method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
5d8c9c53-51a0-4090-9e64-18e9188d91fe
2
@Override public String execute(SessionRequestContent request) throws ServletLogicException { String page; User user = (User) request.getSessionAttribute(JSP_USER); if (user != null && clientTypeOf(user.getRole().getRoleName()) != GUEST) { page = ConfigurationManager.getProperty(...
2f0dafea-a749-4dc7-8c1d-01a4008484f5
5
private void btnCadastrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCadastrarActionPerformed // TODO add your handling code here: if ((fieldNome.getText().equals(""))||(fieldQuant.getText().equals(""))||(fieldDesc.getText().equals(""))) { JOptionPane.showMessageD...
22115824-c13d-4118-a79c-66b2c30283ad
3
private static void ajouterAction(Action action) { if (action.type() == null) return; switch (action.type()) { case Get: actionsGet.put(action.pattern(), action); break; case Post: actionsPost.put(action.pattern(), actio...
cf716a42-1894-460a-9924-3c11755e998c
8
public static final TokenStream tokenize(String data) { TokenStream tokenStream = new TokenStream(); try { int pos = 0; int startBrace = -1; int endBrace = -1; while((startBrace = data.indexOf("{{", pos)) != -1) { // Get text between braces if (pos < startBrace) { String text = dat...
814e00fd-ae10-4da9-b9a9-1aca327817c3
9
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Rover other = (Rover) obj; if (coordinate == null) { if (other.coordinate != null) return false; } else if (!coordinate.equals(other.coo...
10755fef-38b2-40b6-bfa2-75cd041de717
0
public void setMaxV(int a){ maxVelocity = a; }
cb328d51-9922-49b3-a66f-6f607629b3e2
0
public void setDirected(boolean directed) { this.directed = directed; }
19f04ce7-f31b-4ce3-94d4-f1311f5cb8b6
2
public final void setPerms(ChunkyObject object, HashMap<PermissionFlag, Boolean> flags) { if (flags == null) { ChunkyManager.getPermissions(object, this).clearFlags(); DatabaseManager.getDatabase().removePermissions(object, this); return; } PermissionRelation...
8c2ea251-faf2-45b8-8bca-c0f756edabdd
9
private static int pos_neg_flat(int[] seq, int start, int type) { if (start > seq.length -2) return -1; int cd = seq[start+1] - seq[start]; if (type == 1 && cd <= 0) return -1; // positive if (type == 2 && cd >= 0) return -1; // negative if (type == 3 && cd != 0) return start; // flat int i = start+1; w...
34e31b34-d89a-4c92-b38b-cbf191ba8434
1
public static long toLong(double raw) { return (long) (raw > 0 ? raw + 0.00000001 : raw - 0.00000001); }
24aed2d8-3bb6-4945-aa5d-902c3957cf62
5
public PrivateKey decodePrivateKey(byte[] k) { // magic if (k[0] != Registry.MAGIC_RAW_DH_PRIVATE_KEY[0] || k[1] != Registry.MAGIC_RAW_DH_PRIVATE_KEY[1] || k[2] != Registry.MAGIC_RAW_DH_PRIVATE_KEY[2] || k[3] != Registry.MAGIC_RAW_DH_PRIVATE_KEY[3]) { throw new IllegalArgume...
0cf4ef81-9de6-4593-8344-a7a3604cc3a3
8
public void updateEditablilty(boolean editable){ this.editable = editable; for (Component comp : this.getComponents()) { if (comp instanceof RTextScrollPane) { RTextArea textArea = ((RTextScrollPane) comp).getTextArea(); if(textArea != null){ textArea.setEditable(editable); } } } for(int ...
6d386623-3397-4967-81ec-6e766667d14a
5
public static void movingperson()//old code, not used now { Point t = new Point(); t=personCell.getLocation(); double x = Math.random(); double y = Math.random(); System.out.println(x); if(x<0.3) { t.y=t.y+10; }//down else { //t.y=t.y-10; } ...
727e4d11-d62a-4fdc-9b8d-b1dc5acccafa
6
public void update(float dt) { //if(Input.GetSingleton().GetButtonState("camera", "active") != Input.ButtonState.ON) return; /* pan_dir = (Input.GetSingleton().GetAxisState("camera", "look_pan_up") - Input.GetSingleton().GetAxisState("camera", "look_pan_down")); tilt_dir = (Input.GetSingleton().GetAxisState(...
04b0b2c3-4d7b-4852-adea-e1f545d79e28
1
public String toString(){ String str = item.toString(); VariableList itemsList = this.items; if(itemsList != null) str = str + "," + itemsList.toString(); return str; }
4b3cc7d1-fbbd-494d-8bbc-b82d27f7ee5c
2
public static void main(String args[]) { int a=0, b=0, c=0; Random r = new Random(); for(int i=0; i<32000; i++) { try { b = r.nextInt(); c = r.nextInt(); a = 12345 / (b/c); } catch (ArithmeticException e) { System.out.println("Division by zero."); ...
7ce65b60-8516-4039-b235-8b321289b6fa
8
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof Sector91Version)) return false; Sector91Version other = (Sector91Version)obj; if (majorVersion() != other.majorVersion()) return false; if (...
8a97b779-eb88-4318-88f5-667bf6947637
1
public void startSQL() { try { InputStream in = this.getClass().getResourceAsStream("/sols/Util/jdbc.properties"); Properties pp = new Properties(); pp.load(in); url = pp.getProperty("jdbc.url"); user = pp.getProperty("jdbc.username"); pas...
b4141dcd-cb93-40bf-995c-457d99f00abd
8
public void click(int x, int y)//炸彈: 爆炸| 土地 0擴散 1~8不擴散 { if(map[x][y])//炸彈 { freshMessage("踩到地雷! 爆炸!"); buttons[x][y].setBackground(Color.RED); gameOver = true; return ; } else if(aroundBombNum[x][y]!=0) { tu...
ced3f427-20ef-496d-b5ff-470bcf1a38b1
6
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Level other = (Level) obj; if (name == null) { if (other.name != null) ...
26fdb871-b77b-415a-be05-fd17e8885f08
5
public List<WeightedEdge<N, Number>> findPath(IWeightedGraph<N, Number> graph, N source, N target, N current, LinkedList<WeightedEdge<N, Number>> path) { if(current == target) { return path; } else { List<WeightedEdge<N, Number>> edges = graph.edgesFrom(current); for(WeightedEdge<N, Number> edge : edges) {...
b15863fd-dd87-4d84-9050-8216cb91db21
1
@Override public boolean equals(Object obj) { if (obj instanceof Organism) { return this.getOrganism_id() == ((Organism) obj).getOrganism_id(); } return false; }
f19fdf0a-22ab-4c59-a297-d9edbb4409ba
2
public Blocker(TileMap tm) { super(tm); moveSpeed = 1.5; maxSpeed = 1.6; fallSpeed = 1.0; maxFallSpeed = 4.0; width = 30; height = 30; cwidth = 20; cheight = 20; health = maxHealth = 500; damage = 100; try { BufferedImage spritesheet = ImageIO.read(getClass().getResourceAsStream("/Sprites...
6fed8e01-3091-44be-bac3-ab7a9aeeede5
4
private void jList1ValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_jList1ValueChanged if (debug && jList1.getSelectedValue() != null) logger.log(level.DEBUG, "New device selected: " + jList1.getSelectedValue().toString()); if (jList1.getSelectedIndex() != -1 || jLis...
c25dffcf-a096-41da-bde1-e3109f0a248d
0
public int getAge() { return Age; }
2a9eb2f3-a668-4de5-a03f-e29451c9acd3
6
public static ArticleModel buildArticleModelFromVars(String[] vars, String url) { ArticleModel article = new ArticleModel(); article.setHref(url); for (int i = 0; i < vars.length; i++) { String[] var = vars[i].split("="); if (var[0].equals("msg_title")) article.setTitle(...
276513ce-0544-44c1-bbe8-8f68a05ca775
2
public static boolean isNumero(String valor) { final String NUMEROS = "0123456789"; for (int i = 0; i < valor.length(); i++) { char caracter = valor.charAt(i); if (NUMEROS.indexOf(caracter) == -1) { return false; } } return true; ...
e437234b-b457-4679-8874-0affc9d2f6bc
7
static void optimize(final File f, final File d, final Remapper remapper) throws IOException { if (f.isDirectory()) { File[] files = f.listFiles(); for (int i = 0; i < files.length; ++i) { optimize(files[i], d, remapper); } } else if (f.getName().endsWith(".class")) { ConstantPool cp = new Consta...
a48175ed-f85e-450a-89aa-9c417452c356
1
public byte update(int Delta) { byte r = super.update(Delta); try { Collision(); } catch(NullPointerException e) { e.printStackTrace(); } return r; }
7c92826e-e252-4a2a-bfd5-e781df17274a
8
@Override public int getMaxStartFloor(int direction) { int temp = 0; if(direction == -1) temp = this.getFloors(); //set top floor to count down from. for(Customer cust : this.getCustomerList()){ //only count customers that are still active and not already in elevator if(!cust.getFinished() && !cust.getI...
b32bb015-457b-450b-b17e-e6a0c2d93911
0
@FXML private void handleBtnNextAction(ActionEvent event) { move(1); }
41f8ed29-b45b-494a-a6e0-bea4fce38697
2
public void visitStackExpr(final StackExpr expr) { print("S" + expr.type().shortName().toLowerCase() + expr.index()); final DefExpr def = expr.def(); if ((def == null) || (def.version() == -1)) { print("_undef"); } else { print("_" + def.version()); } }
36e0b739-bfb1-4364-babb-a79d3530e975
4
public String toString() { String returnString = leftToken.getValue() + " -> "; for(int i = 0; i < tokens.length; i++) { if(tokens.length > 0) { if(i == position) { returnString += " . " + tokens[i].getValue(); } else { returnString += " " + tokens[i].getValue(); } } ...
6f4ba727-c779-4334-9259-346f8148e808
1
int addNamedParameter(Set<String> namedParameters, String parameter, int namedParameterCount) { if (!namedParameters.contains(parameter)) { namedParameters.add(parameter); namedParameterCount++; } return namedParameterCount; }
8e985d58-3b37-4661-8394-3db3294da661
2
@Override public URI getResourceIdentity() { String actualName = name(); if(!StringUtils.isBlank(actualName) && !actualName.equals("/")){ actualName = "." + actualName; } String uri = context() + "/" + fragment() + actualName; return URI.create(uri.replace(" ", "%20")); }
153d0afe-bbaa-4190-ad61-929efcfae914
8
private boolean isCastlingPossible(Position gonnaMovePos, int baseYPos, int direction){ Position rookInitPos = (direction == 1) ? new Position(7, baseYPos) : new Position(0, baseYPos); Position palace = (direction == 1) ? new Position(5, baseYPos) : new Position(1, baseYPos); if(Board.chessBoard.containsKey(rook...
bf0f0679-1184-4454-bcca-59bb1e76d730
9
static String toPostfix(String infix) { StringTokenizer s = new StringTokenizer(infix); String symbol, postfix = ""; while (s.hasMoreTokens()) { symbol = s.nextToken(); if (Character.isDigit(symbol.charAt(0))) postfix = postfix + " " + (Integer.parseInt(symbol)); else if (symbol.equals("(")) { C...
1f31aa2a-d4d3-454f-8fe1-aab53669e42a
1
public Bookmark save(Bookmark bookmark) { if (bookmark == null) { logger.error("Can not save null object."); } return bookmarkRepository.save(bookmark); }
4b05ec3d-5253-4959-b09d-315b7c486138
5
private static void updateSizes(int index, int cur, int[] curArray, int min, int[] minArray, int max, int[] maxArray) { if (min > minArray[index]) { minArray[index] = min; } if (max < maxArray[index]) { maxArray[index] = max; } if (cur > curArray[index]) { curArray[index] = cur; } if (curArray[in...
4f22ff48-3abe-4d49-8008-6aca0ac86860
1
private JTextField getTxFieldSongName() { if (txFieldSongName == null) { txFieldSongName = new JTextField(); txFieldSongName.setText("Not afraid"); txFieldSongName.setBounds(10, 106, 86, 20); txFieldSongName.setColumns(10); } return txFieldSongName; }
0c0e1186-a293-4f35-96ee-68713c60beb7
7
private JsonValue<?> value() { switch(currTok.getType()) { case STR: JsonStr str = new JsonStr(currTok.getContents()); match(STR); return str; case NUM: JsonNumber num = new JsonNumber(currTok.getContents()); ...
946710e1-a82c-4d99-a92e-45a5d25a105e
0
public void mouseDragged(MouseEvent e) // not used { }
d97203d3-00e7-4a0c-84b7-3d3eab83cdb0
8
public static int updateIntoAdsInfo(int gid) { int result = gid; Connection con = DBUtil.getConnection(); PreparedStatement pstmt = null; ResultSet rs = null; try { pstmt = con.prepareStatement("select * from mstx_ads where gid=?"); pstmt.setInt(1, gid); rs = pstmt.executeQuery();// 查询 if (!rs.nex...
82b72b7d-abfb-4aab-a302-243335829c1a
7
public Object getValueAt(int rowIndex, int columnIndex) { MagnetURI magnetLink = m_entityList.get(rowIndex); try { switch (columnIndex) { case COL_HASH: return magnetLink.getBtih(); case COL_TITLE: return magnetLink.getDisplayName(); case COL_SEED:...
e0461c24-81f6-4562-a3ef-95c9c0517e0f
9
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (!sender.hasPermission("minipython.admin")) { sender.sendMessage(ChatColor.RED + "You do not have permission to use this command."); return true; } if (args.length == 0) { ...
d47ea123-2bb1-4d1c-8507-6d3794ae79bd
6
private void closeResources(Connection conn, Statement st, ResultSet rs) { if (null != rs) { try { rs.close(); } catch (SQLException e) { } } if (null != st) { try { st.close(); } catch (SQLException e) { } } if (null != conn) { try { conn.close(); } catch (SQLException e) ...
080e89d8-e475-404a-ae3d-84a26466d2e5
5
public String averageMood() { String mood = new String(); SortedMap<String,Integer> moods = new TreeMap<String,Integer>(); SortedMap<Integer,String> moods_ordered = new TreeMap<Integer,String>(); Iterator<?> iterator = resultlist.iterator(); while(iterator.hasNext()) { IResultSet temp_res = (IResultSet)...
4d9db619-8db3-4903-8a35-1458f843dc3b
6
@EventHandler public void SnowmanHunger(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.getsnowgolemConfig().getDouble("Snowman.Hun...
0387801d-046e-4cfa-9c0d-a39d63e313e0
9
private boolean buildFriendsListMenu(RSInterface class9) { int i = class9.contentType; if(i >= 1 && i <= 200 || i >= 701 && i <= 900) { if(i >= 801) i -= 701; else if(i >= 701) i -= 601; else if(i >= 101) i -= 101; else i--; menuActionName[menuActionRow] = "Remove @whi@" + fr...
81ca7486-5b23-40b8-9b9b-b337b2c360a7
6
public void result(){ if((house.isBusted()|| player.getHandValue()>house.getHandValue()) &&!player.isBusted()) player.win(); else if(player.isBusted()|| !house.isBusted()&& player.getHandValue()<house.getHandValue()) player.lose(); else player.push(); }
786c6142-7659-493b-bb45-4beee522c1dd
6
public Boolean singleRotation(privAVLNode r,int dir) { //Check valid inputs if(!(dir == 1 || dir == 0)) return false; if(r == null) return false; privAVLNode save = r.getChild(dir); if(save == null) return false; //Preform rotation save.setParent(r.getParent()); if(save.getChild((...
7bd556b5-e5a5-46f9-9e60-f1f1cd145ca6
5
public ArrayList<MailMessage> getMailNotifications(List<TimeAlarm> mailAlarm, String UserId) throws ExecutionException { HashMap<String, ArrayList<TimeAlarm>> buffer = new HashMap<String, ArrayList<TimeAlarm>>(); ArrayList<MailMessage> listOfMsg = new ArrayList<MailMessage>(); //ordenamo...
ce7280c4-cf03-4e07-85a8-ac4ed2c8a9a2
9
private void writeObject(ObjectOutputStream out) throws IOException { // -- Create a serializable form of the RenderingHints object. -- // Create an empty Hashtable. Hashtable table = new Hashtable(); // If there are hints, add them to the table. if(hints != null && !hints.isEm...
44ecc14f-57e3-4d98-b9d4-b85a6c7fdd0b
2
public void addRoom(Room room) { if (room == null) { throw new NullObjectInsertionException(); } if (existRoom(room)) { throw new DuplicateInsertionException(); } rooms.add(room); }
8d727f57-a5bb-472e-a297-3a168e484bda
0
public String toCSV() { return super.toCSV(); }
c4d68dc5-093d-4e7b-abeb-bfdc1a110732
3
@Override public void decode(final ByteBuffer buf, final int available, final StringBuilder log) throws Exception { // Decode reply to ListServices final int count = buf.getShort(); if (log != null) { log.append("ListServices Reply\n"); log.append("UINT count : ").append(count).append("\n"); } ...
0eb10a3a-a297-4010-93c9-5f85c0abd615
1
public void remover(AreaFormacao areaformacao) throws Exception { String sql = "DELETE FROM areaformacao WHERE id = ?"; try { PreparedStatement stmt = ConnectionFactory.getConnection().prepareStatement(sql); stmt.setLong(1, areaformacao.getId()); stmt.executeUpdate(); } catch (SQLException e) { ...
241f18fa-aa4b-428d-8931-621bb176a1fd
9
public void render() { //storing the next rendered screen bs = getBufferStrategy(); if(bs == null)//so we don't create BufferStrategy every time we render { //buffers the next 3 renders createBufferStrategy(3); return; } screen.clear();//clears the previous pixels double xScroll = player.getPo...
4b31661c-e525-4bb4-898c-139866060b73
7
protected void LoadJsonDoc(String filename) { _Product prod = null; JSONArray jarray = null; try { JSONObject json = LoadJSON(filename); prod = new _Product(json.getJSONObject("ProductInfo")); jarray = json.getJSONArray("Reviews"); } catch (Exception e) { System.err.print('X');//fail to parse a j...
5efa8993-d180-480b-bb91-67fb0bedcc7e
7
*/ private JTable createRecListTable() { recSorter = new TableSorter(new DefaultTableModel(), specData); JTable t = new JTable(recSorter) { @Override public boolean isCellEditable(int row, int column) { super.isCellEditable(row, column); // セル編集を不可とする return false; } @Override pub...
016dc3e9-f578-44ed-a2ba-dd9f463d911d
6
public void run() { int n = players.size(); double[][] wins = new double[n][n]; for (int b = 0; b < players.size(); b++) { for (int w = 0; w < players.size(); w++) { if (b != w) { for (int game = 0; game < GAMES_PER_CONDITION; game++) { double result = playGame(players.get(b), players.get(w)); ...
edfe4014-4145-4bad-9d75-82def9a384c4
0
@Test public void testFromInternalTestLinkIdWithoutTrailingSlash() { final TestLinkUriResolver resolver = new TestLinkUriResolver(URI.create("http://testlink.sourceforge.net/demo")); final URI actual = resolver.fromTestLinkId(testLinkId); assertEquals(expectedUri, actual); }
fac0030a-8261-4f70-bef2-5de3d941456c
1
private void addDirectoryActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addDirectoryActionPerformed if (addDirectoryChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) { controller.getModel().getFilesToInclude().add(addDirectoryChooser.getSelectedFile()); updateView(); } }//...
2a3cb141-055b-4529-beb7-40564bb21cf1
9
protected int diff_commonOverlap(String text1, String text2) { // Cache the text lengths to prevent multiple calls. int text1_length = text1.length(); int text2_length = text2.length(); // Eliminate the null case. if (text1_length == 0 || text2_length == 0) { return 0; } // Truncate th...
e2a4eaab-b5a8-4de6-8036-7e535aa201c6
0
@Override public String toString() { return version; }
655244c7-8dd7-4178-96f0-0163def2138c
0
public void setTxtAdrs(JTextField txtAdrs) { this.txtAdrs = txtAdrs; }
de559526-07ca-468f-bf30-ca1a725765a6
3
public static void main(String[] args) { initializePrototypes(); Object[] objects = new Object[9]; int total = 0; for (String arg : args) { objects[total] = PrototypesModule.findAndClone(arg); if (objects[total] != null) { total++; } ...
1dae0628-14d4-46ac-aec9-5e260663f700
0
public static <T> void swapHelper(Pair<T> p) { T t = p.getFirst(); p.setFirst(p.getSecond()); p.setSecond(t); }
0214fc45-7352-4861-b3bc-1157bd95d881
3
public void printLevelOrder() { AVLtree AVLtree = this; LinkedList list = new LinkedList(AVLtree.getRoot()); Node nykyinen = list.getHeadNode(); while (list.getSize() != 0) { System.out.println(list.getHeadKey()); // Jos jonon päällä on vasen lapsi, laitetaan se j...
dc6ca798-4ff7-482b-aed7-c3408eed85d6
5
public void handleKeyPress(int value) { System.out.println("Keyboard key " + value + " was pressed."); switch(value) { case MinuetoKeyboard.KEY_Q: System.exit(0); break; case MinuetoKeyboard.KEY_W: window.setCursorVisible(true); break; case MinuetoKeyboard.KEY_E: window.setCurs...
02d1cb87-5312-42fa-ad94-def39ebc09e7
3
private void parse(String filename){ try { // use the default parser SAXParserFactory factory = SAXParserFactory.newInstance(); SAXParser saxParser = factory.newSAXParser(); // parse the input saxParser.parse(filename, this); } catch (ParserConfigurationException pce) { pce.printStackTrac...
bbfa62a0-e871-4533-a78b-048579677916
3
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } EntityAbstract other = (EntityAbstract) obj; return Objects.equal(this.id, other.id); }
2c4221dd-b243-40cc-87e8-0d23dbc42316
1
@Override public String toString () { if ( !isBound() ) return "AFUNIXServerSocket[unbound]"; return "AFUNIXServerSocket[" + this.boundEndpoint.getSocketFile() + "]"; }
20330bee-bd02-4100-8f5c-b427fbfbc228
9
public String typeString() { switch (options.type) { case ZMQ.ZMQ_PAIR: return "PAIR"; case ZMQ.ZMQ_PUB: return "PUB"; case ZMQ.ZMQ_SUB: return "SUB"; case ZMQ.ZMQ_REQ: return "REQ"; case ZMQ.ZMQ_REP: return "REP...
29c2cbf0-03f7-42b1-86df-76f449d300a5
5
public void printFields(Class<?> c){ Field[] declaredfields = c.getDeclaredFields(); Field[] fields = c.getFields(); ArrayList<Field> fieldList = new ArrayList<Field>(fields.length); for(int i = 0; i < fields.length; i++){ fieldList.add(fields[i]); } for(int i = 0; i < declaredfields.length; i++){ if...
e4479646-0157-4bb5-9ef2-d471084ef033
4
public Image[] getCells(ImageRetriever paramImageRetriever, int paramInt1, int paramInt2) { Integer localInteger = new Integer(paramInt1); if (animationList == null) animationList = new Hashtable(); Object localObject = animationList.get(localInteger); Image[] arrayOfImage; if (localObject =...
55f8a340-2d22-410f-afb4-1a39daeb506a
0
void forward(int velocity) { }
3d82e5e8-0535-4201-a705-ced41cb8bb96
0
public boolean hasNext() { return this.enumeration.hasMoreElements(); }
3f1833b9-b467-4e07-951e-1f660aa441b3
8
public static boolean createOrders(List<OrderInfo> orders, int eventId, int userId) throws HibernateException { boolean isCreateOrdersSuccessful = false; Session session = HibernateUtil.getSessionFactory().getCurrentSession(); try { // Begin unit of work session.beginTransaction(); Calendar calendar ...
b2a34db6-63b6-4306-8e26-cfd56fefc3be
9
* @throws IOException if there is an I/O error. * @throws ClassNotFoundException if there is a classpath problem. */ private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); this.domainGridlineStroke = SerialUtili...
ea36fb93-79fa-4bfc-924a-925566d34a6f
8
public static int getEventCreatorIndexOfStat(String statKey) { //Marks, Percep, Tact, Loyal, Agi, Str, Dip, Know switch(statKey) { case MARKSMANSHIP_KEY: return 0; case PERCEPTION_KEY: return 1; case TACTICS_KEY: return 2; case LOYALTY_KEY: return 3; case AGILITY_KEY: return 4; case STRENGTH_KEY: ...
002f5ded-5825-42ba-af1f-e278958c0fba
7
public void connect(TreeLinkNode node){ if(node == null) return; TreeLinkNode p = node.next; while(p != null){ if(p.left != null) { p = p.left; break; } if(p.right != null) { p = p.right; ...
5fd77ea6-7630-403b-b8fc-194b880ddcf9
2
public static TrafficRestrictionTypeEnum fromValue(String v) { for (TrafficRestrictionTypeEnum c: TrafficRestrictionTypeEnum.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); }
d6e94ad9-7e2e-4937-ae8e-eb0d8da6c097
3
public final EsperParser.forgap_return forgap() throws RecognitionException { EsperParser.forgap_return retval = new EsperParser.forgap_return(); retval.start = input.LT(1); Object root_0 = null; Token set50=null; EsperParser.factor_return factor51 =null; EsperParser....
fc2c2de9-8d26-4ab2-8df5-f29c0b2c2b7e
4
public void select(String target, String source, String criteria, String order) { try { Statement s = connection.createStatement(); String ordering = ""; if (!order.isEmpty()) ordering = " Order By " + order; if (criteria.isEmpty()) s.execute("Select " + target + " From " ...
3aa56c37-e8cf-4c1b-84ca-f7e43c7eca00
8
public static boolean fileprocess(String downloadpath, String filepath, String sn){ int errorcode=0;// print error code in the final output file; int errornum=2; // feature number String result="",mac=""; File downloadfile_r = new File(downloadpath+"\\mac.txt"); File outputfile = new Fi...
c30900cf-7cfe-4514-92c2-353f6f7c6e01
7
public ArrayList loadLevel(Image bbi, Image sbi,Image tbi, Image bli, int num) { levelNumber = num; for (int i = 0; i < level[num].length(); i++) { char item = level[num].charAt(i); if (item == '\n') { by += 50; bx = 0; } else if (item == '#') { blocks.add(new B...
3c7008ca-ad51-4c26-8b7d-cef9ab9cd9f9
7
public HGSearchResult<?> execute() { HGSearchResult<?> leftResult = left.execute(); HGSearchResult<?> rightResult = right.execute(); if (!leftResult.hasNext() && !rightResult.hasNext()) { leftResult.close(); rightResult.close(); return HGSearchResult.EMPTY; } else if (!leftResult.hasNext()) { ...
71e6112b-105e-4c58-8a9d-1616f4419d7a
2
@Override public void keyReleased(KeyEvent e) { int code = e.getKeyCode(); if (code>0 && code<keys.length) { keys[code] = false; } }
282d6977-7bf2-48f9-a9ec-ee3188966720
0
protected Statistic(Initialization initialization) { this.initialization = initialization; }
56259f7f-bdd5-4f95-b4e5-938adb9ecb5e
4
void createExampleWidgets () { /* Compute the widget style */ int style = getDefaultStyle(); if (balloonButton.getSelection ()) style |= SWT.BALLOON; if (iconErrorButton.getSelection ()) style |= SWT.ICON_ERROR; if (iconInformationButton.getSelection ()) style |= SWT.ICON_INFORMATION; if (iconWarningButt...
476651b2-ca34-4273-adf3-48f2e8a61f8c
6
public Object apply ( String source, int lineNo, int columnNo, Object funcBody, Vector namesVec, Vector argsVec ) throws BSFException { if ( namesVec.size() != argsVec.size() ) throw new BSFException("number of params/names mismatch"); if ( !(funcBody instanceof String) ) throw new BSFException(...
c620749e-bd3d-4969-8f12-64a566cb8daa
5
private boolean checkMask(String passwordMask) { boolean checkPasswordResult = false; for (int i = 0; i < passwordMask.length(); i++) { if (passwordMask.charAt(i) != 'c' && passwordMask.charAt(i) != 'C' && passwordMask.charAt(i) != 'n') { checkPasswordResult = false; ...
699e88d1-8dc8-4da1-ba47-6bfbaacc7069
0
public void setStreetName(String streetName) { this.streetName.set(streetName); }
f1c7518c-57b0-4856-9816-4c61de8959bf
6
private String getMime(String extension) { String mime = ""; switch (extension) { case ".pdf": mime = "application/pdf"; break; case ".png": mime = "image/png"; case ".css": ...
367cab41-2327-4ce3-aa20-8b14bf81e351
8
void write(byte[] foo, int s, int l) throws java.io.IOException { //if(eof_local)return; if(init){ Session _session=null; try{ _session=getSession(); } catch(JSchException e){ throw new java.io.IOException(e.toString()); } foo=addCache(foo, s, l); s=0...
0d264f8c-4494-4852-ace5-a61be2256c83
2
public Integer getKey(String path) { // Iterator through the HashMap Iterator it = media.entrySet().iterator(); while (it.hasNext()) { // Contains the key and the filePath to the video Map.Entry pairs = (Map.Entry) it.next(); // filePath String fileName = (String) (pairs.getValue()); if(path.e...
8b87d39c-6706-4cb0-a9ac-d3666c67c67a
9
protected void computeRect(Raster[] sources, WritableRaster dest, Rectangle destRect) { Raster source = sources[0]; Rectangle srcRect = mapDestRect(destRect, 0); int formatTag = MediaLibAccessor.findCompatibleTag(sources,dest); ...
2bc2421e-2376-49be-b79d-48a7da4ecb1b
1
public void addAccount(BankAccount account) throws IllegalArgumentException { if (! canHaveAsAccount(account)) throw new IllegalArgumentException(); accounts.add(account); }
75344db9-2e4a-4266-8724-6d6392158f81
1
public boolean matches(Operator loadop) { return loadop instanceof GetFieldOperator && ((GetFieldOperator) loadop).ref.equals(ref); }