method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
b7798f47-324d-44c7-bb0d-e3940a2de7ce
4
public void correctPosition(Positioned other) { if (collisionType(other)[0] == ApproachFrom.LEFT) setPos(other.leftBorder() - getWidth(), Y()); if (collisionType(other)[0] == ApproachFrom.RIGHT) setPos(other.rightBorder(), Y()); if (collisionType(other)[1] ==...
3bd1dcba-b0c1-4cf2-af73-6ea1fc7c0de0
1
@Test public void function_test() { try{ double a=5.0; GaussCFunction gc= new GaussCFunction(a); double result= gc.function(a); double exp =3.593E-27; Assert.assertEquals(exp,result,0.0001); } catch (Exception e) { // TODO Auto-generated catch block fail("Not yet implemented"); } }
1a544f14-74d3-433e-a0dc-41d63ce6b13b
7
public static int lookAhead(FlaggableCharacterString target, int start, int count, Condition condition) { int index = start; while(0 <= index && index < target.size() - 1 && !condition.applies(target.get(index))) { index++; } // was index < target.size() while(count > 0 && index < target.size() - 1) { ...
2e087172-b376-479f-b2a3-cbc4c9a3b14d
3
private ArrayList<Actor> obtenerActores(ArrayList<String> listaIdActores){ ArrayList<Actor> actores = new ArrayList(); for (String idActor : listaIdActores) { for (Actor actor : misActores) { if (actor.obtenerNombre().equals(idActor)) actores.add(...
74fc0b8c-0847-4b7a-8796-0f35a4b872a6
9
private void foundTwoPair() { rank = Rank.TWOPAIR; Card.Rank firstPair = null; Card.Rank secondPair = null; int firstOrd = -1; int secondOrd = -1; for (int i = ranks.length - 1; i >= 0; i--) { Card[] value = ranks[i]; if (value == null) continue; ...
418a1b92-a934-4ac3-8399-5a0251430cb7
4
public void defaultBookList (LYNXsys system, int page) { // method to display all books in search list displayedSearchResults.removeAll(displayedSearchResults); // don't know if I need this here... for (int i = 0; i < system.getBooks().size(); i ++) { // loop through arraylist of books // add each book as a sear...
ffbda05f-4603-43b1-a080-f2cb06b4e6e8
3
public int getMax(){ int res = 0; for (int i = 0 ; i < taille; i++){ for (int j = 0 ; j < taille; j++){ res = ( res < getValue(i,j))? getValue(i,j) : res; } } return res; }
d6c3a627-e4b0-4586-a30a-a67f782efe63
0
public ThreadSynchronized1(Example e1) { this.example = e1; }
12d08ffe-c9c3-4011-b337-1a0da769dd0f
8
public static List<Integer> getMstxAdsGpid(int id) { ArrayList<Integer> result = new ArrayList<Integer>(); Connection con = DBUtil.getConnection(); PreparedStatement pstmt = null; ResultSet rs = null; try { pstmt = con.prepareStatement("select gpid from mstx_ads_image where gid=?"); pstmt.setInt(1, id);...
ffdac8ea-b088-4cb1-85a6-343c5883d16f
1
private void writeAttributes(final DataOutputStream out) throws IOException { out.writeShort(attrs.length); for (int i = 0; i < attrs.length; i++) { out.writeShort(attrs[i].nameIndex()); out.writeInt(attrs[i].length()); attrs[i].writeData(out); } }
d42e21c6-5628-4993-a872-095f11c8edd3
5
final int[][] method3047(int i, int i_3_) { anInt9192++; int[][] is = ((Class348_Sub40) this).aClass322_7033 .method2557(i_3_ ^ 0x5d41e287, i); if (((Class322) ((Class348_Sub40) this).aClass322_7033).aBoolean4035) { int[] is_4_ = this.method3048(i, 633706337, 0); int[] is_5_ = is[0]; int[] is_6_ =...
628a471f-3d92-4182-b0bd-f169f1ca519a
0
public String getDepartmentName() { return departmentName; }
35691d6b-87e7-488f-b809-9b0c7cff195c
7
private static void runTool(String dataStr, String datasetStr, String output, int numPartitions) throws IOException { Configuration conf = new Configuration(); Preconditions.checkArgument(numPartitions > 0, "numPartitions <= 0"); // make sure the output file does not exist Path outputPath = new Pa...
bac01b1c-16fb-4d9d-8911-564549d24b1d
2
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HttpSession session = request.getSession(); String userName=(String)session.getAttribute("USERNAME"); PrintWriter out = response.getWriter(); if (userName==null){ res...
360f8c8c-7763-4097-bf6c-2d01189cbaf7
9
public synchronized void maj(String action) { if (!mep) { switch (action) { case "B": descendrePiece(); if(pieceCourante.isBloque()) { int nb_lignes = grille.effacerLigne(); Ca...
cd5884fe-5bb9-426a-823e-123985440060
6
public void newGame() { String s; String name = ""; s = "Welcome to Ye Olde RPG!\n"; s += "\nChoose your difficulty: \n"; s += "\t1: Easy\n"; s += "\t2: Not so easy\n"; s += "\t3: Beowulf hath nothing on me. Bring it on.\n"; s += "Selection: "; System.out.print( s ); difficulty = InputValidator.nextValidIn...
4b290113-44ce-4e7f-95ba-54aeae0a399c
4
public static void main(String[] args) throws Exception { HamaConfiguration conf = new HamaConfiguration(); BSPJob bsp = new BSPJob(conf); // Set the job name bsp.setJobName("Standard Multiply"); bsp.setBspClass(MultiplyBSP.class); bsp.setJar("multiply.jar"); if (args.length < 7 || args.length > 9) { ...
d83f569e-1f35-45bf-93d0-fec0b783fe0a
8
@Override public int castingQuality(MOB mob, Physical target) { if(mob!=null) { if(mob.isInCombat()) return Ability.QUALITY_INDIFFERENT; final Room R=mob.location(); if(R!=null) { if((R.domainType()&Room.INDOORS)>0) return Ability.QUALITY_INDIFFERENT; if((R.domainType()==Room.DOMAIN_O...
db218506-18ec-41c3-981b-af73ae280669
0
protected void onSetPrivate(String channel, String sourceNick, String sourceLogin, String sourceHostname) {}
fdf2f6b9-b675-4e0f-a9b3-9273db9b9752
1
@Override public void run() { while (!running) { yield(); } super.run(); }
a15b8fb0-c38c-40dc-acda-17141f0a54d1
1
public void rebuild() { cachedChildrens.clear(); TreeModelListener[] ls; synchronized (listeners) { ls = (TreeModelListener[]) listeners .toArray(new TreeModelListener[listeners.size()]); } TreeModelEvent ev = new TreeModelEvent(this, new Object[] { root }); for (int i = 0; i < ls.length; i++) ls...
c3340691-26e5-4884-a842-8dc1545cb508
2
public static void clearConsole() { try { String os = System.getProperty("os.name"); if (os.contains("Windows")) { Runtime.getRuntime().exec("cls"); } else { Runtime.getRuntime().exec("clear"); } } catch (Exce...
934187cc-d059-4bc4-ad23-07c78f70b77d
3
public void run() { while (true) { if (animationEnabled()) { repaint(); } try { Thread.sleep(FRAME_DELAY); } catch (InterruptedException e) { throw new RuntimeException(e); } } }
2555a8eb-5e36-4651-a626-4a3a0d011e6c
8
private Series <Target> sampleTargets( Object key, Target t, World world, int limit, Series sampled ) { for (int n = limit / 2 ; n-- > 0 ;) { final Target v = randomMatchNear(key, t, -1) ; if (v == t || v == null || v.flaggedWith() != null) continue ; sampled.add(v) ; v.flagWith(sample...
42aa0f69-4daf-4d9e-b61a-769e0467ec9c
4
public boolean isLowerTriagonal(){ boolean test = true; for(int i=0; i<this.numberOfRows; i++){ for(int j=0; j<this.numberOfColumns; j++){ if(i>j && this.matrix[i][j]!=0.0D)test = false; } } return test; }
e913bf7c-ebfe-4d83-a265-8ced9df44e6e
5
private PointList getQuarter(final double minX, final double maxX, final double minY, final double maxY) { final PointList result = new PointList(this.size(), minX, maxX, minY, maxY); for (final float[] p : this.points) { if (p[0] >= minX && p[0] < maxX && p[1] >= minY && p[1] < maxY) { result.add(p[0], p[1]...
8d75d9a9-db32-4626-824b-4e7c0a01cbfb
2
public void addLevel(Level level){ foundLevels.put(level.id, level); ArrayList<Entrance> awaiting =awaitingEntrances.get(level.id); if(null != awaiting){ for(Entrance e : awaiting){ e.target = level; } awaitingEntrances.put(level.id, null); ...
62dc21db-6254-450f-8280-0c5456733b1e
3
public void visit(final String name, final Object value) { if (values == null) { values = new ArrayList(this.desc != null ? 2 : 1); } if (this.desc != null) { values.add(name); } values.add(value); }
dc977b17-bd3f-4250-84a3-05e37873661c
0
public double getTicketPrice() { return ticketPrice; }
b7423672-614a-4d51-9449-87e3dbc1e49a
2
@Override public String toString() { StringBuilder sb = new StringBuilder(); for (int i = 0; i < getUserInfo().size(); i++) { sb.append(i + 1).append(". ").append(getUserInfo().get(i)).append("\n"); } return sb.length() > 0 ? sb.toString() : "No users known.\n"; }
df48ea42-079d-4d58-b0dc-2b5f0234b344
8
public boolean iterate() { List<Board> allBoards; Iterator<Board> iter; allBoards = new ArrayList<Board>(states.keySet()); // Can't use the keyset directly because of iter = allBoards.iterator(); // ConcurrentModificationException! while(iter.hasNext()) { Board board = iter.next(); if(states.c...
37161427-0248-4134-8bdd-df8aca4e46fb
8
static void BuildIndex(String datafile, int mode) throws Throwable { //init the index for(int i = 0;i < num_ip; i++) jclient.initServer(i, Index.BUILD); BufferedReader buf = new BufferedReader(new InputStreamReader(new FileInputStream(datafile))); String line; int id = 0; while ((line = buf.readLi...
a3c132f2-ec43-4f3f-818b-2046727a6c30
3
public void actionPerformed(ActionEvent e) { if (e.getSource().equals(save)) { /*System.out.println(getOutput()); } else{ /**/ int option = fc.showSaveDialog(this); if (option == JFileChooser.APPROVE_OPTION) { File file = fc.getSelectedFile(); try { FileWriter ot = new FileWriter(file.getA...
699ca11b-8591-46f5-af93-5c833aaf9e7c
2
public static JPanel createAboutPanel() { if (ABOUT_PANEL_CLASS != null) { try { return ABOUT_PANEL_CLASS.newInstance(); } catch (Exception exception) { exception.printStackTrace(); } } return null; }
9e92f165-3f72-413f-acd0-71b57f49a075
2
public void startServerBroadcast() { // send broadcast and start as response listener if(running) return; running = true; byte[] buffer = initCode.getBytes(); try { start(); InetAddress broadcastAddress = InetAddress.getByName("255.25...
08394b50-ce82-49be-86e7-0ac73571a6ef
8
@Override public void visitBinaryExpression(JsBinaryOperation binaryOperation) { JsBinaryOperator operator = binaryOperation.getOperator(); JsExpression arg1 = binaryOperation.getArg1(); boolean isExpressionEnclosed = parenPush(binaryOperation, arg1, !operator.isLeftAssociative()); ...
7cfa0f0a-4934-4359-8d42-ab47489336dd
0
public next() { this.info = "get some notifications"; this.requireLogin = true; }
8e2876eb-4cb9-4d58-98a2-58a7fcc4735e
4
public void doCopy() throws SQLException { sourceCw = source.getConnectionWrapper(); ConnectionWrapper targetCw = target.getConnectionWrapper(); // find the number of objects in the source database long count = getCount(); // find the smallest object id in the source Long currentId = getSmallestId(); // ...
72dc3b6b-b52d-4cda-848d-dac821d6dbee
8
private boolean updateBackup(boolean pic) { StringBuilder sb = new StringBuilder(); LinkedList<String> help = null; if (pic) { help = new LinkedList<>(pictureList); } else { help = new LinkedList<>(currentData); } if (!pic) { sb.append(...
dadd8f2d-43e0-4d95-a182-68baa390eff1
7
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; StrEntry strEntry = (StrEntry) o; if (key != null ? !key.equals(strEntry.key) : strEntry.key != null) return false; if (value != null ? !value....
d7fee3a3-037a-415b-bfcd-0d76dfcb8dee
8
@Override public boolean equals(Object o) { if(o instanceof Context) { Item[][] p = ((Context) o).getPieces(); for(int i = 0; i < LARGURA; i++) { for(int j = 0; j < ALTURA; j++) { if(p[i][j] == null ^ pieces[i][j] == null) return false; else if(p[i][j] != null && pieces[i][j] != ...
24d5d879-b507-464b-9618-3f73eac3b772
3
public String getMove() { switch (this.directionToMove) { case 0: return " it was moved Up"; case 1: return " it was moved Down"; case 2: return " it was moved Left"; default: return " it was moved Right"; } }
c28e5734-50e3-4540-bc69-e0ede9396d81
9
private static double[] gaussianElimination(double[][] A, double[] b) { int n = b.length; // set up permutation int[] perm = new int[n]; for (int i = 0; i < n; ++i) perm[i] = i; // convert to upper triangular form for (int i = 0; i < n; ++i) { // pivot for (int j = i + 1; j < n; ++j) if (Math.a...
16353426-e17e-476d-84a9-72d075095641
2
public StatInfo generateStatistics(int id) { ArrayList<Float> stats = new ArrayList<Float>(); for (Entry<Float, float[][]> ent : Database.DB_ARRAY.entrySet()) { float[][] dats = ent.getValue(); for (float[] d : dats) { stats.add(d[id]); } } return new StatInfo(stats, id, StatInfo.DONT_SHOW); }
3f20f5f8-d0f2-4929-821e-db1f5a74de79
6
public void update() throws IOException { // update position getNextPosition(); checkTileMapCollision(); setPosition(xtemp, ytemp); // check flinching if (flinching) { long elapsed = (System.nanoTime() - flinchTimer) / 1000000; if (elapsed > 400) { flinching = false; } } // if it hits a w...
cb57068c-1620-4d43-bb2d-f20161ef69d0
8
@Override public void run() { // Simple selection List<UIEvent> lastEvents = Model.getModel().getInteractionStack().getLastEvents(2); if (lastEvents.get(1).getEventType() == EventType.MOUSE_BUTTON_DOWN && lastEvents.get(1).getButton() == 0 && lastEvents.get(0).getEventType() == EventType.MOUSE_BUTTON_UP ...
c3431a92-44c3-4673-9744-74f970920e4a
7
public boolean cast (Sorcerer sorcerer, Trigger trigger, Event event) { if (trigger.isInteractTriggered()) { PlayerInteractEvent interactEvent = (PlayerInteractEvent) event; interactEvent.setCancelled(true); if (trigger == Trigger.LEFT_CLICK_BLOCK ...
8ef91879-fba2-48f6-9ed3-1663f4179e9d
1
public void setInputs(int[] newInputs){ // // !! Put in validation to check newInputs.length == inputs.length // int i; for(i=0;i<inputs.length;i++){ inputs[i] = newInputs[i]; } }
969d74e6-2571-4cee-93ca-d3a09bb64395
3
private void turn() { boolean p1, p2; p1 = player1.getNextDecision(); p2 = player2.getNextDecision(); if (p1 ^ p2) { if (p1) { player1.addPoints(5); } else { player2.addPoints(5); } } else { if (p1) { player1.addPoints(2); player2.addPoints(2); } else { player1.addPoints(5)...
9b2ddc4e-9748-4f55-8675-92ad434bcb2e
0
public T getData() { return this.data; }
62e2f577-d64d-40cb-b7c7-f9e1ff5996d8
1
public String createTable(){ StringBuffer text = new StringBuffer(); text.append( headTable() ); for(int i=0; i<tasks.length; i++){ String row = contentTable(tasks[i].getTimer(), tasks[i].getName()); text.append( row ); } text.append("</t...
320b0e1d-72c5-4d8f-b48c-5762182d76d5
1
@Override public int releaseAudioData(int dataId) { if (dataId != 0) { alDeleteBuffers(dataId); } return 0; }
1947b108-ac0c-495d-9156-333630be1929
7
public static char[] generateFrequencyAlphabet(int base, String[] trainingData) { //check input parameters if(base<0) return null; if(base==0 || trainingData.length==0) return new char[0]; int totalNumChars = 0; Map<Char...
e620145f-98f6-4569-87e0-6b2ebeb1f7d0
8
@Override @SuppressWarnings("unchecked") public Configuration generateConfiguration(String[] commands) throws ClassNotFoundException { Configuration configuration = new Configuration(); for (int i = 0; i < commands.length; i++) { String command = commands[i]; if ("-c".equ...
9bc3934a-4483-4693-87f9-90cb5e2dadcf
9
public static void main(String[] args) throws IOException{ Scanner in = null; PrintWriter out = null; String line = null; String[] token = null; int i = 0, lineNumber = 0, orderCount = 0; int size, lengthA = 0, lengthB = 0; if(args.length < 2){ System.out.println("Usage: FileIO infile outfil...
6d14ac2a-325c-4dcb-a492-e04eed316d03
8
@Override public void paint(Graphics g) { super.paint(g); Graphics2D g2 = (Graphics2D) g; g2.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setStroke(new BasicStroke(3)); g2.setColor(Color.BLACK); ...
5d502cc6-a12e-4b42-b8a3-2c55120ce7ec
9
public void run() { for (;;) { Package pkg = null; try { pkg = packageQ.take(); } catch (Exception e) { System.out.println(e); } // handle this package XmlTag tag = pkg.getXmlTag(); String tagName = tag.getLocalName(); System.out.println("Processing a package of type: " + tagName); ...
04e75a92-c680-4766-aed4-799f94f10e56
3
private void addIndex(Partition partition, String... attrs) { // Index some attributes on the apache partition HashSet<Index<?, ServerEntry>> indexedAttributes = new HashSet<Index<?, ServerEntry>>(); for (String attribute : attrs) { indexedAttributes .add(new JdbmIndex<String, ServerEntry>(attribute)); ...
4a6cab2e-28f1-4a29-bdcf-63068df72230
6
static File constructFile(String basePath, String fileName) { File file; File absolute = null; if (fileName != null) { absolute = new File(fileName); } if (StrTry.isEmpty(basePath) || (absolute != null && absolute.isAbsolute())) { file = new ...
6bd37b6c-e685-4828-b3e8-3d8dae062eab
7
final int method3451(int i, float f) { if (i == 0) { float f_10_ = ((float) anIntArray4304[0] + (float) (anIntArray4304[1] - anIntArray4304[0]) * f); f_10_ *= 0.0030517578F; aFloat4305 = (float) Math.pow(0.1, (double) (f_10_ / 20.0F)); anInt4303 = (int) (aFloat4305 * 65536.0F); } if (((Cla...
b2d7b7e7-9711-46f3-b6bc-1603fe0cd1c4
8
public static List<Method> getAllSettersIncludeSuperClass(final Class<?> clazz) { List<Method> ls=new ArrayList<Method>(); for (Class<?> superClass = clazz; superClass!=null&&superClass != Object.class; superClass = superClass.getSuperclass()) { Method[] methods=superClass.getDeclaredMethods(); fo...
e70404a3-3d6f-451f-a2f8-daa4fab199f6
5
private void inserta(String nombreConsecuente, String etiquetaConsec, float min) throws IOException { RandomAccessFile raf = new RandomAccessFile(salDifusa, "rw"); char temp[] = new char[15]; String variable = null; String etiqueta = null; float valor = 0.0...
e241c344-8f91-48dc-8a7d-10c7978022bd
9
private static Triple<List<Set<Integer>>, int[], int[]> searchTree(Graph g, List<Set<Integer>> partition, Triple<List<Set<Integer>>, int[], int[]> soFar) { if (discrete(partition)) { int[] label = partitionToMatrix(partition, g.domainSize(), g); // int[] label = partitionToLabel(partition, g.domainSize()); ...
e0e031ac-02c4-4ea6-bb35-1277e3eda4a9
8
public CmdLine(String [] args) { hashMap = new HashMap<String,Info>(); int len = args.length; for(int i=0; i<len; i++) { if(args[i].startsWith("@")) { loadFile(args[i].substring(1)); continue; } } ...
489907b8-5b05-4437-a43b-fcadf2579d21
8
public static void main(String []args) { try { //System.out.println(args.length); if (args.length < 3) { System.out.println("Usage: script pathToXMLTaskFile pathToLogFolder System"); System.exit(0); } String taskFilePath = args [0]; String logFolderPath = args [1]; String system = args[2]; ...
ac793c4b-7efa-444c-9c42-dd59c849f4c0
1
public static double log2(double x) { if (x == 0) { // To avoid inifinity return 0; } return Math.log(x) / Math.log(2); }
8d6844fa-4f05-4077-89f5-2bd6e24e02e7
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Pair<E, T> other = (Pair<E, T>) obj; if (first == null) { if (other.firs...
e4db6555-6554-426d-9575-e919dc53f479
2
private void parseParameterDefinitions(final String[] paramDefinitions) { int paramIndex = 0; parameterNames = new String[paramDefinitions.length]; allPossibleParameterValues = new double[paramDefinitions.length][]; for (final String parameterDefinition : paramDefinitions) { ...
642fdd9f-940f-496a-b537-8916515f6e01
8
private void addPanelInit () { addPanel = new JPanel(); //generates panels formatted layout of components generator.createRigidSpace(addPanel, 40); final JLabel testLabel = generator.createLabel(addPanel, ""); JLabel fNameLabel = generator.createLabel(addPanel, "First Name"); final JTextField fNameInput...
7c1dbe15-373b-44bc-8bcf-fea50ade70a8
1
protected boolean isFinished() { return Robot.oi.getTilterAxis() != 0 || super.isFinished(); }
4ace653c-ccce-4a19-ab9e-b382ba2727fa
5
public void mouseClicked(MouseEvent e) { Point p = e.getPoint(); CPArtwork artwork = controller.getArtwork(); int layerIndex = getLayerNb(p); if (e.getClickCount() == 2 && layerIndex >= 0 && layerIndex < artwork.getLayersNb() && p.x > eyeW) { showRenameControl(layerIndex); } else if (renameField.isV...
5bba964f-50f2-48c5-ab84-352f1f5dc138
6
private static void input(){ try { Keyboard.create(); if(Keyboard.isKeyDown(Keyboard.KEY_D)){ player.moveRight(); player.setDirection(3); } if(Keyboard.isKeyDown(Keyboard.KEY_S)){ player.moveDown(); player.setDirection(2); } if(Keyboard.isKeyDown(Keyboard.KEY_A)){ player.mov...
358d6f14-c9f3-4978-a15e-6a9775cebfe2
6
private void method46(int arg0, Stream stream) { while (stream.bitOffset + 21 < arg0 * 8) { int k = stream.getBits(14); if (k == 16383) { break; } if (localNpcs[k] == null) { localNpcs[k] = new Npc(); } Npc n...
d8f139f7-e1fa-44fe-8056-d3e3c4e2c9df
4
public static void selectAllElementsLike(JList list, Object listElement, List<Integer> indexesOfDuplicates) { DefaultListModel model = (DefaultListModel) list.getModel(); ListSelectionModel sm = list.getSelectionModel(); int lastIndex = 0; for (Object element : model.toArray(...
40bb34f3-8523-4121-b008-da10de801230
3
public void getPathGraph(mxAnalysisGraph aGraph, int numVertices) { if (numVertices < 0) { throw new IllegalArgumentException(); } mxGraph graph = aGraph.getGraph(); Object parent = graph.getDefaultParent(); Object[] vertices = new Object[numVertices]; for (int i = 0; i < numVertices; i++) { ...
26e5fa97-86ae-4296-a91c-f2eeeceb1215
5
public void Reconnect(){ try { this.reconnect(); } catch (NickAlreadyInUseException e) { con.PrintMessage("Nick already in use"); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IrcException e) { // TODO Auto-generated catch block e.printStack...
a03a4310-55a5-4355-927c-7a4e7257a436
6
public static void banPlayer( String bannedBy, String player, String reason ) throws SQLException { BSPlayer p = PlayerManager.getPlayer( bannedBy ); BSPlayer t = PlayerManager.getSimilarPlayer( player ); if ( t != null ) { player = t.getName(); } if ( !PlayerManager....
c2355ec1-58dc-4ec5-ac3f-ab3692a2208a
9
public void propertyChange(PropertyChangeEvent e) { String prop = e.getPropertyName(); if (isVisible() && (e.getSource() == optionPane) && (JOptionPane.VALUE_PROPERTY.equals(prop) || JOptionPane.INPUT_VALUE_PROPERTY .equals(prop))) { Object value = optionPane.getValue(); if (value == JOptionPa...
9aebeceb-3b20-4bb4-b06f-78d98882d812
4
public void readTable(Map table) { if (parent != null) setAlias((String) table.get(getFullName())); for (Iterator i = loadedClasses.values().iterator(); i.hasNext();) { Identifier ident = (Identifier) i.next(); if ((Main.stripping & Main.STRIP_UNREACH) == 0 || ident.isReachable()) ident.readTable(...
1e0f7c34-bba5-4a80-be49-3ca70a0992d5
0
public ArrayList<String> getGoToList() { return goToList; }
454cb6cb-4bf5-41b5-9758-4840e1aee108
7
protected SharedFileInfo resolveFileSpec(File fileSpec) throws DBException { SharedFiles queryService = getQueryService(); SharedFileInfo fileInfo; Cursor<SharedFileInfo> fileRecords = null; log().info("Applying " + queryService.getEffectiveFilterSpec()); fileRecords = queryService.listAllFilesRelatedToPath(...
b321fdad-9794-4d06-bbc6-cf6899597c70
4
public boolean check(int xMouse,int yMouse) { if((x <= xMouse && xMouse <= x + width) && (y <= yMouse && yMouse <= y + height)) { //in = true; return true; } else { //in = false; return false; } //return in; }
37e14007-dd8e-4bd9-a419-08b9844524ac
7
public void execute() { FileDialog fd = new FileDialog(new Frame(), (type == Action.EXPORT) ? "Save File" : "Open File", (type == Action.EXPORT) ? FileDialog.SAVE : FileDialog.LOAD ); fd.setDirectory(directory); fd.setVisible(true); String file = fd.getFile(); String dir = fd.getDirectory(); if ( ...
4a491876-b5d4-4a88-a9c6-98065c859bfb
5
public bloque crearBloque(){ BloqueColor nuevoBloqueColor = new BloqueColor(); Random generador = new Random(); int r = generador.nextInt(5); if(r == 0){ nuevoBloqueColor.color="R"; } else if(r == 1){ nuevoBloqueColor.color="B"; } else if(r == 2){ nuevoBloqueColor.color="O"; } else if(r == ...
262aa66b-2f00-47bd-864d-fee6fc0b5252
0
public String getValue() { return value; }
9acb647e-8b3f-4479-9a49-31b7f9e709b7
0
public Main(final File working_directory, final String[] args) { this.working_directory = working_directory; this.args = args; }
9cc092cc-3ce7-49f2-bc5d-fba275683d12
7
public static final boolean isStaff(final MOB mob) { if(isASysOp(mob)) return true; if(mob==null) return false; if((mob.playerStats()==null) ||((mob.soulMate()!=null)&&(!mob.soulMate().isAttributeSet(MOB.Attrib.SYSOPMSGS)))) return false; if((mob.playerStats().getSecurityFlags().size()==0) &&(mob....
6d8f455d-8d05-4a13-acbd-238e275f1791
1
protected static String processInnerURL(String text) { int index = text.indexOf("|"); String url = text; String label = text; if (index != -1) { url = text.substring(0, index); label = text.substring(index + 1); } return "<a href=\"innerURL://" + u...
00cd45f0-d149-443c-8661-41357c11398c
7
public static int[] getSubset(int[] set, int sum) { for (int i = 0; i < set.length; i++) { for (int j = 0; j < set.length; j++) { for (int k = 0; k < set.length; k++) { if ((i != j && j != k && i != k) && (set[i] + set[j] + set[k] == sum)) { return new int[]{set[i], set[j], set[k]}; } } ...
e9306b58-ef41-41cb-a752-678ec0493f43
7
@Override public void run() { try { while(receiving) { try { Object obj = in.readObject(); if (obj == null) { return; } if(!(obj instanceof IPacket)) { log.err("A class was received, but is not a packet!"); continue; } IPack...
96b1e720-2c78-4112-8ffb-0523e21ef221
1
public static int getFontHeight(Font font) { if (font == null) { return 0; } FontMetrics fm = getFontMetrics(font); return fm.getHeight(); }
708dee0f-79b0-41b4-8830-ff2337f8b649
8
@Override public void mouseMoved(MouseEvent e) { int tx = mainMenuObj.getTx(); int ty = mainMenuObj.getTy(); int th = mainMenuObj.getTh(); int tw = mainMenuObj.getTw(); int gx = mainMenuObj.getGx(); int gy = mainMenuObj.getGy(); int gh = mainMenuObj.getGh(); ...
7a9299b9-792e-42e9-8720-94cb37bc4101
5
private Browser checkUserAgent(String agentString) { if (this.isInUserAgentString(agentString)) { if (this.children.size() > 0) { for (Browser childBrowser : this.children) { Browser match = childBrowser.checkUserAgent(agentString); if (match != null) { return match; } } } ...
ac07b707-4d01-4279-9b0e-a73912f88f94
9
private static void method232(int ai[], int ai1[], int ai2[], byte abyte0[], int i, int j, int k) { int l = 0; for (int i1 = i; i1 <= j; i1++) { for (int l2 = 0; l2 < k; l2++) if (abyte0[l2] == i1) { ai2[l] = l2; l++; } } for (int j1 = 0; j1 < 23; j1++) ai1[j1] = 0; for (int k1 =...
1d1d8aef-846d-47ba-8693-df99c524d559
3
@Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { plugin.toPlayer = args[0]; this.toPlayer = plugin.toPlayer; String prefix = CreeperWarningMain.chat.getPlayerPrefix((Player) sender); prefix = CreeperWarningMain.replaceChatColors(prefix); BufferedReader br; ...
4be485f6-e5c0-4c9d-a21b-6b4ec9ae0dbf
0
public LoginResult(int status,String sharekey,String version,String spnum){ this.Status = status; this.shareKey = sharekey; this.serverVersion = version; this.setSpNum(spnum); }
decfd7e9-91cb-4567-923e-2b8d293fecc0
2
public void tick(Level level, int xt, int yt) { int xn = xt; int yn = yt; if (random.nextBoolean()) xn += random.nextInt(2) * 2 - 1; else yn += random.nextInt(2) * 2 - 1; if (level.getTile(xn, yn) == Tile.hole) { level.setTile(xn, yn, this, 0); } }
30678cac-9743-478d-b537-8dd5f804fe39
9
public void init(Map map) { for (int i = 0; i < map.getBlocks().length; i++) { buttons[i].setText(""); buttons[i].setBorder(new LineBorder(Color.lightGray, 1)); if (!map.getBlocks()[i].isVisible()) { buttons[i].setBackground(Color.gray); } else if...
a4532827-3ffd-4d2d-9a7e-1ffc6b8723d5
3
public static int updateProdBraQty(String pb_prod_id, String pb_bra_id, String prod_qty, String action){ ProdBra pb = new ProdBra(); ArrayList<QueryCriteria> qcSrcProdBra = new ArrayList<QueryCriteria>(); qcSrcProdBra.add(new QueryCriteria("pb_bra_id", pb_bra_id, QueryCriteria.Operand.E...
a846584c-aa4a-4756-b72e-c1effb63cca8
0
protected void onIncomingChatRequest(DccChat chat) {}