method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
67e31eef-4594-4260-ad15-b29652ae43bc
6
private void CollectRent(){ print("CollectRent"); synchronized (mRenterList) { Iterator<MyRenter> itr = mRenterList.iterator(); while (itr.hasNext()) { MyRenter renter = itr.next(); if (renter.mState == EnumRenterState.RentOverdue) { GiveEvictionNotice(renter); itr.remove(); } } } ...
a8a99d3c-d0e6-45f7-b4e2-d502158e7f37
8
public static double getLow(String property) throws SChemPException { double low = 0; HashMap<Object,Element> propertyTable = getTable(property); if(propertyTable == null) return 1; Object[] array = propertyTable.keySet().toArray(); Arrays.sort(array); if(array[0] instanceof Double) { Doub...
35cb685b-0ad7-4b79-aa69-d1bb990294c7
5
public void recallMethod(String clas, String method, Object[] arg){ try { Class cla=Class.forName(clas); Class[] type=new Class[] {Class.forName("java.lang.String"), String.class}; Constructor ct=cla.getConstructor(); Method meth=cla.getMethod(method,type); ...
6abafbd0-db98-4d3a-9967-ef606af5834b
0
public synchronized void registerConnection(Socket socket) { openConnections.add(socket); }
bfa8844a-9240-4ad4-9423-802d64051161
2
public String decrypt(byte[] encondeMessage) { int[] intText = byte2int(encondeMessage); int i, v0, v1, sum, n; i = 0; while (i < intText.length - 1) { n = numCycles; v0 = intText[i]; v1 = intText[i + 1]; sum = delta * numCycles; for (int ind = 0; ind < n; ind++) { v1 -= (((v0 << 4) ^ (v0 >>...
8b6ac656-333c-4e55-8101-dd353479a5d0
5
private void pause() { mIsPaused = true; LoopKeyListener pausedKeyListener = new LoopKeyListener(LoopKeyListener.PAUSED); removeKeyListener(mPlayer); addKeyListener(pausedKeyListener); setPausedMessage(); mBoard.setVisible(false); mSidePanel.setV...
f55fa7e9-b90d-4d7a-a226-92af183bbee1
5
public static void main(String[] args) { Socket cliente = null; try { cliente = new Socket("127.0.0.1", 2050); } catch(UnknownHostException uhe) { } catch(IOException ioe) { } ...
4e39ea6d-3a92-4a82-bad0-294feca970c7
1
@Override public int hashCode() { int hash = 0; hash += (id != null ? id.hashCode() : 0); return hash; }
3165d650-c620-40fb-8744-b83a895a0908
5
public static void main(String [] args) { try { // open a star file, read it in String cs = readFile("resources/bmrb7170.txt"); // run it through the scanner ParseResult<Character, List<Token>> v5 = Tokenizer.SCANNER.parse(new CharStream(cs));//cs.substring(0, 1000))); printIt(v5); // have to r...
285a2a0d-5a27-47de-88a9-aeb2f7234b35
4
private void programmatiesVoorBepaaldeBioscoopTussenTweeDatums() throws SQLException { BioscoopDAO bioscoopDAO = new BioscoopDAO(connection); List<Bioscoop> bioscopen = bioscoopDAO.all(); System.out.printf("%-2s | ", "ID"); System.out.printf("%-20s | ", "Naam"); System.out.p...
60e433ad-849e-4ddf-9f7d-f38917949d84
9
public static void main( String[] args ) throws InterruptedException, IOException { int status = YueCheHelper.STATUS_DISPATCH; //初始化confighttpproxy ConfigHttpProxy.start(); while(true){ if (status == YueCheHelper.STATUS_DISPATCH) { //启动进入的状态 boolea...
c1cbbdce-fe71-4265-bda1-780d455ad6f8
7
public static void main(String[] args) throws CustomerizedException { if(args.length == 0){ log.error("Your parameters mustn't be empty,we need" + " one para to choose whitch DB you want to connect to (Total surpport 6 DBs)-Please using DB1,DB2... to change DB!"); }else if(args.length>1){ log.error("Only...
b9e7daf5-41a0-42f4-87a9-ec44ba3061c3
0
public int getDate() { return date; }
6f39d28a-26f5-4639-9b4b-60ba91ddd84a
8
public String patch_addPadding(LinkedList<Patch> patches) { short paddingLength = this.Patch_Margin; String nullPadding = ""; for (short x = 1; x <= paddingLength; x++) { nullPadding += String.valueOf((char) x); } // Bump all the patches forward. for (Patch aPatch : patches) { aPatc...
135aad09-5a71-4da4-8bf2-6e30a1f0183a
3
private void sendOutput() { // try{ // Thread.sleep(WAIT_TIME); // } catch (InterruptedException e) { // // duh // } if(isClosed()) return; byte[] output; synchronized(kh) { synchronized(net) { byte[] message; /** * Make sure that there are enough connections. This prevents stations ...
6918262d-6415-45ea-a06f-e7a316ed3660
5
public String getMove( String predNear ) { String move = ""; double chance = Math.random(); // if the predator is not in adjacent location if ( predNear.equals("CLEAR") ) { for( int i = 0; i < probRange.length; i++ ) { if( chance <= probRange[i] ) { move = possibleMoves[i]; break; } } ...
49b616b5-80af-4b23-aa64-e3c480153b38
3
public String toString(){ String str = "function " + name.getNewName(false) + "("; if(paramlist != null) str += paramlist.toString(); str += "){"; Object[] ids = it.getAllIdentifier(); if(ids.length > 0){ str += "var "; for(Object id:ids){ str += ((String) id) + ","; } str = st...
1adfd44a-b92f-45c4-8195-c2e0a910859b
1
public Brett(LaenderGraph laenderGraph) { try { bild = ImageIO.read(new File("res/karte.jpg")); } catch (IOException ex) { System.out.println("fehler beim laden des Bildes"); ex.printStackTrace(); } this.laenderGraph = laenderGraph; ...
e8511f11-9c4f-4908-bbe0-83bf98e1277d
7
public boolean start() { synchronized (optOutLock) { // Did we opt out? if (isOptOut()) { return false; } // Is metrics already running? if (task != null) { return true; } // Begin hitting the s...
09aa0e86-39ab-4edb-abf4-f42fd8c58afb
4
@Override public void recalculate(){ if(this.SHAPE_TYPE == Drawable.TRI_ISO){ if(rotation == 0){ xPoints[0] = (int) (this.getOriginX()+(this.getWidth()/2)); yPoints[0] = (int) (this.getOriginY()); xPoints[1] = (int) (this.getOriginX()); yPoints[1] = (int) (this.getOriginY()+ this.getHeight()); ...
88b1c24e-11f7-43c5-9ee3-7eb5a8fa9cd2
8
protected void setDescriptor(String descriptor) { this.descriptor = descriptor; if (descriptor.equals(MetarConstants.METAR_SHALLOW)) { isShallow = true; } else if (descriptor.equals(MetarConstants.METAR_PARTIAL)) { isPartial = true; } else if (descriptor.equals(MetarConstants.METAR_PATCHES)) { isPatch...
2efc46fd-73b4-40a1-97d8-85e58cdb9089
8
public void blankLine(){ BufferedReader reader = null; BufferedWriter writer = null; try { List<String> fileLines = new ArrayList<String>(); reader = new BufferedReader(new FileReader(f)); String line = null; while((line = reader.readLine()) != null){ fileLines.add(line); } writer...
185c9693-7aed-418a-b9a1-4b2b68933124
2
public void testPropertyAddNoWrapSecond() { TimeOfDay test = new TimeOfDay(10, 20, 30, 40); TimeOfDay copy = test.secondOfMinute().addNoWrapToCopy(9); check(test, 10, 20, 30, 40); check(copy, 10, 20, 39, 40); copy = test.secondOfMinute().addNoWrapToCopy(29); chec...
718f8a6b-ec83-4a4e-adcb-2209130e09f1
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...
16c6bdd3-b624-44d6-88b2-6f4c04f834dc
9
public Iterable<Key> kLargest(int k){ if (k < 0 || k > N) return null; /* TODO: Implement kLargest here... */ Queue<Key> kLargestKeys = new Queue<Key>(); MinHeap<Key> heap = new MinHeap<Key>(k); int index = 0; int keyCount = 0; while (keyCount < k && index < M) { i...
e13d35a0-4345-4c9c-bf80-54b6378309fb
8
public static void updateWins(Game game){ System.out.println("updateing wins"); PreparedStatement update1 = null; PreparedStatement update2 = null; Player player1 = game.getPlayer1(); Player player2 = game.getPlayer2(); String selectStatement = //logic for prepared statement "UPDATE Playe...
96da4ff2-e396-47bf-9bad-cde673dfcb9a
3
public static CastleBuilding getTier(int tier, CastleType castle) { for (CastleBuilding u: values()) { if (u.tier == tier && u.type == castle) { return u; } } return null; }
4cf54ab9-013e-44a5-8350-92c9add96b39
6
public int verifyDummyAccount(String u, String p){ //FOR TESTING ONLY int val = -1; //if(u.equalsIgnoreCase("admin")&&p.equalsIgnoreCase("adminpass")){ if(u.equalsIgnoreCase("ALCDBA")&&p.equalsIgnoreCase("ALC")){ userType = 0; val=10000; } else if...
8f0e37d0-a5f8-43fe-b622-9783a73402e3
3
@Override public URL getSchemaURL(String schemaLocation) { if (schemaLocation == null) { throw new IllegalArgumentException("schemaLocation cannot be null"); } if (!schemaLocation.startsWith("/")) { schemaLocation = "/" + schemaLocation; } URL schema...
e78dca4b-8c83-48f3-a545-78429f96a430
8
public Constraint[] updateAndRemoveKnownVariables(Map map) { // first check for previously known values for (int i=nvariables-1; i>=0; --i) { int s = variables[i].getState(); if (s>=0) // clear (remove variable) variables[i]=variables[--nvariables]; else if (s==BoardPosition.MARKED) { // marked (...
a6c4e0ef-92c6-4aa9-b61e-56e0030376af
8
private static String escapeJSON(String text) { StringBuilder builder = new StringBuilder(); builder.append('"'); for (int index = 0; index < text.length(); index++) { char chr = text.charAt(index); switch (chr) { case '"': case '\\': ...
04689bbc-f611-45ff-ad77-0a26f37872ec
0
public void sendToCurrentStep(int currentStepNumber) { OSCMessage message1 = new OSCMessage("/ch/currentstep"); message1.addArgument(currentStepNumber); send(message1); }
af809650-0259-4811-b0b1-2c3090ed7274
0
public void clear() { data.clear(); data.add(initializeRow(0)); fireTableDataChanged(); }
bb70a670-b406-41fb-b1b7-4ce3043fdbd6
6
public void run() { System.out.println("Здесь по идее будет происходить обработка данных боя"); ConnectServer.UserProcessor currentGamer, gamer; while(!closed){ for(Map.Entry<Integer, ConnectServer.UserProcessor> entry : battleUsers.entrySet()){ currentGamer = entry.g...
a6a2e0d4-b4ac-48ca-ac2f-42a7f51f33e4
2
public synchronized DBConnection getDBConnection() { if (free.size() == 0) { //If there aren't an free connections if (!createMoreConnections()) { throw new RuntimeException("Not enough connections"); } } DBConnection dbc = free.remove(0); used.add...
84fb9e0f-75a0-4712-9830-1ef5b6a86c59
8
final void createOffscreenImage(boolean discard_image) { d=getSize(); if(discard_image) { img=null; imgsize=null; } if(img == null || imgsize == null || imgsize.width != d.width || imgsize.height != d.height) { img=createIma...
c7c398fb-8556-4d10-ba5d-6040b1baf7a1
6
public Block findNearByLockable( Block var1 ) { Block found = null; List<Block> possible = new ArrayList<Block>(); if ( var1 == null ) return null; possible.add( var1.getRelative( BlockFace.UP ) ); possible.add( var1.getRelative( BlockFace.NORTH ) ); possible.add( var1.getRelative( BlockFace.EA...
93116559-1141-4888-8416-da487cfcd816
5
public static void p7_1 () throws FileNotFoundException { boolean track = false; while(!track) { try { String filename = "hello.txt"; PrintWriter write = new PrintWriter(filename); try { write.println("Hello World!"); ...
a67afa51-4f84-4a19-907b-8b617d3e57b0
4
@Override public Tipo validarSemantica() throws Exception { Tipo izq,der; izq=izquierdo.validarSemantica(); der=derecho.validarSemantica(); if (izq instanceof TipoInt || der instanceof TipoFloat){ if (der instanceof TipoInt || der instanceof TipoFloat ){ r...
a222eb3e-deee-4fe8-981b-611e96cce4a3
9
public void run() { Mensagem recebida = new Mensagem(); Mensagem aEnviar = new Mensagem(); while(true){ try { recebida = (Mensagem)input.readObject(); String mensageiro = recebida.getMensageiro().toString(); String msg = recebida.getInfo().toString(); // USER !! if (mensageiro.equals("USER...
920d6cad-e515-4b67-94cd-f3e50c37647e
4
public int manhattan() { if (!manhattened) { int manhattanDistanceSum = 0; for (int x = 0; x < N; x++) // x-dimension, traversing rows (i) for (int y = 0; y < N; y++) { // y-dimension, traversing cols // (j) int value = tiles[x][y]; // tiles array contains board // elements ...
beba513b-2519-40a0-84e7-b4c3ae4be42d
1
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed JFileChooser chooser = new JFileChooser("/"); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); int returnVal = chooser.showOpenDialog(this); if(returnVal == JFileCh...
3bcf2e3e-d503-4b0d-adc2-cbea06a956ff
9
public void createJavaSourceFile() { String famNumber = Character.toString(_architecture.charAt(_architecture.length()-1)); String namePrefix = "V" + famNumber; String fileName = namePrefix + "PartLibrary.java"; try { BufferedWriter buf = new BufferedWriter(new F...
b6b3c308-a3d7-4857-b788-f89d159821dd
0
public void setSignature(SignatureType value) { this.signature = value; }
310580f2-da26-4804-9241-ed2cedcd25f7
9
private ArrayList<Integer> findSequence(int xPos, int yPos, ArrayList<Integer> currentPath) { currentPath.add(board[yPos][xPos]); ArrayList<Integer> pathRight = new ArrayList<Integer>(currentPath); ArrayList<Integer> pathDown = new ArrayList<Integer>(currentPath); if (xPos < maxX || yPos < maxY)...
b4463b48-ce33-4806-bc67-bc67571cf949
1
@Override public void actionPerformed(ActionEvent e) { int result = fc.showOpenDialog((JComponent)e.getSource()); if ( result == JFileChooser.APPROVE_OPTION ) { selectedFile = fc.getSelectedFile(); loadImage(selectedFile); } }
0cdc267c-15f9-465a-ba79-bceed4e0ac1c
7
public int[] getInts(int par1, int par2, int par3, int par4) { int[] var5 = IntCache.getIntCache(par3 * par4); for (int var6 = 0; var6 < par4; ++var6) { for (int var7 = 0; var7 < par3; ++var7) { this.initChunkSeed((long)(par1 + var7), (long)(par2 + va...
1e41115f-31f3-4a6a-8c0b-0f188a8f4ecf
1
@BeforeTest public void isSkip() { Page.initconfigration(); if(!TestUtil.isExecutable("LoginTest",Page.excel)){ throw new SkipException("Skipping the test case as the Run mode is not Y"); } }
14dcd98b-bc08-41a2-8502-1ed2a1d42b7b
6
@Override public final void onKeyPress(char var1, int var2) { if (var2 == 14 && name.length() > 0) { name = name.substring(0, name.length() - 1); } String canUse = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ,.:-_\'*!\"#%/()=+?[]{}<>"; if (numbersOnly...
1d322a8f-80ad-4a87-8c0a-367789cccde7
4
static boolean preserveWhitespace(Node node) { // looks only at this element and one level up, to prevent recursion & needless stack searches if (node != null && node instanceof Element) { Element element = (Element) node; return element.tag.preserveWhitespace() || ...
7c08e6d3-b1d2-4f39-9933-793ba3201a92
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...
dbe6cfb0-29db-4a2f-bb18-f6802c723ecb
0
GarbageConnections() { lock = new ReentrantLock(); setName("GarbageConnections"); setDaemon(true); }
bafdfb72-538d-4b92-b716-abb30c944155
2
public OutlineLineNumber(OutlinerCellRendererImpl renderer) { this.renderer = renderer; setVerticalAlignment(SwingConstants.TOP); if (Preferences.getPreferenceBoolean(Preferences.SHOW_LINE_NUMBERS).cur || Preferences.getPreferenceBoolean(Preferences.SHOW_INDICATORS).cur) { setOpaque(true); } else { ...
b981101e-f430-403a-8fd5-5067bea2a3a7
6
@Override public Object getValueAt(int rowIndex, int columnIndex) { switch(columnIndex){ case 0: return ListMsg.get(rowIndex).getRead(); case 1: return ListMsg.get(rowIndex).getId_message(); case 2: return ListMsg.get(rowIndex).ge...
f784bb8b-abfd-4133-8fc5-595722299315
1
private boolean jj_3R_28() { if (jj_3R_77()) return true; return false; }
6ece73f8-0cdd-4728-9caf-82160258ddbb
4
public Creature fight() { log.comment(creature1.toString()); log.comment(creature2.toString()); int currentLifePointsCreature1 = creature1.getTotalLifePoints(); int currentLifePointsCreature2 = creature2.getTotalLifePoints(); while (currentLifePointsCreature1 > 0 && currentLife...
cd568e64-493d-4a7c-8d49-50223026ffdb
3
public boolean containsCoord(int x, int y) { for (int i=0; i<size(); i++) { if (get(i).getX() == x && get(i).getY() == y) { return true; } } return false; }
eb1535ab-5657-4ede-ad27-75b03ad34a93
4
public boolean matches(InventoryCrafting var1) { for(int var2 = 0; var2 <= 3 - this.recipeWidth; ++var2) { for(int var3 = 0; var3 <= 3 - this.recipeHeight; ++var3) { if(this.func_21137_a(var1, var2, var3, true)) { return true; } if(this.func_21137_a(var...
ef37d513-7434-44d6-ab1d-78f412b37621
2
private void setCombinedName() { StringBuilder sb = new StringBuilder(); if (firstName != null) sb.append(firstName).append(' '); if (lastName != null) sb.append(lastName); setName(sb.toString().trim()); }
47bbb393-5cb1-49f4-9bb0-b06a2c5d820b
8
protected void reCompute() { short a = inputPins[0].get(); short b = inputPins[1].get(); short c = inputPins[2].get(); short d = inputPins[3].get(); short e = inputPins[4].get(); short f = inputPins[5].get(); short g = inputPins[6].get(); short h = inputPi...
6871bfb4-b5af-4957-a1e6-9ef40bfb7d87
2
private List<String> fileToLines(String filename) { List<String> lines = new LinkedList<String>(); String line = ""; try { BufferedReader in = new BufferedReader(new FileReader(filename)); while ((line = in.readLine()) != null) { ...
489f08fa-0e1b-4b36-9256-241c40631d79
7
@Override public final void start() { master .createBuffers(bufferSize.width, bufferSize.height, bufferOptions); isRunning = true; if (mustBeAnWebApplet) { mainThread = new Thread("main") { @Override public void run() { if (VERBOSE) System.out.println("Starting main thread..."); ...
5b286226-a4b4-46a7-b40e-594b8a6c27ee
0
public static void main(String[] argv) { new Mine(10, 10); } } class CloseWindow extends WindowAdapter implements ActionListener { Window w; boolean quit=false; CloseWindow(Window w) { super(); this.w = w; } CloseWindow(Window w, boolean quit) { super(); this.w = w...
3e363b28-b757-424e-b8ad-6697cd009755
7
@Override public int run(String[] args) throws IOException, ClassNotFoundException, InterruptedException, InstantiationException, IllegalAccessException { DefaultOptionBuilder obuilder = new DefaultOptionBuilder(); ArgumentBuilder abuilder = new ArgumentBuilder(); GroupBuilder gbuilder = new Grou...
e7f1b381-ccd1-4c11-99d3-08dc116d7ccf
5
public <T extends Enum<T>> T lookupEnum(Class<T> type, String name) { if (type == null) { throw new IllegalArgumentException("type must not be null"); } if (name == null) { throw new IllegalArgumentException("name must not be null"); } Map<String, Enum<?>>...
c7bdebf9-aaae-4ad9-9f3a-eca5b3a8cca3
4
private static boolean isSqliImpl2( final String input, final String quote, final int flags ) throws Exception { final List valueList = new ArrayList(); String[] allTokenBuf = new String[ 1 ]; List processedValueList = tokenize( quote + input, valueList, allTokenBuf, flags, true ); //debugPrint( valueList ); String fo...
612fccf5-17eb-4471-9c03-2324c346eb48
7
private void processAuctionEvent(AuctionEvent event) { if (event.getType().equals(AuctionEvent.AUCTION_STARTED)) { auctionList.add(event); } if (event.getType().equals(AuctionEvent.AUCTION_ENDED)) { // AVG- Duration if (avgAuctionDurationTimeEvent == null) { Timestamp currentTimestamp = new Timesta...
1578c10b-2d70-4171-8a39-f4f768a7787e
2
public ActiveNumber setDirection(int dir) { if (dir == DIR_DEC) { this.increase = false; return this; } if (dir == DIR_INC) { this.increase = true; return this; } this.isStatic = true; return this; }
3ec77762-5320-4c27-aabe-9a827bbee478
8
public void refresh(){ buttonCreator.removeAll(); for(Themes theme : Themes.getAllThemes()){ if(theme != Themes.RANDOM && theme != Themes.RANDOM_COLORS && theme != Themes.SEASONS){ //these themes dealt with separately if(theme.isUnlocked()){ ...
75a23c5c-9c9f-4f48-aa2f-c7c44a61c002
9
protected StringBuffer getAgeDescription(int draconianAge) { StringBuffer returnVal = null; // ===== return a string that represents the age of the Dragon switch (draconianAge) { case HATCHLING: returnVal = new StringBuffer("a hatchling");break; case VERYYOUNG: returnVal = new StringBuffer("a very you...
63b00d62-17c9-49da-8c2a-40a73aa23ba5
7
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Order order = (Order) o; if (id != null ? !id.equals(order.id) : order.id != null) return false; if (positions != null ? !positions.equals(orde...
b2d8d410-4455-4616-a611-f191de2e43c1
4
public void paint(Graphics g) { // check if started checkStarted(); if (started) { // only ever one level Level l = levels.get(0); // draw the backBuffer to the window if (l.cameraShouldMove()) { g.drawImage(backBuffer, (w / 2) - (int)getAverageX(), (h / 2) - (int)getAvera...
4874854d-e463-41fb-826a-9e8a42be01fe
7
public final static Mutator getInstance(int mutatorType) { Mutator mutator = mutators.get(mutatorType); if (mutator != null) return mutator; switch (mutatorType) { case MUTATOR_IDENTITY: mutator = new IdentityMutator(); break; case MUTATOR_SUBSTITUTION: mutator = new SubstitutionMutator(); brea...
110b26a7-7457-4cd5-8db7-6abcb841497b
3
private boolean zzRefill() throws java.io.IOException { /* first: make room (if you can) */ if (zzStartRead > 0) { System.arraycopy(zzBuffer, zzStartRead, zzBuffer, 0, zzEndRead-zzStartRead); /* translate stored positions */ zzEndRead-= zzStartRe...
becc8a65-aa45-4f30-9d2f-8ba671b752a7
2
public Pattern(String pattern) { this.pattern = pattern; patternArray = pattern.split(DELIMITER); // Set wild card rank wildCardRank = NOWILDCARD; for (int i = 0; i < patternArray.length; i++) { if (patternArray[i].equals(WILDCARD)) { wildCardRank = i; break; } } }
64710e2c-1eaf-46f4-96aa-969f1fd838aa
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...
3a3df98b-3dcf-43b6-9017-c79c567f393d
2
private void print(String string) { try { System.out.println(string); if (wr != null) wr.write(string + "\n"); } catch (IOException ex) { // ignore } }
4bec90c2-118b-434b-ab3b-4c29a9322c9c
0
public boolean isCheatingAllowed() { return this.cheatsAllowed; }
796bfc9f-d0ca-4e01-97d1-29d9295c0318
6
private void method130(int j, int k, int l, int i1, int j1, int k1, int l1, int i2, int j2) { Class30_Sub1 class30_sub1 = null; for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext()) { if(...
1d5e9188-f2de-4c90-8a75-ff63e226d1fe
5
public NovacomDrivers() { pBar = null; label = null; String os = System.getProperty("os.name").toLowerCase(); if(os.contains("windows")) { if(System.getenv("ProgramFiles(x86)")==null) { driver = Driver.Windows_x86; } else { driver =...
f157a59f-e47d-4e1c-9ee0-30143764d043
7
public List<String> getmenuItemsProduct() { List<String> menuItemsProduct = new ArrayList<String>() { private static final long serialVersionUID = 3109256773218160486L; { try { //Connect to database conn = DriverManager.getConnec...
94d2b750-3572-4da5-8347-938cf5ced037
3
private boolean parseCharacters(Document doc) { NodeList nodes = doc.getElementsByTagName(XmlTag.CHARACTER_SECTION.toString()); NodeList characters = ((Element)nodes.item(0)).getElementsByTagName(XmlTag.CHARACTER.toString()); for(int char_num = 0; char_num < characters.getLength(); char_num++) { Element cha...
3e77ed52-d1d3-4ada-bbdf-c2f6e537e02a
4
public void setSpills(Spill spill, MapperCounters counters) { long inputRecsInPreviousSpills = 0; long outputRecsInPreviousSpills = 0; List<SpillInfo> list = spill.getSpillInfoList(); SpillInfo info = null; for(int i = 0; i < list.size(); i++) { info = list.get(i); spills.add(new SpillPiece(info)); ...
61395650-bb46-4e02-8484-3ecc13ee7c96
8
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof UsuarioProduto)) { return false; } UsuarioProduto usuarioProduto = (UsuarioProduto) obj; if (this.produto != null && usuarioProduto.getProduto() != null && this.produto.equals(usuarioProduto.getP...
bc73efd9-d078-4732-9e82-e772839149ef
4
public void putBit(int oneBit) throws IOException { mByteBuf[mBytePos] |= (oneBit<<(7-mBitPos++)); if (mBitPos == 8){ byte lastByte = mByteBuf[mBytePos]; ++mBytePos;mBitPos = 0; if (mBytePos == mByteBuf.length){ mOs.write(mByteBuf); mBy...
300e5ee9-1cbc-4d0c-a8fd-f8bff4f4ae96
9
private static void processDefinicniBodElement(final XMLStreamReader reader, final Connection con, final Object item, final String namespace) throws XMLStreamException { final String curNamespace = reader.getNamespaceURI(); if (namespace.equals(curNamespace)) { final...
03931636-07db-4111-8288-0c4394036fd0
7
private boolean runIntoAttackingSpace() { //Returns false if none had to be avoided to move Boolean status = false; for (int i = 0; i < allPlayers.size(); i++) { SeenPlayer player = allPlayers.get(i); if (player.distance < 5.0 && player.direction > -15 && player.direction...
be86801c-a697-4b69-8349-49dcaefb1de7
1
private void resetAIMerger(String aiProjectPath) { mainProjectScreensCBL.clearChecked(); mainProjectAssetsCBL.clearChecked(); secondProjectScreensCBL.clearChecked(); secondProjectAssetsCBL.clearChecked(); mainProjectTF.setText(null); secondProjectTF.setText(null); mainProjectDisplayP.setVisi...
db64fd6f-ba89-4dff-9302-220da754b234
4
void onMouseHover(int entered) { switch(entered) { case GL_TRUE: for(MouseHoverEvent e : _mouseHoverIn) { e.run(); } break; case GL_FALSE: for(MouseHoverEvent e : _mouseHoverOut) { e.run(); } break; } }
c39bfc5f-dfde-4d62-8acf-41b40faceb44
5
public void spy(){ ThreadSpider[] spider = new ThreadSpider[this.thread]; for(int i=0;i<this.thread;i++){ try { // 實作替換 spider[i] = new ThreadSpider(this.startUrl, this.outputFilePath, this.cobweb, this.depth); spider[i].setDescription(this.description); spider[i].setResultFilePath(this.outputFil...
e6a395bf-df7b-40c7-9c40-ebed9bb52eb1
4
private static boolean modifyDrug(Drug bean, PreparedStatement stmt, String field) throws SQLException{ String sql = "UPDATE drugs SET "+field+"= ? WHERE drugname = ?"; stmt = conn.prepareStatement(sql); if(field.toLowerCase().equals("description")) stmt.setString(1, bean.getDescription()); if(field.to...
f387bcea-a0fc-4ec9-bdd3-2342bab1a9c4
1
public static String getNonNullInput(String query) { String response = ConsoleTools.getInput(query); while (response == null) { response = ConsoleTools.getInput(query); } return response; }
53e7ada2-ab2f-4d15-bda5-33a707954a15
3
public static void sort(int[] array) { printArray(array); int a = 0; for (int i = 0; i < array.length - 1; i++) { for (int j = 1; j < array.length - i; j++) { if(array[j - 1] > array[j]) { a = array[j - 1]; array[j - 1] = array[j]; array[j] = a; } } ...
eb8bf4c6-6329-4156-915e-2c5a7d9b1081
0
public double getVolume(){ return volume; }
35b549d0-1082-463f-b925-288385c4fdad
3
@Override public void choose(Player player) { int die = game.rollDie(); ArrayList<MarkListContainer> marks = player.getAt().getNextMarks(die, ConnectionType.normal); Iterator<MarkListContainer> iterator = marks.iterator(); while (iterator.hasNext()) { MarkListContainer mlc = iterator.next(); if (m...
cb7e0f4d-1689-4c37-a5a7-bd86d99b39aa
7
protected void actionPerformed(GuiButton par1GuiButton) { if (par1GuiButton.id == 102) { mc.displayGuiScreen(field_74092_a); } else if (par1GuiButton.id == 104) { if (field_74089_d.equals("survival")) { field_74089_d = "crea...
5dbdeb0e-10ab-488c-8e2d-aebc9c950f73
0
private void reset() { isDragging = false; targetNode = null; componentType = OTHER; currentRenderer = null; prevRenderer = null; }
61de1c9e-2581-4e4f-a245-69aba6fd30e4
2
@Override public void onEnable() { instance = this; hooks.setupVaultEconomy(); hooks.setupVaultPermissions(); hooks.setupResidence(); getCommand("portables").setExecutor(new PortablesCommands(this)); //Classloader has SpoutPlugin, Admin wants to use Spout features, and SpoutPlugin has been enabled. Overkil...
dd96c09e-4e85-4c29-a357-036e7764a203
1
public java.security.cert.X509Certificate[] getAcceptedIssuers() { java.security.cert.X509Certificate[] chain = null; try { TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); KeyStore tks = KeyStore.getInstance("JKS"); tks.load(this.getClas...
1f555dca-3681-4ca1-a04d-8b9edeafdb77
3
@Override protected void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g; super.paintComponent(g2); g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); g2.drawImage(background, 0, 0, getWidth(), getHeight(), this); g...