auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void executeVmCommand() { vmHandler.warnMemorySizeLegal(getParameters().getVm().getStaticData(), getEffectiveCompatibilityVersion()); if (!canAddVm(destStorages.values())) { log.error("Failed to add VM. The reasons are: {}", String.join(",", getReturnValue().getValidationMessages())); return; } if (!addDefaultVmLease(getParameters().getVm().getStaticData())) { return; } TransactionSupport.executeInNewTransaction(() -> { addVmStatic(); addVmDynamic(); addVmNetwork(); addVmNumaNodes(); addVmStatistics(); addActiveSnapshot(); addVmPermission(); addVmInit(); addVmRngDevice(); addAffinityLabels(); getCompensationContext().stateChanged(); return null; }); if (addVmImages()) { TransactionSupport.executeInNewTransaction(() -> { copyDiskVmElements(); copyVmDevices(); addDiskPermissions(); addVmPayload(); updateSmartCardDevices(); addVmWatchdog(); addGraphicsDevice(); getVmDeviceUtils().updateVirtioScsiController(getVm().getStaticData(), getParameters().isVirtioScsiEnabled()); setActionReturnValue(getVm().getId()); setSucceeded(true); return null; }); } if (getParameters().getPoolId() != null) { addVmToPool(); } discardHelper.logIfDisksWithIllegalPassDiscardExist(getVmId()); }

Target:
protected void executeVmCommand() { vmHandler.warnMemorySizeLegal(getParameters().getVm().getStaticData(), getEffectiveCompatibilityVersion()); if (!canAddVm(destStorages.values())) { log.error("Failed to add VM. The reasons are: {}", String.join(",", getReturnValue().getValidationMessages())); return; } getParameters().getVm().setLeaseStorageDomainId(getDefaultVmLease(getParameters().getVm().getStaticData())); if (!addVmLease(getParameters().getVm().getLeaseStorageDomainId(), getVmId(), false)) { return; } TransactionSupport.executeInNewTransaction(() -> { addVmStatic(); addVmDynamic(); addVmNetwork(); addVmNumaNodes(); addVmStatistics(); addActiveSnapshot(); addVmPermission(); addVmInit(); addVmRngDevice(); addAffinityLabels(); getCompensationContext().stateChanged(); return null; }); if (addVmImages()) { TransactionSupport.executeInNewTransaction(() -> { copyDiskVmElements(); copyVmDevices(); addDiskPermissions(); addVmPayload(); updateSmartCardDevices(); addVmWatchdog(); addGraphicsDevice(); getVmDeviceUtils().updateVirtioScsiController(getVm().getStaticData(), getParameters().isVirtioScsiEnabled()); setActionReturnValue(getVm().getId()); setSucceeded(true); return null; }); } if (getParameters().getPoolId() != null) { addVmToPool(); } discardHelper.logIfDisksWithIllegalPassDiscardExist(getVmId()); }
Source:
public void testExecute_withNewStudent_shouldBeAddedToDatabase() { String courseId = typicalBundle.students.get("student1InCourse1").getCourse(); StudentAttributes newStudent = getTypicalNewStudent(courseId); StudentsEnrollRequest req = prepareRequest(Arrays.asList(newStudent)); loginAsInstructor(typicalBundle.instructors.get("instructor1OfCourse1").getGoogleId()); List<StudentData> enrolledStudents = executeActionAndReturnResults(courseId, req); assertEquals(1, enrolledStudents.size()); verifyStudentInDatabase(newStudent, enrolledStudents.get(0).getCourseId(), enrolledStudents.get(0).getEmail()); }

Target:
public void testExecute_withNewStudent_shouldBeAddedToDatabase() { String courseId = typicalBundle.students.get("student1InCourse1").getCourse(); StudentAttributes newStudent = getTypicalNewStudent(courseId); StudentsEnrollRequest req = prepareRequest(Arrays.asList(newStudent)); loginAsInstructor(typicalBundle.instructors.get("instructor1OfCourse1").getGoogleId()); List<StudentData> enrolledStudents = executeActionAndReturnResults(courseId, req); assertEquals(1, enrolledStudents.size()); verifyStudentInDatabase(newStudent, enrolledStudents.get(0).getCourseId(), enrolledStudents.get(0).getEmail()); verifyCorrectResponseData(req.getStudentEnrollRequests().get(0), enrolledStudents.get(0)); }
Source:
public void configure(ResourceInfo resourceInfo, FeatureContext context) { AnnotatedMethod am = new AnnotatedMethod(resourceInfo.getResourceMethod()); if (am.isAnnotationPresent(Auth.class)) { context.register(new AuthFilter(authHandler)); } }

Target:
public void configure(ResourceInfo resourceInfo, FeatureContext context) { AnnotatedMethod am = new AnnotatedMethod(resourceInfo.getResourceMethod()); if (am.isAnnotationPresent(Auth.class)) { Auth auth = am.getAnnotation(Auth.class); context.register(new AuthFilter(authHandler, auth.required())); } }
Source:
public void getMetadataTest() { HashMap<String, String> metaData = new HashMap<String, String>(); metaData.put("a", "1"); metaData.put("b", "2"); metaData.put("c", "3"); se1.setMetaData(metaData); assertEquals("2", se1.getMeta("b")); }

Target:
public void getMetadataTest() { Map<String, String> metaData = new HashMap<String, String>(); metaData.put("a", "1"); metaData.put("b", "2"); metaData.put("c", "3"); se1.setMetaData(metaData); assertEquals("2", se1.getMeta("b")); }
Source:
public void fetchesCommit() throws IOException { final Commit cmmt = StatusTest.commit(); MatcherAssert.assertThat( new Status.Smart( new RtStatus(cmmt, Json.createObjectBuilder().build()) ).commit(), Matchers.equalTo(cmmt) ); }

Target:
public void fetchesCommit() throws Exception { final Commit cmmt = StatusTest.commit(); MatcherAssert.assertThat( new Status.Smart( new RtStatus(cmmt, Json.createObjectBuilder().build()) ).commit(), Matchers.equalTo(cmmt) ); }
Source:
public void invalidateCachedUsernames(String[] usernameList) { if (usernameList == null || usernameList.length == 0) { log.debug("No username received to invalidate Gateway Username Cache."); return; } for (String username : usernameList) { String tenantDomain = MultitenantUtils.getTenantDomain(username); boolean startTenantFlow = startTenantFlow(tenantDomain); Cache gatewayUsernameCache = getCacheManager(). getCache(APIConstants.GATEWAY_USERNAME_CACHE_NAME); Cache gatewayInvalidUsernameCache = getCacheManager(). getCache(APIConstants.GATEWAY_INVALID_USERNAME_CACHE_NAME); if (gatewayUsernameCache != null) { gatewayUsernameCache.remove(username); } if (gatewayInvalidUsernameCache != null) { gatewayInvalidUsernameCache.put(username, UUID.randomUUID().toString()); } if (startTenantFlow) { endTenantFlow(); } } }

