auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Reader(CachableBlockFile.Reader rdr) throws IOException { this.reader = rdr; CachableBlockFile.CachedBlockRead mb = reader.getMetaBlock("RFile.index"); try { int magic = mb.readInt(); int ver = mb.readInt(); rfileVersion = ver; if (magic != RINDEX_MAGIC) throw new IOException("Did not see expected magic number, saw " + magic); if (ver != RINDEX_VER_8 && ver != RINDEX_VER_7 && ver != RINDEX_VER_6 && ver != RINDEX_VER_4 && ver != RINDEX_VER_3) throw new IOException("Did not see expected version, saw " + ver); int size = mb.readInt(); currentReaders = new ArrayList<>(size); deepCopies = new ArrayList<>(); for (int i = 0; i < size; i++) { LocalityGroupMetadata lgm = new LocalityGroupMetadata(ver, rdr); lgm.readFields(mb); localityGroups.add(lgm); currentReaders.add(new LocalityGroupReader(reader, lgm, ver)); } readers = currentReaders; if (ver == RINDEX_VER_8 && mb.readBoolean()) { sampleReaders = new ArrayList<>(size); for (int i = 0; i < size; i++) { LocalityGroupMetadata lgm = new LocalityGroupMetadata(ver, rdr); lgm.readFields(mb); sampleGroups.add(lgm); sampleReaders.add(new LocalityGroupReader(reader, lgm, ver)); } samplerConfig = new SamplerConfigurationImpl(mb); } else { sampleReaders = null; samplerConfig = null; } } finally { mb.close(); } lgContext = new LocalityGroupContext(currentReaders); createHeap(currentReaders.size()); }

Target:
public Reader(CachableBlockFile.Reader rdr) throws IOException { this.reader = rdr; CachableBlockFile.CachedBlockRead mb = reader.getMetaBlock("RFile.index"); try { int magic = mb.readInt(); int ver = mb.readInt(); rfileVersion = ver; if (magic != RINDEX_MAGIC) throw new IOException("Did not see expected magic number, saw " + magic); if (ver != RINDEX_VER_8 && ver != RINDEX_VER_7 && ver != RINDEX_VER_6 && ver != RINDEX_VER_4 && ver != RINDEX_VER_3) throw new IOException("Did not see expected version, saw " + ver); int size = mb.readInt(); currentReaders = new ArrayList<>(size); deepCopies = new LinkedList<>(); for (int i = 0; i < size; i++) { LocalityGroupMetadata lgm = new LocalityGroupMetadata(ver, rdr); lgm.readFields(mb); localityGroups.add(lgm); currentReaders.add(new LocalityGroupReader(reader, lgm, ver)); } readers = currentReaders; if (ver == RINDEX_VER_8 && mb.readBoolean()) { sampleReaders = new ArrayList<>(size); for (int i = 0; i < size; i++) { LocalityGroupMetadata lgm = new LocalityGroupMetadata(ver, rdr); lgm.readFields(mb); sampleGroups.add(lgm); sampleReaders.add(new LocalityGroupReader(reader, lgm, ver)); } samplerConfig = new SamplerConfigurationImpl(mb); } else { sampleReaders = null; samplerConfig = null; } } finally { mb.close(); } lgContext = new LocalityGroupContext(currentReaders); createHeap(currentReaders.size()); }
Source:
public static String getLanguage() { SharedPreferences defaultSharedPref = OpenMRS.getInstance().getOpenMRSSharedPreferences(); String isDarkMode = defaultSharedPref.getString(ApplicationConstants.OpenMRSlanguage.KEY_LANGUAGE_MODE, "en"); return isDarkMode; }

Target:
public static String getLanguage() { SharedPreferences defaultSharedPref = OpenMRS.getInstance().getOpenMRSSharedPreferences(); String selecetedLang = defaultSharedPref.getString(ApplicationConstants.OpenMRSlanguage.KEY_LANGUAGE_MODE, "en"); return selecetedLang; }
Source:
private void connect() { this.connecting = true; this.stompSessionListenableFuture = doConnect(this.compositeStompSessionHandler); this.stompSessionListenableFuture.addCallback(new ListenableFutureCallback<StompSession>() { @Override public void onFailure(Throwable e) { AbstractStompSessionManager.this.connecting = false; logger.error("STOMP connect error.", e); scheduleReconnect(); if (applicationEventPublisher != null) { applicationEventPublisher.publishEvent( new StompExceptionEvent(AbstractStompSessionManager.this, e)); } } @Override public void onSuccess(StompSession stompSession) { AbstractStompSessionManager.this.connecting = false; stompSession.setAutoReceipt(isAutoReceiptEnabled()); AbstractStompSessionManager.this.connected = true; AbstractStompSessionManager.this.reconnectFuture = null; } }); }

Target:
private void connect() { this.connecting = true; this.stompSessionListenableFuture = doConnect(this.compositeStompSessionHandler); this.stompSessionListenableFuture.addCallback(new ListenableFutureCallback<StompSession>() { @Override public void onFailure(Throwable e) { scheduleReconnect(e); } @Override public void onSuccess(StompSession stompSession) { AbstractStompSessionManager.this.connected = true; AbstractStompSessionManager.this.connecting = false; stompSession.setAutoReceipt(isAutoReceiptEnabled()); if (AbstractStompSessionManager.this.applicationEventPublisher != null) { AbstractStompSessionManager.this.applicationEventPublisher.publishEvent( new StompSessionConnectedEvent(this)); } AbstractStompSessionManager.this.reconnectFuture = null; } }); }
Source:
private long getUniqueId(String name) { Long id = fIdToType.inverse().get(name); if (id == null) { id = ENTRY_ID.getAndIncrement(); fIdToType.put(id, name); } return id; }

Target:
private long getUniqueId(String name) { return fIdToType.inverse().computeIfAbsent(name, n -> ENTRY_ID.getAndIncrement()); }
Source:
public ResolvedCds toSingleNameCds() { return ResolvedCds.builder() .buySell(getBuySell().isBuy() ? BuySell.SELL : BuySell.BUY) .dayCount(getDayCount()) .legalEntityId(getCdsIndexId()) .paymentOnDefault(getPaymentOnDefault()) .periodicPayments(getPeriodicPayments()) .protectionEndDate(getProtectionEndDate()) .protectionStart(getProtectionStart()) .stepinDateOffset(getStepinDateOffset()) .settlementDateOffset(getSettlementDateOffset()) .build(); }

