auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ImapFuture<ImapAsyncResponse> terminateCommand(@Nonnull final ImapRequest command) throws ImapAsyncClientException { if (requestsQueue.isEmpty()) { throw new ImapAsyncClientException(FailureType.COMMAND_NOT_ALLOWED); } final ImapCommandEntry entry = requestsQueue.peek(); if (isDebugEnabled()) { logger.debug(CLIENT_LOG_REC, sessionId, command.getLogLine()); } sendRequest(entry.getRequest().getTerminateCommandLine()); return entry.getFuture(); }

Target:
public ImapFuture<ImapAsyncResponse> terminateCommand(@Nonnull final ImapRequest command) throws ImapAsyncClientException { if (requestsQueue.isEmpty()) { throw new ImapAsyncClientException(FailureType.COMMAND_NOT_ALLOWED); } final ImapCommandEntry entry = requestsQueue.peek(); sendRequest(entry.getRequest().getTerminateCommandLine(), command.isCommandLineDataSensitive()); return entry.getFuture(); }
Source:
public boolean verifyAndSetPolicyFromConf(AllocationConfiguration queueConf) { SchedulingPolicy policy = queueConf.getSchedulingPolicy(getName()); for (FSQueue child : getChildQueues()) { if (!policy.isChildPolicyAllowed( queueConf.getSchedulingPolicy(child.getName()))) { return false; } boolean success = child.verifyAndSetPolicyFromConf(queueConf); if (!success) { return false; } } setPolicy(policy); return true; }

Target:
public boolean verifyAndSetPolicyFromConf(AllocationConfiguration queueConf) { SchedulingPolicy queuePolicy = queueConf.getSchedulingPolicy(getName()); for (FSQueue child : getChildQueues()) { if (!queuePolicy.isChildPolicyAllowed( queueConf.getSchedulingPolicy(child.getName()))) { return false; } boolean success = child.verifyAndSetPolicyFromConf(queueConf); if (!success) { return false; } } setPolicy(queuePolicy); return true; }
Source:
public void testConstantQuery() throws Exception { int expectedGeneratedSplits = 1; int expectedEvents = 1 + 1 + expectedGeneratedSplits; runQueryAndWaitForEvents("SELECT 1", expectedEvents); QueryCreatedEvent queryCreatedEvent = getOnlyElement(generatedEvents.getQueryCreatedEvents()); assertEquals(queryCreatedEvent.getContext().getServerVersion(), "testversion"); assertEquals(queryCreatedEvent.getContext().getServerAddress(), "127.0.0.1"); assertEquals(queryCreatedEvent.getContext().getEnvironment(), "testing"); assertEquals(queryCreatedEvent.getContext().getClientInfo().get(), "{\"clientVersion\":\"testVersion\"}"); assertEquals(queryCreatedEvent.getMetadata().getQuery(), "SELECT 1"); QueryCompletedEvent queryCompletedEvent = getOnlyElement(generatedEvents.getQueryCompletedEvents()); assertTrue(queryCompletedEvent.getContext().getResourceGroupName().isPresent()); assertEquals(queryCompletedEvent.getContext().getResourceGroupName().get(), "global.user-user"); assertEquals(queryCompletedEvent.getStatistics().getTotalRows(), 0L); assertEquals(queryCompletedEvent.getContext().getClientInfo().get(), "{\"clientVersion\":\"testVersion\"}"); assertEquals(queryCreatedEvent.getMetadata().getQueryId(), queryCompletedEvent.getMetadata().getQueryId()); List<SplitCompletedEvent> splitCompletedEvents = generatedEvents.getSplitCompletedEvents(); assertEquals(splitCompletedEvents.get(0).getQueryId(), queryCompletedEvent.getMetadata().getQueryId()); assertEquals(splitCompletedEvents.get(0).getStatistics().getCompletedPositions(), 1); }

Target:
public void testConstantQuery() throws Exception { int expectedSplits = 2; int expectedEvents = 1 + 1 + expectedSplits; runQueryAndWaitForEvents("SELECT 1", expectedEvents); QueryCreatedEvent queryCreatedEvent = getOnlyElement(generatedEvents.getQueryCreatedEvents()); assertEquals(queryCreatedEvent.getContext().getServerVersion(), "testversion"); assertEquals(queryCreatedEvent.getContext().getServerAddress(), "127.0.0.1"); assertEquals(queryCreatedEvent.getContext().getEnvironment(), "testing"); assertEquals(queryCreatedEvent.getContext().getClientInfo().get(), "{\"clientVersion\":\"testVersion\"}"); assertEquals(queryCreatedEvent.getMetadata().getQuery(), "SELECT 1"); QueryCompletedEvent queryCompletedEvent = getOnlyElement(generatedEvents.getQueryCompletedEvents()); assertTrue(queryCompletedEvent.getContext().getResourceGroupName().isPresent()); assertEquals(queryCompletedEvent.getContext().getResourceGroupName().get(), "global.user-user"); assertEquals(queryCompletedEvent.getStatistics().getTotalRows(), 0L); assertEquals(queryCompletedEvent.getContext().getClientInfo().get(), "{\"clientVersion\":\"testVersion\"}"); assertEquals(queryCreatedEvent.getMetadata().getQueryId(), queryCompletedEvent.getMetadata().getQueryId()); List<SplitCompletedEvent> splitCompletedEvents = generatedEvents.getSplitCompletedEvents(); assertEquals(splitCompletedEvents.get(0).getQueryId(), queryCompletedEvent.getMetadata().getQueryId()); assertEquals(splitCompletedEvents.get(0).getStatistics().getCompletedPositions(), 1); }
Source:
public IccOpenLogicalChannelResponse iccOpenLogicalChannelBySlot( int slotIndex, String callingPackage, String aid, int p2) { enforceModifyPermission(); mAppOps.checkPackage(Binder.getCallingUid(), callingPackage); if (DBG) { log("iccOpenLogicalChannelBySlot: slot=" + slotIndex + " aid=" + aid + " p2=" + p2); } return iccOpenLogicalChannelWithPermission(slotIndex, callingPackage, aid, p2); }