Target:
public void invalidateCachedUsernames(String[] usernameList) { if (usernameList == null || usernameList.length == 0) { log.debug("No username received to invalidate Gateway Username Cache."); return; } Map<String, Set<String>> tenantDomainMap = new HashMap<>(); for (String username : usernameList) { String tenantDomain = MultitenantUtils.getTenantDomain(username); Set<String> usersInTenant = tenantDomainMap.get(tenantDomain); if (usersInTenant == null) { usersInTenant = new HashSet<>(); } usersInTenant.add(username); tenantDomainMap.put(tenantDomain, usersInTenant); } for (Map.Entry<String, Set<String>> tenantEntry : tenantDomainMap.entrySet()) { boolean startTenantFlow = false; try { startTenantFlow = startTenantFlow(tenantEntry.getKey()); Cache gatewayUsernameCache = getCacheManager(). getCache(APIConstants.GATEWAY_USERNAME_CACHE_NAME); Cache gatewayInvalidUsernameCache = getCacheManager(). getCache(APIConstants.GATEWAY_INVALID_USERNAME_CACHE_NAME); for (String username : tenantEntry.getValue()) { if (gatewayUsernameCache != null) { gatewayUsernameCache.remove(username); } if (gatewayInvalidUsernameCache != null) { gatewayInvalidUsernameCache.put(username, UUID.randomUUID().toString()); } } } finally { if (startTenantFlow) { endTenantFlow(); } } } }
Source:
public String getUuidProperty() { return RestConstants.PROGRAM_ATTRIBUTE_TYPE_UUID; }

Target:
public String getUuidProperty() { return RestTestConstants2_2.PROGRAM_ATTRIBUTE_TYPE_UUID; }
Source:
public void listenBucketNotification(String bucketName, String prefix, String suffix, String[] events, BucketEventListener eventCallback) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException, InvalidResponseException { Multimap<String,String> queryParamMap = HashMultimap.create(); queryParamMap.put("prefix", prefix); queryParamMap.put("suffix", suffix); for (String event: events) { queryParamMap.put("events", event); } String bodyContent = ""; Scanner scanner = null; HttpResponse response = null; ObjectMapper mapper = new ObjectMapper(); try { response = executeReq(Method.GET, getRegion(bucketName), bucketName, "", null, queryParamMap, null, 0); scanner = new Scanner(response.body().charStream()); scanner.useDelimiter("\n"); while (scanner.hasNext()) { if (!continueListening) { bodyContent = scanner.next().trim(); if (bodyContent.equals("")) { continue; } NotificationInfo ni = mapper.readValue(bodyContent, NotificationInfo.class); eventCallback.updateEvent(ni); } else { break ; } } } catch (RuntimeException e) { throw e; } catch (Exception e) { throw e; } finally { if (response != null) { response.body().close(); } if (scanner != null) { scanner.close(); } } }

Target:
public void listenBucketNotification(String bucketName, String prefix, String suffix, String[] events, BucketEventListener eventCallback) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException, InvalidResponseException { Multimap<String,String> queryParamMap = HashMultimap.create(); queryParamMap.put("prefix", prefix); queryParamMap.put("suffix", suffix); for (String event: events) { queryParamMap.put("events", event); } String bodyContent = ""; Scanner scanner = null; HttpResponse response = null; ObjectMapper mapper = new ObjectMapper(); try { response = executeReq(Method.GET, getRegion(bucketName), bucketName, "", null, queryParamMap, null, 0); scanner = new Scanner(response.body().charStream()); scanner.useDelimiter("\n"); while (scanner.hasNext()) { bodyContent = scanner.next().trim(); if (bodyContent.equals("")) { continue; } NotificationInfo ni = mapper.readValue(bodyContent, NotificationInfo.class); eventCallback.updateEvent(ni); } } catch (RuntimeException e) { throw e; } catch (Exception e) { throw e; } finally { if (response != null) { response.body().close(); } if (scanner != null) { scanner.close(); } } }
Source:
private SafeHtmlBuilder formatHashtags(JsArrayString hashtags) { SafeHtmlBuilder html = new SafeHtmlBuilder(); Iterator<String> itr = Natives.asList(hashtags).iterator(); while (itr.hasNext()) { String hashtagName = itr.next(); html.openSpan() .setAttribute(DATA_ID, hashtagName) .setStyleName(style.hashtagName()) .openAnchor() .setAttribute("href", "#" + PageLinks.toChangeQuery("hashtag:\"" + hashtagName + "\"")) .setAttribute("role", "listitem") .append("#").append(hashtagName) .closeAnchor() .openElement("button") .setAttribute("title", "Remove hashtag") .setAttribute("onclick", REMOVE + "(event)") .append( "â") .closeElement("button") .closeSpan(); if (itr.hasNext()) { html.append(' '); } } return html; }

Target:
private SafeHtmlBuilder formatHashtags(JsArrayString hashtags) { SafeHtmlBuilder html = new SafeHtmlBuilder(); Iterator<String> itr = Natives.asList(hashtags).iterator(); while (itr.hasNext()) { String hashtagName = itr.next(); html.openSpan() .setAttribute(DATA_ID, hashtagName) .setStyleName(style.hashtagName()) .openAnchor() .setAttribute("href", "#" + PageLinks.toChangeQuery("hashtag:\"" + hashtagName + "\"")) .setAttribute("role", "listitem") .append("#").append(hashtagName) .closeAnchor() .openElement("button") .setAttribute("title", "Remove hashtag") .setAttribute("onclick", REMOVE + "(event)") .append( "☒") .closeElement("button") .closeSpan(); if (itr.hasNext()) { html.append(' '); } } return html; }
Source:
public void showDriverVersion(){ try { DatabaseMetaData meta = connection.getMetaData(); logger.info(String.format(Locale.ENGLISH,"Using JDBC Driver %s",meta.getDriverVersion())); } catch( SQLException e ) { logger.warn(String.format(Locale.ENGLISH,"Can't get JDBC Driver version. Reason: %s",e.toString())); } }