Target:
public ResolvedCds toSingleNameCds() { return ResolvedCds.builder() .buySell(getBuySell().isBuy() ? BuySell.SELL : BuySell.BUY) .dayCount(getDayCount()) .legalEntityId(getCdsIndexId()) .paymentOnDefault(getPaymentOnDefault()) .paymentPeriods(getPaymentPeriods()) .protectionEndDate(getProtectionEndDate()) .protectionStart(getProtectionStart()) .stepinDateOffset(getStepinDateOffset()) .settlementDateOffset(getSettlementDateOffset()) .build(); }
Source:
protected long sleepFor() { return 200L; }

Target:
protected long sleepFor() { return 500L; }
Source:
public void onDisplayChanged(int displayId) { final int defaultDisplayId = getDefaultDisplayId(context); if (displayId == defaultDisplayId || defaultDisplayId == DISPLAY_ID_UNKNOWN) { setSync(getDefaultDisplayRefreshRate(context)); } }

Target:
public void onDisplayChanged(int displayId) { if (displayId == Display.DEFAULT_DISPLAY) { setSync(getDefaultDisplayRefreshRate(context)); } }
Source:
public Statement apply(Statement current, Description description) { return new Statement() { @Override public void evaluate() throws Throwable { try { setUp(); } catch (Exception e) Security.addProvider(provider); LdapService embeddedServer = startEmbeddedServer(); try { current.evaluate(); } catch (Exception e) { throw e; } finally { if (embeddedServer != null) { embeddedServer.close(); } Security.removeProvider(provider.getName()); } } }; }

Target:
public Statement apply(Statement current, Description description) { return new Statement() { @Override public void evaluate() throws Throwable { setUp(); Security.addProvider(provider); LdapService embeddedServer = startEmbeddedServer(); try { current.evaluate(); } catch (Exception e) { throw e; } finally { if (embeddedServer != null) { embeddedServer.close(); } Security.removeProvider(provider.getName()); } } }; }
Source:
public void testSimpleAttributeChangeIsVisibleOnServer() { ClientAttribute ca = new ClientAttribute("name", null); ClientPresentationModel cpm = new ClientPresentationModel("model", Arrays.asList(ca)); clientModelStore.add(cpm); final AtomicReference<Command> receivedCommand = new AtomicReference<Command>(null); CommandHandler testServerAction = new CommandHandler<ValueChangedCommand>() { @Override public void handleCommand(ValueChangedCommand command, List<Command> response) { receivedCommand.set(command); } }; serverConnector.getRegistry().register(ValueChangedCommand.class, testServerAction); ca.setValue("initial"); clientDolphin.sync(new Runnable() { @Override public void run() { Assert.assertNotNull(receivedCommand.get()); Assert.assertEquals("ValueChanged", receivedCommand.get().getId()); Assert.assertEquals(ValueChangedCommand.class, receivedCommand.get().getClass()); ValueChangedCommand cmd = (ValueChangedCommand) receivedCommand.get(); Assert.assertEquals(null, cmd.getOldValue()); Assert.assertEquals("initial", cmd.getNewValue()); config.assertionsDone(); } }); }

Target:
public void testSimpleAttributeChangeIsVisibleOnServer() { ClientAttribute ca = new ClientAttribute("name", null); ClientPresentationModel cpm = new ClientPresentationModel("model", Arrays.asList(ca)); clientModelStore.add(cpm); final AtomicReference<Command> receivedCommand = new AtomicReference<>(null); CommandHandler testServerAction = new CommandHandler<ValueChangedCommand>() { @Override public void handleCommand(ValueChangedCommand command, List<Command> response) { receivedCommand.set(command); } }; serverConnector.getRegistry().register(ValueChangedCommand.class, testServerAction); ca.setValue("initial"); clientDolphin.sync(new Runnable() { @Override public void run() { Assert.assertNotNull(receivedCommand.get()); Assert.assertEquals("ValueChanged", receivedCommand.get().getId()); Assert.assertEquals(ValueChangedCommand.class, receivedCommand.get().getClass()); ValueChangedCommand cmd = (ValueChangedCommand) receivedCommand.get(); Assert.assertEquals(null, cmd.getOldValue()); Assert.assertEquals("initial", cmd.getNewValue()); config.assertionsDone(); } }); }
Source:
private String getCardIdPath() { if (this.getOrigin().getCardId() == null) { return this.getDestination().getCardId(); } return this.getOrigin().getCardId(); }

Target:
private String getCardIdPath() { if ("deposit".equalsIgnoreCase(this.getType())) { return this.getDestination().getCardId(); } return this.getOrigin().getCardId(); }
Source:
public List<Attribute> getRequiredAttributes(PerunSession sess, Member member, Group group, boolean workWithUserAttributes) throws InternalErrorException, WrongAttributeAssignmentException { List<Resource> resources = getPerunBl().getResourcesManagerBl().getAssignedResources(sess, member); Set<Attribute> attributes = new HashSet<Attribute>(); for(Resource resource : resources) { attributes.addAll(this.getResourceRequiredAttributes(sess, resource, member, group)); } attributes.addAll(this.getRequiredAttributes(sess, member, workWithUserAttributes)); return new ArrayList<Attribute>(attributes); }

Target:
public List<Attribute> getRequiredAttributes(PerunSession sess, Member member, Group group, boolean workWithUserAttributes) throws InternalErrorException, WrongAttributeAssignmentException { List<Resource> memberResources = getPerunBl().getResourcesManagerBl().getAssignedResources(sess, member); List<Resource> groupResources = getPerunBl().getResourcesManagerBl().getAssignedResources(sess, group); memberResources.retainAll(groupResources); Set<Attribute> attributes = new HashSet<Attribute>(); for(Resource resource : memberResources) { attributes.addAll(this.getResourceRequiredAttributes(sess, resource, member, group)); } attributes.addAll(this.getRequiredAttributes(sess, member, workWithUserAttributes)); return new ArrayList<Attribute>(attributes); }
Source:
private void validateResources() { ResourceConfigs resourceConfigs = getResources(); if (isElastic() && !resourceConfigs.isEmpty()) { errors.add("elasticAgentId", "Elastic agents cannot have resources."); return; } resourceConfigs.validate(null); if (resourceConfigs.hasErrors()) { errors.addAll(resourceConfigs.errors()); } }

Target:
private void validateResources() { ResourceConfigs resourceConfigs = new ResourceConfigs(getResources()); if (isElastic() && !resourceConfigs.isEmpty()) { errors.add(RESOURCES, "Elastic agents cannot have resources."); return; } resourceConfigs.validate(null); if (resourceConfigs.hasErrors()) { errors.addAll(resourceConfigs.errors()); } }
Source:
public void testClose() throws InterruptedException, TimeoutException, ExecutionException, NetworkException, InjectionException { setup(0); ParameterWorkerTestUtil.close(parameterWorker, mockSender, workerHandler); }

