method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
691d8d12-9f1c-41a1-9575-f0c057fdbccc
0
@Override public void dragg(Excel start, Excel finish) { }
42da2626-579a-4e0c-9492-ef88abcfb4b7
7
public ConfigurationSerializable deserialize(Map<String, Object> args) { ConfigurationSerializable result = null; Method method = null; if (result == null) { method = getMethod("deserialize", true); if (method != null) { result = deserializeViaMethod(me...
c79ad645-0032-4cf2-91d2-ad57148a3d9d
6
public void WriteOut ( CostAndRangeRanking CARR, int Term ) { File file = new File ( ".\\recycle\\WriteOut\\WritedOut" + Term + "_data.txt" ); //ރt@C ReadFile RR = CARR.getRF(); PrintWriter pw; try { pw = new PrintWriter (new BufferedWriter ( new FileWriter ( file ) ) ); pw.println( "=============" + Term...
55a0b7ce-8ce1-4b5d-8850-c2a557938aad
1
@Override public void execute() { ManPageUtil util = new ManPageUtil(plugin.getConfig().getString("locale", "en")); Player receiver = getReceiver(); // display the help to the console if (receiver == null) { String manPageText = util.getMan(getManPage()); Ter...
e3e8a040-93e3-465c-8484-fd57a5183057
5
@FXML private void handleMenuReportDetail(ActionEvent event) { FXMLLoader fxmlLoader = new FXMLLoader(PosApplication.class.getResource("ReportDetail.fxml")); final Region reportDetail; try { reportDetail = (Region) fxmlLoader.load(); } catch (IOException e) { ...
16560c87-2fcb-46c3-bd8d-70855dd11997
0
@Test public void KuoloEste() { assertTrue("Este oli väärän tyyppinen", t.onkoPisteessaEste(new Piste(250, 250)) == EsteenTyyppi.KUOLO); }
9894df26-901f-4848-8878-036e26bc937a
2
@Override public Object load(){ Object model=null; Statement stmt=null; XStream xStream = new XStream(new DomDriver()); try { stmt = db.getConnection().createStatement(); ResultSet rs = stmt.executeQuery("SELECT users FROM Users"); db.getConnection().commit(); while (rs.next()) { // byte[] st...
34eb2184-5f17-45ae-8c3d-d7cdee44f4c1
7
public int minDepth(TreeNode root) { Stack<TreeNode> nextNode = new Stack<TreeNode>(); Stack<Integer> nextNodeDepth = new Stack<Integer>(); int depth = 0; int min = Integer.MAX_VALUE; if(root == null) { return 0; } nextNode.push(root); nextNodeDep...
fa8009b0-61a7-4455-859c-cabf6453dd14
2
public List<Planet> NeutralPlanets() { List<Planet> r = new ArrayList<Planet>(); for (Planet p : planets) { if (p.Owner() == 0) { r.add(p); } } return r; }
b4a8672a-50fb-4ee4-9455-e7208aff50a0
1
public static void exportBatch(SegmentedImage[] tracked, String out){ for(int i = 0; i < tracked.length; i++){ System.out.println("Exporting image " + i); String dirName = out + " t" + i; File dir = new File(dirName); dir.mkdir(); ImageExporter.saveTiff(tracked[i], dirName + "\\"); } System.out....
661c7206-c285-4067-9b92-908016ada5cc
4
@Override public void update(Observable o, Object arg) { if(state == GameState.DURING && arg instanceof Piece) { // A piece was placed. switchPlayer(); if(board.getValidMoves(currentPlayer.getColor()).size() == 0) { // The other player can't play, switch back. switc...
5a7062a8-dcc9-405d-bbd6-d5a089051302
7
private void txtSearchEmpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtSearchEmpActionPerformed try{ int key=jComboBox1.getSelectedIndex(); String search=txtSearchEmp.getText(); String query2=""; switch(key){ ca...
5b4a19f4-af66-45da-b42a-73fbd8ec5ede
8
void addItem(TableTreeItem item, int index) { if (item == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (index < 0 || index > items.length) SWT.error(SWT.ERROR_INVALID_ARGUMENT); /* Now that item has a sub-node it must indicate that it can be expanded */ if (items.length == 0 && index == 0) { if (table...
e4db10ed-de9f-4e3a-9148-933edbf132ba
2
public byte[] getAsBytes() { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(baos); dos.write(postHash); dos.write(parentHash); dos.writeUTF(new Gson().toJson(this.postInfo)); ...
81f8766f-0b95-45bc-b024-42e22ae89514
1
@DELETE @Produces(MediaType.APPLICATION_JSON) public void deleteTask(@PathParam("id") int id) throws SQLException { if (daoHelper.isIdExist(id)) { daoHelper.deleteTask(id); } }
bd927750-6751-46fc-be6c-63005a52781c
1
public void turn(int x, int y)//翻開 { buttons[x][y].setBackground(Color.LIGHT_GRAY); if(aroundBombNum[x][y]>0) buttons[x][y].setText(Integer.toString(aroundBombNum[x][y])); isTurned[x][y] = true; isPressed[x][y] = true; }
dfa903e6-bcab-41ab-b872-5fc750c1811b
7
private void processRemove(WriteBatch batch, DataFile df, LogFile lf) { if (df != null && lf != null) { df.decrement(batch.removeOPCount); this.enqueueLock.lock(); try { if (df.getLength() >= JournalStore.FILE_SIZE && df.isUnUsed()) { if (...
22994aca-d5a6-4a01-a614-e9cce75acf42
1
public static void runArbi() { if(arbiThread != null) { arbiThread.interrupt(); } arbiThread = new Thread(new Runnable() { @Override public void run() { p1Type= ui.getP1(); p2Type = ui.getP2(); p1 = getPlayer(p1Type); p2 = getPlayer(p2Type); arbi = new Arbiter(p1, p2, 700, 700...
2bc80599-5b2f-4a65-bca5-b0c1248689a5
5
public void init() { calls = new HashMap<String, CallWindow>(); JFrame f = new JFrame("Chat Client Window"); f.setLayout(null); f.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); f.addWindowListener(new WindowListener() { public void windowActivated(WindowEvent arg0) { // Do nothing } public...
6e7d2934-183f-4ff3-bd55-8702c63f3845
2
@Override public boolean damage(int damage){ Random rand = new Random(System.currentTimeMillis()); if (rand.nextInt(PlayerInfo.JUKECHANCE) == 0){ setHealth(this.health - damage); if (health <= 0) { kill(); } return true; } return true; }
6bd30822-5f41-45ba-95b5-64e9f22d5cbb
8
private INode findReducable(ISubModel model) { boolean flag; // Parcours de tous les nœuds for (INode node : model.getNodes()) { flag = true; // Parcours des conditions de réduction for (ICondition cond : this.conditions) { if (!cond.isVerify(node)) { flag = false; break; } } if (fla...
d140b968-39fb-4ea4-8204-bae67e99d0ac
9
@Override public AlgorithmOutput start() { //Give students a random order if(!labs.isEmpty()){ Collections.shuffle(students); //Sort students into labs for(Student s: students){ s.combineLabs(); if(s.getCombinedLabs().isEmpty()){ s.setFlaggedForLabs(true); s.setReasonForFlagging("Student...
2b07dce2-6101-422e-9912-6abe0e658e72
3
public Recording find(String id, int type){ Recording recording = new Recording(); try { Statement st = conn.createStatement(); String query = "SELECT * FROM recordings WHERE id = '" + id + "' AND filetype = '" + type + "'"; ResultSet res = st.executeQuery(query); if(res.next()){ /...
9e3f5ae4-4e78-4341-962c-c5683333069c
0
@Test public void testGetLastErrors() throws Exception { //last errors ArrayList<String> lastErrors; String assertString1, assertString2, assertString3; //we have to know future this.terminal.isReadyForGetTotal(); //last errors lastErrors = this.terminal.getLastErrors(); assertString1 = "[P-1P ? : ...
07c8e062-443c-4e12-8c0a-86ee912fd1ce
6
private int count1_bitcount(int [] ix, EChannel cod_info) { int p, i, k; int signbits; int sum0 = 0, sum1 = 0; int count1End = bigvalues_region + count1_region; for(i = bigvalues_region, k=0; k < count1End; i+=4, k++) { v = Math.abs(ix[i]); w = Math.abs(ix[i+1]); x = Math.abs(ix[i+2]); y = Math.a...
ac843c56-4134-468c-9715-4c2fe0d31bf1
1
@Override public long longValue() { final int fractionalFactor = DPU.toFractionalFactor(factor); if (fractionalFactor > 0) { return 0; } else { return base / DPU.getScale(factor); } }
5d2a7967-7205-4bb4-be8b-b49b7d2d935b
4
public void loadUser(String id) { if (!StringUtil.isBlank(id)) { PreparedStatement st = null; ResultSet rs = null; try { conn = dbconn.getConnection(); st = conn.prepareStatement("SELECT * FROM users WHERE id = " + id + " limit 1"); ...
cf049a2c-c484-4c6e-8ecd-5877cdaf2cfc
6
protected void resolveEntity(StringBuffer buf) throws IOException { char ch = '\0'; StringBuffer keyBuf = new StringBuffer(); for (;;) { ch = this.readChar(); if (ch == ';') { break; } keyBuf.append(ch); } ...
f8be07ad-020d-4013-abad-2ce254d90536
0
public void setDeathSpawnLocation(Location deathspawn) { this.deathspawn = deathspawn; }
a2c32e22-3a8a-4ecf-ac41-adb50ec6759b
0
public String getKeyProfileId() { return keyProfileId; }
1b8e5547-0a5d-47dd-b7dd-a5b0e048ca0a
9
private static PDFDecrypter createStandardDecrypter( PDFObject encryptDict, PDFObject documentId, PDFPassword password, Integer keyLength, boolean encryptMetadata, StandardDecrypter.EncryptionAlgorithm encryptionAlgorithm) throws ...
13bb8c34-43ac-4661-9780-2a279320446f
5
public Renter getRenterByName(String token, String renterName) throws AccessException{ if(token != "abcd1234") throw new AccessException("Access denied"); try{ boolean notFound = true; Iterator<Renter> I = this.renters.iterator(); while(I.hasNext()){ Renter temp = (Renter)I.next(); if(renterName....
992e3223-a390-4f4e-9944-5b95c52eddac
7
@Override public boolean execute(Mob usr) { Container loc = usr.getLoc(); //Search the player's loc for the item's container, if we need to. if(getTargetContainer() != null){ Obj container = search(getTargetContainer(), loc); if (container != null && container.isConta...
ff9571c8-d559-4a17-8b39-e641dd2c3423
9
protected static FastVector pruneCadidates(FastVector allCandidates, FastVector kMinusOneSequences) { FastVector prunedCandidates = new FastVector(); boolean isFrequent; //for each candidate for (int i = 0; i < allCandidates.size(); i++) { Sequence candidate = (Sequence) allCandidates.elementAt(i)...
6e6203c0-db09-4eed-8d54-98502e9ab7cb
5
protected void exportDone(JComponent c, Transferable data, int action) { if (action != MOVE) { return; } if ((p0 != null) && (p1 != null) && (p0.getOffset() != p1.getOffset())) { try { JTextComponent tc = (JTextComponent)c; tc.g...
f3a4fcaf-8b3c-4df9-8fd3-329a34aa65e5
7
@Override public boolean put( K key, V value ) { if ( key == null ) { throw new IllegalArgumentException( "key was null" ); } if ( value == null ) { throw new IllegalArgumentException( "value was null" ); } int offset = offset( key ...
09d90c45-6ae7-4448-8373-f22966ad5ff4
6
public void resetItems() { int iconNum; int borders; images = new ImageTemplate[]{ new ImageTemplate(elem_electricPng, 206, (Height) * winZoom , 27 * winZoom, 30 * winZoom ), new ImageTemplate(elem_setpropPng, 206 + 31 * winZoom, (Height) * winZoom, 54 * winZ...
7a99893a-747d-4057-8679-a17dda5621e8
6
public boolean shortSearch(int v) { p = root; if (p == null) return false; while (p != null) { int i; for (i = 1; i <= p.numOfElements; i++) { // ҵԪ if (p.value[i] == v) { // Message.EndSearch(); return true; } if (p.value[i] > v) break; } // p½ʵλ if (i <= p.num...
1196e384-4043-48cf-8229-95719d6f5634
8
public void player2move(){ if (WPressed) { if(!player2.offscreentop) { player2.setY(player2.getY() - player2Speed); } } if (SPressed) { if(!player2.offscreenbottom) ...
e2120e99-2e54-460d-9629-56abfc1a358d
9
public boolean similar(Object other) { try { if (!(other instanceof JSONObject)) { return false; } Set<String> set = this.keySet(); if (!set.equals(((JSONObject)other).keySet())) { return false; } Iterator<St...
451a38c6-111a-4522-bd40-d710d2988dab
3
public static boolean isPrime(long num) { if(num==2){ return true; } for (int i = 2; i <= (num + 1) / 2; i++) { if (num % i == 0) { return false; } } return true; }
67b1fbbf-23a9-43c8-a660-092763ab861d
9
public String nextToken() throws JSONException { char c; char q; StringBuffer sb = new StringBuffer(); do { c = next(); } while (Character.isWhitespace(c)); if (c == '"' || c == '\'') { q = c; for (;;) { c = next(); ...
96eaa48b-c5c7-45eb-8c5e-b90f78ff57d1
1
@Override public FileVisitResult postVisitDirectory(Path path, IOException exception) throws IOException { if (exception != null) { Log.error(exception); } return FileVisitResult.CONTINUE; }
df1b6f08-1c40-473d-b391-eaf1d17f9cd5
6
public void main(String [] Lista) { Lista_meta= Lista; /* 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. ...
0b968e03-eea5-48ca-b819-42d2f22c5f26
2
public void removeCard(Card card, Slot cardDestination) { CardComponent component = card.getComponent(); int index = this.getSubComponentIndex(component); if (index < 0) { return; } component.trackTarget(cardDestination); component.getTracker().setTempPath(n...
81721cfb-f387-45b4-b5a8-baa4d546b1f9
6
final boolean method478(int i, int i_30_) { if (i_30_ != -31076) return false; anInt901++; if (anIntArrayArray907 == null) return true; synchronized (((ObjectLoader) ((ObjectDefinition) this).aClass263_933) .aClass45_3345) { for (int i_31_ = 0; aByteArray885.length > i_31_; i_31_++) { if (a...
18b1985a-262f-45db-933b-90e3ef8f66a0
5
final void method1716(boolean bool) { if (((Class239) this).aClass348_Sub51_3136.method3422(674) != Class10.aClass230_186) ((Class239) this).anInt3138 = 1; else if (((Class239) this).aClass348_Sub51_3136.method3425(-95)) ((Class239) this).anInt3138 = 0; anInt6090++; if ((((Class239) this).anInt3138 ^...
af528062-7b57-43a4-959f-ed504a551afa
9
void interpret (Vector v) { if (v.size()<1) return; // empty datagram String arg=((String)v.elementAt(0)); if (arg.equals("open")) // a server opened, send him an openinfo datagram { try { open( (String)v.elementAt(1), (String)v.elementAt(2), Integer.parseInt((String)v.elementAt(3)), I...
3cc3def7-6009-4ee9-940b-b341adee4d2a
7
public void sucheDateiNamen(String name, File directory, FoundListener fnd) { if(directory.exists()) { File[] files = directory.listFiles(); for(int i=0; i< files.length; i++) { if(files[i] != null && files[i].exists()) { if(files[i].getName().equals(name)) { findings.add(files[...
3ea426f1-64a2-4109-ab68-8120e0780d2c
0
public boolean isCanceled() { return canceled; }
8932b203-51b8-4b8f-872e-211d12138d22
9
List submitSubL(String text) throws Exception { ex = null; Object result = null; try { worker = new DefaultSubLWorkerSynch("(multiple-value-list " + text + ")", cycAccess, timeoutMsecs); result = worker.getWork(); } catch (IOException iOException) { ex = iOException; } catch (TimeO...
38d6cfaf-614a-41f5-bfc8-ab48bd06ae3b
2
public int GetPlrBlockAnim(int id) { if(id == 4755) // veracs flail { return 2063; } if(id == 4153) // maul { return 1666; } else { return 1834; } }
5833558f-6ccc-4a88-8f80-ed6b612897f1
4
private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed int indx = groupList.getSelectedIndex() - 1; transferChanges(); int n = 0; //see if updated if (!groupNameBox.getText().equals("") && (editing...
3d94ea29-579d-4e4f-89a4-5ba443b36b89
0
public EntradasFacade() { super(Entradas.class); }
062f16c8-dccf-48ba-917e-f9ee60fbef52
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...
a8d6b979-712d-4cae-805c-6f4f3ae75bdc
5
int inverse2(Block vb, Object i, Object memo, float[] out){ LookFloor1 look=(LookFloor1)i; InfoFloor1 info=look.vi; int n=vb.vd.vi.blocksizes[vb.mode]/2; if(memo!=null){ /* render the lines */ int[] fit_value=(int[])memo; int hx=0; int lx=0; int ly=fit_value[0]*info.mult; ...
242da385-df71-416f-aa91-c4b43494e296
3
private void applyMerging(List<Detection> detections) throws Exception { PreparedStatement updateStatement = con.prepareStatement("UPDATE " + detectionTable + " SET groupID = ? WHERE detectionId = ? "); long startTime = System.nanoTime(); long numUpdates = 0; for (Detection det : detecti...
a0d1b1aa-1ab0-4433-80ec-610470263d94
7
static final void method243(int i) { anInt8620++; FileOnDisk class234 = null; try { SignlinkRequest class144 = Class348_Sub23_Sub1.signlink.method2233((byte) -46, "", true); while (class144.state == 0) Class286_Sub5.method2161((byte) -122, 1L); if ((class144.state ^ 0xffffffff) == -2) { ...
39b32d98-3809-431b-84f4-728f5f1cd8fe
5
private void addEmptyThings(){ SortedSet<String> keys = new TreeSet<String>(data.keySet()); for (String path : keys) { while(true){ path = deleteLastLevel(path); if(path == null || path.equals("")) { break; } if(data.get(path) == null){ data.put(path, " "); } } } }
1f2c5248-088f-44cb-a663-140bee28e012
5
@Override public T evaluate(Tuple5<?, ?, ?, ?, T> x) { if (x != null) { return x.getItem5(); } else { return null; } }
fa50e0fe-6e9d-4c2b-a0d5-a1dc3ad6be04
8
public static Properties processArgs(String args[]) { Properties startupArgs = new Properties(); if (args == null) return startupArgs; String _name = null; String _value = null; for (int i = 0; i < args.length; i++) { //Get Name or Value if (args[i].sta...
7e4321f4-4117-439e-9aad-541084ed6cee
0
public TreeNode(int x){ val = x; }
fa2f915f-a4df-47c9-83c5-42932ce5abe8
9
public boolean equals(Object _other) { if (_other == null) { return false; } if (_other == this) { return true; } if (!(_other instanceof Debt)) { return false; } final Debt _cast = (Debt) _other; if (id != _cast.id) { return false; } if (idModified != _cast.idModified) { ...
efd2c916-7fca-4db0-9150-8e17b3a1d0a4
9
private boolean prefixexp1Starters() { if((currentToken.kind == Token.COLON) || (currentToken.kind == Token.COMMA) || (currentToken.kind == Token.LPAREN) || (currentToken.kind == Token.LCURLY) || (currentToken.kind == Token.NORMALSTRING) || (currentToken.kind == Token.CHARSTRING) || (currentToken.kind == Token.LON...
76c5ecea-540e-4f01-95ec-11bf8ca602d0
7
@Override public void invoke(IEvent event) { /* * With the invoke(event) method, we need to not only invoke the Event the EventBus wants, but * every Superclass Event that Event may have. We have to use some Reflection trickery to do this. */ //Firstly, synchronize the listenerMap. We don't want an Event...
b28ea4b9-33a9-48e5-abe1-195237682ff2
6
private Map<Integer, Question> generateQuizQuestionsFromFile() { Map<Integer, Question> questions = new HashMap<Integer, Question>(); String question; BufferedReader br = null; int lineCount = 0; try { String sCurrentLine; br = new BufferedReader(new File...
c8935713-7556-4dbf-a809-984c3ea9642a
3
public static boolean saveFlatFile(FlatFile flatfile) { File flatfilefile = new File("plugins/Favor-Disfavor" + "/Database.fd"); new File("plugins/Favor-Disfavor").mkdirs(); //Our Writer Object. Writer output = null; try { //Create our Writer object. output = new BufferedWriter(new FileWriter(flatfil...
217a1acd-e199-40af-9007-b518a9ccb1bb
2
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // PIZZALISTAN TULOSTAMINEN // Luodaan lista, johon haetaan kannasta tuotteet List<Tuote> tuotteet; List<Pizza> pizzat; // Yhdistetään kantaan ja täytetään lista try { Tu...
0672ff0a-96a1-4789-9b8d-c96322cf6351
3
protected static boolean buscarcod(String cod){ try{ //metodo usado en dar de baja y modificar stock, se utiliza para comprovar si el cod esixte en el fichero //si no esta, no se podra ni dar de baja ni modificar el stock. BufferedReader stdin=Files.newBufferedReader(path, java.nio.charset.StandardChars...
ac6f202e-096f-4ec8-8f35-14ef9ecbcf53
3
public boolean torrentSet(TSetRequestArgs tsr){ if(tsr != null){ JsonObject req = new JsonObject(); //String req = new Gson().toJson(tsr, TSetRequestArgs.class); req.addProperty("method", "torrent-set"); req.add("arguments", new Gson().toJsonTree(tsr, TSetRequestA...
093271fa-2209-4f8c-8656-2a741ba2ad6f
5
private void jBEntrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBEntrarActionPerformed String user = jTextLogin.getText().toLowerCase(); String strpass = jSenha.getText(); try { Class.forName("org.postgresql.Driver"); } catch ...
e41d3411-c435-4063-a3c1-6edc2aee444f
8
@Override public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { MOB target=mob; if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB)) target=(MOB)givenTarget; if(target.fetchEffect(this.ID())!=null) { mob.tell(target,null,null,L("<S-NAME> <S-IS...
a76fe4f7-1789-4920-819e-a6642ad4a673
7
private void updateRoster() { fixTextLength(); // only allow 8 characters (breaks gridbaglayout otherwise) if (UpDown.getNumPlayers()==6 && sizeswitched) { // 5 man --> 6 if (UpDown.getNumPlayers() != UpDown.getRosterSize()) UpDown.addPlayer(new Player()); // add new player UpDown.resetPlayers...
47948e2a-9a07-4793-8494-ec1a934aa2fc
0
public Map<String, List<String>> getDictionary() { return dictionary; }
caf48da7-b6e9-4829-b7b3-d4de7dec7677
1
public Insets getInsets() { if (myInsets == null) { Insets appInsets = super.getInsets(); // /#endif myInsets = new Insets(appInsets.top + BORDER, appInsets.left + BORDER, appInsets.bottom + BORDER, appInsets.right + BORDER); } return myInsets; }
6a9a2454-ea57-4ac5-aea4-9b43aa6cf238
2
public void disable() throws IOException { // This has to be synchronized or it can collide with the check in the task. synchronized (optOutLock) { // Check if the server owner has already set opt-out, if not, set it. if (!isOptOut()) { configuration.set("opt-out", tru...
22d63b44-8d8c-4cbc-b309-1fb2c1476708
0
public String getPassword() { return password; }
e2e7613e-a990-46fc-875f-57dd770948bc
2
public void testRemoveInstantConverterSecurity() { if (OLD_JDK) { return; } try { Policy.setPolicy(RESTRICT); System.setSecurityManager(new SecurityManager()); ConverterManager.getInstance().removeInstantConverter(StringConverter.INSTANCE); ...
a7442f3e-d8ad-447e-bc86-37527d8d9be0
3
@Override public void addChoices(Player player, List<Choice> choices) { super.addChoices(player, choices); if (player.isOn(MarkType.city, MarkType.start) && player.isNextTo(ConnectionType.flight) && player.hasAtLeast(FLIGHT_PRICE)) choices.add(new FlightChoice()); }
13fb0708-1e40-494a-bb3d-14f1d5f500df
7
private void confirm() { if (rbBead1.isSelected()) typeOfAtom = Element.ID_NT; else if (rbBead2.isSelected()) typeOfAtom = Element.ID_PL; else if (rbBead3.isSelected()) typeOfAtom = Element.ID_WS; else if (rbBead4.isSelected()) typeOfAtom = Element.ID_CK; if (rbGrow1.isSelected()) growMode = ...
f069ed7f-59d0-4ba6-bc6b-6407aeb22566
6
public ListNode detectCycle(ListNode head) { if(head == null) return null; ListNode twoStep = head; ListNode oneStep = head; ListNode result = head; boolean loop = false; while(twoStep.next != null && twoStep.next.next != null){ twoStep = twoStep.next...
f482a6f4-6b6c-4e3a-b618-afca319f4ea1
0
public int getSize() { return size; }
4691111a-680b-4061-8297-f05ce93b09df
7
private String defineDay(int day) { String dayOfWeek; switch (day) { case 0: dayOfWeek = "Mon"; break; case 1: dayOfWeek = "Tue"; break; case 2: dayOfWeek = "Wed"; break;...
74513b4b-d7ac-4363-bad0-75d376125312
3
public ArrayList<Double> getStringAsDoubleList(String name) { List<String> value_list = strings_map.get(name); ArrayList<Double> result = new ArrayList<Double>(); if(value_list == null) { return result; } for(String val:value_list) { try { result.add(Double.v...
1f56aea5-59d0-4d4b-b005-a948d4b79bcf
7
public static boolean copyFile(File from, File to, byte[] buf) { if (buf == null) buf = new byte[BUFFER_SIZE]; FileInputStream from_s = null; FileOutputStream to_s = null; try { from_s = new FileInputStream(from); to_s = new FileOutputStream(to); for(int bytesRea...
9d792bdf-0b26-4acf-bb32-8a43c7e405f0
6
public void update(){ getNextPosition(); checkTileMapCollision(); setPosition(xtemp, ytemp); if(flinching){ long elapsed = (System.nanoTime() - flinchTimer) / 1000000; if(elapsed > 400){ flinching = false; } } if(right && dx == 0){ right = false; left = true; facingRight = false;...
9e6abcf5-b7b4-43f3-987a-9b3005b1ff12
5
public final void method44(int i, AbstractToolkit var_ha) { anInt10121++; Object object = null; r var_r; if (aR10128 == null && aBoolean10137) { Class2 class2 = method2491((byte) -51, true, 262144, var_ha); var_r = class2 == null ? null : ((Class2) class2).aR118; } else { var_r = aR10128; aR101...
1cbb3162-2463-4bfc-8021-7224a17c5a89
6
public Emulator getComandsFromXML(File file){ Emulator emulator = new Emulator(); try { DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder(); // Document doc = (Document)...
84590f96-ef09-4733-9d57-cebf33f909c2
8
public Holywater(TextGame _game) { super("Holywater", ""); this.game = _game; this.addAction(new ActionInitial("get") { @Override public Result execute(Actor actor) { if (((Player) actor).getLocation().hasOne("holywater")) { return new ResultPartial(true, " -- In what? ", (ActionContinued)...
4ef7dada-07be-4878-b8a6-93319bf66bd1
2
public Reference (String name, T data) { if (name == null || data == null) throw new RuntimeException("Invalid argument(s)."); this.strName = name; this.data = data; }
b1e53e9e-f73b-4929-b721-7b8f833d2b18
4
public AnnotationMetadata getNamedAnnotation(final Class<? extends Annotation> clzAnnotation) { if (clzAnnotation == null) return null; String annotationQualifiedName = clzAnnotation.getCanonicalName(); for (AnnotationMetadata annotation : annotations) { if (annotation.getQualifiedName().equals(annotationQu...
779831f2-82e5-42c5-928e-0ec34498b969
7
protected void printSolutionModifiers(PrintContext context, SPINModuleRegistry registry) { List<RDFNode> orderBy = getList(SP.orderBy); if(!orderBy.isEmpty()) { context.println(); context.printIndentation(context.getIndentation()); context.printKeyword("ORDER BY"); for(RDFNode node : orderBy) { if(n...
f010b6ad-139b-437a-995a-9745e631f288
1
public void mergeContinueStack(VariableStack stack) { if (continueStack == null) continueStack = stack; else continueStack.merge(stack); }
80bce4de-a766-4f2e-ac80-7c7b2f710bbd
6
public int compare(Object one, Object two) { int oneY = 0; int twoY = 0; //firsts objects y axis coordinate if(one instanceof Setpiece) { oneY = (int) ((Setpiece) one).getBox().getY(); } else if(one instanceof Actor) { oneY = (int) ((Actor) one).getUpBox().ypo...
01c301c5-04d3-4f72-9377-8cca9960d99a
4
public HTSMsg rcv() throws IOException{ byte[] lenBytes = new byte[4]; while (is.available() < 4) { try { Thread.sleep(1); } catch (InterruptedException e) { } } is.read(lenBytes, 0, 4); long len = HTSMsg.deserializeS64(lenBytes, 4); byte[] msg = new byte[(int)len]; while (is.avail...
686cecba-01a7-40f0-b0b2-84d89235d206
2
public int[][] getActualState() { int[][] gridState = new int[sudokuSize][sudokuSize]; for (int i = 0; i < sudokuSize; i++) { for (int j = 0; j < sudokuSize; j++) { gridState[i][j] = cells[i][j].valueState; } } return gridState; }
e312926e-5541-47ba-86a0-91975f34307b
8
private boolean canMoveToPosition(Player player, Grid grid, Position pos) { if (pos.getxCoordinate() < 0 || pos.getyCoordinate() < 0 || pos.getxCoordinate() >= grid.getHorLength() || pos.getyCoordinate() >= grid.getVerLength()) return false; List<Element> elements = grid.getElementsOnPosition(pos); f...
0f6bad73-4eff-4faf-8fdc-387da5712227
0
@Before public void setUp() { }
23e7b261-5ac9-4276-bc40-603c87308d41
7
public Lista SelectionSort(Lista list) throws IOException{ Node I= list.getHead(); Node J= I.getNext(); Node Min; try{ int Vmin; int Vj; for (int i=0; i<cuentaLista(list)-1; i++){ Min=I; Vmin=((int)(Min.get_data())); ...
0176212a-fef8-40ec-8e83-901f319baf69
3
@Override public GameFont getObject(String name, Map<String, String> data) { // Check our cache first if we have already created the object. As // always. if (cache.containsKey(name)) { return cache.get(name); } // Check if the font is valid, IE contains all of our // REQUIRED_XML_FIELDS if (!isValid...