Target:
public void showDriverVersion() throws SQLException { DatabaseMetaData meta = connection.getMetaData(); logger.info(String.format(Locale.ENGLISH,"Using JDBC Driver %s",meta.getDriverVersion())); }
Source:
public void testGetDocIds() throws Exception { long startTime = new Date().getTime(); RecordingDocIdPusher pusher = (RecordingDocIdPusher) context.getDocIdPusher(); config.overrideKey("feed.maxUrls", "5"); adaptor.init(context); adaptor.getDocIds(pusher); List<Record> golden = ImmutableList.of( new Record.Builder(new DocId("pseudo/type=document")) .setCrawlImmediately(true).build()); assertEquals(golden, pusher.getRecords()); }

Target:
public void testGetDocIds() throws Exception { RecordingDocIdPusher pusher = getContextPusher(); config.overrideKey("feed.maxUrls", "5"); adaptor.init(context); adaptor.getDocIds(pusher); assertEquals(ImmutableList.of( new Record.Builder(newDocId(new Checkpoint("type=document"))) .setCrawlImmediately(true).build()), pusher.getRecords()); }
Source:
public XMLExplorerView() { super(TMF_XMLEXPLORER_VIEW); fXmlFilesPath = XmlUtils.getXmlFilesPath(); }

Target:
public XMLExplorerView() { super(ID); fXmlFilesPath = XmlUtils.getXmlFilesPath(); }
Source:
public void submitCloudletList(List<? extends Cloudlet> list) { sortCloudletsIfComparatorIsSet(list); setBrokerForEntities(list); lastSubmittedCloudlet = setIdForEntitiesWithoutOne(list, lastSubmittedCloudlet); if(list.isEmpty()) { return; } setSimulationForCloudletUtilizationModels(list); cloudletWaitingList.addAll(list); if (!isStarted()) { return; } println(String.format( "%.2f: %s: List of %d Cloudlets submitted to the broker during simulation execution.", getSimulation().clock(), getName(), list.size())); if(getVmWaitingList().isEmpty()){ println(" Cloudlets creation request sent to Datacenter."); requestDatacentersToCreateWaitingCloudlets(); notifyOnCreationOfWaitingVmsFinishListeners(); } else println(String.format( " Waiting creation of %d VMs to send Cloudlets creation request to Datacenter.", vmWaitingList.size())); }

Target:
public void submitCloudletList(List<? extends Cloudlet> list) { sortCloudletsIfComparatorIsSet(list); setBrokerForEntities(list); lastSubmittedCloudlet = setIdForEntitiesWithoutOne(list, lastSubmittedCloudlet); if(list.isEmpty()) { return; } setSimulationForCloudletUtilizationModels(list); cloudletWaitingList.addAll(list); if (!isStarted()) { return; } println(String.format( "%.2f: %s: List of %d Cloudlets submitted to the broker during simulation execution.", getSimulation().clock(), getName(), list.size())); if(vmWaitingList.isEmpty()){ println(" Cloudlets creation request sent to Datacenter."); requestDatacentersToCreateWaitingCloudlets(); notifyOnCreationOfWaitingVmsFinishListeners(); } else println(String.format( " Waiting creation of %d VMs to send Cloudlets creation request to Datacenter.", vmWaitingList.size())); }
Source:
public void notifyCheckpointComplete(long checkpointId) throws Exception { if (keyedStateBackend != null && keyedStateBackend instanceof CheckpointListener) { ((CheckpointListener) keyedStateBackend).notifyCheckpointComplete(checkpointId); } }

Target:
public void notifyCheckpointComplete(long checkpointId) throws Exception { if (keyedStateBackend instanceof CheckpointListener) { ((CheckpointListener) keyedStateBackend).notifyCheckpointComplete(checkpointId); } }
Source:
public String rangeParser(List<String> values) { try { return String.valueOf(ThreadLocalRandom.current().nextInt( Integer.valueOf(values.get(0)), Integer.valueOf(values.get(1)))); } catch (NullPointerException | IllegalArgumentException e) { log.error("range values are wrong, skip and parse 0, " + "please review applicaion.conf {}", e.getStackTrace()); return "0"; } }

Target:
public String rangeParser(List<String> values) { try { return String.valueOf(ThreadLocalRandom.current().nextInt( Integer.valueOf(values.get(0)), Integer.valueOf(values.get(1)))); } catch (IllegalArgumentException e) { log.error("range values must be a list of string {}", values, e.getStackTrace()); return "0"; } }
Source:
public NodeInstanceList getProcessInstanceFullHistoryByType(long processInstanceId, String entryType, Integer page, Integer pageSize) { logger.debug("About to search for node instances with page and page size {}", page, pageSize); Collection<NodeInstanceDesc> result = null; result = runtimeDataService.getProcessInstanceFullHistoryByType(processInstanceId, EntryType.valueOf(entryType), buildQueryContext(page, pageSize)); NodeInstanceList nodeInstanceList = convertToNodeInstanceList(result); logger.debug("Returning result of node instances search: {}", nodeInstanceList); return nodeInstanceList; }

Target:
public NodeInstanceList getProcessInstanceFullHistoryByType(long processInstanceId, String entryType, Integer page, Integer pageSize) { logger.debug("About to search for node instances with page and page size {}", page, pageSize); Collection<NodeInstanceDesc> result = null; result = runtimeDataService.getProcessInstanceFullHistoryByType(processInstanceId, EntryType.valueOf(entryType), buildQueryContext(page, pageSize)); return convertToNodeInstanceList(result); }
Source:
TestJettyHttpsClientPem() { super("localhost", getResource("server.keystore").toString()); }

Target:
public TestJettyHttpsClientPem() { super("localhost", getResource("server.keystore").toString()); }
Source:
private void stopChores() { ChoreService choreService = getChoreService(); if (choreService != null) { choreService.cancelChore(this.mobFileCleanerChore); choreService.cancelChore(this.mobFileCompactionChore); choreService.cancelChore(this.balancerChore); Optional.ofNullable(this.regionNormalizerManager) .map(RegionNormalizerManager::getRegionNormalizerChore) .ifPresent(choreService::cancelChore); choreService.cancelChore(this.clusterStatusChore); choreService.cancelChore(this.catalogJanitorChore); choreService.cancelChore(this.clusterStatusPublisherChore); choreService.cancelChore(this.snapshotQuotaChore); choreService.cancelChore(this.logCleaner); choreService.cancelChore(this.hfileCleaner); choreService.cancelChore(this.replicationBarrierCleaner); choreService.cancelChore(this.snapshotCleanerChore); choreService.cancelChore(this.hbckChore); choreService.cancelChore(this.regionsRecoveryChore); } }

