method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
26411c4e-495d-4c4b-8af3-d7ab737e9712
8
String apply(String[] params) throws IOException { String result = null; if (isDefault) { if (defaultRealm.equals(params[0])) { result = params[1]; } } else if (params.length - 1 == numOfComponents) { String base = replaceParameters(format, params); if (match ...
ac33b202-5a76-42d7-8eb7-75acce976a95
7
private boolean isNeighbourOfMarkedPixel(int aX, int aY) { return ( pixelIsMarked(aX - 1, aY) || pixelIsMarked(aX + 1, aY) || pixelIsMarked(aX, aY - 1) || pixelIsMarked(aX, aY + 1) || pixelIsMarked(aX - 1, aY - 1) ...
83f5acda-e17b-4fcf-8fe7-9f9e733b8b14
6
public static void reloadConfig(){ BiomesExcluded = new ArrayList<Biome>(); // Reset BiomesIncluded = new ArrayList<Biome>(); // Reset plugin.reloadConfig(); List<?> biomesInc = plugin.getConfig().getList("included-biomes"); for (Object b : biomesInc){ String biome = ((String)b).toUpperCase(); ...
5f4c2b4f-0a64-4e1b-8c47-356614235c75
2
public boolean equalsExpr(final Expr other) { return (other instanceof StoreExpr) && ((StoreExpr) other).target.equalsExpr(target) && ((StoreExpr) other).expr.equalsExpr(expr); }
62973cdf-daad-4f0c-a278-37b22e17941a
1
@Test @Ignore public void test_SessionsPost() { SessionList laSessionList = new SessionList(); // Put all the attribute that you want control over. This is so // we can handle removal of attributes when a registrant is // updated and no longer has that attribute. laSessionList.getAttrName().add("Session Ty...
e97f8b4e-cdb2-4bc3-a4fb-4e1a8c3509ba
8
public void extractSS(ArrayList<String> dsspFile, ArrayList<Residue> resArray) { int resArrayCounter = 0; String current = "T"; String old = "T"; String[] sheetArray = {"E","B"}; String[] helixArray = {"G","H","I"}; String[] turnArray = {"","S","T"," "}; int nis = 1; // this counter keeps track of the number of...
e78e3bea-f20b-4c04-b064-a7736adfd3a3
4
private void scanning() { if (on && currentFreq > Range.BOTTOM.getFreq() && !stationFound()) { scanning = true; decreaseCurrentFreq(); } else if(currentFreq == Range.BOTTOM.getFreq()) { scanning = false; stopScan = true; } }
a7bde8aa-a6e6-48cb-9038-7ee77b74ec90
0
public int topFrameSize() { return runStack.size() - framePointers.peek(); }
5ca2ea5c-a773-4144-92e1-7f510ba837f2
3
public static void createTree(ResearchScreen rs, ResearchItem root, float x, float y) { if(root != null) { rs.addItemSlot(x, y, root); if(root.researched()) { int indx = 0; for(ResearchItem i : root.getFollowers()) { createTree(rs, i, x...
35cc2657-1fdc-4989-9108-e79c3dfebbfd
0
@Test public void getDuplicatesFromKeyword() throws SameAsServiceException { EquivalenceList equivalences = this.service.getDuplicates("Rome"); assertEquals(10, equivalences.size()); }
1b9a153b-36d3-40ec-b7d7-db7b767f893d
3
@Override public Collection<? extends GrantedAuthority> getAuthorities() { Set<String> roles = this.getRoles(); if (roles == null) { return Collections.emptyList(); } Set<GrantedAuthority> authorities = new HashSet<GrantedAuthority>(); for (String role : roles) { authorities.add(new SimpleGrantedA...
dca57895-50e3-4ea3-899d-36bfebc89aa4
6
public ArrayList<Object> playGame(String gameType) { ArrayList<Object> results = new ArrayList<Object>(); if (gameType.equals("Com")) { int activePlayerIndex = 0; while (this.players.size() > 1) { this.turnNumber++; this.activePlayer = this.players.get(activePlayerIndex); this.activePlayer.setPla...
0f4f78e1-9d80-4851-b9b6-22b6eb3fcff8
5
public static void main(String[] args) throws RemoteException, AlreadyBoundException, NotBoundException, InterruptedException { try { Parser.hdfsCoreConf(); Parser.mapreduceCoreConf(); Parser.mapreduceJobTrackerConf(); Parser.mapreduceTaskTrackerIndividualConf(); } catch (Exception e) { e.printStackT...
a5d2cb78-8553-495e-adcd-61529eacf00b
5
private MinuetoImage buildChessBoard(MinuetoColor mcoFirstColor, MinuetoColor mcoSecondColor) { MinuetoImage imageTempChessBoard; // Stores the temporary chessboard we are drawing. MinuetoImage imageAlternateSquare; // Stores a tile of the second color. // First, we make a board from the first color. im...
630c2e59-9b16-4b8d-ab72-d3d66f77dcfc
2
public Weibull(double lambda, double k) throws ParameterException { if (lambda <= 0 || k <= 0) { throw new ParameterException("Weibull parameters lambda, k > 0."); } else { this.lambda = lambda; this.k = k; unif = new ContinuousUniform(0, 1); } }
849b004d-b2e6-47b7-92bb-d18452e958fb
3
@Override protected String readNext() { try { if (reader.ready()) { line = reader.readLine(); // Read a line (only if needed) if (line != null) { lineNum++; return line; } } } catch (IOException e) { return null; } return null; }
fa4aea49-2b98-4a0a-a84c-6457e04bdf7a
1
public void setStatustextZoomedFonttype(Fonttype fonttype) { if (fonttype == null) { this.statustextZoomedFontType = UIFontInits.STATUSZOOMED.getType(); } else { this.statustextZoomedFontType = fonttype; } somethingChanged(); }
a4b18d1b-69e0-4fed-ab46-96f61c38f660
5
protected static Ptg calcLCM( Ptg[] operands ) { if( operands.length < 1 ) { return new PtgErr( PtgErr.ERROR_NA ); } Ptg[] numbers = PtgCalculator.getAllComponents( operands ); // algorithm: // LCM(a, b)= (a*b)/GCD(a, b) long lcm = 0; try { Ptg[] ops = new Ptg[2]; if( (lcm = PtgCalculator.ge...
93eeffe7-32c6-4d1b-812b-3e43f92602f8
7
public static void parser(String content) throws ParserException{ Parser parser=new Parser(content); parser.setEncoding( parser.getEncoding()); //parser.getEncoding() NodeList nodeList=null; // עضǩ ˵ijضĽڵ NodeFilter titleFilter=new NodeClassFilter(TitleTag.class); ...
684ddb79-1fc9-4f6b-934c-3a7e4f10a8e1
2
public void keyPressed(KeyEvent arg0) { if(arg0.getKeyCode() == KeyEvent.VK_ESCAPE) { System.exit(0); } else if(arg0.getKeyCode() == KeyEvent.VK_ENTER) { yamg.runApplication(); } }
fc68ccb2-1dbc-461b-9bf9-f1fdac600014
8
* @param algName holds the name of a weka algorithm to configure the * bean with if it is a wekawrapper bean * @return a JPanel holding the instantiated (and configured bean) */ private JPanel instantiateToolBarBean(boolean wekawrapper, String tempBeanCompName, String algName) { Object tempBea...
2569b4a8-5301-4bd7-8474-5d628bc0f0ed
5
private void printScore(){ System.out.println(); int[][] temp = new int [25][50]; for (int Y = 0; Y < 25; Y++){ for (int X = 0; X < 50; X++){ Node tempNode = map[Y][X]; if (tempNode != null){ temp[Y][X] = tempNode.getFinalCost();} ...
7c91508d-c68c-487f-a591-7cc9e308867f
0
public void setProcessMode(int processMode) { this.processMode = processMode; }
06a805ac-f174-4960-bad1-36cc2ca7c8ca
7
static final void method872(int i, int i_0_, int i_1_, int i_2_, int i_3_, int i_4_, int i_5_) { anInt1554++; if (i_5_ >= Class369.anInt4960 && (i_4_ ^ 0xffffffff) >= (Class113.anInt1745 ^ 0xffffffff) && Class132.anInt1910 <= i_2_ && (i_3_ ^ 0xffffffff) >= (Class38.anInt513 ^ 0xffffffff)) { if...
27c6a784-5a5e-4a0d-b1ed-47d7a1ea56c4
7
private int combineTestStatus(int beforeMethodStatus, int testMethodStatus, int afterMethodStatus) { int finalStatus = ITestResult.SKIP; if (beforeMethodStatus == ITestResult.SUCCESS && testMethodStatus == ITestResult.SUCCES...
905ed1ef-d5c9-42f1-9dff-ed78b610fd08
7
public void testIteratorPastEnds() { int size = 10; Data[] data = new Data[size]; for ( int i = 0; i < data.length; i++ ) { data[i] = new Data( i ); list.add( data[i] ); } ListIterator<Data> iter = list.listIterator(); Data current = list.getFirst...
bb193097-6e89-425b-be37-cc7809dce9b9
9
@SuppressWarnings("unchecked") public ArrayList<Peer> update(String event, Manager manager) { this.event = event; if(this.event.equals("started")){ try { manager.getUpload(); } catch (IOException e) { this.downloaded = 0; this.uploaded = 0; } } else { manager.setDownloadUpload(thi...
dbaca3df-b35a-499c-acf1-5925a3f55433
4
private void answerEquation(){ //Attempt solution int answer; //Parse answerString as an integer try{ answer = Integer.parseInt(answerString); }catch(NumberFormatException nfe){ System.out.println("Please enter valid value."); answer = 0; return; } //If targeting yourself, make the power 0. ...
b6828ac8-e27f-45af-8537-f14836fc578e
9
public void sendFirst() { System.out.println("-- Alice --"); if (MitM) { System.out.println("ACHTUNG: MitM aktiv!!!"); } // fingerprint werte aus datei auslesen fingerprint = new Fingerprint(new File("HashParameter")); // alice wählt p und g und sendet diese an bob getPrimeAndGenerat...
60a9f120-1de6-4f41-966f-edbde9382b40
1
public void visit_i2d(final Instruction inst) { stackHeight -= 1; if (stackHeight < minStackHeight) { minStackHeight = stackHeight; } stackHeight += 2; }
14018685-2454-45f9-9834-efbe7e28e358
6
public void writeBits(int amount, int value) { if (getAccessType() != AccessType.BIT_ACCESS) { throw new IllegalStateException("Illegal access type."); } if (amount < 0 || amount > 32) { throw new IllegalArgumentException("Number of bits must be between 1 and 32 inclusive."); } int bytePos = get...
7b294acb-64a3-44a8-8b2f-199c701c1f15
0
protected Icon getIcon() { java.net.URL url = getClass().getResource("/ICON/state_expander.gif"); return new ImageIcon(url); }
e23ce6a3-4775-46e4-a8fb-53483e3fd286
0
public Adapter(Adaptee adaptee) { this.adaptee = adaptee; }
e7015524-df38-4cc5-945f-94d7f7d61e13
7
public void action_172() throws SemanticError { Identifier id = ControlVariables.identifiers.pop(); String idClassName = id.getClass().getSimpleName(); switch(idClassName){ case "Variable": Variable variable = (Variable) id; if (variable.getType().isEqual(IdType.VECTOR)) throw new SemanticError("veto...
23ec5141-9547-4597-837c-11f1d2f7cd7b
9
private void addRow(Parameter Parameter){ String ParameterName = Parameter.getName(); String ParameterType = Parameter.getType(); String ParameterValue = Parameter.getValue(); boolean isRequired = Parameter.isRequired(); boolean isComplex = Pa...
1b3368d3-7111-4c58-a3ed-fef4c491b5c6
6
public void cadastar(Medico medico) throws Exception{ if(medico.getNome().isEmpty()){ throw new Exception("Nome Invalido !!"); }else{ this.verificarNome(medico.getNome()); } if(medico.getCpf().equals(" . . - ")){ throw new Exception("CPF Invalido...
c61a16c4-eb14-495b-a6a6-d78cbe9515c3
1
private static String converting(String[] end) { String conver = ""; for (int i = 0; i < end.length; i++) { int bin = sumOfArray(sumOfBinaryString(end[i])); conver += Base64.charAt(bin); } return conver; }
03270f61-b888-4fac-aab1-13a9c92602d7
3
@Override public void update() { super.update(); Indicator indicator = null; for (int i = 0; i < indicators.size(); i++) { indicator = indicators.get(i); if (indicator != null) { indicator.update(); if (indicator.isDirty()) { ...
7f3b93ca-c3fb-4c77-905e-08a0dee1ab4c
3
protected TreeNode<K, D> successor(TreeNode<K, D> node) { if (!isNil(node.getRightChild())) { return getMinNode(node.getRightChild()); } TreeNode<K, D> parent = node.getParent(); while (!isNil(parent) && node == parent.getRightChild()) { node = parent; ...
4eaf685b-1668-435a-863a-be7f5be83e67
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...
214edfa7-a84e-442e-a151-c06e061bb66a
7
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { resp.setContentType("text/html"); PrintWriter out = resp.getWriter(); String line = null; StringBuilder sb = new StringBuilder(); StringBuilder alertDiv = new StringBuilder(); String advisory = ""; try { URL url =...
0794eede-ad97-4d00-82b1-8ceb0fb732f2
0
public MyKey(String pankaj) { name = pankaj; }
0bb174d1-234a-4bd9-8b01-bf010432e14c
0
protected <E> void findArray(String fieldName, Collection<E> rtn) throws SQLException { Data._findArray(this.tableName + "_" + fieldName, this.getId(), rtn); }
a66d5fd8-620f-47b2-a077-f42066f110ff
4
public Object nth(int position) { SListNode currentNode; if ((position < 1) || (head == null)) { return null; } else { currentNode = head; while (position > 1) { currentNode = currentNode.next; if (currentNode == null) { return null; } position--;...
519c0d92-b068-4c4d-b1a4-32652dbe7cea
8
public List<Integer> parts(int n) { int aTimesNPlusB = a_Times_n_Plus_b(n); for(int a = 1;a < n+1 || new ArrayList<Integer>().size() == 2; a++ ){ if (a == 1 || isPrime(a)) { if (isPrime(abs(b(n, aTimesNPlusB, a))) && allArePrimes(a, b(n, aTimesNPlusB, a), n)) { return asList(a, b(n, aTimesNPlusB, ...
831d0087-f6c3-4d12-97b6-1eb25fce479f
5
public void loadPropertiesForClasses(LinkedList<String> classes){ try{ Properties props = new Properties(); String softwareProperties = System.getProperty(SOFTWARE_PROPERTIES); props.load(new FileInputStream(softwareProperties != null ? softwareProperties : HARD_CODED_SOFTWAR...
c74f6193-9b7a-48b4-a481-94f04d8a6a84
7
@EventHandler public void SkeletonFireResistance(EntityDamageByEntityEvent event) { Entity e = event.getEntity(); Entity damager = event.getDamager(); String world = e.getWorld().getName(); boolean dodged = false; Random random = new Random(); double randomChance = plugin.getZombieConfig().getDouble("Skele...
2c07eb74-dbf4-444e-b720-a8892e3304f5
9
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Identification that = (Identification) o; if (revision != that.revision) return false; if (!description.equals(that.description)) return false;...
e5e0ef68-17e4-43aa-93a7-ec60fb4c191c
1
public void updateResourceName(String rn) { if (miniMapHUD != null) { miniMapHUD.updateResourceName(rn); } }
83297b36-a22d-4dee-851f-6e6741eea303
7
public AngularBond getBond(Atom a, Atom b, Atom c) { if (isEmpty()) return null; synchronized (bonds) { for (AngularBond x : bonds) { if (x.atom3 == b) { if ((x.atom1 == a && x.atom2 == c) || (x.atom1 == c && x.atom2 == a)) return x; } } } return null; }
91f1ea83-d620-417d-b13d-dd9f99e90cde
0
public static void init() { frame = new JFrame("VillageCraft"); frame.addKeyListener(Listener.universal); frame.addMouseListener(Listener.universal); frame.addMouseMotionListener(Listener.universal); frame.addMouseWheelListener(Listener.universal); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); fra...
2d9d2182-4b41-45d2-b627-a3cbe49d56d3
8
public BFObject getNextFieldObject(int v, int h, Direction direction) { BFObject result = null; switch (direction) { case UP: if (v > 0) { result = getFieldObject(v - 1, h); } break; case DOWN: if (v < 8) { result = getFieldObject(v + 1, h); } break; case LEFT: if (h > 0) { r...
b31d9645-d5b0-473c-9452-33f45d023cf4
2
private void runWork(){ while(this.noStopRequested){ try{ this.idleWorkers.add(this); process(handoffBox.take());//接收数据进行处理 }catch(Exception e){ e.printStackTrace(); } } }
a428c8c9-d546-4fe3-8a81-86a427812ef1
1
public void addDimension(Dimension dim) { dimensions.put(dim.getName(), dim); Object[] o = dimensions.values().toArray(); dimensionArray = new Dimension[dimensions.size()]; for (int i = 0; i < dimensions.size(); i++) { dimensionArray[i] = (Dimension)(o[i]); } }
5e6009d2-b262-423a-8178-00d6239e3c9f
6
public AidyCalender(String title) { super(title); for (int y = 1900; y < 2101; y++) { combo1.addItem(" " + new Integer(y).toString() + "年"); } for (int m = 0; m < 12; m++) { combo2.addItem(" " + stringMonthCn[m]); } buttonToday.setText("今 天"); setLayout(new FlowLayout()); add(panel1); add(pan...
30f56c88-4d30-49a5-a6ef-98f5bae7a52b
8
private void onClickRB(ActionEvent e) throws Exception { cbRoute.removeAllItems(); LinkedList<Route> routes = calculator.getRoutes(); cbRoute.addItem("All"); if(e == null) { for(Route route : routes) { if((route.getType() + "").equalsIgnore...
f57d6646-f1e3-4f15-8307-68028c8cd8ea
8
@Test public void FireWeapons() { ship.setRng(new FixedRandom(0.7)); assertEquals(0, ship.fireGuns(1)); ship.setRng(new FixedRandom(0.5)); assertEquals(3, ship.fireGuns(1)); ship.setRng(new Random()); int hitCount = 0; ...
3d5127ec-dfda-49f8-ae0d-255a0394c3a6
7
@Override public void applyEvidence(Corpus c, int T) { // error-check String doclabelStr = SideInfoType.DOCLABEL.infoName; assert(c.sideInfo.containsKey(doclabelStr)); for(int t : hashSeedTopics) assert(t >= 0 && t < T); // get document labels int[] doclabels = (int[]) c.sideInfo.get(doclabelStr)...
dc3e9cfe-8c95-4274-8c4b-c215f962066b
7
public static String insertRepresentation(String numS, String dateRep, String heureRep) throws BDException, BDExceptionParamError { String requete = null; PreparedStatement stmt = null; Connection conn = null; BDExceptionParamError errors = new BDExceptionParamError() ; String nomSpectacle = null ; try { ...
2915b7fe-cbdd-4ca0-9f51-79769541f97a
2
public static int singleNumberByHashSet(int[] A) { HashSet<Integer> hSet=new HashSet<>(); for(int i=0;i<A.length;i++) { if(hSet.contains(A[i])) hSet.remove(A[i]); else hSet.add(A[i]); } return hSet.iterator().next(); }
ce18c273-b377-4fd1-89d1-968e39f0e54c
7
public void moveRIGHT() { x += Bullet_SPEED; if (x > 1800 || x<1 || y>900 || y<1){ //explode(); visible = false; if(x > 1351 && y>396 && y<600){ GameArea.scoreamount++; } } }
a133877e-a597-4557-b5bf-82a1be878f5c
5
public boolean gameoverBust(Hand hand) { boolean gameOver = true; switch (hand.getOwner()) { case "split": setEnableSplitHand(false); gameOver = false; break; case "dealer": declareWinner(); break; ...
e0e678b5-1eac-4882-940f-83f4f4928c52
0
public void setMarq(int indice, int val){ tabMarq[indice] = val; }
6f830d8b-8588-49e8-84a9-32cdb95e4c76
3
public double[] do300baudFSKHalfSymbolBinRequest (CircularDataBuffer circBuf,int start,int bin0,int bin1) { double vals[]=new double[2]; // Get the data from the circular buffer double samData[]=circBuf.extractDataDouble(start,13); double datar[]=new double[FFT_64_SIZE]; // Run the data through a Blackman win...
e6a1f74f-5dde-45bf-8a3f-dd1864c0d19b
6
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Event other = (Event) obj; if (id == null) { if (other.id != null) ...
dc49f328-9dfe-4c52-bb18-76a84d2f6928
5
public static double evaluateReciprocalRank( HashMap<String, HashMap<Integer,Double>> relevance_judgments, String path){ try { BufferedReader reader = new BufferedReader(new FileReader(path)); int count=0; String readLineString...
20773a8c-30ff-42e9-bbcb-eb586f637976
1
public UserListWindow(ClientGUI inter) { setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { mInterface.exit(); System.exit(0); } }); setBounds(100, 100, 166, 350); contentPane = new JPanel(); contentPane.setB...
43a17581-8d6f-4a61-bac3-49b563a54f45
9
public int theCount(int N, int muddyCount){ int[][][] dp = new int[N][muddyCount+1][3]; dp[0][0][1] = 1; for(int i=0; i<N-1; i++){ int bound = Math.min(i, muddyCount); for(int j=0; j<=bound; j++){ for(int r=0; r<3; r++){ dp[i+1][j][(r+1...
72270568-205b-424e-9a18-1a48e9ffd2bf
3
public static void main(String[] args) throws UnknownHostException, IOException, ParsingException, InterruptedException { MessageFactory factory = new V1MessageFactory(); System.out.println("local protocol: " + VersionMessage.PROTOCOL_VERSION); Socket s = new Socket("141.134.180.7", 8444); InputStream in = s...
4abd0810-ea48-4e2b-8cc4-ed9f241b534d
4
public synchronized ValidationMessage[] validate(String prefix, String uri, PageData page) { try { this.uri = uri; // initialize messageVector = new Vector(); // save the prefix this.prefix = prefix; // parse parameters if nec...
3909edd0-9e6b-43b2-836c-792d7254477a
9
private void preparePlayer() { if (m_timing) { m_timer = new Timer(1000, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { ((TimerLabel)lblClock0).tick(); } }); m_timer.start(); ...
82260a68-9055-4a83-b6d8-5e39595a83c4
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...
4caca9f6-3b55-4a51-9915-6e3267b9a7b5
0
public String getQuery() { return this.query; }
6c97a04c-cf15-4a8e-a643-3aedb43e9570
0
protected void refreshTitle() { String title = DEFAULT_TITLE + " : " + getDescription(); setTitle(title); }
b08ffa86-fd6f-4f78-acf8-4de0ea60396c
4
public final void normalise() { float m = getMagnitude(); if (m <= Utility.nearZero) m = 1; x /= m; y /= m; z /= m; if (Math.abs(x) < Utility.nearZero) x = 0.0f; if (Math.abs(y) < Utility.nearZero) y = 0.0f; if (Math.abs(z) < Utility.nearZero) z = 0.0f; }
0e18ad69-f31f-4015-81fb-6b463835c8e7
9
public static boolean isQname(String s) { int len = s.length(); if (len == 0) return false; if (!isNameStartCharNs(s.charAt(0))) return false; for (int i = 1; i < len; i++) { char c = s.charAt(i); if (!isNameChar(c)) { if (c == ':' && ++i < len && isNameStartCharNs(s.char...
ee867784-4703-41c6-aa01-3d2f23b641e6
9
public String nextToken() throws JSONException { char c; char q; StringBuffer sb = new StringBuffer(); do { c = next(); } while (Character.isWhitespace(c)); if (c == '"' || c == '\'') { q = c; for (;;) { c = next(); ...
c7a262a7-a34b-4da8-b3f2-13052954e66b
5
public void executeLastCommandBeforeLogin() { try { this.getClass().getMethod(this.lastCommandBeforeLogin, new Class[] {MenuItem.class}).invoke(this, this.lastCommandParams.toArray()); lastCommandBeforeLogin = null; lastCommandParams.clear(); } catch (SecurityException e) { e.printStackTrace(); } catc...
6608a3ad-93d4-4502-be9e-ba94495efc3a
7
public int getSample() { if (!enabled) return 0; // Decrement Counter counter -= psg_cycles; // Counter Expired if (counter < 0) { // Toggle Amplitude Flip Flop amplitude_flipflop = !amplitude_flipflop;; // Update Frequency from ...
d3e81b06-bdd5-4e2c-9864-c721b4d46417
4
private Node parseAdditive() throws ScriptException { Node left = parseMultiplicative(); if (left == null) return null; Token token; while ((token = analyzer.getNextToken()) != null) { if (token.getType() != Operators.ADD && token.getType() != ...
a5715d4c-6d9c-493a-9551-db67a935658c
4
public int stackSize() { switch (typecode) { case TC_VOID: return 0; case TC_ERROR: default: return 1; case TC_DOUBLE: case TC_LONG: return 2; } }
621a83de-fd5b-4b94-8c3b-629bef77eab8
3
public HighScoreView(TetrisWorld tw) { myWorld = tw; myWorld.addObserver(this); this.setLayout(new GridLayout(6, 1)); this.setBackground(Color.DARK_GRAY); try { highScoreFile = new File("." + File.separator + "TetrisGA.txt"); highScoreFile.createNewFile(); highScoreReader = new BufferedReader(new F...
71ad658f-a28e-4f4c-ae7e-4932c085e56c
4
public Method findGetMethod(Field field) { if(field == null) return null; if(getFieldDetailStore().isGetMethodPresentFor(field)) { return getFieldDetailStore().getMethodOf(field); } String getterName = createMethodName("get", field.getName());...
2e9ed9e2-0bf8-4f46-8ca4-497db0a60086
8
public WorkLocation getCorrespondingWorkLocation(WorkLocation wl) { Colony original = wl.getColony(); // Insist that this is a scratch colony, and the work location // is in the original or vice versa. if (getName().equals("scratch" + original.getName()) || original.getName()...
1f213cf1-1b8c-42be-838f-ae50b37cc3b5
7
public synchronized void deleteDrawFile() { if (useable.get() == false) { return; } // checkUseable(); final int count = useCounter.addAndGet(-1); if (count == 0) { if (cached && isCacheTooBig() == false) { return; } synchronized (toDelete) { deleteNow(); if (cached) { final boole...
b2c0ecfd-a481-46ea-a0f3-d462c7a5785d
2
public void render(IRenderContext target, SpriteSheet font, double offsetX, double offsetY, double scale, Color selectionColor, Color fontColor) { double y = offsetY; for (int i = 0; i < options.length; i++) { Color color = i == selectionIndex ? selectionColor : fontColor; y = target.drawString(options[i],...
25faeb0c-7925-4fbc-a008-5d557c293600
7
public static String getInputStr(String strType, boolean checkFlag){ String readLine = readInput(); if(checkFlag){ if(strType.equals(CoreyangHelper.INPUT_TYPE_FILE)){ //check路径类型 if(filePathPreProc(readLine)){ return readLine; }else{ System.out.println("路径输入有误,请重新输入:"); return getInput...
0b250981-eb32-4914-a5f4-820269f7473b
9
private void recalculate(AZeit zeit, ZeitPunktResult r) { AZeit gesamtZeit=startZeit.vonNach(zeit);; char kontoVeraenderungPrefix; AZeit kontoveraenderung; AZeit restZeit; Config.ZeitAbschnitt[] a = Config.getAbschnitte(); AZeit produktivZeit=new Zeit(0); AZeit pausenZeit=new Zeit(0); Zeit abschnittEn...
cba67c5b-5763-4646-b20b-0ba25a11626e
9
public void renderInventory(Graphics g) { g.setColor(Color.black); g.fillRect(inv_window_start, 0, 226, 600); g.setColor(Color.red); g.fillArc(inv_window_start, 0, 226, 140, 0, 360); //create armor inventory int next = 0; for(int y = 0; y < arm_...
8b75e868-c237-4405-87d5-ba822baf9ad3
7
@Override public boolean equals(Object o){ if(o instanceof Pair){ Pair<?, ?> p = (Pair<?, ?>) o; if(getValueOne().equals(p.getValueOne()) && getValueTwo().equals(p.getValueTwo())){ return true; } } return false; }
0d3bbe2f-f295-4463-8a05-d6e09c1fda92
3
public boolean criarLinhaVenda(Produto p, double quantidade, double desconto) throws ExceptionGerenteVendas { if (p != null && quantidade > 0 && desconto >= 0) { LinhaVenda lv = new LinhaVenda(); lv.setNomeProduto(p.getNome()); lv.setValorProduto(p.getValordeVenda()); ...
689f12d0-2c42-476a-bbd8-48bb822eeb1f
9
public void loadBlackjackData(File file) { this.tablesConfig = YamlConfiguration.loadConfiguration(file); ConfigurationSection tablesSection = this.tablesConfig.getConfigurationSection("tables"); try { Set<String> tables = tablesSection.getKeys(false); if (tables == null) { return; } for (Stri...
95144540-c8ab-40b7-b9e6-8d29000e1f29
3
public List<Monster> zoekAlleMonsters() { List<Monster> monsters = new ArrayList<>(); try (Connection conn = DriverManager.getConnection(JDBC_URL)) { PreparedStatement queryAlleMonsters = conn.prepareStatement("SELECT * FROM MONSTER"); try (ResultSet rs = queryAlleMonsters.e...
2766bae5-b432-4922-8c79-cdff1cd51c35
7
public String getToolTipText(MouseEvent e) { // Check parsers for tool tips first. String text = null; URL imageBase = null; if (parserManager!=null) { ToolTipInfo info = parserManager.getToolTipText(e); if (info!=null) { // Should always be true text = info.getToolTipText(); // May be null image...
334f4589-b390-43f5-bcc3-f822decce7d6
1
public void fireAttributesVisibilityChangedEvent(OutlinerDocument doc) { attributesVisibilityChangedEvent.setOutlinerDocument(doc); for (int i = 0, limit = outlinerDocumentListeners.size(); i < limit; i++) { ((OutlinerDocumentListener) outlinerDocumentListeners.get(i)).attributesVisibilityChanged(attributesVisib...
abcd32e7-6a62-4ba1-b445-6b8965f73f09
3
public static String formatOutputName(String fileName, String prefix, boolean gzipped) { String rgx = "^.*\\.[tar\\.]?gz$"; boolean hasGzip = Pattern.matches(rgx, fileName); fileName = (gzipped && !hasGzip) ? String.format("%s%s", fileName, GZIP_EXT) : fileName.replaceAll("\\.tar\\.gz$", GZIP_EXT); in...
d828b300-3504-46bd-bea3-f57e82a9ba88
6
public boolean compareId(Object o) { if (o == null) return false; //if (!o.modelImplementation().equals(type)) return false; String id = factory.getCache().getModelId(type); Class idType = factory.getCache().getModelIdType(type); if (!o.getClass().equals(idType)) return false; if (idType == I...
b5f94cc4-79ee-46ed-8f88-c653f1e50ef5
5
private void getNode(NodeList nodeList, List<String> path, int pathDepth) throws XmlPathNotFoundException { for (int i = 0; i < nodeList.getLength(); i += 1) { Node node = nodeList.item(i); // get rid of {enter}, the empty node if (node.getNodeType() != Node.ELEME...
f68689f7-47a1-4487-b98e-36314b3aa855
0
public void setNote(String note) { this.note = note; }
60190160-4f91-4c27-b92a-dc33f678e534
4
public HsqlCharacterDao(HsqlUnitOfWork uow) { super(uow); try { Connection connection = uow.getConnection(); stmt = connection.createStatement(); ResultSet rs = connection.getMetaData().getTables(null, null, null, null); boolean exists = false; while(rs.next()) { if("product".equalsIg...