text
stringlengths
14
410k
label
int32
0
9
public static void refreshListeners() { EventManager evt = getEventManager(); if (evt == null) { System.out.println("Could not add listeners to event manager"); return; } evt.addListener(self); if (Script.paint != null) { evt.addListener(Script.paint); } if (Script.motion != null) { evt.addLis...
7
public InvestmentTableModel(AccountRecord account, String[] columnNames, Class<?>[] columnClasses) { if (account == null) throw new NullPointerException("No account provided"); if (columnNames == null) throw new NullPointerException("No column names provided"); if (column...
7
@Override public void storeImage(Image image) { ResultSet rs = null; int ID = image.getID(); if (ID > 0) { // update /////////////////////////////////////////////////////////////// // l'immagine già esiste ma non abbiamo dato la possibilità di editarla // ...
7
public BoardUI(Board board, PluginInterface[] plugins) { this.board = board; this.board.addObserver(this); lists_zone = new JPanel(); lists_zone.setLayout(new BoxLayout(lists_zone, BoxLayout.X_AXIS)); lists_zone.setBorder(new EmptyBorder(new Insets(10, 10, 10, 10))); lists_zone.setBackground(new Col...
9
@Override public void mouseClicked(MouseEvent e) { JList liste = (JList)e.getSource(); if (e.getClickCount() == 2) { synchronized(Main.lignes) { final Ligne ligne = Main.lignes.get(liste.getSelectedValue()); System.out.println("DOUBLE CLICK " +ligne.getId()); ...
3
public void fillInGenSet(Collection in, Collection gen) { if (this instanceof LocalVarOperator) { LocalVarOperator varOp = (LocalVarOperator) this; if (varOp.isRead() && in != null) in.add(varOp.getLocalInfo()); if (gen != null) gen.add(varOp.getLocalInfo()); } for (int i = 0; i < subExpressions....
5
public static void showPerson(Person person, String caption) { System.out.print("\n" + caption + ": "); if (person == null) System.out.println(" not known"); else { System.out.println(person.getName().getFullName()); Date birth = person.getBirthDate(); if (birth != null) System.out.println("\tBor...
3
public List<Fleet> EnemyFleets() { List<Fleet> r = new ArrayList<Fleet>(); for (Fleet f : fleets) { if (f.Owner() != 1) { r.add(f); } } return r; }
2
@Override @SuppressWarnings({ "nls", "boxing" }) protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder enc) { List<?> list = (List<?>) oldInstance; int size = list.size(); for (int i = 0; i < size; i++) { Expression getterExp = ...
9
public synchronized boolean moveItem(FieldItem item, Position initial, Position finalPosition){ if ((finalPosition.getX() <= this.getXLength()) || (finalPosition.getY() <= this.getYLength())) return false; if ((initial.getX() <= this.getXLength()) || (initial.getY() <= this.getYLength())) return false; ...
8
private void sendProcessingError(Throwable t, ServletResponse response) { String stackTrace = getStackTrace(t); if (stackTrace != null && !stackTrace.equals("")) { try { response.setContentType("text/html"); PrintStream ps = new PrintStream(re...
4
private void drawRoad(int x0, int y0, int x1, int y1) { boolean xFirst = random.nextBoolean(); if (xFirst) { while (x0 > x1) { data[x0][y0] = 0; level[x0--][y0] = TILE_ROAD; } while (x0 < x1) { ...
8
public void insert(Node n) { Node current = head; boolean flag = false; if (n.getData() < current.getData()) { // case 1: new node becomes head n.setNext(head); head = n; }/* if */else { while (current.getNext() != null && !flag) { if (n.getData() <= current.getNext().getData()) { // case2: //...
5
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; EmployeeHistory other = (EmployeeHistory) obj; if (employee == null) { if (other.employee != null) return false; } else if (!employ...
9
public void testPropertyCompareToMonth() { YearMonth test1 = new YearMonth(TEST_TIME1); YearMonth test2 = new YearMonth(TEST_TIME2); assertEquals(true, test1.monthOfYear().compareTo(test2) < 0); assertEquals(true, test2.monthOfYear().compareTo(test1) > 0); assertEquals(true, test...
2
@EventHandler public void onPlayerJoin(final PlayerJoinEvent e) { final Player player = e.getPlayer(); if (Game.started || Lobby.started) { //Teleport player to lobby player.teleport(new Location(Bukkit.getWorld(TIMV.config.getString("Worldname")), TIMV.config.getInt("Spawn.x"), TIMV.config.getInt("Spawn.y")...
4
private void startRootElement(final String qName, final Attributes attributes) throws SAXException, ObjectDescriptionException { if (qName.equals(ClassModelTags.INCLUDE_TAG)) { if (this.isInclude) { Log.warn("Ignored nested include tag."); ...
9
public int getNumberOfWords() { int count = 0; for (SentencePart sp : sentence) { if (sp instanceof Word) { count++; } } return count; }
2
@AfterClass public static void tearDownClass() { }
0
public float evaluate_float(Object[] dl) throws Throwable { if (Debug.enabled) Debug.println("Wrong evaluateXXXX() method called,"+ " check value of getType()."); return 0.0F; };
1
public boolean isColumnUsedInTheSameQueryWithTable(String tableA, String columnA, String tableB) { for (Query q : queries) { List<String> relations = q.getRelations(); if (relations.size() > 1) { if (relations.contains(tableA) && relations.contains(tableB)) { List<QueryAttribute> projections = q.ge...
7
protected void loadFields(com.sforce.ws.parser.XmlInputStream __in, com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException { super.loadFields(__in, __typeMapper); __in.peekTag(); if (__typeMapper.isElement(__in, CreatedBy__typeInfo)) { ...
9
public void initProvider(int port, List<Object> classesServices) { System.out.println("[Provider] : Start server on port " + port); // Create the server WebServer webServer = new WebServer(port); XmlRpcServer xmlRpcServer = webServer.getXmlRpcServer(); // Handle the services class PropertyHandlerMapping p...
9
public String getNumberDesc() { int n = getNumber(); if (n < 5) return "mało"; if (n < 10) return "kilka"; if (n < 20) return "watacha"; if (n < 50) return "dużo"; if (n < 100) return "horda"; if (n < 250) return "masa"; if (n < 500) return "mrowie"; if (n < 1000) return "rzesza"; if (n < 50000) re...
9
final public void showTable() throws ParseException { /*@bgen(jjtree) showTable */ SimpleNode jjtn000 = new SimpleNode(JJTSHOWTABLE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtn000.jjtSetFirstToken(getToken(1)); try { jj_consume_token(SHOW); jj_consume_token(T...
8
private void displayWinner(Graphics g) { g.setColor(Color.black); if ((game.getPlayer1Color() == 4) || (game.getPlayer2Color() == 4)) g.setColor(Color.cyan); g.setFont(new Font("Times", Font.BOLD, 75)); if (game.getGameMode() == 1) { if (game.getTurn() == 1) { ...
5
public void Interface() { int buffersize = 1024; char stdInbuffer[] = new char[buffersize]; // makes reading from keyboard/shell ready BufferedReader stdIn = new BufferedReader(new InputStreamReader( System.in)); // 1. read from keyboard // 2. send to Server // 3. catch server answer // 4....
4
public void shareDirAccepted(String parentPath, String dirName, String friendName, String mod, String expo) { Map<String, Map<SafeFile, Vector<SafeFile>>> m = user.getFileMap(); Set<SafeFile> safeFiles = m.get(user.getUsername()).keySet(); String dirPath; if (!parentPath.equals("null")) { dirPath = user.g...
8
public DefaultComboBoxModel<String> buildSelectCombo() { DefaultComboBoxModel<String> model = new DefaultComboBoxModel<String>(); if(!MapPanel.actors.isEmpty()) { for(int x = 0; x<MapPanel.actors.size(); x++) { model.addElement(MapPanel.actors.get(x).getID()); } } return model; }
2
public void initRequire(String[] L) { for (int i = 0; i < L.length; i++) { if (!require.containsKey(L[i])) { require.put(L[i], 1); } else require.put(L[i], require.get(L[i]) + 1); } }
2
void jasmin(PrintStream out) { super.jasmin(out); out.print(lvtIndex); if (wideDesc.equals("iinc")) out.print(" " + value); }
4
private static void isort(String[] a, String[] aux, int l, int h, int d) { // insertion sort for (int i = l; i <= h; i++) for (int j = i; j > l && less(a[j], a[j - 1], d); j--) { // swap a[j - 1], a[j] String temp = a[j - 1]; a[j - 1] = a[j]; a[j] = temp; } }
3
private void check_sig(WebauthResponse response) throws WebauthException { try { Certificate cert = keyStore.getCertificate(keyPrefix + response.get("kid")); if (cert == null) { throw new WebauthException("Failed to retrieve a key with " + "alias " + keyPrefix + response.get("kid") + " fro...
7
@Test public void testTransductionEmission() { Source<Boolean> src = new SourceFixe("1"); TransducteurEmission te = new TransducteurEmission(); src.connecter(te); try { src.emettre(); te.emettre(); } catch (InformationNonConforme e) { e.printStackTrace(); } // Verification nb Elements (po...
8
public void standardQuery(String query) { Connection connection = null; Statement statement = null; try { connection = this.open(); statement = connection.createStatement(); statement.executeQuery(query); statement.close(); connection.close(); } catch (SQLException ex) { if (ex.getMessage(...
4
public Point[] get3FrontVectors() { switch (this) { case UP: return new Point[] { new Point(0, -1), new Point(-1, -1), new Point(1, -1) }; case LEFT: return new Point[] { new Point(-1, 0), new Point(-1, 1), new Point(-1, -1) }; case DOWN: return new Point[] { new Point(0, 1), new Point(1, 1),...
4
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SSHCredentials that = (SSHCredentials) o; return !(host != null ? !host.equals(that.host) : that.host != null) && !(pass != null ? !pass...
8
public static <T> T awaitState(final long timeoutMillis, Object compareTo, final T object) { final Matcher matcher = toMatcher(compareTo); final Class<?> matcherType = Primitives.getRealClass(matcher.getType()); return (T) ProxyUtil.newProxy(object.getClass(), new InvocationHandler() { ...
9
public static void main(String[] args) throws Exception { HashMap<String, HashMap<Long, ContextCount>> outerMap = new HashMap<String, HashMap<Long, ContextCount>>(); List<PairedReads> pairedList = getAllBurkholderiaPairs(); for(int x=0; x < pairedList.size(); x++) { PairedReads pr = pairedList.get(x); ...
6
public int attackSpecial(Character opponent){ int damage; System.out.println(_name+" calls upon his CS Minions!"); damage = minions(opponent); if ( damage < 0 ) damage = 0; opponent.lowerHP( damage ); return damage;}
1
protected void fillData() { setLayout(new BorderLayout()); model.clearList(); JPanel vest = new JPanel(); vest.setLayout(new GridBagLayout()); JPanel center = new JPanel(); center.setLayout(new BorderLayout()); GridBagConstraints c = new GridBagConstraints(); ...
5
@Override synchronized public void addOrder(final Order order) { Connection conn = null; PreparedStatement stmt = null; try { conn = dataSource.getConnection(); stmt = conn.prepareStatement("INSERT INTO \"ORDER\" (ORDER_DATE,USER_ID) VALUES(?,?)"); ...
5
@BeforeClass public void setUp() { MeiyoVisitor.createVisitor( new AbstractVisitorConfiguration() { @Override public void configure() { handleType().annotatedWith( ClassAnnotation.class ).withHandler( new AnnotationHandler<Class, ClassAnnotati...
0
private boolean getBoolean(CycSymbol paramName) { Object rawValue = get(paramName); if (rawValue instanceof Boolean) { return (Boolean) rawValue; } else { rawValue = getDefaultInferenceParameterDescriptions().getDefaultInferenceParameters().get(paramName); return (rawValue instanceof Boole...
2
*/ public byte[] getFinalDestination() { //return mesh address if available if(sixLoWPANpacket != null && sixLoWPANpacket.isMeshHeader()){ return sixLoWPANpacket.getFinalAddress(); //else look for an existing sixlowpan address } else if(sixLoWPANpacket != null && sixLoWPANpacket.isIphcHeader() && sixLo...
5
public static String getResultName(int result) { String value = null; switch (result) { case -2: value = "Pending"; break; case 0: value = "Accepted"; break; case 1: value = "Rejected"; break; case 2: value = "No output"; break; case 3: value = "Compilation error"; break; c...
6
private boolean hasTag(String version) { for (final String string : Updater.NO_UPDATE_TAG) { if (version.contains(string)) { return true; } } return false; }
2
public void setManaged(boolean managed) { this.managed = managed; }
0
private void updateLocalTreesCorrelation(Genealogy genealogy) throws NaturalSetException { HashMap<NaturalSet, NaturalSetCollection> localTreesBiPartitions = genealogy.localTreesBiPartitions(); ArrayList<NaturalSet> frames = new ArrayList<NaturalSet>(localTreesBiPartitions.keySet()); Collections.sort(frames); ...
9
private void processMoveFromBoard(MouseEvent e) { int row = findRow(e.getY()); int col = findCol(e.getX()); int index = row * 4 + col; if (index > -1 && index < 12) { activeMove = new CardMoveImpl(index, CardMoveImpl.MOVE_TYPE_FROM.FROM_BOARD); } }
2
public static boolean hasActions(Node<?> root) { Node<?> node = root; for (;;) { if (node instanceof ActionNode) return true; if (node instanceof UnaryNode) { node = ((UnaryNode) node).sibling; continue; } ...
7
@Override public void run(Player interact, Entity on, InteractionType interaction) { if(interaction == InteractionType.RIGHT){ if(type == PotionType.MANA){ if(interact.getFoodLevel() == 20) return; interact.setItemInHand(new ItemStack(ItemType.EMPTY_BOTTLE.getMaterial(), 1)); interact.setFoodLevel(...
8
private void assertNotPrimitiveTargetType(Class<?> sourceType, Class<?> targetType) { if (targetType.isPrimitive()) { throw new IllegalArgumentException("A null value cannot be assigned to primitive type " + targetType.getName()); } }
3
@Override public void paint(Graphics g, JComponent c) { Graphics2D g2 = (Graphics2D) g.create(); if (clockwise) { g2.rotate(Math.PI / 2, c.getSize().width / 2, c.getSize().width / 2); } else { g2.rotate(-Math.PI / 2, c.getSize().height / 2, c.getSize().height / 2); } s...
1
private void initGraph() { Node firstNode = new SimpleNode(0, Node.Types.SIMPLE, defaultResistance); nodes.add(firstNode); for(int i = 1; i < kNearestNeighbors / 2; i++) { Node nextNode = new SimpleNode(i, Node.Types.SIMPLE, defaultResistance); nextNode.addNeighbor(nodes.get(i-1), delaysDistribution.getNex...
7
public ArrayList<PuzzleChar> getNeighbours(PuzzleChar pChar) { ArrayList<PuzzleChar> neighbours = new ArrayList<PuzzleChar>(); for(int ri = -1; ri <= 1; ri++) { for (int ci = -1; ci <= 1; ci++) { int nRow = pChar.loc.row + ri; int nCol = pChar.loc.col + ci; if ( nRow < 0 || nRow >= hei...
8
public ArrayList<Object[]> getPesonnelData(String client) throws Exception{ ArrayList<String> columnName = getTableColumn("personnel"); ArrayList<Object[]> rowData = new ArrayList<>(); int num = 1; try{ String sql = "Select * FROM `personnel` where assignment = '" + client + "' order by name"; St...
4
public void mouseEntered(MouseEvent e) { // if mouse is hovering over top right options... if (e.getSource()==InScreens.getBookHubButton()) { // animate BookHub option system.getContentPane().remove(InScreens.getOptionsUnselected()); system.getContentPane().add(InScreens.getBookHubSelected(),0); system.getCo...
3
public static double[][] toMatrix( double[][] audioVectors ) { int m = audioVectors.length; int n = 0; for ( int i = 0; i < m; ++i ) { int tmp = audioVectors[i].length; if ( tmp > n ) n = tmp; } double[][] audioMatrix = Matrix.newMatrix(m, n); for ( int i = 0; i < m; ++i ) { for ( int j = 0; j < audio...
5
public void fire(Player player, Environment enviro){ if(canShoot){ canShoot = false; float xPos = -player.getPosition().x(); float yPos = -player.getPosition().y(); float zPos = -player.getPosition().z(); Position posToShootFrom = new Position(xPos, yPos, zPos); Position posToShootTo = Position.scre...
3
public SettingsManager() throws IOException { prefsFile = new File("eu/beatsleigher/beattime/plugin/preferences/cfg"); preferences = new HashMap<>(); if (!prefsFile.exists()) { prefsFile.getParentFile().mkdirs(); prefsFile.createNewFile(); savePrefs()...
1
public String toString() { return (parent == null) ? "base package" : getFullName(); }
1
public static void main(String[] args) throws Exception{ count count = new count(args[0]); ArrayList<File> files = FileFinder.GetAllFiles(count.inputFolder, ".data", true); for(File f : files){ @SuppressWarnings("resource") BufferedReader br = new BufferedReader(new FileReader(f)); String line = n...
5
public int getSpeed() { int result = speed + citySpeed; for (Artifact a: active.values()) { result += a.speed; } return result; }
1
void fillSquare(PlanarSquare square, int contourIndex, int edgeMask, boolean reverseWinding) { int vPt = 0; boolean flip = reverseWinding; int nIntersect = 0; boolean newIntersect; for (int i = 0; i < 4; i++) { newIntersect = false; if ((edgeMask & (1 << i)) != 0) { triangleVertexList[vPt++] = squar...
9
public String testStatus(String appKey, String userKey, String testId, boolean detailed) { try { appKey = URLEncoder.encode(appKey, "UTF-8"); userKey = URLEncoder.encode(userKey, "UTF-8"); testId = URLEncoder.encode(testId, "UTF-8"); } catch (UnsupportedEncodingExcep...
1
private void loadCourse(Course course) { // Clear scorecard clearScorecard(); // Add par values to scorecard for (int holeNumber = 0; holeNumber < course.getNumberOfHoles(); holeNumber++) { Hole hole = course.getHole(holeNumber + 1); // +1 to match human # tblScor...
1
public <T extends Object> T construct(NitDesc nitDesc) throws NitException { NitAgent agent = agents.get(nitDesc.spec); if (agent == null){ if (nitDesc.spec == NitDesc.NitSpec.GROOVY_CLASS_LOADER){ agent = new GroovyClasspathAgent(); } else if (nitDesc.spec == NitDesc.NitSpec.JAVASCRIPT_CLOS...
9
private static long applyQueryDeletes(Iterable<QueryAndLimit> queriesIter, SegmentState segState) throws IOException { long delCount = 0; final LeafReaderContext readerContext = segState.reader.getContext(); for (QueryAndLimit ent : queriesIter) { Query query = ent.query; int limit = ent.limit; ...
8
public AnswerCombination(List<Token<AnswerColors>> tokens) { super(tokens); // TODO Auto-generated constructor stub }
0
public Map<InetAddress, GatewayDevice> discover() throws SocketException, UnknownHostException, IOException, SAXException, ParserConfigurationException { Collection<InetAddress> ips = getLocalInetAddresses(true, false, false); for (int i = 0; i < searchTypes.length; i++) { String searchMe...
5
private ScenarioGUIStep getScenarioGUIStepFromTreeStep(ScenarioTreeStep currentStep) { // Gibt das passende GUI Schritt Objekt zurück zum Szenarioschrittobjekt // und fügt das Szenarioschrittobjekt dem GUI Schritt Objekt per Konstruktor hinzu if(currentStep instanceof ScenarioTreeStepBeginning){ return ne...
8
@Override @RequestMapping(value = "/beers/{id}", method = RequestMethod.GET) @ResponseBody public BeerResponse get(@PathVariable("id") Long id) { Beer beer = persistenceService.read(Beer.class, id); return BeerResponse.createBeerResponse(beer); }
0
public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line = ""; StringBuilder out = new StringBuilder(); while ((line = in.readLine()) != null && line.length() != 0) { int nSet = Integer.parseInt(line.trim()); for (int...
8
public void setOptions(String[] options) throws Exception { String args; args = Utils.getOption('C',options); if (args.length() != 0) setClassificationType(new SelectedTag(args, TAGS_CLASSIFICATIONTYPES)); else setClassificationType(new SelectedTag(CT_MEDIAN, TAGS_CLASSIFICATIONTYPES)); ...
8
@Override public void run() { options.status = "Laying tracks"; for (GameObject tunnel : ctx.objects.select().id(TUNNEL).nearest().first()) { if (ctx.camera.prepare(tunnel) && tunnel.interact("Lay-tracks", "Tunnel")) { if (Condition.wait(new Callable<Boolean>() { @Override public Boolean call() th...
4
public final LatticeIF getImplementation(final LatticeType type) { switch(type) { case SHORT_RATE: { this.implementation = new ShortRateLatticeImpl(); break; } case ZERO_COUPON_BOND: { this.i...
7
public int hashCode() { if (cachedHash != 0xdeadbeef) return cachedHash; return cachedHash = buffer.toString().hashCode(); }
1
public void writeToServer(String text){ try{ bw.write(text+"\n"); bw.flush(); }catch(IOException e){ System.out.println("IRC: Failure when trying to write to server: "+e.getMessage()); } }
1
public static HumanTime eval(final CharSequence s) { HumanTime out = new HumanTime(0L); int num = 0; int start = 0; int end = 0; State oldState = State.IGNORED; for (char c : new Iterable<Character>() { /** * @see java.lang.Iterable#iterator(...
9
public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { String a = sc.next(); String b = sc.next(); String c = conv(a); String d = conv(b); int kiri = -1; int kanan = -1; bool...
8
@Override public void destroy(Object args) { if(this.root != null) this.root.destroy(); }
1
static private double anySubstitutionRatio(int taxon1, int taxon2) { double distance; double sumDistance = 0.0; double sumWeight = 0.0; boolean noGapsPairFound = false; // If both sequences are of zero length then the substitution ratio is zero because they are identical ...
8
public String getURI() { return uri; }
0
private boolean isCanLive(Enum lifeStatus, int aliveAround) { if(lifeStatus == LifeStatus.died){ return aliveAround == 3; } return (aliveAround == 2 || aliveAround == 3) && lifeStatus == LifeStatus.alive; }
3
int getOurDocsOpen() { return ourDocsOpen; }
0
public void setId(int id) { this.id = id; }
0
private boolean isReturnExpr(List<String> tokenList) { final int St_START = 1, St_LP_START = 2; Iterator tokenIt = tokenList.iterator(); int currentState = St_START; while (tokenIt.hasNext()) { String nextToken = (String) tokenIt.next(); switch (currentState) { case St_START: if (nextToken.equals...
7
@Override protected void writeChildren(XMLStreamWriter out) throws XMLStreamException { super.writeChildren(out); out.writeStartElement("gen"); out.writeAttribute("humidityMin", Integer.toString(humidity[0])); out.writeAttribute("humidityMax", Integer.toString(humidity[1]));...
9
public List<Key> getAllKeys() { try { Pattern keyIDPattern = Pattern.compile("pub\\s+\\w+/(\\w+)\\s+.*"); Pattern uidPattern = Pattern.compile("uid\\s+(\\S+[^<>]*\\S+)\\s+<([^<>]*)>.*"); List<Key> ret = new LinkedList<>(); List<String> list = new LinkedList<String>(); list.add("--list-keys"); ...
9
public void warn(Event event) { switch(event.getTypeEvent()) { case GOBACKWARD_END : if(state == 0) { state++; } else if(state ==2) { fin = true; } else { ignore(); } break; case CHILDBEHAVIOR_END : if(state == 1) { state++; } else { ignore(); } break; c...
7
public int getHeight() { return height; }
0
private void step() { for(int x = 0; x < Globals.width; x++){ for(int y = 0; y < Globals.height; y++){ float waterAmmount = 0.0f; for(int[] neighbor : HexagonUtils.neighborTiles(x, y, true)){ //waterAmmount += Globals.water.getGroundWaterLevel(neighbor[0], neighbor[1]); for(NeedsControlled nc : N...
8
public Id3v2PictureFrame(Property prop,PropertyTree parent) { super(prop, parent); }
0
private <T> void removeAt(T[] array, int index) { if (currentSize == 0) { shiftArrayBy(array, -1); } else { System.arraycopy(array, index + 1, array, index, array.length - index - 1); changeCapacityBy(array, -1); } }
1
public String getComment(String path) { Preconditions.checkNotNull(path, "Path cannot be null"); Configuration root = getRoot(); if (root == null) { throw new IllegalStateException("Cannot access section without a root"); } // Return the comment associated to this e...
6
@Override public void error(SAXParseException e) { System.out.println("SAXParserException Error: " + e.getMessage()); this.errorOccurred = true; }
0
@Test public void testCancelButtonBeforeCalculated() throws Exception { propertyChangeSupport.firePropertyChange(DialogWindowController.PERCENTAGE, 0, 10); view.getButton().getActionListeners()[0].actionPerformed(actionEvent); assertEquals(propertyName, DialogWindowController.CANCEL); ...
0
@Override protected CommandExecutionResult executeArg(Map<String, RegexPartialMatch> arg) { final String g1 = arg.get("G1").get(0); final String g2 = arg.get("G2").get(0); // if (getSystem().isGroup(g1) && getSystem().isGroup(g2)) { // return executePackageLink(arg); // } if (getSystem().isGroup(g1) || getS...
9
@Override public void setBoolean(long i, boolean value ) { if (ptr != 0) { Utilities.UNSAFE.putByte(ptr + i, value == true ? (byte) 1 : (byte) 0); } else { if (isConstant()) { throw new IllegalAccessError("Constant arrays cannot be modified."); ...
4