Target:
private void stopChores() { ChoreService choreService = getChoreService(); if (choreService != null) { choreService.cancelChore(this.mobFileCleanerChore); choreService.cancelChore(this.mobFileCompactionChore); choreService.cancelChore(this.balancerChore); if (regionNormalizerManager != null) { choreService.cancelChore(regionNormalizerManager.getRegionNormalizerChore()); } choreService.cancelChore(this.clusterStatusChore); choreService.cancelChore(this.catalogJanitorChore); choreService.cancelChore(this.clusterStatusPublisherChore); choreService.cancelChore(this.snapshotQuotaChore); choreService.cancelChore(this.logCleaner); choreService.cancelChore(this.hfileCleaner); choreService.cancelChore(this.replicationBarrierCleaner); choreService.cancelChore(this.snapshotCleanerChore); choreService.cancelChore(this.hbckChore); choreService.cancelChore(this.regionsRecoveryChore); } }
Source:
public boolean isDepleted() { return ExcavatorHandler.mineralVeinYield==0||getDepletion() >= ExcavatorHandler.mineralVeinYield; }

Target:
public boolean isDepleted() { return ExcavatorHandler.mineralVeinYield > 0&&getDepletion() >= ExcavatorHandler.mineralVeinYield; }
Source:
public RemoveExternalSubnetModel(SearchableListModel<?> sourceListModel, List<ExternalSubnet> subnets) { setTitle(ConstantsManager.getInstance().getConstants().removeExternalSubnetTitle()); setHashName("remove_external_subnet"); this.sourceListModel = sourceListModel; this.subnets = subnets; ArrayList<String> items = new ArrayList<String>(); for (ExternalSubnet subnet : subnets) { items.add(subnet.getName()); } setItems(items); UICommand tempVar = new UICommand("OnRemove", this); tempVar.setTitle(ConstantsManager.getInstance().getConstants().ok()); tempVar.setIsDefault(true); getCommands().add(tempVar); UICommand tempVar2 = new UICommand("Cancel", this); tempVar2.setTitle(ConstantsManager.getInstance().getConstants().cancel()); tempVar2.setIsCancel(true); getCommands().add(tempVar2); }

Target:
public RemoveExternalSubnetModel(SearchableListModel<?> sourceListModel, List<ExternalSubnet> subnets) { setHashName("remove_external_subnet"); this.sourceListModel = sourceListModel; this.subnets = subnets; ArrayList<String> items = new ArrayList<String>(); for (ExternalSubnet subnet : subnets) { items.add(subnet.getName()); } setItems(items); UICommand tempVar = new UICommand("OnRemove", this); tempVar.setTitle(ConstantsManager.getInstance().getConstants().ok()); tempVar.setIsDefault(true); getCommands().add(tempVar); UICommand tempVar2 = new UICommand("Cancel", this); tempVar2.setTitle(ConstantsManager.getInstance().getConstants().cancel()); tempVar2.setIsCancel(true); getCommands().add(tempVar2); }
Source:
private void checkRead() { if (isPageFullyConsumed()) { if (isFullyConsumed()) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("end reached"); } repetitionLevel = 0; return; } readPage(); } readRepetitionAndDefinitionLevels(); }

Target:
private void checkRead() { if (isPageFullyConsumed()) { if (isFullyConsumed()) { LOGGER.debug("end reached"); repetitionLevel = 0; return; } readPage(); } readRepetitionAndDefinitionLevels(); }
Source:
public static String toHexString(byte[] digest) { StringBuffer buf = new StringBuffer(); for (int i = 0; i < digest.length; i++) { if ((digest[i] & 0xFF) < 0x10) buf.append('0'); buf.append(Integer.toHexString(digest[i] & 0xFF)); } return buf.toString(); }

Target:
public static String toHexString(byte[] digest) { StringBuilder buf = new StringBuilder(); for (byte element : digest) { if ((element & 0xFF) < 0x10) buf.append('0'); buf.append(Integer.toHexString(element & 0xFF)); } return buf.toString(); }
Source:
private Pages getPages(Board b) { if (savedBoards.contains(b.code)) { long lastUpdateTime = boardTimeMap.get(b.code); if (lastUpdateTime + 3 * 1000 * 60 > System.currentTimeMillis()) { } else { Logger.d(TAG, "Requesting existing board pages, timeout"); requestBoard(b); } return boardPagesMap.get(b.code); } else { Logger.d(TAG, "Requesting new board pages"); requestBoard(b); return null; } }

Target:
private Pages getPages(Board b) { if (savedBoards.contains(b.code)) { shouldUpdate(b, false); return boardPagesMap.get(b.code); } else { Logger.d(TAG, "Requesting new board pages"); requestBoard(b); return null; } }
Source:
public void addThreadFactoryInGUI() { String name = "ThreadFactoryGUI" + RandomStringUtils.randomAlphanumeric(6); ConfigFragment config = page.getConfigFragment(); WizardWindow wizard = config.getResourceManager().addResource(); Editor editor = wizard.getEditor(); editor.text("name", name); editor.text(JNDI_NAME, JNDI_VALID); wizard.clickSave(); Console.withBrowser(browser).dismissReloadRequiredWindowIfPresent(); assertTrue("Thread factory should be present in table", config.resourceIsPresent(name)); ResourceAddress address = new ResourceAddress(eeAddress).add(EE_CHILD, name); verifier.verifyResource(address, true, 5000); removeEEChild(EE_CHILD, name); }

Target:
public void addThreadFactoryInGUI() { String name = "ThreadFactoryGUI" + RandomStringUtils.randomAlphanumeric(6); ConfigFragment config = page.getConfigFragment(); WizardWindow wizard = config.getResourceManager().addResource(); Editor editor = wizard.getEditor(); editor.text("name", name); editor.text(JNDI_NAME, JNDI_VALID); wizard.saveAndDismissReloadRequiredWindow(); assertTrue("Thread factory should be present in table", config.resourceIsPresent(name)); ResourceAddress address = new ResourceAddress(eeAddress).add(EE_CHILD, name); verifier.verifyResource(address, true, 5000); removeEEChild(EE_CHILD, name); }
Source:
public void start() throws StoreException { if (started) throw new StoreException("Store already started", StoreErrorCodes.Store_Already_Started); try { File dataFile = new File(dataDir); if (!dataFile.exists()) { logger.info("data directory not found. creating it", dataDir); boolean created = dataFile.mkdir(); if (!created) throw new StoreException("Failed to create directory for data dir " + dataDir, StoreErrorCodes.Initialization_Error); } if(!dataFile.isDirectory() || !dataFile.canRead()) throw new StoreException(dataFile.getAbsolutePath() + " is either not a directory or is not readable", StoreErrorCodes.Initialization_Error); fileLock = new FileLock(new File(dataDir, LockFile)); if(!fileLock.tryLock()) throw new StoreException("Failed to acquire lock on file " + dataDir + ". Another process or thread is using this directory.", StoreErrorCodes.Initialization_Error); log = new Log(dataDir, metrics, capacityGB); index = new BlobPersistantIndex(dataDir, scheduler, log, config, factory); log.setLogEndOffset(index.getCurrentEndOffset()); started = true; } catch (Exception e) { logger.error("Error while starting store for directory with exception {}",dataDir, e); throw new StoreException("Error while starting store for dir " + dataDir, StoreErrorCodes.Initialization_Error); } }

