method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
b4740a12-99c6-4593-9d30-09e2e53cccac
3
public void orderList() { int countOfFullList = nicks.getSize(); Object[] opers = new Object[beginningVoiced]; Object[] voiced = new Object[beginningNormal - beginningVoiced]; Object[] normal = new Object[countOfFullList - beginningNormal]; Object[] all = nicks.toArray(); System.arraycopy(...
02408472-fede-4c88-89d3-c383f47e351e
7
public void run() { int period=-1; try{ while (isStarted()) { try { if (period!=_scavengePeriodMs) { if(log.isDebugEnabled())log.debug("Session scavenger period...
ba73dcfa-474e-4818-8826-216232c25dbb
5
private Integer spillAndRemoveLowestCost(HashMap<Integer, Set<Integer>> copyGraph, HashMap<Integer, Integer> costMap) { int min = Integer.MAX_VALUE; int theone = -1; for (Entry<Integer, Set<Integer>> entry : copyGraph.entrySet()) { int cost = 0; if (costMap.containsKey(entry.getKey())) { cost = costM...
76c7e3c2-bb12-4274-a82a-84a8ce206fd1
4
public void escribirArchivo(ArrayList<ArrayList<String>> listaLineasArchivo){ FileWriter fw; try{ fw=new FileWriter(new File(System.getProperty("user.dir")+"\\Salida\\SalidaPrograma.txt"), true); BufferedWriter bw = new BufferedWriter(fw); for(ArrayList<String> client...
5102cf23-ef72-467e-be9c-b1c92a766108
0
public void f() throws SimpleException { System.out.println("Throw SimpleException from f()"); throw new SimpleException(); }
c16c8391-f31b-4658-a78a-e428f8002daf
9
private void managementPlanTablePropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_managementPlanTablePropertyChange // TODO add your handling code here: JTable target = (JTable)evt.getSource(); int row = target.getSelectedRow(); int column = target.getSelectedColumn()...
48e8a21b-cde4-49cf-9f16-43beeb2cc659
7
@Override public void update() { super.update(); if (shouldRender) { //make the cursor flash long p = registry.getImageLoader().getPeriod(); cursorTotalTime = (cursorTotalTime + registry.getImageLoader().getPeriod()) % (lon...
41c486e4-1adc-4043-b038-d890ae3ecfb2
3
@Override public String generarCodigoSentencia() { String etiqueta1 = Info.getIntancia().getEtiqueta("If"); String etiqueta2 = Info.getIntancia().getEtiqueta("EndIf"); String cVerdadero = this.condicion.generarCodigo(); String cFalso = conElse!=null ? this.conElse.gener...
a51645f1-aee6-4096-b128-08154ca7c9ce
5
protected void sendPacket( String fromHostId, String fromInterfaceId, final ByteChunk packet ) { Host h = hosts.get(fromHostId); if( h == null ) return; String linkId = h.interfaceLinkIds.get(fromInterfaceId); if( linkId == null ) return; Link l = links.get(linkId); if( l == null ) return; final ...
789bb352-0618-4df8-846e-99868f1b2bd8
5
private File loadFileChooser(javax.swing.filechooser.FileFilter ff, boolean isSave) { File result; JFileChooser fc = new JFileChooser(); //Create a file chooser fc.setAcceptAllFileFilterUsed(false); fc.setMultiSelectionEnabled(false); if(prevDir!=null) fc.setCurrentDi...
bb629ee9-6d5b-4956-b7ed-3c7647d5a0c0
5
@Override public void ParseIn(Connection Main, Server Environment) { Room Room = Environment.RoomManager.GetRoom(Main.Data.CurrentRoom); if (Room == null) { return; } String Gender = Main.DecodeString(); String SelectedLook = Main.DecodeString(); ...
77444683-3da9-4ba8-aa2c-0c57b82f5ade
8
public void setValue(String value) { if (isBoolean(value)) { this.value = Boolean.parseBoolean(value); this.type = Type.Boolean; return; } if (isDateTime(value)) { try { this.value = DATE_FORMAT.parse(value); this.ty...
c1da41b0-7e27-43f9-921a-3f018d3feec9
6
public ResultSet searchRecord(String studentID, String classID, Date date) throws ClassNotFoundException, SQLException { con = DBConnection.getConnection(); String temp = null; if (studentID != null && classID != null && date != null) { temp = "studentID='" + studentID + "' and class...
571bcee6-1ca8-493f-9d87-cccb50be7ff1
0
public boolean isVerbose() { return this.verbose; }
32373450-e4ca-40ac-bba9-aaaf79807715
3
@Override public void run() { File f; ImageIndex [] ind = ImageIndex.values(); for (ImageIndex i : ind) { setLoadStatus((i.ordinal() + 1.0) / ind.length); f = new File(path + i.toString() + extension); Image temp2 = new Image(f.toURI()....
1a91d4b9-4f69-4957-bf0d-e27e8bf8a359
0
public Body getBody() { return body; }
9b0b7c2b-e4e7-4374-96db-b0bfa59c5e16
5
public ArrayList<Auction> searchUser(String username) { try { ArrayList<Auction> auctions = new ArrayList<Auction>(); String[] keywords = username.split(" "); String sql = "select * from " + tableName + " WHERE "; for (int i = 0; i < keywords.length; i++) { if (i != 0) sql = sql + "OR "; sql ...
00c700cd-e9fd-4d51-a385-48e7d31a19d4
1
public TitleMenu() { // Ensure fading has reset Camera.get().addScreenEffect(new TintEffect(new Vector4f(0f, 0f, 0f, 0f), 0f, true, Tween.IN)); // Load title logo Icon logo = new Icon("Avogine Title"); logo.setPosition(() -> Camera.get().getDisplayWidth(0.5f), () -> Camera.get().getDisplayHeight(0.2667f));...
82ed5bc6-bac9-4fd8-97ea-474a33b98fae
8
public static void modify(Document doc){ int choice = InputHandler.getInt("Enter a question number to edit, or 0 to view the test.", 0, doc.getQuestionCount()); if (choice==0) { doc.display(); modify(doc); return; } Question question = doc.getQuestion(choice-1); System.out.println(question.getPrompt(...
bb23ba3a-689e-436d-a98b-93a9c1c76637
9
private void bumpPosition() { // Bump the current X position ++xCur; // If we are at the end of a scan line, set xCur back to the beginning // If we are interlaced, bump the yCur to the appropriate spot, // otherwise, just increment it. if (xCur == imgW) ...
f24cc7db-e183-4cd0-bcd4-c49cdf45506c
3
public SingleObject create() { Random rand=new Random(); double num=rand.nextDouble(); int pos=rand.nextInt(stage.getWidth()); if(cnt%2==0 && grade=='f'){ stage.getSound("audio/missile_fly.wav").play(); } if(grade=='f'){ cnt++; } return new SingleObject(...
99a1a8f1-9627-4467-8ca7-3ca0cbccc174
6
@Override public List<JDK> loadDefaultJDKOnSystem() throws LoadDefaultJDKException, DefautJDKInstalledNotFoundException { List<JDK> jdks = null; try { logger.info("Initing searching default jdk on system"); File file = new File("load.bat"); file.createNewFile(); logger.info("'load.bat' wa...
2e9c6183-b0ea-45c1-9cce-75be80f84c20
4
public void moveArtifact(Hero dst, Artifact art) { if (artifacts.remove(art)) { if (active.containsValue(art)) { for (ArtifactType at: active.keySet()) { if (active.get(at) == art) { active.put(at, Artifact.DUMMY); } } } dst.artifacts.add(art); } }
6153d1a5-060d-4a39-9bdc-d7efabe60e20
5
private void convertSnake() { String thisLine; // variable to read a line BufferedReader myInput = null; try { // Objects to read the file FileInputStream fin = new FileInputStream(new File(input)); myInput = new BufferedReader(new InputStreamReader(fin)); int count =0; // to count the number o...
e52eb76f-60ba-4cf6-949d-e9ede7248030
6
@Override public void valueRecived(SlotInterface s, Value v) { if (s.getLabel().equals(Input)) { try { boolean b = v.getBoolean(); value_ = b; if (trigger_ == null) { if (b) { ifTrigger_.trigger(new Value(Void.TYPE)); } else { elseTrigger_.trigger(new Value(Void.TYPE)); } ...
46727216-7dad-4d77-9ecb-e2e1595b9a1b
6
public static int[] findSortedSubsequence(int[] input){ //smaller will hold elements smaller and on the left of a given array index i int[] smaller = new int[input.length]; //bigger will hold elements greater and on the right of a given array index i int[] bigger = new int[input.length];...
eb4944a0-1029-4bf2-8662-ff4495be0175
1
@Override public void onExit(EventMouse eventMouse) { if (!active){ // square.setTextureCoor(inputTexture.getNormal()); } }
1f1565c0-e31b-476a-9ca0-df779a17d63b
1
private static int totalChoc(int n, int c, int m) { int total = n/c; int currWrappers = total; int overallTotal = total; while (currWrappers >= m) { overallTotal += (currWrappers/m); currWrappers = (currWrappers/m) + (currWrappers%m); } return overallTotal; }
28f655ce-3410-42ef-b5c8-5820e15f7c47
7
public UnitActionDetector(TilePanel selectedPanel, Unit selectedUnit, TilePanel tilePanel, List<Unit> units){ if(selectedPanel == null && selectedUnit == null && units != null && !units.isEmpty()) { selectingUnit = true; } if(selectedPanel == tilePanel) { deselectingUnit = true; ...
43fe5bdc-d5e1-4412-8403-910640e2521f
1
@Override public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) { }
79ec0f3a-f545-4b7b-bf5d-9e472c03b612
5
public boolean jsFunction_waitWindow(String name, int timeout) { deprecated(); int curr = 0; if(timeout == 0) timeout = 10000; while(curr < timeout) { if(JSBotUtils.lastCreatedWindow != null && JSBotUtils.lastCreatedWindow.cap.text != null && JSBotUtils.lastCreatedWindow.cap.text.equals(name...
25d997f9-7279-4583-8eec-655311c146a4
9
public static void newDensity() { double[][] density = calculateDensity(); int numGridLines = getNumGridlines(); // Find the maximum normalized density float maxDens = (float) 0.0; for (int x1Ind = 0; x1Ind < numGridLines; x1Ind++) { for (int x2Ind = 0; x2Ind < numGridLines; x2Ind++) { if (de...
171b241a-d872-4018-b22f-f3c833002326
1
public InnerClassInfo[] getOuterClasses() { if ((status & OUTERCLASSES) == 0) loadInfo(OUTERCLASSES); return outerClasses; }
97d89d6d-ed00-44db-8f3d-c7c17c4c3e53
8
private boolean r_perfective_gerund() { int among_var; int v_1; // (, line 71 // [, line 72 ket = cursor; // substring, line 72 among_var = find_among_b(a_0, 9); if (among_var ...
b00c6d06-1b84-4c79-8e2e-91f52749961e
6
public void refresh() { int x = 0; // ile pixeli zostalo do zapelnienia planszy ziarnami // ===== iteracja ========= switch (Core.Config.metoda) { case 0: x = this.iteracja_naiwny(); break; case 1: // this.iteracja_rekrystqalizacja(); // nie zaimplementowane :p break; } if (x==0 && Core.C...
94c6780d-be9d-4c07-9c1a-3c0b1456c532
8
private static int determineOrientation(World par0World, int par1, int par2, int par3, EntityPlayer par4EntityPlayer) { if (MathHelper.abs((float)par4EntityPlayer.posX - (float)par1) < 2.0F && MathHelper.abs((float)par4EntityPlayer.posZ - (float)par3) < 2.0F) { double var5 = par4EntityPl...
47a72f57-c790-4004-bd8a-d09de5d60a5f
5
private int contaDias() { int totalDias = 0; for (int i=1; i<ano; i++) { totalDias += anoBissexto(i)?366:365; } for (int i=1; i<mes; i++) { totalDias += diasPorMes[i]; } totalDias += (anoBissexto(ano) && mes>2) ? 1 : 0; totalDias +...
9e456917-8e54-4adb-95f4-329c5f2e2702
7
@Override public int castingQuality(MOB mob, Physical target) { if((mob!=null)&&(target!=null)) { if((CMLib.flags().isSitting(mob)||CMLib.flags().isSleeping(mob))) return Ability.QUALITY_INDIFFERENT; if(!CMLib.flags().isAliveAwakeMobileUnbound(mob,true)) return Ability.QUALITY_INDIFFERENT; if(mob...
50ec9b1a-8335-4533-94bc-b78085102090
9
private boolean checkIfPathIsSubPathAndScheduleARide(Cab cab, RideRequest rideRequest, DialARideModel model, Interval interval, IntervalTree<Interval> cabsSet, double timeInstant, Node node, Queue<Event> eventQueue) { List<Integer> myPath = new ArrayList<Integer>(); List<IntermediateNode> that...
5e1bd377-9b05-4c1f-803a-e823090bb5e3
6
public static void main(String[] args) { /** * Replace: directory.getAbsolutePath() + "/FIZZ.WAV" * and directory.getAbsolutePath() + "/BANG.WAV" * with the location of your files, or the working * directory. */ Fizz = new File(directory...
193405c1-fbe9-4fae-bf38-f9ec2b7f3750
9
private Data toData(JsonParser jp) throws IOException { JsonToken ntoken = jp.getCurrentToken(); if (ntoken == JsonToken.START_ARRAY) { Data d = Data.list(); while (JsonToken.END_ARRAY != jp.nextToken()) { d.add(toData(jp)); } return d; } else if (ntoken...
39ff4575-d304-4722-bdb2-fec78282c274
1
public String getRandomString() { StringBuffer buffer = new StringBuffer(); Random random = new Random(); String chars[] = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z".split(","); for (int i=0 ; i<chars.length ; i++) { buffer.append(chars[random.nextInt(chars.length)]); ...
f69ca330-d892-4a87-a22f-7a7105aaf3a3
2
static String[] loadAndSort(Reader in) throws IOException { BufferedReader reader = new BufferedReader(in); ArrayList<String> lines = new ArrayList<>(); String line; while ((line = reader.readLine()) != null) { if (line.isEmpty()) { line = "<empty"; ...
3f52a904-7d85-4fa9-bca8-c4d439f9a393
3
public void setExp(PExp node) { if(this._exp_ != null) { this._exp_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } ...
b31d2776-573a-480b-a1af-2f1ec55ba94b
7
protected TrieEntry<K,V> ceilingEntry(K key) { // Basically: // Follow the steps of adding an entry, but instead... // // - If we ever encounter a situation where we found an equal // key, we return it immediately. // // - If we hit an empty root, return the fir...
b7c3be5e-7c87-4955-8f9a-fe22bf0a8955
3
private JSONWriter end(char mode, char c) throws JSONException { if (this.mode != mode) { throw new JSONException(mode == 'a' ? "Misplaced endArray." : "Misplaced endObject."); } this.pop(mode); try { this.writer.write(c); } catch (IOExcepti...
806104a1-41dd-4a5b-8402-bd0ccf6f5ce8
4
@Override public boolean update(Chambre x) { Statement stm = null; try { String req = "UPDATE chambre +SET datedebut = \""+x.getDateDebut()+"\""+ ",datefin = \""+x.getDateFin()+"\""+ ",titre = \""+x.getTitre()+"\""+ ...
628dacce-4e48-4738-9657-a8c8526f5c18
7
private static Object getListFromJsonArray(JSONArray jsonArr) { List<Object> list = new ArrayList<Object>(); for (int i = 0; i < jsonArr.size(); i++) { JSONValue jsonVal = jsonArr.get(i); if (jsonVal instanceof JSONNull) { list.add(null); } else if (jsonVal instanceof JSONB...
85e606e8-7eed-410c-b708-261831282156
3
public static int ntz2(long x) { int n = 0; int y = (int) x; if( y == 0 ) { n += 32; y = (int) (x >>> 32); } // the only 64 bit shift necessary if( (y & 0x0000FFFF) == 0 ) { n += 16; y >>>= 16; } if( (y & 0x000000FF) == 0 ) { n += 8; y >>>= 8; } return (ntzTable[y & 0xff]) + n; }
0c659f24-4c27-4414-9b7a-0638c8feea12
4
private static double slowSin(final double x, final double result[]) { final double xs[] = new double[2]; final double ys[] = new double[2]; final double facts[] = new double[2]; final double as[] = new double[2]; split(x, xs); ys[0] = ys[1] = 0.0; for (int i = 1...
a9fa937c-662d-46b4-9e6b-808f80b486a8
4
public static Path writeMatrix(double[][] matrix, Path path, HamaConfiguration conf) { SequenceFile.Writer writer = null; try { FileSystem fs = FileSystem.get(conf); writer = new SequenceFile.Writer(fs, conf, path, IntWritable.class, VectorWritable.class); for (int i = 0; i < matrix.length; i++) { ...
08cbe06f-215c-44e1-a747-32cd1ff2c062
0
public void testTransaction(){ Session hbSession = getSession(); Transaction ts = hbSession.beginTransaction(); PhpposItemsEntity items3 = (PhpposItemsEntity) hbSession.get(PhpposItemsEntity.class, 3); System.out.println("items3.getName() = " + items3.getName()); items3.setName( (new java.util.Date()).toStr...
0c1d9f07-ac7e-4469-aade-ee443753706b
8
@Override public void actionPerformed(ActionEvent e) { try { conn = DriverManager.getConnection(Utils.DB_URL); PreparedStatement checkStatMotherlang = conn.prepareStatement("select motherlang_word from word where motherlang_word = ?"); PreparedStatement checkStatForeignLa...
04755002-209f-48ea-97a5-0bcdc0a8b373
7
public static void main(String args[]){ Scanner clavier = new Scanner(System.in); char tableauCaractere[]={'a','b','c','d','e','f','g','h'}; char carac; char reponse; int i; do{ do{ i=0; System.out.println("Rentrez une lettre en minuscule, SVP "); carac = clavier.nextLine().charAt(0); ...
818aa6fb-e3cb-40c9-b686-dc93d1ef7870
3
public static ScoreFunction getScoreFunction(Mode mode) { if (mode == Mode.KLSUM) { return new KLSumPlusScoreFunction(); } else if (mode == Mode.SUMBASIC) { return new SumBasicScoreFunction(); } else if (mode == Mode.RANDOM) { return new RandomScoreFunction(); } return null; }
ff02affc-e3c6-4d4f-b1a9-b3114e331322
7
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final TerrainObject other = (TerrainObject) obj; if (Double.doubleToLongBits(this.explored) != Double.doubleToL...
55f8f5c1-1202-4689-b99a-fb4f49971d5f
9
static byte LaddersFix(byte data, String kierunek) { if (kierunek.equals("right")) { if (data == 4) { return 2; } if (data == 2) { return 5; } if (data == 5) { return 3; } if (data == 3) { return 4; } } else { if...
1d756b93-a264-48e3-8543-083fb988cca3
6
public void question(Avatar name) { if (name.searchUnfinishedCourses(this.course.toString())) { Random n = new Random(); int randNum = n.nextInt(4); if (randNum > 0) { if (this.course.question(name)) { System.out.println("High five! I'll re...
79c7bfef-aeec-4914-8041-23e04f9e257a
2
public void doTransformations() { for (Iterator i = getChilds(); i.hasNext();) { Identifier ident = (Identifier) i.next(); if (ident instanceof ClassIdentifier) { ((ClassIdentifier) ident).doTransformations(); } else ((PackageIdentifier) ident).doTransformations(); } }
b3f3f3fa-b1c8-4537-bddf-3737547b44ad
6
public Writer writeString(Object o) throws IOException { if (o == null) { writeNull(); return this; } CharSequence s = (CharSequence) o; int stringPos = 0; int bufPos = 0; int maxBufNeeded = Math.min(s.length() * 3, 65536); if ((stringBuffe...
1247276a-5955-4ac6-b907-56cfaf81e221
7
private boolean registered() { JLabel regNameLabel = new JLabel("Login name (4-10 chars):", JLabel.RIGHT); JTextField regNameField = new JTextField(20); JLabel regPasswordLabel = new JLabel("Password (2-10 chars):", JLabel.RIGHT); JPasswordField regPasswordField = new JPasswordField(20); JLab...
92234a61-6949-4f80-84d2-e00890bdb1cb
7
public boolean equalsPathNoMatter (MetaDataObject otherMeta) { if (otherMeta == null) return false; if ( (fragmentIdentifier == null && otherMeta.fragmentIdentifier == null) || (fragmentIdentifier != null && otherMeta.fragmentIdentifier != null && fragmentIdentifier.equals (otherMeta.fragmentIdentifie...
8402524b-6381-47d5-8a67-db20892efb10
2
public static UserRole roleForID( int inID ) { for( UserRole r : values() ) { if( r.getID() == inID ) { return r; } } return null; }
cf20cc29-d0be-42dd-a823-8130ae32ca7b
1
public void calculateActivity(){ int counter=0; for(int i=0; i<cycleLength; i++){ counter += update(0); } activity = (double)counter/cycleLength; }
3788d604-d5c3-42b7-852a-9aa243c1d426
6
public OnDemandData getNextNode() { OnDemandData onDemandData; synchronized (aClass19_1358) { onDemandData = (OnDemandData) aClass19_1358.popHead(); } if (onDemandData == null) return null; synchronized (nodeSubList) { onDemandData.unlist(); } if (onDemandData.buffer == null) return onDemandDa...
72afb88a-6eb9-4e08-b21e-80c9cdb17dd2
9
@Override public int compareTo(Version o) { if (o == null) { throw new NullPointerException(); } if (major != o.major) { return major < o.major ? -1 : 1; } if (minor != o.minor) { return minor <...
11201f05-e0ca-42fd-8d2d-d9a1580b0317
0
public HelloWorldAWTGL() throws Exception { frame=new JFrame("Hello world"); frame.setSize(800, 600); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); world = new World(); world.setAmbientLight(0, 255, 0); TextureManager.getInstance().addTexture("box", new Texture("box....
2d5a703d-9a2d-4494-8813-c7a8019362b8
9
private void traverseTree(OperationBase tree, Object parent, Object lastNode, int y) { if(tree != null) { if(tree instanceof UnaryOperationBase) { UnaryOperationBase unary = (UnaryOperationBase) tree; Object v2 = gra...
c23a8e96-ea4f-4575-980c-b45a1b1c1f0d
0
public CheckResultMessage checkDayofMonth3() { return checkReport1.checkDayofMonth3(); }
7b0dfb27-17d8-4fb2-9718-91e1a01f48c7
9
final void aa(short i, short i_570_) { anInt5403++; d var_d = ((AbstractToolkit) aHa_Sub3_5419).aD4579; for (int i_571_ = 0; anInt5478 > i_571_; i_571_++) { if ((aShortArray5423[i_571_] ^ 0xffffffff) == (i ^ 0xffffffff)) aShortArray5423[i_571_] = i_570_; } byte i_572_ = 0; byte i_573_ = 0; if ((i ^ 0xffff...
d019ca8d-01ce-41d8-b820-fd9a504c61e3
2
public String format(Class<? extends Formatter> key, String message) { Validate.notNull(key, "Format class cannot be null!"); Validate.notNull(message, "Message cannot be null!"); Validate.notEmpty(message, "Message cannot be empty!"); if (!formats.containsKey(key)) return me...
6f7e275e-1cb3-4f8e-a795-a7def3a7f0b6
0
@Override public ArrayList<Excel> getColoredExes() { // TODO Auto-generated method stub return coloredEx; }
3806977c-8760-4e46-b941-04deb98da56b
7
private static byte judgeType(String surfaceForm) { String first = surfaceForm.substring(0, 1); if (isVowel(first)) return VOWEL; if (isLong(first)) return LONG; if (isNasal(first)) return NASAL; if (KanaConverter.isKanji(first)) return KANJI; if (KanaConverter.isKana(first)) return KANA; i...
249a936d-69b6-446b-a9b9-65cb0dad9d25
8
public void init() { choose = new JFileChooser(); FileNameExtensionFilter filter = new FileNameExtensionFilter("image files", "png"); choose.addChoosableFileFilter(filter); JPanel panel = new JPanel(); GroupLayout groupLayout = new GroupLayout(this); groupLayout.setHorizontalGroup( groupLayout.createPara...
e98e3493-579a-4821-9207-c7b140d95c02
5
public synchronized InputStream getInputStream(final short fid) { try { InputStream in = null; byte[] file = filesBytes.get(fid); if (file != null) { /* Already completely read this file. */ in = new ByteArrayInputStream(file); in.mark(file.length + 1); } else { /* Maybe partially read? Us...
5cf127f3-766a-464d-858c-cb097afff2b6
4
public void write() { int size = 0; if (streamOperator != null) { streamOperator.input = input; if (streamOperator.isStaticSize()) size += streamOperator.getWriteSize(); else size += streamOperator.calculateWriteSize(); } if (headerOperator.isStaticSize()) size += headerOperator.getWri...
787f3ce9-abf8-43ad-aeb9-fef4e2e9d185
5
private static boolean isDuplicated(MethodInfo newMethod, String newName, String newDesc, MethodInfo minfo, ListIterator it) { if (!minfo.getName().equals(newName)) return false; String desc = minfo.getDescr...
b3dbf431-6874-40ea-82ae-dbe52e14e952
6
public static Cons yieldTerminateObjectTrees(Stella_Class renamed_Class) { { Cons trees = Stella.NIL; Symbol terminator = renamed_Class.terminator(); { Slot slot = null; Iterator iter000 = renamed_Class.classSlots(); while (iter000.nextP()) { slot = ((Slot)(iter000.value)); ...
6c4e59e2-ec65-4219-a97d-bda375e1e2b6
4
public RaidbossInfo(int id, String name, String descr) { super(id, name, descr); for (int npcId : _NPCs) { addStartNpc(npcId); addTalkId(npcId); } // Add all Raid Bosses to RAIDS list for (L2NpcTemplate raid : NpcTable.getInstance().getAllNpcOfClassType("L2RaidBoss")) { for (L2Spawn spawn ...
bcd091db-7d35-4364-8341-b630161d789c
7
protected void UnZip() throws PrivilegedActionException { String szZipFilePath; String szExtractPath; String path = (String)AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() { public Object run() throws Exception { return Util.getWorkingDirectory() + File.separator; ...
92c9a7b3-608d-4356-994e-6e2f48374a65
8
@Override public int castingQuality(MOB mob, Physical target) { if((mob!=null)&&(target!=null)) { if(mob.isInCombat()&&(mob.rangeToTarget()>0)) return Ability.QUALITY_INDIFFERENT; if(mob.charStats().getStat(CharStats.STAT_STRENGTH)<CMProps.getIntVar(CMProps.Int.BASEMAXSTAT)) return Ability.QUALITY_I...
192eea2d-b25c-4fce-8ff7-9dd4e15ea274
4
public static void runwp(String dirname) { File current_dir=new File(dirname); String file_list[]=current_dir.list(); if(file_list == null) { System.out.println("directory not existed"); return; } for(int i=0;i<file_list.length;i++){ String filename=dirname+File.separator+file_list[i]; ...
f9423924-9931-44e8-8186-792eb6ac4a80
4
public void accessAll() { if(binaryTree) { binarytree.accessAll(); } else if(naryTree) { narytree.accessAll(); } else if(hashList) { hashlist.accessAll(); } else if(hashTable) { hashtable.accessAll(); } }
f7c2a91c-5d0f-4104-abf2-844353cb02b9
1
public int version() { if (version < 0) { // Version is bits masked by 0x000000000000F000 in MS long version = (int)((mostSigBits >> 12) & 0x0f); } return version; }
37477ac0-da1c-4a16-842f-4ddce3b1e623
0
@Test public void testGetSenseDirVal() { System.out.println("getSenseDirVal"); Sense instance = new Sense(Sense.senseDir.HERE, 3, 6, Sense.condition.FOE); Sense.senseDir expResult = Sense.senseDir.HERE; Sense.senseDir result = instance.getSenseDirVal(); assertEquals(expResult...
cbf3c50e-577d-4c07-bead-ae5c1fd50277
7
@Override public void mouseClicked(MouseEvent e) { GridCase sgc = (GridCase) e.getSource(); String selectedButton = frame.getPanPara().getCaseGroup().getSelection().getActionCommand(); switch(selectedButton){ case "Vide" : sgc.setBackground(new Color(-1))...
fbc8aa71-335b-45b6-b6a8-733fa477e94b
5
public List<String> getIntersectionList(List<String> list1, List<String> list2) { List<String> commonList = new ArrayList<>(); /* * List<String> commonList = new ArrayList<>(list1); * commonList.retainAll(list2); return commonList; */ if (list1.size() > list2.size()) { for (String obj : list2) { i...
a93ad4a9-56cc-4fe4-a301-65aafd78950a
0
@Override public void hello(String name) { log.debug("befor method invoke...."); hello.hello(name); log.debug("after method invoke..."); }
20c6321a-e737-40f8-a57a-dadf9b88c693
1
private boolean jj_2_7(int xla) { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_7(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(6, xla); } }
db6b354e-3dfc-49a2-9670-d7e97d30c5dc
3
@WebMethod(operationName = "ReadCategory") public ArrayList<Category> ReadCategory(@WebParam(name = "cat_id") String cat_id) { Category cat = new Category(); ArrayList<Category> cats = new ArrayList<Category>(); ArrayList<QueryCriteria> qc = new ArrayList<QueryCriteria>(); ...
9e182a46-7eef-48ea-99bc-c556d225da4c
8
public void onMsgRecive(MsgHead m){ if(m.getType()==IMsgConstance.command_teamList){//б MsgTeamList ms=(MsgTeamList)m; List<TeamInfo> teams=ms.getTeamLists(); for(TeamInfo team:teams){ List<UserInfo> users=team.getBudyList(); for(UserInfo user:users){ DefaultMutableTreeNode newNode...
ac5ad3bc-e4cb-4063-87bb-d233a47bbe7c
7
public static int getMethodCountForName(Class<?> clazz, String methodName) { Assert.notNull(clazz, "Class must not be null"); Assert.notNull(methodName, "Method name must not be null"); int count = 0; Method[] declaredMethods = clazz.getDeclaredMethods(); for (Method method : declaredMethods) { if (methodN...
8746bd10-3cf9-4e3d-a309-22be3ce05933
5
static final void method901(RasterToolkit[] class105s, int i) { try { anInt1599++; Class239_Sub1.anInt5850 = class105s.length; Class175.anIntArray2330 = new int[Class239_Sub1.anInt5850 + 10]; Class341.aClass105Array4234 = new RasterToolkit[Class239_Sub1.anInt5850 + 10]; ArrayUtils.arrayCopy(cl...
501d288f-09c9-4cb7-acfd-513100dc31dd
9
static private int jjMoveStringLiteralDfa5_1(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_1(3, old0); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_1(4, active0); return 5; } switch(curChar) { cas...
0413079b-cdf0-400a-949d-eb805d1cf2e9
8
public void dealDamage(int damage) { if (constitution - damage < 0) damage = constitution; constitution -= damage; int difference = constitution - damage; if (difference <= maxConstitution/10 && difference > 0) appendRedemption(); //Test if (playerEquipment[playerShield] == 13742) { //Elysian if (...
bac0c148-5505-4e3b-b488-cf8a9a3fba1c
0
public boolean isFiring(){ return this.firing; }
7859aba4-add9-4a37-9a06-990d9a81007f
8
@Override public int castingQuality(MOB mob, Physical target) { if(mob!=null) { if(!(target instanceof MOB)) return Ability.QUALITY_INDIFFERENT; if(((MOB)target).amDead()||(!CMLib.flags().canBeSeenBy(target,mob))) return Ability.QUALITY_INDIFFERENT; if((mob.isInCombat())&&(CMLib.flags().isAliveAw...
f8a74b66-d006-4029-8e42-1af7b19e4c3f
6
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed // TODO add your handling code here: //Botón desencriptar if (res != null){ Fechas fec = res; try { StringTokenizer token = new StringTokenizer(...
60f1136b-3aa7-49cb-a695-bf8b9289ad10
4
private String GET_Request(String url) { StringBuffer response; String json_data = ""; try { HttpURLConnection con = set_headers(url); System.out.println(con.getResponseCode()); if (con.getResponseCode() == 200) { BufferedReader in = new BufferedReader(new InputStreamReader( con.getInputStream...
d3dda970-870d-4276-9032-a7097f79687e
2
public static String makeNote(String marker, String note) { StringBuilder buffer = new StringBuilder(note.length() * 2); String indent = makeFiller(marker.length() + 1, ' '); StringTokenizer tokenizer = new StringTokenizer(note, NEWLINE); if (tokenizer.hasMoreTokens()) { buffer.append(marker); buffer.app...