method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
63d6fa9f-3457-41a5-a909-0c6b40231fa7
2
@Override public boolean isDown() { for (int i = 0; i < buttons.length; i++) { if (buttons[i].isDown()) { return true; } } return false; }
af4e568e-9cf2-420f-a01b-7c3a18761b09
6
public void makeNumbersMatch(int a, int b, int x, int y) { //&& should be || because the number of times required for a to reach x and b to y may be different while (a!=x || b!=y) { //if a has already reached x, this part of the computation is not required if (a!=x) { ...
f3fbc352-9035-4ead-8afd-923fe0f7a34c
4
@Override public void paintComponent(Graphics g) { super.paintComponent(g); this.setBackground(Color.BLACK); l1.setText("Generation: " + lens.getLens().getNoGeneration()); g.setColor(new Color(192, 0, 0)); for (Ray r : lens.getRays()) { for (int i = 0; i < r.ge...
1734ad03-30b9-4b8c-a7a1-7e84798be632
2
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // luodaan tyhjä lista tiedotteille List<Tiedote> tiedotteet = new ArrayList<Tiedote>(); // luodaan olio businessluokasta TiedoteService service = ne...
6721308c-d790-44c6-8b32-6a7a7a292167
9
public boolean isLetter(int token) { return (token >= 0x41 && token <= 0x5A || token >= 0x61 && token <= 0x7A || token >= 0xC0 && token <= 0xD6 || token >= 0xD8 && token <= 0xF6 || token >= 0xF8 && token <= 0xFF); }
adfdd8b5-fab8-46e9-b977-bf62e6ef5262
3
@Override public void setReadOnly(String key, boolean isReadOnly) { if (key == null) { key = ""; } if (attributes == null || !(this.isReadOnly.containsKey(key))) { return; } this.isReadOnly.put(key, new Boolean(isReadOnly)); }
317653a5-b98a-459c-a303-ac6fa87c41ee
5
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { String year,month; year=request.getParameter("year"); month=request.getParameter("month"); String region=request.ge...
c1cbdf4e-1173-4cd0-8703-38486c3e9c5f
9
public ExposureProgram fromVlue(short value) { switch (value) { case 0: return UNDEFINED; case 1: return MANUAL; case 2: return NORMAL_PROGRAM; case 3: return APERTURE_PRIORITY; case 4...
87ea3182-1d51-4c24-8e94-a194599172ae
5
public boolean equals(Group f) { if(f == null) { return false; } if (!this.activityIds.equals(f.activityIds)) { return false; } if (!this.name.equals(f.name)) { return false; } if (!this.userId.equals(...
ebbdd550-d86b-403e-8fc9-fb8b919b82ba
1
public void testZoneTransition() { DateTime dt = new DateTime (2005, 4, 3, 1, 0, 0, 0, DateTimeZone.forID("America/Los_Angeles")); try { dt.hourOfDay().setCopy(2); fail(); } catch (IllegalFieldValueException e) { assertEquals(DateTimeFieldType.hour...
f6e4b849-8217-47db-8a49-b998a0259677
4
public void run() { /** * Three step: 1) get challenge, 2) send reponse, 3) parse list */ try { URL url = new URL(BASE_URL + "?" + CommunityConstants.BASE64_PUBLIC_KEY + "=" + URLEncoder.encode(base64PubKey, "UTF-8")); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); BufferedRead...
4e439ff0-889c-4c06-871e-0be6640bd024
3
void addClinit(final Type type) { try { final ClassEditor ce = context.editClass(type); final MethodInfo[] methods = ce.methods(); for (int i = 0; i < methods.length; i++) { final MethodEditor clinit = context.editMethod(methods[i]); if (clinit.name().equals("<clinit>")) { worklist.add(clinit.m...
79cd04ed-70ab-40f2-b07d-069b08672a04
2
private void addInOrder(ArrayList<Long> timestamps, ArrayList<Double> values, long timestamp, double value){ for (int i = 0; i < timestamps.size(); i++){ if (timestamps.get(i) > timestamp){ timestamps.add(i,timestamp); values.add(i,value); return; } } timestamps.add(timestamp); values.add(valu...
4d59f1ee-7929-4dbf-9dbe-d5c8893e9674
2
ImageSearchResponse(JSONObject jsonObject) { super(jsonObject); if (this.Count > 0) { JSONArray results = (JSONArray) jsonObject.get("results"); @SuppressWarnings("unchecked") Iterator<JSONObject> iterator = results.iterator(); while (iterator.hasNext()) { Results.add(new ImageResult(iterator.next()...
b922489d-ccb4-4f18-b9ba-09a1b4392f20
8
public boolean mousedown(Coord c, int button) { if(button == 1) { if(ui.modshift) wdgmsg("xfer"); else wdgmsg("click"); return(true); } else if(button == 3 && ui.modshift) //Kerri { if(boxValues != null) {...
cc5a5aba-2999-4bc6-bb4f-d3c6252bdd33
0
public SQLPermissionRcon() { super("rcon"); }
7be38977-99bb-4a01-9a1f-e96fbfff8598
9
public ListNode reverseKGroup(ListNode head, int k) { if(k == 1 || k == 0 || head == null) { return head; } ListNode lastTail = null, ret = head; ListNode[] points = new ListNode[k]; while(true) { int leftLen = 0; for(; leftLen < k; leftLen+...
9997363e-5739-4741-915f-17662057a0b1
1
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane2 = new javax.swing.JLayeredPane(); jLabel1 = new javax.swing.JLabel(); val_token = new javax.swing.JTextField(); ...
43f1b704-be68-4ae0-a618-6f1499bd22e6
8
public ListNode detectCycle(ListNode head) { if (head == null || head.next == null) { return null; } //find if exist cycle ListNode p1 = head; ListNode p2 = head; while (p1 != null && (p2 != null && p2.next != null)) { p1 = p1.next; p2 ...
d4d06c27-f151-4431-a4bc-87a5389237b7
2
public int countOccurrences(int target) { int answer; int index; answer = 0; for (index = 0; index < manyItems; index++) if (target == data[index]) answer++; return answer; }
ee4509ae-9a45-4170-ac44-5f085d2388af
1
private void mergeFinallyBlock(FlowBlock tryFlow, FlowBlock catchFlow, StructuredBlock finallyBlock) { TryBlock tryBlock = (TryBlock) tryFlow.block; if (tryBlock.getSubBlocks()[0] instanceof TryBlock) { /* * A try { try { } catch {} } finally{} is equivalent to a try {} * catch {} finally {} so remove...
d63bb787-7a4d-4b95-b61a-d6113614d0bb
1
public void stop() { driver.quit(); String verificationErrorString = verificationErrors.toString(); if (!"".equals(verificationErrorString)) { fail(verificationErrorString); } }
e4aee29c-71b8-4776-beee-9922d2b5cc64
9
public CreateActivityWindow() { setTitle("Añadir actividad"); setResizable(false); this.activityService = ActivityService.getInstance(); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setBounds(100, 100, 462, 258); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); set...
1a4a0fe8-4cdc-4a87-8817-2a5dc01f7864
1
public void test_add_long_int() { assertEquals(567L, iField.add(567L, 0)); assertEquals(567L + 1234000L, iField.add(567L, 1234)); assertEquals(567L - 1234000L, iField.add(567L, -1234)); try { iField.add(LONG_MAX, 1); fail(); } catch (ArithmeticException ex...
a1de630b-9d2a-4c0b-b461-d38ceb7c1512
9
static public void loadTweets(){ Statement stmt = null; ResultSet rs = null; for(int month = 1; month <=4; month ++) try { String monthStr = "" + month; if(month < 10) monthStr = "0" + monthStr; stmt = conn.createStatement(); String sqlTxt = "select published_time_GMT, status_ID, user_ID,...
5a27a396-398f-4121-8c14-0f1155efb167
3
public void setNewNBOpcodes(Map<String, Integer> newNBOpcodes) { for(Integer value : newNBOpcodes.values()) { if(value < 0x02 || value > 0x3f) { throw new IllegalArgumentException("Custom non-basic opcodes must be between 0x02 and 0x3f"); } } this.newNBOpc...
2086b771-c53b-44e2-969f-b9a8dcdc3cb9
5
public static double[] doLinearRegressionFromTo(int start,int end,double[][] args) //input int start, int end { //input double[1]=array of prices double[] answer = new double[3]; int ...
e4655b94-4e94-4f7a-a611-47589fe5bb36
2
public List<Variant> variants() { LinkedList<Variant> list = new LinkedList<Variant>(); // // Coverage // int coverage = Gpr.parseIntSafe(getInfo("DP")); // // // Is it heterozygous, homozygous or undefined? // Boolean isHetero = calcHetero(); // Create one SeqChange for each ALT Chromosome chr = ...
3c37c5fb-9da2-4af8-99cf-3b616c1718ee
0
public void delArena(String name) { arenas.remove(name); }
41702cec-36db-4532-bcd4-d032fc7f9bb9
6
private boolean passwordAcceptable() { char[] pass1, pass2; try { pass1 = passField.getPassword(); pass2 = repassField.getPassword(); } catch (NullPointerException ex) { badPassLabel.setText("Password must have at least one characte...
92432f04-3f7d-4772-9923-6765a4311042
8
public static final boolean checkAncestry(final Class<?> cl, final Class<?> ancestorCl) { if (cl == null) return false; if (cl.isPrimitive() || cl.isInterface()) return false; if ( Modifier.isAbstract( cl.getModifiers()) || !Modifier.isPublic( cl.getModifiers()) ) return false; if (ancestorCl == null) return t...
60c7b556-895f-455e-8d7d-94e93ac294e7
2
public char scanChar() throws StringScanException { int idxSave = idx; skipWhiteSpace(); try { if (buf[idx] == '\'') { return scanQuotedChar(); } else { return scanUnquotedChar(); } } catch (StringScanException e) { idx = idxSave; throw e; } }
207db133-a991-4f14-8e6f-5f724d012431
2
public void mouseReleased(MouseEvent event) { // Did we even start at a state? if (first == null) return; State state = getDrawer().stateAtPoint(event.getPoint()); if (state != null) { controller.transitionCreate(first, state); } first = null; getView().repaint(); }
de24c5eb-048e-400f-981a-d1e653ee0c27
6
private void calculateDoorPaths() { doorPaths = new Path[doorGraph.length][doorGraph.length]; for (int i = 0; i < doorPaths.length; i++) { for (int j = 0; j < i; j++) { if (i == j || doorGraph[i][j] <= 0) { // Doors are equal or not adjacent doorPaths[i][j] = null; continue; } Door fro...
932e158c-dac0-4cd7-b642-def8f0cdbe39
4
private void waitAnswer() throws Exception { for (long i=Sequence;i<((Sequence+WIN>nbSequence)?nbSequence:Sequence+WIN);i++) { DatagramPacket packet=new DatagramPacket(new byte[PAYLOADLENGTH], PAYLOADLENGTH); rx(dataSocket, new byte[PAYLOADLENGTH]); System.out.println("verifier si c'est un ACK" +mes...
db48a5d4-164d-4687-99bd-6fcd5ac2611c
4
public static Logger getLogger() throws Exception{ if (filename == null){ throw new Exception("Cannot initialice Logger: Filename not defined."); } if (level == null){ level = Level.SEVERE; } if (logger == null){ try{ createLogger(); } catch(IOException e){ throw new Exception("Ca...
3e3561bc-36cd-4077-b99b-a666f5174b4e
3
private void evalInvokeMethod(int opcode, int index, Frame frame) throws BadBytecode { String desc = constPool.getMethodrefType(index); Type[] types = paramTypesFromDesc(desc); int i = types.length; while (i > 0) verifyAssignable(zeroExtend(types[--i]), simplePop(frame)); ...
3d8d9518-a3e2-4a89-bb1d-c01035e7c20e
9
private void parseArguements(String[] args, Job job) throws IOException { for (int i = 0; i < args.length; ++i) { if ("-input".equals(args[i])) { String files = args[++i]; for (String file : files.split(",")) { FileInputFormat.addInputPath(job, new Path(file)); } } else if ("-output".equals(arg...
f8d2d29a-ad9b-454d-8437-7c412c148ea8
4
public void openBraceNoSpace() { if ((Options.outputStyle & Options.BRACE_AT_EOL) != 0) println("{"); else { if (currentLine.length() > 0) println(); if ((Options.outputStyle & Options.BRACE_FLUSH_LEFT) == 0 && currentIndent > 0) tab(); println("{"); } }
0657dfcd-4ec1-48fd-a9cd-dfce7a0515a1
4
public Path getImgPath_UserlistImage(Imagetype type) { Path ret = null; switch (type) { case MOUSEFOCUS: ret = this.imgUserlist_MFoc; break; case SELECTED: ret = this.imgUserlist_Sel; break; case FOCUSS...
19082c76-9f11-404e-a68a-f93cc5927191
0
@Override public void execute(VirtualMachine vm) { super.execute(vm); ((DebuggerVirtualMachine) vm).executionFinished(); }
867bf759-052d-42bc-88e3-326748d8ee9c
3
String PalabraNueva(String palabra) { String temporal = "", muestra = "", acum = ""; for (int i = 0; i < palabra.length(); i++) { temporal += palabra.charAt(i); acum = temporal; if (temporal.toLowerCase().equals(acum)) { muestra += temporal.toUpperCas...
45d4757f-bcc1-42dd-958f-3f62e7169162
4
public static void back(int length, int cur, int last) { if (length == list.length - 1) { if (cur + dis(list[last], start) < minPath) minPath = cur + dis(list[last], start); } else for (int i = 1; i < list.length; i++) if (!visited[i]) { visited[i] = true; back(length + 1, cur + dis(list[las...
6315119f-dbc2-4b48-8474-85bbfdd6d018
9
public RenderedImage create(ParameterBlock paramBlock, RenderingHints renderHints) { BorderExtender extender = renderHints == null ? null : (BorderExtender)renderHints.get(JAI.KEY_BORDER_EXTENDER); ImageLayout layout = renderHints == null ? null : ...
217711e6-176c-4e79-bb0b-9080c2216bb4
9
public void getFrequencies(String taggedString){ String[] getTags = taggedString.split("\\s+"); String noun1 = "NNS"; String noun2 = "NN"; String noun3 = "NNP"; String noun4 = "NNPS"; String verb1 = "VB"; String verb2 = "VBD"; String verb3 = "VBG"; ...
8a9716c7-f915-4d7a-bb5f-0e3f0311f82c
2
Class<? extends LabFactory> getFactoryClass() { final String className = getProperty(PROPERTY_CLASS); try { LOGGER.trace("Loading LabFactory class {}", className); return Class.forName(className).asSubclass(LabFactory.class); } catch (final ClassNotFoundException e) { throw new IllegalStateException("F...
d82abc4c-02d8-4237-987d-5b973142cf00
2
@Override public void tick() { minions = Game.getInstance().getMobs(); for (GenericMinion gm : minions) { if (pos.distance(gm.getPos()) < RADIUS) { gm.attackPlayer(); gm.onKilled(); } } }
5b6979c4-1496-44e2-9448-80a4972efafb
3
@Test public void testMoveForwardCharge() throws InsufficientChargeException { exception.expect(InsufficientChargeException.class); Random rand = Mockito.mock(Random.class); // On s'assure que le terrain et toujours franchissable. Mockito.when(rand.nextInt(Land.CountLand())).then...
f199261b-07fd-4c45-ab69-2da9647d30fc
3
public String showMessage() throws Exception { Connection conn = null; ResultSet rs = null; Statement stmt = null; try { Class.forName("com.mysql.jdbc.Driver"); conn = DriverManager.getConnection(url, user, psw); if (!conn.isClosed()) System.out.println("Success connecting to the Database!"); el...
087187de-9f57-4e0f-bc64-42a6d9090d69
9
static final void method606(int i, boolean bool, String string) { anInt1128++; string = string.toLowerCase(); short[] is = new short[16]; int i_52_ = i; int i_53_ = bool ? 32768 : 0; int i_54_ = ((!bool ? ((Class355) Class239_Sub6.aClass355_5900).anInt4365 : ((Class355) Class239_Sub6.aClass355_5900).anInt4...
6438c4fa-33de-49b5-9a6d-45f926e21bd2
2
@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { String codeRequest = request.getCharacterEncoding(); // установка кодировки из параметров фильтра, если не установлена if (code ...
12123a7c-8599-4821-a02f-0c6e0877c309
4
public static void UpperGenre(){ try { if(conn == null || conn.isClosed()){ conn = DatabaseConnection.getConnection(); } } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try{ conn.setAutoCommit(false); PreparedStatement stmnt...
cbbe5678-2dcd-425c-b89f-e481a8ac1528
8
public ForLine(Line parent, TokenStream stream, int indentationLevel) { super(parent); Token variableName = stream.removeFirst(); if (!IdentifierMap.isValidIdentifier(variableName.toString())) throw new SyntaxError("Invalid variable name in for statement: " + variableName); variable = new ExpressionIdentifi...
c14eb0a4-4bcb-4d4d-898c-7def8d349211
4
public final void grow(int size) { if (locals != null) { size += count; if (size > locals.length) { int nextSize = locals.length * 2; // GlobalOptions.err.println("wanted: "+size+" next: "+nextSize); LocalInfo[] newLocals = new LocalInfo[nextSize > size ? nextSize : size]; System.arraycopy...
ee4bf61f-ea3c-40e3-856c-353248dc7509
0
@Override public void setRank(int newRank) { rank = newRank; }
18cfc10d-a24f-45da-8443-caf870649bbf
3
public static List<JumpInsnNode> getTargeters(MethodNode m, LabelNode ln) { List<JumpInsnNode> targeters = new LinkedList<JumpInsnNode>(); for (Iterator<AbstractInsnNode> it = m.instructions.iterator(); it .hasNext();) { AbstractInsnNode n = it.next(); if (n instanceof JumpInsnNode) { JumpInsnNode jn...
3cc44f2a-2cfb-4399-8c97-713bd1b771c8
0
@Test public void testForeignKeyPopulation() throws SQLException, IOException, ClassNotFoundException, ParseException { SqlTester.executeSqlFile("test/resources/createTestDb.sql"); Populator p = new Populator(); p.generators.addAll(this.test1Generators()); p.populate("test1", "dim1",...
c419da4e-3945-43fa-9fa0-b6db6f5ac051
5
private int decodeWhiteCodeWord() { int current; int entry; int bits; int isT; int twoBits; int code = -1; int runLength = 0; boolean isWhite = true; while (isWhite) { current = nextNBits(10); entry = white[current]; // Get the 3 fields from the entry isT = entry & 0x0001; bits = (ent...
835eee1c-c0ab-4454-95c2-1fbc5fcb85fb
0
public void setAlive(boolean alive) {this.alive = alive;}
902f76c2-ad2a-4941-9184-6cb7049fe004
1
public CharacterSearchResults searchByQuery(String query) { try { query = URLEncoder.encode(query, "UTF-8"); } catch (Exception e) {} String searchUrl = "character.php?q=" + query; return new CharacterSearchResults(new Network().connect(searchUrl)); }
857fc813-5912-49ff-88e9-0641e52c7458
9
public List<Modifier> getProductionModifiers(GoodsType goodsType, UnitType unitType) { if (goodsType == null) { throw new IllegalArgumentException("Null GoodsType."); } List<Modifier> result = new ArrayList<Modifier>(); final ...
241a6f9a-40c5-4159-b850-5dac245cd5c1
4
public synchronized void gridletMove(int gridletId, int userId, int destId, boolean ack) { // cancels the Gridlet ResGridlet rgl = cancel(gridletId, userId); // if the Gridlet is not found if (rgl == null) { logger.log(Level.INFO, super.resName_ + ...
6f1ae385-2648-48af-92ca-aefa04fce498
2
public String whatAreYou() { return isVar()?"variable" :isConst()?"constant" :"OOPS Entry whatAreYou()"; }
8d9c4ff4-6fc1-4c42-8797-67d7dfd8e573
8
public static int fetchIdByName(String departmentName) { ResultSet rs=null; Connection con=null; PreparedStatement ps=null; int result=0; try{ String sql="SELECT DEPTID FROM DEPARTMENT WHERE DEPTNAME=?"; con=ConnectionPool.getConnectionFromPool(); ps=con.prepareStatement(sql); ps.setString(1, depa...
12790209-ac39-452a-93df-bff9dd871526
9
private void menubar(){ //construct the menubar JMenu M_patient = new JMenu("Patient"); menubar.add(M_patient); JMenuItem newpatient = new JMenuItem("New"); JMenuItem searchpatient = new JMenuItem("Search"); M_patient.add(newpatient); newpatient.addActionListener(new ActionListener(){ @Override publ...
4e4db8a0-9b47-4533-860a-21d9cc15edb1
0
private static void testX(){ //Below was for testing an issue I had with creating ArrayList holding the deck of cards. //Apparently even when declared "private ArrayList<Integer> shuffledDeck = new ArrayList<>(52);" the size is still 0 until elements are added. //Dealer dealer = new Dealer(17); //for (int...
18e64b01-186e-4805-8f6d-aed7e9d92671
4
@SuppressWarnings("CallToThreadDumpStack") public static List<String> getListaDeStringDeArchivo(File archivo){ List<String> listaDeCadenas = new ArrayList<String>(); FileReader fr = null; BufferedReader br; try { fr = new FileReader(archivo); br = new Buffered...
9a491378-941c-4eb3-8d64-f30a64b4c342
4
public void tick() { tick++; switch(type) { case 1: allyBar[0].tick(); allyBar[1].tick(); enemyBar[0].tick(); enemyBar[1].tick(); if(tick == 180) { tick += ally.aut...
15850118-a874-4883-a473-e83eab0adc17
6
@SuppressWarnings("deprecation") @Override public void mouseMoved(MouseEvent e) { for (Button b : buttons) { if (e.getPoint().x > b.p.x && e.getPoint().x < b.p.x + b.d.width && e.getPoint().y > b.p.y && e.getPoint().y < b.p.y + b.d.height) { b.setHovering(true); display.frame.setCursor(Cursor.HAND_CURSOR...
44dd6047-b78e-4408-800b-345475f669fc
6
private boolean parseFields() { boolean successful = true; //surrounding with try and catch in order for the app not to blow because of casting try { if (debiterCombo.getSelectedIndex() != -1) { e.setDebiterID(StrVal.parseIdFromString((String) debiterCombo.getSelecte...
aa13a746-877f-4bfe-b56d-d2bd4faa4d58
5
private void sendToClientZipFiles(IoSession session) throws IOException { InputStream openStream = null; try { URL resource = this.getClass().getClassLoader() .getResource("flume.properties"); openStream = resource.openStream(); Properties properties = new Properties(); properties.load(openStream);...
bfbdb52b-3df2-4c2c-8575-0bcc2340e7a2
2
public static String readLine(Socket socket){ String line = new String(); int c; try { while((c = socket.getInputStream().read()) != '\n'){ line += (char) c; } } catch (IOException e) { System.err.println("Error reading line from strea...
460c1f1d-9b31-4831-80cd-44afd40634de
2
protected void consumeStreams(final Exec exec) { if (page != null) { page.getWorkbenchWindow().getShell().getDisplay().asyncExec(new Runnable() { @Override public void run() { try { GruntConsoleView view = (GruntConsoleView) page.showView( GruntConsoleView.VIEW_ID, task, IWorkbenchPage....
7ed4c409-b0dc-4998-967a-d47ed8253ca9
5
public void updateIcon() { if(isNode) { if(isOpen) { if(isSelected) { setIcon(ICON_OPEN_NODE_SELECTED); } else { setIcon(ICON_OPEN_NODE); } } else { if(isSelected) { setIcon(ICON_CLOSED_NODE_SELECTED); } else { setIcon(ICON_CLOSED_NODE); } } } else { if(isSel...
6b93f068-9fdb-4015-86ae-adabcd68c0d2
2
public boolean neloset(){ for(int i=0; i<5; i++){ if(nopat[i].getValue()==4){ return true; } } return false; }
ef01e415-4b9a-404d-9338-4e66fa1f8620
2
public static JSGUI_Widget unWrapGUI_Widget(Object obj) { if (obj instanceof org.mozilla.javascript.Wrapper) { Object temp = ((org.mozilla.javascript.Wrapper)obj).unwrap(); if (temp instanceof JSGUI_Widget) return (JSGUI_Widget) temp; } return null; }
2980aa76-99a5-4068-b118-418fe30b68e8
0
final protected PropertyTree getParent() { return parent; }
474ac325-6162-4e03-aa72-eca282423fa1
8
@Override public void service(Request request, Response response) { // 色コードを取得する。 int[] color = getRGBColor(request); // セッション ID とユーザー名を取得する。 String sessionId = request.getCookie("session_id"); String[] names = null; try (ShopDB db = new ShopDB()) { if (sessionId == null || ! db.checkSessionId(session...
17dce199-4297-447e-8795-caa77f6f5816
2
public void printJobFailed(PrintJobEvent pje) { System.out.println("Failed"); PrinterStateReasons psr = pje.getPrintJob().getPrintService().getAttribute(PrinterStateReasons.class); if (psr != null) { Set<PrinterStateReason> errors = psr.printerStateReasonSet(Severity.REPORT); ...
3803f4e9-9708-4383-9fd7-56c4d708015a
6
public void update() { int n; double min = 9999999999999.0; double dist = 0.0; Element e; focus = null; n = listElements.size(); for(int i = 0; i < n; i++) { e = listElements.get(i); if(e.type == Type.BOMBERMAN && (dist = distanceToElementPow(e)) < min) { focus = e; pushEvent(focus,...
acff8bce-ef2c-42b5-9d89-68fdf11e4db4
1
static public Catalogo_Cursos instancia() { if (UnicaInstancia == null) { UnicaInstancia = new Catalogo_Cursos(); } return UnicaInstancia; }
79f72272-772c-42b4-a5ee-8e9168b1cf98
4
public static void UpperSurname(){ try { if(conn == null || conn.isClosed()){ conn = DatabaseConnection.getConnection(); } } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try{ conn.setAutoCommit(false); PreparedStatement stm...
47380b50-c5cb-4d5e-bb36-4af77af48f96
9
public String nextToken() throws JSONException { char c; char q; StringBuffer sb = new StringBuffer(); do { c = next(); } while (Character.isWhitespace(c)); if (c == '"' || c == '\'') { q = c; for (;;) { c = next(); ...
d192cb6b-a9ea-48ad-a781-11e765e2e5e3
0
@BeforeClass public static void setUpClass() { }
c1c98d4d-d2b0-4191-a455-0a0a0760ad91
7
public final TLParser.exprList_return exprList() throws RecognitionException { TLParser.exprList_return retval = new TLParser.exprList_return(); retval.start = input.LT(1); Object root_0 = null; Token char_literal100=null; TLParser.expression_return expression99 = null; ...
015ba99c-c5b7-4979-b6f9-45efcbc667ba
7
public String longestPalindrome(String s) { preProcess(s); int center = 0; int rightFrontier = 0; int maxLength = 0; int maxIndex = -1; int[] palindromeLength = new int[preProcessed.length()]; palindromeLength[0] = 0; for (int i = 1; ...
10ea03fa-24a4-4d8f-8d8d-3f10dac2a0e0
3
public void updateCharAppearance(int[] styles, int[] colors) { for(int j = 0; j < 7; j++) { if(styles[j] > 0) { styles[j] += 0x100; pCHead = styles[0]; pCBeard = styles[1]; pCTorso = styles[2]; pCArms = styles[3]; pCHands = styles[4]; pCLegs = styles[5]; pCFeet = styles[6]; }...
f8032a74-209f-4394-83c8-706b8a6651b1
1
public static FileUtil getInstance() { if(instance == null) { instance = new FileUtil(); } return instance; }
86620db4-337a-40e9-842f-126e91e693b5
1
public Expr[] pop2() { final Expr top = (Expr) stack.remove(stack.size() - 1); Expr[] a; final Type type = top.type(); if (type.isWide()) { a = new Expr[1]; a[0] = top; } else { a = new Expr[2]; a[0] = (Expr) stack.remove(stack.size() - 1); a[1] = top; } height -= 2; return a; }
ad93bed5-62a8-4d0d-9fc0-836ffb0d1287
4
@Override public Value evaluate(Value... arguments) throws Exception { // Check the number of argument if (arguments.length == 1) { // get Value Value value = arguments[0]; // If numerical if (value.getType().isNumeric()) { return new Value(new Double(Math.exp(value.getDouble()))); } if (val...
d9bae9ab-ebf5-4a4b-9edf-432661fc08b1
0
@Override public int getYearsExperience() { return super.getYearsExperience(); }
3a2fa763-83ef-49dd-9244-47dbb8d0564e
2
public static void closePlayerWaitingModal() { assert overlayStack.size() > 0; assert window.getGlassPane() == overlayStack.peek().getOverlayPanel(); if (overlayStack.size() > 0) { overlayStack.pop().getOverlayPanel().setVisible(false); if (overlayStack.size() > 0) { window.setGlassPane(overlayStack...
bd7fd2b9-2d2d-4f48-91ad-9e9ff48bbeaf
5
public void moveFallingBlock(Move direction) { switch (direction) { case DOWN: fallingBlock.moveDown(); break; case LEFT: fallingBlock.moveLeft(); break; case RIGHT: fallingBlock.moveRight(); ...
c1a1418d-4baf-4c5d-8458-dbf376081f54
3
public void setElement(ZElement elem, String index) { if (index == Constantes.MCDENTITE1 ) this.elem1 = elem; else if (index == Constantes.MCDENTITE2 ) this.elem2 = elem; else if (index == Constantes.MCDASSOCIATION) this.elem3 = elem; else ...
0f483fb0-3269-4317-8055-a07223a05219
3
public static void main(String[] args) { // Finding a min or max value int[] nums = { 20, 4, 33, 101, 14, 76 }; int currMax = nums[0]; int currMin = nums[0]; for (int i = 1; i < nums.length - 1; i++) { if (currMax < nums[i]) { currMax = nums[i]; } if (currMin > nums[i]) { currMin = n...
53b324fe-2581-44cd-b066-9e91bb0f12c2
0
public int getQuantity() { return this.quantity; }
cef7acff-30b0-478d-8220-c69fbf2879fd
2
private void createAmazonS3Bucket() { try { if (tx.getAmazonS3Client().doesBucketExist(bucketName) == false) { tx.getAmazonS3Client().createBucket(bucketName); } } catch (AmazonClientException ace) { JOptionPane.showMessageDialog(frame, "Unable to crea...
0e7181f4-5050-45c1-8c2b-5a986b8134f9
5
public static Primer transcribePrimerSequences(String primerSequence, int numbMismatches){ Primer newPrimer; String bottomSeq; String topSeq = ""; //char[] nucleotides; char currentNuc; int index; //int counter; // bottom primer bottomSeq = primerSequence; // top primer //counter = 0; //nu...
58d4b931-6286-4238-a110-26933ac8e079
5
@SuppressWarnings("rawtypes") public static JobConf getJobConf(Configuration conf, String[] args, Class callerClass) throws IOException { // Directly create the path instances with the given paths and store them for later usage. Path input = new Path(args[0]); Path output = new Path(args[1]); // Create new ge...
b36bfd83-4381-4910-95e8-82630a6d43a1
9
public Queue<String> soldadoXMLUnit (){ try { path = new File(".").getCanonicalPath(); FileInputStream file = new FileInputStream(new File(path + "/xml/papabicho.xml")); DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); D...