Target:
public void testClose() throws InterruptedException, TimeoutException, ExecutionException, NetworkException, InjectionException { prepare(Long.MAX_VALUE); ParameterWorkerTestUtil.close(parameterWorker, mockSender, workerHandler); }
Source:
public void initializeUsers() { String activeUserString = GoogleLoginPrefs.getActiveUser(); List<String> allUsers = GoogleLoginPrefs.getStoredUsers(); String removedUsers = ""; for (String aUser : allUsers) { users.addUser(new CredentialedUser(aUser)); GoogleLoginState delegate = createGoogleLoginState(true); if(delegate == null) { removedUsers += aUser + ", "; if(aUser.equals(activeUserString)) { activeUserString = null; } users.removeUser(aUser); continue; } IGoogleLoginCompletedCallback callback = new IGoogleLoginCompletedCallback() { @Override public void onLoginCompleted() { uiFacade.notifyStatusIndicator(); } }; users.addUser(new CredentialedUser(delegate, callback)); } if(activeUserString == null) { users.removeActiveUser(); } else { try { users.setActiveUser(activeUserString); } catch (IllegalArgumentException ex) { LOG.warn("Error while initiating users", ex); users.removeActiveUser(); } } if (!removedUsers.isEmpty()) { LOG.warn("The following user(s) had expired authentication scopes: " + removedUsers + "and have been logged out."); } }

Target:
public void initializeUsers() { String activeUserString = GoogleLoginPrefs.getActiveUser(); List<String> allUsers = GoogleLoginPrefs.getStoredUsers(); String removedUsers = ""; for (String aUser : allUsers) { users.addUser(new CredentialedUser(aUser)); GoogleLoginState delegate = createGoogleLoginState(true); if(delegate == null) { removedUsers += aUser + ", "; if(aUser.equals(activeUserString)) { activeUserString = null; } users.removeUser(aUser); continue; } IGoogleLoginCompletedCallback callback = new IGoogleLoginCompletedCallback() { @Override public void onLoginCompleted() { uiFacade.notifyStatusIndicator(); } }; users.addUser(new CredentialedUser(delegate, callback)); } if(activeUserString == null) { users.removeActiveUser(); } else { try { users.setActiveUser(activeUserString); } catch (IllegalArgumentException ex) { LOG.warn("Error while initiating users", ex); users.removeActiveUser(); } } if (!removedUsers.isEmpty()) { LOG.info("The following user(s) had expired authentication scopes: " + removedUsers + "and have been logged out."); } }
Source:
public String toString() { return "" + seatGroup + seatNumber; }

Target:
public String toString() { return seatGroup + seatNumber; }
Source:
boolean maybeCommit() { final int committed; if (now - lastCommitMs > commitTimeMs) { if (log.isTraceEnabled()) { log.trace("Committing all active tasks and standby tasks since {}ms has elapsed (commit interval is {}ms)", taskManager.activeTaskIds(), taskManager.standbyTaskIds(), now - lastCommitMs, commitTimeMs); } committed = taskManager.commitAllActive(); if (committed > 0) { if (eosBetaEnabled) { producer.commitTransaction(); producer.beginTransaction(); } } if (committed > 0 || taskManager.commitAllStandby() > 0) { final long intervalCommitLatency = advanceNowAndComputeLatency(); commitSensor.record(intervalCommitLatency / (double) committed, now); if (log.isDebugEnabled()) { log.debug("Committed all active tasks and standby tasks in {}ms", taskManager.activeTaskIds(), taskManager.standbyTaskIds(), intervalCommitLatency); } } if (committed > 0) { taskManager.maybePurgeCommitedRecords(); } if (committed == -1) { log.trace("Unable to commit as we are in the middle of a rebalance, will try again when it completes."); } else { lastCommitMs = now; } processStandbyRecords = true; } else { committed = taskManager.maybeCommitActiveTasksPerUserRequested(); if (committed > 0) { final long requestCommitLatency = advanceNowAndComputeLatency(); commitSensor.record(requestCommitLatency / (double) committed, now); } } return committed > 0; }

Target:
boolean maybeCommit() { final int committed; if (now - lastCommitMs > commitTimeMs) { if (log.isTraceEnabled()) { log.trace("Committing all active tasks and standby tasks since {}ms has elapsed (commit interval is {}ms)", taskManager.activeTaskIds(), taskManager.standbyTaskIds(), now - lastCommitMs, commitTimeMs); } committed = taskManager.commitAllActive(); if (committed > 0) { if (eosBetaEnabled) { producer.commitTransaction(); producer.beginTransaction(); } } if (committed > 0 || taskManager.commitAllStandby() > 0) { final long intervalCommitLatency = advanceNowAndComputeLatency(); commitSensor.record(intervalCommitLatency / (double) committed, now); if (log.isDebugEnabled()) { log.debug("Committed all active tasks and standby tasks in {}ms", taskManager.activeTaskIds(), taskManager.standbyTaskIds(), intervalCommitLatency); } } if (committed > 0) { taskManager.maybePurgeCommittedRecords(); } if (committed == -1) { log.trace("Unable to commit as we are in the middle of a rebalance, will try again when it completes."); } else { lastCommitMs = now; } processStandbyRecords = true; } else { committed = taskManager.maybeCommitActiveTasksPerUserRequested(); if (committed > 0) { if (eosBetaEnabled) { taskManager.commitAllActive(); producer.commitTransaction(); producer.beginTransaction(); } final long requestCommitLatency = advanceNowAndComputeLatency(); commitSensor.record(requestCommitLatency / (double) committed, now); } } return committed > 0; }
Source:
public void testCreateFileHeader_Binary() throws Exception { ObjectId adId = blob("a\nd\n"); ObjectId binId = blob("a\nb\nc\n\0\0\0\0d\n"); String diffHeader = makeDiffHeader(PATH_A, PATH_B, adId, binId) + "Binary files differ\n"; DiffEntry ad = DiffEntry.delete(PATH_A, adId); DiffEntry abcd = DiffEntry.add(PATH_B, binId); DiffEntry mod = DiffEntry.pair(ChangeType.MODIFY, ad, abcd, 0); FileHeader fh = df.createFileHeader(mod); assertEquals(diffHeader, RawParseUtils.decode(fh.getBuffer())); assertEquals(1, fh.getHunks().size()); HunkHeader hh = fh.getHunks().get(0); assertEquals(0, hh.toEditList().size()); }

