method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
dcaf841f-63c7-4fe7-b3bb-086bbd4c31f3
0
@Override public void setBeanName(String name) { this.beanName = name; }
4b12d86b-5faf-41a0-af1b-1a43f96e6a1f
6
@Override public void input( float delta ) { float movAmt = speed * delta; if ( Input.getKey( forwardKey ) ) move( getTransform().getRot().getForward(), movAmt ); if ( Input.getKey( backKey ) ) move( getTransform().getRot().getForward(), -movAmt ); if ( Input.getKey( leftKey ) ) move( getTransform()...
689fec32-7cce-4376-97a4-892136284f44
9
public boolean start(Session session) throws Exception{ super.start(session); // send // byte SSH_MSG_SERVICE_REQUEST(5) // string service name "ssh-userauth" packet.reset(); buf.putByte((byte)Session.SSH_MSG_SERVICE_REQUEST); buf.putString(Util.str2byte("ssh-userauth")); sessi...
f9cdbb28-206a-4a48-bc38-b72624b65638
0
public double getxCoordinate() { return xCoordinate; }
72ec4218-4433-4143-ab5b-18b8a00f6783
0
@Override public void setGUITreeComponentID(String id) { this.id = id; }
ddf97bbd-a480-410c-8698-71c0b41b9750
6
private Type getRuntimeTypeIfMoreSpecific(Type type, Object value) { if (value != null && (type == Object.class || type instanceof TypeVariable<?> || type instanceof Class<?>)) { type = value.getClass(); } return type; }
3dacb4dc-490d-4028-b5da-d0d3ef2ef953
9
private void savePendingObjects(String ContainerFileName){ String folderName = FileNameParser.getFilePathLessExt(ContainerFileName); // Get the set interface to get the key and value pair final Set<Map.Entry<String,InfluenceGUI>> set = this.pendingSaveObjects.entrySet(); ...
3841784f-05df-4ec4-bae1-6d5ba5773928
9
public static com.google.protobuf.BlockingService newReflectiveBlockingService(final BlockingInterface impl) { return new com.google.protobuf.BlockingService() { public final com.google.protobuf.Descriptors.ServiceDescriptor getDescriptorForType() { return getDescriptor(); ...
26849358-66b1-4ea2-a0ea-4c888d92bbaa
0
_6_Initialization() { System.out.println(x); x = 14; System.out.println(x); }
d0ebf3da-a9fc-4fe9-8ef5-c321d5dfacda
0
public void setPersonId(long personId) { this.personId = personId; }
cb60187d-e400-4907-8040-31fa8d79ad36
0
public int getThirst() {return thirst;}
a3cb05f8-b62d-41fb-a061-097f37df29ec
8
private static List<String> oneCharApart(String s, Set<String> dict, Map<String, String> parentMap) { List<String> result = new ArrayList<>(); if(s == null || dict == null){ return result; } for(String word : dict) { if(!parentMap.containsKey(word)) { ...
671a63c7-bad4-4398-853a-44733badc402
4
private long persistDetails(Details details) throws SQLException { Connection connection = null; PreparedStatement preparedStatement = null; String insertSQL = "INSERT INTO payment_details" + "(bank_BIC,bank_name,total,date_of_payment,date_of_execution) VALUES" + "(?,?,?,?,?)"; try { connection =...
bc358ada-ac19-43ad-9029-9f59c06bc782
7
@SuppressWarnings("unchecked") void readBasis() throws Exception { Vector sdata = new Vector(); Vector gdata = new Vector(); atomCount = -1; gaussianCount = 0; shellCount = 0; String lastAtom = ""; String[] tokens; while (readLine() != null && line.startsWith(" Atom")) { shellCount...
9286cc2c-19c9-40f0-9e7c-38ecee478c8a
9
public static void main(String[] arguments) { if (arguments.length<1) { log("Usage: AXMLPrinter <binary xml file>"); return; } try { AXMLParser parser=new AXMLParser(new FileInputStream(arguments[0])); StringBuilder indent=new StringBuilder(10); final String indentStep=" "; while (true) { ...
91d75d15-4f18-44ec-94a5-e47e6af5fc36
3
public void operateMatrix(Matrix[]... srcs) { if (true) { Matrix[] coeffMat = srcs[0]; double cf = coeffMat[0].get(0, 0); super.mat[0] = Matrix.identity(super.matHeight, super.matWidth).timesEquals(cf); if (super.codeCbCr) { super.mat[1] = Matrix.i...
49a3121b-8568-4dad-bf6a-7f2d350a3d82
9
private void updateSize() { double width; if (isPlacedOnLeftOrRight()) { width = this.leftOrRightWidth; if (context != null) { context.setFont(font); String longestName = Utilities.calculateWidestSeriesName(context, series); ...
202d69c1-6fea-484f-a195-f3444272d79c
5
protected short parse_config_param(final String param_title, final String param_content) { short ret = MsgDumperCmnDef.MSG_DUMPER_SUCCESS; boolean found = false; for (int index = 0 ; index < title_len ; index++) { if (param_title.indexOf(title[index]) == 0) { switch(index) { case 0: port...
4e13427e-4ceb-40c5-aa92-1da74db877bd
1
public FontPreferences(PreferencesWindow owner) { super(FONTS, owner); FlexGrid grid = new FlexGrid(); String[] keys = Fonts.getKeys(); mFontPanels = new FontPanel[keys.length]; int i = 0; for (String key : keys) { grid.add(new FlexComponent(createLabel(Fonts.getDescription(key), null), Alignment.RIGHT_B...
ed6f6669-93bf-4aeb-8dc0-20900cb59fe9
5
int besterror(float[] a, int step, int addmul) { int best = best(a, step); switch (addmul) { case 0: for (int i = 0, o = 0; i < dim; i++, o += step) { a[o] -= valuelist[best * dim + i]; } break; case 1: ...
00429c9c-552d-46f4-9cef-d0049a142b70
2
public static void decodeToFile( String dataToDecode, String filename ) throws java.io.IOException { Base64.OutputStream bos = null; try{ bos = new Base64.OutputStream( new java.io.FileOutputStream( filename ), Base64.DECODE ); bos.write( dataT...
8a3e6d53-84ae-437c-8e58-ffb106c8c879
4
public String diff_prettyHtml(LinkedList<Diff> diffs) { StringBuilder html = new StringBuilder(); for (Diff aDiff : diffs) { String text = aDiff.text.replace("&", "&amp;").replace("<", "&lt;") .replace(">", "&gt;").replace("\n", "&para;<br>"); switch (aDiff.operation) { case INSERT: html.append("<in...
1292dd0e-3220-4a78-af5e-c04a7980725a
8
private void loadAndDisplayInfo() { String filename = "Help Files" + File.separator + "Temperature Monitor Help.txt"; String line; FileInputStream fileInputStream = null; InputStreamReader inputStreamReader = null; BufferedReader in = null; textArea.append("\n"); //blank line at the ...
491fb57f-513b-478e-b6b1-5fb3a3ea73b6
6
public boolean remove(char[] key) throws Throwable{ Node nodo = null; int a; for(a = 2; a < key.length; a++){ if(nodo.nodos[ this.posInAlfa(key[a]) ] != null){ nodo = nodo.nodos[ this.posInAlfa(key[a]) ]; } else{ return false; } } /* System.out.println("Passou por aqui!");*/ if(nodo...
a973ff76-393e-411d-9b7b-3a49bfa0ce38
3
@Override public void execute(VGDLSprite sprite1, VGDLSprite sprite2, Game game) { int numSpritesCheck = game.getNumSprites(itypeCount); this.applyScore = false; this.count = false; if(numSpritesCheck <= leq && numSpritesCheck >= geq) { VGDLSprite newSprite = ...
51301586-e32a-4017-9af0-2e5ba9cb77f8
5
final void _collectElementsByLabel_(final BEXNodeAdapter node, final boolean self) { if (node.node.type() == BEXNode.ELEM_NODE) { if (self && this.name.equals(node.node.name()) && this.uri.equals(node.node.uri())) { this.list.add(node); } final NodeList children = node.getChildNodes(); for (int ...
30293283-2af4-4341-8b97-516579f0f8e6
4
private void startOneReloaderThread() { final Thread t = new Thread() { @Override public void run() { try { synchronized(ChunkManager.this) { ++numberOfThreads; } while(!isInterrupted()) { for(;;) { if(hasContentToReload()) { ...
0cf20146-1bc7-43d4-afce-c6d8837939e6
8
private void checkForPopUp(MouseEvent e) { JPopupMenu popup = new JPopupMenu(target.getDockKey().getName()); // first add the standard menu DockKey key = target.getDockKey(); switch(key.getLocation()) { case DOCKED: initDockedPopUp(popup); break; case HIDDEN: initAutoHidePopUp(popup); brea...
0d8ad021-9fbe-491d-93e7-5aee4d8d1515
1
private JPanel buildAuthorPane() { JPanel panel = new JPanel(new BorderLayout()); try { JEditorPane editor = new JEditorPane( Main.class.getResource("help/author.html") ); editor.setEditable(false); panel.setBorder(BorderFactory.createEmptyBorder(8, 8, 8...
0c31ad6e-5915-471d-bbeb-de50543785b0
8
final void method3817(int i, int i_29_) { if (i <= 53) method3878(-0.15425435F, 84, -0.11598543F, 0.9862154F, -1.0921319F, -1.1620088F, -1.5202727F); if (anInt8167 != i_29_) { boolean bool; Class173 class173; boolean bool_30_; if (i_29_ == 1) { bool = true; class173 = Class348_Su...
a6c73d7c-1108-4c46-81c1-bc13e879e26e
0
@AfterClass public static void tearDownClass() { }
1a4bc4db-c964-4990-a806-9b9582e45483
4
private ArrayList<String[]> exeQuery(Connection conn, String sql, String[] params) throws SQLException { ArrayList<String[]> returnResult = new ArrayList<String[]>(); PreparedStatement preStmt = conn.prepareStatement(sql); if (params != null) { for (int i = 0; i < params.length; i++) { preStmt.setString(...
eddfcd65-b961-46d1-8c02-5c5416a81a85
8
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if(!SessionHelper.checklogin(request, response)){ return; } //all cams for current user List<Cam> collectioncam = camDao.getCamsForuser(SessionHelper.currentUser(request).getId()); // for (i...
8be2cefa-d75c-4873-a5af-0728bdd4e017
0
@Override public void start(Stage stage) throws Exception { this.stage = stage; stage.setScene(createPreloaderScene()); stage.show(); loading.animate(); }
400bc7c7-d47e-4abd-a5a4-66ebc6dcdd20
2
@SuppressWarnings("unchecked") public Object clone() throws CloneNotSupportedException { Person p = (Person) super.clone(); // Deep clone the counter if (mCounter != null) { p.setCounter((Item) mCounter.clone()); } // deep clone the vector. if (mThings != null) { // Deep clone the vector and c...
e1ec2d12-288d-49e0-9fb0-edf680ceb71b
8
private void SlaySurroundingZombies( int rowPosition, int columnPosition ) { int killCount = 0; int leftBoundary = ( rowPosition == 0 ) ? 0 : rowPosition - 1; int rightBoundary = ( columnPosition == world[0].length - 1 ) ? world[0].length - 1 : columnPosition + 1; int topBoundary = ( columnPosition == 0 ) ...
ca56672f-ce9e-4476-ae4f-c5475db7ab72
7
private static void printTable(String[][] table) { // Find out what the maximum number of columns is in any row int maxColumns = 0; for (int i = 0; i < table.length; i++) { maxColumns = Math.max(table[i].length, maxColumns); } // Find the maximum length of a string in each column int[] lengths = new int...
78cf4736-a432-47ae-8c97-af5f725b1ff3
2
public void crawl(final PageVisitor visitor) { if (visitor == null) { throw new IllegalArgumentException("visitor cannot be null"); } ThreadPoolExecutor executor = new ThreadPoolExecutor(config.minPoolSize(), config.maxPoolSize(), config .keepAliveMilliseconds(), TimeUnit.MILLISECONDS, new DelayedBlocking...
36814956-f245-4328-bb58-cbfc3e9c3487
0
public String getPrefix() { return _prefix; }
04c1b978-1dbe-47f9-a6d6-5490a1de3553
1
public static int applyHue(int color, double hue, double saturation) { double l = getLightness(color); double s = saturation; double v2; if ( l < 0.5 ) v2 = l * (1+s); else v2 = ( l + s ) - ( s * l ); double v1 = 2.0 * l - v2; //System.out.println("l: " + l + "s: " + s); int r = (int)(255 ...
12c3d2dd-e560-4b43-8abc-69899728800a
3
public static final Vector nearestPointOnLineSegment(Vector line0, Vector line1, Vector point) { double lenSq = line0.distanceSq(line1); if(lenSq == 0.0) { return line0.clone(); } Vector pv = point.clone().sub(line0); Vector wv = line1.clone().sub(line0); double t = pv.dot(wv) / lenSq; if(t <= 0)...
07262fd3-554b-4dbe-a8a0-46ab9ca0b9e7
9
@Override public String toString() { StringBuffer buf = new StringBuffer(); buf.append(RFC4566.TYPE_MEDIA).append(RFC4566.SEPARATOR); buf.append(type).append(" ").append(port); buf.append(" RTP/AVP"); for (Codec codec: codecs) { buf.append(" "); buf.ap...
3b47ab95-8252-44a0-b0f5-b10359ffcd0e
8
private void projectileAttack(){ Point startPoint = new Point(Game.PLAYER.getX(), Game.PLAYER.getY()); Point endPoint = new Point(Mouse.getX() + Game.PLAYER.getCameraX(), Mouse.getY()+ Game.PLAYER.getCameraY()); if(inUse == false){ if(skillEffects.isEmpty() || hasEffect(SkillEffect.DOUBLE)){ World.ad...
55edfe8f-8aa5-4ebf-8c9a-f4f45cd8731f
2
static public boolean readMagic(InputStream is) throws IOException { byte[] buffer = new byte[4]; realRead(is, buffer, 4); if (!Arrays.equals(buffer, CHIB)) { return false; } realRead(is, buffer, 4); if (!Arrays.equals(buffer, IOEK)) { return false; } return true; }
20bc47db-3f32-48ce-ad04-258a9334035c
2
public double getLongitudeByPID(Statement statement,String PID)//根据PID获取经度 { double result = -1.0; sql = "select longitude from Park where PID = '" + PID +"'"; try { ResultSet rs = statement.executeQuery(sql); while (rs.next()) { result = rs.getInt("longitude"); } } catch (SQLException e) ...
7d4d9051-0ab2-42e5-a76c-559ebea73934
0
public static void main(String args[]) { TabStripper ts = new TabStripper(args); }
13df4aa1-e54f-4b1f-9194-3493e2018b86
7
public EvaluationResult evaluate(List inputs, EvaluationCtx context) { // Evaluate the arguments AttributeValue [] argValues = new AttributeValue[inputs.size()]; EvaluationResult result = evalArgs(inputs, context, argValues); if (result != null) return result; // Now...
0e93b98e-56a1-4460-a4f2-cb2477fea6b0
2
public boolean isDependentOn(String variable1, String variable2, VariableDependencyGraph graph) { State v1 = getStateForVariable(variable1, graph); State v2 = getStateForVariable(variable2, graph); graph.setInitialState(v1); UnreachableStatesDetector usd = new UnreachableStatesDetector(graph); State[] stat...
2711c411-3f71-4f31-93ec-f259afe8f137
6
private static boolean snip(Vector2D[] contour, int u, int v, int w, int n, int[] vList){ int p; double Ax, Ay, Bx, By, Cx, Cy, Px, Py; Ax = contour[vList[u]].x; Ay = contour[vList[u]].y; Bx = contour[vList[v]].x; By = contour[vList[v]].y; Cx = contour[vList[w]].x; Cy = contour[vList[w]].y; if ( E...
66a8983a-3f90-4921-b6ac-61d402d8a573
0
public boolean hasNegativeWeights() { return hasNegativeWeights; }
250893eb-2a01-4eab-9686-dbf51bb58814
4
public double getXSpeed(int which) { //return leftJoy.getRawAxis(4); ?? switch(which){ case 1: return leftDriveJoy.getX(); case 2: return rightDriveJoy.getX(); case 3: return leftJoy.getX(); case 4: ...
a586fb05-e4e3-4113-aaab-25f96a475c42
2
public Contact getContact(String name) { Contact foundContact = null; for (int i = 0; i < contactList.size(); i++) { if (contactList.get(i).getName().equals(name)) { foundContact = contactList.get(i); } } return foundContact; }
bea5184a-d08e-49ad-a3a3-b46edb82f0bc
4
private File extractFromJar(String filename) { try { String tmpFilePath = System.getProperty("java.io.tmpdir"); File efile = new File(tmpFilePath, filename.substring(filename.lastIndexOf("/")+1)); if(efile.exists()) efile.delete(); InputStream in =...
1d1d8ef6-15be-4fa9-857f-374c7dc5f8bc
3
public static void noSpace(String string) throws JSONException { int i, length = string.length(); if (length == 0) { throw new JSONException("Empty string."); } for (i = 0; i < length; i += 1) { if (Character.isWhitespace(string.charAt(i))) { throw...
363ed9be-680d-4009-a203-39b7d580d67f
6
protected final List<Argument> parseArguments(List<String> commands){ List<Argument> arguments = new ArrayList<Argument>(); Argument lastArgument = null; for(String cur : commands){ if(cur.startsWith(String.valueOf(this.commandChar))){ if(lastArgument != null...
0a35685b-8208-4334-8523-6db36a4b3362
2
public ObjectMap arbrePlusProcheO (List<ObjectMap> l){ for(int i = 0 ; i < l.size() ; i++){ if(l.get(i) instanceof Bois){ return l.get(i); } } return null; }
0bd23408-1b58-4e18-bd21-82d9bc3f0e1d
8
public static void unenrolUsers(MoodleEnrolUser[] user) throws UnsupportedEncodingException, MoodleRestEnrolException, MoodleRestException { String functionCall=MoodleCallRestWebService.isLegacy()?MoodleServices.MOODLE_ROLE_UNASSIGN:MoodleServices.CORE_ROLE_UNASSIGN_ROLES; try { StringBuilde...
cc2e8f1f-2c9d-44db-8eb8-50a58d248f4f
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...
bff601a7-97ab-4f45-a50c-5052e444f92b
6
@Override public void render(Graphics2D g2d, int width, int height) { if(borderWidth > 0) { g2d.setColor(new Color(borderColor)); if(borderRadius == 0) { g2d.fillRect(this.x - borderWidth, this.y - borderWidth, this.width + 2*borderWidth, this.height + 2*borderWidth); }else { g2d.fillRoundRect(t...
323fc5fc-2a8d-4c78-8dcc-f5c3a15dfffd
4
public void stop() { server.stop(); int maxWait = 5000 * 5; int currentWait = 0; while (server.getState() != ServerConstants.SERVER_STATE_SHUTDOWN) { LOG.log(Level.INFO, "Shutting down hsqldb-server. State: " + server.getStateDescriptor()); LOG.log(Level.INFO, name); LOG.log(Level.INFO, path); LOG.l...
4de1c8e1-4567-4adb-b1d5-77cc63d834c4
9
public final static String[] replaceInAll(String[] strs, final String thisStr, final String withThisStr) { if((strs==null) ||(thisStr==null) ||(withThisStr==null) ||(strs.length==0) ||(thisStr.length()==0)) { return strs; } for(int s=0;s<strs.length;s++) { final String str=strs[s]; for(int i...
27460140-c175-4fb3-b19d-03c70cb8eb7f
7
public List<Cluster> computeGraphClusters(Map<String, ArrayList<String>> adjList, int numbOfClusters) throws InterruptedException, ExecutionException { List<Cluster> allClusters = new ArrayList<>(); NUMB_PARALL_CLUSTERS = numbOfClusters; boolean seedSelected = false; Integer clusterId = 1; // a set of all p...
511bb780-b0b9-4b65-bc5a-f733dbb06eba
8
protected void rebuild() { removeAll(); for (SpecObject specObject : specification.getSpecObjectList()) { if (specObject instanceof Predicate) { addView(new PredicateView((Predicate) specObject, specController)); } ...
1f2786ab-3757-4d83-bfca-196b62b7f648
2
public static void print() { int counter = 1; while (true) { System.out.println("Counter: " + counter++); try { Thread.sleep(1000); // sleep for 1 seconds } catch (InterruptedException e) { e.printStackTrace(); } } }
fbb47542-c54f-41f2-b162-7619b6321568
5
@Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof Carpart)) { return false; } Carpart other = (Carpart) object; if ((this.id == null && other.id != null) || (thi...
ced0eeaf-4ce3-4e0c-b420-f20f2b2b5113
4
@Override public boolean createTable(String query) { Statement statement = null; try { if (query == null) { this.writeError("SQL query null", true); return false; } if (query.equals("")) { this.writeError("SQL query empty: createTable(" + query + ")", true); return false; ...
4c8780a7-a1c1-442e-9316-21d00c7246c3
1
@Override public void prepareToMission() { for (Hero h: getHeroes()) { removeShadowRadius(h.getX(), h.getY(), 3); } /*try { for (Castle c: getCastles()) { Point p = WorldMap.getLastInstance().getPositionOfObject(c); removeShadowRadius(p.x, p.y, 3); } } catch (Exception e) {}*/ }
e14c7482-9648-4363-bbc7-ee565b7f9611
1
public UploadInfo getUploadInfo() { HttpServletRequest req = WebContextFactory.get().getHttpServletRequest(); if (req.getSession().getAttribute("uploadInfo") != null) return (UploadInfo) req.getSession().getAttribute("uploadInfo"); else return new UploadInfo(); }
5e54d070-4c0c-4ded-a402-e36eb1760ba5
5
void setExampleWidgetAlignment () { int alignment = 0; if (leftButton.getSelection ()) alignment = SWT.LEFT; if (centerButton.getSelection ()) alignment = SWT.CENTER; if (rightButton.getSelection ()) alignment = SWT.RIGHT; if (upButton.getSelection ()) alignment = SWT.UP; if (downButton.getSelection ()) ali...
8eab9345-a63a-4613-98c1-0300537a4467
9
@Override public int getOperandCode() { switch (this.register) { case A: return 0x08; case B: return 0x09; case C: return 0x0A; case X: return 0x0B; case Y: return 0x0C...
dc7f493b-1886-4d0b-8047-cff31a7c4672
0
public void setjLabel3(JLabel jLabel3) { this.jLabel3 = jLabel3; }
984bc7b0-648b-4c35-a291-4170b01f2f1b
1
public void testMultipliedBy_int() { Minutes test = Minutes.minutes(2); assertEquals(6, test.multipliedBy(3).getMinutes()); assertEquals(2, test.getMinutes()); assertEquals(-6, test.multipliedBy(-3).getMinutes()); assertSame(test, test.multipliedBy(1)); Minutes h...
de487425-f14e-4c4e-a75a-68f458166e9b
8
public static void writeGenotypesFile(String fName, boolean founders, PopulationData popdata) throws IOException, Exception { System.out.println("write file "+fName); //File outFile = new File(fName); //PrintWriter out = new PrintWriter(new FileWriter(outFile)); PrintWriter o...
ee82804d-93fb-4376-b7f0-5adcfcd22e9b
8
public Set<Map.Entry<Character,Double>> entrySet() { return new AbstractSet<Map.Entry<Character,Double>>() { public int size() { return _map.size(); } public boolean isEmpty() { return TCharDoubleMapDecorator.this.isEmpty(); } ...
cf459d6e-5e94-4391-a235-a69ddd96ac56
4
@Override public void run() { try { is = new ObjectInputStream(clientSocket.getInputStream()); try { Object o = is.readObject(); if (o instanceof StorageNodeMetadata) { StorageNodeMetadata m = null; m = (StorageNodeMetadata) o;...
68bb7365-1d21-43e7-9c34-e8d3ebd09371
6
@Override public void run() { long nowTime = System.currentTimeMillis(); long nowTicks = world.getFullTime(); float elapsedSecs = (nowTime - startTime) / 1000.0f; int elapsedTicks = (int)(nowTicks - startTicks) + 1; float error = ((int)(((expectedTime - elapsedSecs) / elapsedSecs * 100) * 10)) / 10.0f;...
57fe4d4d-ef5e-4426-a802-cfbdc08be56b
4
@Override public void run() { try { while (!interrupted()) { synchronized (buffer[index]) { while (buffer[index].getValue() < valueToChanging) { buffer[index].wait(); } if (buffer[index].getValue() > valueToChanging) { System.out.println("WTF"); } buffer[index].inc(); ...
b53c13f3-c642-4af3-bdac-61a4ce9b898b
9
private void updateConvo(String input) { //Parse the message data into appropriate fields boolean convoID = false; StringBuilder ci = new StringBuilder(); boolean user = false; StringBuilder un = new StringBuilder(); boolean text = false; StringBuilder msg = new S...
caf108fe-cde7-436e-88db-b733bda06304
0
public String getProjectPath() { return projectPath; }
45a8409f-8317-44e6-a0c0-3f069a5eccba
1
public void setup(){ checkFileFolder(); for(String fileName : files){ listImages.add(new image(parent, parent.loadImage(fileName))); } }
a37804ae-cd15-47d2-b80d-1f20d95a0db2
8
private void initComponents(String mapFormat) { setDefaultCloseOperation(EXIT_ON_CLOSE); setTitle("IJA 2014 - Bludiště"); getContentPane().setLayout(new BorderLayout()); JPanel controlPane = new JPanel(); controlPane.setLayout(new BorderLayout()); map = new XMap(mapFormat); hist...
1bdcb54e-1aa2-4d83-bbf7-fe894269c831
4
public void bearOff(Color player, int source) { if (canBearOff(player)){ Integer dist = 0; // if this doesn't get changed below, something seriously bad is hapened if (player == this.getPlayer1()) { dist = 25 - source; } else if (player == this.getPlayer2()) { dist = source; } if (this.getState...
7c724122-4701-4271-b09e-d87e8db0827d
9
private void readDict (Range r) { this.pos = r.getStart (); while (this.pos < r.getEnd ()) { int cmd = readCommand (false); if (cmd == 1006) { // charstringtype, default=2 this.charstringtype = (int) this.stack[0]; } else if (cmd == 1007) { // fontmatr...
2397e18d-d7df-4761-b24b-0bc0a40e1eb3
8
private boolean isPngHeader(byte[] allData, int i) { if (i + 7 >= allData.length) { return false; } return allData[i] == (byte) 0x89 && allData[i + 1] == (byte) 0x50 && allData[i + 2] == (byte) 0x4E && allData[i + 3] == (byte) 0x47 && allData[i + 4] == (byte) 0x0D && allData[i + 5] == (byte) 0x0A && al...
9f8117ca-7a65-4859-9f14-b21804f3c0b2
3
public final boolean isOwnedBy(ChunkyObject owner) { if (owner == null) return false; ChunkyObject current = this; while (current != null && current != owner) current = current.getOwner(); return current == owner; }
63fa779c-64f4-476e-97d0-6dd1568f7ef8
6
public void takeDamage(int x, int y, int damage) { if(x > -1 && x < width && y > -1 && y < height && theMap[x][y].getHealth() > 0) { theMap[x][y].setHealth(damage); if(theMap[x][y].getHealth() <= 0) { theMap[x][y].setType(0); } } }
c21f4494-22cf-4b89-af9d-121fb20bad58
9
*/ protected boolean chooseMonopoly() { int bestResourceCount = 0; int bestResource = 0; for (int resource = ResourceConstants.CLAY; resource <= ResourceConstants.WOOD; resource++) { //D.ebugPrintln("$$ resource="+resource); int freeResour...
e734c1d1-f42c-4945-849a-c42ade16a489
8
private Connection connectToDB(){ if(this.DriverName != null && this.URL != null && this.UserName != null && this.PassWord != null && this.conn == null){ try { Class.forName(this.DriverName); this.conn = DriverManager.getConnection(this.URL,this.UserName,this.PassWord); } catch (SQLException...
8b007f2e-f321-4b0e-9c35-b3e6042a153a
3
@Override public void open(AudioFormat pAudioFormat) throws AudioDeviceException { boolean failed = false; for ( AudioDevice dev : this.mDevices ) { try { dev.open( pAudioFormat ); } catch (AudioDeviceException e) { failed = true; } } if ( failed ) { throw new AudioDeviceException( "coul...
c1d02271-f5f4-4feb-be6a-326dd6b35b11
7
public void play( Card card) { System.out.println(getName() + " played " + card.getName() + "."); // Remove the card from the player's hand getHand().remove(card); // Add the values from the card to the player's total addRune(card.getRune()); addBattle(card.getB...
831dbf07-e180-4436-a009-fda0dacca5c4
6
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof Badge)) return false; Badge other = (Badge) obj; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.name)) return false; ...
b66dc4b3-b309-4b44-9a98-ff888b1d7ddb
3
private void generateVein(World world, int x, int y, int z, PlacableOre ore, Random rand) { int placed = 0; int size = ore.getVeinSize(rand); ArrayList<int[]> targets = new ArrayList<int[]>(); targets.add(new int[]{x, y, z}); while(targets.size() > 0 && placed < size) { int[] target = targets.remove(ran...
60a15828-dc0b-4e31-b2d7-3bd1f5c757cb
1
@Override public void drawUI() { for(UIElement ui : uiElements) { ui.draw(); } }
4daa5356-1ca5-4b91-aca3-1da6a3059cb7
7
@Test public void doTest() { setPrimes(TEMP); HashSet<BigInteger> f = new HashSet<BigInteger>(); BigInteger temp = new BigInteger("70000"); while (true) { f = getFactors(temp); if (f.size() == 4) { f = getFactors(temp.add(ONE)); ...
0502e2a7-3141-4411-a21b-669d311d5503
8
public void updateUser(String username, String password, String name, String email, String groupNames) throws UserNotFoundException { User user = getUser(username); if (password != null) user.setPassword(password); if (name != null) user.setName(name); if (email != null) ...
4b581ccf-3174-44d6-91c8-d356e3038bb4
3
@Override public void update(){ if(burnTime > 0) if(isLit()) burnTime--; else ; else if(isLit()) setLit(false); }
51e8f1b4-6ca3-4fe9-9040-815b3f1a1637
0
@Override public String toString() { return "fleming.entity.Medico[ numeroColegiado=" + numeroColegiado + " ]"; }
5fc65c2f-ee3b-49b7-a9c7-4d47496fdf1d
0
public static void main(String[] args){ Bitmap b = new Bitmap(32); b.set(3); System.out.println("2: " + b.test(2)); System.out.println("3: " + b.test(3)); b.clear(3); System.out.println("3: " + b.test(3)); b.set(4); System.out.println("4: " + b.test(4)); b.set(31); System.out.println("34: " + b.test...
16a339fa-d72e-4304-b3ea-82539e4ef0ff
5
@Override public int compareTo(Card c) { int rank=this.rankValue().compareTo(c.rankValue()); int suit=this.suitVaule().compareTo(c.suitVaule()); if(rank>0) return 1; else if(rank<0) return -1; else if(suit>0) return 1; else if(suit==0&&rank==0) return 0; else return -1; }
4903930c-9c2c-4eba-9d59-8eec79e3b27d
0
public <T extends BusinessObject> List<T> searchForAll(String boType) throws DataException { return (List<T>)searchForList(boType); }