method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
5b2f9712-c89d-461b-8196-28478b945c87
7
public static void refreshListeners() { EventManager evt = getEventManager(); if (evt == null) { System.out.println("Could not add listeners to event manager"); return; } evt.addListener(self); if (Script.paint != null) { evt.addListener(Script.paint); } if (Script.motion != null) { evt.addLis...
4a8aade9-99e6-440e-a5b4-e3a448f0e5a5
7
public InvestmentTableModel(AccountRecord account, String[] columnNames, Class<?>[] columnClasses) { if (account == null) throw new NullPointerException("No account provided"); if (columnNames == null) throw new NullPointerException("No column names provided"); if (column...
e610d454-db8f-487b-9af9-a86c9edb9021
7
@Override public void storeImage(Image image) { ResultSet rs = null; int ID = image.getID(); if (ID > 0) { // update /////////////////////////////////////////////////////////////// // l'immagine già esiste ma non abbiamo dato la possibilità di editarla // ...
93b4d7ff-f3c0-4776-adc3-39c33f8af8ea
9
public BoardUI(Board board, PluginInterface[] plugins) { this.board = board; this.board.addObserver(this); lists_zone = new JPanel(); lists_zone.setLayout(new BoxLayout(lists_zone, BoxLayout.X_AXIS)); lists_zone.setBorder(new EmptyBorder(new Insets(10, 10, 10, 10))); lists_zone.setBackground(new Col...
4dba6ffc-5e24-43ae-8ff7-a4b6296f219f
3
@Override public void mouseClicked(MouseEvent e) { JList liste = (JList)e.getSource(); if (e.getClickCount() == 2) { synchronized(Main.lignes) { final Ligne ligne = Main.lignes.get(liste.getSelectedValue()); System.out.println("DOUBLE CLICK " +ligne.getId()); ...
074b0076-7a4e-4f7e-8f2e-b16685777d09
5
public void fillInGenSet(Collection in, Collection gen) { if (this instanceof LocalVarOperator) { LocalVarOperator varOp = (LocalVarOperator) this; if (varOp.isRead() && in != null) in.add(varOp.getLocalInfo()); if (gen != null) gen.add(varOp.getLocalInfo()); } for (int i = 0; i < subExpressions....
3473f68b-d17e-488a-98d5-70543b99416d
3
public static void showPerson(Person person, String caption) { System.out.print("\n" + caption + ": "); if (person == null) System.out.println(" not known"); else { System.out.println(person.getName().getFullName()); Date birth = person.getBirthDate(); if (birth != null) System.out.println("\tBor...
e17f1d79-b6fb-44e6-a482-0e0f0ea0071c
2
public List<Fleet> EnemyFleets() { List<Fleet> r = new ArrayList<Fleet>(); for (Fleet f : fleets) { if (f.Owner() != 1) { r.add(f); } } return r; }
125f7a0c-ac46-4133-9807-9cef8c9e1d36
9
@Override @SuppressWarnings({ "nls", "boxing" }) protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder enc) { List<?> list = (List<?>) oldInstance; int size = list.size(); for (int i = 0; i < size; i++) { Expression getterExp = ...
597608f1-14fd-4268-a0b1-e59c0d1f1b74
8
public synchronized boolean moveItem(FieldItem item, Position initial, Position finalPosition){ if ((finalPosition.getX() <= this.getXLength()) || (finalPosition.getY() <= this.getYLength())) return false; if ((initial.getX() <= this.getXLength()) || (initial.getY() <= this.getYLength())) return false; ...
5e9dfdaa-221f-4902-9eb7-04cb2748ba64
4
private void sendProcessingError(Throwable t, ServletResponse response) { String stackTrace = getStackTrace(t); if (stackTrace != null && !stackTrace.equals("")) { try { response.setContentType("text/html"); PrintStream ps = new PrintStream(re...
e55973aa-06a9-423f-b66a-3269972e5dd2
8
private void drawRoad(int x0, int y0, int x1, int y1) { boolean xFirst = random.nextBoolean(); if (xFirst) { while (x0 > x1) { data[x0][y0] = 0; level[x0--][y0] = TILE_ROAD; } while (x0 < x1) { ...
7a7b9663-f58b-4a61-b842-cbd98279fb13
5
public void insert(Node n) { Node current = head; boolean flag = false; if (n.getData() < current.getData()) { // case 1: new node becomes head n.setNext(head); head = n; }/* if */else { while (current.getNext() != null && !flag) { if (n.getData() <= current.getNext().getData()) { // case2: //...
0e93f59a-13d0-47c7-b78e-7fcc569c9588
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; EmployeeHistory other = (EmployeeHistory) obj; if (employee == null) { if (other.employee != null) return false; } else if (!employ...
68c283d8-bf2a-41b1-8e43-9933951469bf
2
public void testPropertyCompareToMonth() { YearMonth test1 = new YearMonth(TEST_TIME1); YearMonth test2 = new YearMonth(TEST_TIME2); assertEquals(true, test1.monthOfYear().compareTo(test2) < 0); assertEquals(true, test2.monthOfYear().compareTo(test1) > 0); assertEquals(true, test...
79502247-cbc5-46f0-9150-b98e58a57db2
4
@EventHandler public void onPlayerJoin(final PlayerJoinEvent e) { final Player player = e.getPlayer(); if (Game.started || Lobby.started) { //Teleport player to lobby player.teleport(new Location(Bukkit.getWorld(TIMV.config.getString("Worldname")), TIMV.config.getInt("Spawn.x"), TIMV.config.getInt("Spawn.y")...
2de086ec-f777-4ccb-8cbd-2e0d4b76573b
9
private void startRootElement(final String qName, final Attributes attributes) throws SAXException, ObjectDescriptionException { if (qName.equals(ClassModelTags.INCLUDE_TAG)) { if (this.isInclude) { Log.warn("Ignored nested include tag."); ...
6424dea3-0df2-4629-b836-0a17f8225366
2
public int getNumberOfWords() { int count = 0; for (SentencePart sp : sentence) { if (sp instanceof Word) { count++; } } return count; }
a820f292-69c5-4a4e-9b2b-2072fb996c2c
0
@AfterClass public static void tearDownClass() { }
38548658-5b70-4f71-ac0d-d85c56c2a9e1
1
public float evaluate_float(Object[] dl) throws Throwable { if (Debug.enabled) Debug.println("Wrong evaluateXXXX() method called,"+ " check value of getType()."); return 0.0F; };
cc644c16-50a8-4ea5-8874-9a9b56619c00
7
public boolean isColumnUsedInTheSameQueryWithTable(String tableA, String columnA, String tableB) { for (Query q : queries) { List<String> relations = q.getRelations(); if (relations.size() > 1) { if (relations.contains(tableA) && relations.contains(tableB)) { List<QueryAttribute> projections = q.ge...
618d1293-6848-4960-97cd-2090ea79efc6
9
protected void loadFields(com.sforce.ws.parser.XmlInputStream __in, com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException { super.loadFields(__in, __typeMapper); __in.peekTag(); if (__typeMapper.isElement(__in, CreatedBy__typeInfo)) { ...
b6fbf4ca-82a3-49fd-a648-9a9f428daca4
9
public void initProvider(int port, List<Object> classesServices) { System.out.println("[Provider] : Start server on port " + port); // Create the server WebServer webServer = new WebServer(port); XmlRpcServer xmlRpcServer = webServer.getXmlRpcServer(); // Handle the services class PropertyHandlerMapping p...
67c36552-50ce-4b78-83bd-873c0f552a12
9
public String getNumberDesc() { int n = getNumber(); if (n < 5) return "mało"; if (n < 10) return "kilka"; if (n < 20) return "watacha"; if (n < 50) return "dużo"; if (n < 100) return "horda"; if (n < 250) return "masa"; if (n < 500) return "mrowie"; if (n < 1000) return "rzesza"; if (n < 50000) re...
0b1c6476-9d04-43c6-9b5c-5f364d4bff75
8
final public void showTable() throws ParseException { /*@bgen(jjtree) showTable */ SimpleNode jjtn000 = new SimpleNode(JJTSHOWTABLE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtn000.jjtSetFirstToken(getToken(1)); try { jj_consume_token(SHOW); jj_consume_token(T...
b8194cf2-eca6-430f-9b6e-7f96cd4541f6
5
private void displayWinner(Graphics g) { g.setColor(Color.black); if ((game.getPlayer1Color() == 4) || (game.getPlayer2Color() == 4)) g.setColor(Color.cyan); g.setFont(new Font("Times", Font.BOLD, 75)); if (game.getGameMode() == 1) { if (game.getTurn() == 1) { ...
be250306-d3a8-4038-8dd3-90bf6cdd18eb
4
public void Interface() { int buffersize = 1024; char stdInbuffer[] = new char[buffersize]; // makes reading from keyboard/shell ready BufferedReader stdIn = new BufferedReader(new InputStreamReader( System.in)); // 1. read from keyboard // 2. send to Server // 3. catch server answer // 4....
1df060bb-cde8-4355-8ebd-ee7116b5abb9
8
public void shareDirAccepted(String parentPath, String dirName, String friendName, String mod, String expo) { Map<String, Map<SafeFile, Vector<SafeFile>>> m = user.getFileMap(); Set<SafeFile> safeFiles = m.get(user.getUsername()).keySet(); String dirPath; if (!parentPath.equals("null")) { dirPath = user.g...
b9483de9-fb3e-4b8b-8e00-0b0de00de96b
2
public DefaultComboBoxModel<String> buildSelectCombo() { DefaultComboBoxModel<String> model = new DefaultComboBoxModel<String>(); if(!MapPanel.actors.isEmpty()) { for(int x = 0; x<MapPanel.actors.size(); x++) { model.addElement(MapPanel.actors.get(x).getID()); } } return model; }
8c024bc2-5c4c-4614-916c-b2d736fba4c4
2
public void initRequire(String[] L) { for (int i = 0; i < L.length; i++) { if (!require.containsKey(L[i])) { require.put(L[i], 1); } else require.put(L[i], require.get(L[i]) + 1); } }
93c5ca66-7e19-4fa7-b636-58e4d7edbdf2
4
void jasmin(PrintStream out) { super.jasmin(out); out.print(lvtIndex); if (wideDesc.equals("iinc")) out.print(" " + value); }
38af9d7b-6190-4e45-8cec-3086b6d65dc5
3
private static void isort(String[] a, String[] aux, int l, int h, int d) { // insertion sort for (int i = l; i <= h; i++) for (int j = i; j > l && less(a[j], a[j - 1], d); j--) { // swap a[j - 1], a[j] String temp = a[j - 1]; a[j - 1] = a[j]; a[j] = temp; } }
651fd65c-58e1-4d1a-8f7e-14a7234cc73a
7
private void check_sig(WebauthResponse response) throws WebauthException { try { Certificate cert = keyStore.getCertificate(keyPrefix + response.get("kid")); if (cert == null) { throw new WebauthException("Failed to retrieve a key with " + "alias " + keyPrefix + response.get("kid") + " fro...
a8c3c5f0-d8c4-44d2-9a99-ed244a0bb0c6
8
@Test public void testTransductionEmission() { Source<Boolean> src = new SourceFixe("1"); TransducteurEmission te = new TransducteurEmission(); src.connecter(te); try { src.emettre(); te.emettre(); } catch (InformationNonConforme e) { e.printStackTrace(); } // Verification nb Elements (po...
0d44438a-76db-4e38-a255-0e643a77f249
4
public void standardQuery(String query) { Connection connection = null; Statement statement = null; try { connection = this.open(); statement = connection.createStatement(); statement.executeQuery(query); statement.close(); connection.close(); } catch (SQLException ex) { if (ex.getMessage(...
3628bf1a-7767-44e8-b622-d25ccc12d21a
4
public Point[] get3FrontVectors() { switch (this) { case UP: return new Point[] { new Point(0, -1), new Point(-1, -1), new Point(1, -1) }; case LEFT: return new Point[] { new Point(-1, 0), new Point(-1, 1), new Point(-1, -1) }; case DOWN: return new Point[] { new Point(0, 1), new Point(1, 1),...
2850a271-566b-4e21-850f-39bacff2d54f
8
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SSHCredentials that = (SSHCredentials) o; return !(host != null ? !host.equals(that.host) : that.host != null) && !(pass != null ? !pass...
10a9fbaf-81ae-41d6-9514-0bc14bf10b1d
9
public static <T> T awaitState(final long timeoutMillis, Object compareTo, final T object) { final Matcher matcher = toMatcher(compareTo); final Class<?> matcherType = Primitives.getRealClass(matcher.getType()); return (T) ProxyUtil.newProxy(object.getClass(), new InvocationHandler() { ...
dccbb497-507d-49c8-8626-40c6cd88d787
6
public static void main(String[] args) throws Exception { HashMap<String, HashMap<Long, ContextCount>> outerMap = new HashMap<String, HashMap<Long, ContextCount>>(); List<PairedReads> pairedList = getAllBurkholderiaPairs(); for(int x=0; x < pairedList.size(); x++) { PairedReads pr = pairedList.get(x); ...
729144a0-51c6-4ef0-8038-ca4a2b7ab053
1
public int attackSpecial(Character opponent){ int damage; System.out.println(_name+" calls upon his CS Minions!"); damage = minions(opponent); if ( damage < 0 ) damage = 0; opponent.lowerHP( damage ); return damage;}
29f8a27b-5639-470c-bac8-42b9283018d6
5
protected void fillData() { setLayout(new BorderLayout()); model.clearList(); JPanel vest = new JPanel(); vest.setLayout(new GridBagLayout()); JPanel center = new JPanel(); center.setLayout(new BorderLayout()); GridBagConstraints c = new GridBagConstraints(); ...
d467b5a3-cd6c-4393-9c00-5fccb7023cf8
5
@Override synchronized public void addOrder(final Order order) { Connection conn = null; PreparedStatement stmt = null; try { conn = dataSource.getConnection(); stmt = conn.prepareStatement("INSERT INTO \"ORDER\" (ORDER_DATE,USER_ID) VALUES(?,?)"); ...
ca6227ec-b1e7-47d0-9218-14bf4b695dbe
0
@BeforeClass public void setUp() { MeiyoVisitor.createVisitor( new AbstractVisitorConfiguration() { @Override public void configure() { handleType().annotatedWith( ClassAnnotation.class ).withHandler( new AnnotationHandler<Class, ClassAnnotati...
e6004adf-adaf-4985-89c9-1e9117ad2958
2
private boolean getBoolean(CycSymbol paramName) { Object rawValue = get(paramName); if (rawValue instanceof Boolean) { return (Boolean) rawValue; } else { rawValue = getDefaultInferenceParameterDescriptions().getDefaultInferenceParameters().get(paramName); return (rawValue instanceof Boole...
fdee4765-5433-46f2-80fa-11ff25dfd203
5
*/ public byte[] getFinalDestination() { //return mesh address if available if(sixLoWPANpacket != null && sixLoWPANpacket.isMeshHeader()){ return sixLoWPANpacket.getFinalAddress(); //else look for an existing sixlowpan address } else if(sixLoWPANpacket != null && sixLoWPANpacket.isIphcHeader() && sixLo...
2c63a402-f6d5-4fc5-a671-440edbb2cd6d
6
public static String getResultName(int result) { String value = null; switch (result) { case -2: value = "Pending"; break; case 0: value = "Accepted"; break; case 1: value = "Rejected"; break; case 2: value = "No output"; break; case 3: value = "Compilation error"; break; c...
d9430c86-3810-46d1-b9f4-862287c79318
2
private boolean hasTag(String version) { for (final String string : Updater.NO_UPDATE_TAG) { if (version.contains(string)) { return true; } } return false; }
09e830f1-8bcc-4d21-a723-41e86cdcd6ea
0
public void setManaged(boolean managed) { this.managed = managed; }
1407cadd-f813-43d8-87b8-0468b98a1851
9
private void updateLocalTreesCorrelation(Genealogy genealogy) throws NaturalSetException { HashMap<NaturalSet, NaturalSetCollection> localTreesBiPartitions = genealogy.localTreesBiPartitions(); ArrayList<NaturalSet> frames = new ArrayList<NaturalSet>(localTreesBiPartitions.keySet()); Collections.sort(frames); ...
8ddcb872-6d92-47e3-9887-ee2c03304424
2
private void processMoveFromBoard(MouseEvent e) { int row = findRow(e.getY()); int col = findCol(e.getX()); int index = row * 4 + col; if (index > -1 && index < 12) { activeMove = new CardMoveImpl(index, CardMoveImpl.MOVE_TYPE_FROM.FROM_BOARD); } }
86f15879-f7f3-4b15-9a15-ca0c52a4d961
7
public static boolean hasActions(Node<?> root) { Node<?> node = root; for (;;) { if (node instanceof ActionNode) return true; if (node instanceof UnaryNode) { node = ((UnaryNode) node).sibling; continue; } ...
d8dd2edb-ad3b-43fd-9cf3-831183a4c941
8
@Override public void run(Player interact, Entity on, InteractionType interaction) { if(interaction == InteractionType.RIGHT){ if(type == PotionType.MANA){ if(interact.getFoodLevel() == 20) return; interact.setItemInHand(new ItemStack(ItemType.EMPTY_BOTTLE.getMaterial(), 1)); interact.setFoodLevel(...
f60a687e-7b0d-4629-b0c9-14f1b110007d
3
private void assertNotPrimitiveTargetType(Class<?> sourceType, Class<?> targetType) { if (targetType.isPrimitive()) { throw new IllegalArgumentException("A null value cannot be assigned to primitive type " + targetType.getName()); } }
944352d2-2291-4c80-9628-14d408237fa3
1
@Override public void paint(Graphics g, JComponent c) { Graphics2D g2 = (Graphics2D) g.create(); if (clockwise) { g2.rotate(Math.PI / 2, c.getSize().width / 2, c.getSize().width / 2); } else { g2.rotate(-Math.PI / 2, c.getSize().height / 2, c.getSize().height / 2); } s...
117c4531-4b3c-483b-a1af-94afd4e5e1cd
7
private void initGraph() { Node firstNode = new SimpleNode(0, Node.Types.SIMPLE, defaultResistance); nodes.add(firstNode); for(int i = 1; i < kNearestNeighbors / 2; i++) { Node nextNode = new SimpleNode(i, Node.Types.SIMPLE, defaultResistance); nextNode.addNeighbor(nodes.get(i-1), delaysDistribution.getNex...
b23cb228-73df-430c-8756-5f1e3cd4853f
8
public ArrayList<PuzzleChar> getNeighbours(PuzzleChar pChar) { ArrayList<PuzzleChar> neighbours = new ArrayList<PuzzleChar>(); for(int ri = -1; ri <= 1; ri++) { for (int ci = -1; ci <= 1; ci++) { int nRow = pChar.loc.row + ri; int nCol = pChar.loc.col + ci; if ( nRow < 0 || nRow >= hei...
e7b8e6f2-bb11-421f-8cbe-92c426abfab5
4
public ArrayList<Object[]> getPesonnelData(String client) throws Exception{ ArrayList<String> columnName = getTableColumn("personnel"); ArrayList<Object[]> rowData = new ArrayList<>(); int num = 1; try{ String sql = "Select * FROM `personnel` where assignment = '" + client + "' order by name"; St...
420bf08a-057e-45ad-a10d-a09a1d638d89
3
public void mouseEntered(MouseEvent e) { // if mouse is hovering over top right options... if (e.getSource()==InScreens.getBookHubButton()) { // animate BookHub option system.getContentPane().remove(InScreens.getOptionsUnselected()); system.getContentPane().add(InScreens.getBookHubSelected(),0); system.getCo...
9e4c2a89-b638-4119-96e2-dce5a69990ce
5
public static double[][] toMatrix( double[][] audioVectors ) { int m = audioVectors.length; int n = 0; for ( int i = 0; i < m; ++i ) { int tmp = audioVectors[i].length; if ( tmp > n ) n = tmp; } double[][] audioMatrix = Matrix.newMatrix(m, n); for ( int i = 0; i < m; ++i ) { for ( int j = 0; j < audio...
43739f01-8b59-4416-bfa6-9c60a68b2eb4
3
public void fire(Player player, Environment enviro){ if(canShoot){ canShoot = false; float xPos = -player.getPosition().x(); float yPos = -player.getPosition().y(); float zPos = -player.getPosition().z(); Position posToShootFrom = new Position(xPos, yPos, zPos); Position posToShootTo = Position.scre...
0f75064c-cdc9-41a5-bb4f-8ec046302796
1
public SettingsManager() throws IOException { prefsFile = new File("eu/beatsleigher/beattime/plugin/preferences/cfg"); preferences = new HashMap<>(); if (!prefsFile.exists()) { prefsFile.getParentFile().mkdirs(); prefsFile.createNewFile(); savePrefs()...
b4ae6185-1192-4373-be29-817eb0a0586e
1
public String toString() { return (parent == null) ? "base package" : getFullName(); }
9ea45727-38a2-4286-8c62-b2df0e75296c
5
public static void main(String[] args) throws Exception{ count count = new count(args[0]); ArrayList<File> files = FileFinder.GetAllFiles(count.inputFolder, ".data", true); for(File f : files){ @SuppressWarnings("resource") BufferedReader br = new BufferedReader(new FileReader(f)); String line = n...
68c2e4ee-4ef6-4e9e-889b-fd7ce28f98e1
1
public int getSpeed() { int result = speed + citySpeed; for (Artifact a: active.values()) { result += a.speed; } return result; }
f7f5e4bc-a81a-4154-934e-acf7a76bbac2
9
void fillSquare(PlanarSquare square, int contourIndex, int edgeMask, boolean reverseWinding) { int vPt = 0; boolean flip = reverseWinding; int nIntersect = 0; boolean newIntersect; for (int i = 0; i < 4; i++) { newIntersect = false; if ((edgeMask & (1 << i)) != 0) { triangleVertexList[vPt++] = squar...
f9f32f5e-b983-4a24-9160-5a7f200646d0
1
public String testStatus(String appKey, String userKey, String testId, boolean detailed) { try { appKey = URLEncoder.encode(appKey, "UTF-8"); userKey = URLEncoder.encode(userKey, "UTF-8"); testId = URLEncoder.encode(testId, "UTF-8"); } catch (UnsupportedEncodingExcep...
de4f2c3e-05fc-44ae-96bb-cfdec0aabc89
1
private void loadCourse(Course course) { // Clear scorecard clearScorecard(); // Add par values to scorecard for (int holeNumber = 0; holeNumber < course.getNumberOfHoles(); holeNumber++) { Hole hole = course.getHole(holeNumber + 1); // +1 to match human # tblScor...
23e0cdee-9a9c-43d0-836d-54a414e18098
9
public <T extends Object> T construct(NitDesc nitDesc) throws NitException { NitAgent agent = agents.get(nitDesc.spec); if (agent == null){ if (nitDesc.spec == NitDesc.NitSpec.GROOVY_CLASS_LOADER){ agent = new GroovyClasspathAgent(); } else if (nitDesc.spec == NitDesc.NitSpec.JAVASCRIPT_CLOS...
56b90346-7837-488b-9d95-8f8f30564270
8
private static long applyQueryDeletes(Iterable<QueryAndLimit> queriesIter, SegmentState segState) throws IOException { long delCount = 0; final LeafReaderContext readerContext = segState.reader.getContext(); for (QueryAndLimit ent : queriesIter) { Query query = ent.query; int limit = ent.limit; ...
ebdcb33b-6c93-48a5-9241-ab8cbb1f576f
0
public AnswerCombination(List<Token<AnswerColors>> tokens) { super(tokens); // TODO Auto-generated constructor stub }
680dbea5-d3b8-4c9a-8c04-91a5db9870b2
5
public Map<InetAddress, GatewayDevice> discover() throws SocketException, UnknownHostException, IOException, SAXException, ParserConfigurationException { Collection<InetAddress> ips = getLocalInetAddresses(true, false, false); for (int i = 0; i < searchTypes.length; i++) { String searchMe...
01717570-2b8d-42ba-a2e8-b5a44aee997a
8
private ScenarioGUIStep getScenarioGUIStepFromTreeStep(ScenarioTreeStep currentStep) { // Gibt das passende GUI Schritt Objekt zurück zum Szenarioschrittobjekt // und fügt das Szenarioschrittobjekt dem GUI Schritt Objekt per Konstruktor hinzu if(currentStep instanceof ScenarioTreeStepBeginning){ return ne...
30463981-20d0-49bc-8ee1-fede978aeeb5
0
@Override @RequestMapping(value = "/beers/{id}", method = RequestMethod.GET) @ResponseBody public BeerResponse get(@PathVariable("id") Long id) { Beer beer = persistenceService.read(Beer.class, id); return BeerResponse.createBeerResponse(beer); }
dd703364-0b7d-43c0-afec-e45ba8c97a7d
8
public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line = ""; StringBuilder out = new StringBuilder(); while ((line = in.readLine()) != null && line.length() != 0) { int nSet = Integer.parseInt(line.trim()); for (int...
90fccc08-ecbb-4854-9ebf-73893e8c49ab
8
public void setOptions(String[] options) throws Exception { String args; args = Utils.getOption('C',options); if (args.length() != 0) setClassificationType(new SelectedTag(args, TAGS_CLASSIFICATIONTYPES)); else setClassificationType(new SelectedTag(CT_MEDIAN, TAGS_CLASSIFICATIONTYPES)); ...
88fa2952-884a-4b0f-bc90-cd6c72ccf92a
4
@Override public void run() { options.status = "Laying tracks"; for (GameObject tunnel : ctx.objects.select().id(TUNNEL).nearest().first()) { if (ctx.camera.prepare(tunnel) && tunnel.interact("Lay-tracks", "Tunnel")) { if (Condition.wait(new Callable<Boolean>() { @Override public Boolean call() th...
2acaae44-cb8a-45f4-912f-603978308526
7
public final LatticeIF getImplementation(final LatticeType type) { switch(type) { case SHORT_RATE: { this.implementation = new ShortRateLatticeImpl(); break; } case ZERO_COUPON_BOND: { this.i...
2ce4db95-51ef-4855-9c08-1d4952a7e7b9
1
public int hashCode() { if (cachedHash != 0xdeadbeef) return cachedHash; return cachedHash = buffer.toString().hashCode(); }
20aba325-5afd-4958-8de3-35ad17648db0
1
public void writeToServer(String text){ try{ bw.write(text+"\n"); bw.flush(); }catch(IOException e){ System.out.println("IRC: Failure when trying to write to server: "+e.getMessage()); } }
28d0e6b3-97a4-4a40-a1d2-71fc4f6edb9d
9
public static HumanTime eval(final CharSequence s) { HumanTime out = new HumanTime(0L); int num = 0; int start = 0; int end = 0; State oldState = State.IGNORED; for (char c : new Iterable<Character>() { /** * @see java.lang.Iterable#iterator(...
eb61a09b-f8cc-49b8-9dfe-a2e6ade3020e
8
public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { String a = sc.next(); String b = sc.next(); String c = conv(a); String d = conv(b); int kiri = -1; int kanan = -1; bool...
24a6ded6-7f86-4398-9571-c44068a79db1
1
@Override public void destroy(Object args) { if(this.root != null) this.root.destroy(); }
d530ebaf-e477-49a0-aaef-b7d229d033f7
8
static private double anySubstitutionRatio(int taxon1, int taxon2) { double distance; double sumDistance = 0.0; double sumWeight = 0.0; boolean noGapsPairFound = false; // If both sequences are of zero length then the substitution ratio is zero because they are identical ...
028b5fb1-7985-4aae-9e3c-92f2816c68c7
0
public String getURI() { return uri; }
a21bb638-1a41-4e02-8c24-875c55bc9537
3
private boolean isCanLive(Enum lifeStatus, int aliveAround) { if(lifeStatus == LifeStatus.died){ return aliveAround == 3; } return (aliveAround == 2 || aliveAround == 3) && lifeStatus == LifeStatus.alive; }
5d4353c7-3617-4a61-913b-d2e41aee2b9d
0
int getOurDocsOpen() { return ourDocsOpen; }
432c453c-418d-434b-be26-000e54cfa5e0
0
public void setId(int id) { this.id = id; }
b7e2aa1f-9583-446f-b331-e81dac8e76d8
7
private boolean isReturnExpr(List<String> tokenList) { final int St_START = 1, St_LP_START = 2; Iterator tokenIt = tokenList.iterator(); int currentState = St_START; while (tokenIt.hasNext()) { String nextToken = (String) tokenIt.next(); switch (currentState) { case St_START: if (nextToken.equals...
cac59a27-bdfb-4ea5-87a2-b8d663f79e68
9
@Override protected void writeChildren(XMLStreamWriter out) throws XMLStreamException { super.writeChildren(out); out.writeStartElement("gen"); out.writeAttribute("humidityMin", Integer.toString(humidity[0])); out.writeAttribute("humidityMax", Integer.toString(humidity[1]));...
1d0f2355-642e-4d11-bf6c-26e9de9cd454
9
public List<Key> getAllKeys() { try { Pattern keyIDPattern = Pattern.compile("pub\\s+\\w+/(\\w+)\\s+.*"); Pattern uidPattern = Pattern.compile("uid\\s+(\\S+[^<>]*\\S+)\\s+<([^<>]*)>.*"); List<Key> ret = new LinkedList<>(); List<String> list = new LinkedList<String>(); list.add("--list-keys"); ...
0bcf6a08-8005-4afd-aa51-2d0b5119ba4b
7
public void warn(Event event) { switch(event.getTypeEvent()) { case GOBACKWARD_END : if(state == 0) { state++; } else if(state ==2) { fin = true; } else { ignore(); } break; case CHILDBEHAVIOR_END : if(state == 1) { state++; } else { ignore(); } break; c...
5a61db6d-bfd5-40c4-bcfa-d124a7a48b15
0
public int getHeight() { return height; }
2cdbc0e8-dd82-4fad-b7e4-ea0848bdb070
8
private void step() { for(int x = 0; x < Globals.width; x++){ for(int y = 0; y < Globals.height; y++){ float waterAmmount = 0.0f; for(int[] neighbor : HexagonUtils.neighborTiles(x, y, true)){ //waterAmmount += Globals.water.getGroundWaterLevel(neighbor[0], neighbor[1]); for(NeedsControlled nc : N...
db4cfda9-1861-4aca-a59a-b8eea12954d6
0
public Id3v2PictureFrame(Property prop,PropertyTree parent) { super(prop, parent); }
3169cb23-976a-42cc-ab4a-fec13862059c
1
private <T> void removeAt(T[] array, int index) { if (currentSize == 0) { shiftArrayBy(array, -1); } else { System.arraycopy(array, index + 1, array, index, array.length - index - 1); changeCapacityBy(array, -1); } }
9bb34d82-bc96-4b5a-a2c8-fc92843af83e
6
public String getComment(String path) { Preconditions.checkNotNull(path, "Path cannot be null"); Configuration root = getRoot(); if (root == null) { throw new IllegalStateException("Cannot access section without a root"); } // Return the comment associated to this e...
cd797e1f-ad20-4c9c-9a74-7d6966847282
0
@Override public void error(SAXParseException e) { System.out.println("SAXParserException Error: " + e.getMessage()); this.errorOccurred = true; }
37b9c6de-12f3-47a8-84d6-9e5d0d8d57bd
0
@Test public void testCancelButtonBeforeCalculated() throws Exception { propertyChangeSupport.firePropertyChange(DialogWindowController.PERCENTAGE, 0, 10); view.getButton().getActionListeners()[0].actionPerformed(actionEvent); assertEquals(propertyName, DialogWindowController.CANCEL); ...
c1a9dc5a-95da-4c1c-9814-12063268363d
9
@Override protected CommandExecutionResult executeArg(Map<String, RegexPartialMatch> arg) { final String g1 = arg.get("G1").get(0); final String g2 = arg.get("G2").get(0); // if (getSystem().isGroup(g1) && getSystem().isGroup(g2)) { // return executePackageLink(arg); // } if (getSystem().isGroup(g1) || getS...
5f3e59e8-ae38-4ec9-a68a-0399134d0a24
4
@Override public void setBoolean(long i, boolean value ) { if (ptr != 0) { Utilities.UNSAFE.putByte(ptr + i, value == true ? (byte) 1 : (byte) 0); } else { if (isConstant()) { throw new IllegalAccessError("Constant arrays cannot be modified."); ...