Target:
public void start() throws StoreException { synchronized (lock) { if (started) throw new StoreException("Store already started", StoreErrorCodes.Store_Already_Started); try { File dataFile = new File(dataDir); if (!dataFile.exists()) { logger.info("data directory not found. creating it", dataDir); boolean created = dataFile.mkdir(); if (!created) throw new StoreException("Failed to create directory for data dir " + dataDir, StoreErrorCodes.Initialization_Error); } if(!dataFile.isDirectory() || !dataFile.canRead()) throw new StoreException(dataFile.getAbsolutePath() + " is either not a directory or is not readable", StoreErrorCodes.Initialization_Error); fileLock = new FileLock(new File(dataDir, LockFile)); if(!fileLock.tryLock()) throw new StoreException("Failed to acquire lock on file " + dataDir + ". Another process or thread is using this directory.", StoreErrorCodes.Initialization_Error); log = new Log(dataDir, metrics, capacityGB); index = new BlobPersistentIndex(dataDir, scheduler, log, config, factory); log.setLogEndOffset(index.getCurrentEndOffset()); started = true; } catch (Exception e) { logger.error("Error while starting store for directory with exception {}",dataDir, e); throw new StoreException("Error while starting store for dir " + dataDir, StoreErrorCodes.Initialization_Error); } } }
Source:
void notifyAllListeners(List<RealmResults<? extends RealmModel>> realmResultsToBeNotified) { for (Iterator<RealmResults<? extends RealmModel>> it = realmResultsToBeNotified.iterator(); it.hasNext() && !realm.isClosed(); ) { RealmResults<? extends RealmModel> realmResults = it.next(); realmResults.notifyChangeListeners(false); } notifyRealmObjectCallbacks(); if (!realm.isClosed() && threadContainsAsyncEmptyRealmObject()) { updateAsyncEmptyRealmObject(); } notifyGlobalListeners(); }

Target:
void notifyAllListeners(List<RealmResults<? extends RealmModel>> realmResultsToBeNotified) { for (Iterator<RealmResults<? extends RealmModel>> it = realmResultsToBeNotified.iterator(); !realm.isClosed() && it.hasNext(); ) { RealmResults<? extends RealmModel> realmResults = it.next(); realmResults.notifyChangeListeners(false); } notifyRealmObjectCallbacks(); if (!realm.isClosed() && threadContainsAsyncEmptyRealmObject()) { updateAsyncEmptyRealmObject(); } notifyGlobalListeners(); }
Source:
public static TrafficClass getDefault() { return TrafficClass.CS1; }

Target:
public static TrafficClass getDefault() { return TrafficClass.DSCP_CS1; }
Source:
private boolean checkForConflict() { TracePackageElement[] packageElements = (TracePackageElement[]) getElementViewer().getInput(); Map<TracePackageExperimentElement, HashSet<String>> experimentElements = new HashMap<>(); List<TracePackageTraceElement> traceElements = new ArrayList<>(); Map<TracePackageExperimentElement, List<TracePackageTraceElement>> experimentTracesMap = new HashMap<>(); List<TracePackageExperimentElement> experimentToRename = new ArrayList<>(); List<TracePackageTraceElement> unhandledTraces = new ArrayList<>(); for (TracePackageElement packageElement : packageElements) { TracePackageTraceElement traceElement = (TracePackageTraceElement) packageElement; if (AbstractTracePackageOperation.isFilesChecked(traceElement)) { if (traceElement instanceof TracePackageExperimentElement) { TracePackageExperimentElement experimentElement = (TracePackageExperimentElement) traceElement; experimentElements.put(experimentElement, new HashSet<>(experimentElement.getExpTraces())); if (experimentExists(experimentElement)) { experimentToRename.add(experimentElement); } } else { traceElements.add(traceElement); } } } for (TracePackageTraceElement traceElement : traceElements) { processTrace(experimentElements, traceElement, experimentTracesMap, unhandledTraces); } boolean result = true; if (!experimentTracesMap.isEmpty() || !experimentToRename.isEmpty()) { result &= handleExperimentConflict(experimentTracesMap, experimentToRename); } if (!unhandledTraces.isEmpty()) { result &= handleTracesConflict(unhandledTraces); } return result; }

Target:
private boolean checkForConflict() { TracePackageElement[] packageElements = (TracePackageElement[]) getElementViewer().getInput(); List<TracePackageExperimentElement> experimentElements = new ArrayList<>(); List<TracePackageTraceElement> traceElements = new ArrayList<>(); Map<TracePackageExperimentElement, List<TracePackageTraceElement>> experimentTracesMap = new HashMap<>(); List<TracePackageExperimentElement> experimentToRename = new ArrayList<>(); List<TracePackageTraceElement> unhandledTraces = new ArrayList<>(); for (TracePackageElement packageElement : packageElements) { TracePackageTraceElement traceElement = (TracePackageTraceElement) packageElement; if (AbstractTracePackageOperation.isFilesChecked(traceElement)) { if (traceElement instanceof TracePackageExperimentElement) { TracePackageExperimentElement experimentElement = (TracePackageExperimentElement) traceElement; experimentElements.add(experimentElement); if (experimentExists(experimentElement)) { experimentToRename.add(experimentElement); } } else { traceElements.add(traceElement); } } } for (TracePackageTraceElement traceElement : traceElements) { processTrace(experimentElements, traceElement, experimentTracesMap, unhandledTraces); } boolean result = true; if (!experimentTracesMap.isEmpty() || !experimentToRename.isEmpty()) { result &= handleExperimentConflict(experimentTracesMap, experimentToRename); } if (!unhandledTraces.isEmpty()) { result &= handleTracesConflict(unhandledTraces); } return result; }
Source:
public CcAES(final Codec codec, final byte[] key) throws IOException { final int block = 16; if (key.length != block) { throw new IllegalArgumentException( "Key length must be in 128-bit." ); } this.origin = codec; final byte[] passcode = new byte[key.length]; System.arraycopy(key, 0, passcode, 0, key.length); final SecureRandom random = new SecureRandom(); final byte[] ivbytes = new byte[block]; random.nextBytes(ivbytes); final AlgorithmParameterSpec spec = new IvParameterSpec(ivbytes); this.secret = new SecretKeySpec(passcode, "AES"); this.enc = this.create(Cipher.ENCRYPT_MODE, spec); this.dec = this.create(Cipher.DECRYPT_MODE, spec); }