Target:
public IccOpenLogicalChannelResponse iccOpenLogicalChannelBySlot( int slotIndex, String callingPackage, String aid, int p2) { enforceModifyPermission(); mAppOps.checkPackage(Binder.getCallingUid(), callingPackage); if (DBG) { log("iccOpenLogicalChannelBySlot: slot=" + slotIndex + " aid=" + aid + " p2=" + p2); } return iccOpenLogicalChannelWithPermission(getPhoneIdFromSlotIdOrThrowException(slotIndex), callingPackage, aid, p2); }
Source:
protected void executeCommand() { ResumeGeoRepGlusterVolumeParameters parameters = getParameters(); setGlusterVolumeId(parameters.getVolumeId()); VDSReturnValue returnValue = runVdsCommand(VDSCommandType.ResumeGeoRepGlusterVolume, new GlusterVolumeResumeGeoRepVDSParameters(upServer.getId(), getGlusterVolumeName(), parameters.getSlaveHostName(), parameters.getSlaveVolumeName(), parameters.isForce())); setSucceeded(returnValue.getSucceeded()); if(!getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_GEO_REP_RESUME_FAILED, returnValue.getVdsError().getMessage()); return; } }

Target:
protected void executeCommand() { GlusterVolumeGeoRepSessionParameters parameters = getParameters(); setGlusterVolumeId(parameters.getVolumeId()); VDSReturnValue returnValue = runVdsCommand(VDSCommandType.ResumeGeoRepSession, new GlusterVolumeGeoRepSessionVDSParameters(upServer.getId(), getGlusterVolumeName(), parameters.getSlaveHost(), parameters.getSlaveVolumeName(), parameters.isForce())); setSucceeded(returnValue.getSucceeded()); if(!getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_GEO_REP_RESUME_FAILED, returnValue.getVdsError().getMessage()); return; } else { getGeoRepSession().setStatus(GeoRepSessionStatus.ACTIVE); getGlusterGeoRepDao().updateSession(getGeoRepSession()); } }
Source:
public Date getLastAlignmentScan() { return lastAlignmentScan; }

Target:
public Date getLastAlignmentScan() { return (Date) lastAlignmentScan.clone(); }
Source:
private void add(EPackage ePackage) { if (ePackage!=null) { URI uri = EcoreUtil.getURI(ePackage); if(ePackage.getNsURI() != null){ if (!packageURIs.contains(uri)) { packageURIs.add(uri); listWidget.add(ePackage.getNsURI()); setPageComplete(true); getContainer().updateButtons(); } } else{ MessageDialog.openError(getShell(), "No 'Ns URI' set", "The EPackage you selected has no 'Ns URI' set! This is a general EMF requirement."); setPageComplete(false); getContainer().updateButtons(); } } }

Target:
private void add(EPackage ePackage) { if (ePackage!=null) { String nsURI = ePackage.getNsURI(); if(nsURI != null && !nsURI.trim().isEmpty()){ URI uri = EcoreUtil.getURI(ePackage); if (!packageURIs.contains(uri)) { packageURIs.add(uri); listWidget.add(ePackage.getNsURI()); setPageComplete(true); getContainer().updateButtons(); } } else{ MessageDialog.openError(getShell(), "No 'Ns URI' set", "The EPackage you selected has no 'Ns URI' set! This is a general EMF requirement."); setPageComplete(false); getContainer().updateButtons(); } } }
Source:
private void followUser() { ViewUtils.setGone(loadingBar, false); setGone(true); new FollowUserTask(this, user.getLogin()) { @Override protected void onSuccess(User fullUser) throws Exception { super.onSuccess(fullUser); isFollowing = !isFollowing; user = fullUser; ViewUtils.setGone(loadingBar, true); setGone(false); } @Override protected void onException(Exception e) throws RuntimeException { super.onException(e); ToastUtils.show(UserViewActivity.this, string.error_following_person); ViewUtils.setGone(loadingBar, true); } }.execute(); }

Target:
private void followUser() { new FollowUserTask(this, user.getLogin(), isFollowing) { @Override protected void onSuccess(User fullUser) throws Exception { super.onSuccess(fullUser); isFollowing = !isFollowing; user = fullUser; } @Override protected void onException(Exception e) throws RuntimeException { super.onException(e); ToastUtils.show(UserViewActivity.this, string.error_following_person); ViewUtils.setGone(loadingBar, true); } }.start(); }
Source:
public void performMigration(String workspaceProjectsRootFolder) { Map<String, String> workspaceName2id = getId2NameWorkspaceMapping(); for (Entry<String, String> entry : workspaceName2id.entrySet()) { Path workspaceStoredByNameLocation = Paths.get(workspaceProjectsRootFolder).resolve(entry.getValue()); if (!Files.exists(workspaceStoredByNameLocation)) { continue; } LOG.info( "Performing migration of workspace with id '{}' and name '{}'", entry.getKey(), entry.getValue()); Path workspaceStoredByIdLocation = Paths.get(workspaceProjectsRootFolder).resolve(entry.getKey()); try { Files.move( workspaceStoredByNameLocation, workspaceStoredByIdLocation, StandardCopyOption.ATOMIC_MOVE); LOG.info( "Successfully migrated projects of workspace with id '{}' and name '{}'", entry.getKey(), entry.getValue()); } catch (IOException e) { LOG.error( "Failed to migrate projects of workspace with id '{}' and name '{}'", entry.getKey(), entry.getValue()); } } }

Target:
public void performMigration(String workspaceProjectsRootFolder) { LOG.info("Starting migration of workspace project files"); Map<String, String> workspaceName2id = getId2NameWorkspaceMapping(); for (Entry<String, String> entry : workspaceName2id.entrySet()) { Path workspaceStoredByNameLocation = Paths.get(workspaceProjectsRootFolder).resolve(entry.getValue()); if (!Files.exists(workspaceStoredByNameLocation)) { continue; } Path workspaceStoredByIdLocation = Paths.get(workspaceProjectsRootFolder).resolve(entry.getKey()); try { Files.move( workspaceStoredByNameLocation, workspaceStoredByIdLocation, StandardCopyOption.ATOMIC_MOVE); LOG.info( "Successfully migrated projects of workspace with id '{}' and name '{}'", entry.getKey(), entry.getValue()); } catch (IOException e) { LOG.error( "Failed to migrate projects of workspace with id '{}' and name '{}'", entry.getKey(), entry.getValue()); } } }
Source:
public void qosOnInterface() { Network network = createNetwork(null); VdsNetworkInterface iface = createNic("eth0", null, null, network.getName()); NetworkQoS qos = createQos(); when(qosDao.get(any(Guid.class))).thenReturn(qos); iface.setQosOverridden(true); qos(network, iface, null, true); }

