method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
68ad2292-9e7c-4aad-b8ac-3073d8e0b9d3
1
public static void main(String[] args) { //Liskov sub ProgrammingCourse[] courseList = { new AdvancedJavaCourse("Advanced Java","COURSE_NUMBER"), new IntroJavaCourse("Introduction to Java","COURSE_NUMBER"), new IntroToProgrammingCourse("Introduction to Programming","COURS...
503c12d8-8701-47bb-95cd-402186c6084b
8
private void expand1(byte[] src, byte[] dst) { for(int i=1,n=dst.length ; i<n ; i+=8) { int val = src[1 + (i >> 3)] & 255; switch(n-i) { default: dst[i+7] = (byte)((val ) & 1); case 7: dst[i+6] = (byte)((val >> 1) & 1); case 6: dst[i+...
18e1fa1a-f322-4776-949e-3a50ec86ec0a
4
private double doSingleSwap(Deque<Pair<Vertex>> swaps) { Pair<Vertex> maxPair = null; double maxGain = Double.NEGATIVE_INFINITY; for (Vertex v_a : unswappedA) { for (Vertex v_b : unswappedB) { Edge e = graph.findEdge(v_a, v_b); double edge_cost = (e != null) ? e.weig...
84831517-69d3-49ba-8623-376955974e17
4
public static void secondinit() throws SlickException{ if(dogepossible==true) chicken1= new Image("resources/images/doge.png"); else if (dogepossible==false) chicken1= new Image("resources/images/chickun1.png"); if(cagepossible==true) chicken2= new Image("resources/images/cage.png"); else...
98ae06c0-89b0-489e-b61a-3b17dacd2eaf
8
public Set<Map.Entry<Character,Integer>> entrySet() { return new AbstractSet<Map.Entry<Character,Integer>>() { public int size() { return _map.size(); } public boolean isEmpty() { return TCharIntMapDecorator.this.isEmpty(); } ...
71b0fdbd-4625-4bfe-8148-cd04af9fe851
4
@Override public void actionPerformed(ActionEvent e) { if(e.getSource() == widokOpisTworcow.btn_WrocDoWyboruKategorii) powrotDoOknaGlownego(); if(e.getSource() == widokOpisTworcow.mnI_Wyjscie) wyjscie(); if(e.getSource() == widokOpisTworcow.mnI_InstrukcjaObslugi) { } if(e.getSource() == widokOpis...
9cc19b5d-feac-489f-8d48-8d093ecb2c26
0
public void addFileDownloadListener(FileDownloadListener listener){ listeners.add(listener); }
bbb93a6b-35a3-4476-b7c1-7f8fddfaa458
9
private void verifyTransfer(boolean srcdirect, boolean dstdirect) { String txt1 = "123"; String txt2 = "abcde"; String srctxt = txt1+txt2; byte[] srcdata = srctxt.getBytes(); org.junit.Assert.assertEquals(srctxt.length(), srcdata.length); //sanity check java.nio.ByteBuffer srcbuf = NIOBuffers.create(srcdat...
fd492679-4b92-4898-879c-b0044b5093e0
4
public void renderModel(TextureManager var1, float var2, float var3, float var4, float var5, float var6, float var7) { super.renderModel(var1, var2, var3, var4, var5, var6, var7); Model var9 = modelCache.getModel(this.modelName); GL11.glEnable(3008); if(this.allowAlpha) { GL11.glEnable(...
9db88d28-2bf9-42c9-bf49-b74971c7bc62
7
public void translateSelectedAtomsXYBy(Matrix3f transform, BitSet bs, float dx, float dy) { if (translationMatrix == null) translationMatrix = new Matrix4f(); if (tempMatrix1 == null) tempMatrix1 = new Matrix3f(); if (tempMatrix4f == null) tempMatrix4f = new Matrix4f(); if (tempPoint3f == null) temp...
f32d1399-272a-4e13-9578-3e7a0520f0d3
1
private String removeNamespace(String string){ if (string.contains(":")){ return string.substring(string.indexOf(":")+1); }else{ return string; } }
faac6139-8886-470c-b537-74084460756c
0
@Override public String toString() { return "fleming.entity.Perfil[ idPerfil=" + idPerfil + " ]"; }
6872833f-8561-4a51-829f-943084c6df37
3
@Override public void run() { long lastTime = System.nanoTime(); start(); long now = System.nanoTime(); long timer = System.currentTimeMillis(); double delta = 0; int frames = 0; int updates = 0; System.out.println("Initialized in " + ((now - lastTime) / 1000000000.0) + " seconds"); while(!Display.is...
afd8a25f-1e7f-4983-ac98-60d708730a59
8
public boolean bodyCall(Node[] args, int length, RuleContext context) { checkArgs(length, context); BindingEnvironment env = context.getEnv(); Node n1 = getArg(0, args, context); Node n2 = getArg(1, args, context); if (n1.isLiteral() && n2.isLiteral()) { Object v1 = n...
ae4d78d8-e3c3-49fa-b90e-09c93b7be9ef
3
public boolean isScopeOf(Object obj, int scopeType) { if (scopeType == METHODSCOPE && obj instanceof ClassInfo) { ClassAnalyzer ana = getClassAnalyzer((ClassInfo) obj); if (ana != null) return ana.getParent() == this; } return false; }
6b4ae6b0-18e8-44de-b1e0-bc810a5a695b
6
public static HashMap<String, HashMap<String, Integer>> getMap(String filePath) throws Exception { HashMap<String, HashMap<String, Integer>> map = new HashMap<String, HashMap<String,Integer>>(); BufferedReader reader = filePath.toLowerCase().endsWith("gz") ? new BufferedReader(new InputStreamReader( ...
dee2f264-a5ce-4385-a61c-596b97159dcb
8
@Override public String returnXMLBlock(String Blob, String Tag) { int foundb=Blob.indexOf("<"+Tag+">"); if(foundb<0) foundb=Blob.indexOf("<"+Tag+" "); if(foundb<0) foundb=Blob.indexOf("<"+Tag+"/"); if(foundb<0) return ""; int founde=Blob.indexOf("/"+Tag+">",foundb)-1; if(founde<0) founde=Blob...
3fd875a4-7319-45d3-bc30-6d431b075ca6
5
public int maxDepth(TreeNode root) { if (root == null){ return 0; } if (root.left == null && root.right == null){ return 1; } else if (root.left == null){ return maxDepth(root.right)+1; } else if (root.right == null){ return max...
1594077e-a3e3-42c5-9b85-3d0c96bf26aa
2
public boolean checkShapeDate(long fechaDesde, long fechaHasta){ return (fechaAlta >= fechaDesde && fechaAlta < fechaHasta && fechaBaja >= fechaHasta); }
1252d0ad-6da0-4128-b20d-fc6a65a1e3be
2
private boolean containsElement(List<ElementInfo> elements, ElementInfo element) { for(ElementInfo e : elements) if (e.equals(element)) return true; return false; }
6fcbe46a-08bf-4efe-81ed-89a9451f788d
0
public void addPanelToLayer(Panel pi) { this.ditems.add(pi); }
9a4f76eb-5aaf-46a1-95a5-c55d6cb7f851
9
private void imprimirElementorSin(ArrayList<Nodo> tem,DefaultMutableTreeNode padre){ Iterator nex=tem.iterator(); Nodo a; int con=0; try{ while(nex.hasNext()){ String tabla = ""; a=(Nodo)nex.next(); DefaultMutableTreeNode ...
6bbe8121-fd0a-47b7-8ef5-a9df9dbc9aee
3
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Classroom other = (Classroom) obj; if (this.number != other.number) { return false; }...
ac849d6a-71c5-4d02-ab9e-8aae9cc94a11
9
@Override public void draw(Graphics g) { int width = getWidth(); int height = getHeight(); if (width == -1 || height == -1) return; g.setClip(getRealX(), getRealY(), width, height); if (this.hasBackground()) g.setColor(getBackground()); else g.setColor(Color.darkGray); g.fillRect(getRealX(), getRea...
19d46e7b-bdf3-44ad-a5c4-3977b937f74e
8
private TreeNode checkChildrenForKeyWords(TreeNode currentNode, String currentWord) { List<TreeNode> children = currentNode.getChildren(); for (TreeNode child : children) { if (child.isTempVisited()) continue; child.setTempVisited(true); if (child.isAccessible()) { List<String> keyWords = child....
fc589009-3e36-49f1-afaa-7e9d5f7ae712
9
public boolean pickAndExecuteAnAction() { try { //synchronized(Customers){ for(int i =0; i < Customers.size(); i++){ ////print("" + Customers.get(i).s ); if(Customers.get(i).s == CustomerState.waiting){ seatCustomer(Customers.get(i)); return true; } } //synchronized(Customers){ ...
ea791e35-8236-42fc-b6d3-7fc98ab3d7d1
5
public void setOpMode(int mode){ opmode = mode; boolean[] es = new boolean[]{false, true, false, false, true, true}; if(es[mode] == false){pause();} switch(aamode){ case 1: pete.setEnabled(es[mode]); break; case 2: for(int y = 0; y < gridy; y++){ for(int x = 0; x < gridx; x++){...
16e26741-5c76-428a-b39b-fff432b070ae
7
private void expTypeChanged() { if (m_Exp == null) return; // update parameter ui if (m_ExperimentTypeCBox.getSelectedItem() == TYPE_CROSSVALIDATION_TEXT) { m_ExperimentParameterLabel.setText("Number of folds:"); m_ExperimentParameterTField.setText("" + m_numFolds); } else { m_Experi...
41e79f00-48f4-4eb1-98fb-bc64529da7bc
5
private void jpeg2dicom(File archivoJPEG, File archivoDICOM) { try { BufferedImage jpegImage = ImageIO.read(archivoJPEG); if(jpegImage == null) { System.err.println("No se pudo crear imagen de archivo JPEG"); } //atributos de imagen int...
b3e6594b-62a2-45ab-98c3-c253d0c8868c
0
public boolean isStart() { return type == START; }
ef29528e-290f-476b-a283-21c40d728b38
4
@Override public float[] getData() { if (ptr != 0) { return null; } else { if (isConstant()) { if (length > getMaxSizeOf32bitArray()) return null; float[] out = new float[(int) length]; for (int i = 0; i < length; i++) { ...
ab6f126f-3889-41e2-ba6f-dfd9795eae2d
9
@Override public QueryResults<String> parseObjectIdentifiers(AtmosResponse response) { Collection<String> identifiers = new LinkedList<String>(); HttpEntity body = response.getEntity(); if (body != null) { try { DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); Document ...
8f1b37ee-f747-4b76-a1d1-1253dc41a9d8
4
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed // TODO add your handling code here: try { String arquivo = null; jSalvar_Backup.setVisible(true); int result = jSalvar_Backup.showSaveDialog(null); if(resu...
073ec7f3-ef1b-4fd2-ba7c-e8dcdcb64a4c
9
public void init(int i, int j, PersonnageType v) { if(i<0 && j <0) throw new PreConditionError("i>=0 && j>=0"); super.init(i, j, v); if(!(super.getType()==v)) throw new PostConditionError("getType(init(i,j,v)) == v"); if(!(super.getForceVitale() == 3)) throw new PostConditionError("getForceVitale(init(...
f528e077-9d56-4505-9279-47b2ff99a99a
2
private boolean isValidUrl(String urlString) { boolean isUrl = false; try { URL url = new URL(urlString); URLConnection conn = url.openConnection(); conn.connect(); isUrl = true; } catch (MalformedURLException e) { // the URL is not in ...
87390e6b-7a56-48d6-a0b9-71a550bf5102
3
private static int sign(int [] a){ int x=0; int len = a.length; for(int k=1; k<len; k++) if (a[k]> k ) x+=a[k]-k; x%=2; if (x==1) return -1; else return 1; }
ee41abb7-b263-48cf-9049-01a4f3ae7472
8
public boolean gameEnded() { int seeds = 0; //Player 1 - South for (int i = START_S; i <= END_S; i++) { seeds += board[i]; } if (seeds == 0) { //Gather opponents seeds (if any) //Rule 6 for (int i = STAR...
840a797a-9217-4ab6-b5de-596df0b9b349
6
public void adjacencyListConnections(GraphNode<T> a, GraphNode<T> b, int direction,int weight) {//creates connection between two nodes forming the adjacency list.(lists inside lists) if (existNode(a) && existNode(b)) {//if a and b exists in the list of graph nodes. if (direction == 0 || direction =...
5619738b-8dfc-4b35-bc95-f83b449bde44
2
public static PlayOutside getSingleton(){ // needed because once there is singleton available no need to acquire // monitor again & again as it is costly if(singleton==null) { synchronized(PlayOutside.class){ // this is needed if two threads are waiting at the monitor at the ...
805bebf4-ed5d-404f-9b4f-c0dbdc4611d6
1
@Test public void worksWithSeveralFieldFilters2() { citations.add(c1); citations.add(c2); citations.add(cnull); filter.addFieldFilter("publisher", "Otava"); filter.addFieldFilter("year", "2012"); List<Citation> filtered = filter.getFilteredList(); List<Citatio...
a48bca5c-4a3a-40f7-a6a9-a06c48aa1964
0
public void setIdAlmacen(int idAlmacen) { this.idAlmacen = idAlmacen; }
5d619ad2-e2c3-452e-b8f7-3ce198ce68ef
2
public void printSources(){ if (sources == null) { System.err.println("Sources not calculated yet"); return; } System.out.println("Sources:"); for (AndroidMethod am : sources) { System.out.println(am.toString()); } System.out.println("End of Sources"); }
d974ed6f-19ce-4bf8-9d34-e2b023de4903
0
@Override public void documentRemoved(DocumentRepositoryEvent e) {}
9767a3e8-3608-437f-b4b5-38bb25623f80
4
static Direction getDir(String s) { if(s.equalsIgnoreCase("r")) return RIGHT; if(s.equalsIgnoreCase("d")) return DOWN; if(s.equalsIgnoreCase("l")) return LEFT; if(s.equalsIgnoreCase("u")) return UP; return null; }
d07ed1e1-0a9b-4d8f-a5a3-cfe96f7ac216
0
public boolean isFrozen() { return frozen; }
0cda3161-9ed5-424b-aaab-16090ee38a09
2
public boolean checkNaive(List<Integer> list) { for (int idx = 0; idx < list.size(); ++idx) if (idx != list.get(idx)) { System.out.print("[FAILED] "); printList(list); return false; } System.out.print("[PASSED] "); printLis...
da6e4aec-a60b-42be-b5b9-259d7b14854d
9
public void run() { while(isRunning()) { if(isEnabled()) { while(Keyboard.next()) { switch(Keyboard.getEventKey()) { case Keyboard.KEY_W: setUp(Keyboard.getEventKeyState()); break; case Keyboard.KEY_A: setLeft(Keyboard.getEventKeyState()); break; case Keyboard...
ed2a85b1-dd8b-484c-9c2d-b5c671e00686
2
public ProfileResponse updateCard(String profileId, Card card) throws BeanstreamApiException { ProfilesUtils.validateProfileId(profileId); Gateway.assertNotNull(card, "card is is null"); String cardId = card.getId(); Gateway.assertNotEmpty(cardId, "card Id is empty"); String url = BeanstreamUrls.getProfil...
20134692-2a4f-42c8-8eb0-0878b539bc31
5
private void gameLoop() { long beforeTime, afterTime, timeSpent, sleepTime, overTime; overTime = 0; long totalOverTime = 0; gameStart = System.nanoTime(); beforeTime = gameStart; while (sc.isRunning()) { sc.update(); sc.paint(); afterTime = System.nanoTime(); timeSpent = afterTime - bef...
01d7ddb3-f5b7-4a84-84b1-2a3a2c8d7767
6
public int ReloadHeidelTimeDocs(int year) { File folder = new File(Configuration.HeidelCollectionRoot + "19" + year); File[] listOfFiles = folder.listFiles(); if (listOfFiles == null) { System.out.printf("ANNO 19%d assente\n", year); return 0; } int countFiles = 0; double perc = 0;...
af4ef3cb-d4b8-465c-8509-cfcc05d9789a
5
public double[][] getOpacites() { double[][] opacites = new double[grid.length][grid[0].length]; boolean[][] nextGrid = this.nextGeneration(); for (int i = 0; i < grid.length; i++) { for (int j = 0; j < grid[0].length; j++) { if (nextGrid[i][j] != grid[i][j]) { ...
52e1e1c4-a253-4093-9879-33e72644000c
0
public void setClassFieldString(String classFieldString) { this.classFieldString = classFieldString; }
a58bfae3-5b2d-4afb-ab59-089df8bfcd12
8
private void createKBestList() throws MaltChainedException { final Class<?> kBestListClass = history.getKBestListClass(); if (kBestListClass == null) { return; } final Class<?>[] argTypes = { java.lang.Integer.class, org.maltparserx.parser.history.action.SingleDecision.class }; final Object[] arguments =...
11d12a72-9c71-49a8-9504-be2ac337baf5
9
public ArrayList<ParseResult> doIt(String x) { String s = new String("OK"); try { Path path = Paths.get(x); ArrayList<ParseResult> parseResults = new ArrayList<>(); // Read lines from file List<String> lines = Files.readAllLines(path); // Iterate all lines for (int i = 0; i ...
10a1bc72-75e1-4d30-8671-5a5f8265b98c
5
public List<Branch> getActiveBranches(){ List<Branch> list = new ArrayList<>(); Connection con = null; Statement stmt = null; try { DBconnection dbCon = new DBconnection(); Class.forName(dbCon.getJDBC_DRIVER()); con = DriverManager.get...
25c6a402-d717-44da-9cbd-f9dd78e34889
5
public TableModel(ResultWrapper rw) { myRes = rw.getResultSet(); wrapper = rw; try { if(myRes != null)// dml commands { int cols = myRes.getMetaData().getColumnCount(); colSizes = new int[cols + 1]; String t...
5527ae88-be2b-4ac3-bfc7-c9ee595ae43b
5
public int[][] csvInt( String filePath, int tableWidth, int tableLength ) { int[][] table = null; BufferedReader ingester = null; try { String line; table = new int[ tableWidth ][ tableLength ]; ingester = new BufferedReader( new FileReader( filePath ) ); while ( (line = ingester.readLine() ...
ad996d6f-6af1-42cf-8a1a-43215f6d4536
2
public iProperty(String fileName) { this.fileName = fileName; File file = new File(fileName); if (file.exists()) { try { load(); } catch (IOException ex) { log.severe("[PropertiesFile] Unable to load " + fileName + "!"); } ...
5965bae4-b36c-4fac-8821-0eb5afe287c6
2
public float getFloat(String key) { try { if(hasKey(key)) return ((NBTNumber<Float>) get(key)).getValue(); return 0; } catch (ClassCastException e) { return 0; } }
6691f044-b966-4349-8b88-0f65c1024903
8
* @param adj_data The data value of the adjacent block */ private STAIR_RENDER shouldRenderStairFront(short adj_id, byte adj_data) { if (adj_id < 0 || blockArray[adj_id] == null) { return STAIR_RENDER.YES; } if (blockArray[adj_id].isSolid()) { return STAIR_RENDER.NO; } else { switch (blockA...
5018cd57-3735-4b30-b045-cecbf359badf
5
@Override public void messageArrived(MqttTopic topic, MqttMessage message) { String[] topics = topic.getName().split("/"); String subtopic = topics[topics.length-1]; Housemate person = null; WCMessage msg = null; for(Housemate hm : Housemate.values()) { if (hm.getName().equals(subtopic)) { pe...
bfe212cb-1525-49b1-aefe-d83703d8c7fe
9
protected void spaceMultipleTrees(StandardTreeNode root) { // Found the appropriate boundary of this tree, allowing for // orientation Point2D pos = graph.getLocation(root.cell); double rootX = 0; double rootY = 0; if (pos != null) { rootX = graph.getLocation(root.cell).getX(); rootY = graph.getLocati...
9aef1e9b-b60f-4cf2-b420-08165cd59523
2
public Anim(byte[] buf) { id = Utils.int16d(buf, 0); d = Utils.uint16d(buf, 2); ids = new int[Utils.uint16d(buf, 4)]; if (buf.length - 6 != ids.length * 2) throw (new LoadException("Invalid anim descriptor in " + name, Resource.this)); for (int i = 0; i < ids.length; i++) ids[i] = Utils.int...
f1db884d-1e71-4a27-b072-c42da8db9fcc
5
@Override public Property deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException { JsonObject o = jsonElement.getAsJsonObject(); String name = o.get("name").getAsString(); int displayMode = o.get("displayMode").getAsI...
1f0c28d0-0029-4331-ad0c-8dd9a69c6269
4
@Override public void mouseReleased(MouseEvent e) { if (enteredOC != null) { this.setSelectedOC(enteredOC, enteredOC.getParent()); enteredOC = null; } else if (e.isPopupTrigger()) { for (Component ele : elements) { if (ele.contains(e.getPoint())) { setSelected(ele); ele.showMenu(e.getX(), e....
1b06db66-d132-49bd-b9ba-8fa2d40f2dc1
4
private static void listFile(File f) throws InterruptedException { if (f == null) { throw new IllegalArgumentException(); } if (f.isFile()) { System.out.println(f); return; } File[] allFiles = f.listFiles(); if (Thread.interrupted()) { ...
e08abbe4-0c57-4346-96c6-ed5411be427e
6
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Source other = (Source) obj; if (sourceName == null) { if (other.sourceName != null) return false; } else if (!sourceName.equals(other.s...
2d0aaa16-4418-4704-89c6-3578a7e91a78
6
protected static char[] encodeBlock(byte[] raw, int offset) { int block = 0; // how much space left in input byte array int slack = raw.length - offset - 1; // if there are fewer than 3 bytes in this block, calculate end int end = (slack >= 2) ? 2 : slack; // convert sign...
58620922-e5c6-4dc6-9418-71f1c999ec1c
3
private boolean areDirectlyConnected(State s1, State s2, Automaton automaton) { if (s1 == s2) return false; if (automaton.getTransitionsFromStateToState(s1, s2).length == 0 && automaton.getTransitionsFromStateToState(s2, s1).length == 0) return false; return true; }
cbe0f14d-d71e-401a-95b3-6d525a592406
2
public Lista<Rama_Hoja> getSalidas(){ Lista<Rama_Hoja> resp = null; for (Nodo<Rama_Hoja> i = arrayIO.getHead(); i != null; i=i.getSiguiente()){ if(i.getIndex().split("_")[2]=="O") resp.insertar(i.getDato()); } return resp; }
f7f268f7-5e29-49b1-b90a-132eeb9ab2d4
6
public static void cardclick(int button) { // in case of button gets clicked again if ((newhand[button] != handcopy[button]) && newhand[button] >= 1) { newhand[button]--; } // in case new button gets clicked else if ((newhand[button] == handcopy[button]) && newhand[button] >= 1) { System.arraycopy(handc...
2c6bc3f9-a1a8-459f-8466-13bd1c30b48b
9
private int checkHtml(final StringBuilder out, final String in, int start) { final StringBuilder temp = new StringBuilder(); int pos; // Check for auto links temp.setLength(0); pos = Utils.readUntil(temp, in, start + 1, ':', ' ', '>', '\n'); if(pos != -1 && in.charAt...
1584d340-6c84-478d-9b3e-d5e6b9287e2f
7
public static boolean couldBeDouble(final String v) { if(null==v) { return false; } final int len = v.length(); if(len<=0) { return true; } if(len>40) { return false; } if(BurstMap.missingDoubleValue(v)) { return true; } if(v.equalsIgnoreCase(BurstMap.doublePosInfString)||v.equalsIgnoreC...
feef70e4-8bea-43f3-9e45-3b8b64aa6c80
1
public void addMany(int... elements) { if (manyItems + elements.length > data.length) { // Ensure twice as much space as we need. ensureCapacity((manyItems + elements.length)*2); } System.arraycopy(elements, 0, data, manyItems, elements.length); manyItems += elements.length; ...
a5c5ae2e-aa51-4462-833a-c41cf33e0b35
7
public final DirkExpParser.additiveExpr_return additiveExpr() throws RecognitionException { DirkExpParser.additiveExpr_return retval = new DirkExpParser.additiveExpr_return(); retval.start = input.LT(1); CommonTree root_0 = null; Token set15=null; DirkExpParser.multiplyExpr_ret...
19acb5b4-a3e4-48e4-b25d-11c5ffe604ce
1
private boolean Ingreso(float importe) { if (importe < 0 ) { return false; } saldo += importe; return true; }
d1d29a0c-ef13-4b84-99db-cb82149176f9
6
public void run(){ // If we have a list of replies from a previous repetition // calculate suspected processes if (started) { for(int i = 0; i <= p.getNo(); i++) { if (i != 0 && i != p.pid) { if (!successfulReplies[i-1] && !suspectedProcesses[i-1]) { Utils.ou...
93e14f6e-7527-4971-89e7-bf9663329e6e
4
public void closeConnection() { //4: Closing connection try { if (in != null) { in.close(); } if (out != null) { out.close(); } if (providerSocket != null) { providerSocket.close(); } ...
1c0fbca6-02d2-4419-b167-cd9dbbd514be
6
public static void waitForElement(UIObject obj) throws Exception{ wait=new WebDriverWait(driver, 320); //wait.until(ExpectedConditions.visibilityOf(element)); log.info("waiting for element " +obj); try{ if(obj.getIdentifier().equalsIgnoreCase("Byid")){ wait.until(ExpectedConditions.presenceOfElementLo...
caa45acc-5641-4bce-b106-d16f6f0bd925
5
public boolean estBloquee(Piece p) { Piece sauv = p; Piece monRoi = null; boolean isBloquee = false; // Recherche de mon roi dans l'echiquier for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { if (this.tableau[i][j].getCouleur() == p.getCouleur() && this.tableau[i][j].getClass().g...
cb86dc71-d3a0-4db8-a859-53c7c8320bdd
1
private static boolean isNullOrEmpty(String str) { return str == null || str.length() < 1; }
c7e4a454-f037-4065-98bf-9f4a6fa0bbc9
6
public boolean equals( Object other ) { if ( _set.equals( other ) ) { return true; // comparing two trove sets } else if ( other instanceof Set ) { Set that = ( Set ) other; if ( that.size() != _set.size() ) { return false; // different sizes, no need ...
56bf9a04-7e9c-4cbd-b9a1-9d39da814035
3
private boolean readCharToken(char ch, List<Token> parts) { switch (ch) { case '(': parts.add(CharToken.OPEN); return true; case ')': parts.add(CharToken.CLOSE); return true; case ',': parts.add(C...
37caa0c5-0baa-4d34-b97e-de3d42b40a92
0
public String toString() { return xCoordinate+", "+yCoordinate; }
f859e61b-8c28-4e50-8e46-bdf759940b65
8
public int crearOpcion(Opcion op) { String consulta; try { if (con.isClosed()) { con = bd.conexion(); } Object ob = null; if (op.getdespuesDeOpcion().getCodigo() != 0) { ob = op.getdespuesDeOpcion().getCodigo(); ...
79d1beaf-9263-4ceb-ac50-8c6e0b3706a3
7
protected void setGrid() { String line; int count = 0; // update geometry this.updateDataSize(); grid = new DataGridCel[numberOfRows][numberOfCols + 1]; LineScanner scan = new LineScanner(dataBuffer.toString()); for (int r = 0; r < numberOfRows; r++) { ...
f18da740-46f9-448c-8ef9-41c211d65117
0
public String getExtraData() { return this.extraData; }
56d5d08d-20b9-4367-a7e8-506ca5a5a016
5
public static int switchlt(int x) { int j = 1; switch(x) { case 1: j++;break; case 2: j++; case 3: j++; case 4: j++; case 5: j++; default: j++; } System.out.println("j = " + j); return j + x; }
8734e59b-1761-4b5d-af4a-99c0c703ad74
5
public static int d(int l1, int l2, int type) { switch (type) { case 01 : return ( match(l1, l2) + penalty01 ); case 10 : return ( match(l1, l2) + penalty01 ); case 11 : return ( match(l1, l2) ); case 12 : return ( match(l1, l2) + penalty21 ); case 21 : return ( match(l1, l2) + penalty21 ); defa...
8d845a8a-5972-4c14-8509-5f7e4db8bbe0
4
private int[][] pasaArregloAMatrizUp(int[] c0, int[] c1, int[] c2, int[] c3) { int[][] res = new int[4][4]; for (int k = 0; k < 4; k++) res[k][0] = c0[k]; for (int k = 0; k < 4; k++) res[k][1] = c1[k]; for (int k = 0; k < 4; k++) res[k][2] = c2[k]; for (int k = 0; k < 4; k++) res[k][3] = c3[k]...
b80e52d8-15ab-42c0-841e-a7fd975b5cb5
6
@Override public Boolean[] convertFromString(Class<? extends Boolean[]> cls, String str) { if (str.length() == 0) { return EMPTY; } Boolean[] array = new Boolean[str.length()]; for (int i = 0; i < array.length; i++) { ...
225675be-f4a7-44ff-9724-f67709af82e3
9
@Override public void visitDocComment(JsDocComment comment) { boolean asSingleLine = comment.getTags().size() == 1; if (!asSingleLine) { newlineOpt(); } p.print("/**"); if (asSingleLine) { space(); } else { p.newline(); ...
6b380317-64b0-495d-93c5-bd602b422c5d
3
private JSONWriter end(char mode, char c) throws JSONException { if (this.mode != mode) { throw new JSONException(mode == 'a' ? "Misplaced endArray." : "Misplaced endObject."); } this.pop(mode); try { this.writer.write(c); }...
6e172b3d-1356-4c7f-9db6-4a79b1c62163
0
public void setValue(T value) { this.value = value; }
c119217d-1e1d-410c-bc4e-6f67d57ecf8b
9
@Override public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { if ("relation".equals(qName)) { cr.setRelationId(Integer.parseInt(attrs.getValue("id"))); } if ("member".equals(qName) && "relation".equals(eleStack.peek())) { if (clcMainWays.containsKey...
420344ec-6b54-4d84-9fdd-211aa194d299
3
@SuppressWarnings("unchecked") public static Map<String, Object> parseMapFirstObject(List<String> strings) { ObjectMapper mapper = new ObjectMapper(); JsonFactory factory = mapper.getFactory(); JsonParser jp = null; Map<String, Object> result = null; try { jp = factory.createParser(strings.get(0)); res...
3add0af8-f16b-47c9-9ed7-ae7c44970335
0
public void setBossSpawnLocation(Location bossspawn) { this.bossspawn = bossspawn; }
c38c46b5-e5da-4c70-b234-353497f6f4d9
9
public void execute() throws MojoExecutionException, MojoFailureException { File scriptFile = null; File scriptMetaFile = null; UnityMenuCommands menuCommands = new UnityMenuCommands(new ProcessRunner(getLog()), unity, project.getBasedir().getAbsolutePath()); try { InputStream scriptStream = this.getClass()...
4753dfdb-e742-4c01-913b-5e8fcfa9463e
4
static void loadTickerSet(String fileName,ArrayList<String> tickers) { Scanner inFile = null; try { inFile = new Scanner(new File(fileName)); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } if (inFile == null) { System.out.println("invalid file no symb...
c846a4a4-5c0d-43f8-baf4-eb6dfcd746e4
9
final private void handleOperator( Operator o ) { int precedence = o.getPrecedence(); int prevPrecedence = -1; if ( this.m_operatorsStack.size() > 0 ) { Token prev = this.m_operatorsStack.peek(); if ( prev instanceof Operator ) { prevPrecedence = ( (Operator) prev ).getPrecedence(); while( prev i...