method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
ab25529b-b9a0-4c8d-95fa-658121f11b84
5
public void validateSetPassword(ChangePasswordBean changePasswordBean, ValidationContext context) { MessageContext messageContext = context.getMessageContext(); String newPassword = changePasswordBean.getNewPassword(); String confirmNewPassword = changePasswordBean.getConfirmNewPassword(); if(newPasswo...
19d6ae8c-7e20-4513-b5be-3cd80c871c1e
8
@Test public void corridorConnectionTests(){ getNewBoard(); for (int row = 0; row < 29; row++ ){ for (int col = 0; col < 25; col++){ Square s = board.getSquare(new Point(col, row)); if (s instanceof CorridorCell){ CorridorCell corCell = (CorridorCell) s; Set<Cell> neighs = corCell.get...
dcf3f8f7-6f03-4408-b517-3c11040d2059
4
public static byte[] decodeFromFile( String filename ) { byte[] decodedData = null; Base64.InputStream bis = null; try { // Set up some useful variables java.io.File file = new java.io.File( filename ); byte[] buffer = null; int length ...
a2f3981f-2c8d-4e3f-b9e4-76c9bee01b39
1
public void addScore(String name, int score) { date = new Date(); if (isNewHighscore(score)) { leaderboard[9][0] = name; leaderboard[9][1] = Integer.toString(score); leaderboard[9][2] = dateFormat.format(date); sortLeaderboards(); repaint(); ...
9e8e4bc3-b768-4e58-b6bc-c085d3fa4847
5
private static double getEuclidDistance ( double[] x , double[] y , Matrix features) { assert(x.length == y.length); double distance = 0; for (int k = 1; k < x.length; k++) { if (x[k] == MISSING || y[k] == MISSING) { distance += 1; } else { int attributeValues = featu...
0fe4b566-4fee-40e8-9d5a-b93c859daf0b
3
private int readChar() { try { int readVal; while(true) { readVal = input.read(); //if(readVal == (int)'\n') // continue; nextReadColumnNumber++; if(readVal == (int)'\n') { nextReadLineNumber++; nextReadColumnNumber = 1; } return readVal; } } catch (IO...
8cfc68df-77ac-43bb-804a-8b295ff6a9c9
5
synchronized void setFullImage(BufferedImage img,ImageType type){ MultiSizeImage setter; if(type==ImageType.Icon) setter=iconImage; else setter=originalImage; setter.fullImage =img; if(img!=null) setter.fullDimensions=new Dimension(img.getWidth(),img.getHeight()); else { ...
449310a7-4fed-4802-9ac9-748362129720
0
public static String getXMLDeclaration() { return getXmlDeclaration(null); }
839280d4-9383-4f1b-a56a-d5d281aec94c
4
@Override public String get(Object keyObject) { String key = (String) keyObject; for (Map.Entry<String, String> e : entries) { if (key == null) { if (e.getKey() == null) { return e.getValue(); } } else if (key.equalsIgnoreCase(e.getKey())) { return e.getValue(); } } re...
e1a1937a-9c2b-4e8f-a19f-b880b913a0ca
8
@Override public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) { if (isResolvable(base)) { Map<?, ?> map = (Map<?, ?>) base; final Iterator<?> keys = map.keySet().iterator(); return new Iterator<FeatureDescriptor>() { public boolean hasNext() { return keys.hasNex...
cdd1cdcb-34d2-4720-a994-abb4749ac49f
8
public void setPoint(Point p, int value) { int oldVal = getPoint(p); if (oldVal == WHITE || oldVal == WHITE_GRAY) { white--; } else if (oldVal == BLACK || oldVal == BLACK_GRAY) { black--; } if (value == WHITE || value == WHITE_GRAY) { white++; } else if (value == BLACK || value == BLACK...
353e193a-b7a3-41ab-8674-44aae35ad5dc
9
public void create(UnidadeMedida unidadeMedida) { if (unidadeMedida.getQualificadorAplicacaoCollection() == null) { unidadeMedida.setQualificadorAplicacaoCollection(new ArrayList<QualificadorAplicacao>()); } if (unidadeMedida.getQualificadorProdutoCollection() == null) { ...
20aa11b8-41ae-49e0-b26d-d922ab50742b
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...
89a1ad25-0e16-4b2d-a4b3-02464d25e23f
4
private static Problem constructProblem(List<Double> vy, List<Feature[]> vx, int max_index, double bias) { Problem prob = new Problem(); prob.bias = bias; prob.l = vy.size(); prob.n = max_index; if (bias >= 0) { prob.n++; } prob.x = new Feature[prob.l]...
d8573626-a90c-4c24-aa1e-91d278d227e7
2
public void shutdown() { if (this.getHttpClient() != null) { try { this.getHttpClient().getConnectionManager().shutdown(); } catch (Exception ignored) { // ignored } } }
6fa7dc24-a3ad-4170-91cd-4ac2bc7ee170
9
private ObjectConverter chooseConverter(Class cls) { if (cls.equals(Float.class) || cls.equals(Double.class)) { throw new SerializationException("Float values should not be serialized!"); } else if (Number.class.isAssignableFrom(cls)) { return numberConverter; } else if (...
1a96d132-a5db-4122-b75d-aacb242bb817
6
public void tournamentsort(int[] a){ int nNodes = 1; int nTreeSize; while(nNodes < a.length){ nNodes *= 2; } nTreeSize = 2 * nNodes - 1; Node[] nodes = new Node[nTreeSize]; int i; int idx; for( i = nNodes - 1; i < nTreeSize; i++){ idx = i - (nNodes - 1); if(idx < a.length){ ...
14bba720-f07c-4872-b11f-428e52203b22
9
public static boolean isOpCritical(SourcePackage pkg, ArrayList<Operation> code, int begin, Operation op) { switch (op.op) { case RET: case WHILE: case IF: case REP: case FOR: case ITER: return true; case CALL: if (!Directives.has(pkg.getFunction(op.args[1]),"pure")) { return true; ...
95a1e1d9-afd4-48fa-9c4a-211bab5744a5
7
final public int Conjunction() throws ParseException { int ret = CONJ_NONE; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case AND: case OR: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case AND: jj_consume_token(AND); ret = CONJ_AND; break; case OR: jj_consume_t...
ae892ecd-e2cf-4362-870f-7a9748851559
5
@Override public void onInvalidCommand(CommandSender sender, String[] args, String command) { tickets = plugin.getTicketHandler(); if (sender instanceof Player) { Player p = (Player) sender; if (args.length == 1) { int id; try { ...
4c9fc775-ce62-4f48-9fa9-4f9103369ee3
8
private void eigenSort(){ int k = 0; double holdingElement; this.sortedEigenValues = Conv.copy(this.eigenValues); this.sortedEigenVector = Conv.copy(this.eigenVector); this.eigenIndices = new int[this.numberOfRows]; for(int i=0; i<this.numberOfRows-1; i++){ ...
307d3c3b-e091-40c7-b331-6d8b8aa89801
7
@EventHandler(priority = EventPriority.HIGHEST) public void onPlayerInteract(PlayerInteractEvent e) { Player player = e.getPlayer(); Block block = e.getClickedBlock(); if ((e.getItem() != null) && (player.getGameMode().equals(GameMode.SURVIVAL))) { if ((e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) ...
b69bdb89-9649-48da-b7e4-9f482a56ef2c
8
public static void main(String[] args) { boolean pago_fisico = false; boolean pago_libro = false; boolean pago_membrecia = false; boolean pago_actualizar_membrecia = false; boolean pago_video = true; boolean pago_comision = false; //++++++++++++++ INGRES...
46ee7bfe-1e86-408c-9ff4-0194410f52f7
2
public static void main(String[] args) { if(args.length == 2){ int a = Integer.parseInt(args[0]); int b = Integer.parseInt(args[1]); System.out.println((a>b)? a : b); } }
57ec4864-120d-4107-b94d-933b648d1b54
7
public void mouseClicked(MouseEvent e) { super.mouseClicked(e); try{ newNeuronButton.removeActionListener(newNeuronL); newNeuron.removeActionListener(newNeuronL); setCursor(defaultCursor); int posX = e.getX()-15;...
3f8ee38d-8bff-4fd3-ba2a-c71f27463df8
3
public Path getImgPath_SliderBar(Imagetype type) { Path ret = null; switch (type) { case DEFAULT: ret = this.imgSlider_Def; break; case FOCUS: ret = this.imgSlider_Foc; break; case PRESSED: ...
7eb35ccc-d7e7-468e-98c8-791c0c9d0507
3
@Override public boolean removeComment(Comment comment) { /* * function gets an POST ID of the specific comment we want to remove and the user name * we make sure to update the number of comments we have i that specific post * we update also the number of posts this user have minus 1 * we save all to th...
4c985116-e0e6-4e78-8832-597d2b4470f8
7
public void writeBeacon( OutputStream out, BeaconState beacon ) throws IOException { writeBool( out, beacon.isVisited() ); if ( beacon.isVisited() ) { writeString( out, beacon.getBgStarscapeImageInnerPath() ); writeString( out, beacon.getBgSpriteImageInnerPath() ); writeInt( out, beacon.getBgSpritePosX() )...
0c7ec389-3253-40c6-a379-d9bee2d233fa
0
protected void interrupted() { end(); }
61b0e197-69f8-4ca5-8fde-eea2bda9b8b5
4
public Double getMedia(){ if(!notas.isEmpty()){ Double somaNotasPonderadas = 0.0; Double somaPesos = 0.0; for(int i=0; i < 3; ++i){ if(this.notas.get(i) != null){ somaNotasPonderadas += notas.get(i) * pesos[i]; ...
2cdf2e85-bbb6-4567-8e6e-4ce4327b2680
1
public static void main(String[] args) { // DatagramSocket socket; // DatagramPacket packet; // // String msg = "hello"; // try { // packet = new DatagramPacket(msg.getBytes(), msg.getBytes().length, // InetAddress.getByName("192.168.212.14"),80...
1f978e46-0064-4cc7-abe0-1849a3a99368
7
private void executeDynamicCommand(String commandName, Connection conn, Parameter p) { assert commandName != null && !commandName.contains(" "); final String fqcn; if (commandName.indexOf('.') > 0) { fqcn = commandName; } else { fqcn = "net.argius.stew.command." ...
a482d6e6-8a7b-4479-853d-7b8c19f5ce32
0
public static ArrayList<Excel> move(int a,int b,int c, ArrayList<Excel> toScale) { return Move.move(a,b,c, toScale); }
48a1a268-0bc0-450e-b655-b897b8477c41
1
public void displaySettingsPanel() { //Leave the current match intact until a new one is created, just in case the user forgot to save. if (this.currentMatch != null) { this.currentMatch.getPanel().setVisible(false); } this.newGamePanel.setVisible(true); super.pack(); //Makes the window resize to mat...
439b9fd5-3680-4358-b2f4-6f0d9bda99e5
0
@Override public void flush() { super.flush(); out.flush(); }
1218b7f4-0525-4f76-adb5-1b9c897216f6
6
@SuppressWarnings("unchecked") public static <T> Set<T> getNominalSet(Class< T> classdef) { if (classdef == null) { return null; } Class<?> classdef2 = getWrapper(classdef); if (classdef2 == Boolean.class) { return (Set<T>) BooleanSet.Instance; } else ...
b63b2908-57e4-4cc3-9bc9-e6dd12f017b9
8
private static final void parseCmdLine(String args[]) { int i = 0; String arg; while (i < args.length && args[i].startsWith("-")) { arg = args[i++]; if (arg.equals("-c")) { if (i < args.length) cities = new Integer(args[i++]).intValue(); else throw new Error("-c requires the size of tre...
83e95996-f825-4f84-8e3d-9011516f789b
0
public void setQuery(String query) {this.query = query;}
40817030-5ae2-4c82-8526-2bd0eea0de42
7
private void parseComputationalUnit(Node currentNode) { String currentTag = currentNode.getNodeName(); switch (currentTag.toLowerCase ( )) { case "nodename": { parseNode(currentNode); break; } case "internodeconn...
4fd2b0a4-2059-4e56-807c-ceeb7cd71952
1
public JSONObject asJSONObject() { JSONObject result = new JSONObject(); try { result.put("cardNumber", cardNumber); result.put("name", name); } catch (JSONException e) { e.printStackTrace(); } return result; }
9621fed2-1ef5-41a3-a251-74b35c59c198
5
public ProcessorHandler(Class<? extends Processor>... processors) throws ProcessorException { // Check if 'processors' is NULL Objects.requireNonNull(processors, "The specified processors must not be Null"); // Check if 'processors' is empty array if (processors.length <= 0) throw new Il...
9c915784-7b38-4adf-bf05-1e3c9c1a844b
5
public boolean exists(String[] names) { boolean valid = true; boolean[] play = { true, true, true, true }; for (int i = 0; i < names.length; i++) { boolean exist = false; for (int j = 0; j < players.length; j++) if (players[j].name.equalsIgnoreCase(names[i])) if (play[j]) { play[j] ...
eb02c9f6-0ec3-4289-97ab-f20cc3b21e5f
6
private void maintainRouteTable() throws IOException { long currentTime = System.currentTimeMillis(); for (Bucket bucket : routeTable.buckets) { if (currentTime - bucket.lastChangeTime > 900000) { byte[] randomId = Util.randomId(bucket.min, bucket.max); findNo...
6cf1737d-7a34-4eb0-8d95-599d0421f72d
3
public Rule parseRule(String input) throws ParseException { Matcher matcher = rulePattern.matcher(input); if (!matcher.matches()) { throw new ParseException( "The given input '" + input + "' is not a valid rule."); } List<Predicate> conditions = new ArrayList...
9cedc8df-cdd4-40cb-9716-c0e0240c751f
3
public void draw(Graphics2D g){ super.draw(g); if(Alpha.selected != this||Alpha.selection!=5) g.setColor(Color.lightGray); else { g.setColor(new Color(0,255,255,15)); g.fillOval(getX() - User.basefield / 2, getY() - User.basefield / 2, User.basefield, User.bas...
94742fb3-24ca-4736-add0-49637bf3b726
2
private void sendStatusInfoToOtherUsers(StatusInfoMessage message) { final Collection<ChatConnection> otherUsersConnections = getAllChatConnectionsExceptThis(); for (ChatConnection connection : otherUsersConnections) { try { connection.getWsOutbound().writeTex...
3524c655-e080-4fc1-9279-21c143708676
8
private static ExternalFinderItemCommand generateFinderCommand(Node commandNode) { String command = commandNode.getTextContent(); ExternalFinderItem.TARGET target = ExternalFinderItem.TARGET.BOTH; ExternalFinderItem.ENCODING encoding = ExternalFinderItem.ENCODING.NONE; String delimiter =...
37fe99fc-bb97-4cfc-a304-619a91d25891
9
public static GeneralizedSymbol internRigidSymbolCaseSensitively(String name, int kindofsym, boolean tryupcasingP) { { GeneralizedSymbol symbol = null; symbol = GeneralizedSymbol.lookupRigidSymbol(name, kindofsym); if (symbol != null) { return (symbol); } if (((Boolean)(Stella.$TRAN...
900f81db-65ce-44e7-ae28-9e945defcffa
4
public Image getTile(int x, int y) { if (x < 0 || x >= getWidth() || y < 0 || y >= getHeight()) { return null; } else { return tiles[x][y]; } }
eb32a9ed-3c89-4fb9-ac1f-9d5585e7d4c3
4
public boolean isAxicollinear(Vector other) { boolean x = this.getX() == other.getX(), y = this.getY() == other.getY(), z = this.getZ() == other.getZ(); return (x && (y || z)) || (y && z); }
64a3208e-4260-441e-b9ec-ce434c6086f1
9
public void initialize(NeuralNetwork nn) { List<ConnectionCandidate> ccs = new BreadthFirstOrderStrategy(nn, nn.getInputLayer()).order(); for (ConnectionCandidate cc : ccs) { if (cc.connection instanceof FullyConnected) { FullyConnected fc = (FullyConnected) cc.connection; if (Util.isBias(fc.getInputLayer())...
07925ac5-414e-4426-8569-dfcd5bf31238
6
public static void backupExtract (String zipLocation, String outputLocation) { Logger.logInfo("Extracting (Backup way)"); byte[] buffer = new byte[1024]; ZipInputStream zis = null; ZipEntry ze; try { File folder = new File(outputLocation); if (!folder.exis...
add00d42-358a-4d15-af96-79eb01da6871
8
public void actionPerformed(ActionEvent e) { JButton source = (JButton)e.getSource(); if(source.equals(executeButton)) executeCode(); else if(source.equals(saveCodeAsButton)) saveCodeAs(); else if(source.equals(saveCodeButton)) saveCode(); else if(source.equals(openExistingFileButton)) openExis...
f43ea064-8a95-4f5f-99b0-29abfcea1e10
7
public void mouseClicked(double x, double y, int modifiers) { SortedSet<Net> clickedNets = new TreeSet<Net>(); model.getNetsAtPoint(x, y, 1.0/display.getDPI(), clickedNets); if (manualTopology.isSelected()) { clearSelection(); TopologyProcessor.mergeNets(clickedNets); return; } if ((selectedNet !...
90e10c36-fe96-4fa9-b423-7a49eb365b67
8
public static boolean isSubInterface(Class<?> sup, Class<?> sub) { if (sup.isInterface() && sub.isInterface()) { if (sup.equals(sub)) return true; for (Class<?> c : sub.getInterfaces()) if (isSubInterface(sup, c)) return true; } return false; }
572f0dc2-9645-46a4-b82c-1b76f3b0d0e0
6
public void submit3() { //Declaring variables int num = 0; int index = 0; boolean won = false; Team temp; Exception wl = new Exception(); //Check if valid team number is entered try { //Pull number from label, throwing exception if...
09a10a72-ca05-4c81-a4b4-9d9d3f85b1ab
3
public static int getPreviousStop(int busStop, int route) { if (busStop == 0) throw new InvalidQueryException("Nonexistent bus stop"); if (route == 0) throw new InvalidQueryException("Nonexistent route"); database db = database.busDatabase; String source = "path As path1 Inner Join path As...
7be17c66-c619-4799-b070-a882ca6acb6b
6
public void setLink( String link ) { String l = null; // Have a shape with an embed? OOXMLElement oe = getObject( SP ); if( oe != null ) { l = ((Sp) oe).getLink(); } if( l != null ) { ((Sp) oe).setLink( link ); return; } // how's about a picture? oe = getObject( PIC ); if( oe != null )...
f502a03a-254f-4702-8179-a5c5dcff395b
2
@Override public void removeComponent(int index) throws ComponentException { if (index > components.size()) { throw new ComponentException( "Index is larger than the size of the list"); } else if (index < 0) { throw new ComponentException("Index is under zero"); } components.remove(index); }
d2bc9902-0a2e-4bc3-8999-b23acd03318a
6
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Ship other = (Ship) obj; if (this.cargo != other.cargo) { return false; } if ...
f4bc72df-1591-4b0c-bbfb-37df1869b131
7
public long compute(int xGridNum, int yGridNum) { //分母の階乗の配列を取得 int[] numeratorArray = MyMathUtil.factorialArray(xGridNum + yGridNum); //分子左の階乗の配列を取得 int[] denoLeftArray = MyMathUtil.factorialArray(xGridNum); //分子右の階乗の配列を取得 int[] denoRightArray = MyMathUtil.factorialArray(yGridNum); //各要素を素因数分解して、分母、分...
9966d18c-c332-42b7-a021-db8c35d866f9
7
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HttpSession session = request.getSession(); Player user = (Player)session.getAttribute("user"); String name1 = request.getParameter("name1"); String player2Name = request.getParameter("name2"...
d6badd13-8d31-4a79-8fad-d5286f284a28
0
public NewsReader(String name) { this.name = name; }
049108b1-dc18-414e-91a0-5838b3e27f13
3
public int inserir(Autor a){ Connection conn = null; PreparedStatement pstm = null; int retorno = -1; try{ conn = ConnectionFactory.getConnection(); pstm = conn.prepareStatement(INSERT, Statement.RETURN_GENERATED_KEYS); pstm.setString(1, a.getNome()); ...
6d94da82-327e-4503-9c81-7bb04a87ec7b
1
private void renderGame() { BufferStrategy bs = this.getBufferStrategy(); if (bs == null) { this.createBufferStrategy(3); return; } Graphics g = bs.getDrawGraphics(); Graphics2D g2d = (Graphics2D) g; g.setColor(Color.black); g.fillRect(0, 0, getWidth(), getHeight()); g2d.translate(cam.getX(), cam....
cae01248-4c24-4f94-94f1-0daaa28c6063
7
public void update(final int index, final DataTableObject dataTableObject) { SwingUtilities.invokeLater(new Runnable() { public void run() { if(index >= _firstRow && index <= _lastRow) { int upperHeight = _emptyDummyUpperViewportPanel.getSize().height; int viewportHeight = _viewportPanel.getSize().he...
8ea7bfee-49a2-4bcc-8e8c-d968ae1f3c86
8
public void _testMultipleThreadsFailure(MockRAMDirectory.Failure failure) throws Exception { int NUM_THREADS = 3; for(int iter=0;iter<5;iter++) { MockRAMDirectory dir = new MockRAMDirectory(); IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), IndexWriter.MaxFieldLength.LIMITED); ...
3d3a36fa-6d6d-4ec9-aa26-086826499345
1
public void setPWFieldFontstyle(Fontstyle fontstyle) { if (fontstyle == null) { this.pWFieldFontStyle = UIFontInits.PWFIELD.getStyle(); } else { this.pWFieldFontStyle = fontstyle; } somethingChanged(); }
30ce1a0f-9e87-41b2-8274-2eab257b4989
8
public void fcc(double n) { int col = toInt(n) % 8; switch(col) { case 1: g2d.setColor(Color.RED); break; case 2: g2d.setColor(Color.GREEN); break; case 3: g2d.setColor(Color.YELLOW); break; case 4: g2d.setColor(Color.BLUE); break; case 5: g2d.setColor(Color.CYAN); break; ...
b6dc660a-6255-4c06-a765-8db64c8083a7
1
public void EnvoyeAClient(Socket socket, String reponse) { try { PrintWriter printWriter = new PrintWriter(socket.getOutputStream(), true); printWriter.println(reponse); } catch (IOException ioe) { System.out.println(ioe); ioe.printStackTrace(); } }
553330cc-4816-482a-843a-89352e600e61
4
private void osmLoadCoastline(String lowDetailedFile, String highDetailedFile) { CoastlineLoader clPinkGreen = new CoastlineLoader(10000000, 20000000) { @Override public void processNode(CoastlineNode nd) { if (nd != null) { loadingbarCounter(73221); ...
223283f7-d013-472f-a92d-06d0901a88ee
9
public static long gcd(long x, long y) { if (x == 0) { return y; } else if (y == 0) { return x; } else if ((x & 1) == 0 && (y & 1) == 0) { // x and y are even. return gcd(x >> 1, y >> 1) << 1; } else if ((x & 1) == 0 && (y & 1) == 1) { // x is even, and y is odd. return gcd(x >> 1, y); } else if (...
5c673bf4-5284-449a-bdf5-04daaf33f50b
7
public String[] sendJobSearch(String s) throws IOException{ String str = new String("jobsearch"+ "," + s ); System.out.println(str); InetAddress serverAddr= null; try { serverAddr= InetAddress.getByName(GlobalV.serverIP); } catch (UnknownHostException e1) { e1.printStackTrace(); } ...
7283c903-15ca-4cfb-a0db-f6011393f66a
5
private void statement(){ if( first(f_assignment) ) assignment(); else if( first(f_print) ) print(); else if( first(f_if) ) ifproc(); else if( first(f_while) ) whileproc(); else if( first(f_for) ) forproc(); else...
59aa5ef3-244c-4ff2-8d0e-6e1a6bbd3a04
1
@Override public JSONObject getValueForOutput() { try { return this.user.toJson(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); return new JSONObject(); } }
4ceeee71-b351-41db-a479-31e6e0558ea4
4
@Override public void valueRecived(SlotInterface s, Value v) { if (s.getLabel().equals(Trigger)) { if (!input_.isFree()){ Value vv= input_.pullValue(); if (vv!=null){ if (getMode()==EditorMode.DEBUG) input_.getLine((OVNode)input_.getConnections().get(0)).debugDisplay(vv.getString()); outpu...
33afc129-d266-4ef8-ba99-5bd98bf7e9a3
7
private JSONWriter append(String s) throws JSONException { if (s == null) { throw new JSONException("Null pointer"); } if (this.mode == 'o' || this.mode == 'a') { try { if (this.comma && this.mode == 'a') { this.writer.write(','); ...
094beaf0-1ccb-4127-a756-7e69204d02b2
7
public ArrayList searchRoomNumber(Date checkin, Date checkout) { ArrayList temp = new ArrayList(); //find all room first Query q = em.createQuery("SELECT t from RoomEntity t"); for (Object o : q.getResultList()) { RoomEntity p = (RoomEntity) o; temp.add(p.getRoom...
df20c45a-d7fe-45c8-a4fe-9c7fee5c5d33
1
public int evaluate_int(Object[] dl) throws Throwable { if (Debug.enabled) Debug.println("Wrong evaluateXXXX() method called,"+ " check value of getType()."); return 0; };
1181d037-4a0f-4e67-8473-58341a3ad1ff
9
private void jbGuardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbGuardarActionPerformed ResultSet rs; error1(false); // Si no eligió fecha if (fecha == null) { error(true); } else { try { rs = st.executeQuery("SELE...
6da13c4f-d724-4a66-94a6-d5d7ea149fcd
5
public void setKeyboardNavigable(boolean enabled, UIElement startIndex) { if(selection != -1) { get(selection).setSelected(false); } selection = (enabled ? indexOf(startIndex) : -1); if(selection != -1 && get(selection) != null) { get(selection).setSelected(true); } else { if(pointer != null) { ...
c71da65e-0a26-45ed-a20a-74f5e9b4f677
0
public void setPort(String port) { this.port = port; }
98e2ff94-1f05-4873-ba7d-2ec6b691e73c
8
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((carClass == null) ? 0 : carClass.hashCode()); result = prime * result + ((carcase == null) ? 0 : carcase.hashCode()); result = prime * result + ((color == null) ? 0 : color.hashCode()); result ...
c495632f-8bad-4d09-b514-306570e198d2
4
private String extractHTML(String currentPageURL){ //System.err.println("Extract HTML : " + currentPageURL); String theLine = ""; try { URL u = new URL(currentPageURL); InputStream is = u.openStream(); InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new B...
a6a1ac19-50c3-4a20-bb75-e5193f3f17d9
4
public boolean isOptOut() { synchronized (optOutLock) { try { // Reload the metrics file configuration.load(getConfigFile()); } catch (IOException ex) { if (debug) { Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.g...
0bb3de0a-32fb-44ab-9183-8974ab8c3409
3
public void act(List<Actor> newRabbits) { incrementAge(); if(isAlive()) { giveBirth(newRabbits); // Move towards a source of food if found. Location newLocation = findFood(); if(newLocation == null) { // No food found - try...
5bb66cbf-20fa-47fd-b10a-b4f8c4f89b27
4
public static Element nodeListTag(NodeList nl, String tag) { if (nl != null) { int length = nl.getLength(); boolean has = false; for (int i = 0; (i < length) && !has; i++) { has = (nl.item(i)).getNodeName().equals(tag); if (has) { return (Element) nl.item(i); } } } retu...
37d248b4-598b-42b3-be2a-b3fa4f0bda50
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...
aed892b2-24a3-422c-a7fd-68bcecedeea8
2
@Override public String toString() { StringBuilder command = new StringBuilder(); if (sender != null) { command.append(":").append(sender).append(" "); } if (recipient != null) { command.append("PRIVMSG "); command.append(recipient).append(" "); command.append(":").append(contents).append("\n"); ...
8eec8cd9-19c2-4fcb-b074-66d2df300ac0
5
@Subscribe public void login(LoginEvent event) throws SQLException { if(!plugin.bansEnabled)return; if(plugin.IPbans.contains(event.getConnection().getAddress().getAddress().toString())){ event.setCancelReason("Your IP is banned from this server, please appeal on the server website"); event.setCancelled(true...
6988f48d-7e69-4323-95b8-22c3b3881536
4
public double groupObjects() { partitionedObjects = new HashMap<>(); for (int i = 0; i < Feature.possibleFeatures.size(); i++) { for (String value : Feature.possibleFeatures.get(i).getPossibleValues()) { partitionedObjects.put(value, new ArrayList<ClassifiableObject>()); for (ClassifiableObject oc : trai...
5c31beb8-712b-4423-b0bb-7b27a5aa32e9
7
@Override public boolean nextKeyValue() throws IOException, InterruptedException { if (key == null) { key = new LongWritable(); } key.set(pos); if (value == null) { value = new Text(); } value.clear(); final Text endline = new Text("\n"...
3174e181-540d-4d31-aa7b-56544a31abe0
9
public static BufferedImage detectHorizontalEdges(BufferedImage image, int amount) { int width = image.getWidth(); int height = image.getHeight(); BufferedImage edgeImage = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_GRAY); for(int x = 0; x < width; x++) for(int y = ...
c738d15d-bab4-4989-a987-18f09c968491
5
@Override protected void onButtonReleased(GuiButton button) { switch (button.id) { case 0: break; case 1: break; case 2: break; case 3: break; case 4: this.parent.setPreviousGui(); break; } }
3deaf311-2d76-432d-a7f4-5f8a828c41cb
0
private boolean initKarte() { pfadList = new ArrayList<>(); laenderList = new VertexSet(); laenderList.addVertex(new Land(0, 150, 200, Fraktion.Grau, 2)); laenderList.addVertex(new Land(1, 400, 200, Fraktion.Grau, 10)); laenderList.addVertex(new Land(2, 200, 400, Fraktion.Grau, 0)); laenderList.addVertex(...
579f8e1d-48c3-4f44-a261-c9765323dec6
2
private void updateCursor(MouseEvent event) { DockLayoutNode over = over(event.getX(), event.getY()); setCursor(over instanceof DockLayout ? ((DockLayout) over).isHorizontal() ? Cursors.HORIZONTAL_RESIZE : Cursors.VERTICAL_RESIZE : null); }
a9281cfe-3e15-4e71-a2af-6ffba5a6d346
1
public void addElement(Element e) { if (! this.elements.contains(e)) { // TODO: Ne marche pas : Pourquoi ?! this.elements.add(e); } }
29ce4799-ec46-4bf6-8360-d47427f26328
5
public String encodeDictionary(Map<?,?> encodeDictionary) { StringBuilder sb = new StringBuilder(); sb.append(BencodingToken.START_DICT_TOKEN); for(Entry<?,?> entry : encodeDictionary.entrySet()) { Object entryKey = entry.getKey(); Object entryValue = entry.getValue(); sb.append(determineEncoding(ent...
e790677e-190a-4855-8a9c-c3af4238bd59
2
public final void useType(Type type) { if (type instanceof ArrayType) useType(((ArrayType) type).getElementType()); else if (type instanceof ClassInterfacesType) useClass(((ClassInterfacesType) type).getClassInfo()); }
28172696-5cd9-4f6b-b63f-09bbec52378a
6
private static Double performOp(String i1, String i2, String sop) { char op = sop.charAt(0); double a = Double.valueOf(i1); double b = Double.valueOf(i2); switch (op) { case '+': return (double) (a + b); case '-': return (double) (b - a); case '*': ...