method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
f026bac4-93fd-4329-851e-1412106aad13
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...
179e0dc3-58c4-4ca3-83ba-e3f1d09b1b7b
6
private void loadWhitespaceFreeNode(Node nodeToLoadFrom, WhitespaceFreeXMLNode nodeToLoad) { // FIRST GET ALL THE ATTRIBUTES NamedNodeMap attributes = nodeToLoadFrom.getAttributes(); int numAttributes = attributes.getLength(); for (int i = 0; i < numAttributes; i++) { ...
23bc146f-6eb3-49d8-8184-d20f76263eaf
6
@Override public void onInvalidCommand(CommandSender sender, String[] args, String command) { tickets = plugin.getTicketHandler(); if (sender instanceof Player) { Player p = (Player) sender; if (p.hasPermission("modreq.reopen")) { if (args.length > 0) { ...
d3a31091-13e3-4bb1-94cf-b0aefe635e37
7
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Quat other = (Quat) obj; if (Double.doubleToLongBits(w) != Double.doubleToLongBits(other.w)) return false; if (Double.doubleToLongBits(x) != Double.doub...
4103ebcd-7b90-4b02-b968-3a8785116098
1
@Override public int attack(double agility, double luck) { if(random.nextInt(100) < luck) { System.out.println("Holy Hit, I messed that monster up!"); return random.nextInt((int) agility) * 2; } return 0; }
cef29b9c-d29e-41c4-8817-05baa5c1fc5a
9
public void update(long elapsedTime) { // select the correct Animation Animation newAnim = anim; if (getVelocityX() < 0) { newAnim = left; } else if (getVelocityX() > 0) { newAnim = right; } if (state == STATE_DYING && newAnim == left) { ...
3d742ec0-0fb7-4150-aae4-66c5fcee68e3
8
public int getMinimalCut(NonDirectedGraph<Integer> graph) { history = new LinkedHashMap<Vertex<Integer>, List<Vertex>>(); while (graph.numVertices() > 2) { Edge<Integer> edge = getRandomEdge(graph); Vertex<Integer> remainingVertex = graph.getVertex(graph.numVertices() % 2 == 0 ...
9b44eb35-5650-449d-9f12-f997550a4f5c
3
public String toStringNoClose(InputStream is, int length) { byte bytes[] = new byte[length]; try { int total = 0; for (int read; total < length && (read = is.read(bytes, total, length-total)) != -1; total += read); assert total == length; return new String...
330ddd5b-f582-4f40-b4c6-d6551bf12cc9
8
public void removeEventListener(String type, ipsilonS3ToolEngineListener listener) { if(type.equals(ipsilonS3ToolEvent.TYPE_DELETING)){ listenerDeleting.remove(ipsilonS3ToolEngineListener.class, listener); } if(type.equals(ipsilonS3ToolEvent.TYPE_UPLOADING)){ li...
6ff36d7b-d33c-4ec8-9a23-6831543a9c7d
5
public static void allocateObject(Item i, String readerName) { ObjectInfo oi = GenerateForSpim.getParams().get(i.getVal()); Item next = Scanner.get(); if(next.getSym() == Constants.BECOMES) { next = Scanner.get(); if(next.getSym() == Constants.CAST) { next = Scanner.get(); } if(readerName !=...
78f2efda-9913-4731-947a-e0bebc5af89e
9
private String parseReg(String firstParam) { firstParam = firstParam.toUpperCase(); if (firstParam.contains("$T0")) return "$T0"; if (firstParam.contains("$T1")) return "$T1"; if (firstParam.contains("$T2")) return "$T2"; if (firstParam.contains("$T3")) return "$T3"; if (firstParam.contains("$...
da9b5e0e-4e5c-4064-8b70-dc2a8a16d82f
6
private void killCheck() { try { for (Shot s : lev.player.shots) { for (Enemy e : lev.enemies) { if (Math.sqrt(Math.pow((s.y-e.y),2)+Math.pow((s.x-e.x),2))<10) { lev.player.shots.remove(s); lev.enemies.remove(e); newSpawn--; lev.player.score+=(120-newSpawn); killedEnemies++; ...
78c85d8d-9f06-44cb-a48c-afc9e957dbbb
2
public static void main(String[] args) throws IOException { String serverIp = "localhost"; System.out.println("Welcome to Client side"); Socket fromserver = null; /* if (args.length==0) { System.out.println("use: client hostname"); System.exit(-1); } * */ System.out.print...
18a0d461-6264-41ee-a609-c6dda822d713
7
public List<Tuple2<PixelType, Integer>> shrink(PixelType[] line){ List<Tuple2<PixelType, Integer>> list = new ArrayList<Tuple2<PixelType, Integer>>(); PixelType past = null; PixelType cur = null; int count = 0; for (int i=0; i<line.length; i++) { ...
1be36517-2c30-4f2b-aa43-2a9b6f9ff8f2
0
private static void usage() { System.out.println("Runs either a client, tracker or creates " + "a torrent metainfo file depending on arguments.\n"); System.out.println("Usage:" + "java -jar ttorrent<version>.jar <client|tracker" + "|create> <arguments>"); System.out.println("\tclient\t-\tstart the cl...
39fa211e-cbc6-4f02-9fa3-879dfae0851a
4
public void loadRocketImages(){// loads rocket images into a 2d arraylist rocketImages = new ArrayList(); int i = 1; int j = 1; while(true){ //cycle through i ArrayList r_img = new ArrayList(); while(true){ //cycle through j String name = "rockets/" + i + "r" + j + "....
25dbba52-545d-4860-85f9-f373f38a835d
7
@Override public void actionPerformed(ActionEvent arg0) { if(arg0.getActionCommand().equals("create")) { int authLevel = 0; if(cManager.isSelected()) authLevel = 1; int result = timeMan.addEmployee(tFName.getText(), tLName.getText(), new String(tPassword.getPassword()), authLevel); if(result < 1) ...
f972d06d-59f8-4a78-8836-e6be9fe01749
3
public static int Kruskal(Graph input) { input.setState(States.ARR_ADJ); Log.print(Log.system, "Kruskal algorithm:"); // init: int N = input.getVertexCount(); int M = input.getEdgeCount(); int[][] arr_inc = new int[N][M]; int[][] arr_adj = new int[N][N]; @SuppressWarnings("unchecked") ArrayList<ListN...
553cd4fe-b1a9-40db-ab69-c9fec65c9c5c
4
public static InputStream getFileInputStream(String pathToFile) { if (Game.isRunningInIdea()) { try { return new FileInputStream("src/main/resources/" + pathToFile);//FileUtils.class.getClassLoader().getResourceAsStream(pathToFile); } catch (Exception e) { ...
8627ceac-086b-4cbc-92e1-4c744bcab912
2
public static String wordsToPhrase(List words) { StringBuffer stringBuffer = new StringBuffer(); for (int i = 0; i < words.size(); i++) { if (i > 0) stringBuffer.append(" "); stringBuffer.append(words.get(i)); } return stringBuffer.toString(); }
73401db0-64f2-4824-93b8-cd69c32e3bb7
7
public static void doDonation(MapleClient c, String name, short damount, String email) { ChannelServer cserv = c.getChannelServer(); try { WorldLocation loc = cserv.getWorldInterface().getLocation(name); if (loc != null) { MapleCharacter victim = ChannelServer.get...
e18e655c-b100-4283-b090-c40966650ff4
5
public boolean newLibrary(Class<?> libraryClass) throws SoundSystemException { initialized(SET, false); CommandQueue(new CommandObject(CommandObject.NEW_LIBRARY, libraryClass)); commandThread.interrupt(); for (int x = 0; (!initialized(GET, XXX)) && (x < 100); x++) { snooze(400); commandThread.interru...
675ce3ee-072c-4090-80f6-025e77395f8e
3
public static void insertionSort( int[] a ){ int j; for ( int p = 1; p < a.length; p++ ){ int tmp = a[p]; for ( j = p; j > 0 && tmp<a[j-1]; j-- ){ a[j] = a[j-1]; } a[j] = tmp; } }
460d2b94-e175-4967-8950-7cccc59f33a6
0
public boolean isLambdaTransition(Transition transition) { return false; }
ebba9f80-9866-41cf-a869-85156bd1498d
4
@Override public Value evaluate(Value... arguments) throws Exception { // Check the number of argument if (arguments.length == 1) { // get Value Value value = arguments[0]; // If numerical if (value.getType().isNumeric()) { return new Value(new Double(Math.round(value.getDouble()))); } if (v...
d27b6314-792d-4ec6-8e3a-57487645c6b6
3
static List<String> read(File script) { List<String> commands = Lists.newArrayList(); if (! script.exists()) { return commands; } try { BufferedReader br = new BufferedReader(new FileReader(script)); String line; while ((line = br.readLin...
ca629bce-84c5-43c1-8962-42be20c407a7
5
public ModifiedNode put(T value) { N node = construct(value); if (m_root == null) { m_size = 1; m_root = node; return new ModifiedNode(true, node); } N parent = m_root; N t = m_root; int cmp = 0; while (t != null) { parent = t; cmp = compare(node, t); ...
c6a01c61-6dac-4d34-be18-d40dc3957d50
3
private DCStation getStation(ArgSet args) { if(!args.hasArg()) return null; String alias = args.pop(); if(servers.containsKey(alias)) { return servers.get(alias); } else if(clients.containsKey(alias)) { return clients.get(alias); } else { return null; } }
79ae71dc-1a20-4332-ba0d-89cbf0976ab3
1
private static synchronized void say(Socket s, String message){ try { PrintWriter printWriter = new PrintWriter(s.getOutputStream(), true); printWriter.println(message); } catch (Exception e){ e.printStackTrace(); } }
9c9990fa-606c-4abf-8e80-12a55a0ab139
9
protected StateDist expandChildren(SearchState oldState, int oldDist) { int[] pieceIndices = oldState.numDroppedPieces >= forcedPieces.length ? ALL_PIECES : new int[]{forcedPieces[oldState.numDroppedPieces]}; StateDist bestStateDist = null; for (int pieceIndex : pieceIndices) { LockPiece<Integer> lock...
0ab640e6-eebd-4080-a983-6e75099b6d90
8
public ListNode reverseBetween(ListNode head, int m, int n) { if(head == null || m == n) return head; Stack<Integer> stack = new Stack<Integer>(); ListNode prev = null; ListNode p = head; int count = 0; while(true){ count ++ ; if(count == m) prev = p; if(count >= m && count <= n) stack....
107aae3f-b8fb-455a-ba30-c71f651de8cc
3
private void loadBackups() { new Thread() { @Override public void run() { DefaultListModel model = new DefaultListModel(); File backupDir = new File(System.getProperty("user.home") + "/.androidtoolkit/backups"); if (debug) ...
ebdd16e2-a0c2-4613-b23e-d4b3b58a415a
9
public static void mousePointReleased(MouseEvent e) { boolean isDelete = false; if (isClicked) { boolean isContained = false; //Проверка, отпускаем ли над областью точки for (Shapes.Point point : points) { isContained = point.equals(new Shapes.Point(e....
eebecb1f-e7ed-412a-ba87-2815c894ec2a
9
public void quickSort(int[] array, int begin, int end){ int left = begin; int right = end; int t = array[left]; // int temp[] = new int[array.length]; while(left < right){ while(left < right && t <= array[right]) right--; if(left < right) array[left] = array[right]; while(left < right && t > a...
dd8db551-75f5-488a-bb73-172b7a8b1131
2
protected void readAttribute(String name, int length, ConstantPool constantPool, DataInputStream input, int howMuch) throws IOException { byte[] data = new byte[length]; input.readFully(data); if ((howMuch & UNKNOWNATTRIBS) != 0) { if (unknownAttributes == null) unknownAttributes = new SimpleMap(); ...
037383dc-e312-49cd-8b75-5415a18639d4
6
public void update(GameContainer gc, StateBasedGame sbg, EnemyManager enemyManager, int delta){ if (this.currentWave < this.waves.length) { if (!this.waveOver) { if (this.waves[this.currentWave].isOver()) { this.waveOver = true; this.nextWaveIn = WaveManager.TIMEBETWEENWAVES; //wave is over, che...
b9edf66a-e504-4a1b-abbc-83c5c1c400cf
3
static List<String> findCSVElements(File f, String tag) throws IOException { List<String> l = new ArrayList<String>(); Reader r = new FileReader(f); CSVParser csv = new CSVParser(r, CSVStrategy.DEFAULT_STRATEGY); String[] line = null; while ((line = csv.getLine()) != null) { ...
1aa0e816-0ac9-45f0-8027-df326b6b7ce7
2
public static void main(String[] Args) { actions.setUpDisplay(); // Creates the window and sets the parameters in setUP; actions.setUpVariables(); while (actions.run) { try { actions.movement(); actions.shoot(); actions.repaint(); ...
f75e6b45-1643-484f-84be-e8b7de95cb35
4
public String setItemRank(int number){ int r = number; if(r == 1){ return "*"; }else if(r == 2){ return "**"; }else if(r == 3){ return "***"; }else if(r >= 4){ return "****"; }else{ return "X"; } }
3eec91e0-cfeb-42d8-bdbc-dc111491f0e1
0
public static void GardenRoom() { currentRoomName = "Garden Room"; currentRoom = 6; RoomDescription = "You nostrils are assulted with the pungant smell of roses and various other flowers. The sudden " + "change of light makes you double back slightly as you slowly try to gain back your vision. This is clearl...
5435ffcd-7e0e-4ca3-88fe-ccb5703ba6dc
5
@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 Business)) { return false; } Business other = (Business) object; if ((this.businessID == null && other.business...
ffb97d02-ca82-4de4-bb80-817323ddf9c1
0
private ImageProcessor gaussDifference(ImageProcessor ip, double weight1, double weight2){ double weight3 = Math.max(weight1, weight2); ImageProcessor src = ip.duplicate(); ImageProcessor dst = ip.duplicate(); dst.blurGaussian(2); dst.multiply(weight1/weight3); src.blurGaussian(15); src.multiply(weight...
401080d9-776f-406a-a989-1d62b3979070
0
public static void setUserOperators(Map<String, UserOperator> userOperators) { Scheduler.userOperators = userOperators; }
8506945e-19bb-4477-91c8-43381d8b620f
6
final void method3622(boolean bool, int i, Component component) { WComponentPeer wcomponentpeer = (WComponentPeer) component.getPeer(); int i_2_ = wcomponentpeer.getTopHwnd(); if ((anInt7461 ^ 0xffffffff) != (i_2_ ^ 0xffffffff) || !bool == aBoolean7460) { if (i != 13259) method3622(true, -90, null); ...
98640a2a-1ad8-417b-bcea-fb2fa5c42acd
9
private String informations(String name, String infos){ String temp = ""; for (int i = 1; i < listContacts.size(); i++) { if ((listContacts.get(i).getNom()).equals(name)) { if(infos.equals("adresse")) temp = listContacts.get(i).getAdress...
6188e574-396e-40a4-9a8c-07be9a97e3c4
3
@Override public boolean contains(Object o) { for (int i = 0; i < list.length; i++) { if (list[i] == null) { return false; } if (list[i].equals(o)) { return true; } } return false; }
43a82213-dd5f-4d97-888a-de30a92cf0c9
5
public void setValue(ELContext context, Object base, Object property, Object value) { if (base != null) { return; } if (property == null) { throw new PropertyNotFoundException("No property specified"); } context.setPropertyResolved(true); String ...
484bc783-4506-4a02-b371-bc4b164dade5
6
@SuppressWarnings("unused") public PersonStatistics generateStatClean(String first, String last, PersonalData... cleaned) { PersonStatistics ret = new PersonStatistics(first, last); Set<String> attributeSkip = new HashSet<>(); cleanLocation: { OrderTable locationAttributeOrder = new OrderTable(); List<Stri...
17c027ff-37c5-4e55-a3a4-6b98844416c8
3
private static String getTagValue(String tag, Element element) { NodeList nlList = null; if (element.getElementsByTagName(tag).item(0) == null) return ""; nlList = element.getElementsByTagName(tag).item(0).getChildNodes(); Node nValue = null; if (nlList.getLength() > 0) nValue = (Node) nlList.item(0);...
dbc9bbb6-5ec5-4777-8eed-a1a60471de4c
2
private Conn createConnection(DbPoolConfig singleConfig) { Connection con = null; try { if(MyStringUtil.isBlank(singleConfig.getUser())){ con = DriverManager.getConnection(singleConfig.getUrl()); }else{ con = DriverManager.getConnection(singleConfig.getUrl(), singleConfig.getUser(), singleConfig.getPa...
b0e7066a-ec07-4436-98a1-0d2dcbb54e47
1
public AbstractPage getChildByURLString(String string) { try { return getChildByURL(resolveLink(string)); } catch (MalformedURLException e) { return null; } }
27e394c3-a264-4862-a78d-ae4ef47c8420
5
private int jjMoveStringLiteralDfa24_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjMoveNfa_0(0, 23); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_0(0, 23); } switch(curChar) { case 48: return jjMoveStringLiter...
8ec5894e-0d4d-42f5-98d8-a380958d98d1
5
@Override public boolean sil(int siraID) { try { /* HbmIslemler hbm = new HbmIslemler(); return hbm.sil(siraID, this.getClass()); * */ Sira sira = siraBul(siraID); if(sira!=null){ if(siradakiler.remov...
67f87de2-3274-49e4-9704-48781cf0f84d
8
public boolean stem() { int v_1; int v_2; int v_3; int v_4; // (, line 133 // do, line 134 v_1 = cursor; lab0: do { // call prelude, line 134 if (!r_prelude()) { break lab0; } } while (false); cursor = v_1; // do, line 135 v_2 = cursor; lab1: do { // call mark_regions, line 135...
93d2eca3-7e60-4051-88cc-822294af0be0
8
private static Area valueOf(int i) { switch (i) { case 0: return NORTH; case 1: return NORTHEAST; case 2: return EAST; case 3: return SOUTHEAST; case 4: return SOUTH; case 5: return SOUTHWEST; case 6: return WEST; ...
560e02e6-191e-417f-b599-148e387d0069
1
public static double lag1(double[] vals) { double mean = mean(vals); int size = vals.length; double r1; double q = 0; double v = (vals[0] - mean) * (vals[0] - mean); for (int i = 1; i < size; i++) { double delta0 = (vals[i - 1] - mean); double delt...
2c0d729e-45b7-46f6-a973-ee2c171f0135
3
public void initArea(){ Random r = new Random(); height = startHeight; width = startWidth; x = 0; y = 0; survived=0; area = new boolean [height+2][width+2]; for(int i=1; i<=height; i++){ for(int j=1; j<=width; j++){ area[i][j] = r.nextBoolean(); if (area[i][j]){ survived++; } }...
41883ecf-f1cf-4c4d-b8e8-7b611381ea4f
1
@Override public void mouseMoved(MouseEvent e) { this.MouseInput.setLocationX(e.getX()); this.MouseInput.setLocationY(e.getY()); if(this.UIManager != null) { this.UIManager.mouseMove(e); } }
2249725c-49f1-427e-a404-cc1d130fee75
4
public static MovementAction convertDirToAct(Direction currentDirection){ switch(currentDirection){ case EAST: return MovementAction.MOVE_RIGHT; case NORTH: return MovementAction.MOVE_UP; case SOUTH: return MovementAction.MOVE_DOWN; case WEST: return MovementAction.MOVE_LEFT; default: return ...
64b93962-32fe-498e-9490-fb0475cd6fb0
0
@Override public Validator getValidator() { return this.validator; }
84a3eea7-6079-4d42-bdb3-82c23315b06b
6
private void prepareInstallButton() { installButton = new JButton(CONFIG_LABEL_BUTTON); installButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { if(MODE.INSTALL.equals(mode)){ operationSystemManager.install(new ArrayList<JDK>( jdks ),jTextPane); ...
f9a37479-aca3-4b64-9a78-a32efb616b41
2
public static boolean hasMethod(Class<?> clazz, String methodName, Class<?>... paramTypes) { return (getMethodIfAvailable(clazz, methodName, paramTypes) != null); }
8f37a510-92ab-4a89-8b1f-b30dc8bc1963
3
public void cambiarPosicionJugado1(){ for(int x=0;x<8;x++){ for(int y=0;y<8;y++){ if(pd.mapa_jugador2[x][y].equals(codigo)) pd.mapa_jugador2[x][y]=""; } } int x=rd.nextInt(0)+7; int y=rd.nextInt(0)+7; set...
3c22149e-6582-4403-8b19-3fed34c86cba
8
private void packFlac() throws IOException { // get output file File outFile = getOutputFile(); if (outFile == null) return; BitOutputStream os = null; FileOutputStream fos; try { fos = new FileOutputStream(outFile); os = new BitOutputStream(fos); ...
b6a8abb6-17cf-4846-938b-37f0a79c9fce
4
@Override public void run() { if(minecraft.session != null) { HttpURLConnection connection = null; try { connection = (HttpURLConnection)new URL("http://www.minecraft.net/skin/" + minecraft.session.username + ".png").openConnection(); connection.setDoInput(true); connection.setDoOutput(false);...
649dc6c6-c924-4ef8-b056-4001b3ab506f
5
public void deleteLevel(int ID) { if (ID < 0 || ID > 4) { if (ChristmasCrashers.isDebugModeEnabled()) System.err.println("Failed to delete level " + ID + " - invalid level ID (must be between 0 and 4, inclusive)."); return; } if (levels[ID] == null) { if (ChristmasCrashers.isDebugModeEnabled()) S...
9f9d7cdd-0933-4ee2-8b0a-ffa5d7fc8737
2
public JavaClassNameParser(String className){ if(StringUtils.isBlank(className)){ throw new InvalidParameterException("className is empty"); } if(!className.contains(".")){ className = className; return; } this.packageName = className.substrin...
ca20f04f-8e73-4a1b-8755-f2f710a91da4
5
public boolean isAdminPlayer(Player p) { parent.log.debug("Checking if " + p.getName() + " is a CB admin"); if (parent.getConfig().getBool(Option.ServerOpIsAdmin) && p.isOp()) { parent.log.debug(p.getName() + " is a server operator, and serverOpIsAdmin is set"); return true; } if (checkNijikokunPermiss...
c76f759b-c31e-490f-aba3-d3ab73c34496
0
@Override public String toString() { return convertToString(cur); }
14b7bb3b-b395-4fdb-abb1-63cdb14ea560
6
public void handleAddInputAlphabetButton() { String alphabet = startView.getInputAlphabetTextField().getText().trim(); if((alphabet.length() > 0) && (startView.getInputAlphabetItems().contains(alphabet) == false)){ startView.getInputAlphabetItems().addElement(alphabet); s...
eb0bbb87-ead6-456a-b571-50227393e21e
4
void loadFile(File file) { try { if (file.isAbsolute() && file.exists()) { BufferedReader in = new BufferedReader(new FileReader(file)); String str; StringBuilder b = new StringBuilder(); while ((str = in.readLine()) != null) { ...
f8f4df8d-9e44-47f1-8f71-5692ade06104
5
private boolean checkPsd() throws IOException { byte[] a = new byte[24]; if (read(a) != a.length) { return false; } final byte[] PSD_MAGIC = {0x50, 0x53}; if (!equals(a, 0, PSD_MAGIC, 0, 2)) { return false; } format = FORMAT_PSD; width = getIntBigEndian(a, 16); height = getIntBigEndian(a, 12); ...
7e98cec6-218f-4ef7-b2b4-da7afbe3a735
3
public void writeToFile(List<Entry> entryList) { Path file = Paths.get(mPath + "/database-1psw.csv"); try { Files.deleteIfExists(file); Files.createDirectories(Paths.get(mPath)); file = Files.createFile(file); } catch (IOException e) { System.err.p...
3808340d-4d3a-4f19-b6ee-81b07b56aff9
4
public Status solve() { Status status = grid.solve(); if (status != Status.SOLVED) { return status; } for (int i = 0; i < size*size; i++) { for (int j = 0; j < size*size; j++) { if (!containsValue[i][j]) { containsValue[i][j] =...
53bd7b7c-4ff0-4e7f-8caa-f5b0707ff709
0
private void initEvents(){ startButtonclick(); }
bde4dfc8-534b-49c0-b934-c2fedbbfc735
6
@Override public Object getAsObject(FacesContext context, UIComponent component, String newValue) throws ConverterException { logger.log(Level.INFO, "Entering CreditCardConverter.getAsObject"); if (newValue.isEmpty()) { return null; } // Since t...
edbfc038-603f-4804-88d8-65748230f680
0
public void setPriority(Priority priority) { this.priority = priority; }
7edcd6ab-f0c4-43b3-bc6a-cb402d11e7c4
6
private void initialize() { this.setBounds(100, 100, 250, 140); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JButton b1 = new JButton("Nouveau"); b1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { // On demande d'abord où l'utilisateur souhaite enreg...
60413d05-ae23-488a-a42e-1019b1be93ed
0
@Test @Ignore public void runTestReflection2() throws IOException { InfoflowResults res = analyzeAPKFile("Reflection_Reflection2.apk"); Assert.assertEquals(1, res.size()); }
9756fa8f-55d1-4650-bec0-9459fb6a3a20
7
@Override protected boolean processSourceMessage(CMMsg msg, String str, int numToMess) { if(msg.sourceMessage()==null) return true; int wordStart=msg.sourceMessage().indexOf('\''); if(wordStart<0) return true; String wordsSaid=CMStrings.getSayFromMessage(msg.sourceMessage()); if(wordsSaid == null) ...
7bdc013f-33ee-485c-8556-fea901bdf3b1
5
public static void main(String[] args) { if (args.length < 1) { System.out.println("Usage: DirListing DirectoryName"); System.exit(0); } Path dirPath = Paths.get(args[0]); DirectoryStream<Path> directory = null; try { directory = Files.newDirectoryStream(dirPath); for (Path p : directory) { S...
cb354319-6996-445d-bf9c-4220fe92ef69
2
public boolean iniciarConexion() throws GlobalException, NoDataException, SQLException{ boolean exito = false; try { conectar(user, pass,ip,port,db); exito = true; } catch(ClassNotFoundException ex) { exito = false; } ...
adb73b2e-0db8-46bf-b12c-7c8954ab8660
9
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { Player player = null; if (sender instanceof Player) { player = (Player) sender; } if (args.length == 0) { if (player == null) { sender.sendMessage(ChatColor.RED+"This command can o...
68e24110-f330-4342-b35a-6221988e102b
3
@Override public boolean isGameOver() { boolean gameOver = true; for (WarMachine w : warMachine) { if (!w.isVersenkt()) gameOver = false; } if (gameOver) { Regeln.setGameOver(); return true; } else return false; }
3535c5ef-67f5-4b5b-a09f-ac66b34115a3
2
public void copyJump(Jump jump) { if (this.jump != null) throw new AssertError("overriding with moveJump()"); if (jump != null) { this.jump = new Jump(jump); this.jump.prev = this; } }
29eb3d2a-29b0-42ec-a6a3-b848de302e34
9
private MouseAdapter createPlaylistTreeMouseListener() { return new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { handleMouseEvent(e); } @Override public void mouseReleased(MouseEvent e) { handleMouseEvent(e); } private void handleMouseEvent(MouseEvent e) ...
7bd0e00a-78f8-4c25-a874-3e7092a5d307
5
@Override public void run() { // TODO Auto-generated method stub try { System.out.println("sendMail()"); MimeMessage message = new MimeMessage(session); DataHandler handler = new DataHandler(new ByteArrayDataSource( messageBody.getBytes(), "text/plain")); message.setSender(new InternetAddress(mess...
5ccffc31-d2c2-4015-8b08-2ae611f82b28
2
public boolean isMouseOverCloseButton(Point mousePosition) { if(mousePosition == null || fButtonShape == null) { return false; } return fButtonShape.contains(mousePosition); }
1555bcd5-112d-4375-90a7-f4a9d6f84e13
0
public void setErrorMessage(final String errorMessage) { this.errorMessage = errorMessage; }
53f0c630-18e8-4fba-9be4-11575402fdb0
6
private static void addMetadata( OtuWrapper wrapper, File inFile, File outFile) throws Exception { int metaLineSize = getMetaLine().split("\t").length; HashMap<Integer, String> metaMap = getMetadataLines(); BufferedReader reader = new BufferedReader(new FileReader(inFile)); BufferedWriter writer = new Bu...
8a43dff8-1491-424f-9291-704639c5a488
1
public static ArrayList<RobotIntel> forget(String name) { if (debug) System.out.println("Removing " + name + " from log"); return log.remove(name); }
306a6aa2-0f79-4bb0-9365-43ad61e9b2d0
6
private void verifDoublonId(List<Noeud> reseau, List<Livraison> livraisons, int id) throws XmlParserException { try { if (!(reseau==null)) { if(!reseau.get(id).equals(null)) { throw new XmlParserException("Erreur s???mantique:Pr???sence de doublons (M???mes identifiants)"); } } if (!(...
10f12d8d-9feb-4caf-a5c4-db162716e948
6
@Override public boolean assembleCode() { this.readAssemblyFile(); if (this.fileReference != null) { //Only assemble if file successfully opened //Operands are assembled first so their symbolic references can be mapped to actual addresses this.separateOperands(); //Assemble the operands (represented...
a8248a6a-58b0-4b2a-9310-e21739e7dbe7
4
public final static ArrayList<DropTargetContainer<JPanel, JPanel, JPanel>> createTargets() { final Field[] instrumentFields = MidiInstrument.class.getFields(); final ArrayList<DropTargetContainer<JPanel, JPanel, JPanel>> instruments = new ArrayList<>( instrumentFields.length + 1); final Class<MidiInstrument> ...
67e3dd0c-5e9f-4374-bca7-bd0e51e09779
3
private Error removeProtection() { Error ret = null; try { FileUtil.createDirectory(Constants.PROGRAM_BACKUP_PATH); if (!FileUtil.setProtection(this.authuiSystemfilePath, false) || // Make the systemfiles replaceable. !FileUtil.setProtection(this.basebrdSyste...
1a05f814-98d0-42cc-a3d6-bc939c81bdaf
9
public void writeDefaultIniFilesIfNeeded() { BufferedWriter output; FileOutputStream outputStream; File testDir = new File(Constants.DATA_DIR); if (!testDir.exists()) { testDir.mkdir(); } File testFile = new File(Constants.MEDIA_LIBRARY_INI); if (!testFile.exists() || (testFile.exists() && testFil...
96c6be60-c4e0-4ef2-90f5-2866dcec7df6
5
public void validaCamposEndereco(String cep, String rua, String numero, String bairro, String cidade) { if (cep.replaceAll("-", "").trim().isEmpty()) { JOptionPane.showMessageDialog(null, "CEP Inválido"); txt_cep.requestFocus(); } else { if (rua.isEmpty()) { ...
94a07a00-2a83-44e8-a197-a893a5f0b959
5
private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed liceu.Administrator admin = new liceu.Administrator(usernameSecretar.getText(), parolaSecretar.getText(),ncSecretar.getText(),cnpSecretar.getText(),"Secretar"); admin.addUser(); userna...
7a2236c9-1a52-4aaf-af37-c2f7c069e38b
8
private static int grade(int beh) { switch (beh) { case 0: return 0; case 1: case 2: case 3: return 1; case 12: case 13: case 14: return 2; case 15: return 3; default: return 4; } }
7255a16a-3cb6-4b39-99eb-61a0736d7d62
7
public void generateDatabase(int sequenceCount, int maxDistinctItems, int itemCountByItemset, int itemsetCountBySequence, String output, boolean withTimestamps) throws IOException { // We create a BufferedWriter to write the database to disk BufferedWriter writer = new BufferedWriter(new FileWriter(output));...