method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
38f3bc38-43ac-43ce-b95f-f15a88bd1bc6
4
public Point getKnobFromIndex(int index) { switch (index) { case 0: return new Point(((Rectangle) shape).x + ((Rectangle) shape).width, ((Rectangle) shape).y + ((Rectangle) shape).height); case 1: return new Point(((Rectangle) shape).x, ((Rectangle) shap...
6e5a3ec0-a5b5-4a13-ba98-a88bb903fd4e
4
@Test public void decreasesKey() { MyInteger[] integers = new MyInteger[30]; for (int i = 1; i < 30; i+=2) { integers[i] = new MyInteger(i); treeHeap.insert(integers[i]); } integers[19].myInt = 2; treeHeap.valueChanged(integers[19]); ...
cf5e3d33-af25-4b43-b8d1-c2175e0a1162
9
static String readChunk(BufferedReader br, int len) throws Exception { StringBuilder sb = new StringBuilder(); for (int i = 0; i < len; ++i) { int ch = br.read(); if (ch < 0) throw new Exception("unexpected EOF in body"); if (ch >= U_0080 && ch < U_0800) // 2 bytes ++i; else if (ch >= U_D800 &...
4fa23f6b-b26a-4ea7-b355-1d654971665f
0
@Override public String toString(){ return "\n INGRESO "+super.toString(); }
71efbe5c-a895-4268-92ac-b69b1acddd61
0
public void remove() { q.clear(); }
7073e726-9c55-443c-86a8-67ff857e83f2
3
public static int arraysMaximum(int ar[][]) { int max = ar[0][0]; System.out.print("Array Is :\n"); for (int[] element : ar) { System.out.println(); for (int element2 : element) { System.out.print(element2 + " "); if (max < element2) { max = element2; } } } System.out.println(); re...
5007eea1-8aeb-4cac-89f3-b0442c39216c
2
public JSONObject append(String key, Object value) throws JSONException { testValidity(value); Object o = opt(key); if (o == null) { put(key, new JSONArray().put(value)); } else if (o instanceof JSONArray) { put(key, ((JSONArray)o).put(value)); ...
60893bd5-fb25-470e-a32d-c9551ccc6d9b
8
private void downloadAndInstallResource(URL par1URL, String par2Str, long par3, int par5) { try { int i = par2Str.indexOf("/"); String s = par2Str.substring(0, i); if (s.equals("sound") || s.equals("newsound")) { if (par5 != 0) ...
72fb5cf1-d9fe-4f1a-996b-d525f3dec11d
7
public static void removeDeprecatedProperties(Object obj, Map<String,String> props) throws Exception { //traverse class hierarchy and find all deprecated properties for(Class<?> clazz=obj.getClass(); clazz != null; clazz=clazz.getSuperclass()) { if(clazz.isAnnotationPresent(DeprecatedPropert...
a919097a-f3e5-48d1-888e-f0e4590c1d40
2
public void locate() throws HttpException { //create resource this.resource = new File(this.domain.getDirectory(), this.path); if (this.resource.isDirectory()) { //trailing slash if (this.checkTrailingSlash()) return; //find index file this.findIndexFile(); } //verify and prepare ...
7da6787a-f08f-42f1-ad0d-13027443fc1c
1
public Item next() { if (!hasNext()) throw new NoSuchElementException(); Item item = current.item; current = current.next; return item; }
ad1ed8cc-cbaf-4591-b876-2675be7bd918
9
public String getHandName(){ // Straight Flush 00--------------. if(isStraightFlush() > 0) return "Straight Flush"; // Four of a kind 00----------.00 if(isFourOfAKind() > 0) return "Four of a Kind"; // Full House 0000--------. if(isFullHouse() > 0) return "Full House"; // Flush ...
571bb919-e45b-46f8-8ec4-c8369839aa3c
4
private void moveDir(Dir dir) { switch(dir) { case North: setY(getY() + 1); break; case South: setY(getY() - 1); break; case East: setX(getX() + 1); break; case West: setX(getX() - 1); break; default: } }
3744a24e-7a87-4d54-b76c-767b33ddd547
4
public static void preLoadDependencies(String folder) throws IOException { File[] fileList = new File(folder).listFiles(); List<File> directoryList = new ArrayList<File>(fileList.length); // Load jar and get directory for(File file : fileList) { if(file.isDirectory()) { directoryList.add(file); } els...
ffaaf4de-9ed7-4378-a23a-a890258e3e60
6
public static boolean versionIsEquivalentOrNewer(String oldVersion, String newVersion) { //Get the list of version numbers for the current version List<Integer> newVersionBreakout = new ArrayList(); for (String versionNumber : newVersion.split("\\.")) { newVersionBreakout.add(Integer...
4ef1e095-f003-467e-9111-72ffb901c309
3
public void mouseWheelMoved(MouseWheelEvent me) { int notches=me.getWheelRotation(); int vc=vscrollbar.getValue(); final int ADJUST=4; // Down if (notches>0) { vc=vc+ADJUST; vscrollbar.setValue(vc); } // Up else if (notches<0) { if (vc>ADJUST) vc=vc-ADJUST; vscrollbar.setValue(v...
9936d8b3-1309-42c7-a905-a081d2ba3bb1
5
public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { PageContext pageContext = null; HttpSession session = null; ServletContext application = null; ServletConfig config = null; JspWriter out = null; Object page ...
a5dbae02-9258-4dd8-9062-831620d6f073
0
public void setStatus(String status) { this.status = status; }
39c95328-8b40-4094-80d8-de6548ba55b0
5
public static void sort(Comparable[] a) { int h = 1; while (h < a.length / 3) { h = 3 * h + 1; // Knuth sequence } // h-sorting the array while (h >= 1) { for (int i = h; i < a.length; i++) { for (int j = i; j >= h && less(a[j], a[j - h]); ...
a9433d39-d0a9-47c1-905f-cfa215159ee2
6
@Test public void test() { Logger.log("regex is " + regex); try { FileOutputStream stream = new FileOutputStream("res/testdata/AutomatonSerialization/automaton.ser"); ObjectOutputStream oStream = new ObjectOutputStream(stream); oStream.writeObject(matcherAutomaton); Logger.log("Wrote Automaton"); oS...
8909635e-3acf-4c02-99a0-ce3cd1871a99
7
private void setupSecurity() { if (Modeler.hostIsLocal) return; if (Modeler.runOnCD) return; File file = new File(propDirectory, "mw2.policy"); if (!file.exists()) { PrintWriter writer = null; try { writer = new PrintWriter(file); } catch (FileNotFoundException e) { e.printStackTrace(); ...
584851e6-defe-4cd6-acee-bdf4af4f3896
8
private void printResults(ClusteringResults<Double> results, Map<Integer,String> statesMap, Map<Integer,String> clustersMap) { ClusteringExternalPerformances<Double> performances = new ClusteringExternalPerformances<Double>( statesMap, clustersMap); performances.addResults( results.getClusterizedTrajectories())...
9f768b86-eaab-4d7c-a03e-5b6e4b48656f
4
private void modifyExtensionRefsetMember(RefexChronicleBI<?> memberChron) throws ContradictionException, InvalidCAB, IOException { RefexVersionBI<?> mem = memberChron.getVersion(vc); RefexCAB bp = mem.makeBlueprint(vc, IdDirective.PRESERVE, RefexDirective.INCLUDE); if (bp.getMemberUUID() == null) { bp.setMemb...
88110f28-83f9-4203-9b6e-3a05a1bc1028
5
public Brick10(int gameAreaStartX, int gameAreaStartY, int brickSize, int brickIndex, BufferedImage brickImage) { super(brickSize, brickIndex, brickImage); switch(brickIndex) { case 1: this.row = 1; this.column = 9; this.relativeRow ...
854798f3-130f-477a-ab5b-8dceaae0c537
7
public void act() { if (timer == 0) { if(foundAvatar()) { timer++; delta = getFun(); } } if (timer > 0) timer++; if (timer == 30) { if (delta == 10) { ...
a322422b-f3f0-4657-a81d-05a548f68d51
3
@Override protected void printScriptContents() { int nrOfClusters = clusters.size(); for (int i = 0; i < nrOfClusters; i++) { String rgbColourSpec = getRgbColourSpec(i); if (i == 0) { writer.println(getClusterLine(rgbColourSpec, i, 0)); } else if (i == (nrOfClusters - 1)){ writer.println(ge...
40f1dd59-d82d-479b-a6af-30abdbff13da
1
public JScrollPane getGUI() { JPanel p999; GroupLayout groupLayout; GroupLayout.ParallelGroup horizontalGroup_P; GroupLayout.SequentialGroup verticalGroup_S; submitButton=new JButton("Create Section"); submitButton.addActionListener(this); updat...
7da1514f-d352-4400-ab0b-081ae4e08521
4
@Test public void deleteOneTest() { final int n = 1_000; Array<Integer> arr = ObjectArray.empty(); for(int k = 0; k < n; k++) { for(int i = 0; i < k; i++) { final Array<Integer> arr2 = arr.remove(i); final Iterator<Integer> iter = arr2.iterator(); for(int j = 0; j < k - 1; j+...
b99673b1-77a6-4903-9e97-3e0ad20fd090
8
public FrmAlumnosFoto() throws SQLException { super("Alumnos"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 554, 396); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); JPanel pnlAlumno = new JPanel(); pnlAlumno.setBor...
6d4338ea-3dc3-4783-ac97-4793a269b5ac
4
private boolean save_processor_prefs(Preferences prefs) { // // markdown processor preferences // // First, remove any old processors from the preferences. try { Preferences md_prefs = prefs.node(MD_PROCESSORS_NODE); md_prefs.removeNode(); md_prefs.flus...
a62f3a22-32f4-4bda-941b-f8dc05a57bff
2
private static int findGreatestX(Graph g) { DynamicArray vertices = g.getVertices(); Vertex v = (Vertex) vertices.get(0); int greatest = v.getX(); for (int i = 0; vertices.get(i) != null; i++) { v = (Vertex) vertices.get(i); if (v.getX() > greatest) { ...
18fee483-29d0-472c-a064-77cba11cba81
0
@Override public String getLoggerName() { return loggerName; }
2d0e314d-eb63-48aa-8da8-51a9cc2c9310
3
@Override public void close() { try { if (!con.isClosed() || !con.isValid(0)) return; this.con.close(); } catch (SQLException e) { // ignore } }
d8516711-b1ac-4eec-a62b-f090d1d36d1f
1
public String getSprite() { if(sprite == null) return null; return sprite.filename; }
cdff0620-4c0a-419b-8a04-506296d5d470
8
public List<Integer> Sort(List<Integer>[] classifyErrorNo, int numInstances, List<Double> correctRateArray) { int i, j; double[][] CFs = new double[classifyErrorNo.length][classifyErrorNo.length]; // 计算分类器之间的互补指数 for (i = 0; i < classifyErrorNo.length; i++) { for (j = 0; j < classifyErrorNo.length; j++) {...
bb234be6-50a0-443f-b63c-095915896bde
9
public static void main(final String[] args) throws Exception { int i = 0; int flags = ClassReader.SKIP_DEBUG; boolean ok = true; if (args.length < 1 || args.length > 2) { ok = false; } if (ok && "-debug".equals(args[0])) { i = 1; flag...
fc28ba92-3c78-4f98-8dbb-3a2cce6cf9cf
5
private static String replace(String value) { if (null == value) { return value; } String newValue = value; int openBrace = 0; if (-1 != (openBrace = value.indexOf("{", openBrace))) { int closeBrace = value.indexOf("}", openBrace); if (closeBra...
f63fdf32-f43e-4242-ba00-bda9ebdf0281
4
@Override protected boolean judgeResult(CardGroup cardGroup) { cardGroup.doSort(CardGroupSortType.DECREASE); boolean result = true; int score = cardGroup.getCard(0).getType(); for(int i = 0; i <cardGroup.size()-2 ; i += 3 , score --) { if( !cardGroup.subCardGroup(i, i + 3).isSame() || ((i + 3)<cardGroup.siz...
3024442a-7c0a-483a-96c8-feefb782a8e2
5
private void removeEdgeNodes(ArrayList<Coordinate> neighbours){ for(int i = 0; i < neighbours.size(); i++){ if(neighbours.get(i).getX() < 1 || neighbours.get(i).getY() < 1 || neighbours.get(i).getX() >= this.columns - 1 || neighbours.get(i).getY() >= this.rows - 1){ neighbours.remove(i); i--; }...
ed65e9c3-8103-471a-bafa-dd5da22fe68a
4
public void connect(Direction direction, Direction otherTileDirection, Tile otherTile){ if (hasDirection(direction) && otherTile.hasDirection(otherTileDirection)){ throw new IllegalArgumentException("Trying to connect two existing edges"); } if (hasDirection(direction)){ Edge connector = getEdge(directio...
12ee5813-2cdb-450a-8bc5-20b17e596e98
4
private Boolean askAnswer(Double answer) { //TODO Ask user for answer; if correct, then continue showing card /* JOptionPane.showInputDialog(this, "Answer " +tempnum1.getStrValue() + " " + ((OperationCard)(this.getComponent(1))).getOperation() + " " + tempnum2.getStrValue() + " = ", "Answer", JOptionP...
19fc0e3d-aedc-4760-b394-5ba39c9b4480
2
private void processMousePress(MouseEvent e) { int buttonCode = e.getButton(); Point clickPoint = e.getPoint(); if (buttonCode == MouseEvent.BUTTON1) { gameController.handleClick(clickPoint); } else if (buttonCode == MouseEvent.BUTTON3) { gameController.handleRig...
5c5661e1-49e1-4e96-bede-a1b0a6b1b750
2
private String buildSimpleKey(Object[] args, ParsedExpression parsedExpression, Method[] getterMethods, Integer[] parameterIndexes) { Assert.notNull(parsedExpression, "ParsedExpression的值不能为null"); String oriKey = parsedExpression.getOriginalExpression(); List<String> parameterNames = parsedExpression.getParam...
1eb0ada1-705a-4cb2-b3b7-2ae130013af6
7
public static void main(String[] _args) { final int NUMELEMENTS = 40; float[] inArray = new float[NUMELEMENTS]; float[] outArray = new float[NUMELEMENTS]; // initialize inArray for (int i=0; i<NUMELEMENTS; i++) { inArray[i] = (float)i; } String sourceFileName = "Squares.hsail"; String squaresSour...
d6021c34-b2db-4c63-8c34-c9db79c55cad
5
public int threeSumClosest(int[] num, int target) { // Start typing your Java solution below // DO NOT write main() function int n = num.length; Arrays.sort(num); int min = Integer.MAX_VALUE; int res = 0; for (int i = 0; i < n - 2; i++) { int l = i + 1; int r = n - 1; while (l < r) { int tmp ...
fe9c2891-3d2c-4b7e-8328-5440270893ed
6
public void drawModel(Graphics2D graphics, Actor actor, Color color) { Model model = actor.getModel(); if (model == null || !model.isValid()) return; Vec3[][] vectors = model.getVectors(); graphics.setColor(color); int gx = actor.getLocation().getGx(); int gy = actor.getLocation().getGy(); for (Vec3...
029461ed-3405-4860-b95c-08d68d0fa794
8
public boolean povMoved(Controller controller, int povCode, PovDirection value) { MyInput.setKey(Input.LEFT, false); MyInput.setKey(Input.RIGHT, false); MyInput.setKey(Input.UP, false); MyInput.setKey(Input.DOWN, false); switch(value){ case east: MyInput.setKey(Input.RIGHT, true); break; case nor...
35fce237-2d3b-497d-9c98-0d53e3c57b0c
4
private void PopulateDoctorDoctorDropDown(String id) { try { ResultSet rs; if(this.pageLoadMode == PatientLoadMode.STAFF) { rs = dbQuery.Staff_GetAllDoctorInfo(id); } else if(this.pageLoadMode == PatientLoadMode.DOCTOR) { rs = dbQuery.Doctor_GetDoctorList(id); } else return; ...
ef00ce77-a536-44a9-9d6d-5f559a827dac
9
public static Position findElementWrong(int[][] matrix, int elem) { if (matrix.length == 0) { return new Position(-1, -1); } int low, high, mid = 0; low = 0; high = matrix.length - 1; while (low <= high) { mid = (low + high) / 2; if (matrix[mid][0] == elem) { return new Position(mid, 0); ...
dd95c95e-165d-44c0-8eab-145ffa0b2694
6
static final public void bloc() throws ParseException { label_3: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case CONST: ; break; default: jj_la1[5] = jj_gen; break label_3; } declConst(); } label_4: while (true) { switch...
b898d857-ff53-4e6c-8be0-8a147fb21b30
2
synchronized Object getValue() { while (value == NULL) { try { wait(); } catch (InterruptedException ex) { throw new RuntimeException(ex); } } return value; }
1c5dddc7-bf53-4b2e-834c-aa0127c4a4e8
8
public synchronized void write(K key, V value) throws IOException { boolean nullKey = key == null || key instanceof NullWritable; boolean nullValue = value == null || value instanceof NullWritable; if (nullKey && nullValue) { return; } ...
b4bdc2e8-b69c-47d2-af16-6feab4670258
3
private void initComponents() { searchQuery = new JTextField(); filter = new JButton(); jScrollPane1 = new JScrollPane(); widgetInformation = new JTextPane(); jScrollPane2 = new JScrollPane(); widgets = new JTree(); setDefaultCloseOperation(WindowConstants.DISPO...
c9f4266b-fd52-4ab2-8da9-14768578b3d1
0
public final String getServer() { return _server; }
73238369-6d94-4e33-99bc-10a123c10db6
2
private void makeGroups(File groupFile) { Scanner s = makeScanner(groupFile); String groupName; ArrayList<Integer> channels = new ArrayList<Integer>(); while (s.hasNext()) { // checks to see there is a token in the input groupName = s.next(); // next() gets the next token while (s.hasNextInt()) { ...
a1da18dd-138f-4627-be5b-f5f476d55641
4
public final void onAdded(Level level, int x, int y, int z) { for(int var7 = x - 2; var7 <= x + 2; ++var7) { for(int var5 = y - 2; var5 <= y + 2; ++var5) { for(int var6 = z - 2; var6 <= z + 2; ++var6) { if(level.isWater(var7, var5, var6)) { level.setTileNoNeig...
77a21f71-e244-4682-9273-a350ce7c3e18
2
private void jTxtFldFindKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTxtFldFindKeyTyped // TODO add your handling code here: try { String sql = "SELECT * FROM clientes WHERE email LIKE ? "; Connection conn = Conexion.GetConnection(); conn.setAutoCommit(fa...
c6ac7938-5b5c-4a47-9821-3319c8f0f850
4
public boolean checkSession(xAuthPlayer player) { if (!plugin.getDbCtrl().isTableActive(Table.SESSION)) return false; Connection conn = plugin.getDbCtrl().getConnection(); PreparedStatement ps = null; ResultSet rs= null; try { String sql = String.format("SELECT `ipaddress`, `logintime` FROM `%s` WHERE...
035f6eec-036f-4fbe-9f37-1986f86be92d
2
@SuppressWarnings("unchecked") public static boolean write(String module, String className, int id, JSONObject json) { boolean success = false; try { String filePath = "assets/data/" + module + "/" + className + "_" + id + ".json"; final File file = new File(filePath); final File parent_director...
4ef332aa-5964-4ea0-850b-13ab4d6edc42
2
public void update(){ if (TE != null){ TE.update(); } if (AIE != null){ AIE.update(); } }
93d48a8f-c041-4eca-a534-79d0f6a33cc5
1
public final EsperParser.condition_return condition() throws RecognitionException { EsperParser.condition_return retval = new EsperParser.condition_return(); retval.start = input.LT(1); Object root_0 = null; EsperParser.conditionaloperator_return conditionaloperator38 =null; ...
9d8925d3-f6fe-42bc-a156-53c1374316d6
6
public ParseTreeNode rexp2() throws SyntaxError { ParseTreeNode node = new ParseTreeNode("<rexp2>"); if (accept('(')) { node.addChild(String.valueOf('(')); node.addChild(rexp()); if (accept(')')) { node.addChild(")"); } node.addChild(rexp2Tail()); return node; } else if (isReChar()) { // ...
e0be4553-55f8-43e3-a8d6-40378f94337a
1
public List<FieldVisit> getFieldVisit() { if (fieldVisit == null) { fieldVisit = new ArrayList<FieldVisit>(); } return this.fieldVisit; }
29968500-2deb-4920-913a-f9f2e0c76588
8
public void clientRead(){ this.bnum = new BlockNumber(); this.bnum.increment(); byte[] block = bnum.getCurrent(); this.counter = 1; try { BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(dir)); for(;;){ int length; byte[] packet = getBlock(bnum.getCurrent()); ...
8aa1c424-3dc8-4961-be60-9ca0c246c0cd
8
private void markSubroutineWalk(final BitSet sub, final int index, final BitSet anyvisited) { if (LOGGING) { log("markSubroutineWalk: sub=" + sub + " index=" + index); } // First find those instructions reachable via normal execution markSubroutineWalkDFS(sub, in...
3ca85f8e-c50a-4220-aec0-41469256d656
9
public Move getMove(IBoard board) { Entry<Pair<IBoard, Move>, Double> bestEntry = null; double costOfMove = 0.0; for (Entry<Pair<IBoard, Move>, Double> entry : qmatrix.entrySet()) { double cost = entry.getValue(); //Normal Moves if (isSameBoard(board, entry) && costOfMove < cost && cost <= 100.0 && !spaw...
5855f367-24f2-49e9-992c-8adbe9d81c95
1
public Entity loadTexture() { try { texture = TextureLoader.getTexture("PNG", new FileInputStream("./res/" + unlocalized_name + ".png")); } catch (IOException e) { e.printStackTrace(); } return this; }
afeee56f-e065-483c-b038-f85636f3dff5
6
public 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://download.or...
2ff7d4e4-0a89-4dfb-95f9-6a409e15dc46
6
public static void setSignature(final String dir, List<Class<?>> classesList) throws IOException { try (PrintWriter output = new PrintWriter(new File(dir, "signature.tsv"))) { for (int i = 0; i < classesList.size(); ++i) { boolean flag = false; for (int j = 0; j < CLA...
32e31bde-eb19-45ae-968b-1c8cfd960636
9
public static void crearGF(){ int primitivepol=0,maximo=0; gfextend=(int) (Math.pow(2, bits)-1); // gfextend funciona como mascara maximo=(int) (Math.pow(2, (bits-1))-1); gf=new int[gfextend]; inv_alfa=new int[gfextend+1]; inv_gf=new int[gfextend+1]; switch(bits){ case 3: primitivepol=3;break; ca...
5cbbbc25-6c99-45e2-857e-423e8f092a27
6
private void jump1() { int tiempo_salto = 1; while (true) { int y = Juego.jFlappy.getLocation().y; int x = Juego.jFlappy.getLocation().x; try { Thread.sleep(getVelocidad()); if (!isDetenerSalto1()) { tiempo_salto = t...
2b5eabe4-ed82-4f47-a15b-bb01ca630efa
7
@Override public void go(){ control = ""; if(interpolation == false) { if (fileScanner.hasNext()) { control = fileScanner.next(); switch (control) { case "control": movex = fileScanner.nextInt(); movey = fileScanner.nextInt(); ang = fileScanner.nextInt(); scale = fileScanner....
5767f5fc-f49c-49e7-a5a7-ab795c241aa6
3
public double[] do64FFTHalfSymbolBinRequest (CircularDataBuffer circBuf,int start,int samples,int bin0,int bin1) { double vals[]=new double[2]; int a; double datar[]=new double[FFT_64_SIZE]; // Get the data from the circular buffer double samData[]=circBuf.extractDataDouble(start,samples); for (a=0;a<datar....
c538d514-621c-4f4b-be68-e8ec60a746d4
2
public List<VgerItemData> getItems() { makeConnection(); try { items = new JdbcTemplate( ds ).query( ITEMS_QUERY, new Object[] { getBibID() }, new VgerItemDataMapper() ); populateMap(); /*for ( String theKey : details.keySet() ) System.out.println( theKey );*/ ...
c7e66689-3a62-4de7-b5c8-a76afa537ceb
2
@Override public boolean isRoomInInventory() { for (int i = 0; i < getInventorySize(); i++){ if (getItemInSlot(i) == null){ return true; } } return false; }
6502c2b0-db65-4302-9ca7-5e6a57388b1b
0
public void setUser(User user) { this.user = user; }
bb68b7b6-a2cf-4b83-817c-b8a990fda106
9
public void calcTargetString() { int whatToShow = getWhatToShow(); switch (whatToShow) { case DTMFilter.SHOW_COMMENT : m_targetString = PsuedoNames.PSEUDONAME_COMMENT; break; case DTMFilter.SHOW_TEXT : case DTMFilter.SHOW_CDATA_SECTION : case (DTMFilter.SHOW_TEXT | DTMFilter....
1e2d9892-d0e3-4c37-b462-6c3025a09261
8
public static void main(String[] args) { String s = "sfA 23sffF F@252&)(*t42+&^%$GsfF"; char [] c = s.toCharArray(); int l = s.length(); int c_n = 0; int s_n = 0; int d_n = 0; int o_n = 0; for (int i = 0; i < l ; i++) { if(c[i]>='A'&&c[i]<='Z'...
fbd3bb91-3ff7-4f02-91ca-33079e79f56d
2
public void printList(Node node) { if(node == null) { System.out.println("\nItems: " + items); return; } if(node.prev != null) System.out.print(node.prev.frequency + ":"); System.out.print(node.frequency + " -> "); printList(node.next); }
0ec3a3ef-eaaf-458f-9f68-9930ce79d317
5
private void copyTree(VCNTreeItem sourceItem, Object destinationItem, Integer index) { assert sourceItem != null && destinationItem != null; VCNTreeItem newItem; if (destinationItem instanceof Tree) { if (index != null) { newItem = new VCNTreeItem((Tree) destinationItem, SWT.NONE, index); } else {...
e35809a6-9a89-4a71-9fd2-1ee1ec95a6b4
8
public Property getOrCreateBlockIdProperty(String key, int defaultId) { if (configBlocks == null) { configBlocks = new boolean[/*Block.blocksList.length*/ 256]; for (int i = 0; i < configBlocks.length; ++i) { configBlocks[i] = false; }...
5b45c620-52c2-4e50-88ce-aea31273bb59
8
private void initializeValues(int[][] map, boolean hasBomb, boolean inDangerPath) { for (int y = 0; y < map.length; y++) { for (int x = 0; x < map[0].length; x++) { if ((!hasBomb || inDangerPath) && map[y][x] > 0) ClosedSet.add(new Point(x, y)); } ...
34cbd710-cda5-4508-a599-94539ebadc8a
8
public static File getMstxHeadFile(int tid, String fileName) { File file = null; Connection con = DBUtil.getConnection(); Statement st = null; ResultSet rs = null; try { st = con.createStatement(); String sql = "select tdata from mstx_head where tid='" + tid + "'"; System.out.println("SQL: " + sql); ...
e9d79c29-f027-472f-9553-d16ebbf11864
9
private void spinner_y2StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinner_y2StateChanged if(hitbox_index_selected!=-1 || click_target_flag) { click_target_flag=true; if(hitbox_index_selected!=-1) { int i=0; for(Node hitboxes_node=current_fr...
11505200-c139-4045-a060-fb0ab5adc3e9
6
private void setupMyCarGeometricInfo() { if (carsGeometricInfos != null && myCarColor != null) { for (GameInit.Race.Car carGeometricInfo : carsGeometricInfos) { if (carGeometricInfo != null && carGeometricInfo.id != null && carGeometricInfo.id.color.equals(myCarColor)) { ...
b8cbb837-8d8e-4579-9ddc-c5cbdcebe247
6
private void checkValues() throws PodCastCreationException { m_logger.info("Checking variables"); if(m_fileToCreate == null || m_directoryToTraverse == null || m_urlSuffix == null || m_httpRoot == null) throw new PodCastCreationExc...
398fb699-9be7-46c5-bbbe-041f076af994
2
public static void main(String[] args) { Scanner in = new Scanner(System.in); int testCases = in.nextInt(); while (testCases > 0) { long n = Long.parseLong(in.next()); if (isFibo(n)) { System.out.println(IS); } else { System.out.println(IS_NOT); } testCases--; } }
36290c70-e3cb-4548-87f5-6bb5bd957f31
7
private void writePrint(Print print) { boolean flagAttribute = false; writer.println(); if (null != print.getAttribute() && !"".equals(print.getAttribute())) { flagAttribute = true; } writer.println(); String expression = null; if (flagAttr...
dfdd5b9d-cecd-45f1-ae3b-391ef8defcf3
8
public Map<String, Object> getCellStyle(String name, Map<String, Object> defaultStyle) { Map<String, Object> style = defaultStyle; if (name != null && name.length() > 0) { String[] pairs = name.split(";"); if (style != null && !name.startsWith(";")) { style = new Hashtable<String, Object>(style...
7f0112fc-427f-4e1c-abe8-35fd80d48400
2
private void assertFlushOfSize(List<Card> cardList, int number) { assertEquals(number, cardList.size()); Suit expectedSuit = null; for (Card card : cardList) { if (expectedSuit == null) { expectedSuit = card.suit; continue; } assertEquals(expectedSuit, card.suit); } }
fc23ee27-16db-4443-bdda-0787e5d3859e
4
public JSONObject toJSONObject(JSONArray names) throws JSONException { if (names == null || names.length() == 0 || length() == 0) { return null; } JSONObject jo = new JSONObject(); for (int i = 0; i < names.length(); i += 1) { jo.put(names.getString(i), this.opt(i...
c9487fe9-9e0e-4c0e-b86b-662babd75142
5
@EventHandler(priority = EventPriority.LOWEST) public void onSignChange(SignChangeEvent e){ File fichier_language = new File(OneInTheChamber.instance.getDataFolder() + File.separator + "Language.yml"); FileConfiguration Language = YamlConfiguration.loadConfiguration(fichier_language); Player player = e.getPlaye...
2fd94391-aa76-4642-9423-7c4294e0c567
3
IndexToTextTranslator(){ try { //first find the number of names with a line counter BufferedReader reader = new BufferedReader(new FileReader("../index/text.txt")); int shiplines = 0; while (reader.readLine() != null){ shiplines++; } reader.close(); //initiate the destination arrays ...
0d30e642-194b-480e-8784-0d000bcbdbb5
2
public Expression negate() { if (getOperatorIndex() == LOG_NOT_OP) { if (subExpressions != null) return subExpressions[0]; else return new NopOperator(Type.tBoolean); } return super.negate(); }
8a825df2-2748-49fd-b363-6ced551db3a3
6
public Object getValueAt(int row, int column) { Object value = null; SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy HH:mm"); Reception reception = receptions.get(row); if (reception != null) { switch (column) { case 0: value = reception.getId(); break; case ...
69281318-170a-496e-bf20-4fc86984c387
1
@Override public Item swap(Item newItem) { Item temp = null; try{ temp = armorItem; armorItem = null; armorItem = (HeadArmor) newItem; return temp; }catch(Exception e){ armorItem = (HeadArmor) temp; return newItem; } }
8460a0dc-a403-4c63-906e-9445d3b90da0
9
@EventHandler(priority = EventPriority.HIGHEST) public void blockBreak(BlockBreakEvent event) { //System.out.println("block break event"); if (!this.p.getOn().get(event.getPlayer().getWorld())){ return; } if (event.getBlock().getType() == Material.IRON_DOOR_BLOCK && event.getBlock().getRelative(0, -1, 0).ge...
ea3418c7-7dab-4f0e-94f3-9a25718c6456
3
public BigDecimal[] getTaxTable(int bracket){ BigDecimal table[] = new BigDecimal[8]; try{ String sql = "Select tax, taxpercentover, z, sme, s1me1, s2me2, s3me3," + "s4me4 from taxtable where bracket = " + bracket + ";"; Statement st = con.createStatement(); ResultSet rs = st.executeQuery(sql); i...
a94e512a-b86e-4755-a092-5c04b77924fc
3
public void visitMethodInsn( final int opcode, final String owner, final String name, final String desc) { if (opcode == INVOKEINTERFACE || opcode == INVOKEDYNAMIC) { minSize += 5; maxSize += 5; } else { minSize += 3; ma...
d9b503de-8975-40fc-8509-db3901c2d40b
0
public SimpleVector getVelocity() { return velocity; }