Target:
public CcAES(final Codec codec, final byte[] key) throws IOException { final int block = 16; if (key.length != block) { throw new IllegalArgumentException( "Key must be with a length of 128 bits." ); } this.origin = codec; final byte[] passcode = new byte[key.length]; System.arraycopy(key, 0, passcode, 0, key.length); final SecureRandom random = new SecureRandom(); final byte[] ivbytes = new byte[block]; random.nextBytes(ivbytes); final AlgorithmParameterSpec spec = new IvParameterSpec(ivbytes); this.secret = new SecretKeySpec(passcode, "AES"); this.enc = this.create(Cipher.ENCRYPT_MODE, spec); this.dec = this.create(Cipher.DECRYPT_MODE, spec); }
Source:
public boolean accept(@NotNull HighlightInfo highlightInfo, @Nullable PsiFile file) { if (null != file) { String description = StringUtil.notNullize(highlightInfo.getDescription()); if (HighlightSeverity.WARNING.equals(highlightInfo.getSeverity())) { if (REDUNDANT_DEFAULT_PARAMETER_VALUE_ASSIGNMENT.equals(description)) { return !EqualsAndHashCodeCallSuperHandler.isEqualsAndHashCodeCallSuperDefault(highlightInfo, file); } else if (CodeInsightColors.NOT_USED_ELEMENT_ATTRIBUTES.equals(highlightInfo.type.getAttributesKey())) { if (VARIABLE_INITIALIZER_IS_REDUNDANT.matcher(description).matches()) { return !BuilderHandler.isDefaultBuilderValue(highlightInfo, file); } } } else if (HighlightSeverity.ERROR.equals(highlightInfo.getSeverity())) { if (uninitializedField(description) && LazyGetterHandler.isLazyGetterHandled(highlightInfo, file)) { return false; } return !OnXAnnotationHandler.isOnXParameterAnnotation(highlightInfo, file) && !OnXAnnotationHandler.isOnXParameterValue(highlightInfo, file) && !LOMBOK_ANYANNOTATIONREQUIRED.matcher(description).matches(); } } return true; }

Target:
public boolean accept(@NotNull HighlightInfo highlightInfo, @Nullable PsiFile file) { if (null == file) { return true; } PsiElement highlightedElement = file.findElementAt(highlightInfo.getStartOffset()); if (null == highlightedElement) { return true; } String description = StringUtil.notNullize(highlightInfo.getDescription()); if (HighlightSeverity.ERROR.equals(highlightInfo.getSeverity())) { if (uninitializedField(description) && LazyGetterHandler.isLazyGetterHandled(highlightedElement)) { return false; } return !OnXAnnotationHandler.isOnXParameterAnnotation(highlightInfo, file) && !OnXAnnotationHandler.isOnXParameterValue(highlightInfo, file) && !LOMBOK_ANYANNOTATIONREQUIRED.matcher(description).matches(); } Map<TextAttributesKey, List<LombokHighlightFilter>> severityMap = FILTERS .getOrDefault(highlightInfo.getSeverity(), Collections.emptyMap()); return severityMap.getOrDefault(highlightInfo.type.getAttributesKey(), Collections.emptyList()).stream() .filter(filter -> filter.descriptionCheck(description)) .allMatch(filter -> filter.accept(highlightedElement)); }
Source:
public void testResynchronize() throws InterruptedException { AgentMessageProcessor processor = (AgentMessageProcessor) this.agent.getMessagingClient().getMessageProcessor(); processor.processMessage( new MsgCmdResynchronize()); Assert.assertEquals( 0, this.client.messagesForTheDm.size()); Assert.assertEquals( 0, this.client.messagesForAgents.size()); TestApplicationTemplate app = new TestApplicationTemplate(); processor.scopedInstance = app.getTomcatVm(); processor.scopedInstance.setStatus( InstanceStatus.DEPLOYED_STARTED ); processor.processMessage( new MsgCmdResynchronize()); Assert.assertEquals( 0, this.client.messagesForTheDm.size()); Assert.assertEquals( 0, this.client.messagesForAgents.size()); app.getTomcat().setStatus( InstanceStatus.DEPLOYED_STARTED ); processor.processMessage( new MsgCmdResynchronize()); Assert.assertEquals( 0, this.client.messagesForTheDm.size()); Assert.assertEquals( 0, this.client.messagesForAgents.size()); app.getWar().setStatus( InstanceStatus.DEPLOYED_STARTED ); processor.processMessage( new MsgCmdResynchronize()); Assert.assertEquals( 0, this.client.messagesForTheDm.size()); Assert.assertEquals( 1, this.client.messagesForAgents.size()); }

Target:
public void testResynchronize() { AgentMessageProcessor processor = (AgentMessageProcessor) this.agent.getMessagingClient().getMessageProcessor(); processor.processMessage( new MsgCmdResynchronize()); Assert.assertEquals( 0, this.client.messagesForTheDm.size()); Assert.assertEquals( 0, this.client.messagesForAgents.size()); TestApplicationTemplate app = new TestApplicationTemplate(); processor.scopedInstance = app.getTomcatVm(); processor.scopedInstance.setStatus( InstanceStatus.DEPLOYED_STARTED ); processor.processMessage( new MsgCmdResynchronize()); Assert.assertEquals( 0, this.client.messagesForTheDm.size()); Assert.assertEquals( 0, this.client.messagesForAgents.size()); app.getTomcat().setStatus( InstanceStatus.DEPLOYED_STARTED ); processor.processMessage( new MsgCmdResynchronize()); Assert.assertEquals( 0, this.client.messagesForTheDm.size()); Assert.assertEquals( 0, this.client.messagesForAgents.size()); app.getWar().setStatus( InstanceStatus.DEPLOYED_STARTED ); processor.processMessage( new MsgCmdResynchronize()); Assert.assertEquals( 0, this.client.messagesForTheDm.size()); Assert.assertEquals( 1, this.client.messagesForAgents.size()); }
Source:
public CompletableFuture<Object> invokeAsync() throws Throwable { long flagBitSet = EnumUtil.bitSetOf(Flag.SKIP_REMOTE_LOOKUP); GetCacheEntryCommand command = commandsFactory.buildGetCacheEntryCommand(key, EnumUtil.mergeBitSets(flagBitSet, getFlagsBitSet())); command.setTopologyId(topologyId); InvocationContext invocationContext = icf.createRemoteInvocationContextForCommand(command, getOrigin()); CompletableFuture<Object> future = invoker.invokeAsync(invocationContext, command); return future.thenApply(rv -> { if (rv instanceof MVCCEntry) { if (trace) log.trace("Handling an internal cache entry..."); MVCCEntry mvccEntry = (MVCCEntry) rv; return entryFactory.createValue(mvccEntry); } else if (rv instanceof InternalCacheEntry) { InternalCacheEntry internalCacheEntry = (InternalCacheEntry) rv; return internalCacheEntry.toInternalCacheValue(); } else { return rv; } }); }