Target:
public void qosOnInterface() { Network network = createNetwork(null); VdsNetworkInterface iface = createNic("eth0", null, null, network.getName()); NetworkQoS qos = createQos(); iface.setQos(qos); iface.setQosOverridden(true); when(qosDao.get(any(Guid.class))).thenReturn(createQos()); qos(network, iface, qos, true); }
Source:
private void checkIfDiscussionsBlackedOut() { createNewPostLayout.setVisibility(View.GONE); discussionService.getCourseDiscussionInfo(courseData.getCourse().getId()) .enqueue(new ErrorHandlingCallback<CourseDiscussionInfo>(getContext(), null, null) { @Override public void onFailure(@NonNull Call<CourseDiscussionInfo> call, @NonNull Throwable t) { markAsBlackedOut(false); } @Override protected void onResponse(@NonNull CourseDiscussionInfo discussionInfo) { final Date today = new Date(); final List<TimePeriod> blackoutTimesList = discussionInfo.getBlackoutList(); for (TimePeriod timePeriod : blackoutTimesList) { if (today.after(timePeriod.getStart()) && today.before(timePeriod.getEnd())) { markAsBlackedOut(true); return; } } markAsBlackedOut(false); } private void markAsBlackedOut(boolean isBlackedOut) { courseData.setDiscussionBlackedOut(isBlackedOut); createNewPostLayout.setEnabled(!isBlackedOut); createNewPostLayout.setVisibility(View.VISIBLE); } }); }

Target:
private void checkIfDiscussionsBlackedOut() { createNewPostLayout.setVisibility(View.GONE); discussionService.getCourseDiscussionInfo(courseData.getCourse().getId()) .enqueue(new ErrorHandlingCallback<CourseDiscussionInfo>(getContext(), (TaskProgressCallback) null) { @Override public void onFailure(@NonNull Call<CourseDiscussionInfo> call, @NonNull Throwable t) { markAsBlackedOut(false); } @Override protected void onResponse(@NonNull CourseDiscussionInfo discussionInfo) { final Date today = new Date(); final List<TimePeriod> blackoutTimesList = discussionInfo.getBlackoutList(); for (TimePeriod timePeriod : blackoutTimesList) { if (today.after(timePeriod.getStart()) && today.before(timePeriod.getEnd())) { markAsBlackedOut(true); return; } } markAsBlackedOut(false); } private void markAsBlackedOut(boolean isBlackedOut) { courseData.setDiscussionBlackedOut(isBlackedOut); createNewPostLayout.setEnabled(!isBlackedOut); createNewPostLayout.setVisibility(View.VISIBLE); } }); }
Source:
private void validateTsPayloads(List<IkePayload> reqPayloads, List<IkePayload> respPayloads) throws TsUnacceptableException { for (int tsType : new int[] { IkePayload.PAYLOAD_TYPE_TS_INITIATOR, IkePayload.PAYLOAD_TYPE_TS_RESPONDER }) { IkeTsPayload reqPayload = IkePayload.getPayloadForTypeInProvidedList( tsType, IkeTsPayload.class, reqPayloads); IkeTsPayload respPayload = IkePayload.getPayloadForTypeInProvidedList( tsType, IkeTsPayload.class, respPayloads); if (!reqPayload.contains(respPayload)) { throw new TsUnacceptableException(); } } }

Target:
private void validateTsPayloads(List<IkePayload> reqPayloads, List<IkePayload> respPayloads) throws TsUnacceptableException { for (int tsType : new int[] {PAYLOAD_TYPE_TS_INITIATOR, PAYLOAD_TYPE_TS_RESPONDER}) { IkeTsPayload reqPayload = IkePayload.getPayloadForTypeInProvidedList( tsType, IkeTsPayload.class, reqPayloads); IkeTsPayload respPayload = IkePayload.getPayloadForTypeInProvidedList( tsType, IkeTsPayload.class, respPayloads); if (!reqPayload.contains(respPayload)) { throw new TsUnacceptableException(); } } }
Source:
public void postCollectionAdminGroupCreateAdminGroupSuccess() throws Exception { ObjectMapper mapper = new ObjectMapper(); GroupRest groupRest = new GroupRest(); MetadataRest metadataRest = new MetadataRest(); metadataRest.put("dc.description", new MetadataValueRest("testingDescription")); metadataRest.put("dc.subject", new MetadataValueRest("testSubject")); groupRest.setMetadata(metadataRest); AtomicReference<UUID> idRef = new AtomicReference<>(); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(post("/api/core/collections/" + collection.getID() + "/adminGroup") .content(mapper.writeValueAsBytes(groupRest)) .contentType(contentType)) .andExpect(status().isCreated()) .andDo(result -> idRef .set(UUID.fromString(read(result.getResponse().getContentAsString(), "$.id"))) ); Group adminGroup = groupService.find(context, idRef.get()); getClient(token).perform(get("/api/core/collections/" + collection.getID() + "/adminGroup")) .andExpect(status().isOk()) .andExpect( jsonPath("$", GroupMatcher.matchGroupEntry(adminGroup.getID(), adminGroup.getName()))); }

Target:
public void postCollectionAdminGroupCreateAdminGroupSuccess() throws Exception { ObjectMapper mapper = new ObjectMapper(); GroupRest groupRest = new GroupRest(); MetadataRest metadataRest = new MetadataRest(); groupRest.setMetadata(metadataRest); AtomicReference<UUID> idRef = new AtomicReference<>(); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(post("/api/core/collections/" + collection.getID() + "/adminGroup") .content(mapper.writeValueAsBytes(groupRest)) .contentType(contentType)) .andExpect(status().isCreated()) .andDo(result -> idRef .set(UUID.fromString(read(result.getResponse().getContentAsString(), "$.id"))) ); Group adminGroup = groupService.find(context, idRef.get()); getClient(token).perform(get("/api/core/collections/" + collection.getID() + "/adminGroup")) .andExpect(status().isOk()) .andExpect( jsonPath("$", GroupMatcher.matchGroupEntry(adminGroup.getID(), adminGroup.getName()))); }
Source:
public static void main(String[] args) { TextAnalyticsAsyncClient client = new TextAnalyticsClientBuilder() .subscriptionKey("<replace-with-your-text-analytics-key-here>") .endpoint("<replace-with-your-text-analytics-endpoint-here>") .buildAsyncClient(); String text = "The hotel was dark and unclean."; client.analyzeSentiment(text).subscribe( result -> { final TextSentiment documentSentiment = result.getDocumentSentiment(); System.out.printf( "Recognized sentiment: %s, positive score: %s, neutral score: %s, negative score: %s.%n", documentSentiment.getTextSentimentClass(), documentSentiment.getPositiveScore(), documentSentiment.getNeutralScore(), documentSentiment.getNegativeScore()); final List<TextSentiment> sentiments = result.getSentenceSentiments(); for (TextSentiment textSentiment : sentiments) { System.out.printf( "Recognized sentence sentiment: %s, positive score: %s, neutral score: %s, negative score: %s.%n", textSentiment.getTextSentimentClass(), textSentiment.getPositiveScore(), textSentiment.getNeutralScore(), textSentiment.getNegativeScore()); } }, error -> System.err.println("There was an error analyzing sentiment of the text." + error), () -> System.out.println("Sentiment analyzed.")); try { TimeUnit.SECONDS.sleep(5); } catch (InterruptedException ignored) { } }

