method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
8b1ed9ab-9a21-46d1-a5c3-b49dc1897b0b
4
public void calculateLineStatistics() { if (codeLineCount == 0) { for (int i = 1; i < lines.size(); i++) if (lines.get(i) != null) { codeLineCount++; if (lines.get(i) > 0) codeLinesCoveredCount++; } ...
434544c2-ede6-4d33-b465-49b9a17a74e8
6
public static double estimateCardinalityOfExtension(NamedDescription description) { if ((description == null) || (!NamedDescription.relationSupportsExtensionP(description))) { return (Stella.NULL_FLOAT); } { int estimate = Description.accessObservedCardinality(description); if ((estimat...
9e60753b-673f-4fc6-bdd6-b3654ff9619b
7
private static int[] merge(int[] a, int[] b) { int[] c = new int[a.length + b.length]; int indexA = 0, indexB = 0; for (int indexC = 0; indexC < c.length; indexC++) { if (indexA < a.length && (indexB == b.length || a[indexA] <= b[indexB])) c[indexC] = a[indexA++]; else if (indexB < b.length && (indexA =...
cc381d6a-02ed-4eef-82d1-8e44c826dc18
5
static final private AbsValueNode possible_infixed_expression() throws ParseException, CompilationException { Token t; AbsValueNode v; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case NUMBER: t = jj_consume_token(NUMBER); v = infixed_expression(new NumberVNode(t.image,currentLine)); ...
25bf6a3e-20bf-4565-9b90-8fe412245725
8
private void createEnderPortal(int par1, int par2) { byte var3 = 64; BlockEndPortal.bossDefeated = true; byte var4 = 4; for (int var5 = var3 - 1; var5 <= var3 + 32; ++var5) { for (int var6 = par1 - var4; var6 <= par1 + var4; ++var6) { ...
76090275-e3a7-4b79-837d-9b28dc72852c
6
@Override public int numberOfLivingNeighbors(int x, int y) { int numberOfLivingNeighbors = 0; for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { if (!(i == 0 && j == 0)) { int xCoordinate = x + i; int yCoordinate = y + j...
262661ed-f03f-42ae-b5e4-ca2fe3779e41
9
public static String formatTime3(long secs) { int seconds = (int) secs; int minutes = 0; int hours = 0; int days = 0; days = seconds / (60 * 60 * 24); hours = seconds / (60 * 60) % 24; minutes = (seconds / 60) % 60; seconds %= 60; StringBuffer buf = new StringBuffer(); if (days > 0) { buf.appen...
918766ce-222f-468b-9670-116f46b95f4a
4
private static double _targetFromDistance(Distance distance) { if(distance == Distance.NEAR) { return StringPot.VAL_NEAR; } else if(distance == Distance.CENTER) { return StringPot.VAL_CENTER; } else if(distance == Distance.OPPONENT_AUTO) { return StringPot.VAL...
ffaa45f4-32cc-42fd-99c3-32300bb5c373
7
private BufferedImage getDiceImage(int size) { if (diceImages == null) return null; switch(size) { case 4: return diceImages[0]; case 6: return diceImages[1]; case 8: return diceImages[2]; case 10: return diceImages[3]; cas...
4349e71d-5fbc-4313-ab87-0ad210c5ff48
1
private File forres(String nm) { File res = base; String[] comp = nm.split("/"); for(int i = 0; i < comp.length - 1; i++) { res = new File(res, comp[i]); } return(new File(res, comp[comp.length - 1] + ".cached")); }
448e8b55-789a-4ff1-b6e6-cf79c344d9ef
8
public static void getLongestSubString() { // 两个需要对比的字符串 String x = "abcdehpoi"; String y = "bcdehfpoidfdegsfet"; int substringLength1 = x.length(); int substringLength2 = y.length(); // 第一步:构造需要遍历的二位数组 int opt[][] = new int[substringLength1 + 1][substringLength2 + 1]; // 定义三个临时变量:最大值,最大值横坐标和竖坐标 int...
cd93bc01-aa07-4cbc-9280-e78c485bf678
7
public boolean canBePillaged(Unit attacker) { return !hasStockade() && attacker.hasAbility("model.ability.pillageUnprotectedColony") && !(getBurnableBuildingList().isEmpty() && getShipList().isEmpty() && (getLootableGoodsList().isEmpty() ...
b83b4183-d660-4f7d-859b-b74fa34ab4aa
2
public void addItemsToSupplierCombobox(ArrayList<Person> list) { supplierComboboxItems.clear(); String item = "<html><font color='red'>Add New Supplier</font></html>"; supplierComboboxItems.add(item); if (driver.getPersonDB().getSupplierList().size() > 0) { for (Person person : list) { item = "\t" + pers...
885332fe-37a1-4b0b-9f46-8d900093838f
4
public static void main(String argv[]) throws Exception { PORT = Integer.parseInt(argv[0]); FILENAME = argv[1]; WINDOW = Integer.parseInt(argv[2]); serverSocket = new DatagramSocket(PORT); ByteArrayOutputStream baos = new ByteArrayOutputStream(); boolean eof = false; ArrayList<byte[]> packet_buffer = n...
696f592a-292c-4ca3-af28-05ce40cc77a1
6
@Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof TaxonObservationDownloadStatisticsPK)) { return false; } TaxonObservationDownloadStatisticsPK other = (TaxonObservation...
66618124-f3a9-4ff3-8add-60f551e6a467
1
public void disconnect(){ try { instream.close(); outstream.close(); } catch(IOException e) { } }
6c2cbc45-c39f-4a24-aa91-5e5981c312e6
7
protected Integer coerceToInteger(Object value) { if (value == null || "".equals(value)) { return Integer.valueOf(0); } if (value instanceof Integer) { return (Integer)value; } if (value instanceof Number) { return Integer.valueOf(((Number)value).intValue()); } if (value instanceof String) { t...
07bdfd31-ad30-47fe-83ca-4dcea96891f0
0
public int getColsCount() { return m_colsCount; }
82a3ced6-e266-4682-b8eb-adae42b8d819
5
private List<String> getImageNames(boolean sameSize) { List<String> imagens = new ArrayList<String>(); for (JInternalFrame frame : getDskCenter().getAllFrames()) if (frame instanceof ImagemIFrame) { if (sameSize) { BufferedImage selected = getSelectedFrame...
831b19fc-910f-43ed-a571-0c99529650bf
0
@Basic @Column(name = "sale_estado") public String getEstadoMovimiento() { return estadoMovimiento; }
97d214a1-f876-4cfe-ac13-3b0019a0bbcd
0
public Configuration[] getSelected() { return (Configuration[]) selected.toArray(new Configuration[0]); }
c44cd948-fda0-4e48-87de-6ff81d94d60a
1
private static byte[] joinQuartetsToBytes(byte[] quartets) { byte[] block = new byte[quartets.length / 2]; for (int i = 0; i < quartets.length; i += 2) { block[i/2] = ByteHelper.joinBlocks(quartets[i], quartets[i + 1]); } return block; }
319d05cc-fb5f-46fc-8284-2d4b4914ee6f
1
public void allDFS(Graph G) { // find a vertex to serve as the starting point for a DFS search in each // component. 'componentCount' will not only keep a count of the // components but will // also serve as the id to use for all vertices of that component for (int v = 0; v < G.V(); v++) { dfs(G, v); ...
0bb018ee-50cd-4a80-8e36-8c9a0be67549
5
private void boutonDeumeureDesElfesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boutonDeumeureDesElfesMouseClicked // TODO add your handling code here: if (partie.getDde().isActif()) { if (!partie.getDieuActuel().isaJoueurEnDeumeureDesElfes() || ((partie...
ebc11ec4-e344-4334-b4c3-4b22a1331d83
5
protected void layout(List<Object> parallels) { Object edge = parallels.get(0); mxIGraphModel model = graph.getModel(); mxGeometry src = model.getGeometry(model.getTerminal(edge, true)); mxGeometry trg = model.getGeometry(model.getTerminal(edge, false)); // Routes multiple loops if (src == trg) { dou...
5eb01917-7f3d-4c57-97d1-f9300d80a19f
7
@Override public boolean activateProfile(Profile profile) { // Save the directories String dataDir = getDir(); String saveDir = dataDir + getGameSaveDir(); String profilesDir = dataDir + getSave() + File.separator; // Find the currently active profile ...
4cfe542d-48e5-47fb-be74-bbae5ba65058
1
public JList<String> getListUsuarios() { if (listUsuarios == null) { listUsuarios = new JList<String>(); } return listUsuarios; }
aef6443a-cf54-4570-978c-f989d4737b70
1
private void setupWorldWind() { BasicModel model = new BasicModel(); globeRound = model.getGlobe(); wwCanvas.setModel(model); // highlightController = new HighlightController(wwCanvas, SelectEvent.ROLLOVER); // ttController = new ToolTipController(wwCanvas); // Register a rendering...
2dfb6c05-8137-48b0-b97e-6f4a60213b22
6
public static void main(String[] args) { Scanner scanIn = new Scanner(System.in); System.out.println("Please key in number for following algorithms:"); System.out.println("[1] Depth-First-Search"); System.out.println("[2] Breadth-First-Search"); System.out.println("[3] Best-First-Search"); System.out.print...
5c66d674-ab19-478a-ad16-4882ae70cfa3
8
public void checkCoupon(Service service, int position) { Calendar today = Calendar.getInstance(); long todaysTime = this.expiryDate.getTimeInMillis(); long serviceTime = service.serviceDate.getTimeInMillis(); long oneDay = 1000 * 60 * 60 * 24; int difference = (int) ((todaysTime ...
768a3f49-55cf-4b77-9f74-9f3cb1e5eba1
1
public void destroy() { for(BaseComponent bc : components.values()) { bc.destroy(); } components.clear(); }
c84dd24b-574e-4ae2-b12f-80a052aab30e
0
@Override public PermissionType getType() { return PermissionType.WORLD; }
9387d656-d157-4dac-80aa-0d92d41e2aab
8
@SuppressWarnings("deprecation") @EventHandler public void click(InventoryClickEvent event) { Player player = (Player) event.getView().getPlayer(); OpenQuestLog oql = getOpenQuestLog(player); if(oql == null)return; event.setCancelled(true); if(event.getView() != oql.getInventoryView()) { player.update...
dee3ebfe-28fb-40ee-a987-0b59c93df8af
4
public static void main(String[] args) throws InterruptedException { final int numberOfTrees = 20; final int numberOfDucks = 20; final int numberOfHunters = 20; HuntField f = new HuntField(21, 70); for (int i = 0; i < numberOfTrees; i++) new Tree(f); for (int i =...
84ad43a5-d5d2-4d0d-9743-1fa4994b8280
5
public void ge_relation(TextArea area,SimpleNode node,String prefix,int cur_end_num,int if_or_while,int con)throws SemanticErr{ if(node.toString().equals("Relation_expression")) { SimpleNode left = (SimpleNode) node.jjtGetChild(0).jjtGetChild(0).jjtGetChild(0); SimpleNode rel = (SimpleNo...
64359a9a-7150-41c1-8cbd-19fa424dc2d8
4
public String getCurrentPuzzle() { String currentPuzzle = ""; int i = 0, j = 0; for(i = 0; i < 16; i++) { for(j = 0; j < 16; j++) { if(entries[i][j].isEditable()) { currentPuzzle = currentPuzzle +"E "; } else { currentPuzzle = currentPuzzle +"N "; } if(entries[i][j]....
a6ea9cb8-1c0a-4cda-8cba-cdeb66816775
4
private static void checkForBlackjack(Dealer dealer, Player player) { boolean playerHasBlackjack = player.getHasBlackjack(); boolean dealerHasBlackjack = dealer.getHasBlackjack(); // End round if both have blackjack. Tie situation. if(playerHasBlackjack && dealerHasBlackjack) { System.out.println("Both ha...
a49bbc20-16a0-45a7-b10a-6099d6290bcd
3
public JSONObject putOnce(String key, Object value) throws JSONException { if (key != null && value != null) { if (this.opt(key) != null) { throw new JSONException("Duplicate key \"" + key + "\""); } this.put(key, value); } return this; }
e19dc6a7-86c5-4a31-9f06-13afcc35d49b
3
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) { if(plugin.hasPermission(sender, "authy")){ if(args.length==0){ }else{ if(args[0].equalsIgnoreCase("register")){ this.register(sender, cm...
b65d5742-eb36-4cb6-bc40-6b6edd2fa17a
1
private ArrayList<String> getValidationErrors() { ArrayList<String> errors = new ArrayList<String>(); String username = txtUsername.getText(); if (username.isEmpty()) { errors.add("Username field is blank"); } return errors; }
34afcc30-569c-442f-b2ba-6762a14f906e
9
public void nextQuestion(){ Scanner input = new Scanner(System.in); question=new Test(); Random random = new Random(); number = random.nextInt(4); while(check.contains(number)) { number = random.nextInt(4); } check.add(number); switch(num...
1de5f5cb-9b8f-4ae3-93e2-41cc5c1d30ba
3
@Override public Object getAsObject(FacesContext facesContext, UIComponent component, String value) { if (value == null || value.length() == 0 || JsfUtil.isDummySelectItem(component, value)) { return null; } return this.ejbFacade.find(getKey(value)); }
6ef994db-dc23-4f5e-a2f8-8003900a4db3
5
@Override public Movement getMove(Board b) { List<PosibleWord> movements = b.getPosibleWords(); Dictionary dic = b.getDic(); SortedSet<WordInfo> words = new TreeSet<WordInfo>(); for (PosibleWord pw : movements) { Iterator<String> it = dic.iterator(pw.getPattern()); while (it.hasNext()) { String...
d6481158-7e0e-4091-bb49-79b378d003dd
3
@Get public Set<Intervention> readAll() { Set<Intervention> interventions = null; String userkey = (String) getRequest().getAttributes().get("userid"); if (userkey == null) return null; User target = null; try { long userid = Long.valueOf(userkey); EntityManager em = emf.createEntityManager()...
ea48ffec-99aa-49fa-ae20-6efd71d70546
2
public static boolean isString(String line){ if(line.charAt(0) == '"' && line.charAt(line.length()-1) == '"'){ return true; } return false; }
c19fb5d6-4e71-42c3-8591-8fab831552f6
1
public boolean matches(Operator loadop) { return loadop instanceof GetFieldOperator && ((GetFieldOperator) loadop).ref.equals(ref); }
e086dcce-e67a-44e3-8ced-1cd86f50f71d
7
public void registerCommand(Object obj) { Method methods[] = obj.getClass().getDeclaredMethods(); for(Method m: methods) { if(m.isAnnotationPresent(DBCommand.class)) { Class<?> params[] = m.getParameterTypes(); if(params.length == 2 && params[0] == CommandSend...
421f41ff-5ba2-4343-b849-5c7bcaa2af52
9
public void respawn(final boolean force) { if (force) { final int numShouldSpawn = monsterSpawn.size() - spawnedMonstersOnMap.get(); if (numShouldSpawn > 0) { int spawned = 0; for (Spawns spawnPoint : monsterSpawn) { spawnPoint.spawnM...
d70bebab-24f4-4eb8-8f9e-7e0f09c822cb
7
@Override public void fill(Parameter parameter, Type type, Annotation[] annotations) { Class clazz; Class reader; if (type instanceof Class) { reader = ((Class)type); clazz = ((Class)type); } else if (type instanceof ParameterizedType) ...
1d5ca197-3dc9-41a6-8ecf-9fe086fb4fcd
8
private void expand1(byte[] src, byte[] dst) { for (int i = 1, n = dst.length; i < n; i += 8) { int val = src[1 + (i >> 3)] & 255; switch (n - i) { default: dst[i + 7] = (byte) ((val) & 1); case 7: dst[i + 6] = (byte...
dabd19aa-e3e7-45e7-b61c-09eb05f8d1d6
3
private void showAllNodesOnTree(UrlNode node , int i ){ System.out.println("Level : " + i + " , Path : " + node.selfUrl + " , parentUrl : " + node.parentUrl + " , childNum :" + node.childNodes.size() ); if( node.childNodes == null || node.childNodes.size() == 0) return ; for(UrlNode nodes : node.childNod...
0e86d850-c466-4cfc-8896-1b9248c47419
9
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String cmd = request.getParameter(CMD_PARAM); UserGame game = (UserGame) request.getSession().getAttribute(USER_GAME); boolean refresh = false; if (REFRESH_CMD.equals(cmd)) { r...
e6e708a0-278a-4b80-a90c-9bef45bd0511
5
public void Update(double timeDelta) { m_collidedLastFrame = false; if (m_interType == InteractionType.Kinetic || m_interType == InteractionType.Ghost || m_velocityX != 0.0 || m_velocityY != 0.0) m_physicsModel.PerformCollisionFor(this); double dX = m_velocityX * timeDelta + m_accelX * timeDelta * timeDelt...
1c7ef7e4-6501-450d-b58c-4cc1245ee791
1
public static void AddIndividualReport(String TestPath, String Testname) { FileWriter fstream =null; BufferedWriter out =null; try { fstream = new FileWriter(TestPath); out = new BufferedWriter(fstream); out.write("<html>"); out.write("<head>"); out.write("<title>"); out.write(Testname + " Detailed...
febfc764-3e78-41b2-bb53-c576be4d83d6
9
private static void mergeSort(Branch[] src, Branch[] dest, int low, int high, int off) { int length = high - low; // Insertion sort on smallest arrays if (length < INSERTIONSORT_THRESHOLD) { for (int i = low; i < high; i++) for (int j = i; j > low && (dest[j - 1]).compareTo(dest[j].getC()) > 0; j...
5e4af300-e70a-48bd-813c-8296c6da95b6
6
@Deprecated private static String checkNFE(String operation, String[] arguments) { if(!operationNFEArgs.containsKey(operation)) { return "VALID"; } String[] argsNums = operationNFEArgs.get(operation).split("&"); for(String s : argsNums) { if(s.contains("...")) { for(int x = Integer.valueOf(s...
88a86c7b-96b1-4ccb-976c-1e825538fa22
2
public Worker(int workerPriority,BlockingQueue<Worker> idleWorkers){ Integer bufferSize = Config.getInt(READ_BUFFER); if(bufferSize == null){ bufferSize = 10; } this.charBuffer = ByteBuffer.allocateDirect(1024 * bufferSize);// 创建读取缓冲区 this.idleWorkers = idleWorkers; handoffBox = new ArrayBlockingQueue...
200e4de5-30ca-4ea4-be20-7b897ebd167c
7
public Field() { Point[][] res = new Point[FIELD_SIZE][FIELD_SIZE]; Scanner sc = new Scanner(System.in); char letter; while (true) { System.out.println("Please, enter one letters from matrix:"); for (int i = 0; i < FIELD_SIZE; i++) { for (int j = 0...
dc036fea-cdc1-4c09-8575-e67045257615
1
private int getEhtoX(Pelihahmo h){ if (h==h1){ return ehtoh1x; } else { return ehtoh2x; } }
96c516b2-c039-4842-aa62-a0ceacc3ec5f
0
public SharingPeer(String ip, int port, ByteBuffer peerId, SharedTorrent torrent) { super(ip, port, peerId); this.torrent = torrent; this.listeners = new HashSet<PeerActivityListener>(); this.availablePieces = new BitSet(this.torrent.getPieceCount()); this.exchangeLock = new Object(); this.reset(); t...
5065a081-2cd9-4c92-b145-7f98a9981575
8
private double findChange(Expr old, Expr nu) { if (old == null || nu == null) return 0; if (old.type != nu.type) return 0; if (nu instanceof ExprNumber) { return Math.abs(((ExprNumber) old).doubleValue() - ((ExprNumber) nu).doubleValue())...
ef14ea8a-d1c9-4b08-abae-839471dbf13a
1
void init(){ if(volume<200){ days=0; }else{ days=Math.min(5,volume/200); } }
e6c41b1e-8782-44be-aaa7-ad0bbedd61fe
0
public String getDefinition() { return definition; }
fe94467f-7354-4651-8103-7a7406fd710d
3
private boolean binarySearch(int[] num, int target, int s, int e) { int mid = 0; while (s <= e) { mid = s + ((e - s) >> 1); if (num[mid] == target) { return true; } else if (num[mid] > target) { e = mid - 1; } else { s = mid + 1; } } return false; }
55452649-7369-4a05-8732-9b048234688e
4
public ArrayList<Node> successors() { ArrayList<Node> temp = new ArrayList<Node>(); State left = state.goLeft(); State up = state.goUp(); State right = state.goRight(); State down = state.goDown(); if(up != null) { temp.add(new Node(up, this, cost+1, Grid.Direction.UP)); } if(down != null) { ...
e6c87052-296a-4088-923e-a1c3d6a06a1e
0
public RemoteClientConnection(String serverIP, int port) { this.serverIP = serverIP; this.port = port; }
5a57fa0b-9adf-4e25-9590-6ab6f44adcfe
2
public void visitInnerClass(final String name, final String outerName, final String innerName, final int access) { checkState(); CheckMethodAdapter.checkInternalName(name, "class name"); if (outerName != null) { CheckMethodAdapter.checkInternalName(outerName, "outer class name"); } if (innerName != null...
5d78515d-e53d-476b-8d10-39f9f4fb29dd
7
void checaColision() { //System.out.println("Entro checaColision"); if(oro.getPosY() - oro.getAlto() > getHeight()) { //Colision de oro con borde clickOro = false; oro.setPosX(0); oro.setPosY(ALTO - oro.getAlto()); if(suena) bord...
8a804a5c-a187-4cbc-9987-a36d01ccaa61
1
public Reading() { // TODO Auto-generated constructor stub try { doc = Jsoup.connect(DOKUMENT_ADRESSE).get(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
5b582288-5639-4b6e-83c4-0f17dce1200a
3
public byte[] read_multiple(short address, int length) throws IOException { if ((this.mode==0) || (this.mode==SET_MODE_I2C_SERIAL)) this.set_mode(SET_MODE_I2C_100); byte[] data=new byte[3]; data[0]=(byte)RW_MULTIPLE; data[1]=(byte)address; data[2]=(byte)length; byte[] result = this.s...
82f72521-2003-4ed7-afc0-0f1275faec0e
1
public boolean jumpMayBeChanged() { return subBlock.jump != null || subBlock.jumpMayBeChanged(); }
91a0188c-fec9-41ee-8311-a8d8aa56210d
4
private void getRootInfo() { new Thread() { @Override public void run() { setName("Root Info Thread"); setPriority(Thread.MIN_PRIORITY); while (getDeviceInfo) { // if (debug) // logger.log(Level.DEB...
37b07547-0214-493a-a5e7-1bf949652a87
7
public void doHDMA() { if (frameDisabled || !hdmaEnabled) return; if (doTransfer) { if (direction == false) hdmaWritePPU(); else hdmaReadPPU(); } rlc = Util.limit(Size.BYTE, rlc-1); doTransfer = isRepeat(); if (getLineCounter() == 0) { rlc = Core.mem.get(Size.BYTE, srcBank, ta...
d3e7ff4b-3b08-49ce-ad3b-9ef56c09e5bc
0
public void Read(RandomAccessFile raf) throws Exception { this.id = raf.readInt(); this.Name = raf.readUTF(); this.height = raf.readDouble(); }
370a4c4b-c104-4e0d-ab7c-e07c2049c500
2
public static double power(double number, int power) { if (power < 0) { throw new IllegalArgumentException("Error: int cannot be < 0!"); } double answer = 1; for (int j = 0; j < power; j++) { answer *= number; } return answer; }
2753481f-d4dc-4ec5-93db-a2d8d0a4b4b3
3
private void freePlayerAction(Player user, FreePlayerData data) { if(user.getPosition() instanceof Jail) { if(data.isUseJailbreak() && user.hasJailbreak()) { user.useJailbreak(); } else { ((Jail) user.getPosition()).payFine(user); } } }
800a72d9-bf39-4fa2-abd5-5146aa04351c
6
public static void addConnection(String nom, String hashtag) { Connection con = null; try { Class.forName("org.sqlite.JDBC"); con = DriverManager.getConnection("jdbc:sqlite:" + Parametre.workspace + "/bdd_models"); Statement stmt = con.createStatement(); ResultSet rs; ResultSet rs2; ResultSet rs3;...
859a0a1f-876e-4e8e-adc2-de75262a3dd5
2
public final synchronized void close(){ if(fileFound){ try{ input.close(); }catch(java.io.IOException e){ System.out.println(e); } } }
39632ddb-ee9f-4175-a3dd-caa961941da0
5
private static void doImportFromXML() throws MVDException { try { if ( xmlFile != null && new File(xmlFile).exists() && textFile == null && !new File(mvdFile).exists() ) { // importing from XML to MVD File xml = new File( xmlFile ); MVD m = MVDXMLFile.internalise( xml ); MVDFile.externali...
475ec605-6769-4085-b946-3fb74fa398b1
9
public boolean equals(Object object) { if(object == this) { return true; } if(!(object instanceof Persoon)) { return false; } Persoon cobj = (Persoon) object; return ( cobj.bsn==this.bsn && cobj.voornaam.equal...
4de595a7-ba9d-403e-9bf4-7e61b22de226
7
public List<String> readBdbLogFile(String bdbLogFilePath) throws LogAnalyseException { if (StringUtils.isBlank(bdbLogFilePath)) { throw new LogAnalyseException("bdb log file path is null"); } File bdbLogFile = new File(bdbLogFilePath); if (!bdbLogFile.exists()) { ...
b7a63df4-c9bc-42b4-8c6c-21ff7cac564a
7
@Override public Object clone() { mxCellState clone = new mxCellState(view, cell, style); if (label != null) { clone.label = label; } if (absolutePoints != null) { clone.absolutePoints = new ArrayList<mxPoint>(); for (int i = 0; i < absolutePoints.size(); i++) { clone.absolutePoints.a...
8bd5d4d5-e42b-4a01-8f11-7b20efc7cc15
3
@Override public boolean equals(Object obj) { if(obj instanceof Item) { Item i = (Item) obj; if(this.name.equals(i.name)) if(this.weight == i.weight) return true; } return false; }
6431d7b7-9dc6-4bbf-9c9c-51dc06d48f41
3
protected void setUp() throws Exception{ super.setUp(); unAuto = new Auto(); unTodoTerreno = new TodoTerreno(); unaMoto = new Moto(); unControlPolicial = new ControlPolicial(); if (unControlPolicial.numeroActual()<50){puntosAuto = 3;} if (unControlPolicial.numeroActual()<30){puntosTodoTerreno =3;...
f0912d83-95ba-4d13-b00f-376bc5cb25b2
4
public void copyToPencilMode() { for(int i = 0; i < 16; i++) { for(int j = 0; j < 16; j++) { if((pencilEntries[i][j].isEditable()) && (pencilEntries[i][j].getText().equals(""))) { pencilEntries[i][j].setText(entries[i][j].getText()); } } } }
935b51fa-9a7f-4ee6-a297-ef3c52113d15
9
@Override public boolean tick(Tickable ticking, int tickID) { if(tickID==Tickable.TICKID_MOB) { if((affected!=null) &&(affected instanceof MOB) &&(invoker!=null)) { final MOB mob=(MOB)affected; if(((mob.amFollowing()!=invoker) ||(mob.amDead()) ||(mob.amFollowing().getGroupMembers(new H...
e2622a9b-fede-4c54-a20f-578dbd6bca50
5
public String preCreateAssignment() { topics = topicModel.getAll(false); classs = classModel.getAll(); boolean check = true; if (topics.isEmpty()) { addFieldError("asmo.topicId", "Topic List is empty"); check = false; } if (classs.isEmpty...
22636589-70ab-41a6-b052-01df67fa52ef
0
@Override public long sizeOf() { return mContent.length(); }
6413112a-ab9f-41c2-a8fe-12f2b6c0d447
7
public static BigDecimal toDecimal(int precision, int scale, byte[] value) { // final boolean positive = (value[0] & 0x80) == 0x80; value[0] ^= 0x80; if (!positive) { for (int i = 0; i < value.length; i++) { value[i] ^= 0xFF; } } // fi...
313b25e5-3e43-44db-a353-6a07e611ffe1
5
protected String makeIndentStr(int indent) { String tabSpaceString = /* (tab x 20) . (space x 20) */ "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t "; if (indent < 0) return "NEGATIVEINDENT" + indent; int tabs = indent / tabWidth; indent -= tabs * tabWidth; if (tabs <= 20 && indent <= 20) ...
577bb5b4-898d-4c4d-9cc2-286f00abf0a3
9
static public ObjectFlag fromLetter(final char c) { switch (c) { case 'B': return BANK; case 'D': return DARK; case 'G': return GUEST; case 'F': return FORGE; case 'H': return HOUSE; case 'M': return MERCHANT; case 'S': return SILENT; ...
2c31e818-2f0d-4233-824a-abb7072472f0
6
public static String changeXY(String str) { if(str.length()==0){ return str; } else if(str.length()==1 && str.equals("x")){ String s=str.replace(str.substring(str.length()-1),"y"); return s; } else if(str.length()==1 && ! str.equals("x")){ ...
849509e9-b592-4889-9b4c-81ea6a0ae2dd
6
public SystemUI() { _instance = this; _timeSheetCtrl = new TimeSheetCtrl(); _clientCtrl = new ClientCtrl(); _searchCtrl = new SearchCtrl(); setIconImage(Toolkit.getDefaultToolkit().getImage(SystemUI.class.getResource("/icons/48x48/app.png"))); setTitle(SystemInformation.systemInformation(1) + ...
9a5e3dc1-cd8b-4192-b3f4-8ebd1541c3b5
9
public String numeroALetra(String numero, boolean mayusculas) { String literal = ""; String parte_decimal; //si el numero utiliza (.) en lugar de (,) -> se reemplaza numero = numero.replace(".", ","); //si el numero no tiene parte decimal, se le agrega ,00 if (numero.inde...
cec2f131-4541-4a0f-8c6b-79728588bbc8
1
public String getUpdate(String appKey, String userKey, String version) { try { appKey = URLEncoder.encode(appKey, "UTF-8"); userKey = URLEncoder.encode(userKey, "UTF-8"); version = URLEncoder.encode(version, "UTF-8"); } catch (UnsupportedEncodingException e) { ...
bf603108-3188-4437-b3f0-3b503c43d301
3
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof User)) { return false; } final User user = (User) o; return !(username != null ? !username.equals(user.getUsername()) : user.getUsername() != null); }
2b5d3480-d888-490c-a534-fff530adae4f
7
public MapleCustomQuest(int id) { try { this.id = id; startActs = new LinkedList<MapleQuestAction>(); completeActs = new LinkedList<MapleQuestAction>(); startReqs = new LinkedList<MapleQuestRequirement>(); completeReqs = new LinkedList<MapleQuestRequirement>(); PreparedStatement ps = Dat...
877e7487-606a-4aac-9fd4-2c79fac0ed60
4
public int FantasmaX(int n){ Query q2; Variable a = new Variable("X"); Variable b = new Variable("Y"); switch(n){ case 0: q2 = new Query("blinky", new Term[]{a,b}); return java.lang.Integer.parseInt(q2.oneSolution().get("X").toString()); ...
e99c1806-8119-48cc-ac13-2d72e4fdf7be
7
public static Term fromString(String str){ String temp = new String(str); TermImp result = null; if (temp.contains("x^")){ // handle term with the form ax^n StringTokenizer strTok = new StringTokenizer(temp, "x^"); List<String> list = new ArrayList<String>(2); while(strTok.hasMoreElements()){ list...
1ee64af4-6379-4954-afb5-cca623a54242
0
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { txt2 = new javax.swing.JTextField(); txt3 = new javax.swing.JTextField(); txt4 = new javax.swing.JTextField(); txt5 = new java...