Target:
public CompletableFuture<Object> invokeAsync() throws Throwable { long flagBitSet = EnumUtil.bitSetOf(Flag.SKIP_REMOTE_LOOKUP); GetCacheEntryCommand command = commandsFactory.buildGetCacheEntryCommand(key, EnumUtil.mergeBitSets(flagBitSet, getFlagsBitSet())); command.setTopologyId(topologyId); InvocationContext invocationContext = icf.createRemoteInvocationContextForCommand(command, getOrigin()); CompletableFuture<Object> future = invoker.invokeAsync(invocationContext, command); return future.thenApply(rv -> { if (trace) log.tracef("Return value for key=%s is %s", key, rv); if (rv instanceof MVCCEntry) { MVCCEntry mvccEntry = (MVCCEntry) rv; return entryFactory.createValue(mvccEntry); } else if (rv instanceof InternalCacheEntry) { InternalCacheEntry internalCacheEntry = (InternalCacheEntry) rv; return internalCacheEntry.toInternalCacheValue(); } else { return rv; } }); }
Source:
public void testInsertTaskWithStartAndDueUpdateStatus() { RowSnapshot<TaskLists> taskList = new VirtualRowSnapshot<>(new LocalTaskListsTable(mAuthority)); RowSnapshot<Tasks> task = new VirtualRowSnapshot<>(new TaskListScoped(taskList, new TasksTable(mAuthority))); DateTime start = DateTime.now(); DateTime due = start.addDuration(new Duration(1, 1, 0)); assertThat(new Seq<>( new Put<>(taskList, new EmptyRowData<>()), new Put<>(task, new TimeData(start, due)), new Put<>(task, new StatusData(Tasks.STATUS_COMPLETED)) ), resultsIn(mClient, new Assert<>(task, new TimeData(start, due)), new AssertRelated<>( new InstanceTable(mAuthority), Instances.TASK_ID, task, new InstanceData( start.shiftTimeZone(TimeZone.getDefault()), due.shiftTimeZone(TimeZone.getDefault()), absent(), Instances.INSTANCE_STATUS_CLOSED)) )); }

Target:
public void testInsertTaskWithStartAndDueUpdateStatus() { RowSnapshot<TaskLists> taskList = new VirtualRowSnapshot<>(new LocalTaskListsTable(mAuthority)); RowSnapshot<Tasks> task = new VirtualRowSnapshot<>(new TaskListScoped(taskList, new TasksTable(mAuthority))); DateTime start = DateTime.now(); DateTime due = start.addDuration(new Duration(1, 1, 0)); assertThat(new Seq<>( new Put<>(taskList, new EmptyRowData<>()), new Put<>(task, new TimeData(start, due)), new Put<>(task, new StatusData(Tasks.STATUS_COMPLETED)) ), resultsIn(mClient, new Assert<>(task, new TimeData(start, due)), new AssertRelated<>( new InstanceTable(mAuthority), Instances.TASK_ID, task, new Composite<Instances>( new InstanceTestData( start.shiftTimeZone(TimeZone.getDefault()), due.shiftTimeZone(TimeZone.getDefault()), absent(), -1), new CharSequenceRowData<>(Tasks.TZ, "UTC")) ))); }
Source:
public boolean isDelayed() { return delayed; }

Target:
public boolean isDelayed() { return timeoutHasPassed || state.get() == DELAYED_SENDING || state.get() == DELAYED_PROCESSING; }
Source:
private String readIntegrationVersionPropertyString(MavenProject mavenProject) { if (mavenProject.getProperties() != null) { if (mavenProject.getProperties().getProperty(_integrationVersionPropertyKey) != null) { return mavenProject.getProperties().getProperty(_integrationVersionPropertyKey); } else { for (Dependency dependency : mavenProject.getDependencyManagement().getDependencies()) { if ("org.jboss.integration.fuse".equals(dependency.getGroupId())) { return dependency.getVersion(); } } } } return null; }

