method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
bf15be3c-7a0d-4b7b-90c0-f8210def05bf
5
public void process( String message ) { Scanner s = new Scanner( message ); s.useDelimiter( MessagesReceived.DELIMITER ); String command = s.next(); if ( this.m_isLoggedIn ) { if ( command.equals( MessagesReceived.CREATE_ROOM ) ) { String roomName = s.next(); int numPlayers = s.nextInt(); ...
726e5fe4-7dc9-4084-95d8-7d70cff8ed19
6
public static void main(String[] args) throws IOException { Scanner in = new Scanner(System.in); StringBuilder out = new StringBuilder(); while (in.hasNext()) { n = in.nextInt(); x = in.nextInt(); t = in.nextInt(); k = in.nextInt(); if (n + x + t + k == 0) break; n++; // Me f = new int[k]...
4ba47ac8-f9cd-40f6-860d-ff744815da02
4
public boolean isInBounds(int col, int row) { if (row < 0 || row >= rows) { return false; } if (col < 0 || col >= cols) { return false; } return true; }
2c91b8f6-77e6-4199-a41c-e9fd686e1dbf
1
public BigDecimal evaluate(BigDecimal first, BigDecimal second) throws BinaryOperatorException{ if (BigDecimal.ZERO.compareTo(first) == 0) { throw new BinaryOperatorException("Division by zero."); } return second.divide(first); }
04540e40-f87e-4c16-99b6-9fb04bc6ec05
1
public double readDouble(String tag){ double d = 0; if(!data.containsKey(tag)){ System.out.println("The tag "+ tag + " did not exist."); return d; } d = (Double)data.get(tag); return d; }
d2db4167-cdca-4d99-96f8-dccbedc99eac
5
private void disconnect() { try { if (_statement != null && !_statement.isClosed()) _statement.close(); if (_connection != null && !_connection.isClosed()) _connection.close(); } catch (SQLException e) { _logger.fatal(e.getMessage(), e); e.printStackTrace(); } }
61a2328e-bfd6-4b95-bfc0-bb15416fb571
1
public void startMove() { PhysicsComponent ownPC = (PhysicsComponent)getOwningActor().getComponent("PhysicsComponent"); if(ownPC != null) { moving = true; ownPC.setTarget(targetX, targetY); } }
baee8c92-31ff-4e53-b8d1-2cb6cd88fa46
3
public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); String result=""; String temp=""; String str=sc.nextLine(); int i=0; int flag=0; while(i<str.length()){ if(str.charAt(i) != ' ') temp+=str.charAt(i); else { if(flag =...
c8cca300-f6cf-4abc-b215-090e3e3c39d1
3
@Override public void writeObject(Product obj) throws IOException { if(!connectionOutStatus) { startOutputConnection(); } if(connectionOutStatus){ try{ os.writeObject(obj); System.out.println("Das Produkt mit dem Namen : " + obj.getName() + " wurde gespeichert!"); } catch (IOException e)...
329a4b71-302d-489a-b90e-befcd7c07546
3
private JSONWriter end(char mode, char c) throws JSONException { if (this.mode != mode) { throw new JSONException(mode == 'a' ? "Misplaced endArray." : "Misplaced endObject."); } this.pop(mode); try { this.writer.write(c); }...
194e3df1-6c86-4bda-87dc-e560d2b9ec67
8
public static void answerTicket(Player player) { removeTicket(player); filterTickets(); if (tickets.isEmpty()) { player.getPackets().sendGameMessage("There are no tickets open, congratulations! KEEP IT UP OR APACHE AH64 WILL KILL YOU."); return; } else if (player.getTemporaryAttributtes().get("ticketTarge...
28b206e9-440c-4756-ba36-dd12f70b14b4
3
public BarGraph() { super("Tick Graph"); setSize(250, 300); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent paramWindowEvent) { BarGraph.this.setVisible(false); BarGraph.this.dispose(); } }); this.active = false; if (GameApplet.thisApplet != null) thi...
d72a497c-37dd-455f-87e9-d4a84df13821
8
@FXML private void acceptOffer(ActionEvent event) { if (offersList.getSelectionModel().getSelectedIndex() >= 0) { Offer offer = HockmanMain.currManagedTeam.getTransfer() .getSellNegOffer( offersList.getSelectionModel().getSelectedIndex()); if (!offer.isImmediately() && offer.getPlayer().getFee...
bbef4489-23e1-4cb4-abdc-4cd732e6e50f
3
@Override public void navigate(NavigationEvent event) { String command = event.getDestination(); if(command == "Novo"){ formState = FormState.CREATING; abrirFormulario(null); } else if(command == "Editar"){ formState = FormState.UPDATING; ...
0c5c91d3-9cd4-45d6-9e6a-0fd4df691ddc
0
@Test public void testGetCellSymbol() throws IOException { System.out.println("getCellSymbol"); Cell instance = new Cell(0,0); String expResult = "."; String result = instance.getCellSymbol(); assertEquals(expResult, result); expResult = "#"; ...
bf3ec69a-3b66-481b-9be4-1d507c321f85
3
public List<NetworkAddressMessage> getNodes(long[] streams) { List<Map<NetworkAddressMessage, NetworkAddressMessage>> nodeLists = new ArrayList<>(); int size = 0; for (long stream : streams) { Map<NetworkAddressMessage, NetworkAddressMessage> s = knownNodes.get(stream); if (s != null) { nodeLists.add(...
ea7e0418-ad4b-4d15-bf8f-aa40c8faec03
2
public void test_set_RP_int_intarray_String_Locale() { OffsetDateTimeField field = new MockOffsetDateTimeField(); int[] values = new int[] {10, 20, 30, 40}; int[] expected = new int[] {10, 20, 30, 40}; int[] result = field.set(new TimeOfDay(), 2, values, "30", null); assertEquals...
a1a53a57-8192-41e7-8848-5c22a319aef8
5
protected Person findPerson(String xref) { xref = xref.substring(1, xref.length() - 1); if (isDebugging()) System.out.print(">>> Looking for person " + xref + " ... "); Person person = (Person)getObjectByXref(xref); if (person != null && isDebugging()) System.out.println("found " + person); if...
1957260f-b049-45c3-92b2-409446edf6da
5
public void configure(Configuration conf) throws ConfigurationException { server = conf.getProperty("broadcastTCPClientInputConnector.server"); if(server == null) throw new ConfigurationException("broadcastTCPClientInputConnector.server not specified"); String portString = conf.getProperty("broadcastTCPClientI...
332e24d5-8ca2-45ca-9c20-ad6c4bb18bd7
6
private void run() { isRunning = true; int frames = 0; long frameCounter = 0; game.init(); double lastTime = Time.getTime(); double unprocessedTime = 0; HierarchyFrame.updateHeirarchyTree(game.getRootObject()); while(isRunning) { Window.update(renderingEngine); boolean render = f...
411721e6-60ff-410e-a651-23a6243232be
1
private void buildHeap(int index) {// using postOrder if (index + 1 > size) return; buildHeap(2 * index + 1); buildHeap(2 * index + 2); trickleDown(index); }
dfb075a4-85e3-48f1-a068-a689803c5eb6
9
private ArrayList<String> execDispatcher( String serverUrl, String type, String param, boolean isMulti, String siteNo ) { String reqUrl = ""; int site = 0; if ( isMulti ) { reqUrl = serverUrl + MULTI_DISPATCHER_NAME; } else { reqUrl = serverUrl + "jsp/" + DISPATCHER_NAME; site = Int...
a23b4fd5-81cd-4d7a-8b3e-baccefb346e7
5
public static void sortCards(CardArray cards) { CardArray DCards = new CardArray(); // diamond cards CardArray HCards = new CardArray(); // heart cards CardArray SCards = new CardArray(); // ... CardArray CCards = new CardArray(); for (Card i : cards) { switch (i.suit()) { case DIAMONDS: DCards.add...
81a1e0ba-1186-47d2-a801-135080a3f66b
9
public void addContexts(Object o) throws IllegalArgumentException { for (Class<?> c = o.getClass(); c != null; c = c.getSuperclass()) { // add to contexts those with @Context annotation for (Method m : c.getDeclaredMethods()) { Context context = m.getAn...
6d7c6f35-9a50-48a9-bbb9-7ab832e172c4
4
private static boolean parsAndSetNewPoll(Polls poll, Request request) { boolean retVal = false; Map<String, String> reqParams = request.getParams(); try { poll.setCreator(getMailFromCookie(request)); poll.setSubject(reqParams.get("subject")); poll.setData(reqParams.get("content")); poll.setDue_dateDa...
d29793b5-173f-4e9d-9076-14a4b49fa0cf
5
@Override public void render(Graphics g) { g.setColor(new Color(0, 0, 0, 128)); g.fillRect(0, 0, this.width, this.height); g.setColor(new Color(198, 23, 35)); g.setFont(new Font("SansSerif", Font.BOLD, 50)); RenderingHelper.drawCenteredString(g, this.width/2, this.height/2 - 100, "Present Delivery"); g....
d09f895a-c3ea-4da4-825f-51c4c5181e47
9
@Override public void update(GameContainer gc, int delta) { // Blockage checking is redundant here because of the AI. Remove it for optimization pos = gameObject.getPos(); Mob mob = (Mob) gameObject; switch(gameObject.getMoveDir()){ case MOVE_UP: if(!gameObject.isBlocked(pos.x, pos.y-delta*speed)){ po...
b7b2c084-8ff9-4f24-bbdd-008901c8c7a3
4
public int[] getCelulasOcupadas(){ if (rotacao == 0){ for(int i = 0; i<nCasas; i++){ celulasOcupadas[i] = JI + i; } } if (rotacao == 1){ for(int i = 0; i<nCasas; i++){ celulasOcupadas[i] = JI + (i*10); } } return celulasOcupadas; }
19e23dd8-23f4-4080-858c-e9ecced33a47
4
public ImagesIterator(File dir) throws IOException { if (!dir.isDirectory()) { throw new IOException(dir + " is not a directory!"); } String[] imageFilenames = dir.list(new FilenameFilter() { @Override public boolean accept(File dir, String name) { if (name.length() > 4) { String fileExtensio...
cb981fd6-c686-49bd-b44e-ad74f68cf7c3
2
public void create(){ if (name != null || name != ""){ update(Database.CREATE_TASK); } }
27b6b64d-b335-41a8-bfdc-7f0cb5cafe0a
9
public void setUserinfo(String p_userinfo) throws MalformedURIException { if (p_userinfo == null) { m_userinfo = null; } else { if (m_host == null) { throw new MalformedURIException( "Userinfo cannot be set when host is null!"); } // userinfo can c...
b01d19f9-cf68-4f03-a54e-591ab3364095
3
public void put(NodeSub nodeSub, long l) { try { if (spaceLeft == 0) { NodeSub nodeSub_1 = queue.popTail(); nodeSub_1.remove(); nodeSub_1.clear(); if (nodeSub_1 == emptyNodeSub) { NodeSub nodeSub_2 = queue.popTail(); nodeSub_2.remove(); nodeSub_2.clear(); } } else { spaceL...
d05e0ebd-c847-4686-ab45-ce069f49d1c1
0
public void setPacketDelay(long millis) { _packetDelay = millis; }
2a97964c-0ae2-498a-99e7-44b6c65120a4
0
@Override protected int getPower() { return 190; }
250a8b59-c7f9-4627-a5db-98e16b472cf3
9
@Override public void keyReleased(KeyEvent e) { fireCannons(); int keyCode = e.getKeyCode(); message = "Released " + KeyEvent.getKeyText(keyCode); if(keyCode == KeyEvent.VK_UP || keyCode == KeyEvent.VK_W){ spaceShip.setVelocityY(0.00F); } if(keyCode == KeyEvent.VK_DOWN || keyCode == KeyEv...
7c42f1e7-c48b-42eb-94b4-d3be6a583b24
4
private boolean setControls(Controls controls) { boolean test = false; if (test || m_test) { System.out.println("GameWindow :: setControls() BEGIN"); } m_controlsControl = controls; if (test || m_test) { System.out.println("GameWindow :: setControls() END"); } return tr...
9ac967f9-ebb6-443b-a948-12f20babbc7c
5
public static void main(final String[] args) throws Exception { String[] colNames = null; OrderBy orderby = null; // delimited by a comma // text qualified by double quotes // ignore first record final Parser pzparser = DefaultParserFactory.getInstance().newDelimitedPars...
3647cb0c-640e-4f96-b43c-86963fa709db
5
protected boolean validaCampos(){ boolean valida = true; if( txtCpf.getText().isEmpty() || txtDataNascimento.getText().isEmpty() || txtNome.getText().isEmpty() || txtUsuario.getText().isEmpty() && !txtSenha.getText().equals(txtSenhaNovamente.getText())){ ...
140bb49d-c5a2-41fa-838f-6d06dd63b113
0
public void setProblem(Problem problem) { this.problem = problem; }
28bd76e1-d6bc-4193-9271-da13a64a013b
6
@EventHandler public void EndermanJump(EntityDamageByEntityEvent event) { Entity e = event.getEntity(); Entity damager = event.getDamager(); String world = e.getWorld().getName(); boolean dodged = false; Random random = new Random(); double randomChance = plugin.getEndermanConfig().getDouble("Enderman.Jump...
09ff8935-5e5b-4b86-bb0d-7228075913a5
2
public static List<Laureate> filterByAfiliation(List<Laureate> inputList, List<String> ListOfTerms) { List<Laureate> outputList = new ArrayList<Laureate>(); // parse input, keep what matchs the terms. for (Laureate Awinner : inputList) { if (ListOfTerms.contains(Awinner.getAfiliatio...
dec59867-986a-4a76-abf6-e8a557e940c6
4
String getHandlePackageResult(final AndroidDevice aDevice, SubType subType, String fileName) { switch (subType) { case INSTALL: try { aDevice.getDevice().installPackage(fileName, true); } catch (InstallException e) { e.printStackTrace(); return "Install failed:" + e.getLocalizedMessage(); ...
6394980a-7f3a-4bc8-88d8-87cd9e725240
5
private final boolean fixFile(final File file, final String fileUrl, final FileType type, final FixMode mode) throws IOException { LogUtils.log(Level.INFO, LauncherConstants.GAME_TASKS_PREFIX + mode.name + " " + type.name + " : " + file.getPath() + "."); if(Skyolauncher.isOnline) { LogUtils.log(Level.INFO, Launc...
321bc772-57a4-43e7-8b8e-822d83f7186f
4
@Override public void mousePressed(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1 && currentTool == Tool.LINE) { x1 = e.getX(); y1 = e.getY(); } else if (e.getButton() == MouseEvent.BUTTON2) { window.removeSprites(); ...
0a451501-3736-4fa7-8e9b-39c5800f6bf2
9
private void extractNamespacesFromNode(Node node) { if (node.getParentNode() == null) { node = node.getFirstChild(); } NamedNodeMap attrs = node.getAttributes(); for (int i = 0; i < attrs.getLength(); i++) { Node attr = attrs.item(i); String name = attr.getNodeName(); if (isDefaultNS(name) && defa...
37bf9793-d526-4508-8097-236674154f2d
1
@Override public Boolean compareAnswer(Object input) { if (!(input instanceof Boolean)) return false; return (Boolean)input.equals(answer); }
c6998065-7d90-4842-a908-ee4948615cfb
2
public int read(CharBuffer cb) { if (count-- == 0) return -1; // Indicates end of input cb.append(capitals[rand.nextInt(capitals.length)]); for (int i = 0; i < 4; i++) { cb.append(vowels[rand.nextInt(vowels.length)]); cb.append(lowers[rand.nextInt(lowers.length)]); } cb.append(" "); return 10; // N...
523b04e3-c4c6-4be4-b3e1-61b3c0e6f374
7
private CellSet seedFillOld(Cell seed, char newChar){ CellSet cellsFilled = new CellSet(); char oldChar = get(seed); if(oldChar == newChar) return cellsFilled; if(isOutOfBounds(seed)) return cellsFilled; Stack<Cell> stack = new Stack<Cell>(); stack.push(seed); while(!stack.isEmpty()){ Cell cell...
237fc157-9f56-498d-a08d-d047924e298d
1
public static synchronized ReaderFactory getInstance() { if (instance == null) { instance = new ReaderFactory(); } return instance; }
75fe92c2-1273-4c6b-89a3-7658df25b5bd
7
private void storeReport(HttpRequest request, String uri) { logger.fine("Storing report"); File reportDir = configuration.getReportDir(); if (uri.length() > JSCOVERAGE_STORE.length()) { reportDir = new File(reportDir, uri.substring(JSCOVERAGE_STORE.length())); } try {...
c77cef23-0fc0-4bca-8ca3-7bebe199bfc8
0
public StringArray(int kit, int length, int chars){ this.kitSize = kit; this.length = length; this.chars = chars; createStructure(); }
6d2551e9-8fcb-46c7-945a-9f1cb4f53e0c
7
public MediaWiki undoRevision(final MediaWiki.EditToken editToken, final long revisionID, final String editSummary, final boolean bot, final Boolean minor) throws IOException, MediaWiki.MediaWikiException { final Map<String, String> getParams = paramValuesToMap("action", "edit", "format", "xml"); final Map<String, ...
0c49ff78-78d3-4b99-ac2e-e9b384a40f6d
6
public void update() { sort(); for (Point point : points) addNeighbors(point); for (int i = 0; i < points.size(); i++) { int neighbors = countAndRemove(points.get(i)); if (neighbors < 2 || neighbors > 3) points.remove(i--); } while (nextGeneration.size() > 0) { Point point = nextGenerati...
441069d2-bbc2-44ef-88c0-24eb1132024e
8
protected boolean isProperty(String device, String property) { if (this.device.equals(device)) { if ( (property == null) && (this.property == null) ) { return true; } if ( (property == null) && (this.property != null) ) { return false; } if ( (property != null) && (this...
78def7ed-3b6c-4101-893c-d72f216d3233
1
public void checkFlyweight() { int i = 0; System.out.println(this + ".checkFlyweight()"); Iterator<Map.Entry<String, Flyweight>> iterator = flies.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry<String, Flyweight> e = iterator.next(); System.out.println("item " + (++i) + " : " + e.getKey()); ...
1b4d38f5-8dec-44c0-80b5-aa36c78a2bb6
6
public void Recount() { if (root.numOfElements == 0) { root = null; return; } BTreeNode p = null; BTreeNode pp = null; stack.push(root); while (!stack.empty()) { p = stack.pop(); if (p != null) { if (p == root) { p.setPoint(rootX, rootY); } for (int i = 0; i <= p.numOfElement...
011b3630-7360-43ea-afaa-90d0f3a67cfe
3
public void exit() { if (isChanged) { int s = Tools.showExitDialog(); if (s == JOptionPane.YES_OPTION) { save(); System.exit(0); } if (s == JOptionPane.NO_OPTION) System.exit(0); } else System.exit(0); }
2cc7e0d0-013e-4809-87c7-7ea2d18cd7e6
6
private static boolean IsPrime(long number, List<Long> primes) { if (number < primes.get(primes.size() - 1)) { return 0 <= Collections.binarySearch(primes, number); } else { for (int i = 0; i < primes.size(); i++) { long prime = primes.get(i); if (...
36f4945c-1e69-4c58-aeb5-a5d138f42177
3
public static void main(String[] args) { Scanner scan = new Scanner(System.in); StringBuilder sb = new StringBuilder(); int f = 0; d: do { int times = scan.nextInt(); for (int i = 0; i < times; i++) { int n = scan.nextInt(); sb.append(((f++!=0)?"\n":"")+proc(n)); } } while (scan.hasNext()); ...
d58f15d8-4396-485b-85ce-e7b2c97c690b
2
public void exit(Car car){ if(parkingLotsBelongingToColor.containsKey(car.getColor())==false){ System.out.println("Car with the color doesnt exist"); return; } if(parkingLotHashMap.containsKey(car.getRegistrationNumber())==false){ System.out.println("Car with ...
cb574234-ad25-42f9-b4eb-6df4239d863a
8
public void writeConnection(Connect connect) { writer.println(); if ((null == connect.getFromName() && null == connect.getToName()) || ("".equals(connect.getToName()) && "".equals(connect.getFromName()))) { writer.write(String.format(Clauses.connectShort, connect.getFrom...
e1bb6fb3-ba2a-4eb1-9b7a-992e88e8a76e
8
public void stratify(int numFolds) { if (numFolds <= 1) { throw new IllegalArgumentException("Number of folds must be greater than 1"); } if (m_ClassIndex < 0) { throw new UnassignedClassException("Class index is negative (not set)!"); } if (classAttribut...
7c0eaf9c-2744-450f-a6b4-454b4dc54623
1
@Override public InputSource resolveEntity (String publicId, String systemId) { Object[] params = new Object[2]; params[0] = publicId; params[1] = systemId; logger.entering(loggerName, "resolveEntity", params); try { InputStreamReader r...
c9b96429-5b98-4a04-96fc-dad256d0cf48
6
public void set(String name, Object value) { try { Scanner scan = new Scanner(this); File temp = new File("temp"); PrintWriter pw = new PrintWriter("temp"); boolean used = false; while(scan.hasNextLine()) { String line = scan.nextLine()...
2a7c63ed-98ee-4341-8d53-7e700d300d87
3
public static Passable<?> readObject(byte[] tmpBytes) throws IOException, ClassNotFoundException { Passable<?> ret; ByteArrayInputStream bis = new ByteArrayInputStream(tmpBytes); ObjectInput in; in = new ObjectInputStream(bis); ret = (Passable<?>) in.readObject(); bis.close(); in.close(); return r...
f07de261-ad4e-44d4-8aee-66894b4d399c
3
private static boolean uploadData(AirNowData airDat){ String[][] data = airDat.getJSON(); for (int i = 0; i < data[0].length; i++){ System.out.println("Uploading " + (i + 1) + " of " + data[0].length); int count = 0; while (!uploadDataSource(data[0][i],data[1][i],data[2][i],data[3][i],data[4][i])){ Sys...
3c5f4aa0-5d75-4cd9-9eb7-5ace6963b94a
2
public long getLong(int index) throws JSONException { Object object = get(index); try { return object instanceof Number ? ((Number)object).longValue() : Long.parseLong((String)object); } catch (Exception e) { throw new JSONException("JSONAr...
e5dd44f0-1530-48fb-8b08-812d34facdff
2
@Test public void testProtectionEntryMaintenanceOnChangePropertyToSubclass() throws Exception { // Move property from one superclass to subclass. PersistenceManager pm = new PersistenceManager(driver, database, login, password); // drop all tables pm.dropTable(Object.class); // create two OriginalObjects to...
0c5e9a29-c13d-4104-954d-d32debf4e7f1
2
public void loadGameConfiguration(String fname) { ConfigLoader loader = new JAXBConfigLoader(fname); GameConfiguration conf = loader.load(); long dly = 100; if (conf != null) { if (sim != null) { dly = sim.getDelay(); sim.stopSimulation(); } sim = new Simulation(new WorldDescriptor(conf), dly);...
2a7d14c1-3614-4a42-bc34-1a7d6a40f13e
5
private final void method682(boolean bool) { if (aClass118Array5621 != null) { Class101_Sub3 class101_sub3 = ((OpenGlToolkit) aHa_Sub2_5598).aClass101_Sub3_7729; aHa_Sub2_5598.method3788(-18516); aHa_Sub2_5598.C(!aBoolean5595); aHa_Sub2_5598.method3728(false, 35); aHa_Sub2_5598.method3794(((...
1a7904b1-ca62-491c-aa93-a08778f3d9a9
4
public static LookAndFeelInfo searchLnf(String name) { if (name == null || name.length() == 0) { return LNF_DEFAULT; } for (LookAndFeelInfo lnf : LNFS) { if (lnf.getName().equals(name)) { return lnf; } } return LNF_DEFAULT; }
358a848d-45d4-46ec-9e96-54562a289e74
3
public void setCaractere(TCaractere node) { if(this._caractere_ != null) { this._caractere_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.par...
37c59baf-8098-4b7a-85a9-82cc69e217be
9
private void decodeHeader(BufferedReader in, Properties pre, Properties parms, Properties header) throws InterruptedException { try { // Read the request line String inLine = in.readLine(); if (inLine == null) return; Strin...
0d8d246a-a879-4ef4-9d76-6fbabb91f295
5
public static double[] doLinearRegressionFromTo(int start,int end,double[][] args) //input int start, int end { //input double[1]=array of prices double[] answer = new double[3]; int ...
2facc192-7a2c-4c24-8dee-d4d9bd58d930
6
private String findLastStringAssignment(Stmt stmt, Local local, BiDiInterproceduralCFG<Unit, SootMethod> cfg) { if (stmt instanceof AssignStmt) { AssignStmt assign = (AssignStmt) stmt; if (assign.getLeftOp() == local) { // ok, now find the new value from the right side if (assign.getRightOp() instanceof...
4518000d-224e-49ad-a262-81b649f12d6c
9
private void loop() { while (!Display.isCloseRequested()) { glLoadIdentity(); //Keyboard if (Keyboard.isKeyDown(Keyboard.KEY_S)) { y += .1f; } else if (Keyboard.isKeyDown(Keyboard.KEY_W)) { y -= .1f; } ...
b7a70c5b-12c4-4e36-8d43-6b24b0bf41c2
6
int getForkCount(Piece piece) { int count = 0; Space[] oppSpaceArray = getSpacesWithPiece(piece); Space[][] openSetsLast = getOpenSets(lastSpaceMoved); for (Space oppSpace : oppSpaceArray) { if (oppSpace != lastSpaceMoved) { Space[][] openOppSets = getOpenSets(oppSpace); for (Space[] oppSet : openOpp...
b4264c09-51ef-41f7-99fe-0d30b0683302
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (this.getClass() != obj.getClass()) return false; final RegExReplace other = (RegExReplace) obj; if (this.find == null) { if (other.find != null) return false; } else if (!th...
df52132a-938e-445b-99b3-dc46af36b5b0
3
private void guardarJuego(){ //Juego actual Juego juego = partida.getJuego(); //Lista de todos los juegos ListModel model = listJuegos.getModel(); //si existe juego quiere decir que fue guardado previamente y/o cargado boolean existeJuego = false; //comprobamos qu...
f2424517-4495-4a45-812d-7925826ad407
0
public JButton getjButtonPrevious() { return jButtonPrevious; }
eb5987fb-37ed-4554-8e02-cdee1bb29a0d
9
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final FullVersion other = (FullVersion) obj; if (minecraft == null) { if (other.minecraft != null) { return false;...
de606e65-2c7d-4e00-ae7b-26b9560a9223
6
public void startgame() { if (continued == true) { loadGame(); } else { currentMapNPC = Town1NPCs; storyline = 0; name = "Gold"; alec.setName(name); alec.createTrainerID(); currentX_loc = 3 - 7; currentY_loc ...
3ad91f5d-0bc0-4b00-9bb2-42505a5411dd
5
public static void elseIfConstruction(Item i) { int type = i.getSym(); String workingMethod = GenerateForSpim.getWorkingMehtod(); ObjectInfo oi = new ObjectInfo(); oi.setType(Constants.METHOD); oi.setName("if"+i.getId()); if(i.getSym() != Constants.ELSE) { Scanner.get(); Expression.startExpressio...
4dd1fd0c-8c04-464e-8b2b-cb6afd0d5fe8
1
@Override public void deleteAll(Collection<CacheEntry> entries) throws CacheException { Collection<Object> keys = new HashSet<Object>(); for (CacheEntry entry : entries) { keys.add(entry.getKey()); } cache.removeAll(keys); }
81f82f54-85c1-4226-a2ea-e82511043163
5
public Login() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName() ); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InstantiationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAc...
2ba8bc4b-3ee6-4b22-becb-33a751e7c259
1
public void updateDlInfo() { if (!downloadsTable.getSelectionModel().isSelectionEmpty()) { int id = downloadsTable.convertRowIndexToModel(downloadsTable.getSelectedRow()); Integer gid = (Integer) downloadsTable.getModel().getValueAt(id, 0); Download dl = DownloadManager.getIn...
83974ae7-47d9-4236-9a95-a8c30a7a923c
7
public static void main(String[] args) { int[] coins = {1, 2, 5, 10, 20, 50, 100, 200}; int totalValue = 200; long counter = 0; for(int a = totalValue; a >= 0; a -= 200) for(int b = a; b >= 0; b -= 100) for(int c = b; c >= 0; c -= 50) for(int d = c; d >= 0; d -= 20) for(int e = d; e >= 0; e...
325034cc-6c37-4b80-b619-1cb61a8fa13d
5
public static <GInput, GOutput> Iterator<GOutput> convertedIterator(final Converter<? super GInput, ? extends GOutput> converter, final Iterator<? extends GInput> iterator) throws NullPointerException { if (converter == null) throw new NullPointerException("converter = null"); if (iterator == null) throw new Null...
fc0cd6be-3aef-40b8-b6c4-6e8545b19b05
4
private static char lookChar() { // return next character from input if (buffer == null || pos > buffer.length()) fillBuffer(); if (buffer == null) return EOF; else if (pos == buffer.length()) return '\n'; else return buffer.charAt(pos); }
e2ccee0c-eefa-4798-812b-6e8d8d945fbd
7
@Override public boolean tick(Tickable ticking, int tickID) { if(!super.tick(ticking,tickID)) return false; final MOB mob=(MOB)affected; if(mob==null) return true; if(mob==invoker) return true; if((CMLib.dice().rollPercentage()<25)&&(CMLib.flags().canMove(mob))) { if(CMLib.flags().isEvil(mob)...
85ce503d-cc7c-4e27-ad3d-ec9b4c2d2659
0
public void sayHello() { System.out.println("Hi!"); }
8ec88750-0820-4ac3-af83-e0d2636c5a91
7
public Node<T> findCycleStart() { Node slow = head; Node fast = head; do { if(slow.next!=null) { slow = slow.next; } else { return null; } if(fast.next != null && fast.next.next!=null) { fast =fast.next.next; ...
31a859d1-530b-409a-8628-d86ae512b0fa
3
public SettingsGui() { super(); settings = Settings.getInstance(); URL iconUrl = ClassLoader.getSystemResource(Constants.ICON_FILE); Image icon = new ImageIcon( iconUrl ).getImage(); setIconImage( icon ); languageLabel = new JLabel(settings.getLanguage().getLabel("label_language")); nameLabel = n...
f05b5e3c-af75-47ab-a4ae-40549db38086
1
public static void setFilechooserBasepath(Path path) { if (Files.isDirectory(path, LinkOption.NOFOLLOW_LINKS)) { Settings.filechooserBasepath = path; } else { Settings.filechooserBasepath = path.getParent(); } }
7bfecf15-8717-4b3c-b301-784189615056
7
@Test public void testValue() { System.out.println("value"); for (int i = 0; i < this._values.length; i++) { _equals.testValue(_instance, null, _values[i], false); _equals.testValue(_instance, _values[0], _values[i], false); _equals.testValue(_instance, _v...
3235c900-f889-4ce3-9545-9a51250d7445
9
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; PreuTipusHabitacioId other = (PreuTipusHabitacioId) obj; if (nomTipusHabitacio == null) { if (other.nomTipusHabitacio != null) return false; } else...
dfe027fc-0c9e-423d-9aa3-7c6a7310f64a
1
public static void main(String[] args){ String host; int port; String platform = null; //default name boolean main = false; //'normal'-container host = "localhost"; port = -1; //default-port 1099 Runtime runtime = Runtime.instance(); Profile profile = null; AgentContainer container = null;...
f5e15237-1930-4e68-a4a7-2cec576b8e7e
4
@Override public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException { try { // Retrieving the list of inactive devices from the Feedback service List<Device> inactiveDevices = Push.feedback( Configuration.getCertificateBytes(), Configuration.CERTIFICATE_PASSWORD, ...
a4f1cf7b-6f07-4eff-ac70-c1dff8c85cd6
6
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof Attachment)) return false; Attachment other = (Attachment) obj; if (fileName == null) { if (other.fileName != null) return false; } else if (!fileName.equals(other...
b9cf2861-8201-44c3-89cc-c3866158e870
2
public void setDefaultColor(Color c) { if (c == null) c = Color.black; if (! c.equals(defaultColor)) { defaultColor = c; setBackground(c); forceRedraw(); } }