method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
cd972d0c-f87c-44bc-858a-7cccabe81dce
8
final void method509(int i, String string) { anInt980++; aString1009 = string; if (aString1009 == null) aClass348_Sub23_Sub4_999 = null; else { if (i > -4) anInt984 = -61; if (aClass348_Sub23_Sub4_999 != null && !aString1009 .equals(aClass348_Sub23_Sub4_999.method2986(52))) aClass348_Sub23_S...
f0e98b45-48e2-4cbd-a514-19f771bbfa80
8
public static void downloadFileFromUrl(URL url, String localFile, String userAgent) throws IOException { InputStream is = null; FileOutputStream fstream = null; try { URLConnection urlConn = url.openConnection(); if (userAgent != null) { ...
288687ee-5c59-4dab-818c-667257824ff8
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...
b4c06b51-9a16-4b2f-9d81-a6397bf4fa47
8
public void calculateScore() { if (playerSum < 22 && (dealerSum < playerSum || dealerSum > 21)) { setWallet(getWallet() + getPot()); setPot(0); walletLabel.setText("You currently have: $" + getWallet()); score.setText(" You win!"); winGames++; wins.setText(winGames + "-"); }...
4abe0835-2a3a-43d3-8fdc-2f324a10417d
0
public Movimiento(String concept, float importe) { this.setConcepto(concept); this.setImporte(importe); this.setFecha(new Date()); }
b621d4c6-8c12-4d95-aeb9-60b629a1f225
0
public int getColumnCount() { return columnNames.length; }
2ef0b215-54b8-407c-ab88-a6d1625f0830
9
public static Game findGameById(Long gameId) { Game game = null; PreparedStatement findGame = null; ResultSet rs = null; String selectStatement = //logic for prepared statement "SELECT * FROM Game WHERE g_id = ?"; try{ conn = getConnection(); findGame = conn.prepareStatement(sel...
a95e2d46-5800-4444-a6bd-ba870831e126
5
private void renderStillGraphics() { // method104 StillGraphic stillGraphic = (StillGraphic) stillGraphicList.getFront(); for (; stillGraphic != null; stillGraphic = (StillGraphic) stillGraphicList.getNext()) { if (stillGraphic.anInt1560 != plane || stillGraphic.aBoolean1567) { ...
bf7a4e67-2260-446a-beef-617c0028a5c4
5
private void showRightAnswer() { if (GameController.getInstance().isCorrect(jBAnswer1.getText())) { jBAnswer1.setForeground(Color.GREEN); JOptionPane.showMessageDialog(rootPane, "Tacan odgovor je " + jBAnswer1.getText()); } if (GameController.getInstance().isCorrect(jBAns...
98939f9b-79f0-498e-ac29-308c87ee79d5
7
public void checkRuleAndSend(TimeStampMessage message) { // Check if the configuration file has been changed. String MD5 = ConfigParser.getMD5Checksum(configFile); if (!MD5.equals(MD5Last)) { sendRules = ConfigParser.readSendRules(); recvRules = ConfigParser.readRecvRules...
1911664d-e310-4b1b-9aca-a87fe8064f3e
8
public int find(String name, boolean exactOnly) { for(int i=0;i<total();i++) { if((name.equalsIgnoreCase(name(i))) ||(name.equalsIgnoreCase(desc(i))) ||(name.equalsIgnoreCase(abbr(i)))) return i; } if(exactOnly) return -1; for(int i=0;i<total();i++) { if((name(i).toLowerCase...
25339904-e087-4584-9c84-f4a343b574cb
5
public void disconnected(int id) { String name = null; //Remove client from clients for (int i = 0; i < clients.size(); i++) { if (clients.get(i).getID() == id) { name = clients.get(i).getName() + " (" + id + ")"; clients.remove(i); break; } } //Client was not removed if (name == null) { ...
2c31d9bb-9f9b-4f61-91f0-457ccdd0b869
3
@Override public void reopen(AudioFormat pAudioFormat) throws AudioDeviceException { boolean failed = false; for ( AudioDevice dev : this.mDevices ) { try { dev.reopen( pAudioFormat ); } catch (AudioDeviceException e) { failed = true; } } if ( failed ) { throw new AudioDeviceException( "...
6f4294f7-01c3-4776-82d6-c0071f931bbf
3
private final void genDVCall() throws CompilationException { if ((accDV==null) || (accDV.length()==0)) return; String varName=accDV.toString(); String typeName=lib.resolver.getTypeName(varName); int paramsStart=paramOPs.size(); Object varObj; // This condition ensures binary and ...
b8541bab-6bef-45e8-ac5b-5db8d675e7da
5
@Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (args.length != 1) return false; SharedChest sc = plugin.getData().getSharedChestByName(args[0]); if(sc == null) { ChatUtil.sendMessage(sender, "Could not find chest " + Config.CC_CHEST_NAME ...
f5961bfc-162a-4f79-ba09-30f0c776b0a0
8
private static void setLookAndFeel() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException e) { Log.x(e.getMessage()); if (Log.debug) e.printStackTrace(); } catch (InstantiationException e) { Log.x(e.getMessage()); if (L...
ac4a832a-22d4-4250-99f0-2140170520ee
0
public String getSsn() { return ssn; }
bba91725-b577-426e-89f5-31cb5bac657c
6
public static List<Record> getStatus(Map<String, LinkDigest> working, Map<String, LinkDigest> parent, Map<String, LinkDigest> rebase) { // LATER: Is this worth cleaning up? // RemoteWikiTextChanges has a copy of changes. ...
10ab1ca7-5652-45d6-8705-0dde1c4fad24
3
@Override protected void reactPressed(MouseEvent event) { ProgramState curr = StateMachine.getState(); if (curr != ProgramState.ARR_PLAYING) { if ((Settings.debug & 0b100000) != 0) System.out.println("Add song"); if (theStaff.getSequenceFile() != null) { ...
23ddf8f1-cf46-4d4a-893b-afd7c94137f1
8
private void createTopPages(Statement statement) throws Exception { List<String> pageIds = new LinkedList<String>(); List<String> parentIds = new LinkedList<String>(); Map<String, String> topPages = new HashMap<String, String>(); ResultSet rs = statement.executeQuery("SELECT id, parent_id FROM pages"); wh...
36387a2e-3522-4633-a46c-51491acf7641
1
public void removeID(int id){ if(cityMap.containsKey(id)){ cityMap.remove(id); } }
14e4481a-8f48-486c-835a-8bfd09d016be
2
public void printDOT(String pathname) throws IOException { // requires DOT to be available in the shell Process process = Runtime.getRuntime().exec("dot -Tsvg"); OutputStream stdin = process.getOutputStream(); InputStream stderr = process.getErrorStream(); InputStream stdout = process.getInputStream(); ...
e12f0e84-0baf-4e10-8c1b-12eca2e633ea
1
@Override public void focusLost(FocusEvent e) { if(this.getText().isEmpty()) { super.setText(hint); Font hintFont = new Font("Segoe UI", Font.ITALIC, 12); super.setForeground(Color.GRAY); super.setFont(hintFont); } }
109a1372-bccc-45e4-9de6-a3e3bce0a7eb
9
@Override protected void enter() { final GameObject support = ctx.objects.select().select(new Filter<GameObject>() { @Override public boolean accept(GameObject gameObject) { final ObjectDefinition definition = ctx.definitions.get(gameObject); return definition != null && Arrays.equals(SUPPORT_MODELS, d...
393a4402-b42f-45c6-a2f8-ac9884858352
3
boolean findOddP(int p[]){ int count=0; for(int i=0;i<p.length;i++){ if(isOdd(p[i])){ count++; } } if(count>=2) return true; else return false; }
94409732-51f8-4953-8bb7-40a153d98bd4
3
public void applyExpensions(){ for(TreeItem item : tree.getItems()){ FilePathTreeItem pathItem = (FilePathTreeItem) item; try{ if(expanded.get(pathItem.getFilePath())){ tree.setItemExpanded(pathItem, true); } } c...
23a8bd0a-b9c2-4d45-b084-5971f61783ed
3
public boolean game2() { // YOUR CODE HERE // Use the instance variable generator to simulate // 24 rolls of a pair of dice. // Return true if at least one pair is both 6s. boolean winner2 = false; for (int i = 0; i < 24; i++) { int dice1Roll...
35a58fdf-6277-4d80-832c-a612a6afc3a5
7
public void initialize(){ // create the dir under plugins if not there (new File(pluginDir)).mkdirs(); // create some empty YML files recipes = new YamlConfiguration(); items = new YamlConfiguration(); config = new YamlConfiguration(); // check if files exist on disk and create if not checkConfigFile();...
b8488f06-1868-47d3-914a-2996be66d0c4
4
public static String getGroupPrefix(final String name) { try { String s = ""; if (MonsterIRC.getHookManager() != null) { if (MonsterIRC.getHookManager().getChatHook() != null) { if (MonsterIRC .getHookManager() ...
f633dc62-369e-489b-9754-bbe43f068b50
6
public AnalyzeFactory<String> alberi(String map, int count) { AnalyzeFactory<String> factory = new AnalyzeFactory<String>(); String[] lines = map.split("\\n"); Map<Character, List<String>> groups = new HashMap<Character, List<String>>(); for (int y = 0; y < lines.length; y++) { ...
f3d26898-73a4-4a19-bf12-510cf4d7536b
1
protected Object getResultHolder(String arg) { Record rec = getRecord(arg, null); return (rec != null) ? rec.resHolder : null; }
25c9de85-ddb3-4855-ae3a-005cf87ac8c4
5
public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line = ""; out = new StringBuilder(); int nCase = 1; while ((line = in.readLine()) != null && line.length() != 0) { if (line.equals("0")) break; v = readInts(l...
370a7efc-c680-4529-b305-9e15e2980d83
9
@Test public void testCalcIncrementCalc() { DoublesArray arr = new DoublesArray(); int avglen = 10; int samples = 12; for(int i=0; i<samples; i++) { arr.add((double)i*2); } Doubles sma = DoublesFunctions.sma(arr, avglen); assertEquals("cache.size == 0 on init", sma.si...
f33a21f9-2227-4c1d-bc94-e22c09bf2123
4
private void connectToHost(int port) { Socket socket = new Socket(); String ip = "noIP"; boolean validIP = false; // Lesen der IP while (!validIP) { try { System.out.println("Geben sie die IP des Gegners an: "); ip = Eingabe.getEingabe().getUserInput(); } catch (Exception e) { System.out.p...
89fbf384-1cdf-4439-9cfe-e1e047d1e376
5
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { boolean canInit = true; if(jTextField1.getText().isEmpty()){ jTextField1.setToolTipText("This can not be Empty!!!"); jTextField1.setBackground(Color.red); jLabel2.setText("UserName an not be Empty!!!"); canIni...
0063016f-e5c2-4def-ad99-a20e70144604
9
@Override public void update() { if(Mouse.getX()>getX() && Mouse.getX()<getX()+getWidth()){ int mousey = Display.getHeight() - Mouse.getY(); if(mousey>getY() && mousey<getY()+getHeight()){ if(Mouse.isButtonDown(0)){ activate=true; ...
2cc0cf68-f4ae-4305-ac19-0048e93f7fdc
1
public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { FileSplitter frame = new FileSplitter(); frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); }
6ac51387-dc0e-4f83-8450-05a9d7aa4a67
7
@Test public void multiThreadedTest() throws InterruptedException { final AtomicBoolean failed = new AtomicBoolean(false); final AvgCallsPerTimeCounter c = new AvgCallsPerTimeCounter(); final AtomicLong index = new AtomicLong(0); ArrayList<Thread> threads = new ArrayList<Thread>(); for (int i = 0; i < 10...
40c71cdc-a6f9-4138-a513-610a2dc199e2
3
private static int studentExists(String fName, String lName) { Student tempStudent = new Student(); for (int i = 0; i < Students.size(); i++) { tempStudent = (Student) Students.get(i); if ((tempStudent.getfName().equals(fName)) && (tempStudent.getlName().equals(lName))) return i; } return -9999;...
daadfb82-4acd-4427-8db1-f2b43324f0a5
7
public void run() { boolean frameStart = false; List<Byte> messageBytes = new ArrayList<Byte>(); while (!stop) { try { int b = input.read(); if (b == 0x00) { frameStart = true; } else if (b == 0xff && frameStart == true) { frameStart = false; Byte[] message = messageBytes.toArr...
0704f560-90f4-47c9-b7e3-d57335b3bd3f
7
private void setMatrix1Panel() { int rows1 = Integer.parseInt(matrix1Rows.getText()); int columns1 = Integer.parseInt(matrix1Columns.getText()); int rows2 = Integer.parseInt(matrix2Rows.getText()); int columns2 = Integer.parseInt(matrix2Columns.getText()); if (((currentOperation == 1 || currentOperation == 2)...
9a5fe0a7-9165-4504-b137-4219adb01827
3
public Event removeNext() { if (data.isEmpty()) { return null; } int firstIndex = 0; double first = ((Event)data.elementAt(firstIndex)).getTime(); for (int i = 0; i < data.size(); i++) { if (((Event)data.elementAt(i)).getTime() < f...
1fa44de6-2715-4642-be90-47c6218d336a
1
protected void hypothesizeUnit(GrammarEnvironment env, Grammar g) { UnitProductionRemover remover = new UnitProductionRemover(); if (remover.getUnitProductions(g).length > 0) { UnitPane up = new UnitPane(env, g); UnitController controller=new UnitController(up, g); controller.doAll(); g=controller.getGr...
de0583f9-1b67-485a-8d35-c002d983c74f
7
protected void open() { if (!m_enabled) { return; } m_openClose.setDown(true); if (m_maxCellWidth == 0) { initMaxCellWidth(); } int selectorWidth = m_maxCellWidth; // should not be any wider than the actual window int windowWidth ...
1265e6f5-911f-4b30-a687-035016d70885
0
public Orb(double hight, double lengh_circle, double x, double y){ // первый конструктор this.hight = hight; this.setName("Шар"); this.lengh_circle = lengh_circle; this.x = x; this.y = y; this.rad = this.hight/2; this.area = 4*Math.PI*rad*rad; this.volume ...
ee305a4f-e5a2-4a90-b452-7a533abc7e20
1
@Test public void receiverShouldStoreCorrectDataToDaoForMultipleUsers() { int firstUserID = 230491; int secondUserId = 239482; List<GameEvent> mergedUsersData = getShuffledEventHistory(firstUserID, secondUserId); DefaultGameEventReceiver gameEventReceiver = new DefaultGameEventReceiver(); ExperienceDao mo...
2939e933-6ca1-4070-8f76-3da2b3b8f0b2
0
@Override public Class getColumnClass(int columnIndex){ return ImageIcon.class; }
2b6f3fc9-cebb-4f05-9f2e-888a5ce07293
0
public void writeExternal(ObjectOutput out) throws IOException { System.out.println("Blip3.writeExternal"); out.writeObject(s); out.writeInt(i); }
02dbebb1-29f2-42f0-92e7-e8b98d167fdf
1
@Override public boolean shouldReact(Message message) { return message.text.startsWith("steam ") && message.text.split(" ").length == 3; }
36fd7ba8-d5a0-4a97-ace4-31d33a9e7072
4
@Override public TreeRow next() { if (hasNext()) { if (mIterator == null) { TreeRow row = mRows.get(mIndex++); if (row instanceof TreeContainerRow) { TreeContainerRow containerRow = (TreeContainerRow) row; if (containerRow.getChildCount() > 0) { mIterator = new TreeRowIterator(containerRow...
b298a200-b071-4176-93d2-8db9f2411c59
2
public void onBroadcastMessageReceived(BroadcastMessage bm) { if(bm.getMessage() != null) { addText("[" + bm.getSender() + "]: " + bm.getMessage() + (bm.getMessage().endsWith("\n") ? "" : "\n")); } }
007b8c30-94ec-4a19-9be0-43c8bb682aac
7
private boolean authorize() { //Request token to be sent to Twitter RequestToken requestToken; try { //set Twitter variables twitter.setOAuthConsumer(TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET); //get request token and set accesstoken to null ...
3aad212d-ac0c-4d12-9fa1-b0d6e748ec66
3
public static void main(String args[]){ for (int i = 17; i < 42; i++) { if (i == 21) { i = 36; } for ( int j = 1; j <= 4; j++) { MassDownload md = new MassDownload(); md.change(i,j); Threa...
9d18700a-737f-483a-b0c7-dd5790168e3f
9
public void mouseReleased(MouseEvent event) { if (!gameOver) { message = ""; // Calculate which square the user attempted to move the piece to BoardSquare destination = new BoardSquare(event.getX() / SQUARE_LENGTH, event.getY() / SQUARE_LENGTH); // Ch...
791f8b61-1d54-46c3-a610-7ce75869d7dd
0
public String toString() { return "valve1 = " + valve1 + " " + "valve2 = " + valve2 + " " + "valve3 = " + valve3 + " " + "valve4 = " + valve4 + "\n" + "i = " + i + " " + "f = " + f + " " + "source = " + source; }
06ae3bad-26c3-40e6-b9ad-7b1966e06a21
0
private static void printListNewWay(String type) { System.out.println("New Way " + type + ":"); users.forEach(u -> System.out.println(u)); System.out.println(); }
3c11c1e6-63b7-48de-9c4a-814cedace10a
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 fe...
eae0c903-81c7-44ed-be79-deba155044df
9
private static boolean valid(int[][] board, int[][] oldBoard, int[][] newBoard) { if (board == null || oldBoard == null) { return true; } if (equals(oldBoard, newBoard)) { return true; } int differentCnt = 0; for (int i = 0; i < board.length; i++) ...
577d25b9-978b-4c28-95b5-81f11d615e2a
1
public void addRecord(String data) throws Exception { Record rec = new Record(data); if (isNameExists(rec.name)) { remove(rec.name); throw new Exception("This name already exists."); } FileWriter fw = new FileWriter(file, true); BufferedWriter bw = new Buf...
02ae50a0-686f-4429-b1f9-493fbdb82a26
0
public void mouseMoved(MouseEvent event) { }
d8214167-1e69-451f-9825-87b6f13a8e7b
7
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Project other = (Project) obj; if (id != other.id) return false; if (name == null) { if (other.name != null) return false; ...
cbb87d6d-e83a-4a6d-a302-9d7d42d75897
8
public static void insertTimeAndLocationContacts() { int numContacts = totalNumContacts; int batchSize = 1000; System.out.println("Starting: insert location and time into contact table."); try { Connection con = dbConnect(); PreparedStatement update = con.prepareStatement( "UPDATE "+conTbl+" SET loca...
59177b5e-cff7-4d28-8d8a-7c653bb9e1b4
7
@Override public boolean tableExists(String table) { ResultSet res = null; table = table.replace("#__", prefix); try { DatabaseMetaData data = this.con.getMetaData(); res = data.getTables(null, null, table, null); return res.next(); }catch (NullPointerException e) { plugin.getLogger().log(Level.SE...
d2a00ef0-b51e-4e24-931b-e0cf5407f3ea
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 TipoInformacao)) { return false; } TipoInformacao other = (TipoInformacao) object; if ((this.codtipoinformacao ...
04cba49e-8c12-4b99-bd4b-eb3a42e65411
8
public void actionPerformed(ActionEvent e) { // Get the name of the button from the ActionEvent. String cmd = e.getActionCommand(); // Perform corresponding action: Change mode of cursor // "Draw", "Draw Rectangle", "Draw ellipse", "Draw line", "Delete", "no mode" switch (cmd) { case "No Mode": this.draw...
3c9ada86-be43-4e21-8efb-5c5fee3cb26d
5
private String readUI() { System.out.flush(); System.out.print("> "); System.out.flush(); String data = null; BufferedReader inputHandle = new BufferedReader(new InputStreamReader(System.in)); boolean wait = true; while (wait) { try { if (inputHandle.ready()) { wait = false; } else { ...
dd26a2ec-b232-4f23-af92-e9ed635ab283
4
public String convertVariableName(String name) { String numberStr = null; if(Character.isDigit(name.charAt(0)) ) { int j = 0; for(int i = 0; i != name.length(); i++) { if(name.charAt(i) == '_') { j = i; break; } } numberStr = name.substring(0, j); name = name.substring(j +...
8ad9aace-132f-491f-90a9-733b3e8e3d92
5
private Map<?, ?> asMap(Object object) throws InvalidDescriptionException { if (object instanceof Map) { return (Map<?, ?>) object; } throw new InvalidDescriptionException(object + " is not properly structured."); }
04ef4931-2481-4713-854a-8d9774f554dd
4
private String readInlineComment() { if (settings.isIgnoreComments()) return null; String comment = null; getNextToken(); if (tokenType == TokenType.COMMENT) { comment = m_word; // Got the comment; now look for a newline. // ...
a7092435-b67d-47fd-b237-40e5023621d3
6
public <T> TypeAdapter<T> create(final Gson gson, final TypeToken<T> type) { Class<?> rawType = type.getRawType(); final boolean skipSerialize = excludeClass(rawType, true); final boolean skipDeserialize = excludeClass(rawType, false); if (!skipSerialize && !skipDeserialize) { return null; } ...
b4538f55-b4eb-4d16-bece-fbd38be1ee9a
9
public void closeOperation(boolean operationOK, boolean addToHistory, int mode) { ICompositeOperation endedComposite = null; synchronized (openCompositeLock) { if (DEBUG_OPERATION_HISTORY_UNEXPECTED) { if (openComposite == null) { Tracing.printTrace("OPERATIONHISTORY", //$NON-NLS-1$ "Attempte...
c7f179e5-8c48-417a-b26f-a9fdc28462a7
1
public void generate() throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException, NoSuchProviderException, InvalidKeyException, SignatureException { int keySize = 2048; char[] psw = this.keyInfo.getPassword().toCharArray()...
72c6abba-069f-4eb9-bcff-6d2376948fad
0
public Lanceur() { vue = new MonInterface(this); vue.setVisible(true); }
2a6745db-dc81-45c9-9ab6-e4e7976d2453
0
public BatchSubscription(String id) { this.id = id; }
666d66e4-5fca-453a-bf41-92bf9a8c81f6
2
private void jTextFieldEntrepriseCodePostalKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldEntrepriseCodePostalKeyReleased try { List<projetrf.model.Ville> vv1 = RequetesVille.rechercheVilleByCp(jTextFieldEntrepriseCodePostal.getText().trim()); jCom...
ca70909d-c3ae-412a-a228-178a6e01f5a1
6
public String getColumnname( int column){ switch(column){ case 0 : return "kode"; case 1 : return "judul"; case 2 : return "pengarang"; case 3 : return "penerbit"; case 4 : return "tempat"; case 5 : return "tahun"; default: ...
73ea372a-4d51-4b5e-84bb-024ef7e8909e
3
public void setRow(int x, String values) { if (x < matrix.length && matrix[x].length == ((values.length() / 2) + 1)) { for (int i = 0; i < matrix[x].length; i++) { matrix[x][i] = Integer.parseInt(values.substring(i * 2, i * 2 + 1)); } } }
fb013384-25bf-45d0-be82-eeb2701f07ee
3
@Override public void deserialize(Buffer buf) { fightId = buf.readShort(); if (fightId < 0) throw new RuntimeException("Forbidden value on fightId = " + fightId + ", it doesn't respect the following condition : fightId < 0"); teamId = buf.readByte(); if (teamId < 0) ...
a466aa3a-18e0-4334-bc31-9be3af03ac7c
0
public void setStudentBean(StudentBean studentBean) { this.studentBean = studentBean; }
6b304c71-a5ca-4ddd-bc12-4d751ae51c6d
4
*/ private void recListPopup(MouseEvent e) { final int selRow = recTable.getSelectedRow(); final int rowCnt = recTable.getRowCount(); JMenuItem item1 = new JMenuItem("Show Record"); item1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { showRecordPage(selRow); ...
10d22a1a-86ff-44c1-b5be-4d0521508bb1
2
public boolean hasWebsocket(WebSocket socket) { if(socket != null && socket == this.websocket) { return true; } return false; }
e018f181-3e73-41fd-ae8d-ff5c8ab36496
0
public void setLast(String last) { this.last = last; setDirty(); }
22262a1a-e35a-4e48-ab04-5b3ade3974f0
2
private IntBuffer uniformi(int loc) { if (ibuf4 == null) ibuf4 = BufferUtils.createIntBuffer(4); ibuf4.clear(); if (loc == -1) return ibuf4; getUniform(loc, ibuf4); return ibuf4; }
48ec9242-ca48-4fd0-8c2e-51466c2daf73
8
private void init ( List<EzimContact> lIn , String strSbj , String strIn ) { this.initGUI(); this.setIconImage(EzimImage.icoButtons[0].getImage()); this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); this.setTitle(EzimLang.OutgoingMessage); this.pack(); this.setMinimumSize(this.getSize()); ...
bf357dac-7e48-45f0-9368-0a393a1ef787
4
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (localSong == null ? 0 : localSong.hashCode()); result = prime * result + (mp3Metadata == null ? 0 : mp3Metadata.hashCode()); result = prime * result + (songUrl == null ? 0 : songUrl.hashCode()); result = prim...
aad1fa9f-e365-43e6-98b7-dbe33e769261
4
private void init() { // create the rectangle button rectButton = new Button("Rectangle"); add(rectButton); rectButton.addActionListener(new ActionListener() { public void actionPerformed (ActionEvent e) { if (handler != null) handler.setShape(Shape.RECTANGLE); } }); ...
4b778044-8036-47c6-b0ad-3e450b21821b
4
public String toString() { String output = ""; int line = 1; for (int i = 0; i < array.length; i++) { if (i == line - 1) { output += "\n"; line *= 2; } output += (array[i] == null ? "null" : array[i].toSt...
638b5e96-b799-41d1-a5f8-383394494782
5
public boolean selfTest() { byte[] padBytes; final int offset = 5; final int limit = 1024; final byte[] in = new byte[limit]; for (int bs = 2; bs < 256; bs++) { this.init(bs); for (int i = 0; i < limit-offset-blockSize; i++) { padBytes = pad(in, offset, i); ...
e64f71f7-85de-46d4-a5a1-04436723785a
4
@Override void removeChild(@SuppressWarnings("unused") Node child) { // Remove child if(this._var_ == child) { this._var_ = null; return; } if(this._aDe_ == child) { this._aDe_ = null; return; } if(...
94fe3b1f-cc53-447c-bd81-35e311a7fe7d
0
@Override public Iterator<InputEvent> iterator() { return unprocessedEvents.iterator(); }
394b0433-7b28-4531-90f0-f221f73c0d70
3
@Override public void lostOwnership(Clipboard cb, Transferable tt) { LOG.trace(format("lostOwnership cb=%s, tt=%s", cb, tt)); while (true) { try { Transferable t = cb.getContents(null); LOG.trace(format("Обрабатываю Transferable: %s", t)); ...
d9f59d30-51fe-4bad-afd5-cb568487f93b
5
public Rectangle getSitesBounds() { if (_sorted == false) { Site.sortSites(_sites); _currentIndex = 0; _sorted = true; } double xmin, xmax, ymin, ymax; if (_sites.isEmpty()) { return new Rectangle(0, 0, 0, 0); } xmin = Doubl...
d9007638-daa7-42e0-9732-ecfec89cc520
2
private void initTraversal() { for (int i = 0; i < MicromouseRun.BOARD_MAX; i++) { for (int j = 0; j < MicromouseRun.BOARD_MAX; j++) { traversal[i][j] = 0; } } traversal[MicromouseRun.BOARD_MAX - 1][0] = 0x40; }
3c2fe5d7-442d-4d1c-9c90-12cfd8055b20
9
public static ArrayList<ArrayList<Integer>> threeSum(int[] num) { ArrayList<ArrayList<Integer>> rs = new ArrayList<ArrayList<Integer>>(); Arrays.sort(num); for (int i = 0; i < num.length - 2; i++) { //if the smallest values are the same, this means we dont need to scan anymore ...
c4f7e96d-d058-420b-963d-10e003adc50c
4
public synchronized void beginThreadAccess() { Object requestingUser = Thread.currentThread(); while (true) { if (m_oCurrentUser == null) { m_oCurrentUser = requestingUser; break; } else if (m_oCurrentUser == requestingUser) { break...
f8a366c6-0b82-453b-8aeb-134ddc120489
4
private void disconnect() { try { if(resultSet != null) { resultSet.close(); } if(preparedStatement != null) { preparedStatement.close(); } if(connection != null) { connection.close(); } } catch(SQLException e) { e.printStackTrace(); Logger.error("Failed to terminate da...
0abb8568-a0eb-420e-bad3-0273df7b2436
6
public boolean dispatchKeyEvent(KeyEvent e) { boolean pressed = e.getID() == KeyEvent.KEY_PRESSED; int ev = e.getKeyCode(); if (ev == up) { mUp = pressed; return true; } if (ev == left) { mLeft = pressed; return true; } ...
01e8ea53-c7dc-49eb-9ce3-78119e3088a4
5
public static UUID getUUIDFromPlayer(final String playerName) { if (playerName == null) { return null; } final Map<String, UUID> uuids = getUUIDs(Arrays.asList(playerName)); if (uuids == null) { return null; } if (uuids.isEmpty()) { return null; } // Search case ins...
c794fea8-67c9-4231-a9ec-cac4544d44d5
5
public static void main(String[] args) throws IOException { String imgLoc = "src/img/plant1.jpg"; // Checking if arg[0] is there and if it is an image. BufferedImage img = null; boolean passed = false; if (args.length > 0) { File f = new File(args[0]); if (f....
162392e0-a37a-49b3-b859-523a60a9f245
2
public static Normkollektiv findNormkollektivById(ArrayList<Normkollektiv> normkollektivs, int id) { for(Normkollektiv normkollektiv:normkollektivs) { if(normkollektiv.getId()==id) { return normkollektiv; } } return new Normkollektiv(); }