method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
e1180769-261e-4b7c-add9-19e83bdcbec5
1
public static void analize( Map<String, Object> request) { if (request.containsKey("action")) { requested_action = (String)request.get("action"); findAction(requested_action ); } }
7f797f86-a197-4bf8-857b-90c1e8797abc
5
@Override protected synchronized URLConnection openConnection(URL url) throws IOException { URLConnection conn = proxy == null ? url.openConnection() : url.openConnection(proxy); if (debug != null && proxy != null) debug.println("AnonymousCallExecutor: Connection was opened with Proxy '" + proxy.toString() + "'...
8ca1c110-d8f8-4786-9f09-c815998adde7
2
public void render() { BufferStrategy bs = getBufferStrategy(); if (bs == null) { createBufferStrategy(3); return; } screen.clear(); screen.render(); level.render(screen.xOffset, screen.yOffset, screen); for (int i = 0; i < pixels.length; i++) { pixels[i] = screen.pixels[i]; } Graphics ...
265e687c-3239-4033-9898-4a8b23d7b34c
6
private void btnIniciarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnIniciarActionPerformed String usuario = txtUsuario.getText(); char[] pass = txtPassword.getPassword(); String password = password(pass); try { /* -1: No esta registrado ...
e435fefa-26c9-4a1a-aaca-6f8eba383f23
4
public void setName(){ if(getNorth()!=null) name = -1+""; else if(getEast()!=null) name = -2+""; else if(getSouth()!=null) name = -3+""; else if(getWest()!=null) name = -4+""; }
02040b6f-555e-47a6-aac0-2f145681403e
4
public static List<?> copyList(List<?> l) { String ser = Functions.serialize(l); List<?> list = (List<?>) Functions.unserialize(ser); return list; }
2f972602-86d3-4734-bb33-d3caf5637d32
2
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if ( request instanceof HttpServletRequest ) { HttpServletRequest req = ((HttpServletRequest)request); try { // get what we want from the request Principal p = req.getUserPrin...
0347e16d-5819-47fa-8233-1de6f12be547
9
public static Map<String, Float> parseFieldBoosts(String boostsStr) { if (boostsStr == null || boostsStr.length() < 3) return null; // the field boosts are in the format of "field1:boost1,field2:boost2,field3:boost3..." ArrayList<String> fieldList = StringUtil.stringToStringList(boostsStr, StringUtil.g...
f6c08fcc-11d5-48ce-8885-8edc895f7813
8
public static boolean isValidDnaChar( char c ) { if ( c == 'A' || c == 'C' || c == 'G' || c == 'T' || c == 'a' || c == 'c' || c == 'g' || c == 't' ) return true; return false; }
632df5f2-42c6-452f-ae59-356c60961d5d
0
@SuppressWarnings("uncheked") public static void main(String[] args) throws Exception { ObjectInputStream in = new ObjectInputStream(new FileInputStream("CADState.out")); Circle.deserializeStaticState(in); Square.deserializeStaticState(in); Line.deserializeStaticState(in); L...
aff032dc-dc22-4f9f-933c-7572aae7c66e
0
public void setSrcname( String name ) { srcname = name; }
2fd68761-0b6c-4f13-9b10-7a92b0fab09b
7
private Product createProduct(String barcode, String description, String sizeVal, Unit sizeUnit, String supply, String shelfLife) { String _description = description; BarCode _barCode = new BarCode(barcode); float _sizeVal; int _supply; int _shelfLife; try { _sizeVal = Float.parseFloat(sizeVal); ...
adc83783-04c3-4a57-8a86-8f07194e15ed
5
public static void refreshMarketNym(String serverID) { System.out.println("In refreshMarketNym, serverID:" + serverID); String currentServerID = "ALL"; if (serverMap != null && serverMap.size() > 0 && jComboBox5.getSelectedIndex() > -1) { currentServerID = ((String[]) serverMap.get(...
0a624be9-cea6-44bb-98fc-654014af0fa7
7
private void setGoal() { HashMap<Planet, Integer> hmap = new HashMap<Planet, Integer>(); for(Planet p : G.getPlayerPlanets(this)){ for(Planet next : G.getNeighborPlanets(p)){ if(next.getOwner() == this) continue; if(!hmap.containsKey(next)){ hmap.put(p, 1); }else{ int e = hmap.get(p); ...
27e694c9-cbd1-4457-a1ba-dcb2c7964b40
2
public void Print_map() { for(int it = 0; it < amountTanks; it++) { System.out.println(tanks[it].getName()); } for(int ix = 0; ix < amountStage; ix++) { System.out.println(stage[ix].getLenghtStage()); System.out.println(FL[ix].GetMisses()); } }
f8cc1dbd-5e60-4ddf-99cf-834e518aea2a
9
public boolean skipPast(String to) throws JSONException { boolean b; char c; int i; int j; int offset = 0; int length = to.length(); char[] circle = new char[length]; /* * First fill the circle buffer with as many characters as are in the ...
00dd0f66-20d5-4bf3-83ca-5dfb112399bb
2
@Override public void paintComponent(Graphics g) { g.setColor(new Color(0, 0, 0, 100)); g.fillRect(0, 0, this.getWidth(), this.getHeight()/2); g.setFont(HUDFonts.getScoreFont()); g.setColor(Color.WHITE); String text = Translator.getMenuString("score") + ": " + model.getScore(); g.drawString(text, this.g...
c1de09d8-dc1d-4a59-bb57-1b22db5a176c
3
public void masaAcMaSorgusu(JSONObject json) throws Exception, Throwable{ int sure = Integer.parseInt(json.get(MASA_AC_SURE).toString()); String masaAdi = json.get(MASA_ID).toString(); String musteriAdi = json.get(GIRIS_KULLANICI_ADI).toString(); String sifre = json.getString(GI...
3ad84259-447d-44bc-97ae-fa758c9a6a6d
7
@Override public Sequence call(XPathContext context, Sequence[] arguments) { Sequence seq = null; String xml = ""; // Read in the argument into a string String locationStr = null; try { locationStr = arguments[0].iterate().next().getStringValue(); } catch (XPathException e) { locationS...
5f4d6c45-2022-43fd-9e2e-aa108de2dcfc
7
final void initValue(int id, String name, Object value, int attributes) { if (!(1 <= id && id <= maxId)) throw new IllegalArgumentException(); if (name == null) throw new IllegalArgumentException(); if (value == NOT_FOUND) throw...
2a3b9954-c22f-4115-9c07-2ae2f1ba7bbc
3
public double getHaltonNumber(int index, int base) { // Check base if(base < 2) base = 2; if(index < 0) index = 0; // Index shift: counting of the function starts at 0, algorithm below starts at 1. index++; // Calculate Halton number x d...
01e115b0-05f8-4078-a5d2-a89ad8a3fb37
0
public Tomahawk() { _motor = new Victor(RobotMap.PORT_MOTOR_TOMAHAWK); _limitSwitch = new DigitalInput(RobotMap.PORT_LIMIT_TOMAHAWK); }
34f11ff0-69ae-40b5-875b-579d5d99c1ed
1
public void listRooms(Object skip) { DataLine rq = new DataLine(); rq.setAPI("room.list_rooms"); rq.set("skip", skip != null ? skip : 0); this._send(rq, null); }
28cfa187-bde7-4c0d-ad02-78594b90f6da
5
private void showScheduleActivities(Schedule s) { Integer[] temp = s.getActivities().toArray(new Integer[0]); //Activity[] activities; //System.out.println("uacts: " + Arrays.toString(temp)); if (temp.length > 0) { //fetch all activities //activities = new Activ...
e3ff1c55-b602-425d-9cc2-5d5606a02aec
8
public GraphInfoDialog(JFrame parent){ super(parent, "Info about the current network", true); GuiHelper.setWindowIcon(this); // determine the number of nodes and edges Enumeration<Node> nodeEnumer = Runtime.nodes.getNodeEnumeration(); int numNodes = 0; int numEdges = 0; while(nodeEnumer.hasMoreEleme...
22f253ef-21c4-4e59-a198-32bbf4c7d3cd
9
@Override public void run() { try { boolean goFurther = true; /*аварийный выход*/ /** первым делом получаю имя нового "клиента" */ try { goFurther = readClientName(); } catch (IOException e) { Sys...
fbd465dc-3466-4aab-b6bd-d02cc4ec2cfa
1
public static void DeleteIfExist(String element) { File file = new File(element); if (file.exists()) { file.delete(); } }
a50c1d5d-7e82-40af-8d13-f214c76113db
1
public synchronized void setWinner(int winnerIndex) throws IndexOutOfBoundsException { if (winnerIndex > players.length) throw new IndexOutOfBoundsException( "The max number of players is four."); this.winner = players[winnerIndex]; }
3adfdc83-f46d-4f99-b907-9908a83ad3fb
9
public static void moveAnt (Ant ant) { int startX = ant.getLocationX(); int startY = ant.getLocationY(); int newXLoc = startX; int newYLoc = startY; int incrementNum = 0; // Loops until a new node is chosen that is valid // Soldier and forager ants loop until a node that is already visible is chose...
128032b6-3d60-4616-ab38-255c6fa0a831
8
@Override public boolean execute(MOB mob, List<String> commands, int metaFlags) throws java.io.IOException { String parm = (commands.size() > 1) ? CMParms.combine(commands,1) : ""; if((!mob.isAttributeSet(MOB.Attrib.AUTORUN) && (parm.length()==0))||(parm.equalsIgnoreCase("ON"))) { mob.setAttribute(MOB.Att...
ff0976d7-d4dd-41a7-86a1-9cfc836e6884
3
boolean can_ignore(short severity) { for (int i = 0 ; i < facility_size ; i++) { if (msg_dumper_thread[i] != null && severity <= dumper_severity_arr[i]) return false; } return true; }
784617d1-0996-4fb2-a6e0-5fe313b2eb57
6
public void getLocation() { setLocation(x, y); setImage(mage); // Speed control if(speed > maxSpeed) { speed = maxSpeed; } else if (movement) { for(int i = 0; i <= 100; i++) { if (i == 100) ...
a0071fb6-5f2f-4367-a1cd-0f9ca3c4c7f7
2
public void DeltaPosition(double value){ lastPosition += value; lastPosition = (lastPosition > 1.0)?1.0:lastPosition; lastPosition = (lastPosition < -1.0)?-1.0:lastPosition; Position(lastPosition); }
0b8c37c0-b1a4-4258-a50e-32a3b439f2ef
3
public void stopGame() { // Setting isRunning to false will // make the thread stop (see run()) this.isRunning = false; // Make sure we wait until the thread has stopped... if (this.gameThread != null) { while (this.gameThread.isAlive()) { try { Thread.sleep(100); } catch (InterruptedExceptio...
4056f3d9-10e7-4db9-a5d3-f601dbdfc532
3
public AbstractInsnNode get(final int index) { if (index < 0 || index >= size) { throw new IndexOutOfBoundsException(); } if (cache == null) { cache = toArray(); } return cache[index]; }
b3e67c21-7732-4049-b040-9b213293abce
8
public static void findNearestPointMethod(Image imageA, Image imageB) { Progress.setup("Neighbourhood", imageA.points.size() * 2 + imageB.points.size() * 2); for(Point p : imageA.points) { p.findMostSimilarPoint(imageB.points); Progress.step(); if(Analysis.stop)break; } for(Point p : imageB.poi...
55db03ac-5f83-42c1-9071-1d2aad7da81e
5
public boolean rmInfo(String info) { boolean deleted = false; StringBuilder infoSb = new StringBuilder(); // Parse info entries for (String inf : infoStr.split(";")) { String vp[] = inf.split("="); if (vp[0].equals(info)) { // Delete this field deleted = true; } else { if (infoSb.length()...
8d0a4ea0-e91d-4456-968c-dde3222bd931
5
@Override public void searchAsync(final String completeString) { WordProcessing wordProcessing = new WordProcessing(); String[] words = wordProcessing.splitToWords(completeString); // i wird immer um die satzlaenge + sprungweie erhoeht for (int i = 0; i < words.length - SEARCH_SENTENCELENGTH; i += SEARCH_SEN...
528edf45-d8fa-4c60-811f-bfda96ecf4fa
3
private int getCalculationResult(final int n) { int distRes = 0; int i = 0; while (i<n) { //first hop i++; distRes=distRes+VALUE_1HOP_DIST; if (i==n) { break; } //second hop i++; distRes=distRes+VALUE_2HOP_DIST; if (i==n) { break; } //third hop i++; ...
be0cde2f-9d25-4097-bfd5-ebdd0604d361
8
public void newlotcreatorforl1(int lotno){ boolean val = true; while (val){ int what=0; System.out.println("what do you want to do?"); System.out.println("1)Add new car"); System.out.println("2)add new car at some specific position"); System.out.println("3)remove car"); System.out.println("4)get number ...
888cb199-e010-44a7-83b3-078b10040d8b
8
public String evaluatePostfix(String pfs) { Stack<String> evaluationStack = new Stack<String>(); String arr[]=pfs.split(" "); for(int i=0;i<arr.length-1;i++){ if(!arr[i].equals("+")&&!arr[i].equals("*")&&!arr[i].equals("=")){ if(variableValues.containsKey(arr[i])&&i...
5c7574b2-c0da-4c96-99b8-e633982a7ae7
1
public void removeEffect(Effect effect) { if (effect == null) throw new IllegalArgumentException("Effect can't be null!"); effects.remove(effect.getPosition()); }
6d8660a1-2c35-4656-8e2d-2dadf1a418e2
1
private void getChecks(Map<String, Integer> metrics){ logger.error("getChecks() called."); try { HttpClient httpclient = new DefaultHttpClient(); } catch (Throwable t) { logger.error("getChecks(): Unexpected exception: " + t.getMessage()); throw t; } }
890cb32b-f297-45eb-bf7d-b089a08a6f0d
6
public final boolean equals(Object obj) { if (!(obj instanceof PropertiesFile)) { return false; } PropertiesFile that = (PropertiesFile) obj; if (!this.filePath.equals(that.filePath)) { return false; } if (this.propsFile != null && this.propsFile !...
47c79cfa-30d4-46f3-a1b0-d0bfabb7e864
9
public void tick(GameContainer container, StateBasedGame game, int delta) throws SlickException { tickCount++; Input input = container.getInput(); for (int i = 0; i < entities.size(); i++) { Entity e = entities.get(i); for (int j = 0; j < en...
4ee9829f-21d4-4df0-b9f6-dc1d9a83174f
6
public boolean addArrayOfCards(int cards[]) { boolean isArrayAdded = true; if (cards != null && cards.length == 5) { // Make sure all values are nonzero for (int card : cards) { if (card < 0) { isArrayAdded = false; break; ...
8f363953-3a11-45fb-b379-e916eacdc047
2
public static void start(String testId) { if ((task == null || task.isDone()) & !testId.isEmpty()) { final TestInfoChecker testInfoChecker = new TestInfoChecker(testId); task = scheduler.scheduleAtFixedRate(testInfoChecker, 0, 30, TimeUnit.SECONDS); BmLog.info("TestInfoContro...
95c0f1ea-0610-4d64-8df5-b7d87783373f
2
protected void setDesc(String desc) throws Exception{ if(desc.length()<1 || desc.length()>20){ throw new Exception("La descripcion no puede estar vacio o contener mas de 20 caracteres."); }else{ this.desc = desc; } }
5f4f0a16-a005-46dc-9e0e-532104ef8478
0
@Test public void testGetLendh() { System.out.println("geLengh"); double l; l= 4*Math.PI; assertEquals(l, new Orb(4,l,1,1).getLengh(), 0.01); }
cfd68ba8-4751-458b-a338-c660273073eb
9
public void avoid(){ for(int b=0;b<lasers.size();b++){ if(lasers.get(b).kind==kind) continue; boolean obstacle = collisionCircle(getX(),getY(),75,(int)(lasers.get(b).x+lasers.get(b).deltax),(int)(lasers.get(b).y+lasers.get(b).deltay),(int)(lasers.get(b).h/2)); ...
5a9324e9-a430-416a-bb5d-42f2f4d720cb
5
public void delete(Key key) { int i; for (i = hash(key); keys[i] != null; i = (i + 1) % M) { if (keys[i].equals(key)) { keys[i] = null; vals[i] = null; } } // 对被删除键的右边的数据进行重新hash i = (i + 1) % M; while (keys[i] != null) { Key tempKey = keys[i]; Value tempValue = vals[i]; keys[i] = nu...
189bbc85-f905-4c87-8e0a-b134e8d2ef06
5
public static void gameloop() throws Exception { final byte[] directionPriority = { Engine.D_DOWN, Engine.D_LEFT, Engine.D_RIGHT, Engine.D_UP }; System.out.println("started gameloop"); while (true) { System.out.println("turn started"); for (byte dir = 0; dir < 4; dir++) { System.out.println("attemptin...
54f891ef-d7f6-4764-9d96-3ae3f5028b5d
9
int get_prop(int obj, int id) { int cla = 0; int [] call_args = new int[2]; if ((id & 0xFFFF0000) != 0) { cla = z.memory.getInt(z.classes_table + ((id & 0xFFFF) * 4)); call_args[0] = obj; call_args[1] = cla; if (oc_cl(2, call_args) == 0) ...
9b7e4bce-e481-46ea-a43d-6418f79909ea
8
public static Matrix multiply(Matrix matrixA, Matrix matrixB) throws IllegalSizesException, MatrixIndexOutOfBoundsException { Matrix matrixC = null; int rowsA = matrixA.getRowsCount(); int colsA = matrixA.getColsCount(); int rowsB = matrixB.getRowsCount(); int colsB...
9b803915-db5a-4a91-ac6f-1e1a8fd4703f
2
private static String _implode(String[] ary, String delim) { String out = ""; for (int i = 0; i < ary.length; i++) { if (i != 0) out += delim; out += ary[i]; } return out; }
d4223c0f-f6f7-4f3b-b830-db15b0d27be3
6
public String get(String url, Map<String, Serializable> data) { try { StringBuffer dataStr = new StringBuffer(); String getURL = url; if (data != null) { for (String s : data.keySet()) { dataStr.append(s + "=" + data.get(s).toString() + "&"); } dataStr.deleteCharAt(dataStr.length() - 1); ...
a667d177-f6df-43fb-9bda-61ec3c3ece48
8
public String toString() { String ret = null; switch (type) { case ANY: ret = "any"; break; case ALL: ret = "all"; break; case EXACT: ret = (min + max) == 0 ? "none" : Integer.toString(min); ...
5b77c3f9-3be7-4eaf-8429-372fab93b883
7
static void displayComic(ArchiveManager ext, File f) { try { BufferedImage a = null; try { int success = ext.extract(f); if(success == 0) { imagePanel.setIndex(0); if(imagePanel.getIndex() <= Arc...
e431bf16-0a2a-4a7d-855e-9061e9e1b6fd
6
@Override public void delUser(String userDeSters) { BufferedReader fisier; BufferedWriter fisier_nou; BufferedReader fisier2; BufferedWriter fisier_nou2; try { fisier = new BufferedReader(new FileReader("credentials")); ArrayLi...
1552f55f-592d-4c64-bdd2-ba05acc26b64
6
public StatisticsGUI(){ screenSize = Toolkit.getDefaultToolkit().getScreenSize(); screenMax = Toolkit.getDefaultToolkit().getScreenInsets(statisticsDialog.getGraphicsConfiguration()); taskbarSize = screenMax.bottom; screenWidth = (int)screenSize.getWidth(); screenHeight = (int)screenSize.getHeight() - taskbar...
be848e93-f06e-4932-9f8c-91af9b26be94
8
void ComputeHistMask(AnElement mask, ROI roi) { double ex=0,ey=0,ez=0; if (DataToHistogramX == null) { System.out.println("Error : No X-direction present for Histogram !\n"); return; } for (int z = 0; z < DataToHistogramX.Sizes[2]; z++) ...
ff8aeddb-ef87-4c45-82ce-0a77722fb839
3
public void cancel() { if (status != SeanceStatus.OPENED) { throw new SeanceChangeStateException("Closed or Canceled seance cannot be caneled"); } setStatus(SeanceStatus.CANCELED); for (Ticket ticket : tickets) { if (ticket.getStatus() != TicketStatus.SOLD) { disableTicket(ticket); ...
2782a446-c07e-4e02-8a91-9c908bd06baa
6
public static Units[][] getUnitLayout(int layoutNum) { Units[][] unitList = new Units[10][10]; try { Statement s1 = conn.createStatement(); ResultSet rs = s1 .executeQuery("Exec getUnitLocation @unitName = '" + layoutNum + "'"); if (rs != null) { while (rs.next()) { for (int i = 0; i <...
5f6ba6f9-48f9-43fc-9a93-3c446da7bcfc
7
public static Cons allDirectSuperrelations(NamedDescription relation, boolean removeequivalentsP) { { MemoizationTable memoTable000 = null; Cons memoizedEntry000 = null; Stella_Object memoizedValue000 = null; if (Stella.$MEMOIZATION_ENABLEDp$) { memoTable000 = ((MemoizationTable)(Logic.SG...
66effcbb-cd05-4f89-8573-025f04ac8bb0
4
private void drawDockLayoutNode(Graphics gc, DockLayoutNode node, Rectangle clip) { if (node instanceof DockLayout) { drawDividers(gc, (DockLayout) node, clip); } else if (node != null) { int layoutWidth = node.getWidth(); if (layoutWidth > 0) { int layoutHeight = node.getHeight(); if (layoutHeight...
ed6bc049-229c-4421-8592-b51bcc380a43
8
public void run() { ByteBuffer buf=direct_buffers? ByteBuffer.allocateDirect(RoundTrip.PAYLOAD) : ByteBuffer.allocate(RoundTrip.PAYLOAD); for(;;) { try { buf.position(0); int num=client_channel.read(buf); if(num == -1) ...
d6c6d82b-c411-45f1-a6eb-83baa34b0023
7
public void setStructTypeC() { for(int i = 0; i != lstPair.size(); i++) { String typeOrigName = lstPair.get(i).getSecond(); if(typeOrigName.equals("character varying")) { lstPair.get(i).setSecond("char"); } else if(typeOrigName.equals("integer")) { lstPair.get(i).setSecond("int"); } ...
7a2c280b-1633-4d65-ad4f-e2bcd775f5fc
2
public boolean checkRotate(Tetromino current, int x, int y, int orientation) { boolean result = false; if(checkLeft(current, x+1, y, (orientation+1)%4)){ if(checkRight(current, x+1, y, (orientation+1)%4)){ result = true; } } return result; }
7f5154fc-b14f-4705-afaa-206b3fa99fc5
7
@Override public void mousePressed(MouseEvent me) { this.requestFocus(); int x = me.getX() / scale; int y = me.getY() / scale; hp.setMouseClick(new Vector3f(x,y,0)); Color c = null; if(SwingUtilities.isRightMouseButton(me)) { c = bg; } else if(SwingUtilities.isLeftMouseButton(me)) { c = fg...
34f5ad56-4097-4006-8d7e-9ff9f711edcc
9
public static Arc2D computeArc(double x0, double y0, double rx, double ry, double angle, boolean largeArcFlag, boolean sweepFlag, double x, double y) { // // Elliptical arc implementation based on the SVG specification notes // // Compute the half distance between the current and the final point doubl...
a65b69e0-68d1-4a7f-872e-2db79abd9786
4
public static List<File> listFiles(final File dir){ List<File> list = new ArrayList<File>(); if(dir != null && dir.exists()) { for (File f : dir.listFiles()) { if(f.isFile()) { list.add(f); } } } return list; ...
58206a78-095f-489f-8d8a-ce55cca34bc9
7
private static void solve() { int[][] res = new int[score.size()][2]; int j = 0; for (Integer team : solved.keySet() ) { boolean[] problems = solved.get(team); int cant = 0; for (int i = 0; i < problems.length; i++) { if(problems[i]) { score.get(team)[score.get(team).length-1]+= penales.get(team...
cb737e17-9f83-451b-aaf2-15b665fed4f8
5
public MainWindow() { super(LOCALIZER.getString(L_APP_NAME)); initializeLookAndFeel(); pModel = new PresentationModel(); pModel.setProperty(PRP_MODE, CMD_PHYSICS_MODE); Scene scene = null; // open a scene, if there is one assigned ...
30f63fea-e6a5-4675-b66c-befbb9102253
1
private void setSelectObject() { InformGraphPrimitive prim; if( world.getSelectObject() == null) { prim = new InformGraphPrimitive(x-220, y + 50, 500, 500, 100, 100, "Null"); selectObjectName = "null"; } else { prim = new InformGraphPrimitive(x-220, y + 50, 50...
fd36a0af-bbd3-499e-ad56-74c6da949733
0
public Living(Point position, int baseSpeed, int baseForce, int health, int maxHealt, World currentWorld, boolean bouncing) { super(position, baseSpeed, baseForce, currentWorld, bouncing); this.health = health; this.maxHealth = maxHealt; }
eb7b8d8e-4fb2-4fd5-82d2-7755c5c0892a
3
private void printAvailableBooks() { boolean isSomething = false; for (Book currBook : list) { if (!currBook.isBorrowed()) { System.out.println(currBook.getTitle()); isSomething = true; } } if (!isSomething) System.out.println("No book in catalog"); }
211ddb7a-d488-4c0d-a52e-b7bc84d24f27
5
private boolean compareMD5Passwords( char[] filePassData, char[] authPassData ) throws ConfigurationException { String hashAlgorithm = "MD5"; try { // On Unix systems usually the password's hashes are MD5 encrypted (what about windows?) MessageDigest messageDigest = MessageDigest.getInstance( has...
a2d2bd19-16f9-47dc-a714-2af721e77bd2
9
public void checkScore(int score) { if (score < 300) { spawnSomewhere(400); } else if (score >= 300) { spawnSomewhere(350); } else if (score >= 700) { spawnSomewhere(300); } else if (score >= 1200) { spawnSomewhere(2...
f39bce5b-4d34-432d-a00e-ad4e184afbfc
3
*/ public void prependStmt(final Stmt stmt) { if (Tree.DEBUG) { System.out.println("prepend: " + stmt + " in " + block); } final ListIterator iter = stmts.listIterator(); while (iter.hasNext()) { final Stmt s = (Stmt) iter.next(); if (!(s instanceof LabelStmt)) { iter.previous(); iter.add(s...
60b95c75-faea-4ae2-b8af-cbdd20ed75fb
0
public Long getMinLength() { return minLength; }
65627ac0-2801-44de-94db-04974cbdaa86
7
public void cmdStatsWriteCsv(CommandSender sender) { List<String> activeDates = plugin.sqlDb.readActiveDates(); int nPlayers = 0; List<LoginEntry> logins = new ArrayList<LoginEntry>(); int nLogins = 0; int totalTimeOnline; int totalBlocksPlaced; int totalBlocksBroken; int nDates = 0; File saveFile = n...
7a367cdd-e7e4-4c1c-bb13-59ceeb0d1c95
8
public static Color getRandomRainbowPixel() { Color color; int r = random.nextInt(8); { switch (r) { case 0: color = Color.RED; break; case 1: color = Color.getHSBColor(15 / 360f, 1, 1); break; case 2: color = Color.YELLOW; break; case 3: color = Color.getHSBColor(60 / ...
1352d5e3-8234-4e20-b85b-8e74ebdcd44d
1
private void paintAllTowers(Graphics2D g2) { for ( Tower currentTower : board.getAllTowers()) { paintPlaceable(currentTower, g2); } }
3c6bed03-1a46-44b8-8b1c-708ebf4ca7c0
2
@Override public void run() { for (Player p : Bukkit.getOnlinePlayers()){ BAUser u = plugin.getUserManager().getUser(p); if(u!=null){ u.save(true); } } }
5967cd55-be3d-4a33-a5c3-804e389e9c27
3
@Override public String getColumnName(int col) { if (col == 0) { return ""; } else if (col == 1) { return ""; } else if (col == 2) { return TEXT_ATTRIBUTE; } else { return TEXT_VALUE; } }
e83f4eb6-ea0b-478d-b9c0-120d5db967ce
7
private static void writeWatchableObject(DataOutputStream var0, WatchableObject var1) throws IOException { int var2 = (var1.getObjectType() << 5 | var1.getDataValueId() & 31) & 255; var0.writeByte(var2); switch(var1.getObjectType()) { case 0: var0.writeByte(((Byte)var1.getObject()).byte...
0bf7f115-36bc-4bba-a833-e46b1e65dcef
2
public CtClass makeNestedClass(String name, boolean isStatic) { if (!isStatic) throw new RuntimeException( "sorry, only nested static class is supported"); checkModify(); CtClass c = classPool.makeNestedClass(getName() + "$" + name); ClassFile cf = ge...
d195b9ce-b92e-4416-84c9-9efc33b55b5d
9
private void postPlugin(final boolean isPing) throws IOException { // The plugin's description file containg all of the plugin data such as // name, version, author, etc final PluginDescriptionFile description = plugin.getDescription(); // Construct the post data final StringBui...
177ffdf3-02c5-4f58-9660-7f60b2cc913a
9
int next() { current = end; if (current == DONE) { return DONE; } if (skipPossessive) { current += 2; skipPossessive = false; } int lastType = 0; while (current < endBounds && (isSubwordDelim(lastType = charType(text[current])))) { current++; } if ...
421de8d0-1271-4d07-893c-2b4da40e589c
2
private boolean jj_3R_53() { Token xsp; xsp = jj_scanpos; if (jj_3_60()) { jj_scanpos = xsp; if (jj_3_61()) return true; } return false; }
608e79b3-84b5-4b8b-a41c-7443052287c7
1
private void acao114Parametros(Token token) throws SemanticError { try { Identificador idParametro = new Identificador(token.getLexeme()); tabela.add(idParametro, nivelAtual); listaParametros.add(idParametro); } catch (IdentificadorJaDefinidoException ex) { throw new SemanticError(ex.getMessage(), toke...
65e31ca6-e4e4-4372-a64c-0bed157b1688
0
private void onCancel() { dispose(); }
8ea029ac-3935-486e-8317-320641dbcc56
1
public static void disableBackgrounds() throws IOException, InterruptedException { try { // Ok, like written above, thats not "the best"! ((((But it works)))) XXX ProgramLauncher.start(SystemInformation.getCMD64(), DISABLE_BG_CMD, true, null); } catch (IOException | Interrupt...
8fd890a6-54c4-4d38-b261-5de0b10a7962
2
public Tracking putTracking(Tracking tracking) throws AftershipAPIException,IOException,ParseException,JSONException{ String parametersExtra=""; if(tracking.getId()!=null && !(tracking.getId().compareTo("")==0)){ parametersExtra = tracking.getId(); }else { String paramRe...
19d6b91a-0c3f-4b59-956d-5a11463eb2b4
1
@Override public int hashCode() { int hash = 0; hash += (id != null ? id.hashCode() : 0); return hash; }
5f2059a4-b40d-4ddc-a142-4ec18b546377
3
public void setConst(TConst node) { if(this._const_ != null) { this._const_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); ...
c003150c-c8be-4684-b4d5-fd4ec12d5d7c
8
public AssistantPromotion() { initComponents(); DatabaseConnection db = new DatabaseConnection(); Connection conn = db.connectToDB(); String[] studentList = null; String[] assistantList = null; String sql = "Select COUNT(Username) as totalCount From `HD...
ddff238c-6a40-41b2-a7d9-b1d7e4b50375
0
public static boolean isCellDataValid(Cell cell, String regex) { return Pattern.matches(regex, cell.getStringCellValue()); }
2da5f734-cfcf-4b74-8b4c-7d353a959ca9
3
public boolean tableExists(String name) { try { final Connection connection = getConnection(); if (connection == null) { Utilities.outputError("Could not connect to database '" + m_databaseName + "' using '" + m_options.username + "'@'" + m_options.host + ":" + m_options.port + "' using password '" + (m_...
e79aacf6-19d9-4445-a1c1-e96a36edbb48
2
private boolean isLeaf(final Expr expr) { if (expr instanceof StoreExpr) { return ((StoreExpr) expr).target() instanceof LocalExpr; } return (expr instanceof LocalExpr) || (expr instanceof ConstantExpr); }