Target:
public static void main(String[] args) { TextAnalyticsAsyncClient client = new TextAnalyticsClientBuilder() .subscriptionKey("{subscription_key}") .endpoint("https://{servicename}.cognitiveservices.azure.com/") .buildAsyncClient(); String text = "The hotel was dark and unclean."; client.analyzeSentiment(text).subscribe( result -> { final TextSentiment documentSentiment = result.getDocumentSentiment(); System.out.printf( "Recognized sentiment: %s, positive score: %s, neutral score: %s, negative score: %s.%n", documentSentiment.getTextSentimentClass(), documentSentiment.getPositiveScore(), documentSentiment.getNeutralScore(), documentSentiment.getNegativeScore()); for (TextSentiment textSentiment : result.getSentenceSentiments()) { System.out.printf( "Recognized sentence sentiment: %s, positive score: %s, neutral score: %s, negative score: %s.%n", textSentiment.getTextSentimentClass(), textSentiment.getPositiveScore(), textSentiment.getNeutralScore(), textSentiment.getNegativeScore()); } }, error -> System.err.println("There was an error analyzing sentiment of the text." + error), () -> System.out.println("Sentiment analyzed.")); try { TimeUnit.SECONDS.sleep(5); } catch (InterruptedException ignored) { } }
Source:
public void removeAllGroupResourceAttributes(PerunSession sess, Resource resource) throws InternalErrorException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException { List<Group> groups = this.perunBl.getResourcesManagerBl().getAssignedGroups(sess, resource); List<Attribute> attrs = new ArrayList<>(); for (Group group : groups) { this.getPerunBl().getAttributesManagerBl().removeAllAttributes(sess, resource, group); } this.attributesManagerImpl.removeAllGroupResourceAttributes(sess, resource); log.info("All non-virtual group-resource attributes removed for all groups and {}", resource); }

Target:
public void removeAllGroupResourceAttributes(PerunSession sess, Resource resource) throws InternalErrorException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException { List<Group> groups = this.getPerunBl().getResourcesManagerBl().getAssignedGroups(sess, resource); for (Group group : groups) { this.getPerunBl().getAttributesManagerBl().removeAllAttributes(sess, resource, group); } this.attributesManagerImpl.removeAllGroupResourceAttributes(sess, resource); this.getPerunBl().getAuditer().log(sess, "All non-virtual group-resource attributes removed for all groups and {}", resource); }
Source:
public static HashMap load(String service) throws Exception { String filename = findPath(); PGServiceFile file = new PGServiceFile(); BufferedReader in = new BufferedReader(new FileReader(filename)); file.parse(in); return file.getService(service); }

Target:
public static Map load(String service) throws Exception { String filename = findPath(); PGServiceFile file = new PGServiceFile(); Scanner in = new Scanner(new FileInputStream(filename), "UTF-8"); try { file.parse(in); } finally { in.close(); } return file.getService(service); }
Source:
public Boolean getDeathdateEstimated() { return isDeathdateEstimated(); }

Target:
public Boolean getDeathdateEstimated() { return this.deathdateEstimated; }
Source:
public void switchProfileTest() { onView(withText(R.string.preference_access_title_profile_1)).perform(click()); onView(withId(R.id.access_active_profile_title)).check(matches(TextViewMatchers.hasValueEqualTo( resources.getString(R.string.preference_access_title_profile_1)))); onView(withId(R.id.access_active_profile_summary)).check(matches(TextViewMatchers.hasValueEqualTo( resources.getString(R.string.preference_access_summary_profile_1)))); onView(withId(R.id.scratch_project_apply_button)).perform(click()); onView(withText(R.string.ok)).perform(click()); compareValuesToXMLProfile(ACCESS_PROFILE_1); openActionBarOverflowOrOptionsMenu(InstrumentationRegistry.getTargetContext()); onView(withText(R.string.settings)).perform(click()); onData(PreferenceMatchers.withTitle(R.string.preference_title_access)) .perform(click()); onView(withId(R.id.access_active_profile_title)).check(matches(TextViewMatchers.hasValueEqualTo( resources.getString(R.string.preference_access_title_profile_1)))); onView(withId(R.id.access_active_profile_summary)).check(matches(TextViewMatchers.hasValueEqualTo( resources.getString(R.string.preference_access_summary_profile_1)))); onView(withId(R.id.access_switch_to_predefined_profiles_button)).perform(click()); onView(withText(R.string.preference_access_title_profile_standard)).perform(click()); onView(withId(R.id.scratch_project_apply_button)).perform(click()); onView(withText(R.string.ok)).perform(click()); }

