method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
451f56a3-9688-433f-b4ca-0ff7b545ea89
5
public String readText() throws IOException { StringBuilder builder = new StringBuilder(); String marker = getMarker(); if (mType == XMLNodeType.START_TAG) { next(); } do { if (mType == XMLNodeType.TEXT) { if (builder.length() > 0) { builder.append(' '); } builder.append(getText()); ...
cc6931e4-5424-4356-96d3-66b2dc60f605
9
public void lookAt(String object, ArrayList<String> inv) { if (object.equalsIgnoreCase("floor")) { System.out.println("It is a cold and hard stone floor.\n"); } else if (object.equalsIgnoreCase("wall") || object.equalsIgnoreCase("walls")) { System.out.println("The walls are made ...
6038a751-3c93-4b9c-b57c-75fb4e137172
4
private void fixDeadReference(TreeNode referencedNode, TreeNode node) { if (node.leftIsWire && node.leftChild == referencedNode) { node.leftChild = referencedNode.parent; } if (node.rightIsWire && node.rightChild == referencedNode) { node.rightChild = referencedNode.parent; } }
495fccd6-b6c0-4823-99ff-147dfb0941d3
8
public void destroy(String id) throws IllegalOrphanException, NonexistentEntityException, RollbackFailureException, Exception { EntityManager em = null; try { em = getEntityManager(); em.getTransaction().begin(); Area area; try { area = em....
35930904-6172-46a8-9fdd-08efe4a5f392
4
@Override public synchronized Object getNext() { Object obj = super.getNext(); if (fileOpen) { try { while (processLine()) {} if (!fileOpen) {theStream.close();} } catch (IOException ioe) { System.err.println("Could not close FileReader: " + "\n" + ioe); } } return obj; }
a4983ede-a390-4626-8f14-dd27b8c8ea74
2
public void calcThisFATEntOffset(int N) { int FATOffset = 0; if (typeOfFileSystem.equalsIgnoreCase("FAT16")) { FATOffset = N * 2; } else if (typeOfFileSystem.equalsIgnoreCase("FAT32")) { FATOffset = N * 4; } thisFATSecNum = BPB_ReservedSecCnt + (FATOffset ...
e74e403b-b2c6-4bc5-b1de-2a9440d4e787
8
public void checkComment() { // discard obsolete comments while inside methods or fields initializer (see bug 74369) // don't discard if the expression being worked on is an ObjectLiteral (see bug 322412 ) if (!(this.diet && this.dietInt == 0) && this.scanner.commentPtr >= 0 && !(expressionPtr >= 0 && expressionSt...
9076f570-58b8-426c-b2ba-977b786cf93c
8
@Override public int rectIntersection( double x, double y, double w, double h ) { if( x + w <= this.x || x >= this.x + this.w || y + h <= this.y || y >= this.y + this.h ) { return INCLUDES_NONE; } if( x >= this.x && y >= this.y && x + w <= this.x + this.w && y + h <= this.y + this.h ) { return INCLUDES_ALL;...
fe277c06-382b-48d4-94fd-6df6fa33f793
1
public void testGetChronology_Object_Zone() throws Exception { GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("Europe/Paris")); assertEquals(GJChronology.getInstance(MOSCOW), CalendarConverter.INSTANCE.getChronology(cal, MOSCOW)); cal = new GregorianCalendar(TimeZone...
b1764e4f-7ff1-498d-b8b7-fda362b68e8a
6
private Error unpackError() throws MikrotikApiException { nextLine(); Error err = new Error(); if (hasNextLine()) { while (!line.startsWith("!")) { if (line.startsWith(".tag=")) { String parts[] = line.split("=", 2); ...
b2680d4e-86ad-4e73-bcec-fb6db6f96f0a
7
public P039C() { Scanner sc = new Scanner(System.in); N = sc.nextInt(); segments = new Segment[N]; dp = new int[N][N]; r = new boolean[N][N]; prev = new int[N]; for (int[] row: dp) { Arrays.fill(row, -1); } for (int i = 0; i ...
b2a8edf9-b4d0-4bd0-9ab4-bc7184994115
6
private IMessage adapterMessage(IMessage m) { ArrayList<Character> al=new ArrayList<Character>(); for(int i=0;i<m.taille();i++) { if(m.getChar(i)==CARACTERE_INTERDIT) { for(int j=0;j<SUBSTITUTION.length();j++) { al.add(SUBSTITUTION.charAt(j)); } } else { if(m.getChar(i)==Character.toUpperC...
c86caea7-3de5-4724-9ef5-bee4dcd1f63a
9
protected void load() { Scanner in = null; try { in = new Scanner(file); } catch(FileNotFoundException e) { e.printStackTrace(); System.exit(0); } if (vertices == null) { vertices = new ArrayList<Vertex>(); textures = new ArrayList<Texture>(); triangles = new ArrayList<Triangle>(); } while(in.has...
6baea1a1-4803-42ff-9ed9-040fdb59ec16
0
public PersonApplication(Person p) { Area =""; WorkPosition = new ArrayList<String>(); Satisfied = false; Person = p; title=""; Contract=""; namePer=""; MobilePer=""; emailPer=""; companyLab=""; posLab=""; nameLab=""; MobileLab=""; }
88bc061c-f678-46c9-9737-108205e19343
2
public Key delMin() { if (N == 0) throw new RuntimeException("Priority Queue Underflow"); Key min = heap[1]; heap[1] = heap[N]; // half exchange heap[N--] = null; sink(1); // resize if (N == heap.length / 4) heap = resize(heap, heap.length / 2); return min; }
b242234a-1e5b-4136-8246-f2ba3d926f7a
7
public void backupDoc(String indexName) throws Exception{ File file = new File(configService.getBackupDataFilePath(indexName)); JsonFactory jfactory = new JsonFactory(); /*** write to file ***/ JsonGenerator jGenerator = jfactory.createGenerator(file, JsonEncoding.UTF8); long startTime = System.c...
eac68268-4ea8-4de6-af32-7aece536abd9
0
private JButton makeButton(String label, String iconName, ActionListener listener, String tooltip) { ImageIcon icon = new ImageIcon(getClass().getResource( "/ICON/web/" + iconName)); JButton button = new JButton(label, icon); button.addActionListener(listener); button.setToolTipText(tooltip); return bu...
5ef746e6-2623-43e6-b32a-613c3741f49b
9
@Override public boolean process( final Set<? extends TypeElement> annotations, final RoundEnvironment roundEnv) { if (annotations == null || annotations.isEmpty()) { return false; } // we need the actual TypeElement of the annotation, not just it's name ...
1abbeffe-9ac8-4a7c-a66b-99baba4892c0
9
public BValue parseBValue() { Token next = tk.next(); BValue ret; switch(next.getType()) { case Token.TRUE: ret = new Bool(true); break; case Token.FALSE: ret = new Bool(false); break; case Token.VAR: ret = new Variable("v" + Integer.toString(((VarToken) next).getIndex())); case Token.N...
73a3f493-5e4d-49c7-961b-1c372b0d9e5d
1
private boolean jj_2_42(int xla) { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_42(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(41, xla); } }
bc49194b-270b-482b-bb19-fb619a265065
8
public synchronized void move(Entity e, int x, int y){ int id = e.id; int w = e.width; int h = e.height; for(int cx = 0; cx < w; cx++) for(int cy = 0; cy < h; cy++){ int cxex = cx + (int) e.x; int cyey = cy + (int) e.y; int cxx = cx + x; int cyy = cy + y; world[cxex][cyey].remove(id); ...
726ece4e-95e4-4994-8f05-ceedb38dfbd5
0
public List<TravelTrip> findAll(){ CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery<TravelTrip> criteria = cb.createQuery(TravelTrip.class); Root<TravelTrip> travelTrip = criteria.from(TravelTrip.class); criteria.select(travelTrip).orderBy(cb.asc(travelTrip.get("country")));...
5758711d-5f50-4638-9662-0057eee90cca
6
public void saveFile(String filename) { try { List<String> sections_list = new ArrayList<String>(); for (String key : map.keySet()) { String section = key.split("\\.")[0]; if (!sections_list.contains(section)) sections_list.add(section); } ...
7ef294a6-e23d-4a18-8ee4-51c6d39285e3
7
public static GenericNode findeBestWay(GenericNode start) { @SuppressWarnings("Convert2Diamond") HashMap<GenericEdge, GenericNode> log; log = new HashMap<GenericEdge, GenericNode>(); GenericNode res = null, other, current = start; current.setDistance(0); PriorityQueue queue = new PriorityQueue(new ComparatorDista...
812ea75c-cb4b-4f2f-a721-ed23fd1ade8e
2
public int bonusGain(Territoire t) { List<Peuple> lstTmp = t.getPrisesDuTerritoire(Partie.getInstance().getTourEnCours()); Iterator<Peuple> it = lstTmp.iterator(); while( it.hasNext() ){ Peuple p = it.next(); if( p == this){ return 1; } } return 0; }
c532c5a2-6340-4c01-879a-276b9009850d
4
protected void consume(int cc) throws CompilationException { if ((cc<0) || (c!=cc)) { CompilationException exc= new CompilationException(c==-1?1:3,new Character((char)c)); exc.col=column; if (c==-1) exc.col--; throw exc; }; read(); };
891bf553-8e0a-4308-bda8-4ae5c7c847ed
3
public double inputToDouble() { double inputValue = 0; while (true) { try { inputValue = Double.valueOf(this.in.next().trim()); break; } catch (NumberFormatException e) { System.out.println("That wasn't a double value"); this.in.nextLine(); } catch (InputMismatchException e) { System.ou...
f8659b47-d99e-4daf-92a7-fa7b3ef8298e
9
public static void executeDualGb(Gameboy gbL, Gameboy gbR, int[] movesL, int[] movesR) { // finish unfinished frames if (!gbL.onFrameBoundaries) gbL.step(); if (!gbR.onFrameBoundaries) gbR.step(); System.out.println("executeDualGb: initial steps " + gbL.stepCount + " - " + gbR.stepCount); ...
cd6903ce-7e25-4405-a5cd-cca0073efbf7
3
@Override public boolean isExistUrl(String url) { Statement stmt; ResultSet rs; ResultSet rsHistory; try { stmt = con.createStatement(); String query = "SELECT * FROM " + TABLE_NAME + " WHERE url = '" + url + "'"; rs = stmt.executeQuery(query); String query4History = "SELECT * FROM " + TABL...
c34ee31b-9691-4a7e-b8bf-6fa0b7858aca
5
private boolean zzRefill() throws java.io.IOException { /* first: make room (if you can) */ if (zzStartRead > 0) { System.arraycopy(zzBuffer, zzStartRead, zzBuffer, 0, zzEndRead - zzStartRead); /* translate stored positions */ zzEndRead -= zzStartRead; zzCurrentPos -= zzStartRead; zzMarkedPos -= zz...
84f446b3-343d-4c24-b3c1-afa69127176f
8
public Point toGate(Point current){ double ox = 0, oy = 0; Point gate = new Point(dimension/2, dimension/2); // if both the x and y of the piper are farther than 1 from the gate, change both // !finishround signifies that the piper is not ready to move towards the target yet if(Math.abs(gate.x - current.x) > ...
db638b02-510f-4ed7-8338-9f0d8c0fdfc8
3
public boolean eatBloodMedicine(BloodMedicine bm){ if(this.isLive && bm.isLive() && this.getRect().intersects(bm.getRect())){ this.blood = 100; bm.setLive(false); return true; } return false; }
3499749c-6af7-42e8-88bc-9eec716ebc1d
2
public void onPart(String chan, IRCUserInfo user, String msg) { String nick = user.getNick(); String username = user.getUsername(); String host = user.getHost(); if (msg.length() > 0) msg = " ("+ msg +")"; String line = "* Part: "+ nick +" ("+ username +"@"+ host +") parts "+ chan + m...
b6e5c1cd-f126-4cfa-a3f6-422cb04134bd
9
@Override public void handle(HttpExchange exchange) throws IOException { Database db = new Database(); XStream xStream = new XStream(new DomDriver()); Search_Input input = (Search_Input) xStream.fromXML(exchange.getRequestBody()); String username = input.getUsername(); String password = input.getPassword(...
a6df0745-1058-4154-bfe6-e49cfe01ca3e
0
public int getArmForce() { return armForce; }
9b5de41c-57c4-485d-a98e-1a17aacbfb15
3
public IllegalOrphanException(List<String> messages) { super((messages != null && messages.size() > 0 ? messages.get(0) : null)); if (messages == null) { this.messages = new ArrayList<String>(); } else { this.messages = messages; } }
d14505e2-2018-4e29-8ab8-e8b9372f9028
8
public int compareTo(Object tmp ) { int result; if (tmp instanceof Person) result = (firstTicks < ((Person)tmp).GetFirstTicks() ? -1 : (firstTicks == ((Person)tmp).GetFirstTicks() ? 0 : 1)); else if (tmp instanceof BlankEvent) result = (firstTicks < ((BlankEv...
abcb40cb-e78c-4201-8efd-54118f9cb600
7
public void renderTile(int xp, int yp, Tile tile){ xp -= xOffset; yp -= yOffset; for (int y=0; y < tile.sprite.SIZE; y++){ int ya = y + yp; //ya is absolute y value, yp is offset for (int x=0; x < tile.sprite.SIZE; x++){ int xa = x + xp; if (xa < 0 - tile.sprite.SIZE || xa >= width || ya < 0 || ya >...
95788fc0-bf90-463f-b601-004b28f556d8
1
public void doLargeDelimitedWithPZMap() { try { final String mapping = ConsoleMenu.getString("Mapping ", LargeDelimitedWithPZMap.getDefaultMapping()); final String data = ConsoleMenu.getString("Data ", LargeDelimitedWithPZMap.getDefaultDataFile()); LargeDelimitedWithPZMap.c...
1efd9be5-739e-4118-8fd6-26ab512b7312
0
public void setDireccion(String direccion) { this.direccion = direccion; }
3884040a-344f-497d-a39c-8019431cade4
6
private void checkProductions(int x,int y) { HashSet <String> tempSet=new HashSet <String>(); for (int i=0; i<myProductions.length; i++) { for (int k=x; k<y; k++) { String key1=x+","+k; String key2=(k+1)+","+y; for (String A : myMap.get(key1)) { for (String B : myMap.get(key2)) ...
a6398f0c-a4ec-4997-a959-b6c9e821c8fd
3
@Override public String toString() { StringBuilder imports = new StringBuilder(); importLines.add( importJavaLines ); importLines.add( importJavaxLines ); importLines.add( importExternalLines ); importLines.add( importComLines ); for ( List<String> lines : importLin...
75306d5b-099c-481a-9823-f324f0afc25d
7
public boolean changeMixer(String mixerName) { Mixer mx=null; try { //stop current line this.line.stop(); this.line.close(); this.line.flush(); // Record this mixer change if (debugAudio==true) audioDebugDump("changeMixer() : mixerName="+mixerName); //set the new mixer and line mx=getMixer(m...
9bf2ba86-c767-4009-9518-5932ad4a4b88
6
public void saveDatabase() { try { File directory = new File(getDataFolder() + File.separator + "anvils"); if (!directory.exists()) directory.mkdirs(); for (File file : directory.listFiles()) { file.delete(); } for (int i = 0; i < anvils.size(); i++) { Location loc = (Location) anvils...
bce47d36-dbb8-45f8-ad83-cee5c207c215
8
public static LogicObject findSelectionKeyWithEquivalents(Cons pattern) { { Cons candidatekeys = pattern.rest.rest; { Keyword testValue000 = ((Keyword)(pattern.value)); if ((testValue000 == Logic.KWD_DEPENDENTS) || (testValue000 == Logic.KWD_ISA)) { } else if (testValue00...
5eb354b4-8799-4418-948a-99f551c52c51
0
@Override public String toString() { return "Message["+source+"->"+dest+" seqNum:"+seqNum+" duplicate:"+duplicate+" kind:"+kind+" data:"+data+" TimeStamp:" + this.timeStamp + "]"; }
adb8c529-788f-4ec5-b89f-3de292dffa02
3
public void close() { try{ if(connection!=null && !connection.isClosed()) { connection.close(); connection=null; } }catch(SQLException ex) { ex.printStackTrace(); } }
0ef269fb-d732-4541-8678-5154dcb779ba
3
static boolean inside(int r, int c) { return r >= 0 && r <= n && c >= 0 && c <= n - r; }
b1170460-32b3-4953-9ea5-161f89ecf5d8
9
private boolean aggregate(char entryCharacter, char exitCharacter, boolean prefix) { if (c != entryCharacter) return false; nextCharacter(); skipWhiteSpace(); if (c == exitCharacter) { nextCharacter(); return true; } for(;;) { ...
631b5fd9-7e37-408b-acc6-3424b0822a54
9
public static void main(String args[]) throws FileNotFoundException { try { t = PdfUtilities.chooseFolder(); if (t != null) { ArrayList<File> files = PdfUtilities.getPaths(new File(t), new ArrayList<File>()); if (files == null) return; String extension; PdfReader reader; try {...
2e7179ed-eeae-4155-94e7-01e7097c627d
5
public void keyPressed(KeyEvent evt) { if (evt.getKeyCode() == keys[UP]) { this.direction = DIR_UP; } else if (evt.getKeyCode() == keys[DOWN]) { this.direction = DIR_DOWN; } else if (evt.getKeyCode() == keys[LEFT]) { this.direction = D...
618f52b0-679d-4f29-a38e-d62b718a4d87
0
@Override protected String getModel() { return "Volvo XC90"; }
80febbb6-33b3-4e1a-8b9f-eb2b10c464e1
7
public int getArrowProjectileGfxId(int weaponId, int arrowId) { if (arrowId == 884) { return 11; } else if (arrowId == 886) { return 12; } else if (arrowId == 888) { return 13; } else if (arrowId == 890) { return 14; } else if (arrowId == 892) return 15; else if (arrowId == 11212) return 1...
c6d9b410-0ede-4995-ae39-5a45973ae045
1
private String getString(int next) throws IOException { StringBuilder str = new StringBuilder(); str.append((char) next); while (!isQuote((next = getChar()))) { // TODO: Properly read escape sequences str.append((char) next); } str.append((char) next); return str.toString(); }
988b0d14-cd30-43ef-948e-58b69f6fcd02
8
public static void main(String[] args){ Scanner in = new Scanner(System.in); int n=in.nextInt(); int[] a = new int[n+1]; for(int i=0;i<n;i++){ a[i+1]=in.nextInt(); } int t = in.nextInt(); int[] d = new int[n+1]; int[] swap = new int[n+1]; int cnt = 0; for(int i=1;i<=n;i++){ if(a[i]==i...
9dbc7b28-a5e4-40a2-8895-dd41f406e42c
3
@Override public Customer readCustomer(int customerID) { if (doc == null) return null; Element currRoot = doc.getRootElement(); Element parrentCusto = currRoot.getChild("customers"); List<Element> listCustos = parrentCusto.getChildren(); for (Element customer : listCustos) { int newCustomerID = Integ...
6e0c126d-f60b-46c0-9ee2-7bea70a270dc
0
public int getSupplierCode() { return getValue().getSuppliercode(); }
8b744573-b42d-40ee-9bfc-800c05576e00
4
public void woodcuttingComplex(int screen) { if (screen == 1) { clearMenu(); menuLine("1", "Normal Tree", 1511, 0); menuLine("1", "Achey Tree", 2862, 1); menuLine("10", "Light Jungle", 6281, 2); menuLine("15", "Oak Tree", 1521, 3); menuLine("20", "Medium Jungle", 6283, 4); menuLine("30", "Willow ...
34f5c3ed-6e84-416a-92f0-f570112f8c10
3
private void draw() { double size = getWidth() < getHeight() ? getWidth() : getHeight(); canvas.setWidth(size); canvas.setHeight(size); ctx.clearRect(0, 0, size, size); if (isFrameVisible()) { //frame Paint frame = new LinearGradient(0.14 * size, 0.14 * size, ...
63ac5e09-aeff-44d6-8419-0edfe607af48
2
public static Card getHighestCard(Card card1, Card card2) { return (card1.getRank().getValue() > card2.getRank().getValue()) ? card1 : ((card1.getRank().getValue() < card2.getRank().getValue()) ? card2 : null); }
1c39022e-6f10-4a14-a59a-bb589ece3756
6
public boolean validarUsr(String nick, String psw){ //System.out.println(nick); //System.out.println(psw); getLista g = new getLista(); ListaClientes = g.getListaCliente(); for(int i = 0;i<ListaClientes.size();i++){ // System.out.println(ListaClientes.get(i).getNombre(...
f2106089-8a82-431e-8e56-822c9105e3ca
3
private void buildReport(ParseNode current, int indent, StringBuilder b) { while(current != null) { if(current.Terminal == null) { for(int i = 0; i < indent; i++) b.append(" "); // 2 spaces b.append(current.ProductionRule.toString()); b.append('\n'); // Children buildReport(current....
594a8d11-d8fe-4a06-8372-f1389b58ecab
2
@Override public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) { //System.out.println("getScrollableBlockIncrement"); switch(orientation) { case SwingConstants.VERTICAL: return visibleRect.height; case SwingConstants.HORIZONTAL: return visibleRect.width; ...
582b7a61-18aa-4b06-b4ae-b3f5915c50d5
0
@Override public void quit() { quitProgram(); }
6fb96361-d4f2-4305-8015-5e76123f6377
4
public void updateDisplay() { if(userValues !=null && systemValues !=null) { for(int row = 0; row < systemValues.length; row++) { for(int col = 0; col < systemValues[row].length; col++) { systemValues[row][col] = userValues[row][col]; } ...
892fa53c-c475-4705-9107-0d88942473a3
0
public double getDecimal(){ return (double)numerator / (double)denominator; }
872b9403-c050-43bc-9e23-4b8b934cbd26
2
public int etsiTasonNumero(ArrayList<String> rivit) { int tasonNumero = 0; for (String string : rivit) { if(string.startsWith("Taso: ")) { tasonNumero = Integer.parseInt(string.substring(6)); } } return tasonNumero; }
5c90fc15-50e3-410b-b0b5-4b5c8894fb78
2
public Meeting getMeeting(int id) { Meeting returner = null; for (int i = 0; i < meetingList.size(); i++) { if (meetingList.get(i).getID() == id) { returner = meetingList.get(i); } } return returner; }
61ab9b85-30f0-4c87-aac0-e540f4e8b980
9
public void scrollCellToView(JTable table, int rowIndex, int vColIndex) { if (!(table.getParent() instanceof JViewport)) { return; } JViewport viewport = (JViewport) table.getParent(); Rectangle rect = table.getCellRect(rowIndex, vColIndex, true); Rectangle viewRect =...
8b047667-23a1-4f9a-af46-b24646381d12
1
public final synchronized void sendRawLine(String line) { if (isConnected()) { System.out.println("Sending Raw Line: " + line); _inputThread.sendRawLine(line); } }
a60613da-1b28-471f-8c31-6deb886266d9
6
private void deSelectAllOtherSoundEffects(String key, String filename) { logger.logDebug("ENTERED deSelectAllOtherSoundEffects key = " + key + ", filename = " + filename); logger.logDebug(" key = " + key); logger.logDebug(" filename = " + filename); logger.logDebug(" listOfSoundFiles.size =...
25d3a082-9e7e-4212-ba39-1a1f2bd1d078
2
private static boolean isLocationInScreenBounds(Point location) { GraphicsDevice[] graphicsDevices = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices(); for (int j = 0; j < graphicsDevices.length; j++) { if (graphicsDevices[j].getDefaultConfiguration().getBounds().contains(location)) { ...
537ac374-a09e-4ecb-b202-8180b046c7ad
1
@Test public void twoCompCircular1() throws Exception { try { C1 c = new C1(); fail(); } catch (RuntimeException E) { assertTrue(E.getMessage().contains("src == dest")); } }
d90a277e-dcd4-4222-aac8-efb77e7f39b8
1
public final synchronized boolean isConnected() { return _inputThread != null && _inputThread.isConnected(); }
4189d89e-2277-4ee1-8150-50218fd938dd
8
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPlayerItemHeld(PlayerItemHeldEvent event) { try { if((event.getPlayer().hasPermission("arctica.use")) && (!event.getPlayer().hasPermission("arctica.immune"))) { ItemStack ...
523f77ae-9bb0-4531-8425-d513ba944040
9
@Override public void doLayout() { Insets insets = getInsets(); int x = insets.left + HMargin; int y = insets.top + VMargin; Dimension d = classNameText.getPreferredSize(); classNameText.setBounds(x + ClassNameOffset + ClassNameSpace, y, d.width, d.height); y +=...
e1f38d4b-b5d8-4f3e-98b2-3e4a9403fbf9
1
public float getFloat(String key, float _default) { return containsKey(key) ? get(key).floatValue() : _default; }
aac3e482-cde5-493e-ac37-36b74fac3bf9
1
@Override public void onDisable() { synchronized (updateChecker) { try { getLogger().info("Waiting for updater to complete"); updateChecker.join(); } catch (InterruptedException ex) { getLogger().log(Level.SEVERE, "Error while waiting f...
58b71160-c497-47a6-88bd-5012017dbb19
4
public void undo(IDTextField field) { // no active list if (list == null) return ; int otherID = field.getMyID() ; int index = 0 ; boolean notFound = true ; ListIterator iterator = list.listIterator() ; // search for undo's while (iterator.hasNext() && notFound) { Und...
bbe3641e-51da-4411-805f-e1cadeddc90f
5
public void calculScore(){ int score = 0; for (Town t : towns){ if(t.isTown()==true) score += 2; else score++; } if (hasLonguestRoad==true) score += 2; if (hasBiggestArmy==true) score += 2; score += bonusScore; this.score = score; if(score>=10) { EndGameFrame endGame = new EndGameFrame...
e9fa6acc-6562-45c7-91ed-6b2832efc250
6
private Cliente get_Cliente (String codigo){ String detalle = ""; Cliente cli = new Cliente(); r_con.Connection(); try { String sql = ( "SELECT cli_codigo, cli_nombre, cli_apellido, cli_fecha_nac, cli_cuit, loc_descripcion, cli_direccion, cli_calle, cli_sit_frente...
0d1537d0-74a0-4a14-820d-05a5b7bb5066
3
public void accel(double aX, double aY, double aZ) { velX += aX; velY += aY; velZ += aZ; if (Math.abs(velX) > speed) { velX = (velX / Math.abs(velX)) * speed; } if (Math.abs(velY) > speed) { velY = (velY / Math.abs(velY)) * speed; } ...
be20857f-537a-4b4e-b067-dff45f014799
1
public void PerformBroadcast() { if(!responseServer.running) { gameList.clear(); UpdateGameList(); } responseServer.startServerBroadcast(); }
19f867af-30e9-4b9b-a9c3-d9727982a3c7
4
@Override public boolean createTable(String query) { Statement statement = null; try { this.connection = this.getConnection(); if (query.equals("") || query == null) { this.writeError("SQL query empty: createTable(" + query + ")", true); return...
80b1b9c8-40c7-4611-80be-cceafde31445
8
public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); char[] s1 = br.readLine().toCharArray(); char[] s2 = br.readLine().toCharArray(); int len1 = s1.length; int len2 = s2.length; int max_all = Integer.MIN_VALUE; int[][] lcs =...
4befa8f6-7e94-498a-8f50-9815b7f571b7
3
private void configurePropertiesForObjectSchema(JsonNode rawProperties, ObjectSchema schema, URL schemaLocation) { if (rawProperties == null) { return; } for (Iterator<String> iterator = rawProperties.fieldNames(); iterator.hasNext();) { String fieldName = iterator.next(...
bc8bf0cb-cd46-41f6-9aa9-7e06e4b8bc1d
6
private void test(Class<?> clazz, String methodName, int expectedParamsCount) throws Exception { InvocationChainRetriever retriever = new InvocationChainRetriever(); String className = clazz.getName(); InputStream in = this.getClass().getResourceAsStream("/" + className.replace('.', '/') + ".class"); Clas...
a9ebe588-9c6b-4923-b057-0fa3737dd852
3
public static void method208(boolean flag, Model model) { int i = 0; int j = 5; if (flag) { return; } Interface.modelCache.clear(); if (model != null && j != 4) { Interface.modelCache.put(model, (j << 16) + i); } }
19a65597-1ef9-46e1-ab00-8d8500cebacc
2
private void load() { for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { pixels[x + y * width] = sheet.pixels[(x + this.x) + (y + this.y) * sheet.width]; } } }
f2b43f9d-7230-467e-98a6-77972b97b49f
9
@Override public void loadImages() { if(hImgLdr == null){ hImgLdr = new HorseRaceImageLoader(); } GameObject background = gameObjects.get("BACKGROUND"); if(backgroundStand == null){ backgroundStand = new BufferedImage[1]; } backgroundStand[0] = hImgLdr.scaleBufferedImage(hImgLdr.loadBufferedImage(Hor...
5cb93331-7f18-4759-9a0f-c713bc37204d
3
public boolean isJumpPressed(){ if(isXboxControllerAttached()){ if(xboxController.isAPressed()){ return true; } } if(jump.isPressed()){ return true; } return false; }
9445ba96-3423-4061-a9e2-7a0273bb3a15
8
private boolean initialiseNextBlock() throws IOException { /* If we're already at the end of the stream, do nothing */ if (this.streamComplete) { return false; } /* If a block is complete, check the block CRC and integrate it into the stream CRC */ if (this.blockDecompressor != null) { int blockCRC = ...
0118d238-d08b-4d41-abeb-ddc7f595506f
0
public void setSize(int size) { this.size = size; }
3db3b43c-4b99-4992-be20-df0fd4a26f5f
0
public void lisaaEste(Este este) { esteet.add(este); }
78813043-6cc8-4650-9f7e-a2e23318a633
6
public String getDuration() { String duration = "-"; if(segments != null) { long durationMinutes = 0; for(int i=0; i< segments.size(); i++) { Segment segment = (Segment) segments.elementAt(i); if(segment.getDuration() != null) { String[] currDuration = StringUtil.split(segment.getDuration(), ":")...
ebd416ec-fea9-4753-a8da-bce243148ecd
9
static String formatDouble(double x, int just, int width, int dec) { int sign = 1; if (x < 0) { sign = -1; x = -x; } double pow10 = 1; for (int i = 0; i < dec; i++) { pow10 *= 10; } double y = Math.round(pow10 * x) / pow10; String s = "" + y; int i = s.indexOf('.'); int l = s.length(); ...
0086d5ab-b602-4906-b0f2-f005f10319b3
9
@Override public Class getColumnClass(int indiceColonne){ //System.out.println("ModeleListeLocations::getColumnClass()") ; switch(indiceColonne){ case 0 : return Integer.class ; case 1 : return String.class ; case 2 : return String.class ; case 3 : return String.class ; case 4 : ...
a6761f7e-c8e5-4058-a183-9136a5c7b942
3
public void visitSRStmt(final SRStmt stmt) { if (stmt.array == from) { stmt.array = (Expr) to; ((Expr) to).setParent(stmt); } else if (stmt.start == from) { stmt.start = (Expr) to; ((Expr) to).setParent(stmt); } else if (stmt.end == from) { stmt.end = (Expr) to; ((Expr) to).setParent(stmt); } ...
4f71f506-d774-403d-b036-db19fa27b63b
5
protected void recursiveBalance(TreeNode currentNode) { setBalance(currentNode); int balance = currentNode.balance; if (balance == -2) { if (height(currentNode.left.left) >= height(currentNode.left.right)) { currentNode = rotateRight(currentNode); } else...
8491fde6-61e6-457c-a71e-bd938211a10a
7
public void printObj () { //Suppression des oiseaux qui ont touche quelque chose synchronized(Fenetre._list_birds) { for(int i = 0; i < Fenetre._list_birds.size(); i++) { if (Fenetre._list_birds.get(i).isDestructed()) { Fenetre._list_birds.remove(i); if (Fenetre._list_birds.size() != 0) Fenet...