method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
6f472944-abf6-4091-8926-5ab305aa2f55
0
private void initComponents() { setLayout(new GroupLayout()); add(getJButton0(), new Constraints(new Leading(70, 86, 30, 20), new Leading(95, 30, 20))); add(getJLabel1(), new Constraints(new Leading(50, 180, 12, 12), new Leading(26, 50, 10, 10))); // add(getJLabel2(), new Constraints(new Leading(70, 150, 12, 12)...
d243dd4e-c665-4e6b-8180-5a9134e7b056
2
public String getExtension(File f) { String ext = null; String s = f.getName(); int i = s.lastIndexOf('.'); if (i > 0 && i < s.length() - 1) { ext = s.substring(i+1).toLowerCase(); } return ext; }
9e65721b-3405-4ef6-b38c-424cd92b0c7d
5
@Get("json") public Representation _get() { String keyword = getAttribute("keyword"); String input = format("^%s", escapeRE(keyword)); Pattern ptrn = compile(input.toLowerCase()); Find find = $annotations.find(FIND, ptrn).limit(20); List<String> rslts = new ArrayList<>(); ...
3c69ca3a-d576-4649-9eb2-7f1cc7853ec9
6
void clearChildNode(TrinaryTreeNode<T> node) { if (middle != null && middle.getValue() == node.value) { middle = null; return; } if (left != null && left.getValue() == node.value) { left = null; return; } ...
1a472a56-fccd-4549-98e4-27754e29a1a3
5
private InterfaceReplicacao nextServer() throws RemoteException, NenhumServidorDisponivelException { //It will be return the next server InterfaceReplicacao ir = null; boolean alive = false; if(vServers.size() == 0) { throw new NenhumServidorDisponivelException(); } /* Try all servers in the vServ...
3bc8d421-2446-467d-a4dd-bcbb18e8c2f0
1
void imeOff() { try { Robot robot = new Robot(); robot.keyPress(KeyEvent.VK_HIRAGANA); robot.keyPress(KeyEvent.VK_HIRAGANA); robot.keyPress(KeyEvent.VK_INPUT_METHOD_ON_OFF); } catch (AWTException e) { /* ignore exception */ } }
ddfd7b12-86f1-4716-88f8-42c5cd805526
2
@Override public String toString() { String retour; if(listeTrajets.size()!=0){ retour = "Liste des trajets : "; for(Trajet m : listeTrajets){ retour+="\n"+m.toString(); } } else{ retour = "Il n'y a encore aucun trajet enregistré."; } return retour; }
b4a72e63-dbd4-4ccc-9985-0ece1fb45c73
6
public static void nextPlayer() { if (GameData.CURRENT_PLAYER == GameData.PLAYER_ONE) { checkIfReceiveCard(); GameData.CURRENT_PLAYER = GameData.PLAYER_TWO; updateStatistics(); GameData.COLLECT_ROUND = false; RiskBoard.getGameLabel().setText(""); } else if (GameData.CURRENT_PLAYER == GameData.PLAYER...
095272ec-e293-4549-9eb9-116f659d28f2
9
@SuppressWarnings("unchecked") void run(){ Dice<Integer> d = new Dice<Integer>(1, 6, 2, 5, 3, 4); dice = new Dice[24]; int id = 0; for(Dice<Integer> x:d.getAllState())dice[id++] = x; Scanner sc = new Scanner(System.in); int T = sc.nextInt(); while(T--!=0){ top = new int[3][3]; front = new int[3][3]; ...
c6eda1ea-6d91-4fe6-b262-c7f4c82ada94
3
private int findCardIndex(List<Card> cards, int yPressed, boolean isDragonsTail) { //y-coord of the end of the last card in the pile int endY = (int) (Y_BOARD_OFFSET + (CARD_HEIGHT - CARD_Y_NO_OVERLAP) + (cards.size() * CARD_Y_NO_OVERLAP)); if (yPressed > endY || yPressed < CARD_Y_NO_OVERLAP) {...
ee95b5d9-a82d-4852-8879-becc3fe11014
3
public List expansionForLevel(int level) { if (level < 0) throw new IllegalArgumentException("Recursion level " + level + " impossible!"); if (level < cachedExpansions.size()) return (List) cachedExpansions.get(level); List lastOne = (List) cachedExpansions.get(cachedExpansions.size() - 1); for (int ...
25efcc57-e3c5-4511-8679-5646bc91bc1c
4
private void creerTblCompetence() { if (!m_comptInit) { try (BufferedReader br = new BufferedReader(new FileReader(Constant.m_compList))) { String sCurrentLine; m_comptVecNom.clear(); m_tblCompts.clear(); while ((sCurrentLine = br.readL...
7e41908f-1192-4d3d-8e6f-f6615505245b
9
public List<Node> getPublicDialogList() { List<Claim> claimList = claimDao.getClaims(CLAIM, TEAMAB); System.out.println("claimList: " + claimList.size() + " fileName: " + fileName); List<Claim> counterclaimList = null; List<Claim> subclaimList = null; List<Evidence> evidenceList = null; List<Evidence> count...
9be2c806-f13c-4c3c-a4f7-80e4a48536cb
7
public void masterMutationSearchHelper(int depth, int maxDepth, int strandMut[][], Set<OneMutation> mutSet, double minVol, double maxVol, String curAAnames[], double rotamerVolumes[][][]) { if (depth >= maxDepth) { // If we've arrived here then we're ready to // compute a volume and approximate energy ...
8500f188-37da-4525-90c0-447a517871f7
3
private void lueTulokset(){ int apu=0; while(skanneri.hasNextLine()&& apu<10){ if(skanneri.hasNextInt()){ lukutaulu[apu]=skanneri.nextInt(); } tulokset[apu]=skanneri.nextLine(); // System.out.println(lukutaulu[apu]); ...
0542e1d6-a2d0-4d4e-a321-ea1946cf940b
8
private Integer[] getSortedCyclicShift(final byte[] data, final int size) { assert (data != null && size > 0); // Test wether there is always the same number boolean isSame = true; for (byte b : data) { if (b != data[0]) { isSame = false; brea...
c95e9f33-72f2-4f24-96ad-e3236bb090ea
5
public void net_load(String user) throws IOException { Chec ini=new Chec(); String[] lista = new String[10]; StringBuffer data = ini.conec_you(user); arquivador as = new arquivador(); as.arquiv(data); if(as.acha(data)!=null){ lista = as.acha(d...
4101aa47-783a-497c-b994-43a3bb95562c
3
@Override public Object execute(HttpServletRequest request, HttpServletResponse response) throws Exception { Contexto oContexto = (Contexto) request.getAttribute("contexto"); //Parte para saber el tipo de usuario UsuarioBean oUsuarioBean; oUsuarioBean = (UsuarioBean) request.getSessio...
99b1a249-fc13-4b49-a0e7-f5e58a1e4fb5
9
@Override public void printSelf() { if ( list.size() == 0 ) { System.out.println( "Empty BST!" ); } try { for ( int i = 0 ; i < list.size() ; i ++ ) { System.out.println( "---------------------------------------------" ); Node node...
4986ca16-fb6a-4a3f-ac32-be643f5e7788
2
public boolean isConnectable() { Connection conn = null; try { conn = getConnection(); return conn != null && !conn.isClosed(); } catch (SQLException e) { return false; } finally { close(conn); } }
47e82e2e-fb07-42de-b831-d9efda4ae90a
0
public int getX(){ return x; }
66f84734-b8a4-42da-959e-6cc2bf1f8265
0
public NewAction() { super("New...", null); putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_N, MAIN_MENU_MASK)); }
5b32730b-e6d8-407b-8274-ff838a27eaec
2
public void visitOuterClass( final String owner, final String name, final String desc) { AttributesImpl att = new AttributesImpl(); att.addAttribute("", "owner", "owner", "", owner); if (name != null) { att.addAttribute("", "name", "name", "", name); ...
55f37a2b-bc6d-426b-a8c2-5c43cb216f4f
0
protected double getBreedingProbability() { return BREEDING_PROBABILITY; }
5adf7fd0-cfe0-4650-9003-3ee6c33c954a
9
public HashMap<Integer, ArrayList<Mission>> listeMissionsAttaquesNonImmediates() { HashMap<Integer, ArrayList<Mission>> missionsAttaquesNonImmediates = new HashMap<Integer, ArrayList<Mission>>(); ArrayList<Mission> missions = new ArrayList<Mission>();; for (int i = 0; i < colonnes; i++) { ...
d6563b4e-df8c-46ee-89f9-44bff5d39848
5
private void parseNumber(String s) { String x = s, number = ""; int end = 0; for (int i = 0; i < s.length(); i++) { if (Character.isDigit(s.charAt(i))) { if (i + 1 == s.length() || !Character.isDigit(s.charAt(i + 1))) { //next char is not a digit e...
cc5b55a6-4a99-4db4-89c8-ce5ae58c499f
1
public Object peek() { if (currentSize > 0) { return array[currentSize-1]; } return null; }
3399de49-502b-41c8-aad8-7e2348257e59
5
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final UserType other = (UserType) obj; if (this.id != other.id) { return false; } i...
90bc8ba8-a8b0-4101-995d-333cedc9519a
7
public void load() { if(EM.getselectedButton()!=null) { EM.getselectedButton().setUnclickedButtonImage(); EM.setselectedButton(null); } String input = null; JFileChooser fc = new JFileChooser(); int returnVal = fc.showOpenDialog(null); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = ...
bd61150a-e226-4748-bae7-79aba92ef3d5
1
protected static String processSmallQuote(String text) { text = RegEx.removeAll(text, SMALL_QUOTE_PATTERN); String[] arr = text.split("\\|"); StringBuilder sb = new StringBuilder(100); sb.append("<span class=\"quote-small\">"); sb.append(arr[0]); sb.append(SPAN_CLOSE); ...
be146bf7-f8eb-4bc1-95ed-7e58f36ff23d
1
@RequestMapping(value = "/hall-event-branch-leader-list/{hallEventId}", method = RequestMethod.GET) @ResponseBody public BranchLeaderListResponse hallEventBranchLeaderList( @PathVariable(value = "hallEventId") final String hallEventIdStr ) { Boolean success = true; String errorMe...
9e44622a-e15b-4c0e-9dd7-de902c86f007
9
final public void exportDiagram(OutputStream os, CMapData cmap, int index, FileFormatOption fileFormatOption) throws IOException { List<BufferedImage> flashcodes = null; try { if ("split".equalsIgnoreCase(getSkinParam().getValue("flashcode")) && fileFormatOption.getFileFormat() == FileFormat.PNG) { f...
420f383b-73f1-4987-9c02-86123928973c
0
int getX() { return 0; }
112d5da8-ab36-49d6-8c74-ab39bc4b764a
1
public void testConstructor_ObjectLocalTime() throws Throwable { LocalTime time = new LocalTime(10, 20, 30, 40, BUDDHIST_UTC); try { new LocalDate(time); fail(); } catch (IllegalArgumentException ex) {} }
f00a94ea-644e-422a-98f7-e5616cf6e0e5
0
public String getTerminal() { return myTerminal; }
922370aa-5c9a-4813-aa76-2e0f779d6656
6
private void listenForConnections() { try { Socket acceptedSocket = serverSocket.accept(); ObjectInputStream ois = new ObjectInputStream(acceptedSocket.getInputStream()); ObjectOutputStream oos = new ObjectOutputStream(acceptedSocket.getOutputStream()); ...
1e2675f1-3f55-4b44-933e-d603c355be8d
9
public static void checkExtensions(int[] elements, int k) { if (k == 0) { return; } for (int i = 0; i <= elements.length; i++) { int[] newElements = Arrays.copyOf(elements, elements.length + 1); for (int j = 0; j < elements.length; j++) { if (n...
cd0e25db-918e-4d0e-80cc-a806f70e6946
8
private String doNext(int num, boolean remove) { if (pos == input.length()) { throw new IllegalStateException("End of stream"); } prevPos = pos; String str = null; for (int i = 0; i < num; i ++) { //look ahead StringBuilder res = new StringBuilder(); String c; res.append(c = read()); pos +...
6d3a34c2-4329-4840-b9e2-6d29d9f49c52
0
public String toString (){return "("+(y*8+x+1)+")";}
61cb994a-7dae-4c48-8cec-05264e611c38
1
public String toString(){ return player == Player.Rom? "R " + targetCityID : "C" +" "+targetCityID; }
cc1a2968-ce46-4b8e-bf92-84d59a2b28d0
3
public void readMessage(){ try{ String message = ""; message = receive.readLine(); if(message != null){ decodeMessageAndTakeActions(message); readMessage(); //Reading again to make sure that no message is missed } }catch(SocketTimeoutException ex){ return; }catch(IOException ex){ ex....
51611194-8288-4541-8e35-f89b1a2c15d7
6
public String tokenize(String text) { Annotation document = new Annotation(text); posPipeline.annotate(document); List<CoreMap> sentences = document.get(SentencesAnnotation.class); StringBuilder builder = new StringBuilder(); for (CoreMap sentence : sentences) { for (CoreLabel token : sentence.get(TokensAn...
c6c12147-4980-4b38-9870-5d5ecb8197e4
9
public void setAttackStyle(int style) { int maxSize = 3; int weaponId = player.getEquipment().getWeaponId(); String name = weaponId == -1 ? "" : ItemDefinitions .getItemDefinitions(weaponId).getName().toLowerCase(); if (weaponId == -1 || PlayerCombat.isRanging(player) != 0 || name.contains("whip") || na...
793bb75d-4d2c-4c01-af07-9ee1cd7ab022
5
public void addDestination(String tag, int destination) { if (tag.equals("DEFAULT")) setDefaultDestination(destination); else if (tag.equals("~`!@#$%?")) otherPunctuationDestination = destination; else if (tag.equals("SPACE")) spaceDestination = destination; else if (tag.equals("0-9")) numDestination = ...
bd785bc6-7ea7-4aa9-91ab-94984934060d
9
@Override public <E> ValidationError<E> validate(E rootEntity, Annotation annotation, Object objectValue) { if (objectValue == null) { return null; } if (annotation.annotationType() != DecimalMin.class && annotation.annotationType() != Min.class) { System.out.println(annotation.annotationType()); throw ...
6b45d8a5-342e-4ce6-b533-653dc6c4d867
5
public void stillgfx(int id, int Y, int X) { for (Player p : server.playerHandler.players) { if(p != null) { client person = (client)p; if((person.playerName != null || person.playerName != "null")) { if(person.distanceToPoint(X, Y) <= 60) { person.stillgfx2(id, Y, X); } } } } }
e6ae1023-80b1-4f58-9700-c5caacffe668
7
protected FrameDecoder retrieveDecoder(Frame header, SoundStream stream, int layer) throws DecoderException { FrameDecoder decoder = null; // REVIEW: allow channel output selection type // (LEFT, RIGHT, BOTH, DOWNMIX) switch (layer) { case 3: if (l3decoder==null) { l3decoder = new LayerIIIDe...
39068174-d43c-47d8-bb59-191d8d270543
2
@Override public void update(long deltaMs) { timeSinceLastShot += deltaMs; if(charging) { charge(deltaMs); } if(weapon != null) { weapon.update(deltaMs); } }
3fc478e8-1024-434f-918a-360eb3ba4ee3
1
public DiningHall findDiningHall(long id) throws InstanceNotFoundException { try { return diningHall.get((int) id); } catch (IndexOutOfBoundsException e) { throw new InstanceNotFoundException(id, "DiningHall"); } }
c85ebf84-c7f1-4259-a628-34366bc7b0fc
4
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Timer other = (Timer) obj; if (this.second != other.second) { return false; } ...
f6b101eb-a7b6-4161-8df7-b82c503a8f48
5
public void CleanEverything() {// called once in a while for (Map.Entry<Zone, RouteEntry> kvp0 : this.Routing.entrySet()) { RouteEntry endpoint = kvp0.getValue(); if (endpoint.ClosestNbr.Dead) { endpoint.ClosestNbr.UnRefMe(); /* if (endpoint.ClosestNbr.RefCount <= 0) {// if nbr ...
c3e90c53-fcc2-4926-a3ac-91f381e0258e
9
@Override public Interactable.Result keyboardInteraction(Key key) { try { switch(key.getKind()) { case ArrowDown: return Result.NEXT_INTERACTABLE_DOWN; case Tab: case ArrowRight: ...
61da356e-b3e9-4406-97bf-412a574702a6
3
protected void fireServerExceptionEvent(ExceptionEvent evt) { if (serverExceptionListenerList != null) { Object[] listeners = serverExceptionListenerList.getListenerList(); for (int i=0; i<listeners.length; i+=2) { if (listeners[i]==IExceptionListener.class) { ((IExceptionListener)list...
1b7295c8-473f-48b5-90b2-a9729c37f2a2
8
private void appendSection(Element parent, Section section, boolean asTemplate) { logger.debug("in appendSection\twith Section section"); Element sectionElement = new Element("section"); Element type = new Element("type"); type.setText(section.getType()); sectionElement.addConte...
838e3c08-20df-4969-9632-1abc725ff77d
0
public String getMajorVersion() { return majorVersion; }
a3192f0d-a673-4a15-9547-4ece54077348
7
public CheckResultMessage checkDayofMonth3() { int r1 = get(17, 2); int c1 = get(18, 2); date(); if (checkVersion(file).equals("2003")) { try { in = new FileInputStream(file); hWorkbook = new HSSFWorkbook(in); if (!(getValueString1(r1 - 1, c1 + 1 + maxDay, 3).equals( maxDay + "日") && (getVa...
b61125ec-66e9-402e-b38a-54c8d92b3e9a
7
@Override public void keyReleased(KeyEvent e) { if(KeyEvent.getKeyText(e.getKeyCode()).equals("Enter")) { if(frame.auth_button.isEnabled() && (e.getSource() == frame.name || e.getSource() == frame.password)) auth(); if(e.getSource() == frame.answer) { if(!Client_Loade...
c480d3fa-61b4-4c96-bdd9-72ac1521e345
6
* @param newX The desired X position * @param newY The desired Y position * @return true If move operation is succesful */ private synchronized boolean tryMove(Shape newPiece, int newX, int newY) { for (int i = 0; i < 4; ++i) { int x = newX + newPiece.x(i); int y = ...
76c53b3b-07a0-4435-a645-10de1eaf217c
2
public void move(int delta) { moveCooldown--; x += dx*delta; if(!standing && dy < 1) dy += gravity; y+= dy*delta; bulletCooldown--; /*if (y > 500 - size) { y = 500 - size; dy = 0; standing = true; }*/ }
25fcc867-be24-4486-96b5-8109afd177dd
9
public static int fromUnchecked(String roman) { if (!RomanNumeral.properlyFormatted(roman)) return -1; roman = roman.toUpperCase(); int result = 0, index = 0; loop: for (RomanNumeral unit : RomanNumeral.reverseOrder()) { if (index == roman.length()) ...
b5c44ba2-b463-48b8-9516-991431e2a47a
4
@Override public ArrayList<Question> chargeLesQuestions() { ArrayList<Question> l = new ArrayList<Question>(); Connection conn = this.daoFactory.getConnexion(); String sql = "select id_question, question, palier from question"; try { Statement s...
f561b5eb-475c-4de5-9901-9d8e60fb1345
4
@Override public OggPacket getNextPacket() throws IOException { if(inProgress) { inProgress = false; return super.getNextPacket(); } else { inProgress = true; } OggPacket p = super.getNextPacket(); inPro...
0edabdfb-c8ee-4e61-80ff-8508e5839d50
3
public void setAsFront() { String[] face = {"F", "R", "B", "L", "U", "D"}; if(Arrays.equals(front[0], getCurrentLayout())) {return;} front[0] = getCurrentLayout(); resetMoves(); for(int i=0;i<6;i++) {rubiks.setText(face[i]+":2:2", face[i]);} moves_box.setBorder(BorderFactory.createLineBorder(...
a272e76d-0f27-4dfd-bd60-06c55a5f080c
2
@Override protected void channelRead0(ChannelHandlerContext ctx, HttpRequest req) throws Exception { String requestHTTP = req.getUri(); if (requestHTTP.contains("redirect?url=")) { //check if contains required characters String [] requestArray = requestHTTP.split("/?url="); S...
b4b612f5-1282-41bb-9067-7a3393c6ee1a
6
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; TypedValue other = (TypedValue) obj; if (value == null) { if (other.value != null...
6f8e44d3-ada5-4898-8c4c-f07c501d7f2f
9
public Wall look_ahead(int x, int y, int dx, int dy) { Cell horizontal = get_cell(x, y, dx, 0); Cell horizontal_neg_vertical = get_cell(x, y, dx, -dy); Cell vertical = get_cell(x, y, 0, dy); Cell vertical_neg_horizontal = get_cell(x, y, -dx, dy); Cell diagonal = get_cell(x, y, d...
5be1f22a-6c96-40fa-90bd-41d246b269f0
7
public void MenuUser() { do { System.out.println("==================================="); System.out.println(" Menu USERDB"); System.out.println("==================================="); System.out.println("1. Inserer un client"); System.out.pr...
cbcaa5c0-82c6-4e85-806f-72d24a29589e
9
public void actionPerformed(ActionEvent e) { String action = e.getActionCommand(); if(action.equals("Exit")) onShutdown(); else if(action.equals("About")) onAbout(); else if(action.equals("New")) onNew(); else if(action.equals("Go"...
4cea70ca-39ac-4859-85aa-c18b2644d243
8
public FileLineTO readFileLine() throws FileNotFoundException, IOException { FileLineTO fileLineTo = null; FileTO fileTo = null; LineTO lineTo = null; if (filenamePointer < 0) { if (filenameList.length > 0) { filenam...
98124b7f-b5d7-4b23-bfa0-e542be298357
3
protected synchronized static boolean checkTable( String table, Connection connection ) { DatabaseMetaData dbm = null; try { dbm = connection.getMetaData(); } catch ( SQLException e2 ) { // TODO Auto-generated catch block e2.printStackTrace(); } ...
5ee8b25e-7a5f-4fad-a88a-7e5044cebb94
8
public void move(char _dir){ dir=_dir; if(dir=='u'){ y-=25; }else if(dir=='d'){ y+=25; }else if(dir=='l'){ x-=25; }else if(dir=='r'){ x+=25; } else if(dir=='u'){ y-=25; }else if(dir=='d'){ y+=25; }else if(dir=='l'){ x-=25; }else if(dir=='r'){ x+=25; } }
e2c9c270-74a8-4e7a-bda2-14f469f168e7
9
private JSONObject getDBPoolsJson(Element dbPoolsElement) throws Exception { JSONObject jsonReturn = new JSONObject(); List<Element> dbElementList = dbPoolsElement.getChildren("DB"); if (dbElementList.isEmpty()) { throw new NullParamException("DBPools节点下必须包含“DB”子节点,请重新检查。"); ...
608e715f-114e-4b60-9dc9-582fd31f0c31
9
private SpriteTemplate GetEnemy(int difficulty){ if (difficulty == 1){ if (rand.nextInt(2) == 1){ if (rand.nextInt(3) > 1){ return new SpriteTemplate(Enemy.ENEMY_GREEN_KOOPA,false); } else { return new SpriteTemplate(Enemy.ENEMY_GOOMBA,false); } } else ...
4735ddef-02b8-4552-a055-65225a4cf544
3
private void botonExaminarCarpetasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonExaminarCarpetasActionPerformed // buscar carpeta de trabajo JFileChooser fc = new JFileChooser(); fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); fc.setLocation(GraphicsEnvironment.getLoc...
48ec1245-d810-4f9c-a79e-e0944012d70f
5
@SuppressWarnings({"RedundantIfStatement"}) @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Point point = (Point) o; if (x != point.x) return false; if (y != p...
c1314eb2-bc16-46ab-93ea-e21b1961d3b7
1
public void proponer(Inscripcion inscripcion,Partido partido){ if(!amigos.contains(inscripcion.getJugador()) ) throw new PropuestaDeJugadorNoAmigoException("no se puede proponer a un jugador que no es amigo"); Administrador.agregarInscripcionPropuesta(inscripcion,partido); }
0b950997-46c7-4946-ace3-d181fbff39c3
7
public synchronized void play(String file) { if (Bootstrap.MUTE) { game.log.jukebox("Game is muted, no sound played"); } else { String type = null; if (file.endsWith(".wav")) type = "wav"; else if (file.endsWith(".ogg")) type = "ogg"; if (type == "ogg") { try { OggClip ogg = new OggClip("juk...
e6b0bb13-075d-488e-896e-0586e58bff90
3
@Override public void deserialize(Buffer buf) { obstacleCellId = buf.readShort(); if (obstacleCellId < 0 || obstacleCellId > 559) throw new RuntimeException("Forbidden value on obstacleCellId = " + obstacleCellId + ", it doesn't respect the following condition : obstacleCellId < 0 || obs...
97b62fc1-53c6-4641-8884-1123e6fe893b
6
private HttpResponse doHTTPRequest(String method, String url, JSONObject data) throws IOException { BmLog.debug("Requesting : " + url); HttpRequestBase request = method.equals(Methods.POST) ? new HttpPost(url) : new HttpGet(url); request.setHeader("Accept", "application/json"); request....
0dbbe20f-7433-4b08-a24d-58bdbd20f14b
5
public boolean isValidPos(final Vector2d pos, final Entity self) { Vector2d copy = pos.copy(); copy.x /= TILE_SIZE; copy.y /= TILE_SIZE; // not inside the Tile-Raster --> not valid if (copy.x < 0 || copy.x > tiles[0].length || copy.y < 0 || copy.y > tiles.length) { return false; } else { boolean col...
6faf4d4c-f8a9-4e6d-8be2-1645ffcef82a
0
@Before public void setUp() { }
41f4c250-c9a8-48f7-9905-d5eebe2dd1f1
1
public void deleteRoom(int id) { try { PreparedStatement ps = con.prepareStatement( "DELETE FROM rooms WHERE id=?" ); ps.setInt( 1, id ); ps.executeUpdate(); } catch( SQLException e ) { e.printStackTrace(); } }
08874171-846d-4834-8c39-13bd6b50d1fe
7
@Override public boolean equals (Object obj) { if (!(obj instanceof TorrentInfoSection)) { return false; } TorrentInfoSection tis = (TorrentInfoSection) obj; return hash.equals(tis.hash) && name.equals(tis.name) && pieceLength == tis.pieceLength && priv == tis.priv ...
dcae2646-edfe-4ed0-9f56-374eb6a10c81
3
public boolean globalSearchAction() { GlobalSearchDialog documentSearchDialog = new GlobalSearchDialog(vermilionCascadeNotebook.getTree().getShell()); documentSearchDialog.open(); GlobalSearchDialog.DialogResult dr = documentSearchDialog.getResult(); if (dr != GlobalSearchDialog.DialogResult.CANCEL) { Syste...
2f38df7e-e2e6-44a0-b1fa-70634d43e169
6
private List<Long> populateTestSetIds(ISuite suite) { List<Long> testSetIds = null; try { if (this.qcTestSetId > 0) { //testset id sent via command line or config file. testSetIds = Arrays.asList(this.qcTestSetId); } else { String testsetName = map2QcTestSetName(...
731427db-808d-4ea8-a196-bd2eced3a2f0
6
public static int saveLyrics(String lyrics, String fileLocation) { try { File mp3 = new File(fileLocation); AudioFile f = AudioFileIO.read(mp3); Tag tag = f.getTag(); tag.setField(FieldKey.LYRICS, lyrics); f.commit(); return 1; } catch (CannotReadException e1) { // TODO Auto-generated catch blo...
4e992b7d-c758-4d74-b542-8f0fdcc88430
7
public void move(int xa, int ya) { if (xa != 0 && ya != 0) { move(xa, 0); move(0, ya); return; } if (xa > 0) dir = 1; if (xa < 0) dir = 3; if (ya > 0) dir = 2; if (ya < 0) dir = 0; if (!collision(xa, ya)) { x += xa; y += ya; } }
4a129cc2-b007-4315-8204-333501f3e531
0
public void setStart(Date start) { this.start = start; }
35515cf2-cd1f-42ea-887f-126e5b10c073
4
@Override public boolean startServer(int portNumber) { boolean retVal = false; if(currentServerMain == null || currentServerMain.isStopped) { try { currentServerMain = new ServerMainThread(portNumber, this); currentServerMain.start(); Logger.logInfo("Started server thread on port:"+Integer.toS...
5e07a19d-a561-47d7-b419-74c2c4a5ed12
7
@Override public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { final MOB target=this.getTarget(mob,commands,givenTarget); if(target==null) return false; if(!target.charStats().getMyRace().ID().equals("Vine")) { mob.tell(L("@x1 can not be uprooted.",ta...
4ac5e551-1e99-49ff-a8f8-99f1e5e3b8c4
7
@Override public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { final Item target=getTarget(mob,null,givenTarget,commands,Wearable.FILTER_UNWORNONLY); if(target==null) return false; if(!(target instanceof Armor)) { mob.tell(L("@x1 cannot be refitted.",targ...
93ff38da-2853-4901-83b4-f86b59ccdc77
8
public void updateUser(HttpServletRequest request, HttpServletResponse response,String updateUserinfo) throws ServletException, IOException { /* * Here we initialize tools for making the database connection * and reading from the database */ Connection conn=null; Statem...
e0f07204-93ad-4289-866e-deca66706e97
3
public void setDimensions(double x, double y, double z) { Vector4D vec = _model.getDimensions(); if (vec.getX() == 0) vec.setX(1); if (vec.getY() == 0) vec.setY(1); if (vec.getZ() == 0) vec.setZ(1); _xScale = x / vec.getX(); _yScale = y / vec.getY(); _zScale = z / vec.getZ(); }
ce189b56-6413-43a1-8041-75a004d6b22e
5
public boolean edit( int X, int Y ){ boolean flag = super.edit(X,Y); if( !flag ){ X -= LabyrinthDrawer.MARGIN; Y -= LabyrinthDrawer.MARGIN; int x = X/LabyrinthDrawer.CELL_SIZE; int y = Y/LabyrinthDrawer.CELL_SIZE; switch( option ){ case AGENT: setAgentPosition( x,...
fd84bc74-ca5f-4356-a1f8-0b426c923b63
1
public static void newGame() { if (System.nanoTime() - lLastCalledAt > L_MIN_TIME_BETWEEN_FILEOP) { // LOLTIME = System.nanoTime(); strPlayerName = ""; strPlayerGender = ""; strTrainerName = ""; lTimePlayed = 0; iLocation = 0; iLocX = 0; iLocY = 0; iBattle = 0; iWin = 0; ArrayList<Str...
15d80b96-9059-4945-92a1-72b999d465ee
5
public static VolatileClass getCraftbukkitClass(String name) throws ClassNotFoundException, FunctionUnavailableException { if(_cbClassFinder == null) { throw new FunctionUnavailableException("The Craftbukkit package could not be found or assumed."); } String className = _...
8e585723-0864-46ce-8c2e-ed450b43c647
0
@Override public int create(Visiteur unVisiteur) throws Exception { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. }
589bb73b-a122-4091-8d7e-04939e928567
3
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final CustomerGroup other = (CustomerGroup) obj; if (!Objects.equals(this.idGroup, other.idGroup)) { ...
635fdb7d-e962-4147-86a4-6075600702a1
6
* @param arguments * @return String */ public static String applyStringMethod(java.lang.reflect.Method code, Cons arguments) { switch (arguments.length()) { case 0: throw ((StellaException)(StellaException.newStellaException("Can't call method code on 0 arguments.").fillInStackTrace())); ...
fc386bba-6b9e-462d-b2cb-abe5f3c9cf07
5
public void checkScroll() { // get the x and y position in pixels int xPos = (int) (colIndex * zoomFactor); int yPos = (int) (rowIndex * zoomFactor); // only do this if the image is larger than normal if (zoomFactor > 1) { // get the rectangle that defines the current view ...