Target:
private String readIntegrationVersionPropertyString(MavenProject mavenProject) { if (mavenProject != null && mavenProject.getProperties() != null) { Properties properties = mavenProject.getProperties(); if (properties.getProperty(_integrationVersionPropertyKey) != null) { return properties.getProperty(_integrationVersionPropertyKey); } else if (mavenProject.getDependencyManagement() != null) { for (Dependency dependency : mavenProject.getDependencyManagement().getDependencies()) { if (M2EUtils.INTEGRATION_GROUP_ID.equals(dependency.getGroupId())) { return dependency.getVersion(); } } } } return null; }
Source:
private void showBookmarkSnackbar() { if (!isAdded()) { return; } Snackbar.make(getView(), R.string.reader_bookmark_snack_title, AccessibilityUtils.getSnackbarDuration(getActivity())).setAction(R.string.reader_bookmark_snack_btn, new View.OnClickListener() { @Override public void onClick(View view) { if (getActivity() instanceof WPMainActivity) { if (ReaderTagTable.getBookmarkTags().isEmpty()) { return; } mRecyclerView.setCurrentFilter(ReaderTagTable.getBookmarkTags().get(0)); mRecyclerView.showToolbar(); } else { Intent intent = new Intent(view.getContext(), WPMainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.putExtra(WPMainActivity.ARG_OPENED_FROM_BOOKMARK_SNACKBAR, true); startActivity(intent); } } }) .show(); }

Target:
private void showBookmarkSnackbar() { if (!isAdded()) { return; } Snackbar.make(getView(), R.string.reader_bookmark_snack_title, AccessibilityUtils.getSnackbarDuration(getActivity())).setAction(R.string.reader_bookmark_snack_btn, new View.OnClickListener() { @Override public void onClick(View view) { ActivityLauncher.viewSavedPostsListInReader(getActivity()); if (getActivity() instanceof WPMainActivity) { getActivity().overridePendingTransition(0, 0); } } }) .show(); }
Source:
public static < T extends NativeType< T > > ImgFactory< T > getArrayOrCellImgFactory( final Dimensions targetSize, final int targetCellSize, final T type ) { if ( Intervals.numElements( targetSize ) <= MAX_ARRAY_SIZE ) return new ArrayImgFactory<>( type ); final int cellSize; if ( Math.pow( targetCellSize, targetSize.numDimensions() ) <= MAX_ARRAY_SIZE ) cellSize = targetCellSize; else cellSize = ( int ) Math.pow( MAX_ARRAY_SIZE / type.getEntitiesPerPixel().getRatio(), 1.0 / targetSize.numDimensions() ); return new CellImgFactory<>( type, cellSize ); }

Target:
public static < T extends NativeType< T > > ImgFactory< T > getArrayOrCellImgFactory( final Dimensions targetSize, final int targetCellSize, final T type ) { Fraction entitiesPerPixel = type.getEntitiesPerPixel(); final long numElements = Intervals.numElements( targetSize ); final long numEntities = entitiesPerPixel.mulCeil( numElements ); if ( numElements <= Integer.MAX_VALUE && numEntities <= MAX_ARRAY_SIZE ) return new ArrayImgFactory<>( type ); final int maxCellSize = ( int ) Math.pow( Math.min( MAX_ARRAY_SIZE / entitiesPerPixel.getRatio(), Integer.MAX_VALUE ), 1.0 / targetSize.numDimensions() ); final int cellSize = Math.min( targetCellSize, maxCellSize ); return new CellImgFactory<>( type, cellSize ); }
Source:
public void testGetAllFromDisksIncludingSnapshots() { List<Disk> result = dao.getAllFromDisksIncludingSnapshots(null, false); List<Disk> sameImageIdDisks = result.stream().filter(disk -> disk.getId().equals(FixturesTool.IMAGE_GROUP_ID)).collect( Collectors.toList()); assertEquals("wrong number of returned disks", 4, sameImageIdDisks.size()); }

Target:
public void testGetAllFromDisksIncludingSnapshots() { List<Disk> result = dao.getAllFromDisksIncludingSnapshots(null, false); assertEquals("wrong number of returned disks", 15, result.size()); }
Source:
public DescriptionBuilder withAdditionalAnnotations(Annotation annotation, Annotation... additionalAnnotations) { if (annotation == null) { throw new NullPointerException("Cannot add a null annotation"); } annotations.add(annotation); annotations.addAll(Arrays.asList(additionalAnnotations)); return this; }

Target:
public DescriptionBuilder withAdditionalAnnotations(Annotation annotation, Annotation... additionalAnnotations) { List<Annotation> annotations = new ArrayList<Annotation>(); annotations.add(annotation); annotations.addAll(Arrays.asList(additionalAnnotations)); return withAdditionalAnnotations(annotations); }
Source:
OperationTimer(boolean trackOverallCpuTime, boolean trackOperationCpuTime, boolean trackOverallAllocation, boolean trackOperationAllocation) { this.trackOverallCpuTime = trackOverallCpuTime; this.trackOperationCpuTime = trackOperationCpuTime; checkArgument(trackOverallCpuTime || !trackOperationCpuTime, "tracking operation cpu time without tracking overall cpu time is not supported"); this.trackOverallAllocation = trackOverallAllocation; this.trackOperationAllocation = trackOperationAllocation; checkArgument(trackOverallAllocation || !trackOperationAllocation, "tracking operation allocation without tracking overall allocation is not supported"); checkArgument(!trackOverallAllocation || THREAD_MX_BEAN_EX != null, "tracking allocation is not supported by this JVM"); wallStart = System.nanoTime(); cpuStart = trackOverallCpuTime ? currentThreadCpuTime() : 0; allocationStart = trackOverallAllocation ? currentThreadAllocation() : 0; intervalWallStart = wallStart; intervalCpuStart = cpuStart; intervalAllocationStart = allocationStart; }

Target:
OperationTimer(boolean trackOverallCpuTime, boolean trackOperationCpuTime, boolean trackOverallAllocation, boolean trackOperationAllocation) { this.trackOverallCpuTime = trackOverallCpuTime; this.trackOperationCpuTime = trackOperationCpuTime; checkArgument(trackOverallCpuTime || !trackOperationCpuTime, "tracking operation cpu time without tracking overall cpu time is not supported"); this.trackOverallAllocation = trackOverallAllocation; this.trackOperationAllocation = trackOperationAllocation; checkArgument(trackOverallAllocation || !trackOperationAllocation, "tracking operation allocation without tracking overall allocation is not supported"); wallStart = System.nanoTime(); cpuStart = trackOverallCpuTime ? currentThreadCpuTime() : 0; allocationStart = trackOverallAllocation ? currentThreadAllocation() : 0; intervalWallStart = wallStart; intervalCpuStart = cpuStart; intervalAllocationStart = allocationStart; }
Source:
private String getExpectedMessagePostfix(final String messageKey) { final String msg = getCheckMessage(IndentationCheck.class, messageKey, FAKE_PROPERTY_ZERO, indent + indentOffset, expectedWarning); final int indexOfMsgPostfix = msg.indexOf(FAKE_PROPERTY_ZERO) + FAKE_PROPERTY_ZERO.length(); return msg.substring(indexOfMsgPostfix); }

Target:
private String getExpectedMessagePostfix(final String messageKey) { final String msg = getCheckMessage(IndentationCheck.class, messageKey, FAKE_ARGUMENT_ZERO, indent + indentOffset, expectedWarning); final int indexOfMsgPostfix = msg.indexOf(FAKE_ARGUMENT_ZERO) + FAKE_ARGUMENT_ZERO.length(); return msg.substring(indexOfMsgPostfix); }
Source:
public void close() throws IOException { markedAsDestroyed = true; if (connector != null) { executor.submit(new Runnable() { public void run() { if (connector != null) { try { connector.close(); } catch (IOException e) { logger.error("Error occurred during close connection {}", this, e); } } } }); } }

Target:
public void close() { if (connector != null) { try { connector.close(); } catch (IOException e) { logger.error("Error occurred during close connection {}", this, e); } } }