Target:
public void testCreateFileHeader_Binary() throws Exception { ObjectId adId = blob("a\nd\n"); ObjectId binId = blob("a\nb\nc\n\0\0\0\0d\n"); String diffHeader = makeDiffHeader(PATH_A, PATH_B, adId, binId) + "Binary files differ\n"; DiffEntry ad = DiffEntry.delete(PATH_A, adId); DiffEntry abcd = DiffEntry.add(PATH_B, binId); DiffEntry mod = DiffEntry.pair(ChangeType.MODIFY, ad, abcd, 0); FileHeader fh = df.createFileHeader(mod); assertEquals(diffHeader, RawParseUtils.decode(fh.getBuffer())); assertEquals(FileHeader.PatchType.BINARY, fh.getPatchType()); assertEquals(1, fh.getHunks().size()); HunkHeader hh = fh.getHunks().get(0); assertEquals(0, hh.toEditList().size()); }
Source:
public User setSpecificUser(PerunSession sess, User specificUser, SpecificUserType specificUserType, User owner) throws InternalErrorException, RelationExistsException, UserNotExistsException, PrivilegeException { Utils.checkPerunSession(sess); Utils.notNull(specificUserType, "specificUserType"); getPerunBl().getUsersManagerBl().checkUserExists(sess, owner); getPerunBl().getUsersManagerBl().checkUserExists(sess, specificUser); if(!AuthzResolver.authorizedInternal(sess, "setSpecificUser_User_SpecificUserType_User_policy", Collections.singletonList(specificUser))) { throw new PrivilegeException(sess, "Only PerunAdmin should have rights to call this method."); } return getUsersManagerBl().setSpecificUser(sess, specificUser, specificUserType, owner); }

Target:
public User setSpecificUser(PerunSession sess, User specificUser, SpecificUserType specificUserType, User owner) throws InternalErrorException, RelationExistsException, UserNotExistsException, PrivilegeException { Utils.checkPerunSession(sess); Utils.notNull(specificUserType, "specificUserType"); getPerunBl().getUsersManagerBl().checkUserExists(sess, owner); getPerunBl().getUsersManagerBl().checkUserExists(sess, specificUser); if(!AuthzResolver.authorizedInternal(sess, "setSpecificUser_User_SpecificUserType_User_policy", Collections.singletonList(specificUser)) && !AuthzResolver.authorizedInternal(sess, "owner-setSpecificUser_User_SpecificUserType_User_policy", Collections.singletonList(owner))) { throw new PrivilegeException(sess, "Only PerunAdmin should have rights to call this method."); } return getUsersManagerBl().setSpecificUser(sess, specificUser, specificUserType, owner); }
Source:
public int queuedJobsUniqueTimes() { synchronized(timedJobsByTime) { return timedJobsByTime.size(); } }

Target:
int queuedJobsUniqueTimes() { synchronized(timedJobsByTime) { return timedJobsByTime.size(); } }
Source:
public void run() { HttpContext context = new BasicHttpContext(null); try { if (!Thread.interrupted() && conn.isOpen()) { httpservice.handleRequest(conn, context); } } catch (ConnectionClosedException ex) { LogUtil.w("Client closed connection: %s", ex); } catch (IOException ex) { LogUtil.w("I/O error: %s", ex); } catch (HttpException ex) { LogUtil.w("Unrecoverable HTTP protocol violation: %s", ex); } catch (OutOfMemoryError ex) { LogUtil.w("Out of memory during download: %s", ex); } finally { try { conn.close(); } catch (IOException ignore) { } } }

Target:
public void run() { HttpContext context = new BasicHttpContext(null); try { if (!Thread.interrupted() && conn.isOpen()) { httpservice.handleRequest(conn, context); } } catch (ConnectionClosedException ex) { LogUtil.w("Client closed connection: %s", ex); } catch (IOException ex) { LogUtil.w("I/O error: %s", ex); } catch (HttpException ex) { LogUtil.w("Unrecoverable HTTP protocol violation: %s", ex); } finally { try { conn.close(); } catch (IOException ignore) { } } }
Source:
public String getMessage() { if( this.moduleTargets == null ) return this.symbolName + " is not defined in symbolTable"; else return this.symbolName + " is not defined in " + String.join( ".", this.moduleTargets ); }

Target:
public String getMessage() { if( this.importPath == null ) { return this.symbolName + " is not defined in symbolTable"; } return this.symbolName + " is not defined in " + importPath; }
Source:
public void downloadFile(File destination, URI downloadUri) throws IOException, DownloadException { CloseableHttpResponse response = execute(downloadUri); int statusCode = response.getStatusLine().getStatusCode(); if (statusCode != 200) { throw new DownloadException( "Got error code " + statusCode + " from the server."); } new File( FilenameUtils.getFullPathNoEndSeparator(destination.toString())) .mkdirs(); ReadableByteChannel rbc = Channels .newChannel(response.getEntity().getContent()); try (FileOutputStream fos = new FileOutputStream(destination)) { fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); } }

Target:
private void downloadFile(File destination, URI downloadUri) throws IOException, DownloadException { CloseableHttpResponse response = execute(downloadUri); int statusCode = response.getStatusLine().getStatusCode(); if (statusCode != 200) { throw new DownloadException( "Got error code " + statusCode + " from the server."); } new File( FilenameUtils.getFullPathNoEndSeparator(destination.toString())) .mkdirs(); try (ReadableByteChannel rbc = Channels.newChannel(response.getEntity() .getContent()); FileOutputStream fos = new FileOutputStream( destination)) { fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); } }
Source:
public void handleDataChange(String dataPath, Object data) { LOG.info("got notification about barrier " + barrierStatePath + "; done=" + data); if (notAValidEvent()) return; State barrierState = (State) data; if (!Objects.equals(barrierState, State.NEW)) { zkUtils.unsubscribeDataChanges(barrierStatePath, this); barrierListenerOptional.ifPresent(zkBarrierListener -> zkBarrierListener.onBarrierStateChanged(barrierVersion, (State) data)); } }

Target:
public void handleDataChange(String dataPath, Object data) { LOG.info(String.format("Received barrierState change notification for barrier version: %s from zkNode: %s with data: %s.", barrierVersion, dataPath, data)); if (notAValidEvent()) return; State barrierState = (State) data; List<State> expectedBarrierStates = ImmutableList.of(State.DONE, State.TIMED_OUT); if (barrierState != null && expectedBarrierStates.contains(barrierState)) { zkUtils.unsubscribeDataChanges(barrierStatePath, this); barrierListenerOptional.ifPresent(zkBarrierListener -> zkBarrierListener.onBarrierStateChanged(barrierVersion, (State) data)); } else { LOG.debug("Barrier version: is at state: {}. Ignoring the barrierState change notification.", barrierVersion, barrierState); } }
Source:
protected String deduceIdentifierQuoteString( DatabaseMetaData databaseMetaData) { return null; }