Target:
public void switchProfileTest() { Intents.init(); Intent intentResult = new Intent(); Instrumentation.ActivityResult activityResult = new Instrumentation.ActivityResult(Activity.RESULT_OK, intentResult); intending(anyIntent()).respondWith(activityResult); onView(withId(R.id.access_title_profilestandard)) .perform(scrollTo(), click()); intended(allOf(hasExtra(equalTo(AccessibilityProfilesActivity.PROFILE_ID), equalTo(R.id.access_profilestandard)))); onView(withId(R.id.access_title_profilemyprofile)) .perform(scrollTo(), click()); intended(allOf(hasExtra(equalTo(AccessibilityProfilesActivity.PROFILE_ID), equalTo(R.id.access_profilemyprofile)))); onView(withId(R.id.access_title_profile1)) .perform(scrollTo(), click()); intended(allOf(hasExtra(equalTo(AccessibilityProfilesActivity.PROFILE_ID), equalTo(R.id.access_profile1)))); onView(withId(R.id.access_title_profile2)) .perform(scrollTo(), click()); intended(allOf(hasExtra(equalTo(AccessibilityProfilesActivity.PROFILE_ID), equalTo(R.id.access_profile2)))); onView(withId(R.id.access_title_profile3)) .perform(scrollTo(), click()); intended(allOf(hasExtra(equalTo(AccessibilityProfilesActivity.PROFILE_ID), equalTo(R.id.access_profile2)))); onView(withId(R.id.access_title_profile4)) .perform(scrollTo(), click()); intended(allOf(hasExtra(equalTo(AccessibilityProfilesActivity.PROFILE_ID), equalTo(R.id.access_profile4)))); Intents.release(); }
Source:
private static NestedSet<Artifact> createDynamicLibrariesCopyActions( RuleContext ruleContext, Iterable<Artifact> dynamicLibrariesForRuntime) { NestedSetBuilder<Artifact> result = NestedSetBuilder.stableOrder(); CppConfiguration cppConfiguration = ruleContext.getFragment(CppConfiguration.class); for (Artifact target : dynamicLibrariesForRuntime) { if (!ruleContext .getLabel() .getPackageIdentifier() .equals(target.getOwner().getPackageIdentifier()) || cppConfiguration.isRenameDLL()) { String copyFilename = target.getFilename(); if(cppConfiguration.isRenameDLL()) { String targetPath = ruleContext.getRepository() + "/" + target.getOwnerLabel().getPackageIdentifier().getSourceRoot(); String targetHash = Hashing.sha256() .hashString(targetPath, Charsets.UTF_8) .toString(); String copyFilenameWithoutExtension = copyFilename .replaceAll("." + target.getExtension(), ""); copyFilename = copyFilenameWithoutExtension + "_" + targetHash + "." + target.getExtension(); } Artifact copy = ruleContext.getBinArtifact(copyFilename); ruleContext.registerAction(SymlinkAction.toArtifact( ruleContext.getActionOwner(), target, copy, "Copying Execution Dynamic Library")); result.add(copy); } else { result.add(target); } } return result.build(); }

Target:
private static NestedSet<Artifact> createDynamicLibrariesCopyActions( RuleContext ruleContext, Iterable<Artifact> dynamicLibrariesForRuntime) { NestedSetBuilder<Artifact> result = NestedSetBuilder.stableOrder(); for (Artifact target : dynamicLibrariesForRuntime) { if (!ruleContext .getLabel() .getPackageIdentifier() .equals(target.getOwner().getPackageIdentifier())) { Artifact copy = ruleContext.getBinArtifact(target.getFilename()); ruleContext.registerAction(SymlinkAction.toArtifact( ruleContext.getActionOwner(), target, copy, "Copying Execution Dynamic Library")); result.add(copy); } else { result.add(target); } } return result.build(); }
Source:
public static <M, OM> StreamOperatorSpec<M, OM> createMapOperatorSpec( MapFunction<? super M, ? extends OM> mapFn, String opId) { return StreamOperatorSpec.<M, OM>createStreamOperatorSpec((MapFunction<M, OM>) mapFn, OperatorSpec.OpCode.MAP, opId); }

Target:
public static <M, OM> StreamOperatorSpec<M, OM> createMapOperatorSpec( MapFunction<? super M, ? extends OM> mapFn, String opId) { return new MapOperatorSpec<>((MapFunction<M, OM>) mapFn, opId); }
Source:
static void detectLanguageShowStatisticsRunner(BiConsumer<List<DetectLanguageInput>, TextAnalyticsRequestOptions> testRunner) { final List<DetectLanguageInput> detectLanguageInputs = TestUtils.getDetectLanguageInputs(); TextAnalyticsRequestOptions options = new TextAnalyticsRequestOptions().setShowStatistics(true); testRunner.accept(detectLanguageInputs, options); }

Target:
void detectLanguageShowStatisticsRunner(BiConsumer<List<DetectLanguageInput>, TextAnalyticsRequestOptions> testRunner) { final List<DetectLanguageInput> detectLanguageInputs = TestUtils.getDetectLanguageInputs(); TextAnalyticsRequestOptions options = new TextAnalyticsRequestOptions().setShowStatistics(true); testRunner.accept(detectLanguageInputs, options); }
Source:
public Map<String, Boolean> asMap() { return featureFlags.stream().collect(toMap(FeatureFlag::getName, FeatureFlag::isEnabled)); }

Target:
private Map<String, Boolean> asMap() { return featureFlags.stream().collect(toMap(FeatureFlag::getName, FeatureFlag::isEnabled)); }
Source:
protected void initBinder(WebDataBinder binder) { StringTrimmerEditor editor = new StringTrimmerEditor(false); binder.registerCustomEditor(String.class, "name", editor); binder.registerCustomEditor(String.class, "nameRu", editor); binder.registerCustomEditor(String.class, "name", new CustomCategoryNameEditor()); binder.registerCustomEditor(String.class, "nameRu", new CustomCategoryNameEditor()); }

Target:
protected void initBinder(WebDataBinder binder) { ReplaceRepeatingSpacesEditor editor = new ReplaceRepeatingSpacesEditor(true); binder.registerCustomEditor(String.class, "name", editor); binder.registerCustomEditor(String.class, "nameRu", editor); }
Source:
public SELF withUrlParam(String paramName, String paramValue) { throw new UnsupportedOperationException(); }

Target:
public SELF withUrlParam(String paramName, String paramValue) { urlParameters.put(paramName, paramValue); return self(); }
Source:
public void openFile(final String file) { IProject[] projects = ResourcesPlugin.getWorkspace().getRoot() .getProjects(); for (int i = 0; i < projects.length; i++) { final IProject prj = projects[i]; final URI remoteURI = Util.getLocationURI(prj); if (remoteURI != null) { if(!file.startsWith(remoteURI.getPath())) continue; getStandardDisplay().asyncExec(new Runnable() { public void run() { IWorkbenchPage page = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getActivePage(); try { String loc = file.substring(remoteURI.getPath().length()+1); IFile file = prj.getFile(loc); IDE.openEditor(page, file); } catch (PartInitException e) { Activator.log(e); } } }); return; } } getStandardDisplay().asyncExec(new Runnable() { public void run() { IWorkbenchPage page = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getActivePage(); try { IEditorDescriptor editorDesc = IDE.getEditorDescriptor(file); IRemoteFileManager irfm = fRemoteConnection.getFileManager(); URI uri = irfm.toURI(file); String editorId = editorDesc.getId(); boolean activate = true; IDE.openEditor(page, uri, editorId, activate ); } catch (PartInitException e) { Activator.log(e); } } }); return; }

