method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
751a6b51-c952-46ee-8a57-cb9a15ab68b4
1
private static IFont loadSmartFont(String path, int charHeight, int asciiStart) { try { return new SmartFont(ImageIO.read(Board.class.getResourceAsStream(path)), charHeight, asciiStart); } catch (IOException e) { e.printStackTrace(); return null; } }
73fce267-b690-406d-bfb0-0f67aca07530
0
public byte[] getValueMAC() { return valueMAC; }
030e45c6-e44c-49ca-99d2-1164069bb772
8
private void initLevel(){ levelinfo = new Level (levelnum, B_WIDTH, B_HEIGHT); crawler = new Crawler(levelinfo); exes.clear(); int ncols = levelinfo.getColumns().size(); for (int i=0; i<levelinfo.getNumExes(); i++ ) { exes.add(new Ex(r.nextInt(ncols), level...
334c03ce-86f6-4f8b-8562-8008a1ba808a
8
@Override public Admin getAdminByID(String id) { Connection conn = null; PreparedStatement stmt = null; Admin admin = null; ResultSet rs = null; try { conn = dataSource.getConnection(); stmt = conn.prepareStatement("SELECT ADMIN_ID,ADMIN_PASSWORD,ADMI...
df1b7c67-4475-4362-bfcd-6742a6ba0662
2
public Utr findUtr(int pos) { // Is it in UTR instead of CDS? for (Utr utr : utrs) if (utr.intersects(pos)) return utr; return null; }
481ab4be-373f-46e5-905a-a44544fffdae
8
* @return false - some files could not deleted, but continue. */ protected boolean cleanDirectory(final File targetDirectory) { boolean result = true; String[] filenames = targetDirectory.list(new FilenameFilter() { @Override public boolean accept(File dir, String name) { if (targetDirectory.equals(dir)) ...
adf0ef3d-eb35-40f2-9a91-adfa99176759
0
public void setCtrCantidad(int ctrCantidad) { this.ctrCantidad = ctrCantidad; }
8ac0ba8f-40dc-4b20-850e-ee3897bda119
1
public void loadContent() { try { img_movingSquare = ImageIO.read(this.getClass().getClassLoader().getResource("img/movingFloor.png")); } catch (IOException e) { e.printStackTrace(); } }
8b89a036-8485-4545-b532-8dfcfd7c1f3d
0
public boolean getMakeBackups() { return this.makeBackups; }
4ac58882-540b-46a1-96e1-5fa8765dcce1
8
public JsonObject terminateExecution(JsonObject json) { // Validate parameters JsonValue executionJsonValue = json.get("execution"); if ( executionJsonValue == null ) return new JsonObject().add("error", "Parameter execution is null"); if ( !executionJsonValue.isObject() ) return new JsonObject().add("error"...
abf94bdf-1ce3-46e8-938d-646d96eda90e
3
private ConstPool compact0() { ConstPool cp = new ConstPool(thisclassname); thisClass = cp.getThisClassInfo(); String sc = getSuperclass(); if (sc != null) superClass = cp.addClassInfo(getSuperclass()); if (interfaces != null) { int n = interfaces.length;...
c7580aec-12cf-420b-a81e-7ee0c23e9b82
2
public void draw(){ for(int i = 0; i < playingVideoKeys.size(); i++){ //plays the video image at a time if(!stoppedVideoKeys.contains(playingVideoKeys.get(i))) parent.image(videos.get(playingVideoKeys.get(i)), 0, 0); } }
363ebf06-9940-47ce-912a-4002e571dc4f
5
private void updateTabla(){ //** pido los datos a la tabla Object[][] vcta = this.getDatos(); //** se colocan los datos en la tabla DefaultTableModel datos = new DefaultTableModel(); tabla.setModel(datos); ...
6c95a95b-a35e-4139-a498-0b36106e3ede
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 Edital)) { return false; } Edital other = (Edital) object; if ((this.id == null && other.id != null) || (this.i...
e00ef14f-f8fa-44ef-bf99-5fe8e169a772
8
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof ReverseLookupIntegerKeyMap)) { return false; } final ReverseLookupIntegerKeyMap<?> other = (ReverseLookupIntegerKeyMap<?>) obj; if (decorated == null) {...
143c9cbe-2cd3-4d26-99fe-a4f8567202dd
1
@RequestMapping(value="/edit.do", method=RequestMethod.GET) public String editProfile(@RequestParam(value="userId", required = false) Long userId, Model model) { if(userId == null) { model.addAttribute("user", new User()); } else { model.addAttribute("user", new User() ); //...
bfa9e418-710e-4808-bc47-e81756cec200
3
final MCHashEntry removeEntry(int var1) { int var2 = computeHash(var1); int var3 = getSlotIndex(var2, this.slots.length); MCHashEntry var4 = this.slots[var3]; MCHashEntry var5; MCHashEntry var6; for(var5 = var4; var5 != null; var5 = var6) { var6 = var5.nextEntry; i...
288bf956-19e6-4f8e-94e2-0e077fdb518e
5
private Connection fireGetConnectExt() { java.util.List list; synchronized (this) { if (eventListeners == null) { return null; } list = (java.util.List) eventListeners.clone(); } int size = list.size(); Connection con = null; ...
39f4fdc3-6fad-4c22-b5a6-20daaefc1df9
1
public void debug(final String msg) { if(disabled) return; logger.fine("" + route_name + "-" + connection_id + "[debug]: " + msg); }
26a2d722-ec0c-49c5-a04c-5bb0b45d621d
1
public static void main(String[] args) { intialStart(); getCommand(); updateDisplay(); // while Loop for the game; while (stillInTheGame) { getCommand(); typeNavigation(); updateDisplay(); directionsYouCanGo(); } System.out.println("Thank you for playing the game."); }
a307eb22-8913-4f3e-b4fa-bdd996361fd0
6
private void initParams(){ if(!androidParams.isEmpty()){ postURL = androidParams.getProperty("GOOGLEPLAY_POST_URL"); reviewType = androidParams.getProperty("GOOGLEPLAY_REVIEW_TYPE"); fromPageNum = androidParams.getProperty("GOOGLEPLAY_FROM_PAGE_NUM"); ID = androidParams.getProperty("GOOGLEPLAY_ID"); re...
64939f76-64af-4c8d-a671-287a9cc522cc
3
public void applyXObjectTransform(AffineTransform transform) { for (LineText lineText : pageLines) { lineText.clearBounds(); for (WordText wordText : lineText.getWords()) { wordText.clearBounds(); for (GlyphText glyph : wordText.getGlyphs()) { ...
0de4d262-a4b8-450d-b433-7858d84a7fa1
7
public double outputValue(boolean calculate) { if (Double.isNaN(m_unitValue) && calculate) { if (m_input) { if (m_currentInstance.isMissing(m_link)) { m_unitValue = 0; } else { m_unitValue = m_currentInstance.value(m_link); } } else { //node is an output. m_unitValue = 0...
66e69b18-e54e-4208-a39a-b7680541f76b
5
public Tile(int x, int y, int typeInt) { // TODO Auto-generated constructor stub tileX = x * 40; tileY = y * 40; type = typeInt; r = new Rectangle(); if (type == 5) { tileImage = StartingClass.tiledirt; } else if (type == 8) { tileImage = StartingClass.tilegrassTop; } else if (type == 4) { ...
76ef69a2-fa8f-4e89-b3d0-352a07d2bba2
1
public static Object load(String fqn) throws ClassNotFoundException, IllegalAccessException, InstantiationException { Class<?> classname = Class.forName(fqn); return classname.newInstance(); }
a0cc8b24-8309-40ae-a72b-fcc7f9f85acb
1
private void visualizeBestAndWorstSystems() { String reliability = isWReliable ? "" : "but some consumption parameters were missing"; String results = "BEST SYSTEMS:\nEVALUATING ENERGY POINTS:\n" + bestSoftwareSystemEP.bestEpToString() + "\n" + bestSoftwareSystemEP.getSystemConsumptionEP() + "EP\n\n\nEVALUATING WAT...
2317e845-cc03-460b-9e75-f87cf753c148
8
public static int countNeighbours(boolean[][] world, int col, int row) { int c = 0; if (getCell(world, col - 1, row - 1) == true) { c += 1; } if (getCell(world, col, row - 1) == true) { c += 1; } if (getCell(world, col + 1, row - 1) == true) { c += 1; } if (getCell(world, col - 1, row) == tr...
b344bec7-2e01-4033-b7fb-87d99e20ed1c
0
public static Border getDefaultEmptyEtchedEmptyBorder() { return defaultEmptyEtchedEmptyBorder; }
7b73d095-262b-4ef2-8d2e-83d03567dfb0
2
@Override public boolean register(Game g, Rack r) { super.register(g, r); max_points = g.maxPoints(); try { for (Model m: hinters) m.register(g, r); } catch (Exception ex) { System.out.println("Could not enable hinting!!!"); } return true; }
bd1988ac-7d03-45b2-a877-83723449e117
3
public void enableServiceMode(Player player) { if(null != player) { if(!playersInSM.contains(player.getName())) { playersInSM.add(player.getName()); if(player.isOnline()) { player.sendMessage(ChatColor.GREEN + "Service-Modus AKTIV"); ...
c2e4602f-fe1a-44f4-9bba-12b3a21983b2
0
public TruncateHelper setWordPattern(Pattern wordPattern) { Assert.notNull(wordPattern); this._wordPattern = wordPattern; return this; }
9a95eb53-8bb3-44f4-9c43-b8db984263a9
0
public static void main(String[] args) { Resource resource = new ClassPathResource("applicationContext.xml"); BeanFactory factory = new XmlBeanFactory(resource); DeviceWritterBusiness business = (DeviceWritterBusiness) factory .getBean("deviceWritterBusiness"); business.save(); }
c95dbd15-7192-450d-86a8-503c8c67e8c6
8
public void alienKilled(double dmg) { if(!(armour<=dmg)){ armour-=dmg; } else if(!alreadyKilled){ alreadyKilled=true; Entity[][] grid = game.getAlienGrid(); grid[rowNum][colNum]=null; game.setAlienGrid(grid);...
5a862f42-bcdb-4f3b-905c-02b5aeb03287
9
static void checkMethodDesc(final String desc) { if (desc == null || desc.length() == 0) { throw new IllegalArgumentException("Invalid method descriptor (must not be null or empty)"); } if (desc.charAt(0) != '(' || desc.length() < 3) { throw new IllegalArgumentException("...
a3eb7ea0-1bba-4522-abf6-3615cd2f68cc
7
@Override public void simulate() { if (!this.pins[0].getType().equals("NC") && !this.pins[0].getType().equals("IN") && !this.pins[1].getType().equals("NC") && !this.pins[1].getType().equals("IN")) { if (this.pins[0].getPotential().toTTL().equals("HIGH") && this.pins[1].getPotential().toTTL().equals("LOW")) { ...
245eaba1-2adc-4096-98d5-a55477396991
7
public void move() { if(Zen.isKeyPressed('w')){ direction = 0; y = y-5; } if(Zen.isKeyPressed('a')) { direction = 3; x = x-5; } if(Zen.isKeyPressed('s')) { direction = 2; y = y+5; } if(Zen.isKeyPressed('d')){ direction = 1; x = x+5; } if(Zen.isVirtualKeyPressed(KeyEvent.VK_SPACE) && b != null) ...
3f2dce03-e781-4006-84f6-a91f1ffc3c17
2
public void visitSource(final String source, final String debug) { AttributesImpl att = new AttributesImpl(); if (source != null) { att.addAttribute("", "file", "file", "", encode(source)); } if (debug != null) { att.addAttribute("", "debug", "debug", "", encode(debug)); } addElement("source", att); ...
b0e7b1c5-a329-48da-ab39-148174039f99
7
@Override public void visitMethodDef(JCMethodDecl method) { super.visitMethodDef(method); if (method.getName().contentEquals("<init>") && !method.getParameters().isEmpty()) { boolean containsInject = false; boolean containsAutowired = false; for (JCAnnotation jcAnnotation : method.mods.annotat...
e773dd5a-69e0-4a8f-92ae-e93851db031c
5
public static void main(String[] args) { KwikLinkChecker checker = new KwikLinkChecker(); for (String arg : args) { if (arg.equals("-v")) { verbose = true; continue; } if (arg.startsWith("-")) { System.out.println("Invalid argument: " + arg); continue; } LinkStatus stat = checker.chec...
5c6f74ce-3b79-4d4b-8a41-7189438a4c4e
4
public static List<Object> getSqlWhereWithKeys(Map<String, Object> sqlWhereMap) throws SQLException { if (sqlWhereMap.size() < 1) return null; List<Object> list = new ArrayList<Object>(); List<Object> fieldValues = new ArrayList<Object>();//占位符对应的值 StringBuffer sqlWhere = new StringBuffer();//SQL语句 Set<E...
cd617444-bc77-46c1-8bf6-e6ef46406ead
0
public String getLname() { return lname; }
497ed80a-0fbb-4f15-9110-634ba732db49
6
static public String GetConfigHosts(String mcfgid) throws FileNotFoundException, IOException, NamingException, SQLException { if (props == null) { props = Basics.getConfiguration(); } String out = ""; String comment = ""; Context ctx = new InitialContext(); DataSourc...
6cff91df-c5be-4ca9-b619-926544e62211
7
public static Stella_Object evaluateLogicObjectTerm(LogicObject self) { { Surrogate testValue000 = Stella_Object.safePrimaryType(self); if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_PATTERN_VARIABLE)) { { PatternVariable self000 = ((PatternVariable)(self)); return (self000); ...
8c318430-fe8e-4e88-8e52-bd16f639d3e2
2
public LinkedList<Integer> searchForPattern(String pattern, String context) { int[][] dfa = this.DFA(pattern); int contextIndex, patternIndex, patternLength = pattern.length(), contextLength = context.length(); LinkedList<Integer> foundPatternList = new LinkedList<Integer>(); for(contextIndex = 0, patternIndex ...
ebeb7ce7-b9c3-4f3a-91f7-f19360c6b5b5
6
private double getCostOfNGramRecursive(String[] s, int smoothing) { double value = 0; switch (smoothing) { case STUPID_BACKOFF: //From http://stackoverflow.com/questions/16383194/stupid-backoff-implementation-clarification if(s.length>1) { value = counts(s...
192696cd-758e-451d-b7b1-49c04392c04d
1
public Constant newNameType(final String name, final String desc) { key2.set('T', name, desc, null); Constant result = get(key2); if (result == null) { newUTF8(name); newUTF8(desc); result = new Constant(key2); put(result); } return result; }
6aa9ab76-c536-4bac-9b59-1b03fdfc49ec
6
private int getCurrentY(Node node2, int edgeNumber) { if (edgeNumber == 0) { return 0; } else if (edgeNumber == 1) { if (node2.getCorridor((heading + 1) % 4).getWeight() == 1) { return 0; } else { return 4; } } else if (edgeNumber == 2) { return 4; } else if (edgeNumber == 3) { if (no...
273c6b65-dbd3-4401-8dc0-edd11d100a4e
0
public BasicBodyArmor(){ this.name = Constants.BASIC_SWORD; this.defenseScore = 4; this.money = 0; this.paybackMoney = 0; }
8a93b8a2-2074-482d-ac42-3c9d2f4bbd38
8
final public void OrExpression() throws ParseException { AndExpression(); label_1: while (true) { switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case OR: break; default: jj_la1[1] = jj_gen; break label_1; } ASTFunNode jjtn001 = new ASTFunNode(JJTFUNNODE); boolean jjtc001 = true; jjtr...
334f9664-a02e-430b-92ce-fc2cce4355ea
8
private static void DFS(int i, int j,int value, int[][] matrix,boolean[][] visit, boolean[] flag) { if(i<0 ||j<0) { flag[0] = true; return; } if(i>=matrix.length||j>=matrix[0].length) { flag[1] = true; return; } if(flag[0] && flag[1...
cf45b1bd-7625-479b-9db9-d46729c4ed3e
2
public boolean isUserKeyFromProp() { return userKey.isEmpty() ? this.propUserKey != null && !this.propUserKey.isEmpty() : false; }
c0680e92-2744-4c8f-8039-d4778ad2b2a7
2
@Override public boolean equals(Object obj) { if (obj == null || obj.getClass() != s.getClass()) { return false; } Sensor sensor = (Sensor) obj; String[] excludeFields = {"id", "datas", "addDate"}; return EqualsBuilder.reflectionEquals(sensor, s, excludeFields); }
58fbc11e-7ec5-4c26-bbd5-2e48b17fdea5
5
public int[] getIntersection(int[] a, int[] b) { int iA = 0, iB = 0, iC = 0; int[] c = new int[a.length < b.length ? a.length : b.length]; while (iA < a.length && iB < b.length) { if (a[iA] == b[iB]) { c[iC] = a[iA]; iC++; iA++; iB++; } else if (a[iA] > b[iB]) { iB++; } else iA++...
c1a7d217-ad99-41b0-8e2f-36883f56d5df
5
private int convertRank() { switch (myRank) { case 'A': return 14; case 'K': return 13; case 'Q': return 12; case 'J': return 11; case 'T': return 10; default: return myRank - '0'; } ...
e3a5203c-604a-42ce-8cde-03422523656c
7
public static boolean balanced(ChemistryUnit inExpression, ChemistryUnit outExpression){ ChemistryUnit apartInExpression = apart(inExpression); ChemistryUnit apartOutExpression = apart(outExpression); for(Map.Entry<ChemistryUnit, Integer> outEntry : apartOutExpression.getUnitEntrySet()){ Debug.print(outEntry +...
5bd70051-956c-4435-9310-c3f24d1beef3
7
public void move(long delta, String direction) { int margin = (int) (getPos().getX()-4 % 64); switch (direction) { case "left": if (!Tilemap.currentTilemap.isXBlocked((int) getPos().getX() - 4, (int) getPos().getY(), 64, 64, -4)) { addPos(-4, 0); }else { System.out.println("blocked"); if (margin...
b6459a4b-e35f-431e-be09-eeb918474863
0
public String getContract() { return Contract; }
c06cddd3-232f-4f89-93a5-fb2fff5a9388
3
private void optimizeKunstMusik(){ // Kunst/Musik: 3 hjs mandatory int hjsToAdd; Semester bestSemester; if(myData.subjects[6].oralExamSubject==true){ hjsToAdd = 2; //since 13.2 is already in C } else {hjsToAdd = 3;} for (int i=0; i<hjsToAdd; i++){ ...
e672fe77-9e3a-4b30-8379-f70cd251b59e
9
public double solve() { JEP solver = new JEP(); double size = (upper - lower) / count; double running = 0; solver.addStandardConstants(); solver.addStandardFunctions(); solver.addVariable("x", 0); solver.parseExpression(expression); for...
1cb83d55-8a94-465f-9549-cce44114a66f
4
private void fillInTaskOnAssetList(Asset asset) { listOfTasks.clear(); listTasksList.repaint(); ResultSet tasksOnAssetListResultSet = null; Statement statement; try { statement = connection.createStatement(); tasksOnAssetListResultSet = stat...
e038ece5-3d98-4915-b794-98964e7c702d
0
public void setIp(String ip) { this.ip = ip; }
0edcdb60-efc6-41f5-9f9d-4b6fdd9bec84
1
private void setPlayers(List<Player> players) { if (players == null) throw new IllegalArgumentException("Players can't be null!"); this.players = new LinkedList<Player>(players); }
b0bbb067-61cb-447a-bb69-be986fbdad9c
2
public void checkQueues() { long now = System.currentTimeMillis(); for(GameQueue q: queues) { long lastCheckDiff = now - q.lastCheck; if(lastCheckDiff > 5000) { q.check(); } } }
5d374eeb-3c32-466d-9d03-4fec107a5d3e
3
public void printErrorAndExit(String msg) { if (helpOptionsEnabled && firstHelpOptionName() != null) { msg += "\nUse " + firstHelpOptionName() + " for help information"; } if (printStream != null) { printStream.println(msg); } System.exit(1); }
cb783eda-44b5-416b-9093-791ea46811a2
1
@Override public String toString() { return this.key!=null ? getKey().toString() : getMessage(); }
2e6c275b-b25d-46cb-9269-2ff5ed682e59
6
public int read(byte[] b,int off,int len) throws IOException { avail = buf.length - pos; if (avail > 0) { if (len < avail) avail = len; if(avail==3){ temp = pos; temp2 = off; b[temp2++] = buf[temp++]; ...
08a73ebc-bbd9-4613-9480-2945f1a9d41e
4
static private int jjMoveStringLiteralDfa17_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(15, old0); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(16, active0); return 17; } switch(curChar) { ...
6332d39c-ae85-4714-b5cc-a14405eee2b9
4
public void tabChanged(JButton pauseButton, JButton stopButton) { if (view.getTabCount() < 1) { pauseButton.setEnabled(false); stopButton.setEnabled(false); updater.stop(); updaterThread = null; view.setStaus(" "); view.setInfo("\n"); return; } pauseButton.setEnabled(true); stopButton.setE...
2bcb7c32-a18e-41f7-9b4c-60a6a213d34b
0
@Override public void startSetup(Attributes atts) { super.startSetup(atts); TEXT = atts.getValue(A_TEXT); setEnabled(false); addActionListener(this); Outliner.documents.addUndoQueueListener(this); Outliner.documents.addDocumentRepositoryListener(this); }
e356b6d0-2216-467d-ac1a-f8577a13c3a0
3
public String getClipboardContents() { String result = ""; Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); //odd: the Object param of getContents is not currently used Transferable contents = clipboard.getContents(null); boolean hasTransferableText = (contents != null) && contents.isDa...
db005855-623b-4346-9572-e28af8277f7f
6
public TreeSet<Literal> getConflictLiterals(Literal origLiteral) { if (isConflictRulesModified() || isConversionRulesModified()) { updateModeConversionConflictRules(); } TreeSet<Literal> conflictLiterals = conflictLiteralsStore.get(origLiteral); if (null != conflictLiterals) return conflictLiterals; conf...
f447e5a5-b28d-44eb-9c6b-075c46e76298
9
public BorderPane bottom() { BorderPane bottom = new BorderPane(); AnchorPane slider = new AnchorPane(); Rectangle rectangle = new Rectangle(); rectangle.autosize(); rectangle.setWidth(490); rectangle.setHeight(60); rectangle.setFill(Paint.valueOf(Color.WHITE.to...
24502f86-9e66-4286-a590-a1e44b314219
5
@Override public void visitIntInsn(final int opcode, final int operand) { // Label currentBlock = this.currentBlock; if (currentBlock != null) { if (compute == FRAMES) { currentBlock.frame.execute(opcode, operand, null, null); } else if (opcode != Opcodes.NEWA...
c458d575-e56a-4ff6-bf7d-ba3eb067e854
0
public IautosSellerInfo getIautosSellerInfo() { return iautosSellerInfo; }
1e1bb5e4-b1ff-4c37-bebc-65b3ace2125e
2
public void addElement(Element e){ for (Element element: elements) { if(element== e) return; } elements.add(e); }
23af8587-7285-40e9-beb4-06c4fbc73d3c
1
public JFieldPane(final Field field) { this.field = field; this.scale = Parameter.FIELD_SCALE.getValue(); setOpaque(true); if (field != null) { field.addObserver(this); } }
19c0a57e-aeb2-4da5-bed3-6438f2e1f019
9
private void checkUpdateAttributesExist(Hashtable<String, Integer> nameTable, Condition cond, ArrayList<AttrAssign> attrAssignList){ ArrayList<String> condAttrStrList = null; ArrayList<String> attrAssignStrList = new ArrayList<String>(); //Get attributes name in a condition if not null if(cond != null){ co...
ff3f782f-3ef9-4979-b715-a8236636c107
3
private boolean intersectHorizontal(KDPoint q, double distActual, boolean upper) { return q.getX() >= xi && q.getX() <= xf && Math.abs(q.getY() - (upper ? yf : yi)) <= distActual; }
78bfaafb-f84d-4353-b0f7-99ec0298742d
2
public static String decode(String[] dictionary, String msg){ String subString = null; StringBuffer message = new StringBuffer(msg); StringBuilder result = new StringBuilder(); int i=0; while(i <= message.length()-1){ subString = message.substring(0, i+1); Arrays.sort(dictionary); if (Arrays.binarySe...
105200da-0589-4928-9860-c640e95e9b21
5
public static Object load(String nom, String version) { // Controler la validité des paramètres // if (nom == null || version == null) { // Indiquer l'erreur // System.err.println("DataXML : Param�tre null !"); return false; } // C...
e43407e1-0193-40c5-b843-2bf16e92688e
3
private static ShadingPattern shadingFactory(Library library, Hashtable attribute, Hashtable patternDictionary) { int shadingType = library.getInt(patternDictionary, "ShadingType"); if (shadingType == Shadi...
b995a9a1-ca6e-4aa5-bfd5-34fae8c9d6ed
4
@SuppressWarnings("WeakerAccess") public void executeSave() { if(instance.hasChanged()) { if(open == null) { open = FileChooser.chooseFile(null, "Save", JFileChooser.FILES_ONLY); if(open == null) { JOptionPane.showConfirmDialog(newFile, "Something went wrong while saving!(ERR:3)\nAborting saving!"); ...
5cb132d2-1de2-4f03-aaa1-a1a2d5d494df
7
public void clipLongStreets() { final Vector<LayoutNode> set2= new Vector<LayoutNode>(set()); for (final LayoutNode p : set2) { if(isUsed(p) && p.isStreetLike()) { for(int d=0;d<4;d++) { if(p.getLink(d)==null) { final LayoutNode p2 =getNextNode(p, d); if((p2!=null) &&(!p...
dac3d512-5792-4ace-a640-79bee5694b52
6
public void actionPerformed(ActionEvent ae) { if ("Default Flat".equals(ae.getActionCommand())){ obj_sel.setContinuous(); } else if ("Positive Linear".equals(ae.getActionCommand())){ obj_sel.setContinuous(true); } else if ("Negative Linear".equals(ae.getActionCommand())){ obj_sel.setContinuous(fal...
bc11502d-1a0a-46b7-abb0-999a21a76088
4
private static String upperCaseFirstLetter(String name) { StringBuilder fieldNameBuilder = new StringBuilder(); int index = 0; char firstCharacter = name.charAt(index); while (index < name.length() - 1) { if (Character.isLetter(firstCharacter)) { break; } fieldNameBuilder.app...
74d122b8-014e-43db-9f96-c6916370c684
9
public String apply(String in1, int idx1, String in2, int idx2) throws ChangesetException { OpIterator iter1 = new OpIterator(in1, idx1); OpIterator iter2 = new OpIterator(in2, idx2); SmartOpAssembler assem = new SmartOpAssembler(); MutableOperation op1 = new MutableOper...
4b798f1c-686c-41fc-99a2-184e1b5841ea
2
@SuppressWarnings("unchecked") @Override @Transactional(readOnly = true) public CUser findByName(String name) { List<CUser> users=null; try{ Query query=getFactory().getCurrentSession().createQuery("from cuser where emailID = :email"); query.setParameter("email", name); users = query.list(); }catch(Exc...
fc54d142-53a6-44fb-977b-11b8f4d915f4
3
public void burnBlock() { for(int i = 0; i < BLOCK_SIZE; i++) { for(int j = 0; j < BLOCK_SIZE; j++) { if (currentBlock.getValue(i, j) == ACTIVE_BLOCK) { gameBoard[i + blockRow][j + blockCol] = INACTIVE_BLOCK; } } } }
d45322fc-5500-4954-b237-59c01c3ee320
3
public void carregarDisciplinasDeArquivo(String nomeArquivo) throws DisciplinaJaExisteException, IOException { BufferedReader leitor = null; try { leitor = new BufferedReader(new FileReader(nomeArquivo)); String nomeDisciplina = null; do { nomeDisciplina = leitor.readLine(); if (nomeDisciplina !...
7a0360ad-db5d-46f2-971c-59cab2a83655
1
public static void main(String[] args) { try { Car car = DriverFactory.driverCar("Benz"); car.driver(); } catch (Exception e) { e.printStackTrace(); } }
a41f7fa4-0bbc-4a4f-b42c-652f89d237e0
6
public void gameRender() { if (dbImage == null) { // バッファイメージ dbImage = createImage(WIDTH, HEIGHT); if (dbImage == null) { System.out.println("dbImage is null"); return; } else { // バッファイメージの描画オブジェクト dbg = dbImage.getGraphics(); } } dbg.setColor(Color.WHITE); dbg.fillRect(0, 0, W...
20d6d1af-c888-49e0-99a0-2fbe3174ebc0
0
@Override public String getGUITreeComponentID() { return this.id; }
fbc36557-1d3e-44da-9609-85e86e7efe25
0
@Test public void testValueOf2() { UserAgent userAgent = UserAgent.parseUserAgentString("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"); UserAgent retrievedUserAgent = UserAgent.valueOf(userAgent.toString()); assertEquals(userAgent, retrievedUserAgent); }
5f27679e-c0a7-4998-af71-64a57e05d12d
4
public void attachHost(GridSimCore entity, PacketScheduler sched) { String msg = super.get_name() + ".attachHost(): Error - "; if (entity == null) { System.out.println(msg + "the entity is null."); return; } if (sched == null) { Sy...
0779e241-be96-4773-a399-5bfc79a94c8c
0
public String getUserId() { return userId; }
3ae07a3f-d223-4907-b721-4638f6e558e9
5
@Override public String toString() { final StringBuilder boardState = new StringBuilder(""); for (int x=size-1; x >= 0; x--) { for (int y=0; y < size; y++) { switch (board[x][y]) { case UNSAFE: boardState.append(" X "); break; case OCCUPIED: boardState.append(" Q "); break; c...
3b13c296-759f-4f7c-8049-54e957540465
5
public boolean contains(Vec3D vector) { return (xpos < vector.x) && (ypos < vector.y) && (zpos < vector.z) && (xmax > vector.x) && (ymax > vector.y) && (zmax > vector.z) ; }
f9a44dc4-1814-47c7-91f3-49065e70f024
2
private static void validerCategorie(Categorie categorie) throws ChampInvalideException, ChampVideException { if (categorie.getNom() == null || categorie.getNom().isEmpty()) throw new ChampVideException("La catégorie doit avoir un nom"); }
350babdb-429e-4bf1-970d-77c2dd288d7b
8
public void onSignChange(SignChangeEvent event) { String lines[]=event.getLines(); if(lines.length>2 && lines[0].length()>0 && lines[1].length()>0 && lines[2].length()>0 && lines[0].equals("[ra]") && lines[1].equals("output") && !plugin.mvm.myVectors.containsKey(lines[2])) { for(int i=0; i<lines.length; i++) { ...
4db402de-815c-478c-b32b-8c284330ce3b
7
void checkCommands2() { int i; LivingThing thnStore; String strStore=null; for (i=0;i<vctSide2.size();i++) { thnStore = (LivingThing)vctSide2.elementAt(i); if (!thnStore.vctCommands.isEmpty()) { strStore = (String)thnStore.vctCommands.elementAt(0); thnStore.vctCommands.removeElementAt(0); ...