Target:
protected String deduceIdentifierQuoteString( DatabaseMetaData databaseMetaData) { return "`"; }
Source:
synchronized void updateTimeRangeSelectionPieChart() { if (getTimeRangePC() == null) { fTimeRangePC = new PieChart(this, SWT.NONE); getTimeRangePC().getTitle().setText(fTimeRangePCname); getTimeRangePC().getAxisSet().getXAxis(0).getTitle().setText(""); getTimeRangePC().getLegend().setPosition(SWT.RIGHT); getTimeRangePC().getLegend().setVisible(true); getTimeRangePC().addListener(SWT.MouseMove, fMouseMoveListener); getTimeRangePC().addMouseListener(fMouseClickListener); } else if (getTimeRangePC().isDisposed()) { return; } Map<String, Long> totalEventCountForChart = getTotalEventCountForChart(false); if (totalEventCountForChart == null) { return; } updatePieChartWithData(fTimeRangePC, totalEventCountForChart, MIN_PRECENTAGE_TO_SHOW_SLICE, fOthersSliceName); }

Target:
synchronized void updateTimeRangeSelectionPieChart() { if (getTimeRangePC() == null) { fTimeRangePC = new PieChart(this, SWT.NONE); getTimeRangePC().getTitle().setText(fTimeRangePCname); getTimeRangePC().getAxisSet().getXAxis(0).getTitle().setText(""); getTimeRangePC().getLegend().setPosition(SWT.BOTTOM); getTimeRangePC().getLegend().setVisible(true); getTimeRangePC().addListener(SWT.MouseMove, fMouseMoveListener); getTimeRangePC().addMouseListener(fMouseClickListener); } else if (getTimeRangePC().isDisposed()) { return; } Map<String, Long> totalEventCountForChart = getTotalEventCountForChart(false); if (totalEventCountForChart == null) { return; } updatePieChartWithData(fTimeRangePC, totalEventCountForChart, MIN_PRECENTAGE_TO_SHOW_SLICE, fOthersSliceName); }
Source:
static Process launchPy4jPythonClient( GatewayServer gatewayServer, ReadableConfig config, List<String> commands, String entryPointScript, String tmpDir) throws IOException { PythonEnvUtils.PythonEnvironment pythonEnv = PythonEnvUtils.preparePythonEnvironment( config, entryPointScript, tmpDir); pythonEnv.systemEnv.put("PYFLINK_GATEWAY_PORT", String.valueOf(gatewayServer.getListeningPort())); pythonEnv.systemEnv.put("PYFLINK_CALLBACK_PORT", String.valueOf(gatewayServer.getCallbackClient().getPort())); return PythonEnvUtils.startPythonProcess(pythonEnv, commands); }

Target:
static Process launchPy4jPythonClient( GatewayServer gatewayServer, ReadableConfig config, List<String> commands, String entryPointScript, String tmpDir) throws IOException { PythonEnvironment pythonEnv = PythonEnvUtils.preparePythonEnvironment( config, entryPointScript, tmpDir); pythonEnv.systemEnv.put("PYFLINK_GATEWAY_PORT", String.valueOf(gatewayServer.getListeningPort())); pythonEnv.systemEnv.put("PYFLINK_CALLBACK_PORT", String.valueOf(gatewayServer.getCallbackClient().getPort())); return PythonEnvUtils.startPythonProcess(pythonEnv, commands); }
Source:
public void accept(final List<SearchResult<?>> results) { if (results.isEmpty()) { return; } SearchResult[] searchResults = results.toArray(new SearchResult[0]); list.setListData(searchResults); int searchResultLength = searchResults.length; if (searchResultLength < 9) { list.setVisibleRowCount(searchResultLength); } JScrollPane scrollPane = new JScrollPane(list); scrollPane.setBorder(BorderFactory.createEmptyBorder()); final JPopupMenu popup = new JPopupMenu(); popup.add(scrollPane); popup.show(searchBox, 0, searchBox.getHeight()); list.requestFocusInWindow(); list.setSelectedIndex(0); onSelect = new Runnable() { @Override public void run() { onSelect(popup, results); } }; onDismiss = new Runnable() { @Override public void run() { popup.setVisible(false); searchBox.requestFocusInWindow(); } }; }

Target:
public void accept(final List<SearchResult<?>> results) { if (results.isEmpty()) { return; } SearchResult[] searchResults = results.toArray(new SearchResult[0]); list.setListData(searchResults); int searchResultLength = searchResults.length; if (searchResultLength < 9) { list.setVisibleRowCount(searchResultLength); } else { list.setVisibleRowCount(10); } JScrollPane scrollPane = new JScrollPane(list); scrollPane.setBorder(BorderFactory.createEmptyBorder()); final JPopupMenu popup = new JPopupMenu(); popup.add(scrollPane); popup.show(searchBox, 0, searchBox.getHeight()); list.requestFocusInWindow(); list.setSelectedIndex(0); onSelect = new Runnable() { @Override public void run() { onSelect(popup, results); } }; onDismiss = new Runnable() { @Override public void run() { popup.setVisible(false); searchBox.requestFocusInWindow(); } }; }
Source:
public ReplicationStats execute(Client client) throws Exception { WalReplication edits = getWalEdits(target, input, p, status, sizeLimit, tids); log.debug("Read WAL entries and retained bytes of WAL entries for replication to peer '{}'", (Long.MAX_VALUE == edits.entriesConsumed) ? "all remaining" : edits.entriesConsumed, edits.sizeInBytes, p); if (0 < edits.walEdits.getEditsSize()) { if (Thread.interrupted()) { log.debug("Replication work interrupted before writing edits, returning empty replstats"); return new ReplicationStats(0L, 0L, 0L); } log.debug("Sending edits", edits.walEdits.getEditsSize()); long entriesReplicated = client.replicateLog(remoteTableId, edits.walEdits, tcreds); if (Thread.interrupted()) { log.debug("Replication work interrupted after writing edits, returning empty replstats"); return new ReplicationStats(0L, 0L, 0L); } if (entriesReplicated != edits.numUpdates) { log.warn("Sent WAL entries for replication but were reported as replicated", edits.numUpdates, entriesReplicated); } else { log.debug("Replicated edits", entriesReplicated); } return edits; } else if (edits.entriesConsumed > 0) { return edits; } return new ReplicationStats(0l, 0l, 0l); }