Target:
public void openFile(final String file) { IProject[] projects = ResourcesPlugin.getWorkspace().getRoot() .getProjects(); for (int i = 0; i < projects.length; i++) { final IProject prj = projects[i]; final URI remoteURI = Util.getLocationURI(prj); if (remoteURI != null) { if(file.startsWith(remoteURI.getPath())) { getStandardDisplay().asyncExec(new Runnable() { public void run() { IWorkbenchPage page = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getActivePage(); try { String loc = file.substring(remoteURI.getPath().length()+1); IFile file = prj.getFile(loc); IDE.openEditor(page, file); } catch (PartInitException e) { Activator.log(e); } } }); return; } } } getStandardDisplay().asyncExec(new Runnable() { public void run() { IWorkbenchPage page = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getActivePage(); try { IEditorDescriptor editorDesc = IDE.getEditorDescriptor(file); IRemoteFileManager irfm = fRemoteConnection.getFileManager(); URI uri = irfm.toURI(file); String editorId = editorDesc.getId(); IDE.openEditor(page, uri, editorId, true); } catch (PartInitException e) { Activator.log(e); } } }); return; }
Source:
public FeedAdapter(String target, FeedConfiguration feedConfiguration, FeedSource feedSource, FeedPublisher feedPublisher, List<AdapterResponseInterceptor<Feed>>adapterResponseInterceptorList) { super(target); if ( adapterResponseInterceptorList == null ) { throw new IllegalArgumentException("adapterResponseInterceptorList argument must not be null"); } if ( adapterResponseInterceptorList.isEmpty() ) { throw new IllegalArgumentException("adapterResponseInterceptorList argument must contain at least one element"); } this.feedConfiguration = feedConfiguration; final List<String> allowedMethodsList = new LinkedList<String>(); if (feedSource != null) { this.feedSource = feedSource; allowedMethodsList.add("GET"); } else { this.feedSource = DisabledFeedSource.getInstance(); } if (feedPublisher != null) { this.feedPublisher = feedPublisher; allowedMethodsList.add("PUT"); allowedMethodsList.add("POST"); allowedMethodsList.add("DELETE"); } else { this.feedPublisher = DisabledPublisher.getInstance(); } final String[] allowedMethods = allowedMethodsList.toArray(new String[allowedMethodsList.size()]); feedResponseHandler = new FeedResponseHandler(allowedMethods, adapterResponseInterceptorList); entryResponseHandler = new EntryResponseHandler(allowedMethods); emptyBodyResponseHandler = new EmptyBodyResponseHandler(allowedMethods); }

Target:
public FeedAdapter(String target, FeedConfiguration feedConfiguration, FeedSource feedSource, FeedPublisher feedPublisher, List<AdapterResponseInterceptor<Feed>>adapterResponseInterceptorList) { super(target); if ( adapterResponseInterceptorList == null ) { throw new IllegalArgumentException("adapterResponseInterceptorList argument must not be null"); } this.feedConfiguration = feedConfiguration; final List<String> allowedMethodsList = new LinkedList<String>(); if (feedSource != null) { this.feedSource = feedSource; allowedMethodsList.add("GET"); } else { this.feedSource = DisabledFeedSource.getInstance(); } if (feedPublisher != null) { this.feedPublisher = feedPublisher; allowedMethodsList.add("PUT"); allowedMethodsList.add("POST"); allowedMethodsList.add("DELETE"); } else { this.feedPublisher = DisabledPublisher.getInstance(); } final String[] allowedMethods = allowedMethodsList.toArray(new String[allowedMethodsList.size()]); feedResponseHandler = new FeedResponseHandler(allowedMethods, adapterResponseInterceptorList); entryResponseHandler = new EntryResponseHandler(allowedMethods); emptyBodyResponseHandler = new EmptyBodyResponseHandler(allowedMethods); }
Source:
public BlockScopeEnv(Env parent, int localsSize) { super(parent); if (localsSize <= 0) { locals = Collections.emptyMap(); types = Collections.emptyMap(); } else { locals = new HashMap<String, Object>(localsSize); types = new HashMap<String, Class>(localsSize); } }

Target:
public BlockScopeEnv(Env parent, int localsSize) { super(parent); if (localsSize <= 0) { locals = Collections.EMPTY_MAP; types = Collections.EMPTY_MAP; } else { locals = Maps.newHashMapWithExpectedSize(localsSize); types = Maps.newHashMapWithExpectedSize(localsSize); } }
Source:
public static boolean isProcessRunning(Platform platform, int pid) { try { final Process pidof; if (platform == Platform.Linux || platform == Platform.OS_X) { pidof = Runtime.getRuntime().exec( new String[] { "kill", "-0", "" + pid }); return pidof.waitFor() == 0; } else { final String cmd = "tasklist.exe /FI \"PID eq " + pid + "\" /FO CSV"; logger.fine("Command: " + cmd); pidof = Runtime.getRuntime().exec(cmd); int returnStatus = pidof.waitFor(); String output = CharStreams .toString(new InputSupplier<InputStreamReader>() { public InputStreamReader getInput() throws IOException { return new InputStreamReader( pidof.getInputStream()); } }); if (logger.isLoggable(Level.FINE)) { logger.fine("returnStatus: " + returnStatus); logger.fine("tasklist.exe: " + output); String error = CharStreams .toString(new InputSupplier<InputStreamReader>() { public InputStreamReader getInput() throws IOException { return new InputStreamReader( pidof.getErrorStream()); } }); logger.fine("tasklist.exe error: " + error); } return output.contains("" + pid); } } catch (IOException e) { logger.severe("IOException when trying to get process status:" + e.getMessage()); e.printStackTrace(); } catch (InterruptedException e) { logger.severe("IOException when trying to get process status:" + e.getMessage()); e.printStackTrace(); } return false; }

Target:
public static boolean isProcessRunning(Platform platform, int pid) { try { final Process pidof; if (platform == Platform.Linux || platform == Platform.OS_X) { pidof = Runtime.getRuntime().exec( new String[] { "kill", "-0", "" + pid }); return pidof.waitFor() == 0; } else { final String[] cmd = { "tasklist.exe", "/FI", "PID eq " + pid ,"/FO", "CSV" }; logger.finer("Command: " + Arrays.asList(cmd)); ProcessBuilder processBuilder = ProcessControl .newProcessBuilder(Arrays.asList(cmd), true); Process process = processBuilder.start(); LogWatchStreamProcessor logWatch = new LogWatchStreamProcessor(""+pid, new HashSet<String>(), StreamToLineProcessor.wrap(Processors.silent())); Processors.connect(new InputStreamReader(process.getInputStream()), logWatch); logWatch.waitForResult(2000); logger.finer("logWatch output: " + logWatch.getOutput()); return logWatch.isInitWithSuccess(); } } catch (IOException e) { logger.severe("IOException when trying to get process status:" + e.getMessage()); e.printStackTrace(); } catch (InterruptedException e) { logger.severe("IOException when trying to get process status:" + e.getMessage()); e.printStackTrace(); } return false; }
Source:
private AbstractTreeIterator getTreeIterator(String name) throws IOException { final ObjectId id = db.resolve(name); if (id == null) throw new IllegalArgumentException(name); final CanonicalTreeParser p = new CanonicalTreeParser(); try (final ObjectReader or = db.newObjectReader()) { p.reset(or, new RevWalk(db).parseTree(id)); return p; } }

