method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
5f878b02-0c23-473f-bc8f-37352b5fd787
6
public static String escape(String string) { char c; String s = string.trim(); StringBuffer sb = new StringBuffer(); int length = s.length(); for (int i = 0; i < length; i += 1) { c = s.charAt(i); if (c < ' ' || c == '+' || c == '%' ...
b18b0c7f-4a09-49cd-af7b-afe417f29bd6
8
public void putAll( Map<? extends Double, ? extends Byte> map ) { Iterator<? extends Entry<? extends Double,? extends Byte>> it = map.entrySet().iterator(); for ( int i = map.size(); i-- > 0; ) { Entry<? extends Double,? extends Byte> e = it.next(); this.put( e.getKey...
cc2d1ae6-52f9-4d63-9b2e-beed3312af9b
5
public String getValueByLabel(String label) throws IllegalStateException { if (nextValueLine == getLastLineNumber()) throw new IllegalStateException("nextValue() was used to get values from this line."); if (lastLine == null) return null; int fieldIndex; try { fieldIndex = ge...
2f8b1e2b-3752-48a4-8261-90f45174b888
8
public void run() { graphicsConfiguration = getGraphicsConfiguration(); // scene = new LevelScene(graphicsConfiguration); mapScene = new MapScene(graphicsConfiguration, this, new Random().nextLong()); scene = mapScene; scene.setSound(sound); Art.init(graphicsCo...
1b721348-9491-4ef6-ae99-30cab55a89d5
6
protected void calculateHorizon(Point3d eyePnt, HalfEdge edge0, Face face, Vector horizon) { // oldFaces.add (face); deleteFacePoints(face, null); face.mark = Face.DELETED; if (LOG.isDebugEnabled()) { LOG.debug(" visiting face " + face.getVertexString()); } H...
672fa1f6-bab6-422c-a52b-9a8d42a114a3
7
public int getStartHeight() { switch(c.MAGIC_SPELLS[c.spellId][0]) { case 1562: // stun return 25; case 12939:// smoke rush return 35; case 12987: // shadow rush return 38; case 12861: // ice rush return 15; case 12951: // smoke blitz return 38; case 12999: // sha...
8c1ae46e-cb51-42c6-9f07-2e2dd1184fbb
0
public static int[] getChunkRegion(int chunkX,int chunkZ) { int[] res = new int[2]; res[0] = (int)Math.floor(chunkX / 32.0); res[1] = (int)Math.floor(chunkZ / 32.0); return res; }
21df7e3d-5199-4b96-af5b-9b3546760728
6
public ModPack(String name, String author, String version, String logo, String url, String image, String dir, String mcVersion, String serverUrl, String info, String mods, String oldVersions, String animation, String maxPermSize, int idx, boolean privatePack, String xml) throws IOException, NoSuchAlgorithmException...
d6c4736e-09ac-459a-8a69-0cd5639277cb
9
public synchronized boolean display() throws MenuExitException { boolean done = false; boolean result = false; String response = ""; while (!done && !user.isDead()) { user.broadcast(menuOptions); response = user.getMenuResponse(); if (response.equalsIgnoreCase("exit") || response.equalsIgnoreCase("e"...
ad19a876-9e7f-4f5b-b136-32dfeebecac4
9
@Override public void invoke(Entity e) { int x = 0, y = 0; boolean located = false; for (Boundary b : e.get(Boundary.class)) { x = (int) b.getMinimum().getX(); y = (int) b.getMaximum().getY(); located = true; } super.invoke(e); if...
a60bc00e-1fe0-41a0-86a7-7a6fcb327a1f
4
@Override public void setValue(int row, int col, double value) throws MatrixIndexOutOfBoundsException { if ((row < 0) || (col < 0) || (row >= mas.length) || (col >= mas[0].length)) { throw new MatrixIndexOutOfBoundsException("Inadmissible value of an index."); } mas[row][col] = v...
e262d3d1-c0c4-4434-831e-eeb3db3763d7
0
@Override public Short getMax() { // TODO Auto-generated method stub return null; }
8be5d46c-da18-4053-a911-b0595fa48728
8
@Override public void run() { try { LinkedList<InetAddress> broadcastIps; if(System.getProperty("os.name").startsWith("Windows")) {//we have a windows here.... broadcastIps = getBroadcastWindows(); }else { //do normal stuff broadcastIps = new LinkedList<InetAddress>(); Enumeration...
dd323a1e-18c5-4df0-bc67-2e679d7412fa
4
@Override public void execute(CommandSender sender, String[] arg1) { if (!CommandUtil.hasPermission(sender, PERMISSION_NODES)) { sender.sendMessage(plugin.NO_PERMISSION); return; } String kmessage = plugin.DEFAULT_KICK_PLAYER; kmessage.replace("%sender", sender.getName()); if (arg1.length > 0) { km...
d3eb0057-e396-4c90-b45a-f04c26d68bdd
8
private static void move(int p, int s, int f) { int start = s; int finish = f; int loops = (finish - start) / 13; int skip; if (p == 0) { skip = 13; if (finish == 13) { finish++; } if (finish <= 12) { fillBeans(start + 1,...
73e5d041-be65-4e28-8992-66e0b2f77490
5
@Override public void actionPerformed(ActionEvent e) { if(e.getSource() == backButton) { this.dispose(); } else { for(int i = 0; i < buttonList.size(); i++) { if(e.getSource() == buttonList.get(i)) { ...
9b58668e-87b1-457e-a7b2-f30e370695d6
3
public void initialize() { setLayout(null); txt_FirstName = new JTextField(); txt_FirstName.setBounds(82, 84, 214, 22); add(txt_FirstName); txt_FirstName.setColumns(10); JLabel lblFirstName = new JLabel("First Name"); lblFirstName.setBounds(12, 70, 200, 50); add(lblFirstName); JLabel lblLast...
d9cba15f-a1ed-40af-bea8-c66797b68aec
7
public void resetPiece(){ if(piece.getColor() == 1){ piece = new Piece(piece.getColor(), new Location(0,3), new Location(0,4), new Location(0,5), new Location(0,6), board,0); } else if(piece.getColor() == 2){ piece = new Piece(piece.getColor(), new Location(1,6),new Location(0,6),new Location(0,5),new Locat...
e0e64e71-0321-4652-b964-e787e32f2ca0
1
public String getErrorMessage(TypedObject message) { // Works for clientVersion return (debug ? message.toString() : message.getTO("data").getTO("rootCause").getString("message")); }
bf267f93-c9a4-4598-9a1c-b1e9ce4c1e4b
7
final boolean method2041(byte i) { if (i < 42) aFloat3462 = 2.1357973F; if (((Class269) this).anInterface18_Impl1_3455 == null) { if (Deque.anObject3331 == null) { byte[] is = Class5_Sub2.method194(128, -1922, 8, 0.6F, 128, 4.0F, 4.0F, 0.5F, 16.0F, new Class186_Sub1(419684), 16); ...
f8c46853-2e28-4b98-9a0a-50962fb13711
5
public void checkEatApple(){ if(snake.get(0).isOnApple()){ int add = new Random().nextInt(3) + 1; Color c = apple.color; if(apple.color == Color.YELLOW){ add = 12; } if(apple.color == Color.GREEN){ speed = defFastSpeed; speedCount = defCount * 2; } if(apple.color == Color.GRAY){ ...
7ebf3b39-e536-4825-a20f-8cbdad958328
3
@Override public void run() { if(implementacao == 1) leitorEescritor(); else if(implementacao == 2) try { naoLeitorEescritor(); } catch (InterruptedException e) { e.printStackTrace(); } }
81424817-0e99-42c8-87ff-83d6cf09ee31
7
private void set(String id, String in) { if (id.equals(UserColumn.ACCOUNT_ID)) { this.account_id = in; } else if (id.equals(UserColumn.ROLE)) { this.role = in; } else if (id.equals(UserColumn.LOGIN_ID)) { this.login_id = in; } e...
11e898f0-4f8d-4a83-a006-41b8c557304d
1
public final String[] getChannels() { String[] channels = new String[0]; synchronized (_channels) { channels = new String[_channels.size()]; Enumeration enumeration = _channels.keys(); for (int i = 0; i < channels.length; i++) { channels[i] = (String) ...
2be1ff16-ec80-4562-aa24-c46f568e1588
5
public GuardView() { // LOAD IMAGES for (int j = 0; j < 4; j++) { String direction = ""; if (j == 0) { direction = "left"; } if (j == 1) { direction = "right"; } if (j == 2) { direction = "down"; } if (j == 3) { direction = "up"; } ...
6ecf1437-ffe0-455f-9c75-3a11c9d4a8d8
0
public synchronized void addDownloadRangeList(String url){ this.downloadRangeList.add(url); }
85c3b9f3-e1b6-42a8-881c-769a58ce6c6d
2
@Override protected ArrayList<ColorPatch> doInBackground() throws Exception { ColorPatch sum = new ColorPatch(); for (ColorPatch patch : patches) { sum.add(patch.getColor(), false); } sum.recalculate(); int i=0, n=patches.size(); for (ColorPatch patch : patches) { double score = 0; Color...
13f8fbcb-8331-4dd1-9ef1-0a65a229c841
4
private void scan(String host,int port){ Socket socket = null; try { socket = new Socket(); InetSocketAddress address = new InetSocketAddress(host, port); // 连接此端口,连上了打印 socket.connect(address, 500); System.out.println("This is a server on " + host + ":" + port); } catch (UnknownHostException e) { ...
72594f9c-e72a-46d5-a086-d2952ae99ed8
3
public void recievePacket(byte[] bytearray) { DataInputStream packetStream = new DataInputStream(new BufferedInputStream( new ByteArrayInputStream(bytearray))); try { int id = packetStream.readByte(); switch (id) { case PING: { consoleMessage("recieved Ping"); sendPong(); break; ...
fe0a2ed0-54a5-45e9-96f9-af81398601bf
3
static String omzettenHoofdletter(String reeks) { for(int i = 0; i < reeks.length(); i++) { if(reeks.charAt(i) > 64 && reeks.charAt(i) < 91) reeks = reeks.replace("A","a"); reeks = reeks.replace("B","b"); reeks = reeks.replace("C","c"); reeks = reeks.replace("D","d"); reeks = reeks.replace("E",...
d2af40ad-7860-4e7c-ac5c-8fcee5a057ef
0
private MathUtils() { }
3304ac4e-d3a6-41ed-bcda-c5624fd122c7
6
public void gameShooter() { Collections.shuffle(shooter); for (int i = 0; i < 100; i++) { Collections.shuffle(shooter); if(shooter.get(0) == team.get(0).name) { ShootPct(team.get(0).name); } if(shooter.get(0) == team.get(1).name) { ShootPct(team.get(1).name); } if(shooter.g...
09bce475-63f3-406a-8db4-928421ef392a
4
public Cardinal nextCounterClockwise(){ switch(this){ case WEST: return SOUTH; case SOUTH: return EAST; case EAST: return NORTH; case NORTH: return WEST; default: return null; } }
ae7cb6bc-9d9c-4697-b869-8c9ef41ecd82
5
public static void sort(String[] a, int w) { int R = 256; int N = a.length; String[] aux = new String[N]; for (int i = w - 1; i >= 0; i--) { int[] count = new int[R + 1]; // 计算出现的频率 for (int j = 0; j < N; j++) { count[a[j].charAt(i) + 1]++; } // 将频率转换为索引 for (int k = 0; k < R; k++) { c...
5924e3d3-06fa-40e9-85bc-e764e9c90806
3
public static Consensus getConsensus (Alignment layoutMap) { int numOfCols = getNumberOfColumns(layoutMap); Consensus consensus = new Consensus(layoutMap.getLayoutID()); double f1score = 0.0; double f2score = 0.0; for (int col = 0; col < numOfCols; col++) { char[] column = getColumn(layoutMap,col); Met...
43fa3e1b-dade-45f1-b4d0-ec8c97288fc4
2
private static Prescription getPrescription(Prescription bean, PreparedStatement stmt, ResultSet rs) throws SQLException{ if(bean.getPrescriptionID()!=0) stmt.setInt(1, bean.getPrescriptionID()); else{ stmt.setInt(1, bean.getPid()); stmt.setInt(2, bean.getDid()); } rs = stmt.executeQuery(); if (rs...
b7db011b-094d-48e3-9ab9-f82cad6eb62f
8
public Edge getEdgeByPathCaseID(String psid, String sid, String tid) { boolean flag = false; if (psid == null || psid.equals("null")) { flag = true; //source node is a process node } Graph2D view = graphViewer.view.getGraph2D(); for (Edge edge : view.getEdgeArray()) {...
ff0dcba3-76f8-4f80-aea2-f15bf65729bc
3
@Override public Sondage insert(Sondage obj) { PreparedStatement pst = null; try { pst = this.connect().prepareStatement("INSERT INTO Sondage (question,choixa,choixb,choixc,id) VALUES (?,?,?,?,?);"); pst.setString(1, obj.getQuestion()); ...
dda8c6e6-d7cf-40d6-b33b-babeab2d9586
9
private void field_sit_frente_ivaFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_field_sit_frente_ivaFocusLost if((field_sit_frente_iva.isEditable())&&(validar.isInt(field_calle.getText()))){ boolean es_componente=false; //voy a preguntar si la componente que me saco el foco ...
a1a95325-ae08-4f38-9040-464a08fa5bb2
5
@Override public String next() { try { if ( maxLines > 0 && maxLines <= linesRead ) { throw new NoSuchElementException(); } String result = nextline; if ( nextline != null ) { nextline = ...
bde11179-dd15-466a-9ab8-461c5b4a7186
2
public String readFile(File file) { StringBuffer fileBuffer = null; String fileString = null; String line = null; try { FileReader in = new FileReader(file); BufferedReader brd = new BufferedReader(in); fileBuffer = new StringBuffer(); while ((line = brd.readLine()) != null) { fileBuffer.appe...
db353197-84f2-4480-8e0a-bfa291a11d7d
2
public void wdgmsg(Widget sender, String msg, Object... args) { int id; synchronized (this) { if (!rwidgets.containsKey(sender)) return; id = rwidgets.get(sender); } if (rcvr != null) rcvr.rcvmsg(id, msg, args); }
4bf8793e-9e83-4bf1-a710-e61d612ce5f2
6
public void deleteCaches() { if(isCachingActive()) { for (int x = 0; caches != null && x != caches.size(); x++) { CachedEntry entry = (CachedEntry) caches.get(x); if (entry != null) { List children = entry.getChildren(); if (children != null) ...
362f1489-2a98-4c5b-9163-f4df044559e9
7
public String [] getOptions() { String [] options = new String [10]; int current = 0; if (m_noCleanup) { options[current++] = "-L"; } if (m_unpruned) { options[current++] = "-U"; } else { if (!m_subtreeRaising) { options[current++] = "-S"; } options[current++] = ...
e0968141-45dc-4822-92b3-7d4a816293a8
7
@FXML private void PressEnter(KeyEvent event) { String pulsado = event.getCode().toString(); if ("ENTER".equals(pulsado)){ String dir = Direccion.getText(); if(dir.contains("http")==true || dir.contains("www")==true|| dir.contains(".com")==true|| dir.contains(".es")==true){ dir = dir....
ad1e0937-a9e1-4837-8a8e-845bfea31d9c
8
public void keyTyped(KeyEvent e){ switch (e.getKeyCode()){ case p1Up: if(userLeft) { p.get(0).moveUp(); } break; case p1Down: if(userLeft) { p.get(0).moveDown(); } break; case p2Up: if(userRight){ p.get(...
58266990-6b31-426c-8ae8-a6738ead29e8
8
private void remove() { for(int i = 0; i < entities.size(); i++){ if(entities.get(i).isRemoved()) entities.remove(i); } for(int i = 0; i < projectiles.size(); i++){ if(projectiles.get(i).isRemoved()) projectiles.remove(i); } for(int i = 0; i < particles.size(); i++){ if(particles.get(i).isRemoved())...
72e69e96-1c7b-4390-9440-7ae4ac2347ba
8
public Resource handleCGIOutput( HTTPHeaders headers, File file, URI requestURI, PostDataWrapper postData, ProcessableResource cgiOutput ) throws IOException { // The processable resource stores the system-process's output inside an internal buffer. // Now we can rea...
b322a838-194b-4398-b85f-c2c1669cb954
9
private void setDispenserDefaultDirection(World par1World, int par2, int par3, int par4) { if (!par1World.isRemote) { int var5 = par1World.getBlockId(par2, par3, par4 - 1); int var6 = par1World.getBlockId(par2, par3, par4 + 1); int var7 = par1World.getBlockId(par2...
b682ccb7-15d4-48b4-98df-3d93cc0e6840
4
public static boolean isAllLowerCase(String str) { if (str == null || isEmpty(str)) { return false; } int sz = str.length(); for (int i = 0; i < sz; i++) { if (Character.isLowerCase(str.charAt(i)) == false) { return ...
f37be4f1-1b85-413e-a083-ee0cd35ba2ae
0
public static String toUpperCase(String input){ return input.toUpperCase(); }
8b093968-e9f2-471a-8bcc-2aff4af2c1a8
2
public int getRow(Booking booking){ int row=0; for(Movement movement:rekening.getBusinessObjects()){ if(movement.getBooking()!=booking){ row++; } else{ return row; } } return 0; }
459515d9-871b-4bd4-9573-d005bc24a5bd
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...
9c212c1a-06db-4ffc-901f-7b4f4aabe35c
2
private void writeCitationsToFile() { List<Citation> citations = super.getCitations(); ObjectOutputStream objectOutputStream = null; try { FileOutputStream fileOutputStream = new FileOutputStream(serializationFilename); objectOutputStream = new ObjectOutputStream(fileOutp...
41d52b9a-ff6e-442d-8db0-dad0a01927dd
1
public <E extends Exception> void printValidateExceptionsList(List<E> validateExceptionList) { for (E validateException : validateExceptionList) { System.out.println(validateException.getMessage()); } }
bd38795f-def9-4b7e-afa2-e9f2b857b1dd
5
private static <L> Tree<L> pruneNodesHelper(Tree<L> tree, Filter<L> filter) { if (filter.accept(tree.getLabel())) return null; List<Tree<L>> prunedChildren = new ArrayList<Tree<L>>(); for (Tree<L> child : tree.getChildren()) { Tree<L> prunedChild = pruneNodesHelper(child, filter); if (prun...
1b71a9ab-5f9b-4e6c-8711-cc337ab0195f
5
public void playCollideSound(){ String sound; switch(damageType){ case ELECTRO: sound = "noise1"; break; case DARKMAGIC: case FIRE: sound = "explosion1"; break; case ICE: sound = "clap1"; break; case ROCK: sound = "shake3"; break; default: sound = "chirp2"; } main.playSou...
ffe5c5ba-8342-48f3-bd11-74bda7cac762
9
protected void removeMatches(Map<Integer, List<MatchResult>> matches, int start, int end) { if (matches == null) { return; } for (int offset : matches.keySet()) { List<MatchResult> offsetMatches = matches.get(offset); ListIterator<MatchResult> iterator = offsetMatches.listIterator(); ...
cf154ff7-40c1-4de4-b050-5b76a628b59a
7
public static Keyword refutationDisjointSpecialist(ControlFrame frame, Keyword lastmove) { { Proposition proposition = frame.proposition; Stella_Object arg1 = Logic.argumentBoundTo((proposition.arguments.theArray)[0]); Stella_Object arg2 = Logic.argumentBoundTo((proposition.arguments.theArray)[1]); ...
c4a08a2c-ac12-48be-856a-bb2a38a047e8
7
public void playOfflineWithEffect() { /* R�cup�ration de la taille d'un �chantillon */ int sampleSize = format.getSampleSizeInBits(); long nbSample = -1; /* Traitement en mono, et �ventuellement st�r�o */ /* On regarde si le fichier audio est en st�r�o ou en mono */ if (format.getChannels() == 1) nbSamp...
90d85e29-9a1a-48bf-8b2b-9acb464e91a9
7
public ResultSet getCheckIns(String book_id,String card_no,String borrower_name) { ResultSet rs = null; String resultQuery="SELECT loan_id,book_id,branch_id,card_no,borrower_name FROM " + "checkout_details WHERE date_in IS NULL AND "; try{ Statement stmt = conn.createStatement(); if(book_id.isEmpty() &...
f4bd34b5-5d36-4a66-83c3-4ee9eb4e1c94
9
public void scrollCellToView(JTable table, int rowIndex, int vColIndex) { if (!(table.getParent() instanceof JViewport)) { return; } JViewport viewport = (JViewport) table.getParent(); Rectangle rect = table.getCellRect(rowIndex, vColIndex, true); Rectangle viewRect =...
a78285c8-dfd2-4b25-9317-94602869f756
9
@Override public void run() { /* * Wait until the commands have finished running & don't bother waiting * if no commands were issued */ try { if (modules == null) throw new Exception(); boolean buildDone = false; while (!buildDone && !manager.panic()) { if (!manager.getToCompile()) { ...
7b43ef77-8a6b-4ad6-94a3-886923d5543e
0
public double getCost() { return this.cost; }
5dba1815-9a98-414a-9136-fdcd54a00a56
4
public PageFormat createPageFormat() { PageFormat format = new PageFormat(); PageOrientation orientation = getPageOrientation(); double[] size = getPaperSize(LengthUnits.PT); double[] margins = getPaperMargins(LengthUnits.PT); Paper paper = new Paper(); if (orientation == PageOrientation.PORTRAIT) { for...
db70b9b4-c2b5-42f8-9a1b-3698861f7afe
8
private void updateProgressView() { System.out.println(loginStatus); switch (loginStatus) { case 0: setMessage("Initialiserer system"); progressBar.setValue(loginStatus); break; case 1: setMessage("Kontrollerer forbi...
9c910fd2-1d29-4c95-9cf0-6caf87e2f452
1
public List getAttributes() { if (attribute == null) attribute = new LinkedList(); return attribute; }
b791c395-2fb7-43f1-9108-01031a7d4c42
1
public static int getMusicVolume() { return isMusicOn ? musicVol : 0; }
42c80849-97ca-45f7-92ed-87571900ae17
7
public static void main(String[] args) { Class<?> c = null; try { c = Class.forName("type_information.ex01.FancyToy"); } catch (ClassNotFoundException e) { System.out.println("Can't find FancyToy"); System.exit(1); } printInfo(c); for(Class<?> face : c.getInterfaces()) { printInfo(face); } C...
137c2bee-7d74-45df-89e4-9db1e8543ccc
1
public void buyBuilding(CastleBuilding b) { if (buyed == false) { addBuilding(b); buyed = true; } }
5e0e042b-a03d-4fc6-9055-a08220860aec
1
public String getDescription() { String description = ""; if (itemType != null) { description = itemType.getDescription(); } return description; }
05a94513-bafe-4f06-91b4-752bd5c22b54
9
@Override public void detectRelationships(Obituary obit) throws Exception { List<List<Term>> sentences = extractor.tagEntities(obit); for (List<Term> sentence : sentences) { sentence = EntityUtils.combineEntities(sentence); List<String> lines = new ArrayList<String>(); List<Term> terms = new ArrayList<Ter...
aa7c6353-ce30-4471-82c0-5a3055ce2a65
1
@Override public void run() { try { example.execute(); } catch (InterruptedException e) { e.printStackTrace(); } }
1349186c-da37-4cbf-8510-eb0cf847b21e
3
@Override public boolean init(List<String> argumentList, DebuggerVirtualMachine dvm) { command = null; if (argumentList.size() > 1) { UserInterface.println("Too many arguments."); HelpCommand.displayHelp(this); return false; } if (argumentList.size...
1539b4a1-2301-4a22-b199-5347cd706a36
9
@Override public void initialize(URL arg0, ResourceBundle arg1) { /* Constructors */ drawnGeometry = new ArrayList<Node>(); mediatorList = new ArrayList<Mediator>(); preferences = new HashMap<String, Preference>(); undo = new Stack<Command>(); redo = new Stack<Command>(); cloneFactory = new C...
a06c4d54-c777-4788-82c1-3d3d981ba9a4
2
public void close() { if (connection != null) { try { connection.close(); } catch (Exception ignored) { } } }
db1ae329-1feb-44ce-87a8-748e367fbc55
9
@Override public void Parse(Session Session, EventRequest Request) { Session.GrabResponse().Initialize(ComposerLibrary.SendInventory); Session.GrabResponse().AppendString("S"); Session.GrabResponse().AppendInt32(1); Session.GrabResponse().AppendInt32(1); Session.GrabResponse().AppendInt32(Session.GrabHabbo(...
4cfb9084-d525-4df2-a8d7-7e6d4f8e5634
3
@Override public void skip(long pFrames) throws MusicPlayerException { this.mLock.lock(); try { if ( this.mStreamPlayerRunnable == null ) { throw new IllegalStateException( "can't skip" ); } if ( !this.mStreamPlayerRunnable.isStopped() && !this.mStreamPlayerRunnable.isDone() ) { this.mStreamP...
ed0a8aa6-91dd-424f-b233-504f089a0678
9
boolean receiveDirectory(List<String> src, Path dest, final boolean zip, final boolean toplevel, DItem item, JFrame frame) throws IOException, ClassNotFoundException, WrongVersionNumber{ if ((src == null) || (dest == null) || (item == null)){ return false; } boolean res ...
952149d7-0c0c-4f23-a599-b9eefd8acbeb
4
private static boolean ExecuteKeyWord(String KeyWord,HashMap<String,String> inputList,boolean Expected) throws Exception { for(int i=1;i<workbook.getRowCount("Keywords");i++){ if(workbook.getCellStringData("Keywords", i, 0).equals(KeyWord)){ Reporter.isError=false; LOGGER.debug("Started Keyword...
3412efc7-b9c9-4962-8b92-45537e88f30d
7
@Override public void paintComponent(Graphics graphics) { int viewMode = getGUI().getCurrentViewMode(); mapEditorPanel.setVisible(false); unitInfoPanel.setVisible(false); endTurnPanel.setVisible(false); tileInfoPanel.setVisible(false); if (getFreeColClient().isMapEdit...
6a8e69ca-3446-4630-abfe-806c7ec50d2a
9
private void btn_GuardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_GuardarActionPerformed Pregunta preg=new Pregunta(); preg=p.getPregunta(); if(txt_DescripcionOpcion.equals("")){ JOptionPane.showMessageDialog(null, "Debe in...
537d8497-74b7-4eb9-bbbe-6792cee67069
8
public void unobfuscateProject() { String obfuscatedContent; int totalSizeTransfert = 0; int numberOfFiles = 0; int fileSizeTransfert; createDestinationDirectories(); List<File> codeFiles = new ArrayList<File>(); for (File file : projectFiles) { String fileExtension = McbcFileUtils.getFilenameExt...
994c5e08-8d56-4553-a607-cbfa46beec30
2
public void tileEvent(Vector2f pos, List<Circuit> cl, int delta){ Vector2f temp = TileUtil.getCoordinate(pos); for(Tile tile : tileList ) { if (TileUtil.getCoordinate(tile.getPosition()).equals(temp)){ tile.update2(delta, cl); } } }
3e3c0ccd-b0bc-4872-afcf-44b31d069364
2
public void VisionAllStates(int[] inTargets, byte[] inVisions){ Iterator<GameState> i = AllStates.iterator(); while(i.hasNext()){ GameState a = i.next(); if(a.SurviveVisions(inTargets, inVisions)){ // state is allowed, and has been updated. } else { //state was not allowed, and is removed i.remove(...
830a6008-e998-4c4d-8af0-e583a5cfb986
9
private static void member_helper_type(final CodeEmitter e, List members, final ObjectSwitchCallback callback, final ParameterTyper typer, final Lab...
36c0fb43-6b33-4641-a3f6-81c1a2a732d3
1
public static void main(String[] args){ System.out.println("Hello Humans I am A Server"); DtoExtractor de = new DtoExtractor(clients); ConnectionInicializer conHandler = new ConnectionInicializer(de); ServerCli cli = new ServerCli(); conHandler.start(); try { Thread.sleep(500); } catch (Inter...
c0998ee2-0a48-4d44-9027-4d976eec4641
0
@Override public String getResource() { return resource; }
edb0c604-55f2-4f9a-bfbf-22a8694767af
0
@Test public void itReturnsACoffeeMakerAPI() { SimulatedCoffeeMaker coffeeMaker = new SimulatedCoffeeMaker(); CoffeeMakerService.set(coffeeMaker); CoffeeMakerAPI actualMaker = CoffeeMakerService.get(); assertSame(coffeeMaker, actualMaker); }
93f25769-3827-4300-b07e-131e5e0d0780
7
public boolean equals(Object other) { if ( (this == other ) ) return true; if ( (other == null ) ) return false; if ( !(other instanceof BitacoraId) ) return false; BitacoraId castOther = ( BitacoraId ) other; return (this.getIdBitacora()==castOther.getIdBitacora()) && ( (this.getUsuari...
5a8b3ad1-1d04-412b-84f9-0de2d92974ca
6
static Map<Character, Cell> scanMap (final char[][] map) { lambdas.clear (); final Map<Character, Cell> result = new HashMap<> (); for (int row = 0; row < map.length; row++) { for (int col = 0; col < map[row].length; col++) { switch (map[row][col]) { case '\\': ...
e385a05c-c3a9-4795-979e-dd67a946aadb
7
public Iterator getTaskLists(String parent) { // child tasks iterator ArrayList<String> taskLists = new ArrayList<String>(); if ( (parent == null) || (parent.equals("")) ) { // no parent specified.. return parents at highest level Iterator taskIterato...
4510b045-270f-4b5e-8ef0-97af06d0a8f5
4
private int getIndex4RandomOutNode(List<Node> selectCollection, Node nodeIn) { int Min = 0, Max = selectCollection.size() - 1; int selectedIngex = Min + (int) (Math.random() * ((Max - Min) + 1)); boolean conclusion = true; //verify declining hierarchy Set<Node> toVerifyNodes = ...
955887c8-665f-4c30-9f6f-86cf84122a28
8
private static TwitterResponseWrapper sendRequestPost(String httpMethod, String baseUrl, Hashtable<String, String> httpParams, String oauthHeader) { HttpURLConnection conn = null; BufferedReader in = null; TwitterResponseWrapper response = new TwitterResponseWrapper(); try { String stringifiedParams = h...
1060cd4b-e3e7-4116-be48-e77ce8a0bb63
7
private void processNotEpochRestartLoop() { do { if (Math.abs(dsv.t - atime) >= stepp) { doLoop = true; epochRestart = false; } else { ft = dsv.t - atime; doLoop = false; } if (Math.abs(dsv.t) < Math.abs(atime)) { if (dsv.t >= 0) { delt = stepn; } else { del...
9a386334-1075-4e98-8650-126c47fa1d54
5
public void update(Observable o, Object arg) { switch ((UpdateAction)arg) { case NEW_GAME: setGame((Game)o); break; case CHECK: setGameCheck((Game)o); break; case SELECTED_NUMBER: case CANDIDATES: ...
3fdbd979-1836-41e1-9f9a-ca575343770c
4
private boolean read() { try { final URLConnection conn = this.url.openConnection(); conn.setConnectTimeout(5000); if (this.apiKey != null) { conn.addRequestProperty("X-API-Key", this.apiKey); } conn.addRequestProperty("User-Agent", Updater.USER_AGENT); conn.setDoOutput(true); final Buffer...
36c1423f-ddcd-461c-a857-d63b26adadd5
9
public void moveCharCase(int mve){ switch(mve){ default: System.out.println("default case entered... Doing nothing."); break; case ONE_UP: setYDirection(-1); break; case ONE_DOWN: setYDirection(1); break; case ONE_...
01dda238-2f21-4ee6-98f2-b233ccd7f857
6
private void doCommand(String cmd) { if (cmd.startsWith("D")) { currWaitDelay = Integer.parseInt(cmd.substring(1)); previousProposal = new HashSet<Integer>(currentProposal); doDelay(); } else if (cmd.startsWith("P")) { doPropose(cmd.substring(1).split("-")...
34c5710a-71f9-4bc9-a7f5-9b2a9c28d2e7
8
public FormResponse[] getAllFormResponse(int formId) throws FormNotFoundException, ErrorRecreatingFormException { try { ArrayList<FormResponse> resp; if(!formExists(formId)) { throw new FormNotFoundException("Form " + formId + " cannot be found"); } ...