Target:
public ReplicationStats execute(Client client) throws Exception { WalReplication edits = getWalEdits(target, input, p, status, sizeLimit, tids); log.debug("Read WAL entries and retained bytes of WAL entries for replication to peer '{}'", (Long.MAX_VALUE == edits.entriesConsumed) ? "all remaining" : edits.entriesConsumed, edits.sizeInBytes, p); if (0 < edits.walEdits.getEditsSize()) { log.debug("Sending edits", edits.walEdits.getEditsSize()); long entriesReplicated = client.replicateLog(remoteTableId, edits.walEdits, tcreds); if (entriesReplicated != edits.numUpdates) { log.warn("Sent WAL entries for replication but were reported as replicated", edits.numUpdates, entriesReplicated); } else { log.debug("Replicated edits", entriesReplicated); } return edits; } else if (edits.entriesConsumed > 0) { return edits; } return new ReplicationStats(0l, 0l, 0l); }
Source:
protected String getMemoryArgs() { return "-Xms1303m -Xmx1303m -XX:MaxPermSize=256m "; }

Target:
protected String getMemoryArgs() { return "-Xms64m -Xmx512m -XX:MaxPermSize=256m "; }
Source:
public List<TopicRef> mergeTags(Collection<TopicRef>... topicCollections) { ImmutableSet.Builder<Equivalence.Wrapper<TopicRef>> setBuilder = new ImmutableSet.Builder<>(); setBuilder.addAll( Arrays.asList(topicCollections).stream() .flatMap(topicCollection -> topicCollection.stream()) .map(equivalator::wrap) .collect(Collectors.toList())); return setBuilder.build().stream() .map(Equivalence.Wrapper::get) .collect(Collectors.toList()); }

Target:
public List<TopicRef> mergeTags(Collection<TopicRef>... topicCollections) { Set<Equivalence.Wrapper<TopicRef>> dedupedTopics = Arrays.asList(topicCollections).stream() .flatMap(topicCollection -> topicCollection.stream()) .map(equivalator::wrap) .collect(ImmutableCollectors.toSet()); return dedupedTopics.stream() .map(Equivalence.Wrapper::get) .collect(Collectors.toList()); }
Source:
private void fillGraphFromAGroup(final List<? extends PhysicalLocation> wholeList, final List<Integer> groupList, final boolean logProgress, final ProgressLogger progressLoggerForKeeper, final int distance, final GraphUtils.Graph<Integer> opticalDistanceRelationGraph) { for (int i = 0; i < groupList.size(); i++) { final int iIndex = groupList.get(i); final PhysicalLocation currentLoc = wholeList.get(iIndex); if (logProgress) { progressLoggerForKeeper.record(String.format("%d", currentLoc.getReadGroup()), currentLoc.getX()); } for (int j = i + 1; j < groupList.size(); j++) { final int jIndex = groupList.get(j); PhysicalLocation other = wholeList.get(jIndex); if (closeEnougnShort(currentLoc, other, distance)) { opticalDistanceRelationGraph.addEdge(iIndex, jIndex); } } } }

Target:
private void fillGraphFromAGroup(final List<? extends PhysicalLocation> wholeList, final List<Integer> groupList, final boolean logProgress, final ProgressLogger progressLoggerForKeeper, final int distance, final GraphUtils.Graph<Integer> opticalDistanceRelationGraph) { for (int i = 0; i < groupList.size(); i++) { final int iIndex = groupList.get(i); final PhysicalLocation currentLoc = wholeList.get(iIndex); if (logProgress) { progressLoggerForKeeper.record(String.format("%d", currentLoc.getReadGroup()), currentLoc.getX()); } for (int j = i + 1; j < groupList.size(); j++) { final int jIndex = groupList.get(j); final PhysicalLocation other = wholeList.get(jIndex); if (closeEnoughShort(currentLoc, other, distance)) { opticalDistanceRelationGraph.addEdge(iIndex, jIndex); } } } }
Source:
private synchronized void runHooks() { if (m_iAmAServer && !m_crashing && ShutdownHooks.m_crashMessage) { VoltLogger voltLogger = new VoltLogger("HOST"); voltLogger.warn("******************************************************************************************"); voltLogger.warn("********* The VoltDB server will shut down due to a control-C or other JVM exit. *********"); voltLogger.warn("******************************************************************************************\n"); } for (Entry<Integer, List<ShutdownTask>> tasks : m_shutdownTasks.entrySet()) { for (ShutdownTask task : tasks.getValue()) { if (!m_crashing || (m_crashing && task.m_runOnCrash)) { try { task.m_action.run(); } catch (Exception e) { new VoltLogger("CONSOLE").warn("Exception while running shutdown hooks.", e); } } } } VoltLogger.shutdownAsynchronousLogging(); if (m_finalAction != null) { try { m_finalAction.run(); } catch (Exception e) } }

Target:
private synchronized void runHooks() { if (m_iAmAServer && !m_crashing && ShutdownHooks.m_crashMessage) { VoltLogger voltLogger = new VoltLogger("CONSOLE"); String msg = "The VoltDB server will shut down due to a control-C or other JVM exit."; CoreUtils.PrintGoodLookingLog(voltLogger, msg, Level.WARN); } for (Entry<Integer, List<ShutdownTask>> tasks : m_shutdownTasks.entrySet()) { for (ShutdownTask task : tasks.getValue()) { if (!m_crashing || (m_crashing && task.m_runOnCrash)) { try { task.m_action.run(); } catch (Exception e) { new VoltLogger("CONSOLE").warn("Exception while running shutdown hooks.", e); } } } } VoltLogger.shutdownAsynchronousLogging(); if (m_finalAction != null) { try { m_finalAction.run(); } catch (Exception e) } }
Source:
public void formatValue(String fieldName, RefObject<String> relations, RefObject<String> value, boolean caseSensitive) { if (StringHelper.EqOp(fieldName, "CREATIONDATE")) { java.util.Date tmp = new java.util.Date(java.util.Date.parse(StringHelper.trim(value.argvalue, '\''))); value.argvalue = StringFormat.format("'%1$s'", tmp); } else { super.formatValue(fieldName, relations, value, caseSensitive); } }

