method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
13fc6888-9c3b-4568-8ed4-a5d33043661f
4
public String getHeader() { StringBuffer buffer = new StringBuffer(); String outputEncoding = this.outputEncoding; if ( outputEncoding == null ) { outputEncoding = "UTF-8"; } // header buffer .append( "<!DOCTYPE html P...
48f64a07-0b39-4fb4-8570-af4386fbecb9
4
private void updateOptions() { options = new ArrayList(); try { options.add(getIndoorText()); options.add(getOutdoorText()); } catch(DataFormatException e) { //JOptionPane.showMessageDialo(frame,"input error",e.getMessage()); } ...
902e31f9-950a-4791-96a0-740e9db1b8cb
0
public void close() { terminer = true; }
28b73a7c-0333-4aa1-9486-ddb508b07009
5
public String explainScore(StringWrapper s, StringWrapper t) { BagOfSourcedTokens sBag = (BagOfSourcedTokens) s; BagOfSourcedTokens tBag = (BagOfSourcedTokens) t; StringBuilder buf = new StringBuilder(""); PrintfFormat fmt = new PrintfFormat("%.3f"); buf.append("Common tokens: ")...
73f6abba-9578-49d6-908f-8364019ac178
7
private boolean validateBsDate(int bsYear, int bsMonth, int bsDayOfMonth) { if (bsYear < lookupNepaliYearStart) { throw new CustomerDiedException(); } else if (bsYear > (lookupNepaliYearStart + monthDays.size() - 1)) { throw new CustomerYetToBornException(); } if (lookupNepaliYearStart <= bsYear && bsYe...
eb0195ad-0e99-46ee-b48a-bdea6fc5ae79
4
void readSetDesktopName(int x, int y, int w, int h) { String name = is.readString(); if (x != 0 || y != 0 || w != 0 || h != 0) { vlog.error("Ignoring DesktopName rect with non-zero position/size"); } else { handler.setName(name); } }
92ad745a-0567-4925-8531-c83fd9611122
7
public static Instances clusterInstances(Instances data) { XMeans xmeans = new XMeans(); Remove filter = new Remove(); Instances dataClusterer = null; if (data == null) { throw new NullPointerException("Data is null at clusteredInstances method"); } //Get the ...
c1a9c47b-2c0f-4189-badf-b703fde7f80f
4
protected Dimension computeLayoutSize(Container parent, int hp, int vp) { if (!validWidths) return null; Component[] components = parent.getComponents(); int preferredWidth = 0, preferredHeight = 0; widths = new int[COLUMNS]; heights = new int[components.length / COLUMNS]; // System.out.println("Grid: " ...
ab915794-6b7c-48ea-9b70-fc465107b8f9
3
private void showWinners() { if (posFido >= tracksize -1) { System.out.println("Fido Wins!"); } if (posSpot >= tracksize -1) { System.out.println("Spot Wins!"); } if (posRover >= tracksize -1) { System.out.println("Rover Wins!"); } }
a3081d26-6a11-4aa5-9e71-a18b5e06fcc8
0
public void setPrice(String price) { this.price = price; }
b655481a-9a5d-4817-beaa-e453fbb02d40
7
protected synchronized void buildClassifiers(final Instances data) throws Exception { for (int i = 0; i < m_Classifiers.length; i++) { if (m_numExecutionSlots > 1) { final Classifier currentClassifier = m_Classifiers[i]; final int iteration = i; Runnable newTask = new Runnable() { ...
36ded91c-b367-4a56-af0a-48912c43bbd5
7
@Override public MailPiece parsePostalItemData(String data) { final MailPiece piece = new MailPiece(); for(int i=0;i<5;i++) { final int x=data.indexOf(';'); if(x<0) { Log.errOut("StdPostman","Man formed postal data: "+data); return null; } switch(i) { case 0: piece.from = data.s...
f4696196-32f6-4463-864f-8b7c5596754d
1
public List<String> getLines() { synchronized (lines) { if (line.length() > 0) { addLine(); } return new ArrayList<String>(lines); } }
fa34c47f-8582-4c50-af93-8af7a1508bdc
1
public void interrupt() { Thread t = threadVar.get(); if (t != null) { t.interrupt(); } threadVar.clear(); }
5ae45dae-01db-4bef-88f3-2a5daf46e4df
7
public void importFunctions() { File f = Tools.showOpenDialog("Importer"); if (f != null) { String ext = f.getName().substring(f.getName().length() - 3, f.getName().length()); if (ext.compareTo("txt") != 0) JOptionPane.showMessageDialog( null, Tools.getLocalizedString("ERROR_IMPORT") + " ...
e6762a4b-5283-41db-bd9e-1cc631fd8bd3
3
public void testXMLParser(){ String s = "<a>value</a>"; DocumentBuilder parser = null; Document document = null; try { parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); document = parser.parse(new InputSource(new StringReader(s))); } catch (SAXException e) { e.printStackTrace(); }...
676032bf-3fe8-4745-aad5-d1e7cfb0e507
7
@Override public ArrayList<String> getTopKills() { ArrayList<String> top_Players = new ArrayList<String>(); PreparedStatement pst = null; ResultSet rs = null; try { pst = conn.prepareStatement("SELECT player_name FROM `ffa_leaderboards` ORDER BY `killcount` DESC"); rs = pst.executeQuery(); int count =...
16adb52a-7485-449e-acb2-93899cdfc821
1
public void prependKnooppunt(Knooppunt knooppunt)throws IllegalArgumentException { if(knooppunt == null) throw new IllegalArgumentException("Je hebt geen knooppunt meegegeven"); this.kortsteWeg.add(0, knooppunt); }
e8350ff7-e4ee-44d9-a05e-bba16977df6e
5
public static void cocktailSort(int[] array) { printArray(array); int a = 0; for (int i = 0; i < array.length / 2; i++) { for (int m = 1; m < array.length - i; m++) { if (array[m - 1] > array[m]) { a = array[m - 1]; array[m - 1] = array[m]; array[m] = a; }...
c893caad-30a8-4fc5-82a3-4ded1b717776
2
protected void computeArgumentsByteArray(OSCJavaToByteArrayConverter stream) { stream.write(','); if (null == arguments) { return; } stream.writeTypes(arguments); for (Object argument : arguments) { stream.write(argument); } }
d5815e90-077f-4f1c-a846-b59b381e43b5
8
public Picture getOppositeInversedImage() { Color[][] col = new Color[h][w]; Color c; int r=0; int g=0; int b=0; for (int i=green.length-1; i>=0; i--) { for (int j=green[0].length-1;j>=0; j--) { for (int k=green[0][0].length-1; k>=0; k--) { if (green[i][j][k]==1) ...
fa65c191-6bbd-441d-873a-f068cf929073
3
protected double getNextFailureLengthSample() { double sample; if (failureLengthPatternDiscrete_ != null) { sample = failureLengthPatternDiscrete_.sample(); return Math.abs(sample); } else if (failureLengthPatternCont_ != null) { sample...
fd3c0193-60e7-4541-a20d-408fbec7d358
9
public void setSelectedEditor(final int selectedEditor) { final int oldEditor = this.selectedRootEditor; if (oldEditor == selectedEditor) { // no change - so nothing to do! return; } this.selectedRootEditor = selectedEditor; // make sure that only the sele...
4fac6d8c-96ae-4835-9c14-083feedd9ce8
3
public WorkloadFileReader(String fileName, int rating) { if (fileName == null || fileName.length() == 0) { throw new IllegalArgumentException("Invalid trace file name."); } else if (rating <= 0) { throw new IllegalArgumentException("Resource PE rating must be > 0."); ...
dd47b8b5-e328-4d24-af33-08aa65e3f310
7
public String longestCommonPrefix(String[] strs) { if (strs.length == 0) { return ""; } if (strs.length == 1) { return strs[0]; } String common = ""; for (int j = 0; j < strs[0].length(); j++) { char c = strs[0].charAt(j); ...
64315eff-00f6-4b69-abb5-afd7fc087e08
2
public static void main(final String args[]) { UserListRoot list = new UserListRoot(); User u = new User(); u.setName("danny"); u.setPassword("danny"); u.setPhoneNumber("123243"); u.setType(0); User u2 = new User(); u2.setName("aly"); u2.setPasswo...
09c8459b-9fcb-43ac-a2f7-070c77ffd58a
3
public void setOutput(AudioBus newOutput) { if(this.isMaster()) return; if(newOutput == null) newOutput = AudioBus.getMasterBus(); if(this.output != newOutput) { this.output.removeAsInputBus(this); this.output = newOutput; newOutput.addAsInputBus(this); } }
53d26454-aade-4c72-beac-9896cde34fc8
8
private boolean checkStartEndBounds(int xp, int yp){ //TODO: Still prettu buggy, can still erase edges of start and end rooms. for(int y = 0; y < 9; y++){ int ya = y + (32 / 2) - (9 / 2); for(int x = 0; x < 10; x++){ int xa = x - 1 + (64 - 10); if(xp == x && yp == ya) return false; if(xp == xa && ...
7e2a476f-3ef3-48ce-9293-d507c376f58d
5
public static Batch <Recreation> audienceFor(Boardable venue, Performance p) { final Batch <Recreation> audience = new Batch <Recreation> () ; for (Mobile m : venue.inside()) if (m instanceof Actor) { final Actor a = (Actor) m ; for (Behaviour b : a.mind.agenda()) if (b instanceof Recreation) { ...
d8edb1d5-b2a0-47a0-b4fd-731bfcf03a9c
0
public ClusterNode(double distance, Cluster cluster) { this.distance = distance; this.cluster = cluster; }
f05f1ad0-63b1-4c2a-b14a-01261eeb89ad
7
public Double aStarSearch(Vertex[] vertices, int start, int goal) { PriorityQueue<Vertex> vertexQueue = new PriorityQueue<Vertex>(); vertices[start].gScore = 0.0; vertices[goal].isGoal = true; vertexQueue.add(vertices[start]); while (!vertexQueue.isEmpty()) { Vertex current = vertexQueue.po...
aa1db958-96bf-4a13-862a-09151f3b43cd
2
public void updateConfigFile() { // Only do this if the old configuration is present if (getConfig().isConfigurationSection("Warnings.warned")) { // Get all the currently warned players and put them in a HashMap Map<String,Object> userList= getConfig().getConfigurationSection("Warnings.warned").getValues...
2818864d-6a8c-4888-ab3d-c0f66071799b
2
private static boolean isPropertyAnnotated(String line, List<String> annotatedVariables){ boolean contains = false; for (String property : annotatedVariables){ if (line.contains(property)) contains = true; } return contains; }
f208c94f-5a55-412b-9880-12a10f01672d
2
public static Rank getRank(String r) { char test = r.charAt(0); for (Rank rank : Rank.values()) { if (rank.shortName == test) { return rank; } } throw new RuntimeException("Rank not recognized!!!"); }
e71d35ba-6db5-4912-8557-b678fb0b2ffd
3
@Override public void deserialize(Buffer buf) { super.deserialize(buf); playerId = buf.readInt(); if (playerId < 0) throw new RuntimeException("Forbidden value on playerId = " + playerId + ", it doesn't respect the following condition : playerId < 0"); playerName = buf.re...
77b896b8-1c7a-40ee-87b6-c9835ce3ba6a
5
public static void main(String[] args) { Conf.init(); boolean nicequit = false; while(!nicequit) { try { Wrapper serv = new Wrapper(); serv.start(); while(!serv.hasStopped()) { try { serv.join(); } catch (Exception e) { e.printStackTrace(); } } nicequit = serv.wasNiceQuit();...
27cac8ec-1bfd-4378-8281-c26dd830ba59
5
public static void prepareNodes() { try { CoordinatorGUI.textArea.append("Transmitting ready checks to nodes..." + "\n" + "\n"); String ready = "ready?"; buf = ready.getBytes(); packet = new DatagramPacket(buf, buf.length, group, 4446); socket.send(pa...
4cb76f01-856b-4562-a228-49b324140ca2
7
public void onTick() { if (timeLeftInFog>0) timeLeftInFog--; else setFog(false); if (getTimeleft() > 0) { setTimeleft(getTimeleft() - speed); listener.onTowerAction(this); return; } if (isInFog()) { for (Road r : closeNeighbours) { if (r.hasEnemy() != null) { Enemy e = r.ha...
bc645617-a994-4097-9a1c-8af32b8449ac
9
@SuppressWarnings("rawtypes") @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; BasicFamilyObject other = (BasicFamilyObject) obj; if (children == null) { if (other.children != null) retu...
0c007026-d0bb-40db-b3c0-c70f98fd709c
3
public String printParkInfoBySingle(){ String text=""; if(park == null && getParkBoyList().size() == 0) { text="目前没有管理任何停车场!" ; return text; } int emptyNum = 0; int totalNum = 0; if(park != null) { text= " 停车场编号:" + park.getCode() +"\n"; text=text+ " 停车场名称:" + park.getP...
17427dc5-3ca0-49eb-bb7c-a337ba846f7f
4
@Override public Object getValue(Method method, Map<Class<?>, ClassBuilder<?>> hows) { List<Object> objects = new ArrayList<Object>(); for (Class<?> clazz : this.classes) { objects.add( hows.get(clazz).build(hows) ); } return objects; }
35e00a34-5e43-4730-83a0-dbfbaf29bc1a
8
void output(int code, OutputStream outs) throws IOException { cur_accum &= masks[cur_bits]; if (cur_bits > 0) cur_accum |= (code << cur_bits); else cur_accum = code; cur_bits += n_bits; while (cur_bits >= 8) { char_out((byte) (cur_accum & 0xff), outs); cur_accum >>= 8; cur_bits -= 8; } if...
5a37957b-a1b2-44f6-98d9-6ec85f308674
6
private final void drawHudItems(Graphics2D drawScreen, int offsetX, int offsetY) { for (IHudItem hudItem : hudItemQueue) { // Decide where the object should be drawn. Call the draw method of // the hudItem as IHudItem extends IDrawable switch (hudItem.getRelativeDraw()) { case CENTER: hudItem.draw(...
274ee647-bec5-4cf3-943d-e0040952de45
4
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeBytes(1, getTeamNameBytes()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { ...
72807d8c-838f-4e6e-930b-b947bd97754c
0
@Test public void testGame() { // barely anything to test here.. _underTest = new Game(_paperPlayer, _rockPlayer); assertNotNull(_underTest); }
26c782cf-c925-4c23-a526-023a82ffc4a5
8
void saveImages(File parentFile) { if (((MDView) getView()).getFillMode() instanceof FillMode.ImageFill) { String url = ((FillMode.ImageFill) ((MDView) getView()).getFillMode()).getURL(); String s = url; String base = FileUtilities.getCodeBase(url); /* * if background image is set using the filechoose...
038b4ef7-f6ec-4c73-b025-857da6d12354
9
public TabletStatus startApps(int type, int quantity) throws InvalidOperationException, IllegalArgumentException { TabletStatus status = getCurrentStatus(); if (quantity <= 0) throw new IllegalArgumentException(); if (type < 0) throw new IllegalArgumentException(); if (status.cpuSpeed ...
96d1eb68-defe-4463-8b7c-750190dd6427
2
private void copyWorld() { //gespeicherte Welt löschen Lines.clear(); Goals.clear(); //Alles kopieren for(int i=0; i<Reflines.size(); i++) { int[] a = new int[4]; a[0] = Reflines.elementAt(i)[0]; a[1] = Reflines.elementAt(i)[1]; a[2] = Reflines.elementAt(i)[2]; a[3] = Reflines.elementAt(i...
3dea9cf1-d516-40eb-8af6-52dcf377b3fe
9
@Override public void train() { double sim = 0; String[] t = socialNeighbourhood.split("_"); int k = new Integer(t[1]); for (Integer user1 : data.getItemsByUser().keySet()) { if (data.getUserFriends().get(user1) == null) { // User has no friends :) continue; } ArrayList<Integer> friendsKth...
52ca6341-5120-4aef-8992-94ffb1cc7027
1
private static String getStringFromDocument(Document doc) { try { DOMSource domSource = new DOMSource(doc); StringWriter writer = new StringWriter(); StreamResult result = new StreamResult(writer); TransformerFactory tf = TransformerFactory.newInstance(); ...
46bc20c1-37ff-40ee-b05d-3fe36071c746
2
@Override public void boot() { running = true; this.configuration = getAudioInputConfiguration(); try { lsr = new LiveSpeechRecognizer(configuration); } catch (IOException e) { System.out.println("Eva was unable to configure Ears."); e.printStackT...
38aa7085-bd58-4f65-a1db-be90919be6cd
0
public int genotypeSize(){ return this.bins.size(); }
b5f8f5a1-780a-40ee-a788-ada04d74f686
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...
f4e99db1-99c2-4201-aa92-e3c780aea1ce
6
public void CreateTextureSetsSkinBodyFemale_1RBS_old() throws Exception { // it copies SkinBodyFemale and changes the textures getting out of RBS folders. for (TXST t : ListRBSTXSTMerger) { if (t.getEDID().equals("SkinBodyFemale_1")) { NumberFormat formatter = new DecimalFor...
57aee8ff-2bf7-4cd8-b9c0-37e7a4236683
3
public ArrayList<String> leerArchivo(String nombre) { ArrayList<String> datos = new ArrayList(); try { FileReader fr = new FileReader("./Data/" + nombre + ".o"); BufferedReader br = new BufferedReader(fr); String line; while ((line = br.readLine()) != null...
96978265-8a36-4365-b3fa-6e93956fd440
4
public void coreWorkflow(Configuration config) { // Build a list of files to validate try { System.out.print(" -- Finding files to process"); AbstractQueue<String> queue = new ArrayBlockingQueue<String>(100000); findDNGFiles(queue, config.inputDir); int qs = queue.size(); System.out.println("\n -...
81e1855c-3fe6-4dcb-b348-014dc1e60f53
8
private static int pivot(int[] a, int low, int high) { int i1 = low, i2 = high - 1, i3 = (low + high) / 2; int a1 = a[i1], a2 = a[i2], a3 = a[i3]; int n = (a1 > a2) ? a1 : a2; int m = (a2 > a3) ? a2 : a3; if (m > n) { return (a1 > a2) ? i1 : i2; } else if (n...
54fac5a4-388a-43a2-b4c8-9cd157828cd5
6
public static int[] countSort(int[] a, int k){ int[] b = new int[a.length]; int[] c = new int[10]; for(int i=0; i<b.length; i++){ b[i] = 0; } for(int i=0; i<c.length; i++){ c[i] = 0; } int s = 1...
8282c5ef-e7b6-4796-9678-0a8b9d5a499a
4
private void showCrewEditor( final CrewSprite crewSprite ) { final String NAME = "Name"; final String RACE = "Race"; final String HEALTH = "Health"; final String PILOT_SKILL = "Pilot Skill"; final String ENGINE_SKILL = "Engine Skill"; final String SHIELD_SKILL = "Shield Skill"; final String WEAPON_SKILL =...
a39e614f-adf9-41bb-b19f-750aaa0fa9cf
5
public void printPSolutions() { String coord = ""; String solutions = ""; for (int j = 0 ; j < 9 ; j++) { for (int i = 0 ; i < 9 ; i++) { solutions = ""; if (getSolver().getGridModel().getValue(i, j) == ' ') { coord = "["+i+","+j+"]...
21a86265-4dba-44cd-9664-4b51958e14d9
2
public Document toDOM(java.io.Serializable structure) { Grammar grammar = (Grammar) structure; Document doc = newEmptyDocument(); Element se = doc.getDocumentElement(); // Add the productions as subelements of the structure element. Production[] productions = grammar.getProductions(); if (productions.length...
58442f10-fbfd-4c50-9775-3e491c98c98f
5
@Override public void setBuffer() { if (isDirty()) { int numTempoChangeBytes = 0; for(TempoChange tempoChange : tempoChanges) numTempoChangeBytes += ((tempoChange.getBeatsPerMinute() < 256 ? 1 : 2) + 4); buffer = new byte[1 + numTempoChangeBytes]; int ...
31108463-aa92-4291-ab60-3d74df9cae62
3
public Database(Logger log, String prefix, String dp) throws DatabaseException { if (log == null) throw new DatabaseException("Logger cannot be null."); if (prefix == null || prefix.length() == 0) throw new DatabaseException("Plugin prefix cannot be null or empty."); this.log = log; this.PREFIX = prefi...
edb1ff32-3f9c-4620-803b-5a9c66477207
6
@Override public void run() { nextAntiBan.endIn(Random.nextInt(5000, 45000)); final Dimension dimension = ctx.game.dimensions(); switch (Random.nextInt(0, 5)) { case 0: ctx.camera.angle(Random.nextBoolean() ? Random.nextInt(0, 360) : Random.nextInt(-359, 0)); break; case 1: ctx.input.move(Rand...
e015c8cf-b005-45ed-b31b-f634a9982380
2
public static boolean inBounds(String position) { String file_bounds = "abcdefgh"; String rank_bounds = "12345678"; if(file_bounds.contains(position.substring(0,1))&&rank_bounds.contains(position.substring(1))) { return true; } return false; }
cca770c8-b23b-4203-aea8-65b4d92e9268
3
public List<Field> findAllAnnotatedFields(Class<? extends Annotation> annotationClass) { List<Field> annotatedFields = new LinkedList<Field>(); for(Field field : getFields()) { if(field.isAnnotationPresent(annotationClass)) { annotatedFields.add(field); } } getFieldDetailStore().addAllFi...
a6733f58-4d23-4124-b04d-f6c6d529d175
6
private void printOptions() { Scanner s = new Scanner(System.in); int option; System.out.println("\n \n"); do { System.out.println("Select one of the options: \n \n"); System.out.println("[1] Make a cell alive"); ...
5779a6aa-8561-44b1-b1a2-7866db21ff44
3
private void loadConfig(){ this.getConfig().addDefault("config.settings.enable", true); this.getConfig().addDefault("config.material.door", Material.QUARTZ.name()); this.getConfig().options().copyDefaults(true); saveConfig(); doorMaterial = Material.getMaterial(getConfig().getString("config.material.door"...
5ffe5eb0-5d92-4e81-8540-74373f5fb0b7
9
private Object parse(Class<?> type, String argument) { try { for (Types t : Types.values()) { if (t.getWrapper() == type) return Types.parseArg(t.getPrimitive(), argument, savedObjects); } return Types.parseArg(type, argument, savedObjects); } catch (IllegalArgumentException e) { } catc...
4b4d685d-a921-4880-819d-1bd998d85dc3
1
private String getDate(String path) { File file = new File(path+ File.separator+ "Info.plist"); String date; try { NSDictionary rootDict = (NSDictionary)PropertyListParser.parse(file); date = rootDict.objectForKey("Last Backup Date").toString(); } catch (Exception e) { e.printStackTrace(); ret...
a64b0e62-5fe1-4931-866f-8b832637edc3
9
@Override public byte[] write(DataOutputStream out, PassthroughConnection ptc, KillableThread thread, boolean serverToClient) { if(!serverToClient || (!ptc.clientInfo.getLocalCache())) { return super.write(out, ptc, thread, serverToClient); } else { int length = super.lengthUnit.getValue(); byte[] buffe...
79cc802f-932c-4b35-8c7a-ee2342e9438c
3
public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); int a[] = new int[n]; //int diff[]=new int[n]; int sum=0; // HashMap<Integer,Integer> map=new HashMap<Integer,Integer>(n); ...
fae208f1-886d-4e90-b0e1-bdda5fe27130
1
public void writeAssertion(CycAssertion cycAssertion) throws IOException { if (trace == API_TRACE_DETAILED) { Log.current.println("writeAssertion = " + cycAssertion.toString()); } write(CFASL_EXTERNALIZATION); write(CFASL_ASSERTION); writeList(cycAssertion.getFormula()); ...
66504366-6c2f-4556-abea-babfc00308ba
6
public final WaiprParser.statdefs_return statdefs() throws RecognitionException { WaiprParser.statdefs_return retval = new WaiprParser.statdefs_return(); retval.start = input.LT(1); CommonTree root_0 = null; Token char_literal36=null; Token char_literal38=null; ParserRuleReturnScope statdef35 =null; Par...
d8a461f2-c3d8-4a09-bd6d-dc3cd523118a
3
public void setMaxParticleNumber(int maxParticles) { if (maxParticles <= 0) { throw new IllegalArgumentException("The maximum particle number cannot be set to zero or less!"); } if (particleArray == null || maxParticles != particleArray.length) { particleArray = ...
c502adef-c1da-4db6-a608-7d2ada678758
1
public Date getDateTime() throws ParseException { if (dateTime == null) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX"); dateTime = sdf.parse(dateTimeStr); } return dateTime; }
01c6bb2b-e470-476d-afed-c25712a3c505
2
private boolean contensFuncionario(String nome) { for (Funcionario f : funcionarios) { if (f.getNome().equalsIgnoreCase(nome)) { return true; } } return false; }
fb9a7c51-812d-4e78-8080-8d8172bdf9b7
1
private static Schedule getSchedule(Schedule bean, PreparedStatement stmt, ResultSet rs) throws SQLException{ stmt.setDate(1, bean.getWorkDay()); stmt.setString(2, bean.getUsername()); rs = stmt.executeQuery(); if (rs.next()) { Schedule newBean = new Schedule(); newBean.setWorkDay(rs.getDate("work_d...
b1c3b585-1242-46e4-8bf1-cd900b882939
2
public static void main(String[] args) { int x = 5; if (x < 5) if (x > 5) System.out.println('b'); else System.out.println('a'); }
588e1c4f-1aaa-4abd-9574-675b8718f2d8
0
public int getPageSize() { return pageSize; }
d5e32f25-6634-4241-b30f-76aca6e667fa
4
private void updateLasers(){ Iterator l = map.getLasers(); Laser laser; Object player; double x1, y1, x2, y2; while(l.hasNext()){ laser = (Laser)l.next(); player = laser.getParent(); if(player instanceof Ship){ //moves the players laser with reguards to his/her mouse. ...
cd3cbecb-2bd0-40ff-ba5e-7a893401258a
2
@Override public boolean equals(Object o) { if(o instanceof VariableReference) { VariableReference v = (VariableReference)o; return this.getInnerValue().equals(v.getInnerValue()) && this.getVariable().equals(v.getVariable()); } return false; }
73074180-5978-4758-a882-874d9e1fea00
4
public static void main(String[] args) { if (args.length < 4) { System.err .println("Usage: JPLEphemerisSerialiser filename start-date end-date outputfile"); System.exit(1); } String filename = args[0]; double jdstart = Double.parseDouble(args[1]); double jdfinis = Double.parseDouble(args[2]); ...
2c85d16b-853f-448f-8ce9-c21588cd7dea
2
@Override public String toString() { String name = getName(); String append = ""; if(name != null && !name.equals("")) { append = "(\"" + this.getName() + "\")"; } return "TAG_Double" + append + ": " + value; }
afa05904-c27d-4331-898a-d533684d6fc8
3
protected void getImagePixels() { int w = image.getWidth(); int h = image.getHeight(); int type = image.getType(); if ((w != width) || (h != height) || (type != BufferedImage.TYPE_3BYTE_BGR)) { // create new image with right size/format BufferedImage temp = new BufferedImage(width, height, Buffe...
0623f2d1-7ada-4d2b-b45b-620f7f388bd5
0
public String getType() { return type; }
ea18ea2e-c11b-464f-8d94-a6001902f5fc
7
@Override public void log(LogLevel logLevel, boolean isAuditMessage, Class<?> clazz, Throwable throwable, String pattern, Object... arguments) { switch (logLevel) { case DEBUG: debug(clazz, isAuditMessage, throwable, pattern, arguments); break; case ERROR: error(clazz, isAuditMessage, throwable, pa...
1383156e-c97e-4d50-9b56-286c8a30eb54
7
public void runProtocoloDHCP() { try { // DHCPMessage messageIn = new DHCPMessage(); byte[] datos = new byte[1024]; DatagramPacket messageIn = new DatagramPacket(datos, datos.length); socket.receive(messageIn); pack = new PaqueteDHCP(messageIn.getData()); switch (pack.existInOption(53).getIntValu...
5514ef9c-f8c7-468d-bbff-a05a327a7918
5
public boolean equals(Object obj) { if (obj instanceof ProgramImpl) { List<Reaction> otherProgramReactions = ((ProgramImpl) obj).getReactions(); for (Reaction r : otherProgramReactions) { if (!this.reactions.contains(r)) { return false; } } for (Reaction r : this.reactions) { if (!otherPr...
a55ee992-3fea-4249-b2ed-c573fafb012e
5
private void cargarTemporadajButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cargarTemporadajButtonActionPerformed // Carga la temporada que se ha seleccionado. int tempIndex = temporadaList.getSelectedIndex();// se obtiene el indice en cual se encuentra la temporada thi...
248bd07c-daa2-4cdf-9ea9-3ce7b705d92c
0
public List findByOutputFormat(Object outputFormat) { return findByProperty(OUTPUT_FORMAT, outputFormat); }
c94f9d0e-18bb-4f53-bc09-f5198db191f0
5
private void readMaze (String filePath){ try (Scanner scan = new Scanner(new File(filePath));){ this.width = scan.nextInt(); this.height = scan.nextInt(); scan.nextLine(); for (int i=0; i<height; i++){ String[] myList = scan.nextLine().split(" "); List<Integer> row = Array...
b6205207-6dba-4452-949d-06f000246c3c
7
public void mergeSets(){ //System.out.println(""); // We repeat this process until we have at least 3 clusters while (spagenumbers.size()>3){ ArrayList<RGB> averages = new ArrayList<RGB>(); // Obtaining the average color for each cluster for (int i = 0; i<...
cff140c0-21ca-475c-9ddc-749077928deb
8
public boolean accept(File f) { if (f.isDirectory()) { return true; } String extension = Utils.getExtension(f); if (extension != null) { if (extension.equals(Utils.tiff) || extension.equals(Utils.tif) || extension.equals(Ut...
eb082e0e-cf65-4ca8-b3ae-f9822a544563
6
public static void main(String[] args) { CutOperations operations = new CutOperations(); MyFileReader readContent = new MyFileReader(); String fileContent; if (args.length == 3) { // for delimiter String separator = args[1].substring(2, 3); int fieldNumb...
136f2584-e80a-4428-ab36-1be2cb596844
7
private JSONWriter append(String string) throws JSONException { if (string == null) { throw new JSONException("Null pointer"); } if (this.mode == 'o' || this.mode == 'a') { try { if (this.comma && this.mode == 'a') { this.writer.write('...
092b7a5e-24e4-4ec8-ac0c-fb38946aa7cc
9
public void reduce(Text prefix, Iterator<Text> iter, OutputCollector<Text, Text> output, Reporter reporter) throws IOException { //Map<String, Node> nodes = new HashMap<String, Node>(); List<Node> nodes = new ArrayList<Node>(); Map<String, Node> nodes_fr = new Has...
b9b876b1-80d7-4650-8c5a-e53e656c0341
7
public static void main(String[] args) { name = ""; client = new Client(); RegisterClasses.register(client.getKryo()); client.start(); //Input address String address = "127.0.0.1"; String addressInput = getInput("Enter address IP or leave blank for default:"); if (!"".equals(addressInput)){ addres...
25f60d72-0835-4458-992e-b7eba2bdada6
3
private void getDMESG(final Device device) { new Thread() { @Override public void run() { try { final File ADB = adbController.getADB(); ProcessBuilder process = new ProcessBuilder(); List<String> args = new Arra...
64fd9a30-2f57-4c3d-b64f-461e7866e14b
7
public boolean isBlockHere(int x, int y, int z) { if((x >= 0 && y >= 0 && z >= 0) && (x < chunkW && y < chunkH && z < chunkD)) { if (data[x + (y * chunkW) + (z * chunkW * chunkH)]) { return true; } return false; } return false; }