method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
c64bb4a6-315a-4254-bd48-2441bc203011
7
public void checkCommand(String command, ArrayList<String> args) { if (command.equals(util.Protocol.CMD_CONNECT)) { cmdCONNECT(args); } else if (command.equals(util.Protocol.CMD_FEATURED)) { cmdFEATURED(args); } else if (command.equals(util.Protocol.CMD_JOIN)) { cmdJOIN(args); } else if (command.equals...
8041ab06-d3a2-4437-b457-6e134fd36b42
2
public void upDate(long gameTime) { if (Avatar.isDead) { Sound.playerDeath.play(); try { Thread.sleep(130); } catch (InterruptedException e) { e.printStackTrace(); } this.restart(); } avatar.update(map); avatar.move(); exitDoor.update(this, avatar); cannon.update(avatar, map); mo...
82a31ff4-89f5-44d0-a840-2b6ffe5b4ac6
5
public void setValueAt(Object value, int row, int column) { try { String tableName = metaData.getTableName(column + 1); // Some of the drivers seem buggy, tableName should not be null. if (tableName == null) { /*gavarela: Innecesrio que imprima en la consola de Java System.out...
03dcfecf-314c-4c35-bf82-f3ac4faa8032
2
private void RangeCheck(int index) { if (index >= size || index < 0) { throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + size); } }
1abe4648-0094-43f8-9d1a-5f0c4f6c7faf
4
public VInstrument readInstrument() { VInstrument read = null; JFileChooser fileChosser = new JFileChooser(); int option = fileChosser.showOpenDialog(VMainWindow.window); switch (option) { case JFileChooser.APPROVE_OPTION: try { ...
53e858c6-c100-47f6-8b76-23da3434fa7f
0
public ReportServlet() { super(); // TODO Auto-generated constructor stub }
452e3f84-3410-4ead-88d1-be30524e31f6
3
public static Map<String, String> loggedInBefore() throws IOException { Map<String, String> dbParams = new HashMap<String, String>(); BufferedReader reader = null; reader = new BufferedReader(new FileReader( System.getProperty("user.dir") + "/src/Settings/settings.txt")); String line; String[] l; whi...
93a7696c-e5a7-4aa2-b789-111129ed30cd
6
@Override public String getColumnName(int column) { switch (column) { case 0: return "Comp"; case 1: return "Date"; case 2: return "Count"; case 3: return "EID"; case 4: ...
06fa833e-9c8c-410b-82f0-c4c83f91b507
2
public static Set<Set<Integer>> allSubSet ( Set<Integer> s ) { Set<Set<Integer>> pre = new HashSet<>(); for ( Integer e : s ) { // System.out.println( pre ); // iterate through each set in pre // 1. add the new incoming element to each set in the set of set // 2. add the new incoming element...
b50c82e8-ba18-457a-b02d-9f3d10fa76a9
9
private void localClientAdded( Client client ) { if ( ! isProxiedClient( client ) ) { return; } // Register a proxy for the new local client on all the remote hubs // in the bridge. Metadata meta = getProxyMetadata( client ); Subscriptions subs = getProxySubs...
8dc0a7f9-5d56-4135-be2e-5be7cb1c98ac
8
public void update(GameContainer gc, StateBasedGame sbg, int delta) { super.update(gc, sbg, delta); Input input = gc.getInput(); if(input.isKeyDown(input.KEY_UP)) { if(world.canMove(x, y-1)) { world.panCameraY(1); setY(-1); } else { return; } } if(input.isKeyDown(input.KEY_DOWN)) { ...
27ff5c1a-9609-4924-8d11-4ae7de0578fa
1
public void addAccount(BankAccount account) throws IllegalArgumentException { if (! canHaveAsAccount(account)) throw new IllegalArgumentException(); accounts.add(account); }
28180ee9-53a7-450a-a067-6c11bdaf2a95
5
@Test public void getCostsTest() { Trainer test = null; Trainer test1 = null; try { test = new Trainer("Franz", 3); test1 = new Trainer("Karl", 5); } catch (Exception e) { fail("Unexpected Exception"); } try { Trainer test3 = new Trainer("Sepp", 12); } catch (ValueException e) { // expect...
8dfe91f8-4d27-43ae-97f5-f5ee55fd9c2b
8
final public void Program_parameter_type() throws ParseException { /*@bgen(jjtree) Program_parameter_type */ SimpleNode jjtn000 = new SimpleNode(JJTPROGRAM_PARAMETER_TYPE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtn000.jjtSetFirstToken(getToken(1)); try { ...
ca0362f1-9c67-436b-a30f-11e65a300584
6
private void dealNewRow(){ int randomPosition; for(int j = 0; j < A1Constants.NUMBER_OF_COLS; j++){ //set previous cards to inactive if(cards[currentRow[j]][j].equals(null)){ currentRow[j]--; }else{ cards[currentRow[j]][j].setActive(false); } } ...
14c9b4c7-3cf6-4bc9-b578-45811f57a942
7
private boolean jj_3_1() { Token xsp; xsp = jj_scanpos; if (jj_scan_token(15)) { jj_scanpos = xsp; if (jj_scan_token(30)) { jj_scanpos = xsp; if (jj_scan_token(16)) { jj_scanpos = xsp; if (jj_scan_token(31)) { jj_scanpos = xsp; if (jj_scan_token(73)) { jj_scanpos = xsp; ...
0c56907c-20a0-4c6a-a92f-48a9296b7085
5
@DELETE @Path("/deleteEvent") @Consumes(MediaType.APPLICATION_JSON) public Response deleteEvent(String jsonObject) { Gson gson = new GsonBuilder().setDateFormat(WS_DATE_PATTERN).create(); Event event = null; try { event = gson.fromJson(jsonObject, Event.class); } catch (JsonSyntaxException e1) { try {...
5629a65f-a6cd-4f99-8eea-271391c6cc46
6
public MapObject getObjectAt(int x, int y) { for (MapObject obj : objects) { // Attempt to get an object bordering the point that has no width if (obj.getWidth() == 0 && obj.getX() + bounds.x == x) { return obj; } // Attempt to get an object borde...
0e2fd18d-4a45-4082-a22a-d79c86094bc9
3
public void drawMap(Graphics g){ if( this.model != 1){ g.setColor(Color.black); g.fillRect(50, 50, 800, 500); }else{ g.setColor(Color.gray); for( int i = 0; i<Constant.MAP_Array_SIZE; i++){ for( int j = 0; j <80; j++){ g.drawRect(j * 10 + 50, i * 10 + 50, 10, 10); } } } draw...
f66ed10d-b85d-4ced-9271-90d3a15d7c96
2
private boolean pushProduction(int topStack, int tokenInput) { int p = PARSER_TABLE[topStack-FIRST_NON_TERMINAL][tokenInput-1]; if (p >= 0) { int[] production = PRODUCTIONS[p]; //empilha a produ��o em ordem reversa for (int i=production.length-1; i>=0; i--...
5418558d-46b8-4121-a153-594c17bd5c3d
4
public static void benchmarkSpeed(int iterations, StringSource src, StringDestination dst, StripAlgorithm... alg) throws Exception { Result[] speed = new Result[alg.length]; System.out.println("\nBenchmarking at " + iterations + " strings"); for (int j = 0; j < alg.length; j++) { S...
e3cc2e0a-3088-4f6f-ac44-f36b3745d0a6
7
public SecuredMessageTriggerBean executeProblem(SecuredMessageTriggerBean message) throws GranException { String text = message.getDescription(); SecuredTaskBean task = message.getTask(); EggBasket<SecuredUDFValueBean, SecuredTaskBean> refs = AdapterManager.getInstance().getSecuredIndexAdapterMa...
b3b3c5ca-fce9-46ad-9aff-170159c7db03
4
public void decreaseKey(int i, Key key) { if (i < 0 || i >= NMAX) throw new IndexOutOfBoundsException(); if (!contains(i)) throw new NoSuchElementException("index is not in the priority queue"); if (keys[i].compareTo(key) <= 0) throw new IllegalArgumentException("Calling decreaseKey() with given...
0089986c-b749-4304-a47b-acc07f9b922b
2
public void checkDeath() { for( int i = 0; i < COLS; i++ ) { //if the row above the board has anything in it //then death has occurred if( colorGrid[ROWS-STAGING_ROWS][i].isSet ) killed = true; } }
001ac28a-79c2-4ba3-ad62-9cb25bf50e69
0
public static int getMainMenuMask() { return MAIN_MENU_MASK; }
ba5106e8-1d99-4cc3-a92a-c95665117358
9
protected void readData() throws IOException { byte[] sbit = null; if (img.data.palette != null) throw new PngException("sBIT chunk must precede PLTE chunk"); int compare_depth = img.data.header.depth; switch (img.data.header.colorType) { case PngImage.COLOR_T...
ad89714e-94c2-4b09-8f33-3a9a4d7de7c3
8
public ArrayList<int[]> getPSemiFlows() { System.out.println(toString()); System.out.println("----------------------------------------------------"); for (int i = 0; i < numbOfRounds; i++) { MatrixRow subtractor = findFirstNotNullRow(i); if (subtractor == null) { ...
dd2b0985-b1c5-41e9-9ede-7b1d0a9b767f
5
protected IRemoteCallObject acceptResponse(final IRemoteCallObject callObj) throws RemoteCallException, EndOfConnectionException { //..handler answer from server (with error or not) IRemoteCallObject resco = callObj.getResponseRemoteCallObject(); if (callObj != null) { if (callObj.isError())...
7d15695a-c8d6-4b83-a0ce-c2bd89b655bc
2
@Override public String toString() { double numberOfExonsAvg = 0; double cdsLengthAvg = 0; double aaLengthAvg = 0; if (numberOfTranscripts > 0) { numberOfExonsAvg = numberOfExonsTotal / ((double) numberOfTranscripts); cdsLengthAvg = cdsLengthTotal / ((double) numberOfTranscripts); } if (aaLengthCou...
6499ad7f-f177-47d8-abd6-31de5c79c008
1
protected boolean isRowDragAcceptable(DropTargetDragEvent event, ArrayList<TreeRow> rows) { return mAllowRowDropFromExternal ? true : rows.get(0).getTreeRoot() == mRoot; }
857c9c37-f6d8-4b30-bbb2-392f927f798d
4
void displayCurrentPoint(Coordinate cp) { for (int y = 0; y < columnLength; y++) { for (int x = 0; x < columns; x++) { System.out.print(Ladder4.ladderAL.get(x)[y]); if (cp.getX() == x && cp.getY() == y) { System.out.print(" *"); } System.out.print("\t"); } System.out.println(); } Sys...
87779478-1090-4eb6-87f9-f5240f3b563b
6
public static void main(String args[]) { try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); ...
1675a8df-84ff-406f-a864-ab6250c85368
5
private void initBtnPane() { btnPane = new JPanel(); JButton btnOK = new JButton("Valider"); JButton btnCancel = new JButton("Annuler"); this.getRootPane().setDefaultButton(btnOK); btnOK.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // récupère les valeurs ...
32301fed-6240-406c-aaab-2ad0f2a5c3ed
3
public static String getUUIDFromName(String name) { try { ProfileData profC = new ProfileData(name); String UUID = null; for (int i = 1; i <= 100; i++) { PlayerProfile[] result = post(new URL("[url]https://api.mojang.com/profiles/page/[/url]" + i), Proxy.NO_PROXY, gson.toJson(profC).getBytes()); if (result.length == 0)...
292d2885-b7c7-420b-9dbf-f755b6915516
1
@Override public String getStatement() { if (multiply) return getX() + "x = " + getY(); else return "x / " + getX() + " = " + getY(); }
8b33834f-043e-45c5-959c-8fb6c849e3b6
8
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (getClass() != obj.getClass()) { return false; } TransientProperty<?> other = (TransientProperty<?...
c3988dbd-ce19-485e-b36a-671843f1e85a
6
private int partition(double[] input, int lo, int hi) { int i = lo; int j = hi+1; int anchor = lo; while (true) { while (Helper.less(input, ++i, anchor)) { if (i == hi) break; } while (Helper.less(input, anchor, --j)) { if (j == lo) break; } if (i >= j) break; Helper.exch(input, i, j);...
0229b0b2-e3db-4afc-8160-ffab828e6339
0
@Override public void init(List<String> argumentList) { }
3b6d1b5f-5ec3-43c4-9b27-b0a0a3f3175c
1
protected boolean skipFrame() throws JavaLayerException { Header h = bitstream.readFrame(); if (h == null) { return false; } bitstream.closeFrame(); return true; }
eee06be5-0667-4220-8d95-d644144b054c
6
public void testRotateBlocks() throws Exception { Clipboard clipboard = new Clipboard(new BlockVector(3,4,5)); BlockVector originalSize = clipboard.getSize(); for (int x=0;x<clipboard.getSize().getBlockX();x++) { for (int y=0;y<clipboard.getSize().getBlockY();y++) { f...
880e198d-cfc5-4aab-a507-9c70f7147da3
0
public List<String> getOpChannels(){ return OpChannels; }
c2c10f11-1ce6-4b94-8dec-8def75ebeb8e
7
public static List<Object> getAllElementFromObject(Object obj, Class<?> toSearch) { List<Object> result = new ArrayList<Object>(); if (obj instanceof JAXBElement) obj = ((JAXBElement<?>)obj).getValue(); if (obj.getClass().equals(toSearch)) result.add(obj); else if (obj instanceof ContentAccessor) { Lis...
688b5f5e-f7b4-4014-a986-d3b32c3bb04f
7
private List<List<Player>> createAllCombos(int playersToAdd, List<Player> participatingPlayers, List<List<Player>> combosList) { ArrayList<List<Player>> combos = new ArrayList<List<Player>>(); for (List<Player> comboPrefix : combosList) { Player lastPlayerChosen = null; boolean passedLastPlayer; if ...
4dd19b22-ec09-41b1-a0ae-5365652c1151
9
public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); // Scanner scan = new Scanner(System.in); StringBuilder out = new StringBuilder(); String line; int dp[][] = new int[13][13]; /* * dp[1][11] = 1; dp[2][10] = 11; dp[3][9] ...
dc431828-2153-4033-a5de-550a2b59d030
2
public String readAllGameInformation() { String fileContents = ""; String fileName = "saveFile.txt"; File currentSaveFile = new File(fileName); Scanner fileReader; try { fileReader = new Scanner(currentSaveFile); while (fileReader.hasNext()) { fileContents += fileReader.nextLine(); } fi...
ea5d859d-b323-4fec-b41a-6f02207b328a
4
@MethodInformation(author="Matthias", date="09.12.2012", description="Gives back a double that describes the average carrying capacity of all BioTraktor") protected double avgCapacityBio() throws DivideByZeroException{ MyIterator it = (MyIterator) traktoren.iterator(); double sum = 0; int count = 0; while(i...
e74c24bf-cc51-41c9-bbef-8399c83a6fcd
4
public String getAnswer(){ int largest = 0; for (int i = 999; i > 900; i--) for (int x = 999; x > 900; x--) if(i * x > largest && isPalindrome(i * x) == true) return String.valueOf(i * x); return String.valueOf(largest); }
884ac772-aab6-4014-ad8c-9261cb1ccd40
5
public static void questChecked() { if (GlobalParams.isQuest) { // Forgotten Village Quests if (GlobalParams.FVQuestTraningCamp == 2) { n = 3; checkedEngine(); if (GlobalParams.FVQuestTraningCampItem >= 3) { GlobalParams.FVQuestTraningCamp = 3; } } if (GlobalParams.FVQuestTraningCam...
b5d5c7ed-23b8-4af8-a42b-faec759c8017
0
public Attribute() { }
df225e6c-8677-43eb-972f-c9a57f89996a
1
public boolean canHaveAsCustomerId(String customerId) { return (customerId != null) && (customerId.length() >= 3); }
d47bb631-d939-488a-b9b9-3c2c3d22d17c
4
private Vector shuffle(Vector v) { // Working in arrays is just a good deal easier // than working out the Vector positions. Object [] vectorArray = new Object[v.size()]; for (int i = 0; i < numberOfAgents; i++) vectorArray[i] = v.elementAt(i); for(int i = 0; i < numberOfAgents; i++){ int...
c3522aaa-8b63-40c0-be74-6421fad4a00c
6
public List<Posicao> posicoesPossiveisPeca(Posicao posicao) { List<Posicao> posicoesPossiveis = new ArrayList<>(); Peca peca = this.getCasas(posicao.getColuna(), posicao.getLinha()); switch (peca.toString()) { // verificacao do peao case "P": ...
57e33a1b-7c94-4bcc-a9bc-c2a78ef0909f
6
public void eliminaX(T x){ if(this.inicio == null ){ System.out.println("Lista vacia"); }else{ Nodo<T> nodoQ = this.inicio; Nodo<T> nodoT = null; boolean bandera = true; while(nodoQ.getInfo() != x && bandera){ if(nodoQ.getLiga() != null){ nodoT = nodoQ; nodoQ = nodoQ.getLiga(); ...
cbf3f43d-1a56-4e2b-adae-f0ef2e5cb197
9
public static double[] validate(Classifier cl, ArrayList<double[]> data) { int truePositive = 0, falsePositive = 0, trueNegative = 0, falseNegative = 0, prediction; double precision,recall, actualDiagnosis, accuracy,f1score; //make pre...
197eac1d-2230-4327-b9ab-8736de399b38
7
public static void main(String[] args) { HashMap<EnumDistributor, Integer> list = new HashMap<>(); int modifier = 1; /*for(long i = 0; i < 100000; i++){ if(i > -1 && i < 33333) modifier = 1; if(i >= 33333 && i < 66666) modifier = 2; if(i >= 66666) modifier = 3; EnumDistributor random ...
6b510493-0c8f-4941-a36e-76dc9631d315
9
@Override public <N, T> QualifiedValue<T> addValue(TKey<N, T> key, T value, Enum<?>... qualifiers) { if (value == null) { throw new IllegalArgumentException( "Argument 'value' should not be null!"); } Set<Enum<?>> quals = new LinkedHashSet<>(); for (E...
878596a6-2cb3-48f0-81bf-23d184edaab9
6
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus){ Component renderer = delegate.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); if(!showRootNodeCheckBox && tree.getMode...
24b7a091-da9d-4f65-a61a-de030700608f
6
private void loadSteps() { // Get document element object Element docEle = dom.getDocumentElement(); // Get the Step names nodes NodeList nl = docEle.getElementsByTagName("Step"); // If node is not null and has children if (nl != null && nl.getLength() > 0) { ...
e82b6bc8-14a1-4c74-8137-343373e45eec
7
public static int discrete(double[] a) { double EPSILON = 1E-14; double sum = 0.0; for (int i = 0; i < a.length; i++) { if (a[i] < 0.0) throw new IllegalArgumentException("array entry " + i + " is negative: " + a[i]); sum = sum + a[i]; } if (sum > 1.0 + EP...
68561c42-6715-4475-b6da-98992c9a6e59
5
static final String method2162(boolean bool) { if (bool != false) aLong6276 = -88L; anInt6271++; String string = "www"; if (Class367_Sub8.aClass364_7361 != Class8.modeWhere) { if (Class8.modeWhere != Class26.aClass364_382) { if (Class8.modeWhere == Class108.aClass364_1657) string = "www-wtwip"; ...
6c7e6401-0c05-49a2-8e5e-7c488aeb39b3
6
private void createView(){ Action menuViewAction = new AbstractAction() { private static final long serialVersionUID = 1L; public void actionPerformed(ActionEvent ae) { System.out.println("view clicked"); } }; // ---- set up the choices on the View menu ---- menuView = new JMenu("View"); menuV...
61eb0f21-5cde-412d-ae7e-5a6cb3f00cc8
3
private void IndexOutOfBound(int givenIndex) { if (this.isempty() || givenIndex > this.length - 1 || givenIndex < 0) throw new IndexOutOfBoundsException( "Given index is bigger than List max length!"); }
c3013a82-0231-43d1-acab-ebcb2e867983
4
public V put(K key, V value){ V oldValue = null; int index = Math.abs(key.hashCode()) % SIZE; if(buckets[index] == null) buckets[index] = new LinkedList<MapEntry<K,V>>(); LinkedList<MapEntry<K, V>> bucket = buckets[index]; MapEntry<K, V> pair = new MapEntry<K, V>(key, value); boolean found = false; ...
a91e84fe-e527-4880-a3e8-a949ee998713
4
public static String toString(JSONObject jo) throws JSONException { StringBuilder sb = new StringBuilder(); sb.append(escape(jo.getString("name"))); sb.append("="); sb.append(escape(jo.getString("value"))); if (jo.has("expires")) { sb.append(";expires="); ...
b36e6ed4-3edd-419b-8230-bf49839c3ab7
7
public void Print() { String str = ""; int lv = this.level; while(lv != 0) { str += "\t"; lv--; } switch(this.nodetype) { case NODE: str += "<" + NODE; break; case REPLICA: str += "<" + REPLICA; break; case REF: str += "<" + REF; break; case ATTR: str += "<" + ATTRIBUTE; ...
e960031b-c894-47ce-8eab-6efcb77e55c5
9
public int buyProposition(Unit unit, Settlement settlement, Goods goods, int gold) { logger.finest("Entering method buyProposition"); Player buyer = unit.getOwner(); String goldKey = "tradeGold#" + goods.getType().getId() + "#" + goods.getAmount() + "#" + settlement.getId(); ...
47e5fc80-60c8-4131-b2b3-ce363446b744
2
private void isLessThanEqualsToString(String param, Object value) { if (value instanceof String) { if (param.compareTo((String) value) >= 0) { throw new IllegalStateException("String is not greater than supplied value."); } } else { throw new IllegalArgumentException(); } }
39b1047e-0174-4c1b-aca2-d7e7820bf438
6
public String processTag(int level, XMLNode tag) throws ProcessorException { try { return super.processTag(level, tag); } // A ProcessorException at this point can mean several things. catch (ProcessorException e0) { // It could be a deprecated...
77de96f2-3048-45a2-b152-f26156485425
0
@Basic @Column(name = "SOL_USUARIO") public String getSolUsuario() { return solUsuario; }
0b0bdddb-5e65-4458-b5de-d447bff13bab
3
public static String getMemoryBar(int size, Runtime run) { String line = ""; double percentUsed = (run.totalMemory() - run.freeMemory()) / run.maxMemory(); int pivot = (int) Math.floor(size * percentUsed); for (int i = 0; i < pivot - 1; i++) line += "="; if (pivot < size - 1) line += "+"; for (int...
be2038d9-a3f3-4fff-a353-82c7906fc8db
0
public String getOldTranslation(){ return oldTranslation.getText(); }
18e0afba-d097-498e-80c4-16fc46d96f02
5
public void updateSheetReferences( Boundsheet newSheet ) { for( int i = 0; i < expression.size(); i++ ) { Object o = expression.elementAt( i ); if( o instanceof PtgMemFunc ) { PtgMemFunc pmf = (PtgMemFunc) o; Stack s = pmf.getSubExpression(); for( int x = 0; x < s.size(); x++ ) { Obje...
db4b3c90-715a-4883-8794-851f032b7a0e
7
@Override public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] args) { if (sender.isOp() || sender.hasPermission("pwp.admin")) { if (args.length == 0) { sender.sendMessage(Plugin.color("&c[&4PWP&c] &fUsage: &7/pwp reload|version")); } else { if (args[0].equalsIgnoreCase("r...
879c4caf-3868-4431-8c4f-76f4304bf02a
3
public Picking getPickingByCourierId(final String courierId) { return new Synchronizator<Picking>() { @Override Picking execute() { List<Picking> pickings = pickingStorage.getPickings(); for (Picking p : pickings) { if (p.getCourierId().equals(courierId) && p.getPickingStates() == PickingSta...
09d08e00-9288-4bc0-9e3a-bce6a65956da
3
private void insertProtectedRegionStores() { db(" Inserting protected region stores"); final HashSet tryPreds = new HashSet(); final Iterator blocks = catchBlocks.iterator(); // Iterate over the blocks in this control flow graph. Build a // set of predacessors of all protected blocks that themselves are ...
ebef378b-0d1d-468b-951d-cf062cbbbae8
4
public boolean isDueToday(boolean dateOnly) { if (this.getDueDate() == null) return false; Calendar today = Calendar.getInstance(); if (org.apache.commons.lang3.time.DateUtils.isSameDay( today, this.getDueDate())) { if (dateOnly) { return true; } else { if (today.compareTo(this.getDueD...
9bf42b94-5dc2-4f50-bc89-92ee1395049f
1
public static void main(String[] args) throws SQLException { DriverManager.registerDriver(new OracleDriver()); String username = "system"; String password = "orcl"; // String url = "jdbc:oracle:thin:@" + "10.22.146.229:1521:orcl"; String url = "jdbc:oracle:thin:@" + "localhost:1...
b08c6d7d-8c28-4d77-b0e1-30df3d9d9f38
2
public boolean hasUserDecrypted(String userID) { for (int i = 0; i < usersDecryptedTable.size(); i++) { if (usersDecryptedTable.get(i).getID().equals(userID)) { return true; } } return false; }
f7c48f52-52ee-4d42-bf9f-c22420d7838c
4
public void setPaused(boolean paused) { if (this.paused != paused && sequencer != null && sequencer.isOpen()) { this.paused = paused; if (paused) { sequencer.stop(); } else { sequencer.start(); } } }
a412548a-0e5b-4af0-a750-7fad302efd34
8
private boolean loadMDModel(final String uri) { if (uri == null) return false; final ModelCanvas mc = insertModel(uri.toLowerCase().endsWith("gbl") ? GBContainer.getCompatibleName() : ChemContainer.getCompatibleName()); if (mc == null) return false; final boolean b = isEditable(); if (!b) setEditable...
d8979eda-eba8-486c-9e70-0e2d29eb3454
2
@Override protected void loadNBT(NBTTagCompound data) { super.loadNBT(data); // uuid = MiscTools.readUUID(data, "uuid"); if (data.hasKey("trackCache")) { NBTTagList tagList = data.getTagList("trackCache", 10); for (int i = 0; i < tagList.tagCount(); i++) { ...
81ed7ef3-51e2-48a2-8444-a0ac6ebd1216
4
public static void printSQLException(SQLException ex) { for (Throwable e : ex) { if (e instanceof SQLException) { if (ignoreSQLException( ((SQLException) e). getSQLState()) == false) { e.printStackTrace(System.err)...
6fa123f6-6ffd-4466-9bb7-d2b9f89b5fd7
1
public String toString() { StringBuffer buffer = new StringBuffer(200); buffer.append("Layer "); buffer.append(layer_string()); buffer.append(" frame "); buffer.append(mode_string()); buffer.append(' '); buffer.append(version_string()); if (!checksums()) buffer.append(" no"); buffer.append(" check...
52e45b6e-20a8-4199-a365-e6e85df8c258
8
public void setRandomColor(long randomseed){ isRandom = true; Random r = new Random(); r.setSeed(randomseed); switch(r.nextInt(8)){ case 0: color = Color.blue; break; case 1: color = Color.pink; break; case 2: color = Color.magenta; break; case 3: color = Color.cyan; ...
6a0e3b85-d3e1-485b-949e-ef88953e34dc
5
private void screenUpdate() { Graphics2D g; try { if(isFullscreen) { BufferStrategy bs = myWindow.getBufferStrategy(); g = (Graphics2D)bs.getDrawGraphics(); gameRender(g); g.dispose(); if(!bufferStrategy.conten...
82dbeaab-2a8b-44b0-8316-a206af650793
7
private List<PFPAd> getAds(RequestBean request, Document doc) throws CitysearchException { log.info("PFPProxy.getAds: Begin"); List<PFPAd> pfpAds = new ArrayList<PFPAd>(); if (doc != null && doc.hasRootElement()) { SortedMap<Double, List<Element>> elmsSortedByDistance = new TreeMap<D...
a33dc6ea-e6d0-4476-974d-2e18aadf472b
3
public String getAdjustType() { String adjust = ""; if(adjustSet.isSelected()) adjust = "0"; else if(adjustAdd.isSelected()) adjust = "1"; else if(adjustSubtract.isSelected()) adjust = "2"; return adjust; }
7504eb58-3e80-4e15-a9a2-f4a499906d09
6
public static void mult_small( DenseD2Matrix64F a , DenseD2Matrix64F b , DenseD2Matrix64F c ) { if( a.numCols != b.numRows ) { throw new MatrixDimensionException("The 'a' and 'b' matrices do not have compatible dimensions"); } else if( a.numRows != c.numRows || b.numCols != c.numCols ) {...
153666b3-3ed3-4413-a418-7622a51d1bac
8
public void actionPerformed(ActionEvent e) { //############### if (e.getSource().equals(browseResumeButton)) { FileFilter filter = new FileNameExtensionFilter("TextFile", "txt"); JFileChooser chooser = new JFileChooser(); //chooser.addChoosableFileFilter(filter); chooser.setFile...
8ad81e69-e2ab-41bc-9d5e-c6f2784417f4
0
public Note getNote() { return myNote; }
b5571e1c-fccc-4b4d-8b33-ad033c29eb33
0
public String getType() { return "re"; }
c0397112-d7bd-4789-816c-ddc0af936213
0
public List<Throwable> getList() { return new ArrayList<Throwable>(exceptions); }
0ac3c266-1fcb-4d00-9238-6f113cb6a43b
1
public void transfer(int from, int to, double amount) throws InterruptedException { bankLock.lock(); try { while (accounts[from] < amount) sufficientFunds.await(); System.out.print(Thread.currentThread()); accounts[from] -= amount; System.out.printf("...
4836b5f4-a452-49b7-b002-ca300ba3f646
9
public static int[] rotationArray() { int n = cad.length; Integer[] order = new Integer[n]; for (int i = 0; i < n; i++) order[i] = i; Arrays.sort(order, comp); int[] sa = new int[n]; int[] classes = new int[n]; for (int i = 0; i < n; i++) { sa[i] = order[i]; classes[i] = cad[i]; } for (int le...
1e71889c-a66a-4310-8c3d-cc90e13bbc51
4
private boolean load() { try (BufferedReader reader = new BufferedReader(new FileReader(dataFilename))) { String elementCountString = reader.readLine(); int roomCount = Integer.valueOf(elementCountString); for(int roomIndex = 0; roomIndex < roomCount; ++roomIndex) { ...
6319419c-28a9-4f9e-8d9d-9a0c9a70e8c9
6
public void checkFile(String person, int i, String[] paths) { try { ArrayList<User> users = DataBase.getInstance().getUsers(); for (Iterator it = users.iterator(); it.hasNext();) { User user = (User) it.next(); if (user.getLogin().equals(person)) { ...
8945f321-4f16-41c9-9dbf-d6a66e105f41
1
private void jTextFieldCmdCliQte5FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldCmdCliQte5FocusLost mondecimal = new DecimalFormat("#######.00"); if (!(jTextFieldCmdCliQte5.getText().equals(""))) { int qte = Integer.parseInt(jTextFieldCmdCliQte5.getText().trim())...
eb4aea77-2a8f-4031-a9a3-b31352c38a06
2
@Override public FractalValue div(FractalValue val) throws FractalException { if (! val.isNumber()) { throw new FractalTypeException(FractalTypes.REAL, val.getType()); } else if (val.isInt()) { return new FractalInt(intValue() / val.intValue()); } else { r...
df4391ae-ac72-4e19-931b-866fee7d2eb2
8
public void print(InstanceList docs, double limit, int num, String file) { assert docs.size() == D; try { PrintWriter pw = new PrintWriter(file, "UTF-8"); pw.println("#doc source topic proportion ..."); Probability[] probs = new Probability[T]; for (int d=0; d<D; d++) { pw...
87524192-aae5-4e87-833e-e874ddaa3d28
2
@Override public void memberRemoved(final MembershipEvent membershipEvent) { final String removedMemberId = membershipEvent.getMember().getUuid(); logger.info("Found there is one node removed from this cluster: {}", removedMemberId); final Optional<NodeRecord> masterNode = this.hazelcastHe...