method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
837c0715-7241-4ca8-9f13-262722257712
8
@Override public T decode(byte[] data) throws ConverterException { ByteArrayInputStream bin = new ByteArrayInputStream(data); try { Constructor<T> defaultConstructor = converteClass.getDeclaredConstructor(); defaultConstructor.setAccessible(true); T obj = defaultC...
afff3550-ad34-4389-8f05-6472c4b8a1f4
8
public boolean SetBusInActiveStatus(int busNumber, int inputBufferNumber, int packetSequence, int TIME, ConfigFile cfg) { //REMOVE IN CROSSBAR FABRIC TYPE //only one bus present in this fabric type, busNumber = 0; //ensure valid busNumber chosen if(...
bec47814-32f9-4c17-99cf-579872c3d933
3
public static void render() { switch(DisplayIndex.index) { case DisplayIndex.MAIN_MENU: renderMainMenu(); break; case DisplayIndex.MAIN_GAME: renderMainGame(); break; case DisplayIndex.TEST: renderTest(); break; } }
d51b26e9-0593-44ee-a79d-045a5d153f82
8
private String compileMethod(Node node) throws CompilationErrorException { StringBuilder builder = new StringBuilder(); variableMap = new HashMap<>(); Arrays.fill(localVariables, 0); stackDepth = 0; maxStackDepth = 0; wasReturnInMainBranch = false; MethodNode ...
cc5cebad-f4da-4d26-a265-b140f6060409
8
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void onDamage(EntityDamageEvent event) { if (!WorldRegionsPlugin.getInstanceConfig().ENABLE_PVE) return; // Check cause, check if damaged by entity if (event.getCause() != DamageCause.ENTITY_ATTACK) return; if (!(event instanceof ...
28b7275a-a875-4936-8787-a8d954311c11
3
public void setName(String name) { if (currentName > names.length - 1) { String[] tmp = new String[names.length]; for (int i = 0; i < names.length; i++) { tmp[i] = names[i]; } names = new String[names.length * 2]; for (int i = 0; i < tm...
e35d625d-e07b-4f6b-894f-fb22a561f6ba
8
public void update() { if (!isFirst && lives > 0 && !isWin) { mobSpawner(); map.process(); for (int i = 0; i < mobs.length; i++) if (mobs[i].inGame) mobs[i].process(); } if (isWin) { if (winFrame >= winTime) { if (level == maxLevel) { in...
482a868b-323e-43d8-a938-d4cf54e46a1c
7
public HgvsProtein(ChangeEffect changeEffect) { super(changeEffect); codonNum = changeEffect.getCodonNum(); marker = changeEffect.getMarker(); effectType = changeEffect.getEffectType(); // No marker? Nothing to do if (marker != null) { // Codon numbering // HGVS: the translation initiator Methionine...
f691f3ae-3d0e-4d98-b3df-981237ad3ebb
7
protected int myNext(StringBuffer s, int i, String[] lastFoundMacro) { int nextsToFind = 1; for (; i < s.length(); i++) { if (s.charAt(i) == '@') { final String foundMacro = parseFoundMacro(s, i, lastFoundMacro, true); if ((foundMacro != null) && (foundMacro.length() > 0)) { if (found...
86b8984e-2e63-4794-8f8d-af60fab9e1e7
0
public IDeviceWritter getWritter() { return writter; }
a6d4acdb-e182-4062-8432-38bf03f738fa
7
public static void createFile(String destPath, String charset) { try { Dom4jHandler dom4jHandler = Dom4jFactory.getDom4jHandler(); dom4jHandler.loadbyPath(PATH); List<Element> list = dom4jHandler.getNodes(TABLE_PATH); for (Element element : list) { String tableName = element.attributeValue("name"); ...
3df48673-8d48-494a-8d38-d08b93b10dbb
6
public static ArrayList <UserData> loadData() { File load = new File("resources/files/UserData/"); Gson loader = new Gson(); ArrayList <UserData> res = new ArrayList <UserData>(); for (File f : load.listFiles()) { BufferedReader br = null; try { br = new BufferedReader(new FileReader(f)); } catch (...
5151bd49-7276-41a7-9477-5b92add39f3a
8
public void meleeAttack(CanMeleeAttack from, Attackable to) { int damage = 0, counterdamage = 0; // Compute damage according to specifics damage = (int)(from.getStrength() * 0.5) +from.getMeleeDamageBonus(); damage = genericAttack(from, to, damage); CombatEvent evt = new CombatEvent(from, to, AttackType...
99edb190-bae3-4e08-967d-9f0fbede7527
8
public String trace(Case ambigousCase) { List<String> subContext = ambigousCase.tokens; String output = ""; String ambigousElement = ambigousCase.getCurrentToken(); String[] ambigousElements = ambigousElement.split("\t"); String ambigousWord = ambigousElements[0]; String...
7c185479-2604-4ef3-b90d-da4175b023d3
9
private boolean getValidate() { String keyword = keyField.getText(); String message = messageField.getText(); //проверка на не пустые поля--------------------------------------------------- if(keyword.length() == 0 || message.length() == 0) return false; ArrayList<Character...
ec2bd122-19a8-4d54-ab0f-053064fc45ae
0
public static GeneralValidator isNotEmpty() { return NOT_EMPTY_VALIDATOR; }
eac55af2-d214-4229-af52-4485fd6e76c6
4
public boolean findStartPos(Level level) { int x = random.nextInt(level.w); int y = random.nextInt(level.h); int xx = x * 16 + 8; int yy = y * 16 + 8; if (level.player != null) { int xd = level.player.x - xx; int yd = level.player.y - yy; if (xd * xd + yd * yd < 80 * 80) return false; } int r =...
c6d5d80f-385a-4319-a8ab-e68a2233741d
3
public static void main (String[] args){ int sum = 0; for (int i=0;i<1000;i++){ if (i % 3 == 0 || i % 5 == 0) sum+= i; } System.out.println(sum); }
44ccc2eb-09bb-4ec7-9cba-7d7c19285989
5
public void render(Graphics g) { for(int i = -1; i < Game.fieldHeight + 1; i++)//needs to be -1 and 1 to prevent ghosting { for(int j = -1; j < Game.fieldWidth + 1; j++) { //int n = getTile(j + x, i + y); Tile t = getTile(j + Game.xOff, i +...
fa4b4d3c-9d10-4806-b422-43f5e6902647
0
public static Server getInstance() { return INSTANCE; }
cb5139d4-d035-4843-b905-d94f45baa6c1
7
private double surfaceChargeDensity0(double psi){ double surCharDen = 0.0D; // temporary values of surface charge density // bisection method double ionSum = 0.0D; for(int i=0; i<this.numOfIons; i++){ if(this.charges[i]>0.0){ ionSum += bulkConcn[i]; ...
9dbc19ba-4524-40b8-aeaa-e7391c6030be
6
static RoadBook calculateRoadBook(Direction direction, Coordinates position, Coordinates destination, ArrayList<Instruction> instructions) { List<Direction> directionList = new ArrayList<Direction>(); if (destination.getX() < position.getX()) directionList.add(WEST); if (destination.getX() > pos...
7e34afaa-cce8-4ed5-b512-0bbb045ed8e5
6
public static boolean isPhrase(String token) { boolean wordStart = false; boolean blank = false; for (int i = 0; i < token.length(); i++) { if (token.charAt(i) != ' ') { if (!wordStart) { wordStart = true; } if (wordStart && blank) { return true; } } else { if (wordStart) { ...
0d89da9e-713e-4b16-bef9-8993905af6a4
4
public static void saveFine(Fine fine){ try { if(conn == null || conn.isClosed()){ conn = DatabaseConnection.getConnection(); } } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { conn.setAutoCommit(false); PreparedStateme...
2cd4bad6-ea41-496b-b103-013b130d3829
7
private String getStringForAbsValue(double value) { double absValue = Math.abs(value); if (absValue == Math.E) return "e"; else if (absValue == Math.PI) return "pi"; //return "π"; String formatted = nf.format(absValue); if (mHasDecimal && !formatted.contains(".")) formatted += "."; if (mHasDeci...
848e8193-4d39-46da-bde5-66556abebe20
1
public HashSet[] getDisjointSets(Automaton automaton) { ArrayList list = new ArrayList(); STATES_IN_A_SET = new ArrayList(); while (!accountedForAllStates(automaton)) { State state = getUnaccountedForState(automaton); HashSet set = getSetIncludingState(state, automaton); accountForStates(set); list.a...
946eedb3-f6f1-4d1e-b5e0-c7039914f3d2
2
public String getTypeSignature() { if (clazz != null) return "L" + clazz.getName().replace('.', '/') + ";"; else if (ifaces.length > 0) return "L" + ifaces[0].getName().replace('.', '/') + ";"; else return "Ljava/lang/Object;"; }
e7402a7b-2ed7-4678-8aa9-d9e89b74e4d5
1
@Test public void sub_test() { try{ double [][]mat1= {{1.0,2.0}, {3.0,1.0}}; double [][]mat2= {{2.0,1.0}, {1.0,3.0}}; double [][]result = Matrix.sub(mat1, mat2); double exp[][]={{-1.0,1.0}, {2.0,-2.0}}; Assert.assertEquals(result, exp); } catch (Exception e) { // TODO Auto-generated catch block...
e96372d7-c74d-493c-94a6-b53b38daae8e
0
public static String delete(String inString, String pattern) { return replace(inString, pattern, ""); }
f06cff44-6ece-4730-85cd-f84d07772d80
2
public static String changeToFull(String str) { String source = "1234567890!@#$%^&*()abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_=+\\|[];:'\",<.>/?"; String[] decode = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "!", "@", "#", "$", "%", "︿", "&", "*", "(", ")", "a", "b", "c", "d", "e", "f"...
39773b45-437b-4d74-a6fe-f4f5ee150803
9
private static double tarkistaAvec(Paikka paikka) { if (paikka != null) { if (paikka.getSitsaaja().avecIsSet() == false) { return 0.0; } else { int mikaPari = onkoMillainenPari(paikka.getSitsaaja()); if (mikaPari == 1) { ...
8e482094-d7ad-4213-8a1a-4e931c087bc7
5
private void smoothValues(XYDataItem[] plotArray, int smoothLevel) { double[] tempArray = new double[plotArray.length]; for (int i = 0; i < tempArray.length; i++) { tempArray[i] = plotArray[i].getYValue(); } for (int i = 0; i < tempArray.length; i++) { double f...
481d1d75-f4fd-459a-acc5-09c7e374519d
8
public static void taistelu(String komento,Kayttoliittyma ui){ Taistelu.ui=ui; hahmo = Luolasto.getHahmo(); vihu = Luola.getViholliset().get(0); if(komento.contentEquals("hyokkaa")){ hyokkaa(Luolasto.getHahmo(), vihu); hahmo.lisaaNykyistaSP(5); ...
9516a4b9-f80c-4fde-b788-31ec9c7a05f4
2
public static KmeansLogger getInstance() throws LogException { if(KmeansLogger.log == null) { synchronized (KmeansLogger.class) { if(KmeansLogger.log == null) { KmeansLogger.instance= new KmeansLogger(); } } } return KmeansLogger.instance; }
3db62160-5c70-4b25-94fe-4804ca065c0f
7
private void insertDatabaseOperation(Object object, Connection connection, DatabaseOperation databaseOperation) { try { if (!object.getClass().isAnnotationPresent(Table.class)) { throw new JStrykerException("Object("+object+") isn't Entity"); } Table table = object.getClass().getAnnotation(Table.clas...
7aabbe31-9c33-4735-bfcb-849b59637d15
5
@Override public void run() { if(start < end){ //swap(list, (start+end)/2, end); //Move pivotPosition to last place int pivotPosition = end; //Set pivotposition to last place in sublist for(int i=start; i<=end; i++){ if(i >= pivotPosition){ //Break if at pivot or beyond break; } /* ...
43d99230-8f4c-47a8-92c3-c758a63ec938
1
public int getID(Class<? extends APacket> p) { return PList.indexOf(p); }
9e5ff334-43ea-44ee-90f5-c16c5bf1617b
7
public void renderSprites(int xScroll, int yScroll, Screen screen) { screen.setOffset(xScroll, yScroll); int x0 = xScroll >> 4; int x1 = (xScroll + screen.width + 16) >> 4; int y0 = yScroll >> 4; int y1 = (yScroll + screen.height + 16) >> 4; for (int y = y0; y <...
2317699b-846f-44fc-8580-2faf994b3bda
6
public ProfileEntry checkPartAvailability(int partId, double startTime, long duration) { if(partId >= partitions.length || partId < 0) { throw new IndexOutOfBoundsException("Partition " + partId + " does not exist."); } Iterator<ProfileEntry> it = avail.itValuesFromPrec(startTime); if (!it.h...
f5e918f9-1836-4941-b77a-f563950b8787
8
public Token nextToken() throws LexicalError { if (!hasInput()) { return null; } int start = position; int state = 0; int lastState = 0; int endState = -1; int end = -1; while (hasInput()) { lastState = state; state =...
314ce599-682b-4181-a3f6-1d844ee32cd1
3
private void initialize(final RadniProzor radniProzor) { frmConnect = new JFrame(); frmConnect.setBackground(SystemColor.window); frmConnect.setResizable(false); frmConnect.setIconImage(Toolkit.getDefaultToolkit().getImage(ParametriKonekcijeProzor.class.getResource("/bp/projekat/etfSQL/Resursi/ETF-Logo.gif")...
b4e288d8-fc5f-4e3f-87fe-ab0db648d8cd
3
@Override public Staff insert(Staff obj) { PreparedStatement pst = null; try { pst = this.connect().prepareStatement("INSERT INTO Staff (fonction,nom,prenom,age,id) VALUES (?,?,?,?,?);"); pst.setString(1, obj.getFonction()); ...
458ad1ad-6120-4236-a37c-5d4401b8488d
2
public BEValue bdecodeMap() throws IOException { int c = this.getNextIndicator(); if (c != 'd') throw new InvalidBEncodingException("Expected 'd', not '" + (char)c + "'"); this.indicator = 0; Map<String, BEValue> result = new HashMap<String, BEValue>(); c = this.getNextIndicator(); while (c != 'e')...
dead55fe-f0b9-4b86-a011-0d8392214891
7
@Override public void init() { System.out.println("Initializing DFS..."); try { myCache = new MyDBufferCache(Constants.NUM_OF_CACHE_BLOCKS); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } //Saving first few i's for inode blocks for (in...
f6486ddb-1e3c-40ca-a59d-334d62d1cc01
8
public void addDataTableObject(final int index, final DataTableObject dataTableObject) { if(getFirstRun()) { initHeaderSize(); setFirstRun(false); } SwingUtilities.invokeLater(new Runnable() { public void run() { DataTableObjectRenderer renderer = new DataTableObjectRenderer(_headerGrid, dataTa...
4271da4e-8d83-47f7-be1d-4e2a343555de
9
private boolean searchWord(TrieNode2 _root, String _word) { if(null == _root || null == _word || "".equals(_word)) return false; char[] cs = _word.toCharArray();//将字符串转化为字符数组 for(int i = 0; i < cs.length; i++){ int index; if(cs[i] >= 'A' && cs[i] <= 'Z'){ index = cs[i]-'A'; } else if(cs[i] ...
91e7c5c3-dbea-4f34-ad26-2d6cbf213aa4
0
public void setUserName(String userName) { this.userName = userName; }
f95a87b8-bdbc-4638-ad6c-c6e802343878
1
public void fillInGenSet(Collection in, Collection gen) { if (gen != null) gen.add(local); super.fillInGenSet(in, gen); }
27e7f240-c867-4468-983b-21f9457d7fca
8
public void run() { try { while (true) { int n = selector.select(); if (n == 0) { continue; } Iterator<SelectionKey> iter = selector.selectedKeys() .iterator(); while (iter.hasNext()) { SelectionKey key = iter.next(); if (!key.isValid()) { continue; } else if (...
ee59c410-44fd-422e-9bc3-551509e62183
2
public boolean moveToChannel(String fromChan, String toChan) { boolean success = true; if(!sendln("PART " + fromChan) || !sendln("JOIN " + toChan)) { success = false; } config.setChannel(toChan); return success; }
42b1fab9-79ce-49cd-be3c-b670d27f6197
4
public void update() { if (!done) { if (x >= (GamePanel.WIDTH - width) / 2) { x = (GamePanel.WIDTH - width) / 2; count++; if (count >= 120) done = true; } else { x += dx; } } else { x += dx; if (x > GamePanel.WIDTH) remove = true; } }
9583a4e0-eaea-493c-9199-729401b1b4a1
7
private void actualizarTabla(){ if (a.getSizeArray() < 15) { for (int i = 0; i < 15; i++) { if (i < a.getSizeArray()) tabla.setValueAt(a.getProc(i).getNombre(), i, 0); else tabla.setValueAt("", i, 0); ...
1d614166-db8a-46c5-8606-c6b1d5175cf6
6
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
6111a3c2-cf31-4c71-9b78-027c387dce4b
4
@Override public void deserialize(Buffer buf) { latency = buf.readUShort(); if (latency < 0 || latency > 65535) throw new RuntimeException("Forbidden value on latency = " + latency + ", it doesn't respect the following condition : latency < 0 || latency > 65535"); sampleCount = b...
7f34683c-96ba-4448-84db-d5fd13830db1
0
public Wlist () { list = new String[MAXSIZE]; }
74a1a877-bd4c-42ac-b1f1-fb04e9694b36
4
private void createRefsetConcepts() throws IOException, ContradictionException, InvalidCAB { // Member Refsets memberRefsetCon = appDb.getConcept(memberRefsetUid); annotatedMemberRefsetCon = appDb.getConcept(annotatedMemberRefsetUid); boolean isAnnotated = false; ConceptVersionBI parentRefsetCon = appDb...
0ac0b9b3-8a87-490a-95e6-5e04696d88f4
0
public Event getEvent(int id){ //returns the event selected by the id Event event = (Event) manager.createQuery( "FROM Event WHERE id="+id).getSingleResult(); return(event); }
ba544f11-1213-451a-bc80-ed113b0bbedb
4
public Shape getShape(String shapeType) { if (shapeType == null) { return null; } if (shapeType.equalsIgnoreCase("CIRCLE")) { return new Circle(); } else if (shapeType.equalsIgnoreCase("RECTANGLE")) { return new Rectangle(); } else if (shapeTyp...
a7b4832e-52e5-4b05-a2a4-dbfa2d29d428
5
public static void main(String args[]) { Scanner in = new Scanner(System.in); int R = in.nextInt(); // the length of the road before the gap. in.nextLine(); int G = in.nextInt(); // the length of the gap. in.nextLine(); int L = in.nextInt(); // the length of the landing p...
b4bdfb6d-41ab-4330-859c-93e10a551d46
0
public void setTicketPrice(double ticketPrice) { this.ticketPrice = ticketPrice; }
e9c285dd-653c-4145-8fb9-ebdf3c34c422
7
public void give1() { while (!Widgets.get(335, 49).getText().contains("50,000")) { if (Widgets.get(335, 49).getText().contains("100,000") || Widgets.get(335, 49).getText().contains("150,000")) { Widgets.get(335, 9).click(true); } Widgets.get(335).getChild(53).click(true); Time.sleep(1000); wh...
46a8d07a-087a-45fa-b0b3-81263c68c747
8
static final Class258_Sub3_Sub1 method3132 (int[] is, int i, int i_0_, int i_1_, int i_2_, OpenGlToolkit var_ha_Sub2, boolean bool, byte i_3_) { try { if (i_3_ != 12) method3134(9); anInt9418++; if (!((OpenGlToolkit) var_ha_Sub2).aBoolean7793 && (!Class192.method1436(-74, i_2_) || !Class192...
ee974edb-1439-4582-995c-a8cd8e783496
9
@Override protected void updateGameObjects() { boolean gameEventsGotten = false; try { gameEventsGotten = executeGameEvents(GameConnection.getInstance().getGameEvents(gameID, userID)); } catch (Exception e) { e.printStackTrace(); } HashMap<String, GameObjectInformation> clientPlayerObjects = new Has...
4f642f97-98a9-41ab-add6-28c29dbf7239
3
@Override public List<Usuario> listAll() { Connection con = null; PreparedStatement pstm = null; ResultSet rs = null; List<Usuario> usuarios = new ArrayList<>(); try { con = ConnectionFactory.getConnection(); pstm = con.prepareStatement(LIST); ...
c1ca69e6-d143-4aa2-8358-31744f4b9da2
7
public static void main (String args[]) { BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); Echeancier echeancier = new Echeancier(); LigneDeCaisses ligneDeCaisses = new LigneDeCaisses(echeancier); echeancier.ajouter(new EvenementArriveeClientCaisses(frenceArriveeDesClients, ligneDeCaisse...
da2f9d4d-55c0-464f-85da-649a57ab0515
1
public void Draw(Graphics2D g2d) { for (int i = 0; i < yPositions.length; i++) { g2d.drawImage(image, xPosition, (int) yPositions[i], null); } }
22c8e43b-310e-465e-a35c-6251ebe8b8f4
8
private static String escapeJSON(String text) { StringBuilder builder = new StringBuilder(); builder.append('"'); for (int index = 0; index < text.length(); index++) { char chr = text.charAt(index); switch (chr) { case '"': case '\\': ...
c9f588a9-f83f-443b-8126-6ad5385c0617
5
private void dct_direct(double f[][], double F[][]) { double a[] = new double[N]; a[0] = sqrt(1. / N); for (int i = 1; i < N; i++) { a[i] = sqrt(2. / N); } double summ = 0; double koeff = 0; for (int u = 0; u < N; u++) { for (int v = 0; v ...
228b39bc-ef5e-4ab2-a5d0-cda4037df960
5
public boolean IsetINodeParam(String resource_id, String inode_id, String paramKey, String paramValue) { boolean isUpdated = false; OrientGraph graph = null; String node_id = null; try { node_id = getINodeId(resource_id, inode_id); if(node_id != null) ...
5ff6be00-8b90-4586-b55e-abace22f1b80
0
public Component getDefaultComponent(Container container) { return getFirstComponent(container); }
4e342c90-fa07-4113-9e71-4bb5b0af1ead
5
public void run(){ if(index==1){ target = User.rotLaser1(target); Enemy newEnemyHit=User.getEnemy(); las.shoot(target, User.getLaser1Pos(),newEnemyHit,null); } else if(index==2){ target = User.rotLaser2(target); Enemy newEnemyHit=User.getEnemy(); las.shoot(target, User.getLaser2P...
330bf880-625e-4886-ab8b-51522d5da74e
3
public static PlayableEffect parse(String string) throws IllegalArgumentException, NumberFormatException { Matcher matcher = pattern.matcher(string); if (!matcher.matches()) { return null; } if (matcher.group(3) != null) { return new PlayableEffect(Eff...
f45ea927-54d5-45f0-a7f0-e556888b5714
9
static void process_chunk(byte[] data) throws Exception { PackedTags2 pt = StructHandler.read(PackedTags2.class, ByteBuffer.wrap(data, CHUNK_SIZE, data.length-CHUNK_SIZE).order(ByteOrder.LITTLE_ENDIAN)); if (pt.t.byteCount != 0xffff) return; ObjectHeader oh = StructHandler.read(ObjectHeader.class, ByteBuffer...
5bc4221c-687c-4d33-bc2a-531ff4595b6d
2
@Override public boolean activate() { if(Tabs.getCurrent() != Tabs.INVENTORY && hasSpinTicket()) { return false; } return hasSpinTicket(); }
3614f21b-b8e7-4e39-b887-30a9c6a80cbf
0
public void setDescription(String description) { this.description = description; }
3b88fe8e-6490-47d5-a10d-4790e6d79946
7
public void createQuickTask(JTextField textFieldCustomer, JComboBox comboBoxType, JComboBox comboBoxTaskLeader, JTextField textFieldtimeSpent, JTextArea textAreaDescription) throws SQLException, IOException, ParseException { Customer customer = null; Type type = null; Statuss status = null; ...
e5925ea4-a19d-4f63-98e6-b7958361a0b9
0
@Override public void loadOp() throws DataLoadFailedException { Map<String, Object> data = getData("server", "name", "op"); load(PermissionType.OP, "op", data); }
560ae520-567c-41bb-8f46-b52a8d011dc7
3
private Predicate[] getSearchPredicates(GroupBE searchParameters, Root<GroupBE> root) { CriteriaBuilder builder = this.entityManager.getCriteriaBuilder(); List<Predicate> predicatesList = new ArrayList<Predicate>(); String name = searchParameters.getName(); if (name != null && !"".equals(name)) { predicate...
6f2a194d-1a68-47af-8439-fd6eeda54cd9
2
private static boolean isSeatsValid(Integer seats) { return seats != null && seats >= SEATS_MIN && seats <= SEATS_MAX; }
b3c391a3-d6d2-4612-9b6d-26dd98d2d11b
0
public boolean GetPacketMoved() { return packetMoved; }
761addcd-4e70-4a34-ae47-f7c487c492bd
0
private void refreshLabels() { fileMenu.setText(settings.getLanguage().getLabel("menu_file")); fileConnectMenuItem.setText(settings.getLanguage().getLabel("menu_file_connect")); fileDisconnectMenuItem.setText(settings.getLanguage().getLabel("menu_file_disconnect")); fileSettingsMenuItem.setText(settings.getLan...
f066d4d7-cdb4-4f8f-999d-d65327673331
9
public static void main(String[] args) throws Exception { if (args.length < 2) { throw new Exception("Too few arguments!"); } String command = args[0]; if (command.equals("date")) { // "serialNumber" // "dateTime" (within 2 seconds) } else if (command.equals("thumbnails")) { ...
f95aad08-97b8-4af0-ab3b-8ddf5c7a06ed
0
@Id @Column(name = "percent") public double getPercent() { return percent; }
dac314d5-1176-4b70-bef7-8dc8b96d4447
0
public boolean hasConnected(){ return HasConnected; }
7a3835d2-752f-484e-9983-ec90968cbf42
0
public void setAdditionalAbility(Ability additionalAbility) { this.additionalAbility = additionalAbility; }
b2d1c8ac-dbbd-45ee-b8ad-0797977387dc
6
public static void deleteMembersOfGroups(MoodleGroupUser[] users) throws MoodleRestGroupException, UnsupportedEncodingException, MoodleRestException { StringBuilder data=new StringBuilder(); String functionCall=MoodleCallRestWebService.isLegacy()?MoodleServices.MOODLE_GROUP_DELETE_GROUP_MEMBERS:MoodleSe...
f10cea53-5172-429d-9f84-91a61caff376
1
public static void insertMultipleSubnets(Subnet sub){ //Recover the arraylist with all the SubnetData from the Rest Interface MultipleCreate ArrayList<SubnetData> multiData = sub.getSubnets(); //call insertSubnet for every subnet SubnetData object for (int i=0; multiData.size()<i; i++) { insertSubn...
7c3bfb60-0b89-408f-9d65-471c3679d28b
1
public static Set<String> commaDelimitedListToSet(String str) { Set<String> set = new TreeSet<String>(); String[] tokens = commaDelimitedListToStringArray(str); for (String token : tokens) { set.add(token); } return set; }
8b71ef3d-f502-4cc2-a6fb-58d4dad573ef
1
public void setK(int k) throws Exception { if (this.n != getK()){ throw IllegalAccessException; } }
ed7713c8-b6af-4b9d-a608-0d295bfbfd34
1
public void disconnect(){ //disconnect our connections pulse = false; try { to_peer.flush(); to_peer.close(); from_peer.close(); socket.close(); } catch (IOException e) { System.err.println("Closing peer:" + ip + " has somehow failed."+ " It was probably already dead :( "); } }
f35b9260-5411-407f-8ec9-d60ef435007d
9
@SuppressWarnings("rawtypes") public PreparedStatement getPreparedStatement() { PreparedStatement preparedStatement = null; try { preparedStatement = dbConnection.prepareStatement(this.preparedStatement); int index = 0; for (HashMap<Class, Object> data : dataList) { Set<Class> keySet = data.keySet(); ...
45c20201-5c8f-415c-97e0-5cbc6b6a9586
0
public static void removePlayer(Player p){ warnLevel.remove(p); }
b0215877-04e2-4c52-86f9-52bc3ef4161e
7
public void setOptions(String optionString) throws MaltChainedException { this.optionString = optionString; format = PennWriterFormat.DEFAULT; String[] argv; try { argv = optionString.split("[_\\p{Blank}]"); } catch (PatternSyntaxException e) { throw new DataFormatException("Could not split the bracket...
b59a4730-248c-4241-bd81-71510b50a04a
3
@Override public LinkedList<String> words() { LinkedList<String> ll = new LinkedList<String>(); // Return only the words appearing with low frequencies. Here words with less than 5 occurrences // in the text. for (int i = b; i <= 32; i++){ HashMap<String, Integer> t = strTab.get(i); ...
a6e5a19b-9514-486d-99fd-aa71ffb6aed1
0
@Override public void redo() { node.setMoveableState(newState); }
e04de8c9-ca7a-4ae7-8aa1-a418384b3ab9
0
public Integer getShowYear() { return Integer.parseInt(sysNowTime[5]); }
73272390-48be-4e5a-82e5-88e44ce682db
1
@FXML private void handleTxtItemNameAction(ActionEvent event) { if (txtItemName.getText().isEmpty()) { return; } txtPrice.setDisable(false); txtPrice.requestFocus(); }
09064bdc-761b-4e9d-b876-1398d34b4afc
2
private double[] matrix(double[][] turn, double[] vector) { double[] newVector = new double[3]; for (int j=0; j<3; j++) { double sum = 0; for (int i=0; i<3; i++) { //System.out.print(turn[j][i] + " "); sum += turn[j][i] * vector[i]; } //System.out.println(); newVector[j] = sum; } re...
520bb405-faea-403f-a40f-c7f28d711c2c
0
private void cancelButtonActionPerformed(ActionEvent e) { // TODO add your code here }
82b3dc66-355c-4408-a452-cebf92b20457
6
public String gravarUSuario (String nome, String senha, String email, String login) { String resposta = ""; System.out.println("Iniciando inserçao de usuario"); if(!nome.equals(null) || !senha.equals(null) || email.equals(null) || login.equals(null)){ Usuario usuario = new Usuario (); if (sen...