Target:
public void formatValue(String fieldName, RefObject<String> relations, RefObject<String> value, boolean caseSensitive) { if (StringHelper.EqOp(fieldName, "CREATIONDATE")) { Date tmp = new Date(Date.parse(StringHelper.trim(value.argvalue, '\''))); value.argvalue = StringFormat.format("'%1$s'", tmp); } else { super.formatValue(fieldName, relations, value, caseSensitive); } }
Source:
private void configureWorkerIntegrationFlow() { Assert.notNull(this.inputChannel, "An InputChannel must be provided"); Assert.notNull(this.jobExplorer, "A JobExplorer must be provided"); if (this.stepLocator == null) { BeanFactoryStepLocator beanFactoryStepLocator = new BeanFactoryStepLocator(); beanFactoryStepLocator.setBeanFactory(this.beanFactory); this.stepLocator = beanFactoryStepLocator; } if (this.outputChannel == null) { this.outputChannel = new NullChannel(); } StepExecutionRequestHandler stepExecutionRequestHandler = new StepExecutionRequestHandler(); stepExecutionRequestHandler.setJobExplorer(this.jobExplorer); stepExecutionRequestHandler.setStepLocator(this.stepLocator); StandardIntegrationFlow standardIntegrationFlow = IntegrationFlows .from(this.inputChannel) .handle(stepExecutionRequestHandler, SERVICE_ACTIVATOR_METHOD_NAME) .channel(this.outputChannel) .get(); IntegrationFlowContext integrationFlowContext = this.beanFactory.getBean(IntegrationFlowContext.class); integrationFlowContext.registration(standardIntegrationFlow) .autoStartup(false) .register(); }

Target:
private void configureWorkerIntegrationFlow() { Assert.notNull(this.inputChannel, "An InputChannel must be provided"); Assert.notNull(this.jobExplorer, "A JobExplorer must be provided"); if (this.stepLocator == null) { BeanFactoryStepLocator beanFactoryStepLocator = new BeanFactoryStepLocator(); beanFactoryStepLocator.setBeanFactory(this.beanFactory); this.stepLocator = beanFactoryStepLocator; } if (this.outputChannel == null) { if (logger.isDebugEnabled()) { logger.debug("The output channel is set to a NullChannel. " + "The master step must poll the job repository for workers status."); } this.outputChannel = new NullChannel(); } StepExecutionRequestHandler stepExecutionRequestHandler = new StepExecutionRequestHandler(); stepExecutionRequestHandler.setJobExplorer(this.jobExplorer); stepExecutionRequestHandler.setStepLocator(this.stepLocator); StandardIntegrationFlow standardIntegrationFlow = IntegrationFlows .from(this.inputChannel) .handle(stepExecutionRequestHandler, SERVICE_ACTIVATOR_METHOD_NAME) .channel(this.outputChannel) .get(); IntegrationFlowContext integrationFlowContext = this.beanFactory.getBean(IntegrationFlowContext.class); integrationFlowContext.registration(standardIntegrationFlow) .autoStartup(false) .register(); }
Source:
protected Builder() { id("packet") .name("Packet API") .identityName("We can use project Id") .credentialName("Must be Token") .documentation(URI.create("<LINK_1>")) .defaultEndpoint("<LINK_0>") .defaultProperties(PacketApiMetadata.defaultProperties()) .view(typeToken(ComputeServiceContext.class)) .defaultModules(ImmutableSet.<Class<? extends Module>>builder() .add(PacketHttpApiModule.class) .build()); }

Target:
protected Builder() { id("packet") .name("Packet API") .identityName("Packet Project Id") .credentialName("Must be Packet Token") .documentation(URI.create("<LINK_1>")) .defaultEndpoint("<LINK_0>") .defaultProperties(PacketApiMetadata.defaultProperties()) .defaultModules(ImmutableSet.<Class<? extends Module>>builder() .add(PacketHttpApiModule.class) .add(PacketComputeParserModule.class) .build()); }
Source:
void refreshChildren() { IFolder folder = getResource(); Map<String, ITmfProjectModelElement> childrenMap = new HashMap<>(); for (TmfTraceElement trace : getTraces()) { childrenMap.put(trace.getElementPath(), trace); } List<IResource> members = getTraceResources(); for (IResource resource : members) { String name = resource.getName(); String elementPath = resource.getFullPath().makeRelativeTo(folder.getFullPath()).toString(); ITmfProjectModelElement element = childrenMap.get(elementPath); if (element instanceof TmfTraceElement) { childrenMap.remove(elementPath); } else { element = new TmfTraceElement(name, resource, this); } } for (ITmfProjectModelElement danglingChild : childrenMap.values()) { removeChild(danglingChild); } super.refreshChildren(); ITmfTrace experiment = getTrace(); if (experiment == null) { return; } Map<String, TmfAnalysisElement> analysisMap = new HashMap<>(); for (TmfAnalysisElement analysis : getAvailableAnalysis()) { childrenMap.put(analysis.getAnalysisId(), analysis); } for (IAnalysisModuleHelper module : TmfAnalysisManager.getAnalysisModules().values()) { if (!analysisMap.containsKey(module.getId()) && module.appliesToExperiment() && (experiment.getAnalysisModule(module.getId()) != null)) { IFolder newresource = ResourcesPlugin.getWorkspace().getRoot().getFolder(fResource.getFullPath().append(module.getId())); TmfAnalysisElement analysis = new TmfAnalysisElement(module.getName(), newresource, this, module); analysis.refreshChildren(); analysisMap.put(module.getId(), analysis); } } }

Target:
void refreshChildren() { IFolder folder = getResource(); Map<String, ITmfProjectModelElement> childrenMap = new HashMap<>(); for (TmfTraceElement trace : getTraces()) { childrenMap.put(trace.getElementPath(), trace); } List<IResource> members = getTraceResources(); for (IResource resource : members) { String name = resource.getName(); String elementPath = resource.getFullPath().makeRelativeTo(folder.getFullPath()).toString(); ITmfProjectModelElement element = childrenMap.get(elementPath); if (element instanceof TmfTraceElement) { childrenMap.remove(elementPath); } else { element = new TmfTraceElement(name, resource, this); } } for (ITmfProjectModelElement danglingChild : childrenMap.values()) { removeChild(danglingChild); } super.refreshChildren(); ITmfTrace experiment = getTrace(); if (experiment == null) { return; } Map<String, TmfAnalysisElement> analysisMap = new HashMap<>(); for (TmfAnalysisElement analysis : getAvailableAnalysis()) { analysisMap.put(analysis.getAnalysisId(), analysis); } for (IAnalysisModuleHelper module : TmfAnalysisManager.getAnalysisModules().values()) { if (!analysisMap.containsKey(module.getId()) && module.appliesToExperiment() && (experiment.getAnalysisModule(module.getId()) != null)) { IFolder newresource = ResourcesPlugin.getWorkspace().getRoot().getFolder(fResource.getFullPath().append(module.getId())); TmfAnalysisElement analysis = new TmfAnalysisElement(module.getName(), newresource, this, module); analysis.refreshChildren(); analysisMap.put(module.getId(), analysis); } } }
Source:
public boolean validateBufferCapacity(int bufferCapacity) { int numBucketsNeeded = (int) Math.ceil((limit + 1) / maxLoadFactor); int targetTableArenaSize = numBucketsNeeded * bucketSize * 2; int heapSize = (limit + 1) * (Ints.BYTES); int requiredSize = targetTableArenaSize + heapSize; if (bufferCapacity < requiredSize) { log.info( "Buffer capacity [%d] is too small for limit[%d] with load factor[%f], " + "minimum bytes needed: [%d], not applying limit push down optimization.", bufferCapacity, limit, maxLoadFactor, requiredSize ); return false; } else { return true; } }

