method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
df93e957-bfe6-4fb5-9cb8-07ec3e4c57b8
0
public boolean isFlying() { return isAlive(); }
7a24206d-c42a-4eba-aa93-490d8d559e10
8
public int[] find_ant(int id, Colour col){ int p[] = new int[2]; if(ant_is_alive(id, col)){ boolean found = false; int x = 0; int y = 0; while(x < world.getRows() && !found){ while(y < world.getColumns() && !found){ p[0] = x; p[1] = y; Cell c = world.getCell(p[0],p[1]); if(c.isAn...
fb09164c-c9be-43d3-918b-5b597039569b
5
public CachedLocations(){ List<EndPoint> north = new ArrayList<>(); List<EndPoint> south = new ArrayList<>(); List<EndPoint> east = new ArrayList<>(); List<EndPoint> west = new ArrayList<>(); for( EndPoint endPoint : endPoints ){ switch( calcPosition( endPoint )){ case WEST: west.add( ...
26f3c9a0-b331-40c5-9827-e857c444e710
8
public void handle(HttpExchange exchange) throws IOException { String requestMethod = exchange.getRequestMethod(); if (!requestMethod.equalsIgnoreCase("GET")) { // GET requests only. return; } // Print the user request header. Headers requestHeaders = exchange.getRequestHeaders(); _logger.debug("Incomin...
173da2ea-dc6c-4b28-89b0-9f10abce0b61
4
public static String getHttp(String url, String body) //getHTTP method called in Main() for Coinbase connections throws InvalidKeyException, NoSuchAlgorithmException, // Error handling ClientProtocolException, IOException { String nonce = String.valueOf(System.currentTimeMillis...
8288644c-3fd8-431c-ae88-ff1a994ff0dc
7
@Override public void actionPerformed(ActionEvent event) { if(event.getSource() == this.environments) { this.methods.removeAllItems(); Environment env = (Environment) this.environments.getSelectedItem(); if(env != null) { for(ServiceMethod method : env.getMethods()) { if(NewQueryDialog.operationPan...
96f586d6-ed6d-441e-86d9-f7d7789f379b
8
private Class getClassImpl(String name) throws UtilEvalError { Class c = null; // Check the cache if (classCache != null) { c = classCache.get(name); if (c != null) return c; } // Unqualified (simple, non-compound) name boolean unqualifiedName = !Name.isCompound(name); // Unqualified name ch...
9956ffd8-760f-4e0b-b1ef-f6a1e0dc017f
6
private static void extractFromZip( String szZipFilePath, String szExtractPath, String szName, ZipFile zf, ZipEntry ze) { if(ze.isDirectory()) return; String szDstName = slash2sep(szName); String szEntryDir; if(szDstName.lastIndexOf(File.separator) != -1) { ...
4ab19403-83ed-4e76-a3fc-cf8187ce939a
8
public static void main(String[] args) throws Exception { HashMap<String, FastaSequence> fastaMap = FastaSequence.getFirstTokenSequenceMap(ConfigReader.getChinaDir() + File.separator + "ncbi" + File.separator + "ncib16.fasta"); BufferedWriter writer= new BufferedWriter(new FileWriter(new File(Config...
04af3b51-4715-4fc5-9455-2d6329491268
0
public void setIdConnection(Long idConnection) { this.idConnection = idConnection; }
9682eb96-38d4-404b-a1b4-f360d13dcd9c
1
@Override public TypeOfValue peek() throws EmptyStackException { if (null == this.firstNode) { throw new EmptyStackException(); } return (TypeOfValue) firstNode.getObject(); }
a6eab2bb-d5c0-44f6-9511-4980b8c15e75
1
public Enumeration<?> getKeys() { return properties.propertyNames(); }
502f65d7-8af0-42f4-9021-ad54376d1d5e
7
private void initCommandBtnFontMenu(Color bg) { this.commandBtnPanel = new JPanel(); this.commandBtnPanel.setBackground(bg); this.commandBtnPanel.setLayout(new VerticalLayout(5, VerticalLayout.LEFT)); String initFontTmp = this.skin.getCommandButtonFont(); int initFontSizeTmp = t...
77ec76c5-84c4-4b91-ad43-d3ea152432f6
0
public void execute() { receiver.turnOn(); }
0eab3f2a-148a-47cc-aeca-7d6a14914891
2
@EventHandler public void onInventoryOpenEvent(InventoryOpenEvent e){ if (e.getInventory().getHolder() instanceof Chest || e.getInventory().getHolder() instanceof DoubleChest){ System.out.println("Opened chest!"); } }
f6beb471-7ae9-4ecb-8312-1bbb8a0a9904
9
*/ private void setSystemObjectKeeping(SystemObject systemObject) { // die Liste der in Bearbeitung befindlichen Objekte wird durchgearbeitet for(ConfigurationArea configurationArea : _editingObjects.keySet()) { for(CheckedObject checkedObject : _editingObjects.get(configurationArea)) { if(checkedObject.get...
26017ac0-3940-42e7-8f80-7ec75014ba17
0
@Override public int hashCode() { return (int) this.user.getId(); }
a7dc453f-8c10-4448-b7da-2b282b28cff3
5
public void visitLookupSwitchInsn(final Label dflt, final int[] keys, final Label[] labels) { buf.setLength(0); for (int i = 0; i < labels.length; ++i) { declareLabel(labels[i]); } declareLabel(dflt); buf.append("mv.visitLookupSwitchInsn("); appendLabel(dflt); buf.append(", new int[] {"); for (in...
8159c6f8-5281-404c-a1be-0875196a43ee
2
public int retrieveScore() { FileHandle file = Gdx.files.local(filePath);//internal does not work String stringa = file.readString(); int score = -1; if(stringa!=null||stringa!=""){ score=Integer.parseInt(stringa); } return score; }
26003dae-1860-4c74-aa65-a4384dcbf6a9
3
public static byte[] gzip(String input) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); GZIPOutputStream gzos = null; try { gzos = new GZIPOutputStream(baos); gzos.write(input.getBytes("UTF-8")); } catch (IOException e) { e.printStackTrace...
0cd1e828-9cc4-4c4a-9f1b-8e2b9a8efec3
0
public String getParagraph() { return paragraph; }
0412ce2e-6aaf-4772-a402-eec871eba6c2
8
private XinWen initXinWen(ResultSet rs) throws SQLException { XinWen xinWen = new XinWen(); xinWen.setId(rs.getString("ID") == null ? "" : rs.getString("ID")); xinWen.setTitle(rs.getString("TITLE") == null ? "" : rs.getString("TITLE")); xinWen.setEntitle(rs.getString("ENTITLE") == null ?...
80716c8c-f325-46ff-af1d-673a0e9bf80c
2
private int getPlacement (final String checkSkill) { for (int i = 0; i < SKILLS.length; i++) { if (SKILLS[i].equalsIgnoreCase(checkSkill)) return i; } return -1; }
a96ed655-93c3-4aea-97a1-5e0921db7296
1
public String patchToString(Path path, Patch patch){ String s = path.toString()+" differs:\n"; for(Delta d : patch.getDeltas()){ s+= StringUtils.trim(d.toString())+"\n"; } return s; }
8678df31-04d2-4fe0-9185-7ae91cc92eb9
9
@Override public void run() { //obtiene el pescator plyr = plugin.getServer().getPlayer(plugin.getConfig().getString("thePescator")); final Calendar cal = new GregorianCalendar(); final int segActual = cal.get(Calendar.SECOND); timeDone = plugin.getConfig().getInt("users.TimePescado." + plyr.getDisplayNam...
15cecc7e-5695-40f7-bdf5-c79016d7d7b6
7
public Map<String, String> handleProbe(String... keys) { Map<String, String> map=new TreeMap<>(); for(String key: keys) { if(key.startsWith("jmx")) { handleJmx(map, key); continue; } if(key.startsWith("reset-stats")) { r...
35a8f476-daf0-4627-bf74-6122024f2841
2
private static IStrategy getUserFixedStrategy(BufferedReader br) { System.out.println("Insert the fix value"); while (true) { try { int value = Integer.parseInt(br.readLine()); return new FixedStrategy(value); } catch (Exception e) { ...
9e3146a6-7041-4bf1-928c-744123b6bae7
5
public void update() { while (!m_shell.isDisposed()) { if (!m_display.readAndDispatch()) { m_display.sleep(); } for (int i = 0; i < m_clients.size(); ++i) { if (!m_shell.isDisposed()) clientLogic(m_clients.get(i)); } if(!m_shell.isDisposed()) serverLogic(m_server); } m_display.di...
f931f307-cf09-45d1-890c-4890ed9c863e
3
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || this.getClass() != o.getClass()) { return false; } Result n = (Result) o; return word.equals(n.word); }
404f5ee1-b1aa-4ced-b87d-65b73df6498c
5
@Override public int analyse(LexicalAnalyser analyser, int beginIndex) throws AnalyseException { String content = analyser.getSentence(); if (!WordTable.isDigit(content.charAt(beginIndex))) { throw new AnalyseException(String.format("Error Undefined String [%c] ", content.charAt(beginIndex))); } for (int in...
c72a671e-3954-414c-9f35-6992abcfdf6a
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Equation other = (Equation) obj; if (a == null) { if (other.a != null) return false; } else if (!a.equals(other.a)) return false; i...
e9cddfb2-04fe-4dbb-b734-9d3aba53688e
9
public String kNearestNeighbour(Datum point, int k) { HashMap<Double,String> vals = new HashMap<Double,String>(); ArrayList<Double> dists = new ArrayList<Double>(); double dist; for (Datum d : data) { dist = point.getDistSquared(d); vals.put(dist, d.name); dists.add(dist); } Double[] sortedD...
d725c137-89db-4438-806a-532e7e60a404
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; SimpleAuthenticationCredentialProvider other = (SimpleAuthenticationCredentialProvider) obj; if (sharedSecret == null) { if (other.sharedSecre...
6ece789d-d715-4f48-879d-530c291edf27
1
@Test(expected = Exception.class) public void NullName() throws Exception { LoginCheck logCh = new LoginCheck(); name = ""; if (kesh.containsKey(name)) { kesh.get(name); } else { boolean result = logCh.validate(name); kesh.put(name, result); ...
b9027d6d-9eda-418c-997b-ccbf754339d0
2
@Override public boolean onCommand(CommandSender sender, org.bukkit.command.Command cmd, String[] args) { if(args.length > 0) return false; if(!Commands.isPlayer(sender)) return false; Player p = (Player) sender; Messenger.tell(p, Msg.GLOBAL_CHAT_ENTERED); PlayerChat.plugin.CustomChat.remove(p.getNa...
fe4f5d35-c99c-4e7e-a22c-8c54645abff2
3
public void normalize() { if (x != 0.0 || y != 0.0 || z != 0.0) { double modulo = modulo(); x /= modulo; y /= modulo; z /= modulo; } }
81b61002-5190-4dca-8427-f1de05f59189
7
@Override public Piece getPieceAt(Location location) { Piece result = null; if (location.equals(redMarshalLocation) && gameStarted && !gameOver) { result = redMarshal; } else if (location.equals(redFlagLocation)) { result = redFlag; } else if (location.equals(blueFlagLocation)) { result = gameOver ? ...
9635fab9-77e6-4369-9883-dcff4db88b73
1
public boolean myTurn(int player) { if (player == currentPlayer) return true; else return false; }
fb63f6c0-fe59-46ad-bebe-8d1bc097cf01
9
private boolean isBinary(final ClientServices client, final String filename, final Map<StringPattern, KeywordSubstitutionOptions> directoryLevelWrappers) throws CommandException { KeywordSubstitutionOptions keywordSubstitutionOptions = getKeywordSubst(); if (keyw...
49f62f5c-e600-487d-a629-130c7f5ffbe1
0
public String getAlgorythmName(){ return algorythmName; }
1da3f936-b10e-4ced-96d7-2bd5e9caf0c9
2
public boolean benutzerLoeschen(String benutzername) { Benutzer benutzer = dbZugriff.getBenutzervonBenutzername(benutzername); if(benutzer != null){ try{ benutzer.loeschen(); return true; } catch(SQLException e){ System.out.println(e); } } return false; }
ea5545c8-da66-42fc-a206-8d94dcf3391e
8
protected <T> List<T> readFromListElement(String tagName, XMLStreamReader in, Class<T> type) throws XMLStreamException { if (!in.getLocalName().equals(tagName)) { throw new XMLStreamException(tagName + " expected, not:" + in.getLocalName()); } final int length = Integer.parse...
ec647bd4-22ee-4dc3-8291-c85257b3bd42
4
protected void createStatment() throws SQLException { if ((stmt == null || stmt.isClosed()) && (conn != null && !conn.isClosed())) { stmt = conn.createStatement(); } }
b84da5fb-d3b3-4343-8581-7aef159b6172
2
public void abrirFactura(String path){ try { if (Desktop.isDesktopSupported()) { Desktop.getDesktop().open(new File(path)); } } catch (IOException ioe) { ioe.printStackTrace(); } }
1485694d-9ea8-46bb-903e-ec282a4b595f
5
public void run(){ //Try to establish write connection with client. try{ output = new PrintWriter(userSocket.getOutputStream(), true); }catch(IOException e){ System.out.println("Error writing to client: " + user.getName() + "(" + user.getIP() + ")."); e.printStackTrace(); } //Try to establish r...
43499750-ee2d-4fbf-86a0-f4b63bc13957
6
private static Node findPredecessor(Node r, Node t) { if (t.left != null) { Node p = t.left; while (p.right != null) { p = p.right; } return p; } else { Node p = r; Node prev = null; while (p != t) { if (p == null) return null; if (p.v < t.v) { prev = p; p = p.right; ...
0fc5dfce-a98d-47fb-9837-cd094e4f77c3
0
public List<LngLatAlt> getExteriorRing() { assertExteriorRing(); return coordinates.get(0); }
67cee893-1dbe-4dce-bcc7-b823d9fc3177
9
public Compass getOctant() { if (isOrigin()) return Compass.CENTER; double angle = rep.arg(); if (angle < OCT1) return Compass.W; if (angle < OCT2) return Compass.SW; if (angle < OCT3) return Compass.S; if (angle < OCT4) return Compass.SE; if (angle < OCT5) return...
dc6d0de8-c6a4-47c7-9862-3b01cc17ba55
0
public List<BranchLeader> findBranchLeadersByEventBranchId(final Long eventBranchId) { return new ArrayList<BranchLeader>(); }
d36f9b64-a338-49f1-9990-70ba44c44338
5
public Event getNextEvent(){ Event a,b; a=this.listCustAr.peek(); b=this.listOrderArrival.peek(); if (a!=null && b!=null) { if (b.getTime()>a.getTime()) return this.listCustAr.remove(); else return this.listOrderArrival.remove(); } else if (b!=null...
eb144f26-d20c-4702-9e8f-c00cf2c37aae
5
public static void main(String args[]) { String s = JOptionPane .showInputDialog("Vilken text vill du ska rulla?"); CharController c = new CharController(s); Array7x7[] characterArray = c.getCharacterArray(); RollingTextViewer theWindow = new RollingTextViewer(); Array7x7[] theBlocks = new Array7x7[4];...
15b1187b-1f6e-4df9-b96a-27e9b4229546
3
public String findDataFile(File[] files) { for (File file : files) { String s = file.getAbsolutePath(); if (s.endsWith(".dat")) { if (s.contains("file_cache")) { return s; } } } return null; }
0b1a1e4b-aec8-4ec9-8100-073a1c48060b
1
private JLabel getJLabel3() { if (jLabel3 == null) { jLabel3 = new JLabel(); jLabel3.setText("CsvName:"); } return jLabel3; }
88645705-4296-4802-a62a-48f82565842f
2
public boolean removeProtocol(String protocolName) { for (int i = 0, limit = protocols.size(); i < limit; i++) { FileProtocol protocol = (FileProtocol) protocols.get(i); if (protocol.getName().equals(protocolName)) { protocols.remove(i); // Also remove it from the list of formats stored in the pref...
69e1812a-9cef-43ed-b88f-a76214a27c08
1
public Sign(float x, float y) { super(""); this.x = x; this.y = y; this.width = 12; this.height = 18; try { texture = TextureLoader.getTexture("PNG", this.getClass() .getResourceAsStream("sign.png")); System.out.println(texture.getImageWidth()); } catch (IOException e) { e.printStackTrace();...
b4c13009-1547-49e1-8edb-974a4fb5dd79
6
public static String getModelId(Class model) { if (model.isAssignableFrom(Model.class)) throw new IllegalArgumentException(EXC_NOTAMODEL); Method[] all = model.getDeclaredMethods(); String id = ""; boolean found = false; for (Method m : all) /*TODO: make conventions ind. */ if (m.isAnnotati...
6536e290-8127-457b-9780-26e3955b1c7c
9
public int maxProfit(int[] prices) { if(prices == null || prices.length <= 1) return 0; int L = prices.length; int [] maxLeft = new int [L+1]; int [] maxRight = new int [L+1]; int curMin = prices[0]; int maxL = -1; for(int i = 0; i < L; ++i){ if(prices[i] - curMin > maxL){ maxL = prices[i] - curMi...
589637c5-d191-4fed-91a2-4975dc5b9431
7
public void run() { RevEnglishCustomerBean bean = (RevEnglishCustomerBean) context.getBean("revEnglishCustomerBean"); bean.writeTemplate(template); LinkedList<String> templates = new LinkedList<String>(); Integer currentPrice = Integer.MAX_VALUE; Date start = new Date(); Template match = bean.waitF...
98d484ab-8101-4d8f-954e-ae1b851349c9
9
public static boolean checkCellInDirection(Board board, int x, int y, DirectionX dirx, DirectionY diry) { boolean finished = false; int count = 0; Counter turn = board.getPosition(x, y); //Iterate check if the cell is connected while((count <= Game.WINCON) && !finished && (x >= Board.MINWIDTH) && (y >= Bo...
f68ed6f9-399f-40b7-9667-3b3abde3b5b7
2
@Override public boolean isCommonSubexpression(Instruction i) { if(i instanceof UnaryInstruction) { UnaryInstruction u = (UnaryInstruction)i; return this.getOpcode() == u.getOpcode() && this.argument.equals(u.argument); } return false; }
4a9eb16d-7269-4730-b9e4-1fff3ac24d9f
4
@Override public OreLookup lookup(String player, Integer time, List<Integer> restrict) { List<Block> blocks = new ArrayList<Block>(); int i = 0; for (int value : restrict){ blocks.add(i,new Block(value, -1)); i++; } OreLookup ore = new OreLookup(player); for (String w : plugin.getConfiguration().getW...
bea356c1-f7f9-40eb-bf84-bc36cdece5a8
0
@Override public PermissionType getType() { return PermissionType.RCON; }
4cfc855a-ac47-4476-b38b-11cc87607e6a
6
public int[] getBestTranslations(int sourceWord, int transCount){ int totalTransCount = translations[sourceWord].length; if(totalTransCount < transCount) transCount = totalTransCount; int[] bestTranslation = new int[transCount]; double[] bestScores = new double[transCount]; for(int i=0; i<transCount; i++){ ...
91ff07b8-7b12-49da-a596-b1d21e848024
7
@Override public final int find(final IAMArray key) throws NullPointerException { if (key == null) throw new NullPointerException("key = null"); int i = this._rangeMask_; if (i != 0) { final IAMArray range = this._rangeOffset_; i = key.hash() & i; for (int l = range._get_(i), r = range._get_(i + ...
3d3e4418-a17d-40da-8eb7-2144019fc038
7
@Override public void run() { try { /* // get login information String username = _in.readLine(); String password = _in.readLine(); String responseMessage; if (validateLogin(username, password)) { responseMessage = "ok"; } else { responseMessage = "nok"; } resp...
62bde0ac-095d-460f-8256-47c2201e90d8
8
private void InfectSurroundingHumans( int rowPosition, int columnPosition ) { int[] infectLeft = CalculateMove( rowPosition, columnPosition, "Left" ); int[] infectRight = CalculateMove( rowPosition, columnPosition, "Right" ); int[] infectUp = CalculateMove( rowPosition, columnPosition, "Up" ); int[] infectDown...
d9987298-dc9f-4433-9e75-211682e7ddf7
0
@Override public void startDocument() throws SAXException { System.out.println("start Document"); }
a9208963-dc36-454b-9d38-efbfcfdc44c9
0
public static boolean validateEvent(){ boolean isValid=false; return isValid; }
5dfbce3e-26a3-4a4d-bc8e-69d5fb5abde5
3
private static void validerSujet(Sujet sujet) throws ChampInvalideException, ChampVideException { if (sujet.getSujet() == null|| sujet.getSujet().isEmpty()) throw new ChampVideException("Le sujet n'a pas de titre"); if (!sujet.getCategorie().peutCreerSujet(sujet.getCreateur())) ...
425aa55e-16fd-4c23-891b-edf0026cec98
1
public void flush() { if (isOpen()) { flushImpl(); } }
2ef36ae2-2293-464e-afcb-243dda22c585
2
public void listPaare(){ for(Paar p : paare){ if(p == null) continue; System.out.println("Paar: " + p.paarnummer + ", Name Herr: "+ p.nameH + ", Name Dame: "+ p.nameD); } }
59a8703e-2658-42d7-8f26-dd0a56d1bef2
5
@Override protected boolean collidingWithWall() { if(!collidable) return false; if(game.getCurrentLevel().isBlockAtPixelCollidable((int)tx+(width/2)-4,(int)ty-(height/4)) && game.getCurrentLevel().isBlockAtPixelCollidable((int)tx+(width/2)-4,(int)ty+(height/4)) ){ return true; } else if(game.getCurrentLev...
f7e0b058-1c5f-496c-af79-e1fadd93ea31
7
public Object invokeConstructor(Reference ref, Object[] params) throws InterpreterException, InvocationTargetException { Constructor c; try { String[] paramTypeSigs = TypeSignature.getParameterTypes(ref .getType()); Class clazz = TypeSignature.getClass(ref.getClazz()); Class[] paramTypes = new Clas...
a7528738-bd9a-4bc4-9450-02f67577af1a
2
public static String toString(Inventory i) { YamlConfiguration configuration = new YamlConfiguration(); configuration.set("Title", i.getTitle()); configuration.set("Size", i.getSize()); for (int a = 0; a < i.getSize(); a++) { ItemStack s = i.getItem(a); if (s != n...
3063a4ae-6ad0-4c0b-9e04-7a833d1f73ad
7
private void setSequence(URL midiSource) { if (sequencer == null) { errorMessage("Unable to update the sequence in method " + "'setSequence', because variable 'sequencer' " + "is null"); return; } if (midiSource == null) { errorMessage("Unable to load Midi file in method 'setSequence'."); r...
092ee06b-2f24-404e-8dcd-aa13a650231d
9
private void readFile(BufferedReader reader) throws IOException{ startTime = System.nanoTime(); textfields.setControlfile("Starting assembly ..."); for ( String line; ( line = reader.readLine() ) != null; ) { textfields.setProgramfile(linecounter + " " + lin...
c534e3c8-3911-4274-ac79-6e65c523924d
6
@Override protected Object doInBackground() throws Exception { socketChannel.register(selector, SelectionKey.OP_CONNECT); while (running) { selector.select(); for (Iterator<SelectionKey> it = selector.selectedKeys().iterator(); it .hasNext();) { SelectionKey key = it.next(); it.remove(); t...
ced84978-9c92-49ff-9ba8-6558f6700973
2
private void checkEarning() { if (cb.isCanCreateMeoMeo()) { pp.addMeoMeo(); cb.setCanCreateMeoMeo(false); } if (cb.isCanUpgradeMeoMeo()) { pp.upgradeMeoMeo(); cb.setCanUpgradeMeoMeo(false); } }
90452a25-b8a5-45f2-8411-64ecb4c0a873
3
@Test public void testRunStartServerSpotStudent()throws Exception{ AccessControlServer server = new AccessControlServer(1931); server.start(); SpotStub spot = new SpotStub("312",1931); spot.start(); sleep(1000); String ans = ""; int x = 0; ...
0570e89b-fa43-402b-bb89-3da370974477
9
public void setBody( final Foil f ) { final StringBuilder sB = new StringBuilder(); final int count = f.size(); final int digits = String.valueOf( count ).length(); sB.append( "<html>" ); sB.append( "<pre>" ); final int eC = f.getErrorCount(); int index = 0; if ( eC > 0 ) { ...
036a4b7b-b7e5-417b-8fa9-6fe7e5afe8a6
2
public String output() { String str = ""; if (data<10) { str+="0"; } if (data<100) { str+= "0"; } str+= "" + data + " data2: " + data2 + " text: " + text; return str; }
1f834a9c-a5a6-4c5a-9cfa-3db109e4468f
1
private void writeFile(byte[] content, String filename) throws IOException { File file = new File(filename); if (!file.exists()) { file.createNewFile(); } FileOutputStream fop = new FileOutputStream(file); fop.write(content); fop.flush(); fop.close(); }
ffbe11a3-4ac7-4623-b213-03010803eeaf
1
@Override public List<Kolegij> fetchAllKolegijList() { List<Kolegij> listaKolegija = new ArrayList<Kolegij>(); for (int i = 0; i < 10; i++) { listaKolegija.add(mock(Kolegij.class)); } return listaKolegija; }
68bce62c-49d3-4efb-83d3-24c145bfa1b8
6
private void doubleRightRotate (Tree degTree) { Tree leftChild = degTree.getLeftChild(), parent = degTree.getParent(), rightGrandson = leftChild.getRightChild(); leftChild.setParent(rightGrandson); leftChild.setRightChild(rightGrandson.getLeftChild()); if (rightGrandson.getLeftChild() != null) ...
0ac925aa-1b69-4b27-82eb-1ae420a48573
3
@Override protected boolean xsend (Msg msg_, int flags_) { if (pipe == null || !pipe.write (msg_)) { ZError.errno(ZError.EAGAIN); return false; } if ((flags_ & ZMQ.ZMQ_SNDMORE) == 0) pipe.flush (); // Detach the original message from the dat...
c0ef28cb-aeef-4e17-84eb-ade6d766126a
9
@Override public void update() { /** Coleta eventos de explosão. */ List<Event> explosionEvents = getEntityManager().getEvents( InAnExplosionEvent.class); /** Verifica se a lista de eventos não está vazia. */ if (explosionEvents != null) { for (Event event : explosionEvents) { InAnExplosionEvent exp...
e0e1d06a-ecac-4e62-8eff-c8f31b9a4d1e
0
public int getYLocation() { return yLocation; }
abf1eac8-1725-4ff1-aeff-eae3431a841c
2
public IdentityDiscGridFactory(Grid grid, FullGridFactory factory) { if (grid == null) throw new IllegalArgumentException("Grid can't be null!"); if (factory == null) throw new IllegalArgumentException("Factory can't be null!"); this.factory = factory; this.grid = grid; }
a20272ba-a3b3-4c85-8ec0-ca922a99f951
9
public void updateAllBoard() { Cell cCell; for (int y = 0; y < ySize; y++) { for (int x = 0; x < xSize; x++) { cCell = curMap.getCell(y, x); if (cCell.containsRock()) { board[x][y] = new Hexagon(this, rock); } else if (cCell.containsBlackAnt()) { board[x][y] = new Hexagon(this, antB); }...
cfe53750-0a0b-4b45-bac4-6c7ed1f3bb26
5
public void run() { String currentIP = TakitDNS.getIP(); String file = TakitDNS.getURL( "http://freedns.afraid.org/api/?action=getdyndns&sha=" + Security.SHA1(username.toLowerCase()+"|"+password) ); if ( file==null ) { return; } String[] entries = file.split("\n"); String[] entry = null; for...
a7e75924-9389-46d8-8bfa-63feb0c708fa
9
public void method468(int i) { super.modelHeight = 0; anInt1650 = 0; anInt1651 = 0; anInt1646 = 0xf423f; anInt1647 = 0xfff0bdc1; anInt1648 = 0xfffe7961; anInt1649 = 0x1869f; for (int j = 0; j < anInt1626; j++) { int k = anIntArray1627[j]; int l = anIntArray1628[j]; int i1 = anIntArray1629[j]; ...
b6608807-9037-47f1-82f2-f3c19beff745
2
protected void showFamilyAsChild() { Person person = personPanel.getPerson(); List<Family> families = person.getFamiliesAsChild(); Family family = null; if (families != null) family = families.get(0); if (family != null) { familyPage.setFamily(family); parent.setSelectedIndex(1); } }
24bd3316-56d6-4867-a4eb-6522b7535d4e
1
public void printListBackwards() { if (previous != null) { System.out.println(this.getData()); previous.printListBackwards(); } else { System.out.println(this.getData()); } }
49ec01a6-1407-4d4a-b988-107131b33c07
3
@Override public void handle(ChannelHandlerContext ctx, FullHttpRequest request) throws Exception { // Cache Validation String ifModifiedSince = request.headers().get(IF_MODIFIED_SINCE); if (ifModifiedSince != null && !ifModifiedSince.isEmpty()) { SimpleDateFormat dateFormatter =...
288ec403-d191-41d6-b1b5-5a76fb0d97c2
5
@Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof Perfil)) { return false; } Perfil other = (Perfil) object; if ((this.idPerfil == null && other.idPerfil != null...
dac1c09e-75e8-4c77-af9a-45d0ac1b36cd
4
public void readXML(XMLStreamReader parser) throws IOException, XMLStreamException { parser.require(XMLStreamReader.START_ELEMENT, null, "matrix"); m = Integer.parseInt(parser.getAttributeValue(null, "rows")); n = Integer.parseInt(parser.getAttributeValue(null, "cols")); A = new double[m][n]; ...
af6db94e-e1a1-4eae-bf05-ad7cf39631c9
0
protected boolean shouldShowStatePopup() { return true; }
0bb8dda5-1a74-4896-b5c0-71ec41281321
3
private AudioChannel getAudioChannel(int objectId) { if (channels.containsKey(objectId)) { return channels.get(objectId); } Iterator<Entry<Integer, AudioChannel>> it = channels.entrySet() .iterator(); while (it.hasNext()) { Entry<Integer, AudioChannel> entry = it.next(); if (entry.getValue().isFr...
6b11c51b-068a-43fd-ab6e-b8cddad9f86c
2
public static String combineSplit(int startIndex, String[] string, String separator) { if (string == null) { return ""; } else { StringBuilder builder = new StringBuilder(); for (int i = startIndex; i < string.length; i++) { builder.append(string[i]); ...
e543da9c-e335-4a0a-81f7-b964ef44e38e
1
void cancelLastCommand() { try { worker.abort(); } catch (Exception ex) { } }