Target:
private AbstractTreeIterator getTreeIterator(String name) throws IOException { final ObjectId id = db.resolve(name); if (id == null) throw new IllegalArgumentException(name); final CanonicalTreeParser p = new CanonicalTreeParser(); try (ObjectReader or = db.newObjectReader()) { p.reset(or, new RevWalk(db).parseTree(id)); return p; } }
Source:
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); result = SQLite.select().from(Result.class).where(Result_Table.id.eq(getIntent().getIntExtra(ID, 0))).querySingle(); assert result != null; setTheme(result.getTestSuite().getThemeLight()); setContentView(R.layout.activity_result_detail); ButterKnife.bind(this); setSupportActionBar(toolbar); ActionBar bar = getSupportActionBar(); if (bar != null) { bar.setDisplayHomeAsUpEnabled(true); bar.setTitle(result.getTestSuite().getTitle()); } pager.setAdapter(new ResultHeaderAdapter()); tabLayout.setupWithViewPager(pager); LinearLayoutManager layoutManager = new LinearLayoutManager(this); recycler.setLayoutManager(layoutManager); recycler.addItemDecoration(new DividerItemDecoration(this, layoutManager.getOrientation())); result.is_viewed = true; result.save(); items = new ArrayList<>(); adapter = new HeterogeneousRecyclerAdapter<>(this, items); recycler.setAdapter(adapter); snackbar = Snackbar.make(coordinatorLayout, R.string.Snackbar_ResultsSomeNotUploaded_Text, Snackbar.LENGTH_INDEFINITE).setAction(R.string.Snackbar_ResultsSomeNotUploaded_UploadAll, v1 -> new MKCollectorResubmitSettingsAsyncTask(this).execute(result.id, null)); }

Target:
protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); result = SQLite.select().from(Result.class) .where(Result_Table.id.eq(getIntent().getIntExtra(ID, 0))).querySingle(); assert result != null; setTheme(result.getTestSuite().getThemeLight()); setContentView(R.layout.activity_result_detail); ButterKnife.bind(this); setSupportActionBar(toolbar); ActionBar bar = getSupportActionBar(); if (bar != null) { bar.setDisplayHomeAsUpEnabled(true); bar.setTitle(result.getTestSuite().getTitle()); } pager.setAdapter(new ResultHeaderAdapter()); tabLayout.setupWithViewPager(pager); LinearLayoutManager layoutManager = new LinearLayoutManager(this); recycler.setLayoutManager(layoutManager); recycler.addItemDecoration(new DividerItemDecoration(this, layoutManager.getOrientation())); result.is_viewed = true; result.save(); items = new ArrayList<>(); adapter = new HeterogeneousRecyclerAdapter<>(this, items); recycler.setAdapter(adapter); snackbar = Snackbar.make(coordinatorLayout, R.string.Snackbar_ResultsSomeNotUploaded_Text, Snackbar.LENGTH_INDEFINITE) .setAction(R.string.Snackbar_ResultsSomeNotUploaded_UploadAll, v1 -> runMKCollectorResubmitSettingsAsyncTask()); }
Source:
protected void executeQueryCommand() { VDSReturnValue returnValue = getBackendResourceManager().RunVdsCommand(VDSCommandType.GetGlusterVolumeAdvancedDetails, new GlusterVolumeAdvancedDetailsVDSParameters(getClusterUtils() .getUpServer(getParameters().getClusterId()).getId(), getParameters().getClusterId(), getParameters().getVolumeName(), getParameters().getBrickName(), getParameters().detailsRequired())); getQueryReturnValue().setReturnValue(returnValue.getReturnValue()); }

