method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
dd5af0d1-9a11-4da1-ab3a-682de6b2d796
8
@Override public void updateParty(MapleParty party, PartyOperation operation, MaplePartyCharacter target) throws RemoteException { for (MaplePartyCharacter partychar : party.getMembers()) { if (partychar.getChannel() == server.getChannel()) { final MapleCharacter chr = server.getPlayerStorage().getCharacter...
be3e09cd-c951-43d0-8916-0f6305a68be4
2
public void setDAO(String daoLine) { if (daoLine.equals("Mock")) { dao = new MockDAO(); } else if (daoLine.equals("MySQL")) { dao = new MySQLDAO(); } }
3aed8890-4ca8-4e4a-b72e-4c74865ed39e
9
public void mouseExited(MouseEvent e) { Point[] path = null; if(e.getSource() instanceof GameSquare){ GameSquare gameSquare = (GameSquare) e.getSource(); if(current == null){ if(gameSquare.isOccupied()){ path = gameSquare.getGuest().path(); if(path != null){ for(Point point : path){...
2358010e-add2-4203-a7d6-abc17f7b5e69
6
public void townCenterScaner() { SQLBridge sqlite = new SQLBridge(); int rows = sqlite.getColumnsCount("TownList", "ROWID"); if (rows == 0) { return; } for (int i = 1; i <= rows; ++i) { rows = sqlite.getColumnsCount("TownList", "ROWID"); HashMap<Integer, HashMap<String, String>> results = SQLBridg...
d4762e18-aebb-406f-9207-1d7c106152eb
6
private void isPromotion() { Iterator<Position> pieceIter = Board.chessBoard.keySet().iterator(); while (pieceIter.hasNext()) { Position pos = (Position) pieceIter.next(); Piece inspectedPiece = Board.chessBoard.get(pos); if (!isSameTeam(pos)){ continue; } if (!(inspectedPiece.unicode == "\u2659...
8631ed55-6413-401b-ac81-3c29ae194099
0
public void setPreviousGrids(ArrayList<Grid> previousGrids) { this.previousGrids = previousGrids; }
5bbd9ed7-b400-4965-92f6-8aa8021f0a60
6
@EventHandler public void onSignDestroy(BlockBreakEvent event) { Block block = event.getBlock(); if (block.getType().equals(Material.SIGN) || block.getType().equals(Material.WALL_SIGN) || block.getType().equals(Material.SIGN_POST)) { Player pl...
7c83a554-1be9-4d36-8282-e5c9ca7a2d98
2
private void attack() { cwidth += 20; if (this.intersects(getWorld().getPlayer())) { attacking = true; getWorld().getPlayer().damageEntity(10); for (int i = 0; i < 10; i++) getWorld().getPlayer().backOff(this); } cwidth -= 20; }
953d98d6-2508-4cf7-96c2-002c18ed34b8
5
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String data = request.getParameter("date"); String horario = request.getParameter("time"); String professor1 = request.getParameter("professor1"); St...
34aaf9a0-db61-4141-a49d-f3d0b9db40ac
5
public static void openVault(Player viewer, String name, int id) throws NotEnoughVaultsException { if(Bukkit.getPlayerExact(name) != null) { Player p = Bukkit.getPlayerExact(name); boolean hasPerm = false; int num = id; while (num != 1000) { if(p.hasPermission("vaults." + num)) { hasPer...
201157d7-93ec-40fc-958e-415653ad4c82
0
@Override public boolean supportsEditability() {return false;}
e0d80960-9cb1-4cd8-a73e-de94bc8b5777
2
public VueNouvelleLocation(ModeleLocations modele, Controleur controleur) { super(); System.out.println("VueNouvelleLocation::VueNouvelleLocation()") ; this.modele = modele ; this.controleur = controleur ; this.tfDateDepart.getDocument().addDocumentListener(this) ; this.bEnregistrer.setEnabled(false) ...
4f375486-636a-4c82-a77d-d1e2c303009c
2
@SuppressWarnings({ "unchecked", "rawtypes" }) public void execute(Map o, PluginManager pm) { Class pClass = pluginMap.get(o.get("node")); Plugin plugin = pm.getPlugin(pClass); try { if(pClass == OmniLinkII.TYPE) ((OmniLinkII) plugin).execute(o); } catch (Exception e) { // TODO Auto-generated catch b...
e9d0fc8a-55bf-486a-8b0d-f734f2e2a3e5
8
public void paintComponent(Graphics g) { if (groundMap != null && terrainMap != null) { for(int i = 0; i < row; i++) { for (int j = 0; j < col; j++) { if(groundMap[i][j] == 'P') g.drawImage(imgPlain, j*BLOCK-xMap, i*BLOCK-yMap, null); else if(groundMap[i][j] == 'W') g.drawImage(imgWater, ...
2428a863-3a95-4612-81ab-e95249f2da2a
8
public boolean passesTest(Instance inst) throws Exception { if (inst.isMissing(m_AttIndex)) return false; // missing values fail boolean isNominal = inst.attribute(m_AttIndex).isNominal(); double attribVal = inst.value(m_AttIndex); if (!m_Not) { if (isNominal) { if (((int) attribVal) != ...
2fe31738-9735-4c59-af8c-a53076ffaa0f
7
public static void floodFill(int r, int c, char l, int v) { for (int i = 0; i < dir.length; i++) if (r + dir[i][0] >= 0 && r + dir[i][0] < n && c + dir[i][1] >= 0 && c + dir[i][1] < m && map[r + dir[i][0]][c + dir[i][1]] == l && ans[r + dir...
9913a91c-6afa-4eef-80b1-c18ca1c344ee
4
public void entferneDuplikate(String[] feld) { for (int i = 0; i < feld.length - 1; i++) { String zuUeberpruefen = feld[i]; for (int j = i + 1; j < feld.length; j++) { if (zuUeberpruefen == null) { continue; } if (zuUebe...
67036ec7-a7ee-415a-ad95-7184110be60b
2
private static void copy(InputStream in, File file){ try { OutputStream out = new FileOutputStream(file); byte[] buf = new byte[1024]; int len; while((len=in.read(buf))>0){ out.write(buf,0,len); } out.close(); in.close(); } catch (Exception e) { e.printStackTrace(); } }
567ec389-695f-4e46-b892-331abd380cba
8
@Override public String toString() { return "SubCarrierFreq {" + (extReferences != null ? " extReferences [" + extReferences + "]" : "") + (cls != null ? " cls [" + cls + "]" : "") + (recommendedValue != null ? " recommendedValue [" + recommendedValue + "]" : "") + (quality != null ? " qua...
6d391171-ebd9-416c-8018-8dc44e9a8861
9
void updateMouse(MouseEvent e,boolean pressed, boolean released, boolean inside) { mousepos = e.getPoint(); mousepos.x = (int)((mousepos.x/*-el.canvas_xofs*/)/el.x_scale_fac); mousepos.y = (int)((mousepos.y/*-el.canvas_yofs*/)/el.y_scale_fac); mouseinside=inside; int button=0; if ((e.getModifiers()&InputEv...
586037af-9e50-4982-bd78-78829b5949de
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Context other = (Context) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; ...
edf32f5d-4533-442b-ba94-ce99f08478a9
8
@Test public void testBuyAllCopiesDefaultBook() throws BookStoreException { // Set of books to buy Set<BookCopy> booksToBuy = new HashSet<BookCopy>(); booksToBuy.add(new BookCopy(TEST_ISBN, NUM_COPIES)); // Try to buy books client.buyBooks(booksToBuy); List<StockBook> listBooks = storeManager.getBooks();...
d5ce58fb-a0b2-4205-8b9c-a3589bc6c1e6
1
public static void main(String[] args) { //Display a loading screen loading = new JFrame("Syntaxilizer - By Alex Li"); loading.getContentPane().add(new JLabel(new ImageIcon("resources\\loading.png"))); loading.setUndecorated(true); loading.setSize(500, 100); loading.setBackground(new Color(0, 0,...
0325dafc-389e-4e44-8bce-e38276bd4056
5
public void keyPressed(KeyEvent key) { int keyCode = key.getKeyCode(); if(keyCode ==KeyEvent.VK_LEFT){ player.setLeft(true); } if(keyCode ==KeyEvent.VK_RIGHT){ player.setRight(true); } if(keyCode ==KeyEvent.VK_UP){ player.setUp(true); } if(keyCode ==KeyEvent.VK_DOWN){ player.setDown(true); ...
f47c36b3-a6e3-48cd-9314-4f92ca419039
0
private void createTabPage1() { projectTabPane = new ProjectOptionsView(campaign); lblOpcjeProjektu = new JLabel( "Opcje projektu, nazwa, liczba quizow, byc moze graf lub lista punktow"); projectTabPane.add(lblOpcjeProjektu); }
c4d93b60-2f98-4901-81f2-d2a1d87b00ea
3
public boolean isValid(Location loc) { return 0 <= loc.getRow() && loc.getRow() < getNumRows() && 0 <= loc.getCol() && loc.getCol() < getNumCols(); }
b57603ba-fe28-4e38-bb61-a3b1b96f7202
1
public void keyPressed(KeyEvent e) { // if(e.getKeyCode() == KeyEvent.VK_SPACE){ // System.out.println(MouseInfo.getPointerInfo().getLocation().x + " " + MouseInfo.getPointerInfo().getLocation().y); // } if(player == null){ player = gameObjects.get("PLAYER" + userID); } pressedKeys.add(e.getKeyCode()); s...
15a6656a-c461-4d53-90f8-b11d7f5e6c68
7
public static long calculateGbPalette(long[] colors) { long gbPalette = 0; for (int counter = 0; counter < 1; counter++) { for (int c = 5; c != 2; c++) { c %= 3; gbPalette &= 0x83ff83ff83ff83ffL >> ((2 - c) * 5); for (int bitShift = 5 - BITS_PER_ROUND; bitShift >= 0; bitShift--) { ...
2ca9e7eb-4404-4678-af8e-357d3f2267e0
7
private final boolean cons(int i) { switch (b[i]) { case 'a': case 'e': case 'i': case 'o': case 'u': return false; case 'y': return (i == 0) ? true : !cons(i - 1); default: return true; } }
14485fe3-36ca-4cab-83d6-827e6292e014
8
private void readOpenItems() { try { CsvReader csvReader = new CsvReader(sourceFileOpenItems); if(csvReader.readHeaders() == true) { while(csvReader.readRecord()==true) { //apar_id,apar_name,address,place,province,Country_code,zip_code,telephone_1,comp_reg_no,acctype // TODO : constants...
3fdde318-0e77-4a41-b9b4-c4a7c2b29f74
3
@Override public String dataFromSignal(List<Double> output) { StringBuilder sb = new StringBuilder(); char curChar = 0; int posInChar = 0; for (Double doubleValue : output) { int bit = Math.min((int)Math.abs(Math.round(doubleValue.doubleValue())), 1); curChar |= bit << (charSize - 1 - posInChar++); //...
6d8b0c1c-d47d-4e68-ba66-37e787d64bed
2
public City getCityByName(String inCityName) { City tempCity = null; for (City city: db.getCityList()){ if (city.getCityName().equals(inCityName)){ return city; } } return tempCity; }
93314746-5287-4660-94a3-652fc3320e9b
5
@Override public String getCurrentReservationIndex() { Statement stmt = null; int max = 0; try { stmt = con.createStatement(); ResultSet results = stmt.executeQuery("Select * from Reservation"); while (results.next()) { String strnum = results.getString("ID"); int intnum = Integer.parseInt(st...
c66fc71b-d34f-4d24-a4cc-c516242dd89c
0
public RecursiveSolution(Peg x, Peg y, Peg z, int diskCount) { this.x = x; this.y = y; this.z = z; this.diskCount = diskCount; actions = new Stack<IPaintable>(); TowersOfHanoi.setCaption("Rekursyvus sprendimas. Atvaizduojamas kiekvienas pagrindinės funkcijos iškvietima...
7508973a-6776-4ad3-9cf1-af332b146e37
2
private String getFileName(MultivaluedMap<String, String> header) { String[] contentDisposition = header.getFirst("Content-Disposition").split(";"); for (String filename : contentDisposition) { if ((filename.trim().startsWith("filename"))) { String[] name = filename.split("="); String finalFileNa...
7cdf0c13-bded-4281-8075-5187a2bed413
3
public boolean validate(String s) { if (s == null) throw new NullPointerException("validate: null input"); failedTag = null; Matcher m = patt.matcher(s); while (m.find()) { String tagName = m.group(1); System.out.println(tagName); // If even one tag bad, we return false. if (!okTag(tagName)) ...
4462f267-aaa6-4f26-90f0-4558cfeb265b
5
public static <V,E> PositionalList<Vertex<V>> topologicalSort(Graph<V,E> g) { // list of vertices placed in topological order PositionalList<Vertex<V>> topo = new LinkedPositionalList<>(); // container of vertices that have no remaining constraints Stack<Vertex<V>> ready = new LinkedStack<>(); // ma...
6486c20e-52b9-4e0e-bd09-29ed878b7712
7
private void assignToSet(int i, double a, int y) { if (y == 1) { if (a > 0 && a < C) { i0.add(i); } if (a == 0) { i1.add(i); } else { i3.add(i); } } else { if (a > 0 && a < C) { i0.add(i); } if (a == 0) { i4.add(i); } else { i2.add(i); } } }
3db377fd-17ab-4c07-968d-13f63e11ebba
8
public boolean similar(Object other) { if (!(other instanceof JSONArray)) { return false; } int len = this.length(); if (len != ((JSONArray)other).length()) { return false; } for (int i = 0; i < len; i += 1) { Object valueThis = this.ge...
881ee49f-043a-45a5-a6ff-3f357eeb9bd7
7
public void attemptUpdate(String name, int totalCount) { int size = playerCountList.size(); //If the new entry exists in the list, then.... for (int i = 0; i < size; i++) { if (playerNameList.get(i).equals(name)) { //Shift everything up to fill the entry spot up. for (int j = i; j > 0; j--) ...
6821ddbb-a1cb-426c-a9e7-bbd4915e8992
0
public boolean isDead() { return this.hitpoints == 0; }
6ef0a42e-b4c1-42ac-8e2a-2b97326d254f
7
private void setBaud(int baud) { this.baud = baud; try { if (baud == 9600) p.writeBytes(BAUD9600); else if (baud == 57600) p.writeBytes(BAUD57600); else if (baud == 1200) p.writeBytes(BAUD1200); else if (baud == 19200) p.writeBytes(BAUD19200); else if (baud == 115200) p.writeBytes...
861ccb93-f196-4329-b27e-678cfb6a21d1
8
void generateTree(int nNodes) { boolean [] bConnected = new boolean [nNodes]; // start adding an arc at random int nNode1 = random.nextInt(nNodes); int nNode2 = random.nextInt(nNodes); if (nNode1 == nNode2) {nNode2 = (nNode1 + 1) % nNodes;} if (nNode2 < nNode1) {int h = nNode1; nNode1 = nNode2; ...
4cabfeee-13b7-4544-b1b5-d730580ff4c9
3
public static Method getMethodIfAvailable(Class<?> clazz, String methodName, Class<?>... paramTypes) { Assert.notNull(clazz, "Class must not be null"); Assert.notNull(methodName, "Method name must not be null"); try { return clazz.getMethod(methodName, paramTypes); } catch (NoSuchMethodException ex) { ...
acfc778e-0206-4f17-a198-91859d712a7e
1
private void compute_pcm_samples3(Obuffer buffer) { final float[] vp = actual_v; int idx = 0; //int inc = v_inc; final float[] tmpOut = _tmpOut; int dvp =0; // fat chance of having this loop unroll for( int i=0; i<32; i++) { final float[] dp = d16[i]; float pcm_sample; pcm_sample = (fl...
ff1e7bb8-d25b-4dce-99e6-9767595ea5e2
7
public static double getMetric(Evaluation eval, int metric_index) { switch (metric_index) { case METRIC_ACCURACY: return eval.pctCorrect(); case METRIC_RMSE: return 1.0 - eval.rootMeanSquaredError(); case METRIC_ROC: return eval.areaUnderROC(1); //TODO - is 1 right? case METRIC_PRECISION:...
de394020-1660-4e38-a2b3-5888f99c8559
4
public static List<String> getFiles(File dict) { List<String> files = new ArrayList<String>(); if (dict.listFiles().length > 0) for (File file : dict.listFiles()) { if (file.isFile() && file.getName().contains(".sc")) { files.add(removeExtension(file.getName())); } } return files; }
4dc8b2e4-492e-41ce-a307-e23c9d2c9817
7
public ArrayList<Boolean> cantoRealEnvido(boolean envido, boolean envidoEnvido,Contador contador, Maquina jugadorM, boolean mentir){ ArrayList<Boolean> respuesta = new ArrayList<Boolean>(); int resp = 0; boolean realEnvido = false; boolean faltaEnvido = false; boolean error = true; while(error){ Scanner ...
ded0b635-06f3-42aa-a1e9-95086c91ee68
3
private void createConnection() { try { ConnectionProperties properties = new ConnectionProperties(); Class.forName(SQL_DRIVER_NAME); // Create a connection to the database String url = SQL_DRIVER_URL.replace("{HOST}", properties.getHost()) .rep...
c460245a-9498-4d7f-b611-8ec76807a86a
1
public static void main(String[] args) { Punto[] puntos = {new Punto(3, 1), new Punto(5, -3), new Punto(7, 2), new Punto(-1, 0)}; final double[][] doubles = MetNumericos.splineCubicoNatural(puntos); for (int i = 0; i < doubles[0].length; i++) { double xi = puntos[i].getX(); ...
bbef9d4b-0c23-464b-a9da-4465ca65c295
3
@Override public void command(Command command) { if (up) { if (command == Command.UP) { parent.addEffectPackage(new EffectPackage(Effect.MOVE_UP, true, null)); } } else { if (command == Command.DOWN) { parent.addEffectPackage(new Ef...
41ec69e7-4497-4325-8f7b-891801f24c4f
8
@Override public void remove(FilterBypass fb, int offset, int length) throws BadLocationException { if (!ignoreInput) { if (!bypassRemove) { if (isReceivingInput && rangeStart > 0) { if (!(offset < rangeStart)) { if (!isInfi...
bce8fc48-2d46-4a96-b225-0fdb65e8cf50
1
public void sort(TreeContainerRow container) { if (!mSortData.isEmpty()) { container.sort(this); } }
a3624bb2-a519-4f74-b57a-4f9e5cd64181
8
void getNewPointAtRandom(double[] newPoint) { for (int j = 0; j < numOfParams; j++) { int nnn = 0; do { double R = gasdev(); newPoint[j] = pointsInSimplex[0][j] + stdDevOfPopulation[j] * R * bound[j]; nnn++; if (nnn == 1001)...
a15cd75b-8754-4b5d-92c9-75babae324a9
3
public void updateShots(float pf_width, float pf_height, Player player, Vector<Brick> bricks, Vector<BrickConfiguration> brickConfigurations, BreakoutCanvas canvas) { synchronized(shooterLock) { int index = 0; boolean shotsUpdated = false; while(!shotsUpdated) { shotsUpdated = true; fo...
cf78f6b7-d96e-4624-b0c7-9140c0b55e0b
2
public void startTransfer(String serviceName, String otherUser) { // Refuse all other offers, then the service will start HashMap<String, String> serviceHashMap = this.matchingUsers .get(serviceName); for (String user : serviceHashMap.keySet()) { if (user.equals(otherUser)) { serviceHashMap.put(user, S...
bbff5be0-048e-4e8f-8a50-df2bf19ad5d7
9
public static List<Wall> tesselate(List<Wall> walls) { Collections.sort(walls, new WallComperator()); ArrayList<Wall> newWall = new ArrayList<Wall>(); ArrayList<Wall> toDelete = new ArrayList<Wall>(); Wall last = null; // newWall.add(last); System.out.println(walls.size()); Object[] wallArray = walls.toA...
693343b8-d572-4fc8-b58d-504e915e9345
0
public void keyPressed(KeyEvent e){ keys[e.getKeyCode()] = true; }
332e43d6-680b-493f-8b03-902fe34512b8
7
public void parseError( int startPosition, int endPosition, int currentToken, char[] currentTokenSource, String errorTokenName, String[] possibleTokens) { if (possibleTokens.length == 0) { //no suggestion available if (isKeyword(currentToken)) { String[] arguments = new String[] {new String(currentTokenSou...
1f942cf2-fdf2-4be9-ae75-a48fef30e737
4
public static double binaryShannonEntropyNat(double p) { if (p > 1.0) throw new IllegalArgumentException("The probabiliy, " + p + ", must be less than or equal to 1"); if (p < 0.0) throw new IllegalArgumentException("The probabiliy, " + p + ", must be greater than or equal to 0"); double entropy = 0.0D; if (p...
66db0291-8c24-4e0d-b37c-8c29698f4c95
6
public Map<String, Double> getTimeForLargestUnpaid() { Connection connect = null; Statement statement = null; ResultSet resultSet = null; Map<String, Double> ret = new HashMap<String, Double>(); try { // First connect to the database connect = DriverManager.getConnection("jdbc:mysql://localhost:3306/...
67b367fd-c788-46e0-be30-6dcea0d27495
7
public static HashMap<Integer, Integer> get(int number) { if (number > max) { return null; } final int start = 2; final int end = number; final HashMap<Integer, Integer> pfs = new HashMap<Integer, Integer>(); while (number >= start) { for (int n = ...
049d92f0-17c6-4411-aa0c-9fb5661a101f
1
private void loadPreviousFonts() { this.previousFonts = new ArrayList<Font>(); for (int i = this.startFrom; i <= this.endAt; i++) { this.previousFonts .add(this.document.getChildren().get(i).getFont()); } }
6e09df86-af76-40b6-9166-f1cafa5820f3
7
public boolean equals(Object _other) { if (_other == null) { return false; } if (_other == this) { return true; } if (!(_other instanceof GroupMembers)) { return false; } final GroupMembers _cast = (GroupMembers) _other; if (groupId != _cast.groupId) { return false; } if (gr...
64c90903-c36d-48ff-942a-476ae42ff669
3
public static void traceSpec(Class<?> cls, final String msg) { if (DEBUGGING && debuggingActivityList.contains(cls.getSimpleName())) System.out.println(msg); }
b6e178d8-ee73-4e4c-982d-30b3c56cf76f
3
public void loadDescription() throws SAXException, IOException { URLConnection urlConn = new URL(getLocation()).openConnection(); urlConn.setReadTimeout(HTTP_RECEIVE_TIMEOUT); XMLReader parser = XMLReaderFactory.createXMLReader(); parser.setContentHandler(new GatewayDeviceHandler(this)...
b7c8b153-8b9a-41f3-b560-3ee121e5f5d4
0
public FileFilter getDirectoryFilter() { return dirFilter; }
9509759c-b38d-4c83-b46b-a39c7a98835c
2
public boolean kolmoset(){ for(int i=0; i<5; i++){ if(nopat[i].getValue()==3){ return true; } } return false; }
aaf93185-becc-4382-83f2-426f1a32a8fc
6
@Override public ArrayList<Task> findAll() { ArrayList taskList = new ArrayList(); try { connection = getConnection(); ptmt = connection.prepareStatement(QUERY_SELECT + ";"); resultSet = ptmt.executeQuery(); while (resultSet.next()) { T...
0a3ee780-3303-4cad-ba6c-c1eaf4c14985
4
public static String getDescription(int type) { String desc = ""; switch (type) { case HONG_TAO: desc = "hongtao"; break; case FANG_PIAN: desc = "fangpian"; break; case MEI_HUA: desc = "meihua"; break; case HEI_TAO: desc = "heitao"; break; } return desc; }
8c11a442-0ee1-4d08-8df0-c6ca714c06ee
4
@Override public void modelPropertyChange(PropertyChangeEvent pce) { switch (pce.getPropertyName()) { case DialogWindowController.INIT : { display(); break; } case DialogWindowController.PERCENTAGE : { progressBar.setValue((Integer) pce...
6c293067-5529-426c-abc2-656614673af3
2
public void open() { Display display = Display.getDefault(); createContents(); shlFscDatabase.open(); shlFscDatabase.layout(); while (!shlFscDatabase.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } }
2076062f-b9a5-4006-a409-8b0405024d38
0
public T get(int i) { return coordonnees.get(i&1); }
8a3624be-19a3-45a7-ae20-2b7844b2a5e8
9
public void replaceSelection(String text) { // It's legal for null to be used here... if (text==null) { handleReplaceSelection(text); return; } if (getTabsEmulated() && text.indexOf('\t')>-1) { text = replaceTabsWithSpaces(text, getTabSize()); } // If the user wants to overwrite text... if (te...
f4fb9329-c83f-4620-b24d-8bbe680731b6
9
@Override public String toString() { return "BandApplication {" + (extReferences != null ? " extReferences [" + extReferences + "]" : "") + (cls != null ? " cls [" + cls + "]" : "") + (idx != null ? " idx [" + idx + "]" : "") + (recommendedValue != null ? " recommendedValue [" + recommende...
873cd829-94c6-454e-bf8b-191bfc7d8209
5
@Override public Model getRotatedModel() { Model model = spotAnimation.getModel(); if (model == null) { return null; } int frameId = -1; if (spotAnimation.sequence != null) { frameId = spotAnimation.sequence.frames[relapsedFrames]; } Mo...
151d7793-3140-4981-9d01-9bafd267d529
9
public void scrollCellToView(JTable table, int rowIndex, int vColIndex) { if (!(table.getParent() instanceof JViewport)) { return; } JViewport viewport = (JViewport) table.getParent(); Rectangle rect = table.getCellRect(rowIndex, vColIndex, true); Rectangle viewRect =...
280d068d-db42-4ce8-ba6d-43af6c4a7169
2
public static void main(String[] params) { try { decompile(params); } catch (ExceptionInInitializerError ex) { ex.getException().printStackTrace(); } catch (Throwable ex) { ex.printStackTrace(); } printSummary(); /* * When AWT applications are compiled with insufficient classpath the * type g...
c213203e-c113-4ab1-8196-1931227fd407
5
public int saveLineUp(LineUp lup) throws SQLException { // Initialise the return value Groop grp = lup.getGroop(); // Check to see if this lineup already exists Collection<LineUp> currentLineups = grp.getLineUps(); for (LineUp lineUp : currentLineups) if (lineUp.equals(lup) &...
6f35f1e3-e65b-48b1-953f-c3c2c186f9b1
0
public void driver() { System.out.println("bmw car drive"); }
85131eb5-d89d-4f04-bb63-f78a981435ce
9
private Locale getLocale() { Locale userlocale = null; if (localeName.length() > 0) { int firstuscore = localeName.indexOf('_'); int seconduscore = -1; String language = null; String country = null; String variant = null; if (firstu...
cc9f7db7-8a14-452b-adb2-5aa660575c23
1
public void connectProcessors(ProcessorList processors) throws Exception { for(Processor processor : processors) { processor.setEventBus(this); } }
93ff478b-994f-451e-9fac-09eff6ebee3a
9
public static void main(String[] args) throws Throwable{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); TreeMap<String, TreeMap<Character, Integer>> palabras = new TreeMap<String, TreeMap<Character,Integer>>(); for(String ln; !(ln = in.readLine(...
8a74bc2a-0a69-4642-a396-d4c8d2b4188d
1
public static String changeReturnType(String classname, String desc) { int i = desc.indexOf(')'); if (i < 0) return desc; else { StringBuffer newdesc = new StringBuffer(); newdesc.append(desc.substring(0, i + 1)); newdesc.append('L'); n...
fcca01c9-a800-4ffc-93fe-5a5d140364d2
7
@Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof CanjeaPK)) { return false; } CanjeaPK other = (CanjeaPK) object; if (this.clienteId != other.clienteId) { ...
834ec886-6f59-4173-aacb-3b5243dbacb2
9
public static byte[] decode(String s) { int end = 0; // end state if (s.endsWith("=")) { end++; } if (s.endsWith("==")) { end++; } int len = (s.length() + 3)/4 * 3 - end; byte[] result = new byte[len]; int dst = 0; try { for(int src = 0; src< s.length()...
1fb44498-d0a6-45f5-ae6c-5955efb0a92c
8
static Ops ops(Object x){ Class xc = x.getClass(); if(xc == Integer.class) return LONG_OPS; else if(xc == Double.class) return DOUBLE_OPS; else if(xc == Long.class) return LONG_OPS; else if(xc == Float.class) return DOUBLE_OPS; else if(xc == BigInt.class) return BIGINT_OPS; else if(xc == BigInteger.cl...
ec310137-56c3-4d58-bbc7-8d6d6f04d5f1
7
public static void setZeros(int [][] matrix){ int nrows = matrix.length; int ncolumns = matrix[0].length; BitSet rows = new BitSet(nrows); BitSet columns = new BitSet(ncolumns); for(int i = 0; i < nrows; i++){ for(int j = 0; j < ncolumns; j++){ if(matrix[i][j] == 0){ rows.set(i); columns.s...
450fff3f-94ad-4a58-8e08-9a500409fcfc
0
public AutomataTransitionEvent(Automaton auto, Transition transition, boolean add, boolean change) { super(auto); myTransition = transition; myAdd = add; myChange = change; }
415833a4-2f59-4b50-8ec4-b550b00d5ce5
9
@Override protected void parseFrame() throws MessageValidationAssertionException { // Initial parsing of IP message. // BACnet/IP if (queue.pop() != (byte) 0x81) throw new MessageValidationAssertionException("Protocol id is not BACnet/IP (0x81)"); ...
dbaa104d-d5ae-4df3-8c3b-1869351725ca
5
@Override public void render(Screen screen) { // Cut panel textures if (mainBitmap != Art.button[0][0]) { mainBitmap = Art.button[0][0]; trCorner = new Bitmap(5, 5); trCorner.blit(mainBitmap, - BUTTON_WIDTH + 5, 0); dlCorner = new Bitmap(5, 5); dlCorner.blit(main...
6245a29e-2013-4b9c-bce5-51519ce26b88
7
* @param xxx * @param yyy * @param zzz */ public void renderBrewingStand(int textureId, int xxx, int yyy, int zzz, BlockType block, int tex_offset) { float x = xxx + this.x*16; float z = zzz + this.z*16; float y = yyy; float zero = 0f; float one = .0625f; float two = .125f; float three = .1875f; ...
8d504017-a666-4fa0-88c7-0b45aca8cacf
4
private void rotate() { //orient++; if (orient%4==0) { litPositions=new int[][] {{1,0,0}, {1,1,1}, {0,0,0}}; } if (orient%4==1) { litPositions=new int[][] {{0,1,1}, {0,1,0}, {0,1,0}}; } if (orient%4==2) { litPositions=new int[][] ...
21a1c3d8-2a06-427c-88d4-a8fd01e74a07
0
private TestLinkId(final T id) { this.id = id; }
7b995b5b-6a59-42b4-9528-67eb2722d1c4
6
@Override public void simpleUpdate(float tpf) { if (!initialized) return; // don't run updates before everything is initialized // Check that all GameObjects have GrahpicsObjects for (sharedstate.GameObject obj : state.getObjects()) { if (!objs.containsKey(obj)) { if (obj instanceof sharedstate.Player...
6fb8a204-7d21-4e9d-98c4-9bca84ac1104
0
@Override public Iterator getExtensions() { return extensions.keySet().iterator(); }
91f47a6d-27f9-4b7b-ba79-faa85cf2c938
9
@SuppressWarnings("unchecked") private void getClaimList() { titleDLM.removeAllElements(); claimResultList = claim.getClaims(fileName, CLAIM, teamType); if (claimResultList.size() != 0) { for (int i = 0; i < claimResultList.size(); i++) { titleDLM.addElement(claimResultList.get(i).getTitle()); } tit...
f2308f91-0797-4c2f-80f1-3c9f7f34c784
0
protected void docClosingChores(Document document) {}
8870b568-3e7a-413e-a07b-ca2b838e52b9
8
public void actionPerformed(ActionEvent arg0) { //Conditionals to Validate Which button was pressed if(arg0.getActionCommand().equals("Begin Match Upload")) { //Validate at Least One Connected Client if(numConnected >= 1) { //Send Match Data to Clients if(MainThread.uploadQueues[0] != null) ...
343b331c-2cb2-4719-9a35-88a5aaa6276e
1
protected final Set<String> getList(String section) { ConfigurationSection sec = yamlConfiguration.getConfigurationSection(section); if (sec == null) { sec = yamlConfiguration.createSection(section); } return sec.getKeys(false); }