method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
526a40f0-d3ab-45de-9387-839f88071664
6
@Override public void mouseDragged(MouseEvent arg0) { //Deplacement du plateau if(arg0.getSource() == this.board && isBoardSelected) { arg0.translatePoint(arg0.getComponent().getLocation().x-cX, arg0.getComponent().getLocation().y-cY); //On ne change la position du plateau que si il ne sort pas de l'ecran ...
4c495687-a05b-4ba4-87c7-4fe55d0bb348
2
public void genererFichierResultat(String JsonFichier) { JSONArray jsonerreurs = new JSONArray(); JSONObject jsonsortie = new JSONObject(); for (int i = 0; i < erreurs.size(); i++) { jsonerreurs.add(erreurs.get(i)); } jsonsortie.put("complet",...
0870b3a6-c870-4358-b049-85abbccdf3cc
7
public void init() { if (book == null && bookId != 0) { book = bookService.findBook(bookId); } else if (book == null && bookId == 0) { if (comics) { book = new Comics(); } else { book = new Book(); } } if (bo...
6b4d0ca2-f5ce-4fcb-8da4-e73e0bc9fd24
6
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
23b60a6e-dfec-4100-ba36-7c766446115d
2
public void fillMatrix() { Random generator = new Random(); for (int i = 0; i < column.length; i++) { for (int j = 0; j <column.length; j++) { column[i].push(generator.nextInt(9) + 1); } } }
48158290-f637-4fa1-aeff-fec3700fe45b
5
public static void keyPressed(KeyEvent e) { key.set(e.getKeyCode()); if (key.get(KeyEvent.VK_SPACE)) { AudioManager.shooting(); setFire(true); } if (key.get(KeyEvent.VK_LEFT)) { setX(-1); } if (key.get(KeyEvent.VK_RIGHT)) { ...
01ab41c0-a8b8-41e8-8ed8-fd3ca26557ae
3
public void paint(Graphics g) { if (cellStates != null && cellStates.size() > 0) { mxGraphics2DCanvas canvas = graphComponent.getCanvas(); // Sets antialiasing if (graphComponent.isAntiAlias()) { mxUtils.setAntiAlias((Graphics2D) g, true, true); } Graphics2D previousGraphics = canvas.getGra...
a78d129f-2541-4b90-92bd-cdfda04cdfb3
0
public Move(int s1, int s2) { this.state1 = s1; this.state2 = s2; }
9c725640-a80e-4a3c-bf68-50ebfad57779
3
public ThetaEquation(String equation, double tstart, double tend, double dt){ this.tstart = tstart; this.tend = tend; this.dt = dt; equ = new Equation(equation); Vector<Variable> variables = equ.getVariables(); if(variables.size()==0){ theta = new Variable("t"); } else{ if(variables.size()!=1) ...
50787e29-7a3b-4023-9243-2f63b8b96b4e
7
@Override public final void sendSpawnData(final MapleClient client) { if (target.getId() == client.getPlayer().getMapId() || owner == client.getPlayer() && owner.getParty() == null) { client.getSession().write(MaplePacketCreator.spawnDoor(owner.getId(), town.getId() == client.getPlayer().getMapId() ? townPort...
6c7a1e02-e218-408c-8515-b2c8181c1b0f
8
public Socket makeConnection(String ipAddress, int port) { //The socket used to connect to the server socket=null; //The PrintWriter out = null; //The BufferedReader in = null; //The string that represents the messages coming from this class/from the cleint machine String fromPlayer=null; //The string...
414c316c-95ff-4691-87f6-d8e4c8901bbe
4
public void riichi(String[] split, String command) { if (split.length != 3) { PrintMessage("Syntax:!riichi [game] [player]"); return; } TournyGame m = (TournyGame) games.get(split[1]); if (m == null) { PrintMessage(split[1] + "is not a game"); return; } String p = split[2]; if (!m.exists...
d19650c5-0c73-46ed-af78-997e4bcb34d0
6
private static <E> Result<E> isPalindrome_Recurse_Internal(Node<E> head, int length) { if (head == null || length == 0) { //empty list is considered to be true; return new Result<>(true, null); } else if (length == 1) { return new Result<>(true, head); } else ...
fcefdf3e-e5ec-44f7-9eaf-0c1570caa45d
9
protected Object invokeReadFromXML(Element node) throws Exception { Method method; Class[] methodClasses; Object[] methodArgs; boolean array; boolean useDefault; useDefault = false; method = null; m_CurrentNode = node; ...
a8fa117a-db91-4c04-a931-c851bb668ae8
7
private SingleTypeFactory(Object typeAdapter, TypeToken<?> exactType, boolean matchRawType, Class<?> hierarchyType) { serializer = typeAdapter instanceof JsonSerializer ? (JsonSerializer<?>) typeAdapter : null; deserializer = typeAdapter instanceof JsonDeserializer ? (J...
51fa7887-004b-430e-8c9a-510112a4311f
4
private static ArrayList<MapEdge> createTree(int type, MapEdge start, MapEdge end) throws NullPointerException { MapNode fn1 = DataLoader.nodes.get(start.getFNode()); Point2D.Double xy1 = new Point2D.Double(fn1.getX(), fn1.getY()); MapNode tn2 = DataLoader.nodes.get(end.getTNode()); Poin...
51d70d1b-ebaf-48b2-908b-5f229c0dff57
1
public String getInChat(String chat){ String inChat = ""; List<Player> list = getPlayersInChat(Bukkit.getWorld(chat).getPlayers(), chat); for (Player playeren : list){ inChat += playeren.getName() + ", "; } return inChat; }
a1c44385-49fd-4e91-a53e-88b168adb9d4
5
public void run() { System.out.println("Server Starting..") ; synchronized(this){ this.runningThread = Thread.currentThread(); } try { this.serverSocket = new ServerSocket(this.serverPort); System.out.println("Server Started."); System.out.println("This Machin...
65334d5d-8388-4b79-a873-636d39f66e44
0
@Override public void focusGained(FocusEvent e) { handleUpdate(); }
f5df2cef-d56b-42b2-b369-cc14c5410365
6
public int sumNumbers(TreeNode root) { int sum = 0; if(root == null){ return 0; } Stack<TreeNode> nextNode = new Stack<TreeNode>(); Stack<String> nextPath = new Stack<String>(); nextNode.push(root); nextPath.push(""); while...
bdae67c6-7ccb-4610-b58d-7736e3e35617
3
@Test public void testIntersectSingleStep() { System.out.println(abcde); for (char c : "abcde".toCharArray()) { Assert.assertTrue(abcde.acceptIn(fstP,c)); } System.out.println(cdefg); for (char c : "cdefg".toCharArray()) { Assert.assertTrue(cdefg.acceptIn(fstP,c)); } Fst<Pair<Character, Characte...
235492b8-cee1-44ef-be93-22f8cf4b40ab
7
private void processArguments(final String[] args) throws CommandException { log.debug("processing arguments: " + Strings.join(args, ",")); if (args.length == 0) { throw new CommandException("Command requires arguments"); } String sopts = "-:c"; LongOpt[] lopts = ...
84bc6258-bf6c-4a02-8b6c-706114068b14
0
public Node getParent() {return parent;}
b82b125e-ce66-448c-af52-27c6c7e96dae
4
@Test public void testMap() { ExecutorService threadPool = Executors.newSingleThreadExecutor(); Map<String, Integer> _map = new HashMap<>(); _map.put("1", 1); _map.put("22", 22); map = _map; threadPool.execute(new Runnable() { @Override public void run() { for (Map.Entry<String, Integer>...
792dccc8-9f0a-402b-9bad-e77bd19fbc46
7
public Col(HtmlMidNode parent, HtmlAttributeToken[] attrs){ super(parent, attrs); for(HtmlAttributeToken attr:attrs){ String v = attr.getAttrValue(); switch(attr.getAttrName()){ case "align": align = Align.parse(this, v); break; case "char": charr = Char.parse(this, v); break; ...
77640088-3981-45d3-9aea-4371397997e5
6
@Override public GameObject getGame(int gameID) { switch (gameID) { case 0: // Intro Menu return new IntroMenu(this); case 1: // Level 1 return new GameFrame1(this); case 2: // Level 2 return new GameFrame2(this); case 3: // Level 3 return new GameFrame3(this); case 4: // Level 4 return new ...
2ecd0076-e975-46a7-be9f-df6921a478d0
1
public static double[] add( double[] vec1, double[] vec2 ) { int m = vec1.length; double[] res = new double[m]; for ( int i = 0; i < m; ++i ) { res[i] = vec1[i] + vec2[i]; } return(res); }
6abca9ec-2d3e-4c2b-83b0-3cbda7bd5284
6
@Override public void keyPressed(KeyEvent e) { if(e.isControlDown() && e.getKeyChar() != 's' && e.getKeyCode() == KeyEvent.VK_S) createScreenShot(); else if(e.isControlDown() && e.getKeyChar() != 'c' && e.getKeyCode() == KeyEvent.VK_C) copyScreenShot(); }
613ba6e9-9727-4edf-9020-5c7f7c72f626
0
public CheckResultMessage check1(int day) { return checkReport.check1(day); }
a0fd3e6e-31d3-4122-92ca-cb9706207e22
9
@Override public CMObject newInstance() { if(!ID().equals("Sword")) { try { return this.getClass().newInstance(); } catch(final Exception e) { } return new Sword(); } final Random randomizer = new Random(System.currentTimeMillis()); final int swordType = Math.abs(randomizer.nextInt(...
228ee1d2-6c19-4701-a475-046e42a22061
8
void setStateOfComboBox(JComboBox cb, int index) { Action a = cb.getAction(); ActionListener[] al = cb.getActionListeners(); ItemListener[] il = cb.getItemListeners(); cb.setAction(null); if (al != null) { for (ActionListener x : al) cb.removeActionListener(x); } if (il != null) { for (ItemLis...
b2e58d72-5439-4e8c-9597-33c5f32427fa
7
public void run() { try { byte[] byteBuf = new byte[20000]; boolean tryAgain = false; // Keep going while the manager thread says so while (manager.notifyThreadReady(this, (int) (currentPosition - startPosition))) { do ...
23a36f6a-13fe-458a-b371-f09d7724d7b9
7
private void parseInterNodeConnection ( Node currentNode ) { if (null != this.nodeInfo) { for (int i = 0; i < currentNode.getAttributes().getLength(); i++) { if ("type".equals(currentNode.getAttributes().item(i).getNodeName())) { ...
ff10f844-2c73-4eda-b641-4a05cef96790
3
public void updateSubTypes() { argType = (type instanceof ArrayType) ? Type .tSubType(((ArrayType) type).getElementType()) : Type.tError; for (int i = 0; i < subExpressions.length; i++) if (subExpressions[i] != null) subExpressions[i].setType(argType); }
e0d43292-f5ef-4924-80c0-cb97ffaacb28
9
private byte[] wrapCommandAPDU(byte[] capdu, int len) throws GeneralSecurityException, IOException { if (capdu == null || capdu.length < 4 || len < 4) { throw new IllegalArgumentException("Invalid type"); } /* Determine lc and le... */ int lc = 0; int le = capdu[len - 1] & 0x000000FF; if (len == 4) {...
dbc6b373-e070-4473-a313-e61b2dc2ace6
4
public List<Integer> getProvsWithBuilding(String building) { final List<Integer> provs = new ArrayList<Integer>(); final String tag = getTag(); for (int i = 1; /* loop until broken */; i++) { GenericObject prov = dataSource.getProvince(i); if (prov == null) ...
82e855fa-46bf-46d0-83fe-b382e4f59286
1
public void addPath(List<Position> coords, String tooltip) { Path shape = new Path(coords); shape.setAttributes(attrPoly); shape.setAltitudeMode(WorldWind.CLAMP_TO_GROUND); shape.setPathType(AVKey.GREAT_CIRCLE); shape.setFollowTerrain(true); shape.setTerrainConformance(40...
6cc9e548-4b87-4427-bdf4-eeeb9e781934
1
public void renderManyLines(String text, int lineLength, int line) { if(text.length() <= lineLength) { Renderer.get().drawText(text, x+38, y+40+line*26, 0.75f); } else { int cut = findSpace(text, lineLength); Renderer.get().drawText(text.substring(0, cut+1), x...
5912a019-9078-41ba-811b-b92e0e2f9825
5
@Override public void mousePressed(MouseEvent e) { // Iterate through all of the objects that are registered with the // system and check if the mouse has been clicked within the bounds of // the IMouseEventable synchronized (registeredListeningObjects) { for (IMouseEventable eventable : registeredListening...
f78ac4b3-8144-459d-b669-072f7485b848
9
void transpose(char c1, char c2, State state, StateQueue nextQ, double positionalEditPenalty) { double transposeWeight = mEditDistance.transposeWeight(c1,c2); if (transposeWeight == Double.NEGATIVE_INFINITY) return; if (c2 == ' ' && !state.tokenComplete()) return; Toke...
0b0dd69b-cde9-4de2-936c-c386adcc69cb
8
public QRDecomposition(Matrix A) { // Initialize. QR = A.getArrayCopy(); m = A.getRowDimension(); n = A.getColumnDimension(); Rdiag = new double[n]; // Main loop. for (int k = 0; k < n; k++) { // Compute 2-norm of k-th column without under/overflow. double nrm = 0; for (in...
05aa4b53-067c-478f-aa48-591fefa304d7
7
public int callProbLogicEval(boolean addRules, boolean poTypedWD, Report report, int numberPo, String parameters, String goalExpression) { exitVal = 0; try { Runtime rt = Runtime.getRuntime(); String tmpPath = System.getProperty("java.io.tmpdir"); String tmpFileName = tmpPath + File.separator + modul...
1a5d9c08-d42f-4aa5-aba1-5f2d7c421bb2
1
public void testWithField_unknownField() { YearMonth test = new YearMonth(2004, 6); try { test.withField(DateTimeFieldType.hourOfDay(), 6); fail(); } catch (IllegalArgumentException ex) {} }
85b3084a-8e6f-4201-acff-75c023431e8b
8
public Debug() { if (GameApplet.thisApplet != null) { debugFlag = Debug.AWT_DEBUG = GameApplet.thisApplet.getParameter("AWT_DEBUG") == null ? false : true; if (!debugFlag) debugFlag = GameApplet.thisApplet.getParameter("DEBUG") != null; } else { try { debugFlag = ...
cfbf9f7c-5abe-48bd-89a5-b9ead5383711
6
public float[] getNormals( float x, float y, float z ) { switch( this ) { case LEFT: return new float[] { x - 1, y, z }; case RIGHT: return new float[] { x + 1, y, z }; case BOTTOM: return new float[] { x, y - 1, ...
67d77592-88b9-436e-afb3-bec721b5606f
1
public String getExpression() { String collector = "("; collector += function; for (String arg : arguments) collector += arg + " "; collector += ")"; return collector; }
64c8d2e2-1b62-482f-b2fc-4606a6452c05
6
protected void renderScreen(Graphics renderer, IScreen screen, GameContainer window) { if (screen.getBackColor() != null) renderer.setBackground(screen.getBackColor()); RenderImage backImage = screen.getBackImage(); if (backImage != null) { if (screen.tileBackground()) { for (int x = 0; x < windo...
a673725c-84ce-4d1e-889d-241426e66f4e
2
public static Achievement getAchievementByID(int aid) { String statement = new String("SELECT * FROM " + DBTable + " WHERE aid = ?"); PreparedStatement stmt; try { stmt = DBConnection.con.prepareStatement(statement); stmt.setInt(1, aid); ResultSet rs = stmt.executeQuery(); Achievement achievement = nu...
29d3c3d0-0d4a-448c-b935-520d852c17b7
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); } ...
d9527c21-1968-4f90-8174-00d72ffef680
3
public final boolean subIDEqualsAndNewer(Object obj) { if (obj == this) { return true; } if (obj instanceof UniqueID) { UniqueID other = (UniqueID) obj; return mSubID == other.mSubID && mTimeStamp < other.mTimeStamp; } return false; }
9622cd6e-cc88-401b-a5d4-2d5a6ee95d54
4
public void onPrivateMessage(String sender, String login, String hostname, String message) { // check if exist if (sender.equalsIgnoreCase(DarkIRC.currentChan.name)) { GUIMain.add_line("<" + sender + ">:" + message); } else { ...
b134cfda-78a2-4d49-b030-69792b2fa39a
6
public MainMenu(RoomDisplay rd) { super(rd); // Material 0, Blank materials.addElement(new Material(true, false)); // Material 1, White Wall materials.addElement(new Material(new Color(255, 255, 255), false, true)); // Material 2, Green Wall materials.addElement(...
498976fc-90b2-4b1c-b5a4-dab97b2255bb
1
public void fitAABB(AABB other) { if (aabb == null) { aabb = other; } else { aabb = aabb.combine(other); } getEntity().fitAABB(aabb); }
d316f400-f3c8-4a0c-a926-98889c43da52
6
@Override public void run() { ArrayList<ArrayList<String>> arreglos = null; try { DataInputStream ois = new DataInputStream( socketCliente.getInputStream()); DataOutputStream oos = new DataOutputStream( socketCliente.getOutputStream()); System.out.println("DEBUG: A punto de leer la consulta!"); ...
d1f00933-4e8e-4df9-83c2-e014a18f1785
3
private void btnExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExcluirActionPerformed if (estaModoEdicao() && exclusaoConfirmada()) { try { excluir(); } catch (ValidacaoException ex) { _unitOfWork.rollback(); J...
455c809e-1fd6-45c7-83ae-d82fad044494
4
public List<cheque> retriveChequeinfo() throws SQLException{ List<cheque> chequeInfo=new ArrayList(); try{ databaseConnector=myConnector.getConnection(); stmnt=(Statement) databaseConnector.createStatement(); SQLQuery="SELECT * FROM familydoctor....
766c907c-e525-4b96-81d9-517b213a0747
5
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final PeopleCP other = (PeopleCP) obj; if (this.id != other.id && (this.id == null || !this.id.equals(other.id)...
c9fcde54-b9b6-469c-941a-1f7949f637ca
4
public static Map<String,String> parseDigestAuthorizationChallenge( String line ) { Map<String,String> map = new TreeMap<String,String>( CaseInsensitiveComparator.sharedInstance ); // This regex works but includes the quotes in the final result. // The line will be splitted into the single '<key>=<value>' elements...
97c9ed44-dfe1-4eca-9ca3-218d396a4a45
8
protected File getPreviousOutputDirectory() { File dir = previousOutputDirectory; if (dir == null && !IOSImageUtil.isNullOrWhiteSpace(subdir.getText())) { dir = new File(subdir.getText()); if (!dir.isAbsolute()) { dir = null; } } if (dir == null && previousTargetDirectory != null) { dir = previo...
fbd499b5-0e4f-47ff-8cfb-850843806ddc
8
public void keyPressed(KeyEvent e) { int keyCode = e.getKeyCode(); switch (keyCode) { case KeyEvent.VK_LEFT : left = true; break; case KeyEvent.VK_RIGHT : right = true; break; case KeyEvent.VK_UP : up = true; break; case KeyEvent.VK_DOWN : down = true; break; c...
7711f7e1-4673-467d-82aa-a6dbc896dfb2
8
public static void main(String[] args) { boolean sortir = false; int opcio; while (!sortir) { menu(); opcio = llegirNum("\n\n\tInserir opció: "); switch (opcio) { case 1: FitxerJugadorsOut jugador = new FitxerJugadorsOut("fi...
c7967f21-c8b9-4d6c-ab6a-e56b57cba154
4
@Override public void clicked(final int x, final int z) { for(int i = -dr; i <= dr; ++i) { final int isq = i * i; for(int j = -dr; j <= dr; ++j) { if(circle && (isq + j * j > 4 * r2)) { continue; } final int posX = x + i; final int posZ = z + j; viewer...
0bede754-f0ee-43a7-a6f1-a397353437c1
9
@Override protected void paintComponent(Graphics g1) { super.paintComponent(g1); Graphics2D g = (Graphics2D) g1; g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); ...
170b814f-443a-4f35-8c59-3f37bf791549
5
private Vector2f lineIntersects(Vector2f lineStart1, Vector2f lineEnd1, Vector2f lineStart2, Vector2f lineEnd2) { Vector2f line1 = lineEnd1.sub(lineStart1); Vector2f line2 = lineEnd2.sub(lineStart2); float cross = crossVector(line1, line2); if(cross == 0) { ret...
f349239b-ccfd-4ca4-9e1a-dec3e52a58ff
5
public CheckResultMessage check25(int day) { int r1 = get(6, 5); int c1 = get(7, 5); int r2 = get(39, 5); int c2 = get(40, 5); BigDecimal b = new BigDecimal(0); if (checkVersion(file).equals("2003")) { try { in = new FileInputStream(file); hWorkbook = new HSSFWorkbook(in); b = getValue(r1 + d...
fb2648be-8210-4444-bc09-bc264d8fa117
0
@SuppressWarnings("rawtypes") @Override public Class getObjectType() { return Blog.class; }
234bf346-444f-4e24-aa80-ef2fb758c748
4
private ArrayList<FilmBean> createListOfFilmBeans(ResultSet rs) { try { if (rs == null || rs.getFetchSize() < 0) { return null; } else { ArrayList<FilmBean> films = new ArrayList<FilmBean>(); FilmBean film = new FilmBean(); ...
d5fda287-4a99-4a00-89d7-9f2e8f5372b1
2
public static boolean isNumero(String valor) { final String NUMEROS = "0123456789"; for (int i = 0; i < valor.length(); i++) { char caracter = valor.charAt(i); if (NUMEROS.indexOf(caracter) == -1) { return false; } } return true; }
eb860ec7-0ed3-400c-b5c2-a2cebecc247a
6
public RemoteController() { //Misc Intializers serverAddress = null; intPort = 5252; dicernType = 0; charCount = 0; autoSave = 0; selected = null; conv = new byteConvertor(this); control = new RCControls(); strName = "null"; //Initializes the name list head = null; tail = head; //Generat...
4eb26d55-bcd4-405a-98a2-d6a87e231875
1
private URL getURL(String filename) { URL url = null; try { url = this.getClass().getResource(filename); } catch (Exception e) { } return url; }
b095b0dc-d97a-42ad-85c6-c62e2504a5c9
3
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Course other = (Course) obj; if (!Objects.equals(this.name, other.name)) { return false; ...
102a9ad2-82e1-4b18-8eae-a93eb83e99bd
1
public void testConstructor_ObjectStringEx3() throws Throwable { try { new YearMonthDay("10:20:30.040"); fail(); } catch (IllegalArgumentException ex) { // expected } }
d355ff07-77ee-4098-ab09-8a8ab53eb58f
8
private void appendShapeInternal(StringBuilder sb) { if (type == ShapeType.RECTANGLE && shield > 0) { throw new UnsupportedOperationException(); } else if (type == ShapeType.RECTANGLE) { sb.append("shape=rect"); } else if (type == ShapeType.DIAMOND) { sb.append("shape=diamond"); } else if (type == Shap...
018893da-b462-4161-bf50-720d324038d2
0
public void mouseEntered(MouseEvent e) // not used { }
360fe4e4-9555-428c-813f-997017918bc1
3
@EventHandler(ignoreCancelled = true) public void onBlockBreak(final BlockBreakEvent broken) { if (broken instanceof KioskRemove) return; if (!Kiosk.SIGN_BLOCKS.contains(broken.getBlock().getTypeId())) return; final Sign state = (Sign) broken.getBlock().getState(); if (!this.hasTitl...
d78285ff-0b02-4dfc-b999-16b91e9bdffd
8
private MoveResult dealWithSpecialCases(StrategyBoard gameBoard, PlayerColor currentTurn, PieceType pieceMoving, Location fromLocation, Location toLocation) { final MoveResult result; if(gameBoard.getPieceAt(fromLocation) == null && gameBoard.getPieceAt(toLocation) == null){ return new MoveResult(currentTur...
74d5888d-8990-40a1-b281-74b53064babb
7
@Override public void unInvoke() { // undo the affects of this spell if(!(affected instanceof MOB)) return; final MOB mob=(MOB)affected; super.unInvoke(); if((canBeUninvoked())&&(!mob.amDead())&&(mob.location()!=null)) { if(mob.amFollowing()!=null) CMLib.commands().postFollow(mob,null,false); ...
c60e9ed8-c7fc-48dd-8c1e-fb08ac3a7480
5
public static void makeUnbreakable(ItemStack stack) { if (stack == null) return; try { Object craft = getHandle(stack); if (craft == null) return; Object tagObject = getTag(craft); if (tagObject == null) return; Object unbreakableFlag = null;...
7154d8fb-adba-4a41-95c1-f73f421ea416
0
public UndoTool(AutomatonPane view, AutomatonDrawer drawer) { super(view, drawer); }
890d7f3b-128e-4000-bccc-f229492d0480
7
public Stmts() { // while (true) { /* The program may have already reach it's end. */ int lexResult = 0; boolean breakLoop = false; if (Lexer.nextToken == Token.KEY_END || GlobalAttributes.braceEncounteredPreviously) { lexResult = Lexer.nextToken; GlobalAttributes.braceEncounteredPreviously = false; ...
ce2f9c40-8996-4200-a9b3-8426ad3dcf07
2
public void setNextCell(ProcessedCell c){ nextCell = c; if(c != null && c.getPrevCell() != this){ c.setPrevCell(this); } }
cb4fd198-ba74-46fa-bdb4-bd61d5aa091b
2
public String getTaytteetString() { String tayteStr = ""; for (int i = 0; i < this.taytteet.size(); i++) { if(tayteStr.isEmpty()) { tayteStr = this.taytteet.get(i).toString(); } else { tayteStr = tayteStr + ", " + this.taytteet.get(i); } } return tayteStr; }
16437f3c-45e3-48c1-87ff-1dd1e8586076
5
public void deplacer(int orig, int dest, int nbrCartes) { orig--; dest--; if (orig < 0 || orig >= this.table.size()) throw new IllegalArgumentException( "Pile d'origine invalide: " + (orig + 1)); else if (dest < 0 || dest >= this.table.size()) throw new IllegalArgumentException( "Pile de destinat...
e7a4b9de-4489-47c9-9cf3-37aef3685119
5
public void handleReleasedKeys(ArrayList<KeyButtons> keyReleased) { if (keyReleased.contains(KeyButtons.LEFT)) { left = false; } if (keyReleased.contains(KeyButtons.RIGHT)) { right = false; } if (keyReleased.contains(KeyButtons.UP)) ...
b94c3c02-470a-4702-88ee-ca6f621badaf
3
public boolean login() { boolean loggedIn = false; try { while(loggedIn == false) { System.out.println("Username: "); _username = _scanner.next(); System.out.println("Password: "); _password = _scanner.next(); loggedIn = _remoteObj.login(_username, _password, new Client(), ServerInterface....
f970fb25-1349-4818-84ad-3b46a8a2a8a8
0
@XmlAttribute public String getClient() { return client; }
430b7076-2581-44c0-9a46-e52b1417c248
6
public void loop() { if (!MUSIC_ON && (name.equals("music1") || name.equals("music2"))) return; if (!SOUND_ON && !name.equals("music1") && !name.equals("music2")) return; new Thread() { public void run() { clip.loop(); } }.start(); }
f8e98352-1058-4b6c-b992-b310a23017fb
9
public void boostMessage(String pokeString,String stat,String amounts, String from) { int which = getStatIndex(stat); int amount = Integer.parseInt(amounts); Pokemon pokemon = getPokemon(pokeString); String level = ""; //sharply for 2, drastically for 3-6, nothing for 1 if(amount == 2 || amount == -2) ...
5bb46c05-2aad-424d-a924-ae7ed9646712
2
public void setJump(String[] src) { charJump = new Image[src.length]; for (int i = 0; i < src.length; i++) { try { charJump[i] = new Image(src[i]); } catch (SlickException e) { System.out.println(e); } } }
829c45e4-d9c4-483a-965f-3f99df1854be
8
private void setupGui() { setTitle("Enter Password!"); setModal(true); setSize(324, 91); setResizable(false); setUndecorated(true); close.addMouseListener(new MouseListener() { @Override public void mouseClicked(MouseEvent e) { ...
3a1a4aae-2ef8-4963-9568-1ed57396f659
0
public String getEmail() { return email; }
dff78c45-7ae5-4a0c-8e7d-8f81bd93fa5b
5
public SecurityEditDialog(JDialog parent, String title, DBElementListModel listModel, SecurityRecord security) { super(parent, title, Dialog.ModalityType.DOCUMENT_MODAL); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); // // Save the security information // t...
ad1ab9b3-ce06-4f41-9481-9d376e423ef6
3
private void parsePacket(byte[] data, InetAddress address, int port) { String message = new String(data).trim(); Packets type = PacketUtils.getPacketByID(Integer.parseInt((message.substring(0, 2)))); Packets packet = null; switch (type) { case INXPAMOUNT: packet ...
d7822207-f315-455d-b43e-055042221964
7
public int[] getOneFileLines(File file) { int codeSum = 0;// 代码行数 int blankSum = 0;// 空白行数 int commentSum = 0;// 注释行数 BufferedReader br = null; try { br = new BufferedReader(new FileReader(file)); String line = null; while((line = br.readLine()) != null) { line = line.trim(); if (line.matches...
0219d8e3-31df-4c6c-ba6b-fc674d0b29aa
9
private boolean isValid(String s) { if (s.length() == 3 && s.charAt(0) == '0') return false; if (s.length() == 3 && (Integer.valueOf(s) > 255 || Integer.valueOf(s) == 0)) return false; if (s.length() == 2 && s.charAt(0) == '0') return false; if (s.length() == 2 && Integer.valueOf(s) == 0) return fal...
dafdcccc-0dcb-48db-9543-0b0069878e91
9
public void execute() { clearConsole(); Deck deck = new Deck(); // TURNO PLAYER1 Player player1 = new Player(); player1.setScore(0); do { Card card = deck.getCard(); //dai carta System.out.println(deck.getCardsList().size()); player1.setScore( player1.getScore() + deck.calcValue(c...
dac18f2f-ad2d-4501-9552-7fb7110861a3
9
public boolean isTall() { switch (eType) { case ENDERMAN: case ENDER_DRAGON: case GHAST: case GIANT: case HORSE: case IRON_GOLEM: case MAGMA_CUBE: case SLIME: case WITHER: return true; default: return false; } }
3a2415d3-c811-4069-906b-89036c0995b2
8
private static Map<Integer, Double> getRankedTagList(BookmarkReader reader, Map<Integer, Double> userMap, double userDenomVal, Map<Integer, Double> resMap, double resDenomVal, boolean sorting, boolean smoothing, boolean topicCreation) { Map<Integer, Double> resultMap = new LinkedHashMap<Integer, Double>(); i...
47bdf46a-a82d-4520-b90c-171504cbc3c7
2
public void shutdown() { // System.out.println("trying to shut down"); synchronized (accptsoc) { if (!listen) { return; } listen = false; try { accptsoc.close(); this.closeall(); } catch (IOException e) { System.err.println("ajserver: could not shutdown properly"); } } }
330c7064-dee9-4ba2-b437-023e563aaf8b
9
private String fixBadChars(String s) { if (s == null || s.length() == 0) return s; Pattern p = Pattern.compile("[<>\"&]"); Matcher m = p.matcher(s); StringBuffer b = null; while (m.find()) { if (b == null) b = new StringBuffer(); switch (s.charAt(m.start(...