text
stringlengths
14
410k
label
int32
0
9
@EventHandler public void onPlayerMove(PlayerMoveEvent event) { // Respect other plugins if (event.isCancelled()) { return; } Player player = event.getPlayer(); if (preChecks(player, event.getTo())) { JumpPort port = JumpPorts.getPort(event.getTo()); ...
7
private void addPiece(final BusyTile busyTile, final Position position, final boolean activate) { add(busyTile); if(busyTile.getColor())//ovvero se è bianco if (activate) { busyTile.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { board.remo...
3
private void sortFiles(File[] files) { if (directoryComparator != null) { try { Arrays.sort(files, directoryComparator); } catch (ClassCastException cce) { cce.printStackTrace(); } } else { Arrays.sort(files); } }
2
public Object getValueAt(int row, int col) { CounterParty c = (CounterParty)counterParties.getBusinessObjects().get(row); if (col == 0) { return c; } else if (col == 1) { return Utils.toString(c.getAliases()); } else if (col == 2) { return c.getBankAccountsString(); } else if (col == 3...
6
public MainGeneration() throws Exception{ int x = 0; Scanner sc = new Scanner(System.in); /*Tant que le résultat est différent des réponses attendues On continue de demander une réponse adéquate*/ while(x != 1 && x != 2 ){ System.out.println("Génération Controlée(1)"); System.out.println("Génération Aléat...
4
public CoreInterface getTreeObject(CoreInterface ci){ if(ci.getClass() == Dvd.class){ return dvdTree.get(ci); }else if(ci.getClass() == Location.class){ return locationTree.get(ci); }else if(ci.getClass() == Genre.class){ return genreTree.get(ci); } return null; }
3
private void checkEnoughCapacity(int number) { int len = keys.length; if (len - currentSize < number) { // Make inner arrays two times longer changeCapacityBy(keys, len); changeCapacityBy(values, len); } else if (currentSize < len / 4 && len / 2 > INITIAL_CAPA...
3
public Course(ResultSet rs) throws Exception{ DBConnector db = new DBConnector(); if(rs.next()){ setCourseID(rs.getInt("courseid")); setTitle(rs.getString("title")); setYear(rs.getInt("year")); setSeason(rs.getString("season")); setTeacher(db.g...
1
protected boolean canAct(Tickable ticking, int tickID) { switch(tickID) { case Tickable.TICKID_AREA: if(!(ticking instanceof Area)) break; //$FALL-THROUGH$ case Tickable.TICKID_MOB: case Tickable.TICKID_ITEM_BEHAVIOR: case Tickable.TICKID_ROOM_BEHAVIOR: { if((--tickDown)<1) { tickReset...
9
private void update(DocumentEvent event) { String newValue = ""; try { Document doc = event.getDocument(); newValue = doc.getText(0, doc.getLength()); } catch (BadLocationException e) { e.prin...
5
private void collectFiles(String path, File... files) { for (File file : files) { if (!file.canRead()) { logger.warn("Can't read from file %:", file.getAbsolutePath()); continue; } UpdateItem ui = new UpdateItem(); ui.setNewData(tru...
5
public String getAlfrescoProperty(String filename, String property) { Document doc = (Document) session.getObjectByPath("/" + filename); List<Property<?>> properties = doc.getProperties(); String propertyValue = ""; for (Property<?> p : properties) { if (p.getFirstValue() ==...
6
private void makewt(int nw) { int j, nwh, nw0, nw1; float wn4r, wk1r, wk1i, wk3r, wk3i; double delta, delta2, deltaj, deltaj3; ip[0] = nw; ip[1] = 1; if (nw > 2) { nwh = nw >> 1; delta = 0.785398163397448278999490867136046290 / nwh; de...
8
public SortedSet<Map.Entry<String,Integer>> runRandom(final int n){ final Map<String,Integer> results = new HashMap<String,Integer>(); final int threadCount = 10; final int threadLoad = n/threadCount; if(n<threadCount){ for(int i = 0;i<n;i++){ String seq = backtrackF(0, len - 1); Integer freq = resul...
8
protected void dispatchEvent(AWTEvent event){ super.dispatchEvent(event); // interested only in mouseevents if(!(event instanceof MouseEvent)) return; MouseEvent me = (MouseEvent)event; // interested only in popuptriggers if(!me.isPopupTrigger()) ...
4
private void updateMatchResults(Player winner) { if(null!=winner) { GameScore gs = players.get(winner); if(gs.hasWon()) { matchWinner = winner; matchWinner.win(); } } }
2
public String getHelpText(HelpType command) throws Connect4Exception { String helpText = ""; switch (command) { case BOARD: case GAME: case SPACES: case TOKENS: helpText = command.getHelpText(); break; ...
4
public static void ChangeTile() { if (!intrfce.Menu.runMenu) { for (int h = 0; h < Engine.mb.BLOCKS[layer - 1].length; h++) { for (int w = 0; w < Engine.mb.BLOCKS[layer - 1][h].length; w++) { if (r.intersects(Engine.mb.BLOCKS[layer - 1][h][w].r)) { if (isPressed) { Engine.mb.ID[layer - 1][h][...
5
public boolean updateConnections(Node n) throws WrongConfigurationException{ boolean edgeAdded = false; // For the given node n, retrieve only the nodes which are possible neighbor candidates. This // is possible because of the rMax filed of the GeometricNodeCollection, which indicates the maximum // distan...
5
public void Command (CommandSender sender, Command cmd, String commandlabel, String[] args) { if (args[0].equalsIgnoreCase("reload")) { return; } }
1
@Override public String toString() { return "isStatic()"; }
0
public void flush() { FileOutputStream saveFile = null; try { saveFile = new FileOutputStream(".contacts.txt"); ObjectOutputStream expt = new ObjectOutputStream(saveFile); expt.writeObject(this.IDgenerator); expt.writeObject(this.contactList); expt.writeObject(this.meetingList); }catch(IOExcepti...
2
public void cleanup() { final Iterator iter = cleanup.iterator(); while (iter.hasNext()) { final Node node = (Node) iter.next(); node.cleanup(); } vars = null; phis = null; pushes = null; pops = null; defs = null; def = null; cleanup = null; }
1
public boolean checkDefeated(){ return monster.isAlive(); }
0
public void draw(Graphics g){ final STATE state = this.now_state; switch(state){ case STATE_NORMAL: int frame_count = player.get_frame_count(); int chip_size = MapChip.CHIP_SIZE;//1チップの大きさ /* 移動アニメーションのためにオフセットを計算する */ double one_frame = (double)chip_size / (double)Frame_Of_Move; ...
6
public void oneLevelDeepPost(String container1, String url1, String dest) { String fileData = ""; BufferedWriter bufferWritter = null; try { String container = container1; String url = url1; String destination = dest; Document doc = postUrl(url); ...
8
public void toggle(KeyEvent key, boolean pressed){ int keyCode = key.getKeyCode(); if(keyCode == KeyEvent.VK_UP) up = pressed; if(keyCode == KeyEvent.VK_DOWN) down = pressed; if(keyCode == KeyEvent.VK_LEFT) left = pressed; if(keyCode == KeyEvent.VK_RIGHT) right = pressed; }
4
public boolean isNear(double x, double y, double zoom) { double distance = Math.abs(dist(x, y)); if (zoom >= 0 && distance > 5.0 / Math.sqrt(zoom)) return false; double d = (from.getX() - to.getX()) * (from.getX() - to.getX()) + (from.getY() - to.getY()) * (from.getY(...
4
public Complex[] getData1() { for (k = 0; k < power; k++) { for (j = 0; j < 1 << k; j++) { bfsize = 1 << (power - k); for (i = 0; i < bfsize / 2; i++) { Complex temp1 = new Complex(0, 0); Complex temp2 = new Complex(0, 0); p = j * bfsize; x2[i + p] = temp1.plus(x1[i + p], x1[i + p + bf...
6
public static void main(String[] args) { final long startTime = System.currentTimeMillis(); /* if (args.length > 3 && !args[1].equals("-k") || args.length < 3) { System.err.println("Usage: [-DataCounter implementation] [-sorting routine] [filename of document to analyze]"); System...
7
@Override public String toString() { return "isPublic()"; }
0
private Integer differenceBetweenSpecieLists(List<Specie> list1, List<Specie> list2) { Integer difference1 = 0; for (Specie s : list1) { if (!list2.contains(s)) { difference1++; } } Integer difference2 = 0; for (Specie s : list2) { if (!list1.contains(s)) { difference2++; } } retur...
4
private int jjMoveStringLiteralDfa4_5(long old0, long active0) { if (((active0 &= old0)) == 0L) return 4; try { curChar = input_stream.readChar(); } catch (java.io.IOException e) { return 4; } switch (curChar) { case 93: if ((active0 & 0x200000L) != 0L) return jjStopAtPos(4, 21); break; ...
4
public void drawSkillEffects(Graphics2D g2d, Character character, boolean isMonster) { int buffAmount = character.getBuffs().size(); if (buffAmount > 0) { for (int i=0; i<character.getBuffs().size(); i++) { if (!isMonster) { g2d.drawImage(character.getBuff...
6
private void vender() { dtmcv = (DefaultTableModel) JT_CarrinhoCompras.getModel(); JT_Venda_Produtos.selectAll(); int linha = JT_Venda_Produtos.getSelectedRow(); int codigo = Integer.parseInt((String) JT_Venda_Produtos.getValueAt(linha, 0)), quantidade = Integer.parseInt(JTF_Qtde.getTex...
6
@Test public void testExecutingState() throws ProcessExecutionException, ProcessRollbackException { IProcessComponent<?> comp = TestUtil.executionSuccessComponent(true); // use reflection to set internal process state TestUtil.setState(comp, ProcessState.EXECUTING); assertTrue(comp.getState() == ProcessState...
5
public static final List<String> loadEnumerablePage(final String iniFile) { final StringBuffer str=new CMFile(iniFile,null,CMFile.FLAG_LOGERRORS).text(); if((str==null)||(str.length()==0)) return new Vector<String>(); final List<String> page=Resources.getFileLineVector(str); for(int p=0;p<(page.size()-1);p...
7
@Override public GameFont getClonedObject(String name, Map<String, String> data) { // Get an existing GameFont, remember this can possibly return null if // it wasn't a validFont. GameFont cachedFont = getObject(name, data); if (cachedFont == null) { return cachedFont; } return cachedFont.getShallowClo...
1
public void f() { System.out.println("public f()"); }
0
public HostInfo(String address, int port) { try { this.address = InetAddress.getByName(address); this.port = port; } catch (Exception e) { System.err.println("Cannot get IP address" + address + ":" + port); } }
1
public void update() { for (int i = 0; i < bullets.size(); i++) { Bullet bullet = bullets.get(i); bullet.fly(); for (int j = 0; j < enemies.size(); j++) { Enemy enemy = enemies.get(j); if (GameTool.isCollision(bullet, enemy)) { // 敵人要消失 enemies.remove(enemy); // 子彈要消失 bullets.r...
5
public void quickClear(Space center) { if (center.getState() == State.REVEALED && !center.isMine()) { int nearFlags = 0; List<Space> adjacent = center.getAllAdjecentSpaces(this); for (Space s : adjacent) { if (s.getState() == State.FLAGGED) { ...
9
@Override public List<Point> findWay(Node<Point> start, Node<Point> goal, ListGraph<Point> graph) { // Closed list is only a fraction of the complete graph int initSize = (int) Math.log(graph.getVerticesSizes()); System.out.println(initSize); this.closedList = new HashSet<Node<Point...
7
@Override public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, Object[] args) { if (!f.hasTag(SCRIPT_TAG)) { return super.execIdCall(f, cx, scope, thisObj, args); } int id = f.methodId(); switch (i...
7
public Set<Point3> getAlivePositions() { Set<Point3> points = new HashSet<Point3>(); synchronized (beings) { for (Being b : beings) { points.add(new Point3(b.getPosition())); } } return points; }
1
private Message errorMessage(Stat stat) { Message msg = new Message(); String subject = stat.getName() + ": validation failed"; if (stat.getStateDescription() != null) subject += " (" + stat.getStateDescription() + ")"; msg.subject(subject); addNameValue(stat, msg); msg.a...
1
public Set getDeclarables() { Set used = new SimpleSet(); if (instr != null) instr.fillDeclarables(used); return used; }
1
private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_exitMenuItemActionPerformed {//GEN-HEADEREND:event_exitMenuItemActionPerformed if(hasChanges) { int dialogResult = JOptionPane.showConfirmDialog(this, "You have unsaved changes, would you like to sa...
5
@Override public void update(GameContainer gc, int delta, Level level) { Input input = gc.getInput(); if (input.isKeyDown(Input.KEY_LEFT) || input.isKeyDown(Input.KEY_A)) { velocity.x -= runSpeed; } else if (input.isKeyDown(Input.KEY_RIGHT) || input.isKeyDown(Input.KEY_D)) { velocity.x += runSpeed; } ...
8
public void create(Qualificador qualificador) { if (qualificador.getQualificadorAplicacaoCollection() == null) { qualificador.setQualificadorAplicacaoCollection(new ArrayList<QualificadorAplicacao>()); } if (qualificador.getQualificadorProdutoCollection() == null) { quali...
9
static final synchronized AbstractToolkit createToolkit (int i, int i_168_, int i_169_, IndexLoader loader, int i_170_, d var_d, Canvas canvas, int i_171_) { try { anInt4576++; if (i_170_ == i_171_) return Class348_Sub5.createSoftwareToolkit(true, i_168_, i_169_, canvas, var_d); if (i_171_ == 2) ...
9
public void body() { // Process events Object obj = null; while ( Sim_system.running() ) { Sim_event ev = new Sim_event(); super.sim_get_next(ev); // get the next event in the queue obj = ev.get_data(); // get the incoming data ...
8
@Override public void deserialize(Buffer buf) { super.deserialize(buf); level = buf.readUByte(); if (level < 1 || level > 200) throw new RuntimeException("Forbidden value on level = " + level + ", it doesn't respect the following condition : level < 1 || level > 200"); in...
3
public final Variable addend() throws RecognitionException, TokenStreamException { Variable result = new Variable("","","");; Variable e1, e2; try { // for error handling e1=factor(); result = e1; { _loop313: do { switch ( LA(1)) { case OP_PRODUCTO: { { ma...
8
@Override public void setBoolean(long i, boolean value) { if (ptr != 0) { Utilities.UNSAFE.putLong(ptr + sizeof * i, value == true ? 1 : 0); } else { if (isConstant()) { throw new IllegalAccessError("Constant arrays cannot be modified."); } ...
4
private static PixImage randomImage(int i, int j) { /** * Visit each cell (in a roundabout order); randomly pick a color. */ PixImage image = new PixImage(i, j); Random random = new Random(0); // Create a "Random" object with seed 0 int x = 0; int y = 0; for (int xx = 0; xx < i; xx++) { x = (x + 78...
2
public ServerFinder(JFrame parent) { super(parent, I18n.getInstance().getString("sfTitle")); setLayout(new BorderLayout()); table = new JTable(); table.setCellSelectionEnabled(false); table.setColumnSelectionAllowed(false); table.setRowSelectionAllowed(true); table.setModel(new ServerTableModel(new Vecto...
6
public void run() { try { while(!finished && !socket.isClosed()) { Packet packet = Packet.unpack(in); if(packet == null) { // The other side closed the connection break; } //System.out.println("Received packet: " + packet); if((packet.getFlags() & Packet.FIN) != 0) { gotFIN = t...
7
public static pgrid.service.corba.repair.IssueState from_int (int value) { if (value >= 0 && value < __size) return __array[value]; else throw new org.omg.CORBA.BAD_PARAM (); }
2
public void setAuthorities(String roles) { this.authorities = new HashSet<GrantedAuthority>(); for (final String role : roles.split(",")) { if (role != null && !"".equals(role.trim())) { GrantedAuthority grandAuthority = new GrantedAuthority() { public St...
3
public void updateViews() { for (IUpdateView iv : viewList) { if (iv != null) { iv.updateView(); } } }
2
public static void main(String argv[]) throws Exception { PORT = Integer.parseInt(argv[0]); FILENAME = argv[1]; SERVER_SOCKET = new DatagramSocket(PORT); ByteArrayOutputStream baos = new ByteArrayOutputStream(); int expected_number = 0; boolean eof = false; do { byte[] packet_buffer = new byte[1024]...
8
private NetworkingPreference(ProxyInfo proxy) { System.setProperty("http.proxyHost", proxy.getHost()); System.setProperty("http.proxyPort", proxy.getPort()); }
0
@Override public void startSetup(Attributes atts) { super.startSetup(atts); TEXT = atts.getValue(A_TEXT); setEnabled(false); addActionListener(this); Outliner.documents.addUndoQueueListener(this); Outliner.documents.addDocumentRepositoryListener(this); }
0
public void jsFunction_waitCraft(String wnd, int timeout) { deprecated(); int cur = 0; while (true) { if (cur > timeout) break; if (UI.instance.make_window != null) if ((UI.instance.make_window.is_ready) && ...
5
public Value naryOperation(final AbstractInsnNode insn, final List values) throws AnalyzerException { if (insn.getOpcode() == MULTIANEWARRAY) { return newValue(Type.getType(((MultiANewArrayInsnNode) insn).desc)); } else { return newValue(Type.getReturnType(((MethodInsnNode) insn).desc)); } }
1
public void addCards(PlayingCard... nCards) { int nL=this.cards.length+nCards.length; PlayingCard[] newCards=new PlayingCard[nL]; for (int i=0;i<this.cards.length;i++) { newCards[i]=cards[i]; } for (int i=0;i<nCards.length;i++) { newCards[i+this.cards.length]=nCards[i]; } this.cards=newCards; ...
2
Object[] allocateArray(Object data[], int num) { Object newData[] = null; if (data instanceof javax.vecmath.Point3f[]) { newData = new Point3f[num]; } else if (data instanceof javax.vecmath.Vector3f[]) { newData = new Vector3f[num]; } else if (data instanceof javax.vecmath.Color3f[]) { ...
8
@Override public void closeChannel() throws IOException{ this.input.close(); this.output.close(); if(tcpchannelsocket != null) tcpchannelsocket.close(); }
1
public static Stella_Object wrapKifWithForall(Stella_Object tree, Cons declaredvariables) { if (Stella_Object.safePrimaryType(tree) == Logic.SGT_STELLA_CONS) { { Cons tree000 = ((Cons)(tree)); if (Stella_Object.symbolP(tree000.value)) { { GeneralizedSymbol testValue000 = ((GeneralizedSymbol...
9
@Override public void changeUserPassword(String username, String oldPassword, String newPassword) throws UserLockedOutException { // throws UserLockedOutException if this isn't allowed lockoutService.allowAttempt(username); for(LdapServer ldapServer : ldapServers) { try { if(ldapServer.verifyPasswor...
5
private boolean jj_2_76(int xla) { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_76(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(75, xla); } }
1
@Override public void process(JCas aJCas) throws AnalysisEngineProcessException { String inputDocument = aJCas.getDocumentText(); Matcher questionMatcher = questionPattern.matcher(inputDocument); // Find all question patterns, and create Question annotations while (questionMatcher.find()) { Q...
4
public ArrayReverseIterator(T[] source) { this._source = source; this._position = this._source.length - 1; }
0
public void setFullScreen( DisplayMode dm ){ this.setUndecorated(true); this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); this.pack(); this.setSize(1920, 1080); this.setResizable(false); this.setVisible(true); vc.setFullScreenWindow(this); if( dm !=...
3
@Override protected boolean canDeleteChild(int index, Construct child, boolean isUser) { if(mState == null || mState.mPlaceholders == null) { return super.canDeleteChild(index, child, isUser); } Placeholder descriptor = getPlaceholderForConstruct(child); if(descriptor == null || descriptor.isPermanent()...
6
private void readLines(final BufferedReader reader, final MyObjects myObjects) throws IOException { String line; while ((line = reader.readLine()) != null) { myObjects.addLine(line); } }
1
public List<Partner> findAllPartnersByHallEventId(final Long hallEventId) { return new ArrayList<Partner>(); }
0
private void dispatch(UpdateRequest ur) { if (ur instanceof PrintRequest) { print((PrintRequest) ur); } else if (ur instanceof RemoveRequest) { remove(((RemoveRequest) ur)); } else if (ur instanceof HighlightRequest) { HighlightRequest hr = (HighlightRequest) ...
8
public FightThread() { int mapTime = HyperPVP.getTime(); int left = HyperPVP.getMinutesLeft(); int third = mapTime / 3; int one = mapTime; int two = mapTime - third; int three = mapTime - third - third; ChatColor status = ChatColor.GREEN; if (left <= one && left > two) { status = ChatColor.GREEN...
7
public static String getName(Object instance) { Class<? extends Object> type = instance.getClass(); if (type.isArray() || Collection.class.isAssignableFrom(type) || Map.class.isAssignableFrom(type)) { return "Array"; } else { if (packages.contains(type.getPackage().getName())) { return ty...
5
public String getKodPocztowy() { return kodPocztowy; }
0
private void encode(String message) { int index = 0; // initialize dictionary w/ single symbols for(int i = 0; i < message.length(); i++) { if(i + 1 == message.length()) { if(!dictionary.containsKey(message.substring(i))) dictionary.put(message.substring(i), index++); } else { if(...
8
public static double stddev(double[] vals) { double mean = mean(vals); double squareSum = 0; for (double v : vals) { squareSum += v * v; } return Math.sqrt(squareSum / vals.length - mean * mean); }
1
private int getEhtoY(Pelihahmo h){ if (h==h1){ return ehtoh1y; } else { return ehtoh2y; } }
1
public double getX() { return x; }
0
public void actionPerformed(ActionEvent e) { if (e.getSource() == b1) count[0]++; else if (e.getSource() == b2) count[1]++; else if (e.getSource() == b3) count[2]++; else if (e.getSource() == b4) coun...
8
public JButton getjButtonQuitter() { return jButtonQuitter; }
0
public void loadAntBrains(AntBrain red, AntBrain black) { redAntBrain = red; blackAntBrain = black; }
0
private boolean isInTrack(int var1, int var2, int var3) { for (int var4 = 0; var4 < this.connectedTracks.size(); ++var4) { ChunkPosition var5 = (ChunkPosition) this.connectedTracks.get(var4); if (var5.x == var1 && var5.z == var3) { return true; } } ...
3
public void leerArchivoOrigen() { try { FileInputStream file=new FileInputStream("articulos.txt"); int c; while((c=file.read())!=-1) { dataInput=dataInput+String.valueOf((char)c); } file.close(); } ...
3
private void compareFiles() { progress = 0; long start = System.currentTimeMillis(); for (int i=0; i<fileArray.size(); i++) { calculataAndPublishProgress(i, fileArray.size(), "State 4 of 5: Find duplicate files! "); ArrayList<File> duplicateFileArray = new ArrayList<File>(); for (int j=(i+1); j<fileArr...
8
private SkinPreviewVO getSelectedListEntry() { SkinPreviewVO ret = null; if (this.previewList.size() > this.selectedIndex) { ret = this.previewList.get(this.selectedIndex); } return ret; }
1
@Override public boolean activate() { furnace = SceneEntities.getNearest(Constants.FURNACE_IDS); if (!Players.getLocal().isMoving() && furnace.isOnScreen() && !Bank.isOpen() && Inventory.getCount(Constants.STEEL_BAR_ID) > 0) { if (Inventory.getCount(Constants.IRON_ORE_ID) <= 1 && Invento...
6
public OrgaEinheit getOrgaEinheitZuLeitername(String Leitername) { OrgaEinheit rueckgabe = null; ResultSet resultSet; try { resultSet = db .executeQueryStatement("SELECT * FROM OrgaEinheiten WHERE Leitername = '" + Leitername + "'"); if(resultSet.next()) rueckgabe = new OrgaEinheit(resultSet,...
2
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Cliente other = (Cliente) obj; if (this.idCliente != other.idCliente) { return false; ...
4
@Override public void show() { // Get list of styles and populate comboBox. styles.removeAllItems(); File[] fileNames = CSS_DIR.listFiles(); for (int i = 0; i < fileNames.length; i++) { File file = fileNames[i]; if (file.isFile()) { styles.addItem(file); } } super.show(); }
2
private Response takeAnswer() throws IOException{ //Implementation to take answer input. Used for storing user responses and storing answer keys. String s = null; @SuppressWarnings("unchecked") ArrayList<String> copy = (ArrayList<String>) right.clone(); //Replacement of responses so responses are not lost HashM...
5
public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof KeyedValueDataset)) { return false; } KeyedValueDataset that = (KeyedValueDataset) obj; if (this.data == null) { if (that.getKey() != null || th...
7
private int getOnlinePlayers() { try { Method onlinePlayerMethod = Server.class.getMethod("getOnlinePlayers"); if (onlinePlayerMethod.getReturnType().equals(Collection.class)) { return ((Collection<?>) onlinePlayerMethod.invoke(Bukkit.getServer())).size(); } else { return ((Player[]) onlinePlayerMeth...
4