Target:
public boolean validateBufferCapacity(int bufferCapacity) { int numBucketsNeeded = (int) Math.ceil((limit + 1) / maxLoadFactor); int targetTableArenaSize = numBucketsNeeded * bucketSize * 2; int heapSize = (limit + 1) * (Ints.BYTES); int requiredSize = targetTableArenaSize + heapSize; if (bufferCapacity < requiredSize) { log.debug( "Buffer capacity [%,d] is too small for limit[%d] with load factor[%f], " + "minimum bytes needed: [%,d], not applying limit push down optimization.", bufferCapacity, limit, maxLoadFactor, requiredSize ); return false; } else { return true; } }
Source:
protected void initDisplayer() { completeTaskCallback(this); inlineFrame.setWidth("100%"); inlineFrame.setHeight("100%"); inlineFrame.getElement().setPropertyBoolean("webkitallowfullscreen", true); inlineFrame.getElement().setPropertyBoolean("mozallowfullscreen", true); inlineFrame.getElement().setPropertyBoolean("allowfullscreen", true); inlineFrame.getElement().getStyle().setBorderWidth(0, Style.Unit.PX); inlineFrame.getElement().getStyle().setPosition(Position.ABSOLUTE); inlineFrame.getElement().getStyle().setTop(0, Unit.PX); inlineFrame.getElement().getStyle().setLeft(0, Unit.PX); inlineFrame.setUrl(renderingSettings.getUrl()); FlowPanel div = new FlowPanel(); div.getElement().getStyle().setPosition(Position.RELATIVE); div.getElement().getStyle().setOverflow(Overflow.HIDDEN); div.getElement().getStyle().setPaddingTop(40, Unit.PCT); div.add(inlineFrame); formContainer.add(div); }

Target:
protected void initDisplayer() { completeTaskCallback(this); inlineFrame.setWidth("100%"); inlineFrame.setHeight("100%"); inlineFrame.getElement().setPropertyBoolean("webkitallowfullscreen", true); inlineFrame.getElement().setPropertyBoolean("mozallowfullscreen", true); inlineFrame.getElement().setPropertyBoolean("allowfullscreen", true); inlineFrame.getElement().getStyle().setBorderWidth(0, Style.Unit.PX); inlineFrame.getElement().getStyle().setPosition(Position.ABSOLUTE); inlineFrame.getElement().getStyle().setTop(0, Unit.PX); inlineFrame.getElement().getStyle().setLeft(0, Unit.PX); inlineFrame.setUrl(renderingSettings.getUrl()); FlowPanel div = GWT.create(FlowPanel.class); div.getElement().getStyle().setPosition(Position.RELATIVE); div.getElement().getStyle().setOverflow(Overflow.HIDDEN); div.getElement().getStyle().setPaddingTop(40, Unit.PCT); div.add(inlineFrame); formContainer.add(div); }
Source:
private boolean isNonconformityForRemovedRequirement(SurveillanceNonconformityEntity nonconformity) { if (!ff4j.check(FeatureList.EFFECTIVE_RULE_DATE_PLUS_ONE_WEEK)) { return false; } return nonconformity != null && nonconformity.getType().equalsIgnoreCase("170.523 (k)(2)"); }

Target:
private boolean isNonconformityForRemovedRequirement(SurveillanceNonconformityEntity nonconformity) { if (!ff4j.check(FeatureList.EFFECTIVE_RULE_DATE_PLUS_ONE_WEEK)) { return false; } return nonconformity != null && nonconformity.getType().equalsIgnoreCase(NonconformityType.K2.getName()); }
Source:
public int hashCode() { int result = 17; result = 31 * result + super.hashCode(); result = 31 * result + Objects.hashCode(bs); result = 31 * result + Objects.hashCode(join); result = 31 * result + Objects.hashCode(side); result = 31 * result + Objects.hashCode(varOrder); return result; }

Target:
public int hashCode() { return Objects.hash(super.getBatchSize(), super.getColumn(), super.getSpan(), super.getTask(), bs, join, side, varOrder); }
Source:
public int onUpdate(int type) { if (type == Level.BLOCK_UPDATE_NORMAL) { if (this.getSide(Vector3.SIDE_DOWN).getId() != SOUL_SAND) { this.getLevel().useBreakOn(this); return Level.BLOCK_UPDATE_NORMAL; } } else if (type == Level.BLOCK_UPDATE_RANDOM) { if (new Random().nextInt(10) == 1) { if (this.meta < 0x02) { BlockNetherWart block = (BlockNetherWart) this.clone(); ++block.meta; BlockGrowEvent ev = new BlockGrowEvent(this, block); Server.getInstance().getPluginManager().callEvent(ev); if (!ev.isCancelled()) { this.getLevel().setBlock(this, ev.getNewState(), true, true); } else { return Level.BLOCK_UPDATE_RANDOM; } } } else { return Level.BLOCK_UPDATE_RANDOM; } } return 0; }

Target:
public int onUpdate(int type) { if (type == Level.BLOCK_UPDATE_NORMAL) { if (this.getSide(Vector3.SIDE_DOWN).getId() != SOUL_SAND) { this.getLevel().useBreakOn(this); return Level.BLOCK_UPDATE_NORMAL; } } else if (type == Level.BLOCK_UPDATE_RANDOM) { if (new Random().nextInt(10) == 1) { if (this.meta < 0x03) { BlockNetherWart block = (BlockNetherWart) this.clone(); ++block.meta; BlockGrowEvent ev = new BlockGrowEvent(this, block); Server.getInstance().getPluginManager().callEvent(ev); if (!ev.isCancelled()) { this.getLevel().setBlock(this, ev.getNewState(), true, true); } else { return Level.BLOCK_UPDATE_RANDOM; } } } else { return Level.BLOCK_UPDATE_RANDOM; } } return 0; }