method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
3bbeeb66-b738-4571-a6be-3d80d35d93f8
7
private void cisaoArvoreB (NoB cabecalho) { int n = 0; NoB temp1; NoB temp2; NoB pag1 = cabecalho; //cabecalho e' o cabeçclho da página desbalanceada NoB pag2 = new NoB(pag1.chave - MIN_CHAVES - 1, null, pag1, null); pag1.chave = MIN_CHAVES; temp1 = pag2.proximo; while (n <= MIN_CHAVES) { //temp1 apo...
00e39d7e-00e0-4b74-86e4-45491ac45491
9
public void mousePressed(MouseEvent e) { boolean shifted = (e.getModifiers() & InputEvent.SHIFT_MASK) != 0; boolean ctrl = (e.getModifiers() & InputEvent.CTRL_MASK) != 0; boolean alt = (e.getModifiers() & InputEvent.ALT_MASK) != 0; //System.out.println("mousePress, mod="+e.getModifiers()+", shifted="+shif...
35c0c28b-1507-45bf-85a2-f15fbb712256
5
@SuppressWarnings("deprecation") public static boolean addNewSchedule() { start=new JTextField(10); end=new JTextField(10); wage=new JTextField(10); vacation= new JTextField(10); startL=new JLabel("Start Time:"); endL=new JLabel("End Time:"); vacationL=new JLabel("Vacation days:"); wageL=new JLabel(...
d8bd8558-e499-4a11-be4b-50ff9016dd1c
7
public void handleInput() { if (Keys.isPressed(Keys.ESCAPE)) gsm.setPaused(true); if (player.getHealth() == 0) return; player.setUp(Keys.keyState[Keys.UP]); player.setDown(Keys.keyState[Keys.DOWN]); player.setLeft(Keys.keyState[Keys.LEFT] || Keys.keyState[Keys.A]); player.setRight(Keys.keyState[Keys.R...
4415cd6a-589a-4289-967a-58d1a6435abc
3
public boolean setDecoderProperties(byte[] properties) { if (properties.length < 5) { return false; } int val = properties[0] & 0xFF; int lc = val % 9; int remainder = val / 9; int lp = remainder % 5; int pb = remainder / 5; int dictionarySize ...
67a9734c-5113-4b03-8421-946f90323ce7
8
public void checkChair(){ System.out.println("checking chair"); if(getCurrentCity() == 1){ if(inside){ if(lvl.c1i.chairsInsideOne.containsKey(currentBuilding)){ System.out.println("found chair"); Set<Chair> checkChair = lvl.c1i.chairsInsideOne.get(currentBuilding); for(Chair c : checkChair)...
18ed594f-0904-4119-b83d-7017dd32e0e7
6
public void unpackImages() { int origIndexOffset = this.indexStream.offset; int origDataOffset = this.dataStream.offset; while (this.dataStream.offset < this.dataStream.payload.length) { int drawOffsetX = this.indexStream.getSignedByte(); int drawOffsetY = this.indexStream.getSignedByte(); int width = t...
98e9a94d-94e1-48f7-9099-42740fd9c765
0
@Test public void validationPositiveAfterNegativeTest() { view.getNumberOfPointsTextField().setText("aaa"); view.getNumberOfPointsTextField().getInputVerifier().verify(view.getNumberOfPointsTextField()); assertFalse(view.getDrawButton().isEnabled()); view.getNumberOfPointsTextField()...
f6c80c86-2db6-4d3f-bc79-de14e45ff363
3
private synchronized void saveClassFile() { /* getMembers() and releaseClassFile() are also synchronized. */ if (classfile == null || hasMemberCache() != null) return; ByteArrayOutputStream barray = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputS...
9df66d02-64b7-41c5-aa94-de1f7241e8fe
7
public ArrayList<BankAccount> getBankAccounts() { if (!Constants.Banking) { return null; } Connection conn = null; ResultSet rs = null; PreparedStatement ps = null; ArrayList<BankAccount> banks = new ArrayList<BankAccount>(); try { conn = iConomy.getiCoDatabase().getConnectio...
46527ad5-cceb-4ac8-861f-fd5430a9c50c
4
public String login(String login, String password){ String confirmacion = ""; for(int i = 1; i < usuarios.size(); i++){ if((login.equals(usuarios.get(i).getLogin())) && (password.equals(usuarios.get(i).getPass()))){ confirmacion = confirmacion + "Usuario logueado exitosamente"; usuarioLogueado = usuarios...
0f98a210-b4a4-4e30-91f2-253ee25bf906
8
public void importFile() { if (location == null) { return; } try { JagexBuffer buffer = new JagexBuffer(DataUtils.readFile(location)); main = Utilities.readHeaderChunk(buffer); Utilities.readTypeChunk(main, buffer); int children = buffer.getShort(); if (children != 0) { for (int index = 0; i...
26369224-16e7-46a5-9d89-c8a29038660e
4
public void build(String prefix, File dir) { File[] files = dir.listFiles(); // Consider every file in the current directory for (File file : files) { if (file.isDirectory()) { // It's a directory, so make a recursive call into the directory if (DEBUG) System.out.println("directory: " + prefix+file.getName(...
03bc9c47-1c08-4fe5-9eab-2d482cb495c9
5
@Override protected int drawSelectedText(final Graphics g, int x, int y, int p0, int p1) throws BadLocationException { // Same as drawUnselectedText, but without colors. final Font boldFont = g.getFont().deriveFont(Font.BOLD); final Font plainF...
16bad970-7c99-4bf5-ab75-3d707b98ae74
9
public void actionPerformed(ActionEvent e) { if(e.getActionCommand().equals("minimizeView")) { appConfig.guiControlPanelShowFullViewPanel = false; createViewPanel(); } else if(e.getActionCommand().equals("maximizeView")) { appConfig.guiControlPanelShowFullViewPanel = true; createViewPanel(); } else if...
54cb7d17-720f-47d6-9230-86ee4cb6e8d6
0
public SelectionDrawer(Automaton automaton) { super(automaton); }
4e171786-3e24-46d6-bc57-89b6fbaf1b11
0
protected int getMaxLitterSize() { return MAX_LITTER_SIZE; }
c5e118da-726d-4e76-9b53-15085d76edad
6
@Override public int compareTo(final BitArray o) { int res; int i = 0; int thisByte, otherByte; while (true) { thisByte = (i < bits.length ? bits[i] : 0) & 0xFF; otherByte = (i < o.bits.length ? o.bits[i] : 0) & 0xFF; res = Integer.compare(thisByte, otherByte); i++; if (res != 0) { return re...
e25074ab-4e3f-4f95-b8c9-02f0504a45df
8
public List<List<Datum>> yieldExamples(List<Datum> data) { List<List<Datum>> examples = new ArrayList<List<Datum>>(); List<Datum> buffer = new ArrayList<Datum>(); for (Datum datum : data) { if (datum.word.equals(FeatureFactory.START_TOKEN)) { // Clear buffer if we a...
ecf28704-b2a6-4864-a787-1a180995311f
2
public void exportExcel(HSSFWorkbook workbook, String path) { FileOutputStream out = null; try { out = new FileOutputStream(path); workbook.write(out);// workbook对象数据持久化,创建Excel out.close(); if (path != null) { path = path.substring(path.lastIndexOf(File.separator) + 1); } System.out.println(p...
cc6207f7-e6fe-4c8e-96c9-270973cf72f2
7
public void moveWest() { boolean [] temp = WhenShitHits.Enemy2Setpiece(this, 7); if(temp[3] == false) { if(direction != 7) { direction = 7; anamationFrame = 0; pic = westAnamation()[anamationFrame]; animate = false; if(animationTimer.isRunni...
2a8a4a8e-d082-47c2-85bc-4d9207af7cfb
8
public void onTick() { int previousDistance = -1; int previousI = -1; for (int i = 0; i < Screen.enemyList.size(); i++) { if (new Ellipse2D.Double((x * Frame.sizeMultiplier) + (Constants.tileSize / 2) - (Constants.towerDiameters[this.towerID] / 2), (y * Frame.sizeMultiplier) + (Constants.tileSize / 2) - (Co...
37645164-9f78-4b28-aa5d-f83f8f81793a
8
public List<String> findLongestSubstring(String A, String B) { int[][] table = new int[A.length()][B.length()]; List<String> results = new ArrayList<>(); int max = 0; List<Integer> pos = new ArrayList<>(); for (int a = 0; a < A.length(); a++) { for (int b = 0; b < B.length(); b++) { if (A.charAt(a) == ...
503716ae-4ba0-4164-898c-2bddbe622b46
6
public static HashMap<String, HashMap<String, Integer>> getMap(String filePath) throws Exception { HashMap<String, HashMap<String, Integer>> map = new HashMap<String, HashMap<String,Integer>>(); BufferedReader reader = filePath.toLowerCase().endsWith("gz") ? new BufferedReader(new InputStreamReader( ...
91c73235-ec0c-42d3-841a-9d5f5802dfa8
7
void initEntity(int locationX, int locationY) throws SlickException { // spawn at curX = locationX; curY = locationY; nextX = locationX; nextY = locationY; // Initialize collision ranges rec.setCenterX(curX + centerOfSprite); rec.setCenterY(curY + centerOfSprite); sightRadius.setCenterX(curX + centerO...
7c4b5032-c7a3-4f23-ab43-a6c520d398dd
2
private void unRegisterPlayer(Color c) { if ( c == Color.white ){ white_player = null; } else if ( c == Color.black ){ black_player = null; } }
dd58a927-0d27-44e0-bcc2-acfae524bfe0
1
public IndestructibleBrickView (int x, int y) { BufferedImage img = null; try { img = ImageIO.read(new File("src\\jark\\ibrick.png")); this._elementSprite = new Sprite(img,x,y); } catch (IOException e) { e.printStackTrace(); ...
ab5da444-f819-4a8c-8748-9b1c6915191d
8
public String minWindow(String S, String T) { int start=0,end=0; String result = ""; int[] expect = new int[256]; int[] lcount = new int[256]; int found=0,min=Integer.MAX_VALUE,temp; int i,j,k; for(i=0;i<T.length();i++){ expect[(int)T.charAt(i)]++; ...
73dcaae5-74f0-40bd-b1b3-fd828e423e72
6
public ArrayList<ArrayList<Item>> getBankTabs() { if (!ctx.bank.opened() || (ctx.bank.currentTab() != 0 && !ctx.bank.currentTab(0))) { return null; } ArrayList<ArrayList<Item>> tabs = new ArrayList<ArrayList<Item>>(); for (BankTab tab : BankTab.values()) { final ItemQuery<Item> items = getItemsInTab(tab)...
1f0c34cd-4800-42aa-b054-7864df8bdae0
2
public void giveResourceType(String str) { if (str == null || str == "DESERT") { return; } resources.put(str, resources.get(str) + 1); }
2beed88e-68fb-4112-baa4-70cebcf7d566
8
private void controlSpecializedTown(Town town){ // Correspondance entier-ressource : 0 = bois ; 1 = mouton ; 2 = ble ; 3 = argile ; 4 = minerai. if(town.getSpecialization()=="bois") {specializedResources[0]=2;} if(town.getSpecialization()=="mouton") {specializedResources[1]=2;} if(town.getSpecialization()=="ble"...
01258d74-c86a-4d10-a2cd-10e89c2fce04
5
private MoveDirection getPlayerMove() { MoveDirection moveDirection = null; try { Terminal terminal = Terminal.setupTerminal(); int c = terminal.readVirtualKey(System.in); if (c == VIRTUAL_LEFT) { moveDirection = MoveDirection.MOVE_LEFT; } else if (c == VIRTUAL_RIGHT) { moveDirection = MoveDirec...
5e62c6f7-94e7-4c0f-a523-9c4ca16dfbd3
6
private void gem_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gem_buttonActionPerformed int aer = 0; int sagstype = 0; String sagssted = sagssted_textField.getText(); String paragraf = paragraf_textField.getText(); String foranstaltningsnavn = foranst...
c59bd422-905b-4846-a56c-c09d9b6e246b
8
public void recordRoll(int pinsKnockedDown) { assert 0 <= pinsKnockedDown : "pinsKnockedDown = " + pinsKnockedDown + " < 0!"; assert pinsKnockedDown <= 10 : "pinsKnockedDown = " + pinsKnockedDown + " > 10!"; assert (getCurrentBall() == 1) || ((getCurrentBall() == 2) && (((getCurrentFrame() == 10) && isStrikeOrSp...
90ba22f8-7206-41e5-82fb-3aa39ad75ddd
6
public final Variable factor() throws RecognitionException, TokenStreamException { Variable result = new Variable("","","");; Token i = null; Token n = null; Token n2 = null; Variable e; try { // for error handling switch ( LA(1)) { case IDENT: { i = LT(1); match(IDE...
6857c950-9561-4cfc-aa69-eef706d2160a
9
public void textCreator() throws IOException, ParseException { Permutas_Main rvp1 = new Permutas_Main(); // Declare some variables String date = ""; String towrite = ""; String path = ""; // GET ROOT FILE File dir1 = new File(onMac); //"C:/Documents and ...
457c9cb8-e83f-4f6c-87a2-7fab8dddb850
4
@EventHandler(priority = EventPriority.HIGH) public void onPlaceBlock(BlockPlaceEvent event){ Player player = event.getPlayer(); if(!player.hasPermission("NodeWhitelist.Whitelisted")){ if(!whitelistWaive.isWaived(player)){ if(!Config.GetBoolean("NoneWhitelisted.Restraints.Interact")){ if(!Config.GetStrin...
d784d9cc-f17d-425f-8806-6c6cc91983ec
2
public void updatePerson(P p) throws InvalidFieldException { // is the ID in use in the game data? GameData g = GameData.getCurrentGame(); boolean valid; InvalidFieldException ie; if (p instanceof Contestant) { valid = g.checkID((Contestant)p, Contestant.class); ie = new InvalidFieldException(Field....
71a8580e-7852-4dbe-b749-da49dcb38177
4
public void setComando(List<?> list) { for(PComando e : this._comando_) { e.parent(null); } this._comando_.clear(); for(Object obj_e : list) { PComando e = (PComando) obj_e; if(e.parent() != null) { e.pa...
af8a1252-3dd2-4daa-b057-e7ae259484c5
3
private static void nodeToText(StringBuilder sb, NodeList nodeList) { for (int i = 0; i < nodeList.getLength(); i++) { Node node = nodeList.item(i); if (node.getNodeType() == Node.TEXT_NODE) { sb.append(node.getTextContent()); ...
29fca01c-c24b-476b-8e89-5f586b0de938
8
@Test public void testUpgradeWriteDeadlock() throws Exception { System.out.println("testUpgradeWriteDeadlock constructing deadlock:"); SimpleAction p0_read = new SimpleAction(p0, Permissions.READ_ONLY); SimpleAction p0_write = new SimpleAction(p0, Permissions.READ_WRITE); LockGrabber lg1 = startG...
bf3ddcab-3c99-43ef-bff5-c7120f42c69e
1
public static void main(String[] args) throws Exception { OuroborosLexer lex = new OuroborosLexer(new ANTLRFileStream(args[0])); CommonTokenStream tokens = new CommonTokenStream(lex); OuroborosParser parser = new OuroborosParser(tokens); try { parser.expr(); } cat...
4a861ed7-b2df-48ef-8a21-a8783c5d6417
7
private void createTextureFromImage(BufferedImage image, int mipMapLevel) { int width = image.getWidth(); int height = image.getHeight(); boolean hasAlpha = image.getColorModel().hasAlpha(); ByteBuffer buffer = ByteBuffer.allocateDirect((hasAlpha ? 4 : 3) * width * height); for (int y = 0; y < height; ++y) ...
cddd25e6-5f8e-4e24-99d2-755d6352aa10
2
private static void openFileDialog(Shell shell) { FileDialog dialog = new FileDialog(shell, SWT.OPEN); String[] filterNames = new String[] { "Image Files", "All Files (*)" }; String[] filterExtensions = new String[] { "*.gif;*.png;*.xpm;*.jpg;*.jpeg;*.tiff", "*" }; String filterPath = "/"; String platform = S...
d52fb678-fcae-4309-bed5-6b14c96fecfe
3
private void setExtensions(FileFormat format, Vector extensions) { if (extensions == null) { return; } for (int i = 0, limit = extensions.size(); i < limit; i++) { // the first extension in the set is the default if (i == 0) { format.addExtension(((String) extensions.get(i)).toLowerCase(), true); ...
fd730137-5ec6-424e-89ca-e39a433d4f7d
1
public Move chooseMove(State s) { if(s.getnBlue()+s.getnRed()<25){ return mp.chooseMove(s); } else{ return mc.chooseMove(s); } }
2b8a37fa-5941-484e-b485-2e49733b1d50
6
@Override public String getColumnName(int column) { switch (column) { case 0 : return "Код преподавателя"; case 1 : return "Имя"; case 2 : return "Отчество"; case 3 : return "Фамилия"; ...
4f8af74d-2767-4b9a-bd26-ebf5cabb52de
0
protected void addEquivalence(Equivalence equivalence) { this.equivalenceList.add(equivalence); }
953534bb-4f23-4109-82bd-b657efb8f2fc
3
public List getSpawnableList(EnumCreatureType var1) { return var1 == EnumCreatureType.monster?this.spawnableMonsterList:(var1 == EnumCreatureType.creature?this.spawnableCreatureList:(var1 == EnumCreatureType.waterCreature?this.spawnableWaterCreatureList:null)); }
50643373-7b87-4236-9bbd-7c80c42a7b08
6
@Override public void start(final Stage stage) { this.stage = stage; gridMenu = new GridPane(); gridMenu.setVgap(5); tabelaSettings(gridMenu); fitFunctionLabel = new Label("Funkcja przystosowania"); fitFunctionLabel.setFont(Font.font("Tahoma", FontWeight.NORMAL, 15)); fitFunctionLabel.setStyle("-fx-tex...
773370db-e773-4b86-a03d-526247649f65
9
@SuppressWarnings("unchecked") @Override public void init() throws Exception { endpoint.setName(getName()); endpoint.setHandler(cHandler); // Verify the validity of the configured socket factory try { if (isSSLEnabled()) { sslImplementation = (SSLImplementation<NioChannel>) SSLImplementation .ge...
e76e9df9-aafc-4b0c-9ee6-449d50055801
9
private static void dfs(char[][] s, int x, int y) { if(s[x][y] != 'O') { return; } s[x][y] = 'Y'; if(x-1 >= 0 && s[x-1][y] == 'O') { dfs(s,x-1,y); } if(x+1 < s.length && s[x+1][y] == 'O') { dfs(s,x+1,y); } if(y-1 >=...
dcfaefb4-76e4-4d13-8774-e31ae7d5ca7f
2
public void renderItem(int x, int y){ if(inventory.size() > (y * width) + x){ Item item = inventory.get((y * width) + x); if(item != null) { item.render(x * 48 + 16 + xOff + 4, y * 48 + 16 + yOff + 4, 24); } } }
facd69a4-da89-4f9a-bb28-4ebad07ffcb1
1
public TimerPanel(Widget parent){ super(new Coord(250, 100), Coord.z, parent, "Timers"); justclose = true; btnnew = new Button(Coord.z, 100, this, "Add timer"); synchronized (TimerController.getInstance().timers){ for(Timer timer : TimerController.getInstance().timers){ new TimerWdg(Coord.z, this, timer); ...
f3f9fe17-9f1a-4d76-9005-67096ce866e9
9
public synchronized GOTreeNode getLCA(GOTreeNode annotation) { GOTreeNode lca = cachedLCAs.get(annotation); if (lca == null) { lca = goTree.getRoot(); int lcaDepth = goTree.getRoot().getDepth(); int distanceLCAToAnnotation = lca.getDistanceToAnnotation(annotation); ...
861c94ec-3bf8-44cf-8f83-377900cd3b40
7
public static List<Integer> computeIntersectsTransitiveClosure(List<IIntervalsTimeDomain> domains, List<Integer> seed) { // set cache matrix for storing intersects relation IntMatrix intersects = new IntMatrix(domains.size()); List<Integer> closure = new ArrayList(seed); ...
83ae8db9-9750-4a85-bd27-bd042e97bcef
0
public void setJoystickHandler(ROJoystickHandler assignedJoystickHandler) { joystickHandler = assignedJoystickHandler; }
60dccc4a-1122-4188-ac6e-ea281253b54d
0
@Basic @Column(name = "PCA_FECMOD") public Date getPcaFecmod() { return pcaFecmod; }
51490c75-86bd-4166-a810-cf1eea1ddd9c
8
public void addPlayerMenu(JMenuBar menuBar) { JMenu playerMenu = new JMenu("Player"); menuBar.add(playerMenu); //Blue Player Menu JMenu blueMenu = new JMenu("Blue"); JRadioButton blueMiniMaxRadio = new JRadioButton("MiniMax"); JRadioButton blueQuiescenceRadio = new JRadioButton("Qui...
800441c8-4f6a-47aa-bcd8-624d66f19ecb
3
public void tick60hz() { if (this.interval == 0) return; if (++this.intCount >= this.interval) { if (this.interruptMessage != 0) this.dcpu.interrupt(this.interruptMessage); this.intCount = 0; this.ticks++; } }
fcc0ca58-fcc6-440f-93b3-f125441ed934
4
public void deleteQuery(String query) { try { Connection connection = getConnection(); Statement statement = connection.createStatement(); statement.executeQuery(query); } catch (SQLException ex) { if (ex.getMessage().toLowerCase().contains("locking") || ex.getMessage().toLowe...
5e0437b3-1d97-43dd-b4a4-82f538a9e5af
1
@Override public void newAttribute(String key, Object value, boolean isReadOnly, AttributeTableModel model) { AttributeContainer node = view.tree; if (node == null) { return; } model.keys.add(key); model.values.add(value); model.readOnly.add(new Boolean(isReadOnly)); node.setAttribute(key, v...
18690a4a-d167-4ffc-af79-10b8ec2ee062
3
public boolean listFilesServer(String pathname) throws IOException { output.writeInt(3); output.writeUTF(pathname); output.flush(); ArrayList<String> listeFichiers = new ArrayList<String>(); try { ObjectInputStream objectInput = new ObjectInputStream(clt....
3dcd9069-9a03-4878-88bf-33197311685a
8
Integer calculateNumberOfTripsWithSteps(String nodeFromId, String nodeToId, Integer steps, Boolean mustBeExact) throws NodeDoesNotExistInGraphException { Node nodeFrom = railRoad.getGraph().getNode(nodeFromId); Node nodeTo = railRoad.getGraph().getNode(nodeToId); Integer result = 0; Arra...
32330b1c-a567-4a4f-8b10-2202e82455e8
3
public void animateWelcome() throws InterruptedException { Thread.sleep(1000); for(char c:"YAMG".toCharArray()) { stringShownYAMG.append(c); image.repaint(); Thread.sleep(300); } for(String str:new String[] {"Yet ", "Another ", "Mining ", "Game"}) { stringShownYAMG2.append(str); image.repaint(); ...
5ce85166-4c92-4df2-9341-a9cf50990887
8
public static void n087() { for (Constructor<?> constructor : File.class.getConstructors()) { String name = constructor.getName(); Class<?>[] type = constructor.getParameterTypes(); boolean mod = Modifier.isPublic(constructor.getModifiers()); } for (Method me...
f19fe4ef-f833-42fe-83e1-3458a1b8425e
9
@Override public boolean equals(Object obj) { if (obj instanceof JProperty) { JProperty p = (JProperty)obj; if (name != null) { if (p.name == null) return false; if (!name.equals(p.name)) return false; } else { if (p.name != null) return false; } if (value != null) { if (p.value == ...
7a7eacc8-e054-42ca-a1c3-48e29b9bb44f
9
private void setOutputFormatNominal() { FastVector newAtts; int newClassIndex; StringBuffer attributeName; Instances outputFormat; FastVector vals; // Compute new attributes newClassIndex = getInputFormat().classIndex(); newAtts = new FastVector(); for (int j = 0; j < getInputForm...
a704d0f8-e950-4d9c-82d0-a9eccc44d4e8
9
private void dealWithBufferedOperation() { Map<Integer, Operation> backupbufferedOperation = new HashMap<Integer, Operation>(); for(int i: bufferedOperation.keySet()) { backupbufferedOperation.put(i, bufferedOperation.get(i)); } for (int i: bufferedOperation.keySet()) { Operation bufferedOp = bufferedO...
cf3ee067-3bbf-4248-8bbf-652f968c9fb5
2
@Override public void stateChanged(ChangeEvent arg0) { Date d = (Date) startTimeSpinner.getValue(); Calendar c = Calendar.getInstance(); c.setTime(d); int m = c.get(Calendar.MINUTE); if (m % 15 != 0) { if (m%15 > 8) { m -= m%15; } else { m += 15 - m%15; } c.set(Calendar.MINUTE, m); ...
d9558138-a58d-4856-a088-8cbe0f401bcd
5
public void communcation(){ try { BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream())); PrintWriter pw = new PrintWriter(socket.getOutputStream(),true); BufferedReader localReader = new BufferedReader(new InputStreamReader(System.in)); String msg = null; while((msg = l...
4f7cacd6-7d27-4c50-8bf3-37d9be282235
4
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Toets other = (Toets) obj; if (id != other.id) return false; return true; }
35db4445-6349-40ea-925d-dc77c7398e49
6
public static void main(String args[]) { try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); ...
623704d4-f903-43bf-bce1-e80390bcd55f
5
public Boolean checkTable(String table) throws MalformedURLException, InstantiationException, IllegalAccessException { try { Connection connection = getConnection(); Statement statement = connection.createStatement(); ResultSet result = statement.executeQuery("SELECT * FROM " + table); if (result == nul...
1b150a24-8c9a-44b8-931a-024904326d90
6
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof EdgeListObject)) return false; EdgeListObject other = (EdgeListObject) obj; if (edge == null) { if (other.edge != null) return false; } else if (!edge.equals(other...
ba864009-7b5f-4529-8597-245e32153b13
5
@Override public void onServerUpdate(Server lol) { // System.out.println(System.currentTimeMillis()-time); time = System.currentTimeMillis(); if (!lol.earth.inBounds(X, Y)||lol.earth.checkCollision(X, Y)) { radius*=3; alive = false; //lol.earth.ground.FillCircleW(...
b5747a99-af14-4a8f-9315-803041d9a0c6
7
public boolean start() { synchronized (optOutLock) { // Did we opt out? if (isOptOut()) { return false; } // Is metrics already running? if (task != null) { return true; } // Begin hitting the s...
eb459582-df35-4b3b-adb9-ba4e3127c4a1
8
private Candidate newCandidate(S2Cell cell) { if (!region.mayIntersect(cell)) { return null; } boolean isTerminal = false; if (cell.level() >= minLevel) { if (interiorCovering) { if (region.contains(cell)) { isTerminal = true; } else if (cell.level() + levelMod > m...
3e7ca4f9-4252-46cd-8dca-0175e0963db8
3
private static String inputConnectionString(String defaultString) { JOptionPane pane = new JOptionPane( bundle.getString("start.connection.message"), JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION); pane.setWantsInput(true); pane.setInputValue(defaultS...
3fb5d0ee-9de3-49f4-b68c-d509db9bd1e6
9
public int getSavedLightValue(EnumSkyBlock var1, int var2, int var3, int var4) { if (var3 < 0) { var3 = 0; } if (var3 >= 128) { var3 = 127; } if (var3 >= 0 && var3 < 128 && var2 >= -32000000 && var4 >= -32000000 && var2 < 32000000 && var4 <= 32000000) { ...
ddbb91d3-7ebe-497d-b1a7-47ccd6b11429
0
@Override public void setLastName(String lastName) { super.setLastName(lastName); }
7dec2ccb-42a0-4f54-bf67-82951417ae37
8
public boolean hasClickableSurround(int x, int y) { //first check the square is actually non-mine if (board[x][y].isMine()) return false; //the square must also have at least 1 adjacent mine for (int i = x - 1; i <= x + 1; i++) { for (int j = y - 1; j <= y + 1; j++) { //position must exist, and we don't...
3d241f7c-31fa-4596-99e9-0f59430fa04a
1
private void initComponentsEast() { eastPanel = new JPanel(); // Layout für 10 Zeilen und 2 Spalten eastPanel.setLayout(new GridLayout(10, 2)); // Unsichtbarer Rahmen wird gesetzt, um Abstand zum Frame zu bekommen eastPanel.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 15)); ActionListener myAction...
64d5ec8d-bb0b-4dd3-9910-c66e1662a808
1
public final GameLayer getGameLayer(String name) { GameLayer foundLayer = gameLayers.get(name); if (foundLayer == null) { logger.error(new NullPointerException(), "Died within getGameLayer. There was no corresponding layer with the name :: ", name); return null; } return foundLayer; }
614838c3-af9b-40a9-a33b-474d0491e99c
2
@Override protected void setReaction(Message message) { Cmds cmd = getCommand(message.text); if(cmd == Cmds.INVALID) return; String result = executeCmd(cmd, message.text, message.author); if(result != null) reaction.add(result); }
b4553182-4d7a-43d3-9281-06b4b5e472a8
9
private void doSubLWorkerDataAvailable(SubLWorkerEvent event) { Object obj = event.getWork(); if ((obj == null) || (!(obj instanceof CycList))) { if (CycObjectFactory.nil.equals(obj)) { return; } throw new RuntimeException("Got invalid result from inference: " + obj); } final C...
adb43341-1ca2-46dc-943c-60a0e2168e39
1
private boolean jj_2_48(int xla) { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_48(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(47, xla); } }
8c8eebc1-6434-4d92-aff1-1b747851efed
2
public String setLoadData(String url, String saveP, String tmpFname) { urlPath = url; try { URL zeroFile = new URL(urlPath); bufInStream = new BufferedInputStream(zeroFile.openStream()); String name = zeroFile.getFile(); String tmpName = name.substring(name.lastIndexOf("."), name.length());// 取得副檔名...
cd50beec-b955-4112-8851-5cf9f9d45ce8
5
protected boolean isSafeAttribute(String tagName, Element el, Attribute attr) { TagName tag = TagName.valueOf(tagName); AttributeKey key = AttributeKey.valueOf(attr.getKey()); if (attributes.containsKey(tag)) { if (attributes.get(tag).contains(key)) { if (protocols.c...
6697bc3c-d36c-47fe-9461-5952f8f0e98b
8
public void count() throws IOException { Solver noweZadanieMES; String curDir = System.getProperty("user.dir"); FileWriter fr = new FileWriter( curDir + "/OutputData.txt"); String dane; dane = "***********************************************************"; ...
cc2d7b05-986a-428f-a2ee-b8d12bb45405
0
@Override public String toString() { return StringUtil.concatenateStrings("Watchkey: folder path- ", folderPath); }
27ba6834-5498-4730-a9c5-0258e3da09db
5
public void initResources() { final Class<PaintExample> clazz = PaintExample.class; if (resourceBundle != null) { try { for (int i = 0; i < tools.length; ++i) { Tool tool = tools[i]; String id = tool.group + '.' + tool.name; InputStream sourceStream = clazz.getResourceAsStream(getResourceStrin...
4557439e-451a-4c09-aa97-9b7939ad222f
5
@Override public double getXRotation() { double lowest = 9001; double highest = 0; int y = 0; if (getRotationAngle() == 180) y = -20; if (getRotationAngle() == 360) y = 20; for (Block block : blockArray) { if (block.getXValue() > highest) highest = block.getXValue(); if (block.getXValue(...
08eaa65f-3987-4305-bdd2-280b841445cb
5
@SuppressWarnings("unchecked") public void bind(PathInput input, Object value) { if (parameter < 0) { return; } if (properties != null) { Object object = input.getParameter(parameter); if (object instanceof Map) { ((Map) object).put(prope...
ae657a6f-59a2-4350-9348-7081b80ea44f
4
private boolean read() { try { final URLConnection conn = this.url.openConnection(); conn.setConnectTimeout(5000); if (this.apiKey != null) { conn.addRequestProperty("X-API-Key", this.apiKey); } conn.addRequestProperty("User-Agent", "U...
3ce2a94a-49f8-456a-ad78-ce835f3a77b3
2
public void popFrame() { if (!runStack.isEmpty() && framePointers.peek() < runStack.size()) { runStack.subList(framePointers.pop(), runStack.size() - 1).clear(); } else { framePointers.pop(); } }
39746353-db89-4df7-a2b8-95e8945cf8c2
3
public static void main(String[] args) { SensorGroup building = new SensorGroup("Building"); building.addSensor(new TemperatureSensor("LocalTemp1")); building.addSensor(new ThermalCamera("RemThermCam1")); building.addSensor(new ThermalCamera("LocalThermCam1")); building.addSens...
aed52d0f-7b77-468b-91e5-304e7ddb83e0
0
public void setFirewallIndexes(int idx1, int idx2) { // keep the order of numbers firewallId1 = Math.min(idx1, idx2); firewallId2 = Math.max(idx1, idx2); }
6f866b3b-949f-4ffd-b59d-7d81a97fd770
7
private void openChannels() throws IOException { servSelector = Selector.open(); boolean portOpen=false; IOException lastException=null; for(final int listenPort : config.getHttpListenPorts()) { try { openChannel(listenPort, Boolean.FALSE); portOpen=true; } catch(final IOException e) ...
6ad04c11-03e7-48c5-8bad-180425fb6b5f
4
public JWP(String[] args) throws RegistryFormatException { super("Main Editor"); init(); setVisible(true); if (args != null && args.length > 0) { for (int i = 0; i < args.length; i++) { getDesktopManager().createDocumentFrame(new File(args[i])); } } else { if (getRegis...