method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
db0d1c6f-8336-4cdc-aa95-02d9f0e54642
1
public List<String> getValues() { List<String> valuesList = new ArrayList<String>(); for(int i = 0; i < size; i++) { valuesList.addAll(map[i].getValues()); } return valuesList; }
7caab213-4e94-4e5e-ad6e-6b3fed7992fa
5
public static Staff getStaffByID(String staffID){ try { if(conn == null || conn.isClosed()){ conn = DatabaseConnection.getConnection(); } } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { Statement stmnt = conn.createStatem...
829168cd-5c22-469c-b812-c80a5d503f16
6
public void render() { if(isMoving()) { if(hspeed < 0){ prevDir = LEFT; anim_left.play(); drawImage(anim_left.getImage(), (int)x, (int)y, 0); anim_left.update(); } else if(hspeed > 0) { prevDir = RIGHT; anim_right.play(); drawImage(anim_right.getImage(), (int)x, (int)y, 0); ...
39d2cff6-f4f5-406c-bed2-0f43e0937e1c
1
private Venda finazilarVenda(double desconto, String formaPagamento, String cliente, String dependente) throws ExceptionGerenteVendas { if(atual != null){ atual.addDesconto(desconto); atual.setFormaPagamento(formaPagamento); atual.setCliente(cliente); atual.setDepend...
82be55f4-23c3-475f-ba1c-12891269238b
4
private boolean yesOrNo() { String yesOrNo = scanYesOrNo(); switch (yesOrNo) { case "YES": case "Y": return true; case "NO": case "N": return false; default: return false; } }
01818429-747a-4c97-a956-c5c632109d80
8
public void onKeyPressed(KeyEvent e) { switch (e.getKeyCode()) { case VK_UP: case VK_W: // Arrow up key: move direction = forward (infinitely) moveDirection = 1; moveAmount = Double.POSITIVE_INFINITY; break; case VK_DOWN: case VK_S: // Arrow down key: move direction = backward (infinitely) ...
8d01b4ff-e63d-418d-9fb7-5eefa92b9f25
5
public boolean addSentence(String word, final Sentence sentence) throws IOException { final boolean[] added = new boolean[] { true }; final int[] count = new int[] { 0 }; File file = getWordFile(word); if (file.exists()) { if (file.length() > 40000) return false; scan(file, new SentenceParserCall...
a0291612-3424-4f90-8f8d-9f0531e8eabd
1
public static Sistema getInstance() { if (instance == null) { instance = new Sistema(); } return instance; }
94075bd9-c0f1-49a5-b647-9d437c3a6a7f
7
public Object nextValue() throws JSONException { char c = this.nextClean(); String string; switch (c) { case '"': case '\'': return this.nextString(c); case '{': this.back(); return new JSONObject(this); ...
c9e6cbb0-caba-46fc-9130-e170d27ad16d
4
private void saveConfig(){ String str = new String(); for(int i=0; i<config.length; i++) str = new String(str+properties[i]+";"+config[i]+"\r\n"); BufferedWriter writer = null; try{ writer = new BufferedWriter( new FileWriter(file)); writer.write(str); } catch ( IOException e){} finally{ ...
75d5c50c-1258-44d0-9cd1-d93ad7af5596
2
public void loadConfigFiles() { try { loadBoardConfigFile(); loadLegendConfigFile(); } catch (FileNotFoundException e) { System.out.println(e.getMessage()); } catch (BadConfigFormatException e) { System.out.println(e.getMessage()); } }
1ec39c10-da89-4c21-a10e-8a2b01440435
5
public static void main(String[] args) { if (args.length > 1) { System.err.println("Usage: java HackAssembler [.asm name]"); System.exit(-1); } @SuppressWarnings("unused") HackTranslator assembler; //If a file is passed as an argument assemble ...
ac1ccaa5-01ba-4532-b1ad-8765f7907686
0
public int calculate(int a, int b) { return a / b; }
2b1de50a-c26d-4f51-9a67-9addfa54aaff
9
final private boolean jj_3R_23() { Token xsp; xsp = jj_scanpos; if (jj_3R_28()) { jj_scanpos = xsp; if (jj_3R_29()) { jj_scanpos = xsp; lookingAhead = true; jj_semLA = (getToken(1).kind == INDENTIFIER1 || getToken(1).kind == INDENTIFIER2) && jep.funTab.c...
cf33b4fc-bf0a-4201-9346-65b52abfb03d
1
public static String getStackTrace(Throwable t) { String stackTrace = null; try { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); t.printStackTrace(pw); pw.close(); sw.close(); stackTrace = sw.getBuffer()...
6f90f82c-1928-4622-8f28-54a38445ccc2
5
public Metadata(Object obj) { primitiveValues = new HashSet<String>(); collectionsValues = new HashSet<String>(); associatedValues = new HashSet<String>(); this.obj = obj; if (obj == null) { classMetadata = null; return; } classMetadata = g...
c351ef52-815d-4dac-86fc-bfa7a1da82d2
9
@Override public Result select(String[] conditions, String[] arguments) { //Check for parameter errors if(arguments.length>1){ return new Result(102); }else if(conditions.length!=arguments.length){ return new Result(103); }else { String[] temp = ne...
886d4c11-3b0e-4112-beca-62c0197734f0
5
final public Number number(boolean requireEOF) throws ParseException { Number val = null; Token t = null; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case INTEGER: t = jj_consume_token(INTEGER); val = new Long((t.image.startsWith("+")) ? t.image.substring(1) : t.image); bre...
375c0f63-37f9-45f5-a297-c594163abf18
6
public <T> T requestService(Class<T> service) { T result = null; ServiceLoader<T> impl = ServiceLoader.load(service); for (T loadedImpl : impl) { result = loadedImpl; if (result != null && DEFAULT_SERVICES.containsKey(service.getName())) { if (DEFAULT_SER...
b23bfcdb-4d97-4549-bb13-d2df0eaabb0b
1
public void save(String fileName, String outputFormat) throws IOException { BufferedImage output = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); int[] data = ((DataBufferInt) output.getRaster().getDataBuffer()) .getData(); for (int i = 0; i < data.length; i++) { data[i] = pixels[i]; ...
db90ba2f-dd40-4509-805b-6628c2a2f96b
0
public FrameGeneralWindow getMainWindow(){ return mainWindow; }
ad39506b-0342-4629-9731-3e6983198c95
0
@Override public double getArea() { return Math.PI * _radius * _radius; }
82913f7f-935e-4343-88be-77043bd32de3
0
@Override public String getDesc() { return "EarthQuake"; }
c42df320-e87d-4b82-a945-91f80ba855fb
3
public double winPossibility(ActionList history, GameInfo gameInfo, int playerHandStrength) { // find number of raise actions in history int numRaises = history.numberOfRaises(); // find histogram and adjusted hand strength int[] histogram = historyToHandStrength.get(numRaises); int aphs = adjust...
be232abb-b412-4c7e-9686-b81faf4134d9
0
public static void main(String[] args) { (new InterfaceDeUsuario()).menu() ; }
7c32b31f-8a62-4098-aee2-708f945bbdff
3
@Override public List<User> getAll() throws SQLException { List<User>users = null; Session session=null; try{ session=HibernateUtil.getSessionFactory().openSession(); session.beginTransaction(); users = session.createCriteria(User.class).list(); session.getTransaction().commit(); }catch(Exceptio...
af0ff1c3-2e09-40a1-878f-5f5efbdd2d66
4
public boolean insert(final Block block) { final Def def = operandAt(block); if (def == null) { return true; } if (!def.downSafe()) { return true; } if ((def instanceof Phi) && !((Phi) def).willBeAvail()) { return true; } return false; }
c4a2c963-0ff6-4dfd-b22a-3c2cc3f57177
5
public void writeToSimpleAdjacencyList(ArrayList<Node> network, String file){ try { BufferedWriter out = new BufferedWriter(new FileWriter(file)); Set<String> links = new HashSet<String>(); for(Node N : network) { if(N.id % 1000 == 0) ...
90699cec-d3f5-4449-a31e-90bb8506a5d5
2
@Override public UsuarioBean set(UsuarioBean oUsuarioBean) throws Exception { try { oMysql.conexion(enumTipoConexion); oMysql.initTrans(); if (oUsuarioBean.getId() == 0) { oUsuarioBean.setId(oMysql.insertOne("usuario")); } oMysql.up...
da7e370f-4646-4c0c-93b0-d0c3807f9192
4
private int getNearestPeriodStartToAndBefore(LocalDateTime start) { // compute periods count difference from referenceStart to given start int periods = 0; switch(repeatingPeriod.getClass().getName()) { case "org.joda.time.Months": periods = Months.monthsBetween(refer...
151081c5-04cc-49ae-aa81-dc8d1af5be56
7
public int largestRectangleArea(int[] height) { // Start typing your Java solution below // DO NOT write main() function Stack<Integer> s = new Stack<Integer>(); int i = 0; int max = 0; int counter = 0; while (i <= height.length - 1) { if (s.isEmpty() || height[i] >= s.peek()) { s.push(height[i]);...
c9040bd2-26fb-4cbe-b218-989ebab78824
5
public ANN(Agent owner, Genotype g) throws WeigthNumberNotMatchException { layers = new Vector<Layer>(g.getHiddenLayerCount()); this.owner = owner; // Input layer Layer inp = new Layer(); // Input neurons inp.insertNeuron(new ConstantOneInputNeuron()); inp.insertNeuron(new HungerInputNeuron(this.owner)); ...
9a96d0ed-df3c-4e68-abee-ff8cf204de79
5
public static void main(String[] args) throws ClassNotFoundException, JsonParseException, JsonMappingException, IOException, SQLException { TwitterModel twitterModel = null; HbaseConfModel hbaseConfModel; MediaConfModel mediaConfModel; // TODO 設定ファイルでMariaDBなどに切り替える ...
c1b17c61-ba54-485d-a97e-7772e706e892
0
public void matchesAnnotatedWithType() { assert annotatedWithType( Test.class ).matches( this.getClass() ); assert !annotatedWithType( Parameters.class ).matches( this.getClass() ); }
e3769f72-b7a5-46d9-bdee-9e0ec70130c1
8
private void distinto() throws Exception{ op2 = pila.pop(); if (op2.getValor().equals("null")) throw new Exception("Una de las variables esta sin inicializar!"); op1 = pila.pop(); if (op1.getValor().equals("null")) throw new Exception("Una de las variables esta sin inicializar!"); Elem resultado = new ...
94992c79-a3e3-451c-a027-407289120aea
4
private static boolean checkAuto(String s, String t){ int sindex = 0; for(int i=0;i<t.length();i++, sindex++){ while(sindex<s.length() && s.charAt(sindex)!=t.charAt(i)) sindex++; if(sindex >= s.length()) return false; } return true; }
9e6de5e8-1d88-462a-8953-44d2506bc983
4
public int getDestination(String input) { if (destinations.containsKey(input)) return destinations.get(input); else if (isOtherPunctuation(input)) return otherPunctuationDestination; else if (isSpace(input)) return spaceDestination; else if (isNum(input)) return numDestination; else return defaultDe...
720f3667-8cff-4a41-ac3e-f7380b5e404a
8
public int characterAt(int at) throws JSONException { int c = get(at); if ((c & 0x80) == 0) { return c; } int character; int c1 = get(at + 1); if ((c1 & 0x80) == 0) { character = ((c & 0x7F) << 7) | c1; if (character > 0x7F) { ...
c4fd8478-f6ca-4225-990d-5abaa7a71e06
4
public static IContextBuilder getBuilder(String str) { if (str.equals("text")) return new TextBuilder(); else if (str.equals("image")) return new ImageBuilder(); else if (str.equals("list")) return new ListBuilder(); else if (str.equals("barcode")) return new BarCodeBuilder(); else return new...
05bcfe81-48c1-490e-9b89-151b3da32648
9
@Override public int print(Graphics g, PageFormat pageFormat, int pageIndex) throws PrinterException { if (pageIndex >= tripsOfDay.size()) return NO_SUCH_PAGE; Font oldFont = g.getFont(); Graphics2D g2d = (Graphics2D) g; double scaleX = g2d.getDeviceConfiguration().getDefaultTr...
55d8e49b-0525-4206-986e-b616b2b2f538
1
public OutputStream getOutputStream(){ try { return socket.getOutputStream(); } catch (IOException e){} return null; }
b22a14e6-5619-4f7d-9de1-8faf6b28ae46
3
public Relojito() { initComponents(); //aqui dentro del constructor programaremos. Thread t1=new Thread(new Runnable() { @Override public void run() { while(true){ try { Calendar cal=Calendar.getInstance(); ...
b8346270-9602-4a0d-9899-2f454b912dee
9
public void start() throws IOException { Set<SelectionKey> keys; Iterator<SelectionKey> keyIterator; this.keepGoing = true; while (keepGoing) { int readyChannels = this.selector.select(); if (readyChannels == 0) continue; keys ...
1b6c8c69-b129-400f-91f2-361db428c65a
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.ge...
8c298dff-c226-43a4-aa3f-2f5959c732d1
1
@AfterMethod(alwaysRun = true) public void tearDown() throws Exception { // Killing existing instances if (driver != null) { driver.quit(); } }
6497a444-18ca-4595-b010-60947bb35b93
8
public void disconnect(){ if(MFServer.DEBUG_CONNECTIONS){ System.out.print("==> [CONNECTION] '"+name+"' disconnected, trying to close socket..."); } try { socket.close(); if(MFServer.DEBUG_CONNECTIONS){ System.out.println("[DONE]"); ...
ac85750f-9cff-449a-a196-c23cd7b00d57
3
private void saveTarget(final ExprInfo exprInfo, final VarExpr tmp, final Expr real, final SSAConstructionInfo consInfo) { if (SSAPRE.DEBUG) { System.out.println("SAVE TARGET: " + real + " to " + tmp + "--------------------------------"); } Assert.isTrue(real instanceof MemRefExpr); // Replace //...
dc60eaee-7902-47cc-a862-c6d0015d6fb8
5
public void action() { ACLMessage message = null; switch (state) { case SENDING: message = new ACLMessage(ACLMessage.REQUEST); message.addReceiver(aid); try { message.setContentObject(agentDataContainer); }...
c0b2ccec-9ed4-47ce-a4ba-4f3ad7e0656c
9
public void paint(Graphics g2) { if (applet != null) return; int w = getWidth() / 2; int h = getHeight() / 2; if ((img == null) || (img.getWidth() != w) || (img.getHeight() != h)) { img = createVolatileImage(w, h); } Graphics g = img.getGraphics(); g.drawImage(bgImage, 0, 0, null); ...
ffca02ae-4871-4523-8b8f-4d12828247e3
0
public AboutAction() { super("About...", null); }
6c70d06d-43f1-466a-bc8a-94d8084429d0
8
public static String factions(MOB E, HTTPRequest httpReq, java.util.Map<String,String> parms) { for(final Enumeration e=E.factions();e.hasMoreElements();) { final String strip=(String)e.nextElement(); E.removeFaction(strip); } if(httpReq.isUrlParameter("FACTION1")) { int num=1; String whichFactio...
81bcc89e-44c5-4d0f-9459-1bac70afaeb5
1
public void testGetShortName_berlin() { DateTimeZone berlin = DateTimeZone.forID("Europe/Berlin"); assertEquals("CET", berlin.getShortName(TEST_TIME_WINTER, Locale.ENGLISH)); assertEquals("CEST", berlin.getShortName(TEST_TIME_SUMMER, Locale.ENGLISH)); if (JDK6) { assertEquals("...
ea71e934-ed1c-49af-a058-d3792a8c65a8
7
private void initGameBoard(Piece[][] contents) { _gameboard = new JPanel(); _gameboard.setLayout(new GridLayout(8, 8)); _gameboard.setPreferredSize(BOARDSIZE); _gameboard.setBounds(0, 0, BOARDSIZE.width, BOARDSIZE.height); for (int i = 0; i < 8 * 8; i++) { JPanel squa...
6e5b2005-2b1b-4968-94dc-f457556feabb
1
@Override public void map( LongWritable key, Text text, OutputCollector<Text, IntWritable> textIntWritableOutputCollector, Reporter reporter) throws IOException { try { Row row = (Row) unmarshaller.unmarshal(new StringReader(text.toStri...
c29615b6-2713-440a-be32-00374a81bbe0
0
@Override public Message toMessage(Session session) throws JMSException { BlobMessage message = ((ActiveMQSession) session) .createBlobMessage(image); setMessageProperties(message); message.setJMSType(TYPE); return message; }
a57f16fe-9d21-4ef1-86ed-9aacbb88780d
9
public String nextToken() throws JSONException { char c; char q; StringBuilder sb = new StringBuilder(); do { c = next(); } while (Character.isWhitespace(c)); if (c == '"' || c == '\'') { q = c; for (;;) { c = next(); ...
eb714d3f-1a79-4454-b9a6-e455edbef28d
6
public static void chargerFichierDonnees() { // Lecture des donnees des etudiants try { FileInputStream fstream = new FileInputStream("etudiants.txt"); DataInputStream in = new DataInputStream(fstream); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String ligne; while ((li...
8587a3b2-f783-463c-82d1-c0e957e67ee8
8
public static void updateBankVowelPurchase() { PlayerTurn playerTurn = new PlayerTurn(); playerTurn.updatePlayersTurn(); try { if (getBankPlayerUp() >= 250) { setHasEnough(true); long bank = 0; long updateBank; int contr...
462dd93f-0985-4e56-9b88-0b7db4ea0125
2
private boolean isOver() { int end = tracksize -1; return (posFido >= end || posSpot >= end || posRover >= end); }
2b040ebd-4829-404c-b2d5-0eb0148209a4
5
public boolean inArea(int x, int z, String worldname) { boolean isInArea = false; if(world.equalsIgnoreCase(worldname)) { if(minX <= x && x <= maxX) { if(minZ <= z && z <= maxZ) { isInArea = true; } } } return isInArea; }
237c7b7e-96a9-4875-907a-6c3ce18d866e
1
private String toByteString(byte b) { String s = "" + Integer.toBinaryString(b & 0xFF); while(s.length() < 8) s = "0" + s; return s; }
252a82ea-1ec4-4549-ab33-ac4cad5e1614
9
public String getNickname(){ switch(this){ case LAWFUL_GOOD: return "Crusader"; case NEUTRAL_GOOD: return "Benefactor"; case CHAOTIC_GOOD: return "Rebel"; case LAWFUL_NEUTRAL: return "Judge"; case TRUE_NEUTRAL: return "Undecided"; case CHAOTIC_NEUTRAL: return "Free Spirit"; case LAWFUL_EVIL: return "Dom...
8423791a-1c5c-4dcf-ab77-3600cc393bdb
1
public void visit_invokespecial(final Instruction inst) { final MemberRef method = (MemberRef) inst.operand(); final Type type = method.nameAndType().type(); stackHeight -= type.stackHeight() + 1; if (stackHeight < minStackHeight) { minStackHeight = stackHeight; } stackHeight += type.returnType().stack...
bb8fe014-d50c-4137-a06f-2408c3266261
9
public static final Class<?> getClass(final Type type) { final Class<?> result; if (type instanceof Class<?>) { result = (Class<?>) type; } else if (type instanceof ParameterizedType) { final Type rawType = ((ParameterizedType) type).getRawType(); result = getClass(rawType); } else if (type instanceof...
5be4f8a9-d7aa-4008-b0b9-57526c9eabd9
6
public void cargarArchivoTXT(String ruta) { File archivoAutomata = null; FileReader fr = null; BufferedReader br = null; JFileChooser selector = null; try { if (ruta == null) { // si no se pasa una ruta, hay que selecionar el archivo JOptionPane.show...
bb620ac7-7c4c-4ec8-94af-2d94c911246b
5
@Override public void actionPerformed(ActionEvent arg0) { String s = (String) categories.getSelectedItem(); DetailsPanelController pc = DetailsPanelController.getInstance(); if (s.equals("")) { //If the "no category" category is chosen, create a new dummy category and set //that as the currentTasks() categ...
28e0d194-147d-4c73-9aec-cc43c31cfb12
6
public void createIndexes() { personIndex = new HashMap<String, Person>(); for (Person person : getPeople()) { personIndex.put(person.getId(), person); } familyIndex = new HashMap<String, Family>(); for (Family family : getFamilies()) { familyIndex.put(family.getId(), fam...
23cc1c0f-bf11-4acc-b178-70e86b745cd3
3
private static String readIntegerString() { // read chars from input following syntax of integers skipWhitespace(); if (lookChar() == EOF) return null; if (integerMatcher == null) integerMatcher = integerRegex.matcher(buffer); integerMatcher.region(pos,buffer.length()); ...
8fd9fab9-14cc-4e25-8335-e1ba7927868c
2
public final synchronized long readLong(){ this.inputType = true; String word=""; long ll=0L; if(!this.testFullLineT) this.enterLine(); word = nextWord(); if(!eof)ll = Long.parseLong(word.trim()); return ll...
52ae4c4b-00ad-4dc2-b7fb-276d717b60ce
5
public int getColor(String part) { if(part.equals("head")) { return handsColor; } if(part.equals("hands")) { return handsColor; } if(part.equals("body")) { return bodyColor; } if(part.equals("legs")) ...
5eef7771-aa74-4317-8eb8-64c9e77f7000
3
public String getAlfrescoTicket(String username, String password) { String url = "http://phaedrus.scss.tcd.ie/CS3BC2/group6/tomcat/alfresco" + "/service/api/login?u=" + username + "&pw=" + password; HttpClient client = new HttpClient(); GetMethod method = new GetMethod(url); String respo...
0538043f-56bb-4b82-aa5d-5cf6c93eb7fb
0
@Override public void setIdleTimeout(long idleTimeout) { this.idleTimeout = idleTimeout; }
705d2534-1b4f-4505-88ad-d96142786e0a
7
public void info(){ try{ if( file.exists() ){ System.out.println("Nombre: " + file.getName()); System.out.println("Path: " + file.getPath()); System.out.println("Absoluto: " + file.getAbsolutePath()); System.out.println("PAPA: " + file....
444b1f8f-ce9d-456b-ac38-7dc7497256f8
3
private MaskValue findFlag() { for (MaskValue mask : mMasks) if (mask.isFlag() && !mask.isOpen()) return mask; Log.exception("No Flag Mask Defined!"); Sweeper.forceStop(); return null; }
fff472d7-bfdb-4a09-bc60-32026771846b
7
@Override public void executeMsg(Environmental host, CMMsg msg) { if((invoker()!=null) &&(!unInvoked) &&(affected==invoker()) &&(msg.amISource(invoker())) &&(msg.target() instanceof Armor) &&(msg.targetMinor()==CMMsg.TYP_WEAR)) { if(msg.source().location()!=null) msg.source().location().show(msg....
f8955704-8971-4aaf-8f75-b1980d09b3ce
3
public void generaCentros() { Iterator listaElementos = listaElementos(); Nodo n; while(listaElementos.hasNext()) { Elemento next = (Elemento) ((Map.Entry)listaElementos.next()).getValue(); n = new Nodo(new double[]{0,0,0}); for(int nodo : next.ve...
5a15eb42-2753-4aab-a8f7-7885620f4525
1
public void eval(EvalContext context) { int stmtId = context.newStmtId(); context.logEntering("Evaluating If@"+stmtId + " ctx@" + context.id); predicate.eval(context); boolean value = context.popBoolean(); context.log("If@"+stmtId + " - Predicate: " + value); if(value) { ...
e6a759bc-2b75-470b-a3ed-443f60ef3e1b
5
public static void parseNaturals(String str, int[] numbers){ int len = str.length(); int numberIndex = 0; int maxIndex = numbers.length; int currentNumber = 0; boolean numberStarted = false; for(int i = 0; i < len; i++){ char c = str.charAt(i); if(c >= '0' && c <= '9') { numberStarted = true;...
b1e240fa-caa9-45dc-9cfa-e6a89ffc2221
7
private Object decodeValue(){ JsonLexer.Token token = lexer.next(); switch (token.type){ case NULL : return null; case TRUE : case FALSE : return token.asBoolean(); case STRING : return token.asString(); case NUMBER : return token.asNumber(); case OBJEC...
6cb23d90-edac-49c2-9a4d-dfb87bd10103
1
public DefExpr def() { if (isDef()) { return this; } return super.def(); }
977258ae-3024-4b71-a7dd-4faff12dc16a
6
public void undisguise(Player player) { if(this.players.containsKey(player.getName())) { DisguisedPlayer dp = this.players.remove(player.getName()); if(dp != null && dp.lastBlock != null) { for(Player p : player.getWorld().getPlayers()) ...
39b50a8a-2606-4793-b590-bacb14e0577d
1
public Object next() { if (next == null) { throw new NoSuchElementException(); } AbstractInsnNode result = next; prev = result; next = result.next; return result; }
3b66fb4f-551c-40ce-8e81-5d17b9bedc19
7
public static Stella_Object clTranslateSqlTypeSpecifier(Stella_Object stellatype) { { Stella_Object result = null; if ((stellatype == null) || (stellatype == Sdbc.SYM_STELLA_NULL)) { } else { { GeneralizedSymbol testValue000 = ((GeneralizedSymbol)(stellatype)); if (te...
6384719f-8bdd-4d1d-b6f8-e8bd25819634
9
public String inputs( String type, String [] attr, String name ) { if ( name != null ) { type += " name='"+name+"'"; } boolean hasValue = false; if ( attr != null ) for( int i=0 ; i<attr.length ; i+=2 ) if ( attr[i] != null && attr[i+1] != null ) { if ( "value".equals( attr[i] ) ) hasValue = ...
155b8361-558c-468a-b6b0-e8d835cb4279
0
protected void fireServerStart(ServerStartEvent evt) { sync.clear(); conns.clear(); prevCallId = Long.MIN_VALUE; }
01244436-16df-44ba-b113-84a2fc34ea64
8
public static void main(String[] ops) { int n = Integer.parseInt(ops[0]); if(n<=0) n=10; long seed = Long.parseLong(ops[1]); if(seed <= 0) seed = 45; RandomVariates var = new RandomVariates(seed); double varb[] = new double[n]; try { System.out.println("Generate "+n+" val...
d7618bef-8812-47c7-92f2-51b3c20cf1dd
4
public CardCheckResult check() { CardCheckResult result = CardCheckResult.OK; if(super.check() != CardCheckResult.OK) { result = super.check(); } else { Calendar calendar = Calendar.getInstance(); int today = calendar.get(Calendar.DAY_OF_WEEK); if ...
18479474-ae01-4e27-93f1-47a627f3b396
2
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub //vastaanotetaan palaute String-muodossa String palauteIDStr = request.getParameter("palauteID"); int palauteID; try { //luodaan olio busine...
73bff746-3132-4f67-bace-af415876155d
0
public static void main(String[] args) { //DoubleLetters dl = new DoubleLetters(); //dl.DoDoubling(); UpByN ubn = new UpByN(); ubn.upByThrees(4); }
ff119ce8-80f5-4f3a-862b-c6a9335c0027
8
public int compare(String o1, String o2) { String s1 = (String)o1; String s2 = (String)o2; int thisMarker = 0; int thatMarker = 0; int s1Length = s1.length(); int s2Length = s2.length(); while (thisMarker < s1Length && thatMarker < s2Length) { ...
808e761d-ea33-4025-b278-17eaa85f2aae
7
@Override protected byte[] load_from_current_position(String frameId, int dataLength, RandomAccessFile openFile) throws IOException { byte[] frameData=super.load_from_current_position(frameId, dataLength, openFile); if(frameData==null) return null; if(frameData.leng...
fa20eb10-6e30-44b9-be3c-b7b7e29a967b
2
public static String getStreamID(String streamerName) { for (int i = 0 ; i < streamName.size(); i++) { if (streamName.get(i).equalsIgnoreCase(streamerName)) { return streamList.get(i); } } return null; }
1b754c52-8509-4797-9a6e-86e9226c9744
6
public List<List<Integer>> helper(int[] c, int start, int end, int target) { List<List<Integer>> result = new ArrayList<List<Integer>>(); if (start < end) { if (target > c[start]) { int pick = c[start]; List<List<Integer>> r = helper(c, start + 1, end, target - pick); for (List<Integer> l : r) { ...
09dbb7c0-570e-4e5b-9a13-182a8c551a36
8
@Override public boolean onCommand(CommandSender sender, Command command, String lable, String[] args) { if (master.getConfig().getBoolean("enable-adventure", false)) { sender.sendMessage("This feature is not fully implemented! " + "If you want to try this feature out, set 'enable-adventure' in the conf...
3cb0f710-6265-4f30-8f74-5c7abef05434
9
public updater(Plugin plugin, int id, File file, UpdateType type, boolean announce) { this.plugin = plugin; this.type = type; this.announce = announce; this.file = file; this.id = id; this.updateFolder = plugin.getServer().getUpdateFolder(); final File pluginFile...
51cad220-d2f7-483a-b6e9-f7b725f3017a
9
@Override public boolean mayICraft(final Item I) { if(I==null) return false; if(!super.mayBeCrafted(I)) return false; if(((I.material()&RawMaterial.MATERIAL_MASK)!=RawMaterial.MATERIAL_METAL) &&((I.material()&RawMaterial.MATERIAL_MASK)!=RawMaterial.MATERIAL_MITHRIL)) return false; if(CMLib.flags()....
52ac6a4c-24d4-4310-8d0c-e58db2c008e6
6
public void removeListener(IoFutureListener listener) { if (listener == null) { throw new NullPointerException("listener"); } synchronized (lock) { if (!ready) { if (listener == firstListener) { if (otherListeners != null && !otherList...
d3d98ee3-6008-4861-9345-201cef5326fb
3
@Override public void paint(Graphics g) { super.paint(g); Node travelNode; for (int i = 0; i < GameConstants.HEIGHT; i++) { for (int j = 0; j < GameConstants.WIDTH; j++) { travelNode = ship.nodeMap.get(new Coordinates(i, j)); drawLines(travelNode, g); } } drawControlRoom(Engine.controlNode, g);...
1d7e6702-f96e-4ab8-8074-b9b2cf73e42a
7
private boolean isFourOfKnd(){ int cnt=0,rID=0,sID=0; boolean first=true; for (int i = 0; i < crds.size()-1; i++) { rID=crds.get(i).getRankID(); if(crds.get(i).getRankID()==crds.get(i+1).getRankID()){ System.out.println("matched "+crds.get(i+1).getRankID() ); if(sID!=crds.get(i).getRankID()){ f...
f01ec40a-e35a-479e-8f22-3df2fe7e1685
8
private void loadMesh( String filename ) { String[] splitArray = filename.split( "\\." ); String ext = splitArray[ splitArray.length - 1 ]; if( !ext.equals( "obj" ) ) { System.err.println( "Error: File formate not supported for mesh data: " + ext ); new Exception( ).printStackTrace( ); System.exit( 1 );...