Target:
protected void executeQueryCommand() { try { VDSReturnValue returnValue = getBackendResourceManager().RunVdsCommand(VDSCommandType.GetGlusterVolumeAdvancedDetails, new GlusterVolumeAdvancedDetailsVDSParameters(getUpServerId(), getParameters().getClusterId(), getParameters().getVolumeName(), getParameters().getBrickName(), getParameters().detailsRequired())); getQueryReturnValue().setReturnValue(returnValue.getReturnValue()); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
private void formatAnnotation(JFieldVar field, JDefinedClass clazz, String propertyName, JsonNode node) { String format = node.has("format") == true ? node.get("format").asText() : null; if ("date-time".equalsIgnoreCase(format)) { ruleFactory.getAnnotator().jsonFormat(field, clazz, propertyName, node); } }

Target:
private void formatAnnotation(JFieldVar field, JDefinedClass clazz, String propertyName, JsonNode node) { String format = node.path("format").asText(); if ("date-time".equalsIgnoreCase(format)) { ruleFactory.getAnnotator().dateField(field, node); } }
Source:
public static QueryStatusEncoding submitted(final QueryEncoding query) { QueryStatusEncoding ret = new QueryStatusEncoding(); ret.rawQuery = query.rawQuery; ret.logicalRa = query.logicalRa; ret.plan = query.plan; ret.profilingMode = query.profilingMode.toString(); ret.ftMode = query.ftMode.toString(); ret.submitTime = DateTimeUtils.nowInISO8601(); ret.status = Status.ACCEPTED; ret.language = query.language; return ret; }

Target:
public static QueryStatusEncoding submitted(final QueryEncoding query) { QueryStatusEncoding ret = new QueryStatusEncoding(); ret.rawQuery = query.rawQuery; ret.logicalRa = query.logicalRa; ret.plan = query.plan; ret.profilingMode = query.profilingMode; ret.ftMode = query.ftMode.toString(); ret.submitTime = DateTime.now(); ret.status = Status.ACCEPTED; ret.language = query.language; return ret; }
Source:
private OmniGradleBuild fetchGradleBuildStructure(IProgressMonitor monitor) { org.eclipse.buildship.core.workspace.GradleBuild gradleBuild = CorePlugin.gradleWorkspaceManager().getGradleBuild(this.fixedAttributes); GradleBuild model = gradleBuild.getModelProvider().fetchModel(GradleBuild.class, FetchStrategy.FORCE_RELOAD, getToken(), monitor); return DefaultOmniGradleBuild.from(model); }

Target:
private OmniGradleBuild fetchGradleBuildStructure(IProgressMonitor monitor) { ModelProvider modelProvider = CorePlugin.gradleWorkspaceManager().getGradleBuild(this.fixedAttributes).getModelProvider(); return modelProvider.fetchGradleBuild(FetchStrategy.FORCE_RELOAD, getToken(), monitor); }
Source:
public ArrayList<ApplicationRecord> getVisibleAppRecords() { ArrayList<ApplicationRecord> visible = new ArrayList<ApplicationRecord>(); for (ApplicationRecord r : getInstalledAppRecords()) { if (!r.isArchived()) { visible.add(r); } } System.out.println("NUM VISIBLE APPS FOUND: " + visible.size()); return visible; }

Target:
public ArrayList<ApplicationRecord> getVisibleAppRecords() { ArrayList<ApplicationRecord> visible = new ArrayList<>(); for (ApplicationRecord r : getInstalledAppRecords()) { if (r.isVisible()) { visible.add(r); } } return visible; }
Source:
public boolean hasSomeResults() { return !results.isEmpty(); }

Target:
public boolean hasSomeResults() { return results != null && !results.isEmpty(); }
Source:
public String toString() { List<String> strings = new ArrayList<String>(); for (Long value : getValue() ) { switch (base) { case 2: strings.add("0b" + Long.toBinaryString(value)); break; case 8: strings.add('0' + Long.toOctalString(value)); break; case 10: strings.add(value.toString()); break; case 16: strings.add("0x" + Long.toHexString(value)); break; default: strings.add(value.toString()); break; } } return getName() + '=' + strings.toString(); }

Target:
public String toString() { List<String> strings = new ArrayList<String>(); for (Long value : getValue() ) { strings.add(formatNumber(value, base)); } return getName() + '=' + strings.toString(); }
Source:
protected VMs mapCollection(List<org.ovirt.engine.core.common.businessentities.VM> entities, boolean isFiltered) { VMs collection = new VMs(); for (org.ovirt.engine.core.common.businessentities.VM entity : entities) { VM vm = map(entity); if (isFiltered) { vm.setHost(null); vm.setPlacementPolicy(null); } collection.getVMs().add(addLinks(populate(vm, entity))); } return collection; }

Target:
protected VMs mapCollection(List<org.ovirt.engine.core.common.businessentities.VM> entities, boolean isFiltered) { VMs collection = new VMs(); for (org.ovirt.engine.core.common.businessentities.VM entity : entities) { VM vm = map(entity); if (isFiltered) { removeRestrictedInfoFromVM(vm); } collection.getVMs().add(addLinks(populate(vm, entity))); } return collection; }
Source:
public void ovfUpdate_timer() { log.info("OvfDataUpdater: Attempting to update VMs/Templates Ovf."); List<storage_pool> storagePools = getStoragePoolDao().getAll(); for (storage_pool pool : storagePools) { try { if (StoragePoolStatus.Up == pool.getstatus()) { clearProccessedInfo(); log.infoFormat("OvfDataUpdater: Attempting to update vms Ovf in Data Center {0}", pool.getname()); updateOvfForVmsOfStoragePool(pool.getId()); clearProccessedInfo(); log.infoFormat("OvfDataUpdater: Attempting to update templates Ovf in Data Center {0}", pool.getname()); updateOvfForTemplatesOfStoragePool(pool.getId()); log.infoFormat("OvfDataUpdater: Attempting to remove uneeded Ovfs in Data Center {0}", pool.getname()); removeOvfForTemplatesAndVmsOfStoragePool(pool.getId()); } } catch (Exception ex) { addAuditLogError(pool.getname()); log.errorFormat("Exception while trying to update VMs/Templates ovf in Data Center {0}, the exception is {1}", pool.getname(), ex.getMessage()); log.debug(ex.getStackTrace()); } } clearProccessedInfo(); }

Target:
public void ovfUpdate_timer() { ITEMS_COUNT_PER_UPDATE = reloadConfigValue(); log.info("OvfDataUpdater: Attempting to update VMs/Templates Ovf."); List<storage_pool> storagePools = getStoragePoolDao().getAllByStatus(StoragePoolStatus.Up); for (storage_pool pool : storagePools) { try { initProccessedInfoLists(); log.infoFormat("OvfDataUpdater: Attempting to update VM OVFs in Data Center {0}", pool.getname()); updateOvfForVmsOfStoragePool(pool.getId()); log.infoFormat("OvfDataUpdater: Attempting to update template OVFs in Data Center {0}", pool.getname()); updateOvfForTemplatesOfStoragePool(pool.getId()); log.infoFormat("OvfDataUpdater: Attempting to remove uneeded template/vm OVFs in Data Center {0}", pool.getname()); removeOvfForTemplatesAndVmsOfStoragePool(pool.getId()); } catch (Exception ex) { addAuditLogError(pool.getname()); log.errorFormat("Exception while trying to update VMs/Templates ovf in Data Center {0}, the exception is {1}", pool.getname(), ex.getMessage()); log.debug(ex.getStackTrace()); } } proccessedIdsInfo = null; proccessedOvfGenerationsInfo = null; }
Source:
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { synchronized (getClassLoadingLock(name)) { Class<?> clazz = findLoadedClass(name); if (clazz == null) { clazz = super.loadClass(name, resolve); if (!name.startsWith("java.") && !name.startsWith("javax.") && !name.startsWith("sun.") && !name.startsWith("org.xml.") && !name.startsWith("org.junit.")) { try { boolean definalize = filters.contains(name); if (!definalize) { for (int i = name.indexOf('.'); i > 0; i = name.indexOf('.', ++i)) { if (filters.contains(name.substring(0, i))) { definalize = true; break; } } } clazz = reloadClass(clazz, definalize); } catch (NotFoundException e) { throw new ClassNotFoundException(e.getMessage(), e); } catch (CannotCompileException e) { throw (ClassFormatError) new ClassFormatError(e.getMessage()).initCause(e); } } } if (resolve) { resolveClass(clazz); } return clazz; } }

Target:
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { synchronized (getClassLoadingLock(name)) { Class<?> clazz = findLoadedClass(name); if (clazz == null) { clazz = super.loadClass(name, resolve); if (DeFinalizeClassLoader.isNotFromAReservedPackage(name)) { try { clazz = reloadClass(clazz, shouldDefinalize(name)); } catch (NotFoundException e) { throw new ClassNotFoundException(e.getMessage(), e); } catch (CannotCompileException e) { throw (ClassFormatError) new ClassFormatError(e.getMessage()).initCause(e); } } } if (resolve) { resolveClass(clazz); } return clazz; } }