text
stringlengths
14
410k
label
int32
0
9
private void createTouristList(Criteria criteria, Integer idOrder, AbstractDao dao) throws DaoException { List<Tourist> list = (List<Tourist>) criteria.getParam(DAO_ORDER_TOURIST_LIST); for (Tourist t : list) { Criteria crit = new Criteria(); crit.addParam(DAO_ID_ORDER, idOrder);...
1
public String fwla_to_fsp(String name) { if(name.indexOf('.') == -1) throw new java.lang.Error("The supplied string apears not to have the form <object>.<event>"); String object = name.substring(0, name.indexOf('.')); String event = name.substring(name.indexOf('.') + 1); String _res = ""; if(objec...
9
public int buscarConta() { System.out.print("entre com o numero da conta: "); return entrada.leiaInt(); }
0
public List<Category> getAll() throws SQLException { Session session = null; List<Category> cats = new ArrayList<Category>(); try { session = HibernateUtil.getSessionFactory().openSession(); Class tmmp = Category.class; cats = session.createCriteria(Category.clas...
3
private void readFeed() { try { // Set header values intial to the empty string String title = ""; String link = ""; // First create a new XMLInputFactory XMLInputFactory inputFactory = XMLInputFactory.newInstance(); // Setup a new eventRea...
8
public void visitMethodInsn( final int opcode, final String owner, final String name, final String desc){ boolean itf = opcode == Opcodes.INVOKEINTERFACE; Item i = cw.newMethodItem(owner, name, desc, itf); int argSize = i.intVal; // Label currentBlock = this.currentBlock; if(currentBlock != null) { if(...
7
public static void read_type_def(SimpleNode declarations, Symbol_table symbol_table, Type_table type_table) { try { int component_num = declarations.jjtGetNumChildren(); for (int i = 0; i < component_num; i++) { SimpleNode type_declaration = (SimpleNode) declarations.jjtG...
5
static private final boolean cvc(int i) { if (i < 2 || !cons(i) || cons(i-1) || !cons(i-2)) return false; { int ch = b[i]; if (ch == 'w' || ch == 'x' || ch == 'y') return false; } return true; }
7
private void updateFont() { // [srk] same protection added to updateColors // make sure node is not null if (node == null) { return ; } // end if if (node.isEditable()) { setEditable(true); if (!node.isMoveable() && pApplyFontStyleForMoveability) { setFont(immoveableFont); } else { ...
8
public void rotateImages(float rotationAngle){ //Number of right angle turns int numTurns = (int) Math.round(rotationAngle / (Math.PI*0.5)); //Rounds rotationAngle to nearest integer multiple of pi/2 float testAngle = (float) ((Math.PI*0.5)*numTurns); assert (Math.abs(testAngle-rotationAngle)<0.001): "E...
9
public static String treeToString(TreeMap<Integer, Integer> tree) { StringBuilder builder = new StringBuilder(); for(Entry<Integer, Integer> i : tree.entrySet()) { builder.append(i.getKey() + " " + i.getValue() + "\n" ); } return builder.toString(); }
1
boolean startManually() { return manualStart; }
0
public static void write (org.omg.CORBA.portable.OutputStream ostream, String[] value) { ostream.write_long (value.length); for (int _i0 = 0;_i0 < value.length; ++_i0) ostream.write_string (value[_i0]); }
1
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed String name = username.getText(); char [] pw = passwordField.getPassword(); String password = new String(pw); //System.out.println(password); try { ...
7
public static Registry440 getRegistry(String host, int port) throws RemoteException440{ try{ Socket soc = new Socket(host, port); ObjectOutputStream out = new ObjectOutputStream(soc.getOutputStream()); ObjectInputStream in = new ObjectInputStream(soc.getInputStream()); HandshakeMessage handshkMsg = new Ha...
5
public final void setY(int y) { if (y < 0) { return; } this.y = y; }
1
public int[] searchRange(int[] A, int target) { int[] res = new int[2]; res[0] = -1; res[1] = -1; if (A == null || A.length == 0) { return res; } int start = 0, end = A.length - 1; int mid; // Search left end while (start <= end) { ...
8
public Boolean agregarProducto(String producto){ if(this.stock.containsKey(producto)){ return false; } this.stock.put(producto, 0); return true; }
1
public static List<String> processComplexValue(String complexValue) throws Exception{ if(!SymbolComplexValueHelper.isComplex(complexValue)) throw new Exception("Symbol: [" + complexValue + "] isn't a complex valid type."); String realValue = cleanComplexValue(complexValue); ...
5
@Test public void depthest01opponent3() { for(int i = 0; i < BIG_INT; i++) { int numPlayers = 4; //assume/require > 1, < 7 Player[] playerList = new Player[numPlayers]; ArrayList<Color> factionList = Faction.allFactions(); playerList[0] = new Player(chooseFaction(factionList), new SimpleAI()); ...
5
public static void initializeExecutor(String resDirectory) { PokemonType.initializeTypes(); JSPokemonEngineHandler.initializeTypeHandlers(); System.out.println("Initializing JavaScript..."); //Init scope handlers (THIS, TARGET, etc) pokemonHandlerTHIS = new JSPokemonHandler(); pokemonHandlerTARGET = new ...
3
public void openBraceClass() { if (currentLine.length() > 0) { if ((Options.outputStyle & Options.BRACE_AT_EOL) != 0) print(" "); else println(); } println("{"); }
2
public Move bestMove(Board board, Piece piece, Piece nextPiece, int limitHeight){ Rater[] raters = { new HeightRater(FACTORS[0]), new RowsClearedRater(FACTORS[1]), new CohesionRater(FACTORS[2]), new GapFactor(FACTORS[3]) }; EnhancedMove bestMove = null; Piece current = piece; do { ...
7
public static void displayHelp(Object object) { String url = getURL(object); if (url == null) url = DEFAULT_HELP; FRAME.gotoURL(url); FRAME.setVisible(true); }
1
public CFGToPDALRConverter() { }
0
public JTextField getjTextFieldVille() { return jTextFieldVille; }
0
public Sprite getSpriteCollision(Sprite sprite) { // run through the list of Sprites Iterator i = map.getSprites(); while (i.hasNext()) { Sprite otherSprite = (Sprite)i.next(); if (isCollision(sprite, otherSprite)) { // collision found, return the Sprite ...
2
public Response callAndWait( String recipientId, Map msg, int timeout ) throws SampException { long finish = timeout > 0 ? System.currentTimeMillis() + timeout * 1000 : Long.MAX_VALUE; // 3e8 years HubConnection connection = getConnection(); S...
9
public DnDSimplePluralityResult(DnDElection election) { winners = new ArrayList<Option>(); ArrayList<String> maxGUID = new ArrayList<String>(); Integer maxVotes = 0; Map<String, Integer> votemap = new HashMap<String, Integer>(); for (Vote v : election.getVotes()) { if (!(v instanceof OneOfNVote)) { /...
8
public static String run(String input, int length, int filter) { StringBuilder sb = new StringBuilder(); NaiveSuffixTree myTree = new NaiveSuffixTree(); input += "$"; final BaseCalculator myBaseCalculator = new BaseCalculator(input); Node root = myTree.createTree(input); ArrayList<Entry<Strin...
2
@Override public void setTransient(Registry rg) { super.setTransient(rg); try { for (String key : resources.keySet()) { Resource resource = (Resource) resources.get(key); resource.setTransient(rg, this); } } catch (ConcurrentModificati...
3
private static final boolean hasDecimalSeparator(String buffer, boolean localized) { return buffer.indexOf(localized ? LOCALIZED_DECIMAL_SEPARATOR.charAt(0) : '.') != -1; }
1
public int largestRectangleArea(int[] height) { int maxArea = 0; int n = height.length; for( int i = 0; i < n; i++ ) { if( i < n - 1 && height[i] <= height[i+1] ) continue; int maxHeight = height[i]; for( int j = i; j >= 0; j-- ) { int l = i - ...
4
public void destroy(Integer id) throws IllegalOrphanException, NonexistentEntityException { EntityManager em = null; try { em = getEntityManager(); em.getTransaction().begin(); PypAdmControlProfesionales pypAdmControlProfesionales; try { py...
6
public void removeEntity(String name){ for (int i=0;i<eHandler.length-1;i++){ if (eHandler[i].getName().equals(name)){ eHandler[i] = null; } } }
2
private final void method1802(String s, int i) { int j = 0; boolean flag = false; int k = s.length(); for (int l = 0; l < k; l++) { char c = s.charAt(l); if (c == '<') { flag = true; } else if (c == '>') { flag = false; ...
6
@Override public void spawnEnemy(String enemyData) { if(!free()) { return; } int r = Application.get().getRNG().nextInt(6); GameActor a = Application.get().getLogic().createActor(enemyData); PhysicsComponent pc = (PhysicsComponent)a.getComponent("PhysicsComponent"...
2
private static String lineStyle2Dot(Styles.LineStyle lineStyle) { switch (lineStyle) { case Dashed: return "dashed"; case Dotted: return "dotted"; case Bold: return "bold"; case Solid: default: ...
4
@Override public void actionPerformed(ActionEvent e) { OutlinerDocument doc = new OutlinerDocument(""); Outliner.menuBar.windowMenu.changeToWindow(doc); }
0
public void setKey(String key) { byte[] keybyte = key.getBytes(); if (keybyte == null) { throw new RuntimeException("No key"); } else if (keybyte.length < 16) { throw new RuntimeException("Key too short"); } // Change bytes for ints IntBuffer intBuf = ByteBuffer.wrap(keybyte).order(ByteOrder.BIG_END...
3
public void makeNonVoid() { if (type != Type.tVoid) throw new jode.AssertError("already non void"); type = subExpressions[0].getType(); }
1
public boolean isInParty() { synchronized (JSBotUtils.glob.party.memb) { for (Party.Member m : JSBotUtils.glob.party.memb.values()) { if (m.gobid == gob_id) return true; } return false; } }
2
public TreatmentRec(Db db,Patient patient,String doctorID){ this.doctorID = doctorID; GregorianCalendar currentTime = new GregorianCalendar(); time = currentTime; //set treatment time //set discuont discount = 1; int ch, cm, nh1, nm1, nh2, nm2; ch = currentTime.get(11); cm = currentTime.get(12); nh1 =...
9
private static void printResult() { Iterator<Entry<String, Integer>> iter = class_number.entrySet().iterator(); while (iter.hasNext()) { Entry<String, Integer> entry = iter.next(); String key = entry.getKey(); int val = entry.getValue(); System.out.println("\t"+key + "\t: " + val); ...
4
public static <E extends GameObject> List<E> getNearby(Vector2D position, List<E> list){ final int MAX_DISTANCE = 50; List<E> neighbours = new ArrayList<>(); for (E thing : list){ Vector2D other = thing.getPosition(); if (Utilities.distance(position, other) < MAX_DISTANCE){ neighbours.add(thing); } ...
2
@Override public void run() { int choice; do { System.out.println("\nCryptoby - Crypt your Stuff"); System.out.println("---------------------------\n"); System.out.println("1 - Crypt Files"); System.out.println("2 - Crypt Text"); System.ou...
8
private String apendKeyInString() { StringBuilder field = new StringBuilder(); int i = 0; for (Integer key : cardInFieldGame.keySet()) { if (!listeofcontains.contains(key)) { double fehlt = LEGHTFORSTRING - 1; double me = fehlt / 2; fehlt = fehlt - me; for (int loop = 0; loop < me; loop++) { ...
5
@Override public boolean activate() { return Methods.needToHeal() && (Global.useRejuvenate && ActionBar.getNode(0).canUse() && ActionBar.getAdrenaline() == 1000) || (Global.eatFood && Methods.getHpPercent() <= HEAL_PERCENT - 10); }
5
public void cb(JComboBox cb,String a,String id){ con.ConsultarSQL("SELECT id,"+a+" FROM "+a,true); try { con.rs.first(); cb.addItem("Selecionar...."); int index = 0; do{ index++; cb.addItem(new InseriIdCombobox(con.rs.getString("id...
3
public int count() { Set<Integer> components = new HashSet<>(); for (int v = 0; v < id.length; v++) components.add(id[v]); return components.size(); }
1
public void recalculateTable(int row){ BigDecimal vorigRestCapital; if (row == 0) { vorigRestCapital = getStartCapital(); } else { vorigRestCapital = getBusinessObjects().get(row - 1).getRestCapital(); } for(int i=row; i<getBusinessObjects().size();i++) { ...
2
private Widget getHoverText(int seriesIndex, JavaScriptObject object) { if(series!=null && series.size() > seriesIndex) { Series<D> s = series.get(seriesIndex); if(s instanceof LineSeries) { JSONObject lineDataObject = new JSONObject(object); double x = lineDataObject.get("x").isNumber().doubl...
8
public static void testValidity(Object o) throws JSONException { if (o != null) { if (o instanceof Double) { if (((Double) o).isInfinite() || ((Double) o).isNaN()) { throw new JSONException( "JSON does not allow non-finite numbers."); ...
7
@Override public void start(final Stage primaryStage) throws Exception { this.primaryStage = primaryStage; this.root = new VBox(); root.setAlignment(Pos.CENTER); root.setSpacing(10); root.setPadding(new Insets(10, 10, 10, 10)); HBox settings = new HBox(); settings.setSpacing(20); settin...
8
public final static void plot(String[] files) throws PlotterException { for(int i= 1; i< files.length; ++i) { try { File file= new File(files[i]); double[] values= LoadRhythmHistogram.getValues(file); HistogramPlotter hp= new HistogramPlotter(values, file.getName()); hp.drawFrame(); } c...
3
public int [] svmTest(Problem test) { if (test == null) return null; int [] pred = new int[test.l]; for (int i=0; i<test.l; i++) { pred[i] = (svmTestOne(test.x[i])<0?-1:1); } return pred; ...
3
public boolean isReference() { return type != null && (type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY); }
2
public static com.google.protobuf.BlockingService newReflectiveBlockingService(final BlockingInterface impl) { return new com.google.protobuf.BlockingService() { public final com.google.protobuf.Descriptors.ServiceDescriptor getDescriptorForType() { return getDescriptor(); ...
9
public static int findMax(int[][] matrix) { int[][] ps = buildPartialSumMatrix(matrix); System.out.println("partial sum matrix"); AssortedMethods.printMatrix(ps); int maxSum = Integer.MIN_VALUE; for(int i=0; i<matrix.length; i++){ for(int j=0; j<matrix[i].length; j++){ for (int i2 = i; i2 < matrix.len...
9
@EventHandler public void EnderDragonWeakness(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.getEnderDragonConfig().getDouble("End...
6
public static void main(String[] args) throws IOException { CFG cfg = new CFG(); ArrayList<CFG_Graph> graphs = cfg.cfgMaker("bin/com/csci599/project/", "Condition"); System.out.println("CFG Size: " + graphs.size()); int i = 1; for (CFG_Graph graph : graphs) { // LocalVariable[] localVariables = graph....
6
public void makeMaze() { Random rand = new Random(); for(int q=0; q<act_rows-1; q++){ //for all rows but the last one if(q != 0){ /* get the current row from the last iteration */ for(int i=0; i<current.length; i++){ current[i] = next[i]; next[i] = UNDETERMINED; } ...
9
public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line = ""; StringBuilder out = new StringBuilder(); do { line = in.readLine(); if (line == null || line.length() == 0) break; int times = Integer.parseInt(lin...
8
public static ArrayList<QuestionBean> getQuestions(String testid) { // TODO Auto-generated method stub try { ArrayList<String> qidlist=new ArrayList<String>(); ArrayList<QuestionBean> qlist=new ArrayList<QuestionBean>(); con=DBConnection.getConnection(); Statement stmt=con.createStatement(); ResultS...
3
public void calculateResults() { resetCounts(); for (URL url : urls) { if (url.getURLType() == URLType.Page) { sumPages++; } else if (url.getURLType() == URLType.Document) { sumDocuments++; } else { ...
3
public static String unescapeHTML4(String str) { if (str == null) return null; int index = 0; Integer cCode; while ((index = str.indexOf('&', index)) != -1) { int index2 = str.indexOf(';', index + 1); if (index2 == -1) return str; if (str.charAt(index + 1) == '#') { int result = 0; ...
8
public List<Node> Colorize() { List<Node> linkedNodes = new ArrayList<Node>(); /*для всех смежных узлов*/ for (Node node : adjacentNodes) { /*если узел не просмотрен*/ if (!node.IsVisited()) { /*покрасить в цвет основного узла*/ node.SetCom...
2
public void setJoint(boolean isJoint) { if (this.isJoint == isJoint) return; if (isJoint) { this.isJoint = true; } else { try { this.isJoint = false; this.deleteArray("aWaitingId"); this.deleteArray("aAcceptedId"); this.deleteArray("aRejectedId"); } catch (SQLException e) { ...
3
@Override public boolean mover(int xIn, int yIn, int xFin, int yFin) { for (int aux = 0; aux < 8; aux++){ if ((xIn+aux == xFin) && (yIn+aux == yFin)) return true; if ((xIn-aux == xFin) && (yIn-aux == yFin)) return true; if ((xIn+aux == xFin) && (yIn-aux == yFin)) return true; if ((xIn-aux == xFin) &&...
9
public void persistVendor(Vendor vendor) { String sqlStatement; // SQL statement to persist the student // could pass a student object in as parameter to this method dao.connect(); sqlStatement = generateInsertStmt(vendor); if(dao.getErrorLogs().getErrorMsgs().size() == 0){ dao.executeUpdate(sqlStateme...
2
public Set<BankAccount> getAccountsSatisfying(Checker<BankAccount> checker) { Set<BankAccount> result = new HashSet<>(); for (BankAccount account: accounts) if (checker.check(account)) result.add(account); return result; }
2
public void DumpAPILinks( List<ClassDocumentation> docs, String outFile ) { try { FileWriter fw = new FileWriter(outFile); for( ClassDocumentation doc : docs ) { String packName = doc.Klass.ParentPackage.Name; String klassName = doc.Klass.Name; for( ThreadElement thread : doc.getValidatedThre...
7
@Override public void deserialize(Buffer buf) { short flag1 = buf.readUByte(); hasRights = BooleanByteWrapper.getFlag(flag1, 0); wasAlreadyConnected = BooleanByteWrapper.getFlag(flag1, 1); login = buf.readString(); nickname = buf.readString(); accountId = buf.readInt(...
4
@Override public void enable(boolean force) { // Make sure MobManager is enabled if (P.p() == null || !P.p().isEnabled()) { throw new IllegalStateException("MobManager must be enabled to enable Abilities"); } // Check if the Spawner is already enabled if (this.isEnabled()) { throw new IllegalSt...
5
public String getLastName() { return lastName.get(); }
0
protected String instanceToString(Instance inst) { StringBuffer result; Instance outInst; int i; String field; result = new StringBuffer(); if (inst instanceof SparseInstance) { outInst = new DenseInstance(inst.weight(), inst.toDoubleArray()); outInst.setDataset(inst.datas...
7
public int computeNextAge(int currentAge){ if (currentAge < -100){ return currentAge + 100; } else if (currentAge == -100){ return -1; } else if (currentAge == -1){ return 1; } else if (currentAge == 1){ return 50; } else if (currentAge < 1750){ return currentAge + 50; } else if (currentA...
7
private int helper(int n, int m, int[][] men, int[][] obstacleGrid) { if (n <= 0 || m <= 0) { return 0; } //the start position, if not obstacle, return 1 if (n == 1 && m == 1 && obstacleGrid[0][0] != 1) { return 1; }//else will be check in the recursive e...
7
public void incrementCountCategories(int type, String word, Term key, Map<String, Integer> map, Integer line_number, Integer word_number) { Logger.getGlobal().fine("," +type + "," + word + "," + key.getCategory() + "," + key.getTerm()); if (map.containsKey(key.getCategory())) { ...
6
private String traerPrimerObjetivoAComprobar(Regla reglaAPuntoDeComprobarse) { for (String obj : reglaAPuntoDeComprobarse.getCausantes()) { if (!isElementoEnListas(obj)) { return obj; } } return null; }
2
private RegularExpression readRE(File file) { String rstring = ""; // If nothing found, RE is blank. try { BufferedReader reader = new BufferedReader(new FileReader(file)); String line = null; while ((line = reader.readLine()) != null) { line = line.trim(); if (line.startsWith("#")) continue; ...
5
private void BtIncluirProdutoCompraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BtIncluirProdutoCompraActionPerformed boolean inclui = true; limpar.Limpar(TbCompraServ); TfQuantidadeKeyReleased(null); TfValorTotalCompraServ.setValue(BigDecimal.ZERO); if (!Tf...
9
@Override public void update(GameContainer gc, int delta) throws SlickException { for (int i = 0; i < entityList.size(); i++) { entityList.get(i).update(gc, null, delta); } boardSpawn.update(delta); for (int i = 0; i < boardSpawn.getEnemies().size(); i++) { boardSpawn.getEnemies().get(i).update(gc, null...
7
public void register(long eventType, IGameEventListener listener) { if(!eventListeners.containsKey(eventType)) { eventListeners.put(eventType, new ArrayList<IGameEventListener>()); } eventListeners.get(eventType).add(listener); }
1
public int findNthCatalanNumber(int N) { if(N>2) { int C[] = new int[N+1]; C[0] = C[1] = 1; for(int i=2; i<=N; i++) { C[i]=0; for(int j=0; j<i; j++) C[i]+=C[j]*C[i-j]; } return C[N]; } else if(N==1 || N==2) return 1; else return -1; }
5
private boolean r_factive() { int among_var; // (, line 132 // [, line 133 ket = cursor; // substring, line 133 among_var = find_among_b(a_7, 2); if (among_var == 0) { ...
8
@EventHandler public void SpiderJump(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.getSpiderConfig().getDouble("Spider.Jump.Dodge...
6
@Override public boolean equals(Object obj) { // TODO Codeoptimierung if (this == obj) return true; if (obj == null) return false; Card other = new Card((CardType) obj); if (this.treasure != other.getTreasure()) { return false; } for (Integer ID : this.getPin().getPlayerID()) { if (!other.get...
6
public static void main(String[] args) throws UnknownHostException, IOException { Socket s = new Socket("localhost", 2048); OutputStream outputStream = s.getOutputStream(); DataOutputStream dos = new DataOutputStream(outputStream); dos.writeLong(System.currentTimeMillis()); s.close(); }
0
public void acquire() { Lib.assertTrue(!isHeldByCurrentThread()); int p; boolean intStatus = Machine.interrupt().disable(); KThread thread = KThread.currentThread(); if(useSPS) temp.printTryLock(thread, this); // check if highest priority can be chang...
9
public void login() { System.out.print("\nAre you a new user? (yes/no) "); String yn = sc.nextLine().toLowerCase(); while (!yn.equals("yes") && !yn.equals("y") && !yn.equals("no") && !yn.equals("n")) { System.out.println(yn + " is incorrect input, try again...."); System.out.print("Are you a new user? (...
9
public static void main(String args[]) throws IOException { Loader.Load(); System.out.println("Welcome. Enter number of players: "); Scanner reader = new Scanner(System.in); String input = reader.nextLine(); int amountOfPlayers = Integer.parseInt(input); System.out.println("Welcome. Enter number of round...
8
private void setLinear() throws Exception { //then set default behaviour for node. //set linear regression combined with attribute filter //find the attributes used for splitting. boolean[] attributeList = new boolean[m_training.numAttributes()]; for (int noa = 0; noa < m_training.n...
8
@Override public int partition(int[] array, int pivotIndex, int b, int e) { int pivot = array[ pivotIndex ]; // Using an auxiliary table (easier to understand, but memory impact is // greater) int copyB = 0; int copyE = e - b; int[] copyArray = new int[e - b + 1]; for (int i = b; i <= e; ++i) { if (i...
4
@Override public int compare(KeyFrame k1, KeyFrame k2) { if(k1.frameNum > k2.frameNum){ return 1; } else if(k1.frameNum == k2.frameNum){ return 0; } return (-1); //throw new UnsupportedOperationE...
2
public static void setBreedingProbability(double newBREEDING_PROBABILITY) { BREEDING_PROBABILITY = newBREEDING_PROBABILITY; }
0
private void isLegal() { if ((null == operator) || (null == validator)) { throw new IllegalStateException("Illegal Unary Operator."); } }
2
public static boolean isMyChessmen(final ChessBoardEntity aBoard, final PositionEntity p) { boolean result = false; if (null != p) { List<ChessmenEntity> chessmens = aBoard.getChessmens(); for (ChessmenEntity c : chessmens) { if (c.isPlayer()) { if (p.getX() == c.getPosition().getX() && p.getY() == c...
5
private static String downloadChecksum(String addr, int numTries) { final int BUFFER_SIZE = 32; BufferedInputStream bis = null; ByteArrayOutputStream baos; try { URL url = new URL(addr); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); ...
5
private boolean versionCheck(String title) { if(type != UpdateType.NO_VERSION_CHECK) { String version = plugin.getDescription().getVersion(); if(title.split(" v").length == 2) { String remoteVersion = title.split(" v")[1].split(" ")[0]; // Get the ...
6