method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
7f0e8ba4-279b-4a45-a1ef-799633e52bf0
0
@Override public void changedMostRecentDocumentTouched(DocumentRepositoryEvent e) {}
5ae2d9aa-35f6-4718-9058-3981b8f86c2e
8
@command public void Null(CommandSender sender, String[] args) { if (sender.hasPermission("modreq.mods")) { sender.sendMessage(ModReq.format(ModReq.getInstance().Messages.getString("headers-footers.mods.header"), "", "","")); Player[] op = Bukkit.getOnlinePlayers(); Strin...
79bd86a3-aca7-491f-9522-db6c4ee8acd9
1
public double getWeight(Neuron perceptron) { if(dendrites.containsKey(perceptron)) return dendrites.get(perceptron); else return 0; }
320636c8-166c-41d2-be66-d5569f7ddcf6
9
private synchronized Collection<Rule> filterAndSetRulesInLastTwoHoursFromCache() { if (lastTime < System.currentTimeMillis() - cachedRulesTimeout) { Collection<Rule> rules = (Collection<Rule>) getCached(getCachedRulesKey()); boolean update = false; if (rules != null) { ...
f2ea89e3-5307-482a-9e87-8e9222d163c2
6
private void freeResources(Socket socket, InputStream in, OutputStream out) { if (out != null) { try { out.close(); } catch (IOException e) { } } if (in != null) { try { in.close(); } catch (IOException e) { } } if (socket != null) { try { socket.close(); } catch (IOExcepti...
941e774e-dc31-426b-8369-9c4c07f63b69
9
public boolean doTimeoutCheck(boolean forceKill) { if (mySocket.isClosed()) { // the connecion was already closed and should be removed by the HTTPServer instance. return true; } else { long nowtime = System.currentTimeMillis(); int startTimeout = hr != null ? (hr.isServercmd() ? 1800000 : 180000) : 3...
ef1ec7e7-5ae8-4576-bfc8-b8c8a268b02c
5
@Override public void run() { int buffersize=size; double datasize=30*buffersize*1024; System.out.println(datasize+""); int num=(int)datasize/buffersize; byte toSend[] = new byte[buffersize]; byte toReceive[] = new byte[buffersize]; for (int i=0; i<buffersize; i++){ toSend[i] = (byte)2; } long s...
9e15601c-4863-4521-b914-a619fa7705bd
7
public static Color getColor(int num) { switch (num) { case -1: return new Color(255,255,255,100); case 0: return new Color(230,0,0); case 1: return new Color(0,0,230); case 2: return new ...
12185bae-e771-4f5c-bd48-f56ef6d34d2c
9
private boolean r_vowel_suffix() { int v_1; int v_2; // (, line 170 // try, line 171 v_1 = limit - cursor; lab0: do { // (, line 171 // [, line 172 ...
ece32f96-6622-4d21-adda-42718e4dbbf0
3
public static Method getMethod(Class<?> clazz, String methodName, Class<?>... paramTypes) { Assert.notNull(clazz, "Class must not be null"); Assert.notNull(methodName, "Method name must not be null"); try { return clazz.getMethod(methodName, paramTypes); } catch (NoSuchMethodException ex) { throw new I...
98079f1e-afd3-4ecf-8179-dc4bce3bce2f
8
private Value plus(String arg1, String arg2) { final Value v1 = evaluate(arg1); final Value v2 = evaluate(arg2); if (v1 instanceof ValueInt && v2 instanceof ValueInt) { return new ValueInt(((ValueInt) v1).getValue() + ((ValueInt) v2).getValue()); } if (v1 instanceof ValueTime && v2 instanceof ValueInt) { ...
bd9536c1-f2e3-428c-ba9b-994dcc511b87
2
public void stop() { if(fTimer.isRunning()) { fTimer.stop(); final Runnable r = new Runnable() { public void run() { fAnimationTarget.end(AnimationTimer.this); } }; if(SwingUtilities.isEventDispatchThread()) { r.run(); } else { SwingUtilities.invokeLater(r); } } }
90c68fd6-9251-4db2-a1c7-60483f86a42b
3
protected File getJavaExecutable() throws MojoExecutionException { final String javaHome = System.getenv("JAVA_HOME"); if (StringUtils.isEmpty(javaHome)) { throw new MojoExecutionException("JAVA_HOME is not set, cannot continue"); } final File java = new File(java...
a25374c1-6263-402b-8623-2076c7f489ce
1
public void stop() { if(!isRunning) return; isRunning = false; }
5e452354-bd9e-4e13-9617-978e0fed92c4
0
public void mouseEntered(MouseEvent e) { //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. }
057afebe-712b-4202-a8f1-052982efec85
2
@Override public byte[] getHTTPMessageBody() { try { writeToForm(); } catch (Exception e) { e.printStackTrace(); } try { return Files.readAllBytes(getPath()); } catch (IOException e) { e.printStackTrace(); } return "File Could Not Be Read".getBytes(); }
b856f2ce-299d-4356-be36-5e09055c0f03
3
public static String testNumSpectable (Connection conn, String numS) throws BDException { String requete; Statement stmt; ResultSet rs; String res = null ; try{ Integer.parseInt(numS); } catch(NumberFormatException nfe){ throw new BDExceptionIllegal("Problème de numéro de représentation (pas un entie...
4b0f391e-b2b6-4aea-9196-3371e4eb6c95
7
public static String getType(Entry32 e) { switch ( e.p_type ) { case PT_NULL: return "null"; case PT_LOAD: return "load"; case PT_DYNAMIC: return "dynamic"; case PT_INTERP: return "interp"; case PT_NOTE: return "note"; case PT_SHLIB: return...
e9ba1e78-0c1c-4ff6-9136-6bba8f73f046
0
public static void changeFocusToTextArea(Node currentNode, JoeTree tree, OutlineLayoutManager layout) { tree.setCursorPosition(0); tree.getDocument().setPreferredCaretPosition(0); tree.setComponentFocus(OutlineLayoutManager.TEXT); tree.clearSelection(); layout.draw(currentNode,OutlineLayoutManager.TEXT); ...
02aedd94-0920-44fb-ad28-ee4069254c19
8
private static void parseArgs(String[] args) throws Exception { if (args.length != 1) { System.out.println("Need exactly 1 argument.\n" + PLAY_MINICHESS_USAGE); System.exit(1); } /**Parse config file and load into MinichessConfig class*/ configFileName = args[0]; BufferedReader configReader...
c46fa9fb-e518-4a8e-aebe-af0ef02378c8
0
@Override public int compareTo(Shape shape) { return Double.compare(getArea(), shape.getArea()); }
dbfbb871-2315-46d2-a3c5-3225a580de1a
4
private void framePageInit() throws Exception { this.getContentPane().setLayout(null); this.setSize(500, 300);// UI长宽 this.setLocation(300, 300);// UI在显示器中的位置坐标 btnSourceFile.addActionListener(new ActionListener() { @SuppressWarnings("deprecation") @Override public void actionPerformed(ActionEvent e)...
bd55e052-eca4-419b-919b-bafca3d0928d
8
public Humain rencontre(Humain h) { Humain b; loterie = new Random(); if (h instanceof Femme) return null; if (age > 15 && age < 50 && h.age > 15) { if (poids > 150 || h.poids > 150) { return null; } else { int f = loterie.nextInt(100); if (f > fertilite) return null; int p = loter...
74ae9d71-280a-446d-b1a2-8ae0f66efc0d
7
@Test public void testeCriarJogo2() { try { t.criarJogo(2, 3); fail("Deveria ter lancado uma execao"); } catch (TamanhoInvalidoException e) { assertEquals("Largura e Altura devem ser maiores que 2", e .getMessage()); } try { t.criarJogo(3, 2); fail("Deveria ter lancado uma execao"); } c...
f4055477-b08d-46cd-9a57-5fa2b4afc84c
6
protected void UpdateLineColumn(char c) { column++; if (prevCharIsLF) { prevCharIsLF = false; line += (column = 1); } else if (prevCharIsCR) { prevCharIsCR = false; if (c == '\n') { prevCharIsLF = true; } else line += (column = 1); ...
df8af432-1c83-4a4e-bf4c-06cac21fede3
6
public static void main(String args[]) { /* * Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* * If Nimbus (introduced in Java SE 6) is not available, stay * with the default look and feel. For details see * http://down...
3dea377e-0ffc-4d46-a281-5b3a201e6f03
4
@Test public void builderTestRandom() { final Random rng = new Random(42); final ArrayDeque<Integer> deque = new ArrayDeque<>(); for(int len = 0; len < 10_000; len++) { deque.clear(); final ObjectArrayBuilder<Integer> builder = new ObjectArrayBuilder<>(); for(int i = 0; i < len; i++) { ...
a2d3e6c8-eaeb-476c-9d8e-c7917e9dd996
7
public void TypesDimension(HashMap<String, List> dims, String n) throws ParseException { List ty = new LinkedList(); TypeRef tr; jj_consume_token(LESS); switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case ADD: case SUB: case IDENTIFIER: ...
27bdcb5c-14b7-4601-b144-3382b7aec3cf
6
public static <A, B, C, D, E, F$, G> Equal<P7<A, B, C, D, E, F$, G>> p7Equal(final Equal<A> ea, final Equal<B> eb, final Equal<C> ec, final Equal<D> ed, final Equ...
831e4cad-3611-427c-81de-b7a78899a586
6
public static void main(String[] args){ int N = Integer.parseInt(args[0]); int[][] triangle = new int[N][N]; for(int i = 0; i < N; i++){ for(int j = 0; j <= i; j++){ if(j == 0 || j == i) triangle[i][j] = 1; else triangle[i][j] = triangle[i-1][j-1] + triangle[i-1][j]; if(triangle[i][j...
54a3ddc2-1be7-4249-9151-988628d0f746
1
public boolean more() throws JSONException { next(); if (end()) { return false; } back(); return true; }
54c02af1-c0f5-46fe-b31e-bbe786433b15
3
public static Picture mirror4(Picture tile) { Picture canvas = new Picture((tile.getWidth() * 2), (tile.getHeight() * 2)); for (Pixel pixel : tile.getPixels()) { if (pixel.getColor() == Color.WHITE) { continue; } // Ignore white Pixel topLeft = canvas.getPixel(pixel.getX(), pixel.getY()); Pixel bott...
3d1a449f-9ef0-47ae-a920-b1ebe2a9ce4b
7
* @param dialect * @param stream */ public static void printLogicalFormInDialect(Stella_Object self, Keyword dialect, OutputStream stream) { if (self == null) { return; } if (dialect == null) { dialect = ((Keyword)(Logic.$LOGIC_DIALECT$.get())); } if (dialect == Logic.KWD_KIF) { ...
3be249a0-221c-403e-bd7c-5f41a87f2e1a
1
public JPanel getNametextInListChangesMenu() { if (!isInitialized()) { IllegalStateException e = new IllegalStateException("Call init first!"); throw e; } return this.nametextListPanel; }
7fb5a9ed-1418-4e7c-8408-d554680fe08c
6
public static void Error(final String message) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see htt...
a3732884-facc-4dc3-b7a9-c51fdaaf9f70
0
public Rate getDLRate() { return this.download; }
82d23085-59e5-4823-acad-c6bca9b29829
8
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Survey survey = (Survey) o; if (idsurvey != survey.idsurvey) return false; if (date != null ? !date.equals(survey.date) : survey.date != null) ...
78fcda40-6d87-40bf-8c02-099b6ec4693c
1
static int count(CtMember head, CtMember tail) { int n = 0; while (head != tail) { n++; head = head.next; } return n; }
4a08e9d0-e71f-426c-ac77-4d5642e5054a
6
private void preLoadFeaturesIntoFESVo() { Feature [] features; // set of prop_val of required features: Set<Integer> propVals = new HashSet<Integer>(); for (int id : this.requiredIDs){ propVals.add(this.horizonsSourceIDs.get(id)); } // [9...
dccbfc80-2d30-4e92-b715-543293ff1a85
6
public boolean canTurnInCards(int index1, int index2, int index3) { condition = false; if (hand.size() >= 3) { if (hand.get(index1).getType().equals(hand.get(index2).getType()) && hand.get(index1).getType().equals(hand.get(index3).getType())) { //If all three cards have the same type condition = true...
6da9fd9d-b076-4d9e-9398-41acb59c10d4
3
@Override public void actionPerformed(ActionEvent e) { OutlinerDocument doc = (OutlinerDocument) Outliner.documents.getMostRecentDocumentTouched(); OutlinerCellRendererImpl textArea = doc.panel.layout.getUIComponent(doc.tree.getEditingNode()); if (textArea == null) { return; } Node node = textArea.n...
7df902ec-5acf-4cc7-bf45-b4feef507a08
1
public void setCoachNumber(int coachNumber) throws CarriageException { if (coachNumber < 0) { throw new CarriageException("Coach number is under zero"); } this.coachNumber = coachNumber; }
e7bd617d-ff0f-4aab-9dd2-467897cc8b1e
7
public void faceUp() { // Make sure this isn't just a place-holder if (this.Child == null) { return; } if (Game.getThis().TimerRunning) { return; } // Show the face this.setIcon(Child.getImage()); current = Child.getImage(); // Determine the type of match Matching MatchType; if (Game.getThis().F...
258cf6c9-27fc-41c6-9772-9339862a0c92
8
private void serializeInternal(Object object) throws IOException { if (object==null) { writer.write("null"); } else if (object instanceof String) { quote((String)object); } else if (object instanceof Number) { numberToString((Number) object); } else if...
1a42a2d2-ad76-4e9a-85fc-98c1b81cccf1
6
@Override public double checkConstraint() { double result = 0; int acheived = 0; for(TerminationData t:gameDescription.getTerminationConditions()){ for(String s:t.sprites){ acheived += numOfObjects.get(s); } if(t.type.equals("SpriteCounter")){ if(acheived > t.limit){ result += 1; } ...
04ef32e4-c2da-402c-bca9-f15d1580c258
0
public int getX() { return x; }
1b6ab6a2-45bb-495e-b13b-dbc719aa9513
6
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
3c1078b7-20aa-4919-b404-60ccec5b2c27
3
@Override public boolean hasValue(String name) { if (!this.caseSensitive) { name = name.toLowerCase(); } if (this.vars.containsKey(name)) { return true; } if (this.parent != null) { return this.parent.hasValue(na...
a5146e7a-0be2-42ec-ac3a-3b06baad18fe
6
public void reduce(Text key, Iterable<Text> values, Context context) throws IOException, InterruptedException { if (!se.equals(key.toString().split("--##")[0])) { se = key.toString().split("--##")[0]; num = 0; } for (Text val : values) { ...
bdcf46b6-3143-4495-9a98-2f9ac9e9b4e8
4
public void alignCloserBoundTo(GameComponent<?> target) { Appearance ownBounds = this.getAppearance(); Appearance targetBounds = target.getAppearance(); double bottomDistance = abs(ownBounds.getHeight() + this.getY() - target.getY()); double targetRight = target.getX() + targetBounds.getWidth(); double leftDi...
d2c4259f-8eb4-49d8-ae39-10907903a04d
8
@Override public void execute(Game game, HashMap<String, String> strings, Entity target) throws ScriptException { if (args[0].toLowerCase().equals("p")) { for (int i = 1; i < args.length; i++) { game.getPlayer().walk(getDir(game, args[i])); } } else if (args[0].toLowerCase().equals("t")) { try { f...
972cad12-6d20-49b8-9826-58a5a33ba4ba
7
public static Keyword tryForwardGoalsProof(ControlFrame frame) { { Iterator iterator = ((Iterator)(KeyValueList.dynamicSlotValue(frame.dynamicSlots, Logic.SYM_STELLA_ITERATOR, null))); if (iterator == null) { { Proposition baseproposition = Proposition.findMatchingConceivedProposition(frame.propositi...
cfd698a8-8a8e-4a77-9d46-1daa95f1cb38
1
public void print() throws IOException { String line; while((line = reader.readLine()) != null){ printStream.println(line); } }
e09ade35-4a18-4ccb-92c6-4e7fb8babc3f
1
public void visitTryCatchBlock(final Label start, final Label end, final Label handler, final String type) { buf.setLength(0); buf.append(tab2).append("TRYCATCHBLOCK "); appendLabel(start); buf.append(' '); appendLabel(end); buf.append(' '); appendLabel(handler); buf.append(' '); appendDescriptor(I...
8cf2ed6f-72a7-4a41-8e02-1740791c07d7
8
public static String wordWrap(String message, int lineWidth) { if (message.length() < lineWidth) { return message; } //Iterate through message, replacing spaces with newlines if it's been more than lineWidth //characters since our last newline int lastSpace = 0; int lastNewline = 0; StringBuilder...
1c9f4967-4a56-4f78-801f-bf071096250c
1
public String parse() { String data = sb.toString(); Matcher m = Pattern.compile( "\"([a-z]+|(([a-z]+\\_[a-z]+)|\\_[a-z]+))\":") .matcher(data); while (m.find()) { String found = m.group(); data = data.replace(found, found.replace("\"", "")); } return data; }
54f7d65a-7ecf-4ce7-8a79-4d47c5dd4272
2
public void draw() { for (int x = 0; x < BLOCK_ROWS_X; x++) { for (int y = 0; y < BLOCK_ROWS_Y; y++) { getBlocks()[x][y].draw(); } } }
e78a27a3-5224-4d4e-aa18-4ad7958bceb8
9
public PannelloClassificatore(final PannelloConfigurazione pc) throws IOException{ this.pc = pc; Configurazione configurazione = new Configurazione(); int totIp = configurazione.getNumeroDiIpRange(); String[] listaIp = configurazione.getListaIp(); this.setTitle("Classificatore"); int colon...
863f50bc-a5eb-4cb5-ac72-dcdf156e7857
7
private void setUpChord(NoteName rootOfChord, ChordType chordType, ChordFunction function, Scale scale, int inversion) { // Check for valid input. if (chordType == null || function == null || rootOfChord == null || scale == null) { throw new NullPointerException(); } this.root = rootOfChord; this.ty...
3fe4e725-2b43-4d60-8b37-87327b5c0f2c
8
private static String getQualifiedNewInstance(String classname, List<Exprent> lstParams, int indent, BytecodeMappingTracer tracer) { ClassNode node = DecompilerContext.getClassProcessor().getMapRootClasses().get(classname); if (node != null && node.type != ClassNode.CLASS_ROOT && node.type != ClassNode.CLASS_L...
c3986d58-dbf0-4983-ab6a-3a8ac69271eb
9
public static void processMockContextAnnotation(Object testClass, Field f) { MockContext contextAnnotation = f.getAnnotation(MockContext.class); if (contextAnnotation != null) { if (f.getType().isAssignableFrom(InitialContext.class)) { f.setAccessible(true); t...
7ffd05a2-f26a-4f66-b76b-acdee5d3981c
4
public User getUser(String nick, String login, String hostname) { for(User user : users) { if(user.nick.equals(nick) && user.login.equals(login) && user.hostname.equals(hostname)) { return user; } } return null; }
fe5c74f3-f863-4af2-a157-05915e283c81
5
@SuppressWarnings("unchecked") private Map<String, StoredObject> load() { // File file = new File(NAMOO_CLUB_DAT); if (file.exists()) { // FileInputStream fis = null; ObjectInputStream ois = null; try { fis = new FileInputStream(file); ois = new ObjectInputStream(fis); return (Ma...
48ebe4f5-7322-40bc-b368-78cfa0c1ea6b
5
void writeData(List<Vector3D> points) { for (Vector3D p : points) { if(p.getX() != 0 && p.getY() != 0 && p.getZ() != 0) { s.write((int) p.getX() + ";" + (int) p.getY() + ";" + (int) p.getZ() + "\n"); } } if(points.size() > 0) { s.write("#"); ...
d1bb9635-0587-4de3-82e6-86b115166663
7
int [] getCliqueTree(int [] order, Set [] cliques, Set [] separators) { int nNodes = order.length; int [] parentCliques = new int[nNodes]; //for (int i = nNodes - 1; i >= 0; i--) { for (int i = 0; i < nNodes; i++) { int iNode = order[i]; parentCliques[iNode] = -1; if (cliques[iNode] != null && separato...
365aac1d-769c-49c7-bcfd-8d9116615c0e
8
protected void redistributeMipsDueToOverSubscription() { // First, we calculate the scaling factor - the MIPS allocation for all VMs will be scaled // proportionally double totalRequiredMipsByAllVms = 0; Map<String, List<Double>> mipsMapCapped = new HashMap<String, List<Double>>(); for (Entry<String, List<Do...
ce63dc1f-e0e6-4cfe-afbf-f54948163fc9
2
public boolean checkEndFightHero(){ boolean checking = true; int counter = 0 ; int i = 0; while(i <numHero){ BattleHeroSlots slot = heroTurn.remove(); if(slot.checkDefeated() == false) checking = false; //counter++; heroTurn.add(slot); i++; } return checking; }
d6e842ed-3e0f-4609-b08d-6fccc3b95cfc
9
void onMouseMove(Event event) { if (isLocked) return; fixEvent(event); CoolItem grabbed = getGrabbedItem(event.x, event.y); if (dragging != null) { int left_root = toDisplay(new Point(event.x - itemXOffset, event.y)).x; Rectangle bounds = dragging.internalGetBounds(); if (event.y < bounds.y) { m...
187ce82b-66be-49e0-a1a9-9fc77719545d
2
public static Client getClient() { TTransport transport = new TSocket("localhost", 12345); if (!transport.isOpen()) { try { transport.open(); } catch (Exception e) { e.printStackTrace(); } } TProtocol protocol = new TB...
dbc86c4d-2165-4efe-9f2f-33d84e96e2f7
4
public void doStandUpScaffold(StaplerRequest request, StaplerResponse response) throws IOException, ServletException, IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException { if (!"post".equalsIgnoreCase(request.getMethod())) { response.setStatus(405); ...
648a4d22-23bd-4100-8220-6920caedb51c
4
@Override public void startElement(String uri, String localName, String name, Attributes atts) throws SAXException { if (parsedElementName.equalsIgnoreCase(localName)) { if (attributesMatched(uri, localName, name, atts)) { numLayers = 1; } } else if (numLayers > 0 && secondElementName.equalsIgnore...
a4c58628-47ed-4dc2-9257-2f6a160ed520
9
public Ovni() { // super((Math.random()*Board.getWIDTH()+1), (Math.random()*Board.getHEIGHT()+1), 0.0f); super(0, 0,0.0f); this.x = (double) inici.get(0); this.y = (double) inici.get(1); switch(Board.getTheme()){ case "Desert":...
2287ecf8-ddfd-41af-8cc7-bd9a6a4b832d
8
public void processEvent(Event event) { if (event.getType() == Event.COMPLETION_EVENT) { System.out.println(_className + ": Receive a COMPLETION_EVENT, " + event.getHandle()); return; } System.out.println(_className + ".processEvent: Received Login Response.....
c05cee3c-a48f-4249-b9d2-f15ad3f30299
3
private void touchRotate(final double X, final double Y, final Rotate ROTATE) { double theta = getTheta(X, Y); interactiveAngle = (theta + 90) % 360; double newValue = Double.compare(interactiveAngle, 180) <= 0 ? (interactiveAngle + 180.0 + getSkinnable().getStart...
169638ae-9e5e-457b-b23d-1e2de7b0eb06
4
private static int getSoValueInputIndex(int sampleIndex) { int soIndex = sampleIndex / 2; int inputIndex = 16615 + (soIndex / 154) * 3251; soIndex %= 154; if (soIndex < 124) return inputIndex + soIndex * 25; else if (soIndex < 143) return inputIndex + 3100 + (soIndex-124) * 3; else i...
3225ff8a-0381-4cb4-8b93-144b298caf5b
5
public List<CensusTract> parsePrecincts(int stateCode, List<CensusTract> tracts) { String precinctDataPath = String.format(precinctPathFormat, stateCode); PoliticalParser precinctParser = new PoliticalParser(); List<VotingPrecinct> precincts = precinctParser.parse(precinctDataPath); ...
8a8454b7-8275-4094-8248-b41d821da4d5
4
public String getTeamShortListNumb(){ if ((getTeamNumb() == null) && (teamname == null)){ return ("--"); } else if (teamname == null){ return (getTeamNumb() + getTeamLetter()); } else if (getTeamNumb() == null){ return ("" + getTeamLetter() + "...
5fc0b3c9-dd44-4ff7-8d96-00a3d2459a02
6
static final void method312(int i, byte i_0_) { Class48.anInt859 = -1; if (i != 37) { if ((i ^ 0xffffffff) != -51) { if (i != 75) { if (i != 100) { if ((i ^ 0xffffffff) == -201) Class75.aFloat1249 = 16.0F; } else Class75.aFloat1249 = 8.0F; } else Class75.aFloat1249 = 6.0F; ...
d062f2f6-b83d-46ec-8d97-5514e8eb5b7b
0
private IRemoteCallObject getCallObj(Long key) { return sync.get(key); }
c6ee3cd6-4816-4455-908a-7288e8e7873f
8
@Override public Object getValueAt(int rivi, int sarake) { if (rivi < 0 || rivi >= henkilolista.palauta().size()) return null; Henkilo henkilo = henkilolista.palauta().get(rivi); switch (sarake) { case 0: return henkilo.getId(); case 1: return henkilo.getEtunimi(); ...
ae6bba17-87a6-4c76-a5df-b3d4002c80bf
8
@Override public void visitVarInsn(final int opcode, final int var) { Type type; switch (opcode) { case Opcodes.LLOAD: case Opcodes.LSTORE: type = Type.LONG_TYPE; break; case Opcodes.DLOAD: case Opcodes.DSTORE: type = Type.DOUBLE_T...
50dff4bf-2fe6-4323-ae55-f3bcafc6a459
0
public UnmarkTest() { }
00cfaef1-b654-4def-a674-200ef02abf04
3
@Override public void run() { synchronized(this){ this.runningThread = Thread.currentThread(); } openServerSocket(); while(! isStopped()){ Socket clientSocket = null; try { clientSocket = this.serverSocket.accept(); ...
9c4eb129-970c-4c60-9d60-3c5db5c49a94
6
private void quickSortDate(int low, int high, List<OrderStatus> table) { int i = low; int j = high; Date pivot = table.get(low + (high - low) / 2).getOrder().getFullDate(); while (i <= j) { while (table.get(i).getOrder().getFullDate().before(pivot)) { i++; ...
4da7a09c-1dd4-477d-817e-8f61e2b5e03a
6
private static void createDevices() { interrupt = new Interrupt(privilege); timer = new Timer(privilege); if (Config.getBoolean("Machine.bank")) bank = new ElevatorBank(privilege); if (Config.getBoolean("Machine.processor")) { if (numPhysPages == -1) numPhysPages = Config.getInteger("Processor.numPhys...
6df28ebf-8254-4585-8dbc-00cfb8210b20
9
private boolean validSampleId(String s) { if (s.equalsIgnoreCase("BLK")) { return false; } else if (s.equalsIgnoreCase("blank")) { return false; } else if (s.equalsIgnoreCase("water")) { return false; } else if (s.equalsIgnoreCase("unknown")) { return false; } else if (s.equalsIgnoreCase("*")) { ...
35727610-279d-429f-9fcf-b4be022e71f0
3
public final SymbolraetselASTNormalizer.arith_return arith() throws RecognitionException { SymbolraetselASTNormalizer.arith_return retval = new SymbolraetselASTNormalizer.arith_return(); retval.start = input.LT(1); CommonTree root_0 = null; CommonTree _first_0 = null; CommonTre...
accb122f-0466-4219-958d-c66db8579879
6
public static String escape(String string) { char c; String s = string.trim(); StringBuffer sb = new StringBuffer(); int length = s.length(); for (int i = 0; i < length; i += 1) { c = s.charAt(i); if (c < ' ' || c == '+' || c == '%' ...
edd18872-e312-4cb5-9030-3e5d59842674
8
public List<Insumo> select(Insumo selectInsumo) throws SQLException{ String nom = selectInsumo.getNombre(); Long id = selectInsumo.getId(); Connection con = SQLiteConnectionFactory.getInstance().getConnection(); String sql = null; if (nom != null && !nom.trim().equals("")){ sql = "select id, nombre, can...
437abc2a-7859-4287-a41f-a0357eef1d07
9
private MatText readTextArray(byte[] name, int[] dim, int P) { MatText data = new MatText(new String(name), dim); switch (P) { case P_DOUBLE: // they are stored as a list of rows, so we read them in as // such. This looks kind of backwards, but it works. ...
c74ad15b-f379-446f-8647-2aa882f9918c
5
private boolean isWon(FieldSlot[] line, FieldSlot player) { int eCount = 0; int pCount = 0; for (int i = 0; i < 3; i++) { if (line[i] == FieldSlot.EMPTY) eCount++; if (line[i] == player) pCount++; } if (eCount == 1 && pCount == 2) return true; return false; }
486f61b5-40df-4d53-8746-c4cca9d1f531
1
final int countTestsWithExternalIdfinal(Xpp3Dom results) { final AtomicInteger externalIds = new AtomicInteger(); new ForAllTestCases(results) { @Override void apply(Xpp3Dom each) { if (each.getAttribute("external_id") != null) { externalIds.in...
3e398e4b-fbe6-444a-ba00-87847700d0d7
3
public boolean accept(File f) { String filename = f.getName(); if(filename != null){ if(filename.endsWith(".gf") || f.isDirectory()){ return true; } } return false; }
d091b3b7-25d2-460e-8638-bc9b7e284e48
1
private static void verify(boolean ok, String msg) { if (!ok) { Throwable e = new Throwable(); System.out.println("Verification failed:" + msg); e.printStackTrace(); System.exit(1); } }
061265b9-9dde-4747-b9dd-9b6ca2fc12fe
9
public static void parseMehtod(Item item) { Item i = item; while(i == null || (i.getSym() != Constants.INDENT && i.getSym() != Constants.METHOD)){ i = Scanner.get(); } ObjectInfo oi = new ObjectInfo(); oi.setType(Constants.METHOD); oi.setName(String.valueOf(i.getVal())); GenerateForSpim.setWorki...
8a4718fe-9f1d-4827-a3e6-84a777f8d746
8
public boolean kopt3(Kswap2 kswap, int[] rightCuts, int i, int length,int k,int index, boolean first){ if(k==0){ // System.out.println("doing k swap on: "+Arrays.toString(rightCuts)); return kswap.startFindBestSolution(rightCuts); } if(index<=1&&System.currentTimeMillis()>=this.timeLimit){ return false; }//T...
cd97fb50-1a28-4f28-b436-8ec74480e624
8
@Override protected boolean mutatesTo(Object oldInstance, Object newInstance) { if(null == oldInstance || null == newInstance){ return false; } if(!oldInstance.getClass().isArray() || !newInstance.getClass().isArray()){ return false; } ...
a3881c57-a339-47c0-b1a0-b00994adaa2c
4
@Override protected void process(List<Previous> chunks) { if (!gui.paused.get()) { for (Previous chunk : chunks) { if (model.size() <= chunk.index) { model.add(chunk.index, chunk.index + ": " + chunk.newValue); } else { model.set(chunk.index, chunk.index + ": " + chunk.newValue); } if (c...
8042dfec-bcaa-4f35-a50e-0ba2f74b713d
1
public void editPatient(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{ log.debug("PatientManager editPatient method called..."); int healthRecord=Integer.parseInt(request.getParameter("healthRecord")); PatientService patientService=new PatientServiceImpl(); ...
1fef3600-21f9-474e-b166-4c510bac222b
3
int findMaximalActivitySet(int k, int s[], int f[]) { int n = s.length; // find the next compatible activity int m; for (m = k + 1; m < n; m++) if (s[m] >= f[k]) break; if (m < n) { maximalSet += m + " "; return 1 + findMaximalActivitySet(m, s, f); } return 0; }