method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
28b00b12-bf55-450b-87e3-5cc4fab3b9a5
0
public Integer getJournalId() { return journalId; }
fbc0d898-b892-43ae-bb64-6b9a3fac5059
0
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Object obj = method.invoke(realObj, args); return obj; }
facbf9a5-5fd1-4478-bb25-be74c9a8b723
0
public PScoutPermissionMethodParser(String filename){ this.fileName = filename; }
cdbab018-a21a-4844-8aab-316114062d34
0
@Override public void windowOpened(WindowEvent arg0) { // TODO Auto-generated method stub }
2529b27a-06d6-4f7b-9fa2-cf0b884803b2
5
public SetUserInfoResult genLoad() { EntityUser user = EntityUser.load(userId); UserType userType = userInfo.getType(); if (userType != null) { long time = BaseEnvironment.getEnvironment().getTime().getTimeMillis(); EntityAction newAction = new EntityAction(ActionType.CHANGE_USER_TYPE, time, use...
a74bc32d-e9dd-4cae-a7e5-7407778eb4e3
8
@SuppressWarnings("deprecation") @Override public void onEnable() { enabled = true; islandSpacing = getConfig().getInt("island.spacing", 8); getConfig().set("island.spacing", islandSpacing); islandHeightScalar = getConfig().getDouble("island.heightscale", 1); getConfig().set("island.heightscale", islandHei...
94afa6aa-b09b-4bc3-bedc-faae4966230a
7
public static List<String> getTriplesFromFile(String filename) { List<String> lines = new ArrayList<>(); try ( FileInputStream fileInputStream= new FileInputStream(filename); InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "UTF-8"); ...
1e7b2c9e-b272-4be2-8af1-450f331294d5
3
public void printSymmetry(Matrix m) { IOGeneric.printResult("Symmetric? " + (isSymmetrical()? "Yes. " : "No. ") + "TopTriangular? " + (m.isUpTriangular()? "Yes. " : "No. ") + "DownTriangular? " + (m.isDownTriangular()? "Yes. " : "No. ") , "-"); }
92a1e5de-5f85-4815-8a54-be287dd73b28
6
public Grafo (Nodo[][] grid){ malla=grid; int N=malla[0].length; V=(int)Math.pow(N, 2); adjuntos= new ArrayList[V]; int i,j,k,l,m; Nodo n; for (k = 0; k < V; k++) { adjuntos[k] = new ArrayList<Integer>(); j=k%N; i=(k-j)/N; for(l=i-1;l<=i+1;l++) { for(m=j-1;m<=j+1;m++) { if...
58a1b0e3-bdad-4a50-8c70-f50edb882319
6
@Override public String toString() { String operationString = "<unknown command>"; switch (operation) { case EQUAL: operationString = "=="; break; case GREATER: operationString = ">"; ...
6d8c7a80-319b-4492-b9f7-cd81c84279cb
1
public ThreadPool(int numThreads) { super("ThreadPool-" + (threadPoolID++)); setDaemon(true); isAlive = true; taskQueue = new LinkedList(); for (int i=0; i<numThreads; i++) { new PooledThread().start(); } }
a683d636-3f5e-4fc3-b90b-a66d69bab951
3
public double bajarEstacion() { if (frecuencia){ fm = fm - 0.2; if (fm < 89.7) { fm = 107.9; } return fm; } else { am = am - 10; if (am < 530){ am = 1610; ...
4c5647ce-1e28-407a-8b89-969286902271
4
@Override public ArrayList<Book> getAllBooks(ResultSet rsetBook) throws SQLException { ArrayList<Book> books = new ArrayList<Book>(); try { // for every album do... while (rsetBook.next()) { ResultSet rsetGenre; ResultSet rsetAuthor; ResultSet rsetRating; ResultSet rsetReview; ResultS...
520f970a-6b21-4d57-8ef5-4b2ecb293d33
0
@Basic @Column(name = "FES_FECMOD") public Date getFesFecmod() { return fesFecmod; }
142781c9-80ab-468d-8408-65b1f8325b9f
0
default void log(String str){ System.out.println("I2 logging::"+str); }
bee8ac8b-1508-4205-b295-a2150444cec7
4
@Override public String[] gibTabs() { String[] re = new String[5]; re[0] = "Punkte\n"; re[1] = "Punktlisten\n"; re[2] = "Kanten\n"; re[3] = "Flaechen\n"; re[4] = "Gesamt\n"; String[] points = QGui.pointArrayToStringArray(gibPoints()); for (int i = 0; i < points.length; i++) { re[0] += points[i] + "...
46c3ff7f-8de8-4861-ac22-62e6f68f40bd
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...
09af6716-3232-489e-8592-f412307520e8
7
private MatchCollection getLocationsHash(StringBuffer DNAsequence, String tokenToMatch, HashMap<String, ArrayList<Integer>> DNAhash, int originalLocation){ MatchCollection out = new MatchCollection(safetyMargin,tokenToMatch.length()); ArrayList<Integer> possibleLocations = new ArrayList<Integer>(); //= DNAhash.get(...
e9a0f4f4-a608-4a85-b3dd-077fb7a8d452
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...
98bd3905-2c1d-429f-95fe-569644f7947c
8
public Grid BFS (Grid grid){ if(grid == null){ return null; } if (grid.playerCanExit()) { return grid; } Queue<Grid> queue = new LinkedList<Grid>(); ArrayList<Grid> listOfGrids = new ArrayList<Grid>(); listOfGrids.add(grid); queue.add(grid); int count = 0; while(!queue.isEmpty()) { Grid par...
8ea349eb-4405-4696-a48e-04b3dfc09f23
2
private void create(String initialValue, Color bg, String fieldTitle) { setPreferredSize(new Dimension(GUIConstants.DEFAULT_FIELD_WIDTH, FIELDHEIGHT)); setBackground(bg); setBorder(BorderFactory.createTitledBorder(fieldTitle)); final JTextField contentInputField = new JTextField(initial...
c266f4ce-484b-4d5b-9bf0-82f5091a960b
9
public Location getAdjacentLocation(int direction) { // reduce mod 360 and round to closest multiple of 45 int adjustedDirection = (direction + HALF_RIGHT / 2) % FULL_CIRCLE; if (adjustedDirection < 0) adjustedDirection += FULL_CIRCLE; adjustedDirection = (adjustedDirect...
d53e636f-ab19-4d1d-955d-92347519eae3
0
public String getDoctorID(){ return userName; }
4bce8355-692c-4553-9bbf-7489e2b8a65d
6
private int maxpath(TreeNode root) { if (root == null) return 0; //if (root.right ==root.left) return root.val; int maxl = root.left == null? 0 : maxpath(root.left); int maxr = root.right == null?0 : maxpath(root.right); if (maxl < 0 ) maxl = 0; if (maxr < 0) maxr = 0; if (root.val + maxl + maxr...
c186515b-5367-4875-a17c-9877f8cdcc14
0
public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("안녕 안드로이드"); System.out.println("오로라"); }
2b4de5d8-8aa4-43f8-b274-4e8e9d979af5
1
private void changeFixation() { if(fixedOrientation) { fixedOrientation = false; mouseListener.hide(); } else { fixedOrientation = true; mouseListener.show(); } allFalse(); }
a6e86444-1099-4917-a784-fef2483e918a
3
private void makeJobs(){ NodeList jobs = queueDoc.getElementsByTagName(JOB_TAG); // Make a job for each entry in the queue document for(int i = 0; i < jobs.getLength();i++){ try{ queue.add(new Job(jobs.item(i).getChildNodes())); } catch( Exception e){ ...
42053c9b-c817-45cd-833c-d887473c9dce
2
public void tick() { segundo = ++segundo % 60; if (segundo == 0) { minuto = ++minuto % 60; if (minuto == 0) { hora = ++hora % 24; } } }
284011e0-8733-4709-8384-df2a540def87
9
private static Map<String, Object> map4DBObject(DBObject obj){ Map<String, Object> ret = new HashMap<String, Object>(); if(obj == null)return ret; for(Object o:obj.keySet().toArray()){ String key = (String)o; if (key.equals("_id") || key.endsWith("._id")) { ...
dff1bb63-121f-4725-825b-ce722a19153c
2
private void selectDataSource() { switch (dataSourceCombo.getSelectedIndex()) { case 0: DatabaseManager.setGetQuestionsFromDatabaseStrategy(new GetQuestionsFromSqliteDatabase()); break; case 1: DatabaseManager.setGetQuestionsFro...
1c16bde2-d10a-471d-8393-c41334f81052
4
public static EncryptionMode getBestEncryptionMode(EncryptionMode[] modes){ for(int i = 0; i < modes.length; i++){ if(modes[i] == MODE_STREAM){ return MODE_STREAM; } } for(int i = 0; i < modes.length; i++){ if(modes[i] == MODE_STREAM){...
8b906d20-b184-4f76-a50e-bbec2325ffe1
9
@Override public void actionPerformed(ActionEvent e) { if (e.getSource() instanceof JComboBox) { if (((JComboBox) e.getSource()).getSelectedIndex() == 0) { ipadr.setVisible(false); ipAdress.setVisible(false); myAdress.setVisible(true); ...
8904cf02-360f-402c-be95-c42e670d09b8
7
private void analysisMenu() throws InterruptedException { System.out.println(); println("Choose an option or enter any integer to go back:"); println("0: Empirical formula using percent composition"); println("1: Empirical formula using mass composition"); println("2: Molecular formula from empiric...
75083523-ddbb-4cb1-aa17-08a2a88cf21a
9
@SuppressWarnings ("unchecked") @Override public Assigner<? super Item, ? super Item> convert(final Field<?, ?> input) { return input instanceof Assigner<?, ?> ? (Assigner<? super Item, ? super Item>)input : null; }
7be0d993-27b7-43de-a299-f89b5deca55c
8
private static String getCategory(String b1, String b2) throws Exception { if( b1.equals("NA") && b2.equals("NA")) return "NA_for_both"; if( b1.equals("NA") && ! b2.equals("NA")) return "NA_for_first"; if( ! b1.equals("NA") && b2.equals("NA")) return "NA_for_second"; if( !b1.equals("NA")...
31a02267-5fd4-4d3e-8e4c-97e7ba1072aa
5
protected void action(){ if(!dead){ if(wallExistsRight()){ if(game.getCurrentLevel().blockAtPixelExists(x+(width)-1,y+(height/4))){ Block bl = game.getCurrentLevel().getBlockAtPixel(x+(width)-1,y+(height/4)); activateDoor(bl); } else { Block bl = game.getCurrentLevel().getBlockAtPixel(x+(wid...
669d919e-eb75-432c-9502-c8d67572e452
5
public static FSList getReferParents(String path) { ServiceInterface smithers = ServiceManager.getService("smithers"); if (smithers==null) { System.out.println("org.springfield.fs.Fs : service not found smithers"); return null; } String body = "<fsxml mimetype=\"application/fscommand\" id=\"showrefs\">"; ...
dcf5b4d0-385e-4ba4-9fc8-9f1502463107
6
@Override public void mouseClicked(MouseEvent e) { if (enabled) { LOG.info("MouseClicked on " + e.getComponent().getName()); String[] split = e.getComponent().getName().split("_"); try { pfactory.sendPlayCardPacket(Integer.parseInt(...
c775bbb5-84f5-4609-88a7-bd7902b8a2e2
7
public @Override void processCommands(final Module module, final TokenFeed tokenFeed) throws CommandException { assert (module != null): "Supplied data module is null"; assert (tokenFeed != null): "Supplied token feed is null"; final Map<String, Command> commandMap = new HashMap(); // init command map for modul...
3c49f8de-0147-4fe4-b2ea-3d70e89023fe
9
@Test public void addbooktest() throws Exception{ Book newbook2; newbook2=new Book ("","سʹ轺","ۺ۴",6656,"X",""); int count=bookcollectb.getBookCount(); bookcollectb.addbook(newbook2); count++; int endnum=0; try{ //׽Ʈ ObjectInputStream osb = new ObjectInputStream(new FileInputStream("bookcollecti...
327d3d22-6553-44a1-ad20-a59fedfcd332
5
@Override public boolean checkPlaceableProjectileHit(Projectile p) { if (gameController.multiplayerMode != gameController.multiplayerMode.CLIENT) { Placeable placeable = null; try { for (String key : placeables.keySet()) { placeable = (Placeable) ...
05121a4b-2c44-420f-8891-04a91f24fe47
2
public void messageReceived(MessageEvent messageEvent) { String message = messageEvent.getMessage(); int id = messageEvent.getId(); if (id == 0 && message.contains("Oh dear")) isDead = true; }
01d98c49-7cb3-4e93-9f51-f23d4ad96fb3
6
private static void preInterface() { Logger.getLogger(BookNaviger.class.getName()).entering(BookNaviger.class.getName(), "preInterface"); try { if (OSBasics.isMac()) { MacOSXApplicationAdapter.setMacInterfaceAndCommands(); } try { UIMan...
a4cfd81e-e6ff-4505-9973-b4a170c4bbd7
2
@Override public boolean evaluate(T t) { if(firstSearchString.evaluate(t) && secondSearchString.evaluate(t)){ return true; } else{ return false; } }
081b0a62-013b-44aa-b465-d21a18698602
7
private static String nombDia(int diaSemana){ if(diaSemana==0) return "Dom"; if(diaSemana==1) return "Lun"; if(diaSemana==2) return "Mar"; if(diaSemana==3) return "Mie"; if(diaSemana==4) return "Jue"; if(diaSemana==5) return "Vie"; if(diaSemana==6) return "Sab"; return ""; }
3854aff7-3d12-4ac2-afa4-ff1dfc05d72c
9
public void objectGroundCollision2() { long t = System.currentTimeMillis(); IFunction func = new IFunction() { @Override public double function(double x) { return scene.getGround().function((int) x); } }; ...
912d0547-dac6-432c-b113-0a7076aeb11a
8
@Test public void RLTest() { //first part of the dialog: RL userInput.add("hi"); userInput.add("alex"); userInput.add("i would like to teach you a recipe"); userInput.add("it is called marinated greek chicken skewers"); userInput.add("greecetest"); userInput.add("we need red onion"); userInput.add("yes...
9cefe565-b554-4eef-8960-172a213ad513
9
@Override public void keyPressed(KeyEvent e) { switch (e.getKeyCode()){ case KeyEvent.VK_UP: System.out.println("Move up"); break; case KeyEvent.VK_DOWN: currentSprite = characterDown; if (robot.isJumped() == false){ robot.setDucked(true); robot.setSpeedX(...
5e07c133-a5ea-42fb-b9f5-03d9bbf98327
6
public void onBlockRemoval(World par1World, int par2, int par3, int par4) { TileEntity var5 = par1World.getBlockTileEntity(par2, par3, par4); if (var5 != null && var5 instanceof TileEntityBrewingStand) { TileEntityBrewingStand var6 = (TileEntityBrewingStand)var5; fo...
f63cbf31-9a96-4bad-9739-c8f3cb4402b7
1
public InputStream getRawID3v2() { if (rawid3v2 == null) return null; else { ByteArrayInputStream bain = new ByteArrayInputStream(rawid3v2); return bain; } }
7a136ff2-b4d8-46e3-b552-94da77decee2
5
private void estimateDistribution_orig(){ int totalSelections = 0; //Number of times each fruit category has been selected for distribution int[] selectedFruits = new int[NUM_FRUITS]; //Number of fruit of each category has been distributed int[] distributedFruits = new int[NUM_FRUITS]; for(int i = 0...
85d42c83-bba1-421d-913a-72a39d656d4c
3
public Point getDirectionAdjPoint() { if (direction == Direction.LEFT) return new Point(location().x - 1, location().y); else if (direction == Direction.RIGHT) return new Point(location().x + 1, location().y); else if (direction == Direction.UP) return new Point(location().x, location().y - 1); else ...
9762ed56-f2b4-45e9-af22-038183c77540
1
public void setVars(String varlist) { StringTokenizer t = new StringTokenizer(varlist, ";,:"); while (t.hasMoreTokens()) { String var = t.nextToken().trim(); String[] l = Conversions.parseArrayElement(var); vars.add(new V(var, l[0], Util.arraysDims(l))); d...
5a126ee0-0819-400b-bf12-00e5216fbda5
6
private String getOffsetDisplayString(int offsetValue) { String offsetString = null; if ((OFFSET_DISPLAY_MODE_ABS_DECIMAL == offsetDisplayMode) || (OFFSET_DISPLAY_MODE_REL_DECIMAL == offsetDisplayMode)) { offsetString = String.valueOf(offsetValue)...
e321759c-b164-4551-992d-a19b8a247656
0
public void setCiudad(String ciudad) { this.ciudad = ciudad; }
ce396896-e5aa-46fb-beb0-ef4ae324548b
6
public static void addMonth(String monthName, DefaultTableModel table) { if(!insert.contains(monthName)) { String tempInsert = "['"+monthName+"'," + "["; for(int c = 0; c<table.getColumnCount(); c++) { tempInsert+= "['" +table.getColumnName(c)+"',"; for(int r = 0; r<table.getRowCount(); r++) { ...
73ad0173-2ff5-4b2b-990a-d10ce28f5ca6
0
public final IServiceProvider getSite() { return privateSite; }
dc8c9a48-65e1-4254-a9e4-49236833b1be
4
public void updateAttractionList(Attraction attraction) { Pattern basicPattern = Pattern.compile("[-a-zA-Z0-9'&\\.\\s]+"); Matcher matcher = basicPattern.matcher(attraction.getName()); if (!matcher.find()) { open(); logger.info("Attraction name: " + attraction.getName() + " is an invalid name"); close...
aeecd0d6-6185-4a97-8abf-81e6abbf0e2e
6
void resetEditors (boolean tab) { TableItem oldItem = comboEditor.getItem (); if (oldItem != null) { int row = table.indexOf (oldItem); try { new String (nameText.getText ()); } catch (NumberFormatException e) { nameText.setText (oldItem.getText (NAME_COL)); } try { new Integer (widthText...
5666cc2f-7b27-4f55-a401-53f91ef10b81
0
public void die() { alive = false; }
92068670-f1d0-4cf5-b33b-c3b365103ef9
8
@SuppressWarnings( "unused" ) //The unused variables provide documentation. public static void convert( File file, File outFile ) throws IOException { long fileLen = file.length(); if( fileLen < 44 ) { throw new IOException( "Not a WOFF file or corrupted." ); } ...
ade30855-c5fc-452c-90f8-31b323d0b836
3
private double calcDebyeLength(){ if(!this.epsilonSet)throw new IllegalArgumentException("The relative permittivitie/s have not been entered"); if(!this.tempSet)System.out.println("The temperature has not been entered\na value of 25 degrees Celsius has been used"); double preterm = 2.0D*Fmath.s...
3f884c1a-bc1a-4758-9031-1b5abd133b23
3
@Override public Collection<Ticket> search(Map<String, String> params) { //TODO make real search: building tree, etc long requestId = this.findFreeKey(this.foundTicketStatuses); this.foundTicketStatuses.put(requestId, false); MsgFindTicket msg = new MsgFindTicket(this.address, this.m...
8784472d-fa95-46bf-9d7e-9f24c34ccf98
8
public CPBrushDab getDab(float x, float y, CPBrushInfo brushInfo) { CPBrushDab dab = new CPBrushDab(); dab.alpha = brushInfo.curAlpha; // FIXME: I don't like this special case for ROUND_PIXEL // it would be better to have brush presets for working with pixels boolean useAA = brushInfo.isAA && brushInfo.type ...
ad115c52-7e31-4e8f-bd44-601126b0069f
5
public boolean intersects(Edge that) { // This function is always returning false. It shouldn't. // trivial rejections if (that == null) { return false; } if (that.higherVertex().isBelow(this.lowerVertex())) { return false; } if (that.lower...
e2a1fdba-526a-471f-82ab-80923bb670eb
7
public boolean ExecuteArrayCall(String SQL, Object[] params, int[] paramsout) throws SQLException { checkedConnection(); CallableStatement cl = getConnection().prepareCall(SQL); if (params != null) { prepareParams(cl, params); } else { ...
4b24de92-6678-45d1-838a-0fc15b955cee
8
public static Integer[] solveSmallestFirst(Graph graph) { ArrayList<Integer> cache = new ArrayList<>(graph.graph.size()); Integer[] result = new Integer[graph.graph.size()]; for (int i = 0; i < result.length; ++i) { result[i] = -1; } int color = 0; while (cach...
d0e1c5bb-a39f-4d06-9cb4-d3aa4982afe9
2
public void setInputDevice(MidiDevice device) { //close existing connection, if there is one try { inputDevice.close(); } catch (NullPointerException npe) { } inputDevice = device; System.out.println("Trying to open " + inputDevice.getDeviceInfo().getName()...
e62e05b1-adde-441c-9a1e-815fcee9d59b
0
public void setName(String name) { this.name = name; }
611f1a5c-3d8b-4849-886e-0ae24c687d37
0
public int getMaxRANGE() { return inventory.getItem(0).getMaxRANGE(); }
13af65fc-af7b-4b8a-9702-217b033edb24
4
public void start() { new Thread(new Runnable() { public void run() { try { final URL url = new URL(mUrl); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod(mMethod); conn.connect(); String response = ""; String line; Buffere...
e94b3c80-6c2b-43b6-9153-e2fc9f0725ce
9
public StartingFrame() { //задаю нужные мне переменные: новый шрифт для красоты и этот фрейм, чтоб к нему обращаться final Font myFont = new Font("Arial", Font.PLAIN, 15); //этот шрифт я буду ставить везде, шде есть текст final JFrame myFrame = this; //меняю иконку окна this....
893d0e23-e936-478d-9b84-e22bce8ba84d
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...
ec70b6a8-bf30-4329-8f82-9790c6dcb5df
7
@Override public void executeMsg(final Environmental myHost, final CMMsg msg) { super.executeMsg(myHost,msg); if((affected!=null) &&(affected instanceof MOB) &&(msg.amISource((MOB)affected)||msg.amISource(((MOB)affected).amFollowing())||(msg.source()==invoker())) &&(msg.sourceMinor()==CMMsg.TYP_QUIT)) { ...
f2664816-81c9-45e8-872e-612c0d327d09
1
public synchronized List<Long> getWaysIds(int pos) { if (nodes.size()>pos) return ways.get(pos); else return new ArrayList<Long>(); }
a143b12f-a7ef-44a8-80ba-52847def38f8
3
public SkinList(Stream buffer) { int len = buffer.getUnsignedByte(); opcodes = new int[len]; anIntArrayArray343 = new int[len][]; for (int j = 0; j < len; j++) { opcodes[j] = buffer.getUnsignedByte(); } for (int i = 0; i < len; i++) { int len_ = buffer.getUnsignedByte(); anIntArrayArray343[i] = new...
c600282c-a1d4-4359-8811-fddbc0571f7c
8
public static void main(String args[]) throws IOException { System.out.println("Starting"); String curLine = ""; System.out.println("server\\client mode? (type 'quit' to exit): "); InputStreamReader converter = new InputStreamReader(System.in); BufferedReader in = new BufferedRea...
bd5ef102-7b4e-4d8d-b42c-450f16b0dbbd
1
public void kirjoitaFeilaavaSisaltoTiedostolle(){ try { PrintWriter kirjoitin = new PrintWriter(tiedosto); kirjoitin.println("tällä\trivillä\ton\tliian\tmonta\tsanaa"); kirjoitin.println("tälläTaasLiianVähän"); kirjoitin.println("vika\trivi\tkelpaisi:"); k...
9ad7a96e-8b63-46a4-a262-0c0a3d417f61
0
public void setPlainValue(Integer value) { this.plainValue = value; }
aef92c01-15ea-44ca-80bf-1b28571aa5ec
0
@Override public int getBoilerStatus() { return boilerStatus; }
64d9773e-e0a3-4c03-982e-fe9948b6212d
5
@Test public void returnsLinkedList() { for (int i = 0; i < 2048; i++) tree.add(i); LinkedList<Integer> list = tree.toLinkedList(); boolean test = true; for (int i = 0; i < 2048; i++) { test = false; list.reset(); while (lis...
85053f24-8f78-4b4a-807b-5fcd6251d38e
6
private void generate(byte[] par1ArrayOfByte) { int var2 = par1ArrayOfByte.length / 256; for (int var3 = 0; var3 < 16; ++var3) { for (int var4 = 0; var4 < 16; ++var4) { for (int var5 = 0; var5 < var2; ++var5) { int ...
365a83e0-bf3a-40b0-b323-b0c934e73a60
0
public MetaDataDao() throws SQLException { this.c = Configuration.getConnection(); this.statement = c.createStatement(); }
fe2a0152-e837-430b-b32d-4d493dff4632
4
public State(String fileName, boolean isEncrypt){ this.state = new char[4][4]; try { if (isEncrypt) { this.edFile = new File(fileName + ".enc"); } else { this.edFile = new File(fileName + ".dec"); } String name = this.edFile.getName(); if (this.edFile.exists()) { this.edFile.delete(); ...
a7dd24b4-43c9-490e-8c62-5b0f5511b2d6
6
@Test public void readOpmlElements() { opmlReader.init(); try { Reader resourceReader = new FileReader(resourceFile); boolean parseStatus = opmlReader.readDocument(resourceReader); if (parseStatus) { Map<String, OpmlElement> elementMap = opmlRead...
fd0f53e2-e489-47a0-9fde-638951175487
5
private long readBuffer(SelectionKey key, int offset) { long numRead = 0; SocketChannel socketChannel = (SocketChannel) key.channel(); while (buffer[offset].hasRemaining()) { enterLoopNIO.inc(); try { numRead += socketChannel.read(buffer, offset, 1); ...
db09f991-5ebc-424b-91ea-eee306f4ab76
4
public void RecordFormula(String csvFilePath) { if (csvFilePath != null && !csvFilePath.isEmpty()) { CsvParser csvParser = new CsvParser(); File myFormula = csvParser.getCsvFile(csvFilePath); List<String[]> tableList = null; try { tableList = csvPa...
1534a823-d883-41a6-92ee-d00ed5e95151
0
@SuppressWarnings({ "unchecked", "deprecation" }) @MethodInfo(author = "Pankaj", comments = "Main method", date = "Nov 17 2012", revision = 10) public static void genericsTest() throws FileNotFoundException { List l = new ArrayList(); l.add("abc"); oldMethod(); }
5800b950-592b-4a13-be66-046bbe230d70
3
private void skipHeader(InputStream in) throws IOException { int len; do { int c; len = 0; while ((c = in.read()) >= 0 && c != 0x0d) ++len; in.read(); /* skip 0x0a (LF) */ } while (len > 0); }
ddb3692a-345c-456b-889f-d5843ff28f80
4
public void mute() { if (!this.muted) { this.muted = true; Enumeration localEnumeration = this.soundRecords.elements(); Vector localVector = new Vector(); while (localEnumeration.hasMoreElements()) { SoundRecord localSoundRecord = (SoundRecord)localEnumeration.nextElement...
43348b51-56aa-4b4a-9b3d-f80906fe8273
1
@Override public void closeRequestSession() { SqlSession session = thSession.get(); if (session != null) { try { session.close(); } finally { thSession.remove(); } } }
35d695aa-f60b-40d7-914e-8552ea45a10f
7
public void run() { while (!Thread.interrupted()) { try { Socket sin = waitForData(); String filename = sin.getInetAddress().getHostAddress() + "_" + new SimpleDateFormat("yyMMdd_HHmmss").format(new Date()) + ".gcode"; InputStream in = sin.getInputStream(); BufferedOutputStream bufout = n...
f132ec4f-e6c0-45be-8fdf-b04d11f86778
7
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setCharacterEncoding("UTF-8"); response.setContentType("text/html;charset=utf-8"); String method = Util.nullToString(request.getParameter("method")); if("viewA...
3d6b364a-31f4-463f-a4b5-4fb1c6dd3444
1
public EditPanel(Dimension size) { setBackground(Color.MAGENTA); setAutoscrolls(true); setPreferredSize(this.size); if(size != null) { this.size = size; setPreferredSize(size); } }
3dff26ed-27f5-46e2-acaa-3099df899311
8
private long readNumber ( int side, int l, boolean FF ) { long r = 0, b = 1; int q=0; byte[] g = new byte[l]; try { fidx.read(g); } catch (IOException e) { e.printStackTrace(); } if(side>0 && l>1) b<<=((l-1)<<3); for(int i=0;i<l;i++) { q = g[i]; if(q<0) q+=0x100; if(q!=0xff) FF=false; r|= ...
823b680c-4f4b-4c97-8a3a-54ea54a7c66f
2
@Override public Dimension preferredLayoutSize(Container parent) { Dimension size = mHeader.getPreferredSize(); int width = size.width; int height = size.height; if (!mDockables.isEmpty()) { size = getCurrentDockable().getPreferredSize(); if (width < size.width) { width = size.width; } height +...
823226cf-7eac-4ecd-a306-1c85d3ea2e21
0
public void f() { System.out.println("public f()"); }
67616978-40e9-49d0-809a-968a6a15c4fa
2
public int getLeastVisited() { int index = 0; int minVisits = Integer.MAX_VALUE; for (int i=0; i < actions.length; i++) { if (actions[i].getVisits() < minVisits) { minVisits = actions[i].getVisits(); index = i; } } return index; }
bb88ec64-638b-4c49-be66-e943820ef160
8
public void saveGame() { File file = new File("Saved_Games.txt"); FileWriter writer; boolean flag = false; ArrayList<String> data = new ArrayList<String>(); ListIterator<String> iterator; String currentPuzzle = getCurrentPuzzle(); try { Scanner s = new Scanner(file); while(s.hasNextLine()) { ...
b7355880-3e5d-4b7f-91e3-c73f5507fb00
8
public boolean ColliderWithPodiumDown(){ if((x>=0 && x<=Podium.WIDTH-25) && (y<=GameMain.GAME_HEIGHT_ASSUM - GameMain.DistanceBottomAndPodiumDown && y> GameMain.GAME_HEIGHT_ASSUM - GameMain.DistanceBottomAndPodiumUp)){ return true; } if((x>=GameMain.GAME_WIDTH+25 - Podium.WIDTH - Character.WIDTH && x<=Ga...