auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void beforeTest() { beforeTestSetup(); if (interceptorManager.isPlaybackMode()) { client = clientSetup(credentials -> new ConfigurationClientBuilder() .credential(credentials) .httpClient(interceptorManager.getPlaybackClient()) .httpLogDetailLevel(HttpLogDetailLevel.BODY_AND_HEADERS) .buildAsyncClient()); } else { client = clientSetup(credentials -> new ConfigurationClientBuilder() .credential(credentials) .httpClient(new NettyAsyncHttpClientBuilder().wiretap(true).build()) .httpLogDetailLevel(HttpLogDetailLevel.BODY_AND_HEADERS) .addPolicy(interceptorManager.getRecordPolicy()) .addPolicy(new RetryPolicy()) .buildAsyncClient()); } }

Target:
protected void beforeTest() { beforeTestSetup(); if (interceptorManager.isPlaybackMode()) { client = clientSetup(credentials -> new ConfigurationClientBuilder() .credential(credentials) .httpClient(interceptorManager.getPlaybackClient()) .httpLogDetailLevel(HttpLogDetailLevel.BODY_AND_HEADERS) .buildAsyncClient()); } else { client = clientSetup(credentials -> new ConfigurationClientBuilder() .credential(credentials) .httpClient(new NettyAsyncHttpClientBuilder().setWiretap(true).build()) .httpLogDetailLevel(HttpLogDetailLevel.BODY_AND_HEADERS) .addPolicy(interceptorManager.getRecordPolicy()) .addPolicy(new RetryPolicy()) .buildAsyncClient()); } }
Source:
private boolean isInitializable(Thing thing) { logger.debug("Determine if thing '{}' is initializable.", thing.getUID()); ThingType thingType = TypeResolver.resolve(thing.getThingTypeUID()); if (thingType != null) { ConfigDescription description = TypeResolver.resolve(thingType.getConfigDescriptionURI()); if (description == null) { return true; } List<String> requiredParameters = getRequiredParameters(description); Map<String, Object> properties = thing.getConfiguration().getProperties(); return properties.keySet().containsAll(requiredParameters); } else { logger.debug("Thing type '{}' of thing '{}' not found.", thing.getThingTypeUID(), thing.getUID()); } return false; }

Target:
private boolean isInitializable(Thing thing) { ThingType thingType = TypeResolver.resolve(thing.getThingTypeUID()); if (thingType == null) { return true; } ConfigDescription description = resolve(thingType.getConfigDescriptionURI(), null); if (description == null) { return true; } List<String> requiredParameters = getRequiredParameters(description); Map<String, Object> properties = thing.getConfiguration().getProperties(); return properties.keySet().containsAll(requiredParameters); }
Source:
public void linkNewChild(@NonNull IHTNode<E> childNode) { takeWriteLock(); try { super.linkNewChild(childNode); final int childIndex = getNbChildren() - 1; if (childNode instanceof OverlappingNode<?>) { ((OverlappingNode<E>) childNode).addListener(new NodeUpdateListener() { @Override public void nodeClosed(@NonNull OverlappingNode<E> node, long endtime) { takeWriteLock(); try { fChildEnd[childIndex] = endtime; } finally { releaseWriteLock(); } } }); } fChildStart[childIndex] = childNode.getNodeStart(); fChildEnd[childIndex] = childNode.getNodeEnd(); } finally { releaseWriteLock(); } }

Target:
public void linkNewChild(@NonNull IHTNode<E> childNode) { if (!(childNode instanceof OverlappingNode<?>)) { throw new IllegalArgumentException("Adding a node that is not an overlapping node to an overlapping tree!"); } takeWriteLock(); try { super.linkNewChild(childNode); final int childIndex = getNbChildren() - 1; ((OverlappingNode<E>) childNode).addListener((node, endtime) -> { takeWriteLock(); try { fChildEnd[childIndex] = endtime; } finally { releaseWriteLock(); } }); fChildStart[childIndex] = childNode.getNodeStart(); if (childNode.isOnDisk()) { fChildEnd[childIndex] = childNode.getNodeEnd(); } } finally { releaseWriteLock(); } }
Source:
protected void onLoad() throws IOException, ConfigInvalidException { ObjectId rev = getRevision(); if (rev == null) { loadDefaults(); return; } RevWalk walk = new RevWalk(reader); try (ChangeNotesParser parser = new ChangeNotesParser(change, rev, walk, repoManager)) { parser.parseAll(); if (parser.status != null) { change.setStatus(parser.status); } if (parser.changeKey != null && !parser.changeKey.equals(change.getKey())) { throw parseException(change.getId(), String.format( "change key in notedb does does not match change entity: %s != %s", parser.changeKey.get(), change.getKey().get())); } approvals = parser.buildApprovals(); changeMessages = parser.buildMessages(); commentsForBase = ImmutableListMultimap.copyOf(parser.commentsForBase); commentsForPS = ImmutableListMultimap.copyOf(parser.commentsForPs); noteMap = parser.commentNoteMap; ImmutableSetMultimap.Builder<ReviewerState, Account.Id> reviewers = ImmutableSetMultimap.builder(); for (Map.Entry<Account.Id, ReviewerState> e : parser.reviewers.entrySet()) { reviewers.put(e.getValue(), e.getKey()); } this.reviewers = reviewers.build(); this.allPastReviewers = ImmutableList.copyOf(parser.allPastReviewers); submitRecords = ImmutableList.copyOf(parser.submitRecords); } catch (ParseException e) { throw new IOException(e); } finally { walk.release(); } }

Target:
protected void onLoad() throws IOException, ConfigInvalidException { ObjectId rev = getRevision(); if (rev == null) { loadDefaults(); return; } RevWalk walk = new RevWalk(reader); try (ChangeNotesParser parser = new ChangeNotesParser(change, rev, walk, repoManager)) { parser.parseAll(); if (parser.status != null) { change.setStatus(parser.status); } approvals = parser.buildApprovals(); changeMessages = parser.buildMessages(); commentsForBase = ImmutableListMultimap.copyOf(parser.commentsForBase); commentsForPS = ImmutableListMultimap.copyOf(parser.commentsForPs); noteMap = parser.commentNoteMap; ImmutableSetMultimap.Builder<ReviewerState, Account.Id> reviewers = ImmutableSetMultimap.builder(); for (Map.Entry<Account.Id, ReviewerState> e : parser.reviewers.entrySet()) { reviewers.put(e.getValue(), e.getKey()); } this.reviewers = reviewers.build(); this.allPastReviewers = ImmutableList.copyOf(parser.allPastReviewers); submitRecords = ImmutableList.copyOf(parser.submitRecords); } catch (ParseException e) { throw new IOException(e); } finally { walk.release(); } }
Source:
protected Result check() throws Exception { return timeBoundHealthCheck.check(() -> jdbi.withHandle((handle) -> { handle.execute(validationQuery); return Result.healthy(); }) ); }

Target:
protected Result check() throws Exception { return timeBoundHealthCheck.check(() -> { try (Handle handle = jdbi.open()) { handle.execute(validationQuery); return Result.healthy(); } } ); }
Source:
private void applyUrl(boolean include) throws CoreException { String value = include ? recomputeUrl() : null; getCurrentItem().setURL(value); }

Target:
private void applyUrl(boolean include) throws CoreException { ISiteFeature feature = getCurrentItem(); if (feature != null) { String value = include ? recomputeUrl() : null; feature.setURL(value); } }
Source:
void testActivationOrder() throws IOException { sut = new ConsumerHolder(eventConsumerMock, "queue", false, PREFETCH_COUNT, consumerChannelFactoryMock, declarationsListMock, declarerRepositoryMock); Assertions.assertEquals("queue", sut.getQueueName()); when(consumerChannelFactoryMock.createChannel()).thenReturn(channelMock); sut.activate(); InOrder inOrder = inOrder(channelMock, declarerRepositoryMock); inOrder.verify(channelMock).addRecoveryListener(sut); inOrder.verify(channelMock).basicQos(PREFETCH_COUNT); inOrder.verify(declarerRepositoryMock).declare(channelMock, declarationsListMock); inOrder.verify(channelMock).basicConsume(eq("queue"), eq(false), isA(DeliverCallback.class), isA(ConsumerShutdownSignalCallback.class)); }

Target:
void testActivationOrder() throws IOException { sut = new ConsumerHolder(eventConsumerMock, "queue", false, PREFETCH_COUNT, consumerChannelFactoryMock, declarationsListMock, declarerRepositoryMock); assertEquals("queue", sut.getQueueName()); when(consumerChannelFactoryMock.createChannel()).thenReturn(channelMock); sut.activate(); assertDoesNotThrow(sut::activate); InOrder inOrder = inOrder(channelMock, declarerRepositoryMock); inOrder.verify(channelMock).addRecoveryListener(sut); inOrder.verify(channelMock).basicQos(PREFETCH_COUNT); inOrder.verify(declarerRepositoryMock).declare(channelMock, declarationsListMock); inOrder.verify(channelMock).basicConsume(eq("queue"), eq(false), isA(DeliverCallback.class), isA(ConsumerShutdownSignalCallback.class)); }
Source:
public static ListMultipartUploadResponse create(int partNumber, Date lastModified, String eTag, long size) { checkArgument(partNumber > 0, "partNumber must be greater than zero, was: " + partNumber); checkNotNull(eTag, "eTag"); lastModified = (Date) checkNotNull(lastModified, "lastModified").clone(); checkArgument(size >= 0, "size must be positive, was: " + size); return new AutoValue_ListMultipartUploadResponse(partNumber, lastModified, eTag, size); }

Target:
public static ListMultipartUploadResponse create(int partNumber, Date lastModified, String eTag, long size) { checkArgument(partNumber > 0, "partNumber must be greater than zero, was: %s", partNumber); checkNotNull(eTag, "eTag"); lastModified = (Date) checkNotNull(lastModified, "lastModified").clone(); checkArgument(size >= 0, "size must be positive, was: %s", size); return new AutoValue_ListMultipartUploadResponse(partNumber, lastModified, eTag, size); }
Source:
public Optional<PlanNode> apply(PlanNode node, Lookup lookup, PlanNodeIdAllocator idAllocator, SymbolAllocator symbolAllocator, Session session) { ProjectNode parent = (ProjectNode) node; PlanNode source = lookup.resolve(parent.getSource()); if (!(source instanceof IndexSourceNode)) { return Optional.empty(); } IndexSourceNode indexSourceNode = (IndexSourceNode) source; Optional<Set<Symbol>> prunedOutputs = pruneInputs(indexSourceNode.getOutputSymbols(), parent.getAssignments().getExpressions()); if (!prunedOutputs.isPresent()) { return Optional.empty(); } Set<Symbol> newLookupSymbols = indexSourceNode.getLookupSymbols().stream() .filter(prunedOutputs.get()::contains) .collect(toImmutableSet()); Map<Symbol, ColumnHandle> newAssignments = Maps.filterEntries( indexSourceNode.getAssignments(), entry -> prunedOutputs.get().contains(entry.getKey()) || indexSourceNode.getEffectiveTupleDomain().getDomains() .map(domains -> domains.containsKey(entry.getValue())) .orElse(false)); return Optional.of( parent.replaceChildren(ImmutableList.of( new IndexSourceNode( indexSourceNode.getId(), indexSourceNode.getIndexHandle(), indexSourceNode.getTableHandle(), indexSourceNode.getLayout(), newLookupSymbols, indexSourceNode.getOutputSymbols().stream() .filter(prunedOutputs.get()::contains) .collect(toImmutableList()), newAssignments, indexSourceNode.getEffectiveTupleDomain())))); }

Target:
public Optional<PlanNode> apply(PlanNode node, Lookup lookup, PlanNodeIdAllocator idAllocator, SymbolAllocator symbolAllocator, Session session) { ProjectNode parent = (ProjectNode) node; PlanNode source = lookup.resolve(parent.getSource()); if (!(source instanceof IndexSourceNode)) { return Optional.empty(); } IndexSourceNode indexSourceNode = (IndexSourceNode) source; Optional<Set<Symbol>> prunedIndexSourceOutputs = pruneInputs(indexSourceNode.getOutputSymbols(), parent.getAssignments().getExpressions()); if (!prunedIndexSourceOutputs.isPresent()) { return Optional.empty(); } Set<Symbol> newLookupSymbols = indexSourceNode.getLookupSymbols().stream() .filter(prunedIndexSourceOutputs.get()::contains) .collect(toImmutableSet()); Map<Symbol, ColumnHandle> newAssignments = Maps.filterEntries( indexSourceNode.getAssignments(), entry -> prunedIndexSourceOutputs.get().contains(entry.getKey()) || tupleDomainReferencesColumnHandle(indexSourceNode.getEffectiveTupleDomain(), entry.getValue())); List<Symbol> prunedIndexSourceOutputList = indexSourceNode.getOutputSymbols().stream() .filter(prunedIndexSourceOutputs.get()::contains) .collect(toImmutableList()); return Optional.of( parent.replaceChildren(ImmutableList.of( new IndexSourceNode( indexSourceNode.getId(), indexSourceNode.getIndexHandle(), indexSourceNode.getTableHandle(), indexSourceNode.getLayout(), newLookupSymbols, prunedIndexSourceOutputList, newAssignments, indexSourceNode.getEffectiveTupleDomain())))); }
Source:
public void test() throws Exception { sink.input().send(MessageBuilder.withPayload("this is a test").build()); File file = new File("/tmp/dataflow-tests/test.txt"); file.deleteOnExit(); assertTrue("file does not exist", file.exists()); assertEquals("this is a test\n", FileCopyUtils.copyToString(new FileReader(file))); }

Target:
public void test() throws Exception { sink.input().send(MessageBuilder.withPayload("this is a test").build()); File file = new File(ROOT_DIR, "test.txt"); file.deleteOnExit(); assertTrue("file does not exist", file.exists()); assertEquals("this is a test\n", FileCopyUtils.copyToString(new FileReader(file))); }
Source:
public void onEvent(ActivitiEvent event) { if (event.getType().equals(ActivitiEventType.TIMER_SCHEDULED)) { if (event instanceof ActivitiEntityEvent && TimerJobEntity.class.isAssignableFrom(((ActivitiEntityEvent) event).getEntity().getClass())) { converter.from((ActivitiEntityEvent) event) .ifPresent(convertedEvent -> { for (BPMNElementEventListener<BPMNTimerScheduledEvent> listener : processRuntimeEventListeners) { listener.onEvent(convertedEvent); } }); } } }

Target:
public void onEvent(ActivitiEvent event) { converter.from(event) .ifPresent(convertedEvent -> { for (BPMNElementEventListener<BPMNTimerScheduledEvent> listener : processRuntimeEventListeners) { listener.onEvent(convertedEvent); } }); }
Source:
public void testLiteralFor() throws Exception { final DefaultConfiguration configurationTestLiteralFor = createCheckConfig(WhitespaceAfterCheck.class); configurationTestLiteralFor.addAttribute("tokens", "LITERAL_FOR"); final String[] expected = { "51:12: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "for"), }; verify(configurationTestLiteralFor, getPath("InputWhitespaceAfterConditions.java"), expected); }

Target:
public void testLiteralFor() throws Exception { final DefaultConfiguration configurationTestLiteralFor = createCheckConfig(WhitespaceAfterCheck.class); configurationTestLiteralFor.addAttribute("tokens", "LITERAL_FOR"); final String[] expected = { "51:12: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "for"), }; verify(configurationTestLiteralFor, getPath("InputWhitespaceAfterLiteralFor.java"), expected); }
Source:
private void copyOuterJoinInfo( MultiJoin multiJoin, List<Pair<JoinRelType, RexNode>> destJoinSpecs, int adjustmentAmount, List<RelDataTypeField> srcFields, List<RelDataTypeField> destFields) { final List<Pair<JoinRelType, RexNode>> srcJoinSpecs = Pair.zip( multiJoin.getJoinTypes(), multiJoin.getOuterJoinConditions()); if (adjustmentAmount == 0) { destJoinSpecs.addAll(srcJoinSpecs); } else { int nFields = srcFields == null ? 0 : srcFields.size(); int[] adjustments = new int[nFields]; for (int idx = 0; idx < nFields; idx++) { adjustments[idx] = adjustmentAmount; } for (Pair<JoinRelType, RexNode> src : srcJoinSpecs) { destJoinSpecs.add( Pair.of( src.left, src.right == null ? null : src.right.accept( new RelOptUtil.RexInputConverter( multiJoin.getCluster().getRexBuilder(), srcFields, destFields, adjustments)))); } } }

Target:
private void copyOuterJoinInfo( MultiJoin multiJoin, List<Pair<JoinRelType, RexNode>> destJoinSpecs, int adjustmentAmount, List<RelDataTypeField> srcFields, List<RelDataTypeField> destFields) { final List<Pair<JoinRelType, RexNode>> srcJoinSpecs = Pair.zip( multiJoin.getJoinTypes(), multiJoin.getOuterJoinConditions()); if (adjustmentAmount == 0) { destJoinSpecs.addAll(srcJoinSpecs); } else { assert srcFields != null; assert destFields != null; int nFields = srcFields.size(); int[] adjustments = new int[nFields]; for (int idx = 0; idx < nFields; idx++) { adjustments[idx] = adjustmentAmount; } for (Pair<JoinRelType, RexNode> src : srcJoinSpecs) { destJoinSpecs.add( Pair.of( src.left, src.right == null ? null : src.right.accept( new RelOptUtil.RexInputConverter( multiJoin.getCluster().getRexBuilder(), srcFields, destFields, adjustments)))); } } }
Source:
public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo) { title = null; if (view instanceof WebView) { WebView.HitTestResult result = ((WebView) view).getHitTestResult(); if (result.getType() == WebView.HitTestResult.SRC_ANCHOR_TYPE) { Uri uri = Uri.parse(result.getExtra()); if (isValidPageLink(uri)) { WikiSite wikiSite = new WikiSite(uri); if (wikiSite.dbName().equals(((WebViewContextMenuListener) contextMenuListener).getWikiSite().dbName()) && !wikiSite.languageCode().equals(((WebViewContextMenuListener) contextMenuListener).getWikiSite().languageCode())) { wikiSite = ((WebViewContextMenuListener) contextMenuListener).getWikiSite(); } title = wikiSite.titleForInternalLink(uri.getPath()); } } } else if (view instanceof ListView) { AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo; title = ((ListViewContextMenuListener) contextMenuListener) .getTitleForListPosition(info.position); } if (title != null && !title.isSpecial()) { hideSoftKeyboard(view); entry = new HistoryEntry(title, historySource); entry.setReferrer(referrer); new MenuInflater(view.getContext()).inflate(R.menu.menu_page_long_press, menu); menu.setHeaderTitle(title.getDisplayText()); for (int i = 0; i < menu.size(); i++) { menu.getItem(i).setOnMenuItemClickListener(this); } L.d("LongPressHandler final " + title.getCanonicalUri()); } L.d("LongPressHandler title " + title.getCanonicalUri()); }

Target:
public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo) { title = null; if (view instanceof WebView) { WebView.HitTestResult result = ((WebView) view).getHitTestResult(); if (result.getType() == WebView.HitTestResult.SRC_ANCHOR_TYPE) { Uri uri = Uri.parse(result.getExtra()); if (isValidPageLink(uri)) { WikiSite wikiSite = new WikiSite(uri); if (wikiSite.dbName().equals(((WebViewContextMenuListener) contextMenuListener).getWikiSite().dbName()) && !wikiSite.languageCode().equals(((WebViewContextMenuListener) contextMenuListener).getWikiSite().languageCode())) { wikiSite = ((WebViewContextMenuListener) contextMenuListener).getWikiSite(); } title = wikiSite.titleForInternalLink(uri.getPath()); } } } else if (view instanceof ListView) { AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo; title = ((ListViewContextMenuListener) contextMenuListener) .getTitleForListPosition(info.position); } if (title != null && !title.isSpecial()) { hideSoftKeyboard(view); entry = new HistoryEntry(title, historySource); entry.setReferrer(referrer); new MenuInflater(view.getContext()).inflate(R.menu.menu_page_long_press, menu); menu.setHeaderTitle(title.getDisplayText()); for (int i = 0; i < menu.size(); i++) { menu.getItem(i).setOnMenuItemClickListener(this); } } }
Source:
public int hashCode() { return Objects.hashCode(indexer, listener); }

Target:
public int hashCode() { return Objects.hash(indexer, listener); }
Source:
private List<String> categoriesForPipeline(Task task) { if (task instanceof PlaceholderTask) { PlaceholderTask placeholderTask = (PlaceholderTask)task; try { FlowNode firstThrottle = firstThrottleStartNode(placeholderTask.getNode()); Run<?,?> r = placeholderTask.run(); if (firstThrottle != null && r != null) { return ThrottleJobProperty.getCategoriesForRunAndFlowNode(r.getExternalizableId(), firstThrottle.getId()); } } catch (IOException | InterruptedException e) { return new ArrayList<>(); } } return new ArrayList<>(); }

Target:
private List<String> categoriesForPipeline(Task task) { if (task instanceof PlaceholderTask) { PlaceholderTask placeholderTask = (PlaceholderTask)task; try { FlowNode firstThrottle = firstThrottleStartNode(placeholderTask.getNode()); Run<?,?> r = placeholderTask.run(); if (firstThrottle != null && r != null) { return ThrottleJobProperty.getCategoriesForRunAndFlowNode(r.getExternalizableId(), firstThrottle.getId()); } } catch (IOException | InterruptedException e) { LOGGER.log(Level.WARNING, "Error getting categories for pipeline {0}: {1}", new Object[] {task.getDisplayName(), e}); return new ArrayList<>(); } } return new ArrayList<>(); }
Source:
public void testBulkSlotAllocationFulfilledWithAvailableSlots() throws InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException { PhysicalSlotRequest request = createPhysicalSlotRequest(); addSlotToSlotPool(); CompletableFuture<PhysicalSlotRequest.Result> slotFuture = allocateSlot(request); PhysicalSlotRequest.Result result = slotFuture.get(TIMEOUT.getSize(), TIMEOUT.getUnit()); assertThat(result.getSlotRequestId(), is(request.getSlotRequestId())); }

Target:
public void testBulkSlotAllocationFulfilledWithAvailableSlots() throws InterruptedException, ExecutionException { PhysicalSlotRequest request = createPhysicalSlotRequest(); addSlotToSlotPool(); CompletableFuture<PhysicalSlotRequest.Result> slotFuture = allocateSlot(request); PhysicalSlotRequest.Result result = slotFuture.get(); assertThat(result.getSlotRequestId(), is(request.getSlotRequestId())); }
Source:
private static void addViewerService(FileViewerService service) { int index = 0; int orderPriority = service.getOrderPriority(); while (index < SERVICES.size() && orderPriority < SERVICES.get(index).getOrderPriority()) { index++; } SERVICES.add(index, service); }

Target:
private static void addViewerService(FileViewerService service) { SERVICES.add(service); SERVICES.sort(FileViewerServiceTracker::compareServices); }
Source:
private void importProject(Intent data) { if (data == null) { setShowProgressBar(false); return; } if (!data.getData().getScheme().equals("file")) { throw new RuntimeException("importProject has to be called with a file uri. (not a content uri"); } try { File cacheFile = new File(CACHE_DIR, CACHED_PROJECT_ZIP_FILE_NAME); if (cacheFile.exists()) { if (cacheFile.isDirectory()) { StorageOperations.deleteDir(cacheFile); } else { cacheFile.delete(); } } File src = new File(data.getData().getPath()); if (src.isDirectory()) { new ProjectImportTask(projectImportListener) .execute(src); } else { File projectFile = StorageOperations .copyUriToDir(getContext().getContentResolver(), data.getData(), CACHE_DIR, CACHED_PROJECT_ZIP_FILE_NAME); new ProjectUnzipAndImportTask(projectUnzipAndImportListener) .execute(projectFile); } setShowProgressBar(true); } catch (IOException e) { Log.e(TAG, "Cannot resolve project to import.", e); } }

Target:
private void importProject(Intent data) { if (data == null) { setShowProgressBar(false); return; } if (!data.getData().getScheme().equals("file")) { throw new IllegalArgumentException("importProject has to be called with a file uri. (not a content uri"); } try { File cacheFile = new File(CACHE_DIR, CACHED_PROJECT_ZIP_FILE_NAME); if (cacheFile.exists()) { cacheFile.delete(); } File src = new File(data.getData().getPath()); if (src.isDirectory()) { new ProjectImportTask(projectImportListener) .execute(src); } else { File projectFile = StorageOperations .copyUriToDir(getContext().getContentResolver(), data.getData(), CACHE_DIR, CACHED_PROJECT_ZIP_FILE_NAME); new ProjectUnzipAndImportTask(projectUnzipAndImportListener) .execute(projectFile); } setShowProgressBar(true); } catch (IOException e) { Log.e(TAG, "Cannot resolve project to import.", e); } }
Source:
public List<ExchangeType> getExchanges() { exchanges = exchangeService.getAllExchanges(); return exchanges; }

Target:
public List<ExchangeType> getExchanges() { return exchangeService.getAllExchanges(); }
Source:
synchronized static boolean sslVerifyCallback(String serverAddress, String pemData, int depth) { try { if (ROS_CERTIFICATES_CHAIN == null) { ROS_CERTIFICATES_CHAIN = new HashMap<>(); TRUST_MANAGER = systemDefaultTrustManager(); CERTIFICATE_FACTORY = CertificateFactory.getInstance("X.509"); } if (!ROS_CERTIFICATES_CHAIN.containsKey(serverAddress)) { ROS_CERTIFICATES_CHAIN.put(serverAddress, new LinkedList<String>()); } ROS_CERTIFICATES_CHAIN.get(serverAddress).add(pemData); if (depth == 0) { int n = ROS_CERTIFICATES_CHAIN.get(serverAddress).size(); X509Certificate[] chain = new X509Certificate[n]; for (String pem : ROS_CERTIFICATES_CHAIN.get(serverAddress)) { chain[--n] = buildCertificateFromPEM(pem); } try { TRUST_MANAGER.checkServerTrusted(chain, "RSA"); boolean isValid = OkHostnameVerifier.INSTANCE.verify(serverAddress, chain[0]); if (isValid) { return true; } else { RealmLog.error("Can not verify the hostname for the host: " + serverAddress); return false; } } catch (CertificateException e) { RealmLog.error(e, "Can not validate SSL chain certificate for the host: " + serverAddress); return false; } finally { ROS_CERTIFICATES_CHAIN.remove(serverAddress); } } else { return true; } } catch (CertificateException | IOException e) { RealmLog.error(e, "Error during certificate validation for host: " + serverAddress); return false; } }

Target:
synchronized static boolean sslVerifyCallback(String serverAddress, String pemData, int depth) { try { if (ROS_CERTIFICATES_CHAIN == null) { ROS_CERTIFICATES_CHAIN = new HashMap<>(); TRUST_MANAGER = systemDefaultTrustManager(); CERTIFICATE_FACTORY = CertificateFactory.getInstance("X.509"); } if (!ROS_CERTIFICATES_CHAIN.containsKey(serverAddress)) { ROS_CERTIFICATES_CHAIN.put(serverAddress, new ArrayList<String>()); } ROS_CERTIFICATES_CHAIN.get(serverAddress).add(pemData); if (depth == 0) { List<String> pemChain = ROS_CERTIFICATES_CHAIN.get(serverAddress); int n = pemChain.size(); X509Certificate[] chain = new X509Certificate[n]; for (String pem : pemChain) { chain[--n] = buildCertificateFromPEM(pem); } try { TRUST_MANAGER.checkServerTrusted(chain, "RSA"); boolean isValid = OkHostnameVerifier.INSTANCE.verify(serverAddress, chain[0]); if (isValid) { return true; } else { RealmLog.error("Can not verify the hostname for the host: " + serverAddress); return false; } } catch (CertificateException e) { RealmLog.error(e, "Can not validate SSL chain certificate for the host: " + serverAddress); return false; } finally { ROS_CERTIFICATES_CHAIN.remove(serverAddress); } } else { return true; } } catch (Exception e) { RealmLog.error(e, "Error during certificate validation for host: " + serverAddress); return false; } }
Source:
public void convertsEntitiesToListOfResources() { Person first = new Person(); first.id = 1L; Person second = new Person(); second.id = 2L; List<PersonResource> result = assembler.toList(Arrays.asList(first, second)); LinkBuilder builder = linkTo(PersonController.class); PersonResource firstResource = new PersonResource(); firstResource.add(builder.slash(1L).withSelfRel()); PersonResource secondResource = new PersonResource(); secondResource.add(builder.slash(1L).withSelfRel()); assertThat(result).hasSize(2); assertThat(result).contains(firstResource, secondResource); }

Target:
public void convertsEntitiesToListOfResources() { Person first = new Person(); first.id = 1L; Person second = new Person(); second.id = 2L; List<PersonResource> result = assembler.build(Arrays.asList(first, second)).toListOfResources(); LinkBuilder builder = linkTo(PersonController.class); PersonResource firstResource = new PersonResource(); firstResource.add(builder.slash(1L).withSelfRel()); PersonResource secondResource = new PersonResource(); secondResource.add(builder.slash(1L).withSelfRel()); assertThat(result).hasSize(2); assertThat(result).contains(firstResource, secondResource); }
Source:
public void testParcelUnparcel() { assertParcelingIsLossless(new IpSecConfig()); IpSecConfig c = getSampleConfig(); assertParcelingIsLossless(c); }

Target:
public void testParcelUnparcel() { assertParcelingIsLossless(new IpSecConfig()); IpSecConfig c = getSampleConfig(); assertParcelSane(c, 15); }
Source:
protected AdapterFactory getLoadedFactoryForTypes(Collection<?> types) { AdapterFactory result = null; FactoryLoop: for (AdapterFactory factory : adapterFactories) { if (factory instanceof ComposedAdapterFactory) { AdapterFactory candidate = ((ComposedAdapterFactory)factory).getFactoryForTypes(types); if (candidate != null) { if (!candidate.isFactoryForType(ANY_EOBJECT) && !candidate.isFactoryForType(ANY_OBJECT)) { return candidate; } else if (result == null) { result = candidate; } } } else { for (Object type : types) { if (!factory.isFactoryForType(type)) { continue FactoryLoop; } } if (!factory.isFactoryForType(ANY_EOBJECT) && !factory.isFactoryForType(ANY_OBJECT)) { return factory; } else if (result == null) { result = factory; } } } return result; }

Target:
protected AdapterFactory getLoadedFactoryForTypes(Collection<?> types) { FactoryLoop: for (AdapterFactory factory : adapterFactories) { if (factory instanceof ComposedAdapterFactory) { AdapterFactory candidate = ((ComposedAdapterFactory)factory).getFactoryForTypes(types); if (candidate != null) { return candidate; } } else { for (Object type : types) { if (!factory.isFactoryForType(type)) { continue FactoryLoop; } } return factory; } } return null; }
Source:
public JSONObject fetchDiff() throws ArcanistUsageException, IOException, InterruptedException { Map params = new HashMap<String, String>(); params.put("ids", new String[]{this.diffID}); JSONObject query = this.callConduit("differential.querydiffs", params); JSONObject response; try { response = query.getJSONObject("response"); } catch (JSONException e) { e.printStackTrace(); throw new ArcanistUsageException( String.format("No 'response' object found in conduit call: (%s) %s", e.getMessage(), query.toString(2))); } try { return response.getJSONObject(diffID); } catch (JSONException e) { e.printStackTrace(); throw new ArcanistUsageException( String.format("Unable to find '%s' key in response: (%s) %s", diffID, e.getMessage(), response.toString(2))); } }

Target:
public JSONObject fetchDiff() throws ArcanistUsageException, IOException, InterruptedException { Map params = new HashMap<String, String>(); params.put("ids", new String[]{this.diffID}); JSONObject query = this.callConduit("differential.querydiffs", params); JSONObject response; try { response = query.getJSONObject("response"); } catch (JSONException e) { throw new ArcanistUsageException( String.format("No 'response' object found in conduit call: (%s) %s", e.getMessage(), query.toString(2))); } try { return response.getJSONObject(diffID); } catch (JSONException e) { throw new ArcanistUsageException( String.format("Unable to find '%s' key in response: (%s) %s", diffID, e.getMessage(), response.toString(2))); } }
Source:
return (Response) reply; } }; private final Function<Object, Response> _replyHandler; private final Map<String, BlockingCell<Object>> _continuationMap = new HashMap<String, BlockingCell<Object>>(); private int _correlationId; private DefaultConsumer _consumer; public RpcClient(RpcClientParams params) throws IOException { _channel = params.getChannel(); _exchange = params.getExchange(); _routingKey = params.getRoutingKey(); _replyTo = params.getReplyTo(); if (params.getTimeout() < NO_TIMEOUT) { throw new IllegalArgumentException("Timeout argument must be NO_TIMEOUT(-1) or non-negative."); } _timeout = params.getTimeout(); _useMandatory = params.isUseMandatory(); _replyHandler = params.getReplyHandler(); _correlationId = 0; _consumer = setupConsumer(); if (_useMandatory) { this._channel.addReturnListener(returnMessage -> { synchronized (_continuationMap) { String replyId = returnMessage.getProperties().getCorrelationId(); BlockingCell<Object> blocker = _continuationMap.remove(replyId); if (blocker == null) { LOGGER.warn("No outstanding request for correlation ID {}", replyId); } else { blocker.set(new UnroutableRpcRequestException(returnMessage)); } } }); } }

Target:
return (Response) reply; } }; private final Function<Object, Response> _replyHandler; private final Map<String, BlockingCell<Object>> _continuationMap = new HashMap<String, BlockingCell<Object>>(); private int _correlationId; private DefaultConsumer _consumer; public RpcClient(RpcClientParams params) throws IOException { _channel = params.getChannel(); _exchange = params.getExchange(); _routingKey = params.getRoutingKey(); _replyTo = params.getReplyTo(); if (params.getTimeout() < NO_TIMEOUT) { throw new IllegalArgumentException("Timeout argument must be NO_TIMEOUT(-1) or non-negative."); } _timeout = params.getTimeout(); _useMandatory = params.shouldUseMandatory(); _replyHandler = params.getReplyHandler(); _correlationId = 0; _consumer = setupConsumer(); if (_useMandatory) { this._channel.addReturnListener(returnMessage -> { synchronized (_continuationMap) { String replyId = returnMessage.getProperties().getCorrelationId(); BlockingCell<Object> blocker = _continuationMap.remove(replyId); if (blocker == null) { LOGGER.warn("No outstanding request for correlation ID {}", replyId); } else { blocker.set(new UnroutableRpcRequestException(returnMessage)); } } }); } }
Source:
protected Control createPageControls(Composite parent) { setTitle(Messages.RemoveReviewerDialog_Remove_Reviewer); setMessage( NLS.bind(Messages.RemoveReviewerDialog_Are_You_Sure_You_Want_To_Remove, userToRemove.getDisplayName())); return parent; }

Target:
protected Control createPageControls(Composite parent) { setTitle(Messages.RemoveReviewerDialog_Remove_Reviewer); Label label = new Label(parent, SWT.CENTER); label.setText( NLS.bind(Messages.RemoveReviewerDialog_Are_You_Sure_You_Want_To_Remove, userToRemove.getDisplayName())); return parent; }
Source:
public void closeThread(String reason) { waitForElementByCss("div.msg-toolbar"); executeScript("document.getElementsByClassName(\"buttons\")[1].style.display = \"block\""); waitForElementByElement(moreButton); mouseOver(moreButtonCss); executeScript("document.querySelectorAll(\"div.msg-toolbar nav.wikia-menu-button.secondary.combined\")[0].click()"); mouseOver(".WikiaMenuElement .close-thread"); jQueryNthElemClick(".WikiaMenuElement .close-thread", 0); waitForElementByElement(removeCloseMessageOverLay); waitForElementByElement(removeCloseMessageConfirmButton); removeCloseMessageReason.sendKeys(reason); clickAndWait(removeCloseMessageConfirmButton); driver.navigate().refresh(); PageObjectLogging.log("closeThread", "Thread is closed" + reason, true, driver); }

Target:
public void closeThread(String reason) { waitForElementByElement(msgToolbar); setStyle(".buttons", "1", "block"); secondaryCombinedMoreButton.click(); mouseOver(closeThreadCSS); click(closeThread); waitForElementByElement(removeCloseOverLay); waitForElementByElement(removeCloseConfirmButton); removeCloseReason.sendKeys(reason); click(removeCloseConfirmButton); refreshPage(); PageObjectLogging.log("closeThread", "Thread is closed" + reason, true); }
Source:
public final void removesKey() throws Exception { final MkContainer container = new MkGrizzlyContainer().next( new MkAnswer.Simple( HttpURLConnection.HTTP_NO_CONTENT, "" ) ).start(); final PublicKeys keys = this.getKeys(); try { keys.remove(1); final MkQuery query = container.take(); MatcherAssert.assertThat( query.uri().toString(), Matchers.endsWith("/user/keys/1") ); MatcherAssert.assertThat( query.method(), Matchers.equalTo(Request.DELETE) ); } finally { container.stop(); } }

Target:
public final void removesKey() throws Exception { final PublicKeys keys = this.keys(); final PublicKey key = keys.create("rsa", "rsa sh"); MatcherAssert.assertThat( keys.iterate() , Matchers.hasItem(key) ); keys.remove(key.number()); MatcherAssert.assertThat( keys.iterate(), Matchers.not(Matchers.hasItem(key)) ); }
Source:
public String waitForNewLeader(long timeout) throws Exception { long start = System.currentTimeMillis(); long curTimeout; synchronized (lock) { while ( exception == null && (address == null || address.equals(oldAddress)) && (curTimeout = timeout - System.currentTimeMillis() + start) > 0) { try { lock.wait(curTimeout); } catch (InterruptedException e) { } } } if (exception != null) { throw exception; } else if (address == null || address.equals(oldAddress)) { throw new TimeoutException("Listener was not notified about a leader within " + timeout + "ms"); } oldAddress = address; return address; }

Target:
public String waitForNewLeader(long timeout) throws Exception { throwExceptionIfNotNull(); final String errorMsg = "Listener was not notified about a new leader within " + timeout + "ms"; CommonTestUtils.waitUntilCondition( () -> { leader = leaderEventQueue.poll(timeout, TimeUnit.MILLISECONDS); return leader != null && !leader.isEmpty() && !leader.getLeaderAddress().equals(oldAddress); }, Deadline.fromNow(Duration.ofMillis(timeout)), errorMsg); oldAddress = leader.getLeaderAddress(); return leader.getLeaderAddress(); }
Source:
public EmailProducerBuilder setBccRecipient(String recipient) { List<String> recipients = new ArrayList<String>(); recipients.add(recipient); return this.setBccRecipients(recipients); }

Target:
public EmailProducerBuilder setBccRecipient(String recipient) { return this.setBccRecipients(Arrays.asList(recipient)); }
Source:
private Function<String, OsFamily> osFamily() { return new Function<String, OsFamily>() { OsFamily osFamily = OsFamily.UNRECOGNIZED; @Override public OsFamily apply(final String description) { if (description != null) { if (description.contains(CENTOS)) osFamily = OsFamily.CENTOS; else if (description.contains(UBUNTU)) osFamily = OsFamily.UBUNTU; } logger.debug("os family for item: %s is %s", description, osFamily); return osFamily; } }; }

Target:
private Function<String, OsFamily> osFamily() { return new Function<String, OsFamily>() { @Override public OsFamily apply(final String description) { if (description != null) { if (description.contains(CENTOS)) return OsFamily.CENTOS; else if (description.contains(UBUNTU)) return OsFamily.UBUNTU; } return OsFamily.UNRECOGNIZED; } }; }
Source:
public Assignment apply(Task task, TaskContext context, String excludedUser) { if (!active) { logger.debug("{} strategy is not active", this); return null; } logger.debug("Using rules to assign actual owner to task {}", task); KieSession kieSession = this.kieContainer.newKieSession(); try { context.loadTaskVariables(task); kieSession.insert(task); kieSession.fireAllRules(); Set<Assignment> assignments = new TreeSet<>(); String queryName = System.getProperty("org.jbpm.task.assignment.rules.query"); if (queryName != null) { logger.debug("Query is going to be used to retrieve results from working memory", queryName); QueryResults results = kieSession.getQueryResults(queryName); results.forEach(row -> assignments.add((Assignment)row.get("assignment"))); } else { logger.debug("No query defined, retrieving all facts of type Assignment"); Collection<Assignment> results = (Collection<Assignment>) kieSession.getObjects(new ClassObjectFilter(Assignment.class)); assignments.addAll(results); } logger.debug("Rule evaluation completed with selected assignemtns of {}", assignments); if (assignments.isEmpty()) { logger.debug("No assignments found by BusinessRule strategy"); return null; } Assignment selected = assignments.iterator().next(); logger.debug("Selected assignment is for task {}", selected, task); return selected; } finally { kieSession.dispose(); logger.debug("KieSession in BusinessRule disposed"); } }

Target:
public Assignment apply(Task task, TaskContext context, String excludedUser) { if (!active) { logger.debug("{} strategy is not active", this); return null; } logger.debug("Using rules to assign actual owner to task {}", task); KieSession kieSession = this.kieContainer.newKieSession(); try { context.loadTaskVariables(task); kieSession.insert(task); kieSession.fireAllRules(); Set<Assignment> assignments = new TreeSet<>(); String queryName = System.getProperty("org.jbpm.task.assignment.rules.query"); if (queryName != null) { logger.debug("Query is going to be used to retrieve results from working memory", queryName); QueryResults results = kieSession.getQueryResults(queryName); results.forEach(row -> assignments.add((Assignment)row.get("assignment"))); } else { logger.debug("No query defined, retrieving all facts of type Assignment"); Collection<Assignment> results = (Collection<Assignment>) kieSession.getObjects(new ClassObjectFilter(Assignment.class)); assignments.addAll(results); } logger.debug("Rule evaluation completed with selected assignments of {}", assignments); if (assignments.isEmpty()) { logger.debug("No assignments found by BusinessRule strategy"); return null; } Assignment selected = assignments.iterator().next(); logger.debug("Selected assignment is for task {}", selected, task); return selected; } finally { kieSession.dispose(); logger.debug("KieSession in BusinessRule disposed"); } }
Source:
public VoldemortService getService(ServiceType type) { for(VoldemortService service: services) if(service.getType().equals(type)) return service; throw new IllegalStateException(type.getDisplayName() + " has not been initialized."); }

Target:
public VoldemortService getService(ServiceType type) { for(VoldemortService service: services) { if(service.getType().equals(type)) { return service; } } throw new IllegalStateException(type.getDisplayName() + " has not been initialized."); }
Source:
protected void checkIfComplete() { if (observer == null) return; if (bytesCompleted >= bytesTotal) super.checkIfComplete(); }

Target:
protected void checkIfComplete() { if (observer == null) { return; } if (bytesCompleted >= bytesTotal) { super.checkIfComplete(); } }
Source:
public long getLong() { long retVal = buf.getLong((int) (pos / 8L)); pos += 64L; return retVal; }

Target:
public long getLong() { long a = getInt(); long b = getInt(); a &= 0xFFFFFFFFL; b &= 0xFFFFFFFFL; if (this.byteOrder == ByteOrder.BIG_ENDIAN) { return (a << 32) | b; } return (b << 32) | a; }
Source:
public Map<String, Object> visualize( ControlFlowGraph cfg, Block entry, @Nullable Analysis<V, S, T> analysis) { String stringGraph = visualizeGraph(cfg, entry, analysis).trim(); Map<String, Object> res = new HashMap<>(); res.put("stringGraph", stringGraph); return res; }

Target:
public Map<String, Object> visualize( ControlFlowGraph cfg, Block entry, @Nullable Analysis<V, S, T> analysis) { String stringGraph = visualizeGraph(cfg, entry, analysis); Map<String, Object> res = new HashMap<>(); res.put("stringGraph", stringGraph); return res; }
Source:
private void doBatchWork(BatchBackend backend) throws InterruptedException { ExecutorService executor = Executors.newFixedThreadPool( batchIndexingThreads, "BatchIndexingWorkspace" ); for ( Class<?> type : rootEntities ) { executor.execute( new BatchIndexingWorkspace( searchFactoryImplementor, sessionFactory, type, objectLoadingThreads, collectionLoadingThreads, cacheMode, objectLoadingBatchSize, endAllSignal, monitor, backend, objectsLimit, idFetchSize ) ); } executor.shutdown(); endAllSignal.await(); }

Target:
private void doBatchWork(BatchBackend backend) throws InterruptedException { ExecutorService executor = Executors.newFixedThreadPool( typesToIndexInParallel, "BatchIndexingWorkspace" ); for ( Class<?> type : rootEntities ) { executor.execute( new BatchIndexingWorkspace( searchFactoryImplementor, sessionFactory, type, objectLoadingThreads, collectionLoadingThreads, cacheMode, objectLoadingBatchSize, endAllSignal, monitor, backend, objectsLimit, idFetchSize ) ); } executor.shutdown(); endAllSignal.await(); }
Source:
public void activate() { VDS vds = null; boolean cpuFlagsChanged = false; try { if (log.isDebugEnabled()) { log.debugFormat( "ResourceManager::activateVds - trying to activate host {0} , meanwhile setting status to Unassigned meanwhile", getVdsId()); } vds = DbFacade.getInstance().getVdsDAO().get(getVdsId()); RefObject<Boolean> tempRefObject = new RefObject<Boolean>(cpuFlagsChanged); VDSStatus newStatus = refreshCapabilities(tempRefObject, vds); if (log.isDebugEnabled()) { log.debugFormat( "ResourceManager::activateVds - success to refreshCapabilities for host {0} , new status will be {1} ", getVdsId(), newStatus); } cpuFlagsChanged = tempRefObject.argvalue; } catch (java.lang.Exception e) { log.infoFormat("ResourceManager::activateVds - failed to get VDS = {0} capabilities with error: {1}.", getVdsId(), e.getMessage()); log.infoFormat("ResourceManager::activateVds - failed to activate VDS = {0}", getVdsId()); } finally { if (vds != null) { UpdateDynamicData(vds.getDynamicData()); if (servicePolicy.checkCpuFlags()) { ResourceManager.getInstance().getEventListener().processOnCpuFlagsChange(vds.getId()); } ResourceManager.getInstance().getEventListener().handleVdsVersion(vds.getId()); } } }

Target:
public void activate() { VDS vds = null; boolean cpuFlagsChanged = false; try { if (log.isDebugEnabled()) { log.debugFormat( "ResourceManager::activateVds - trying to activate host {0} , meanwhile setting status to Unassigned meanwhile", getVdsId()); } vds = DbFacade.getInstance().getVdsDAO().get(getVdsId()); RefObject<Boolean> tempRefObject = new RefObject<Boolean>(cpuFlagsChanged); VDSStatus newStatus = refreshCapabilities(tempRefObject, vds); if (log.isDebugEnabled()) { log.debugFormat( "ResourceManager::activateVds - success to refreshCapabilities for host {0} , new status will be {1} ", getVdsId(), newStatus); } cpuFlagsChanged = tempRefObject.argvalue; } catch (java.lang.Exception e) { log.infoFormat("ResourceManager::activateVds - failed to get VDS = {0} capabilities with error: {1}.", getVdsId(), e.getMessage()); log.infoFormat("ResourceManager::activateVds - failed to activate VDS = {0}", getVdsId()); } finally { if (vds != null) { UpdateDynamicData(vds.getDynamicData()); if (monitoringStrategy.shouldTestSpecialHardwareCapabilities()) { ResourceManager.getInstance().getEventListener().processOnCpuFlagsChange(vds.getId()); } ResourceManager.getInstance().getEventListener().handleVdsVersion(vds.getId()); } } }
Source:
public String toString() { return toStringHelper(this) .add("path", relativeUri) .add("start", start) .add("end", end) .add("fileSize", fileSize) .toString(); }

Target:
public String toString() { return toStringHelper(this) .add("relativeUri", new String(relativeUri, UTF_8)) .add("start", start) .add("end", end) .add("fileSize", fileSize) .toString(); }
Source:
public static Package buildPackageFromTemplate() { try { ClassLoader classLoader = PackageExtension.class.getClassLoader(); File file = new File(classLoader.getResource(DATAPAAKCAGE_TEMPLATE_FILE).getFile()); return new Package(FileUtils.readFileToString(file), false); } catch (ValidationException e) { logger.error("validation failed", ExceptionUtils.getStackTrace(e)); } catch (DataPackageException e) { logger.error("DataPackage Exception", ExceptionUtils.getStackTrace(e)); } catch (IOException e) { logger.error("IOException when build package from template", ExceptionUtils.getStackTrace(e)); } return null; }

Target:
public static Package buildPackageFromTemplate() { try { ClassLoader classLoader = PackageExtension.class.getClassLoader(); File file = new File(classLoader.getResource(DATAPACKAGE_TEMPLATE_FILE).getFile()); return new Package(FileUtils.readFileToString(file), false); } catch (ValidationException e) { logger.error("validation failed", ExceptionUtils.getStackTrace(e)); } catch (DataPackageException e) { logger.error("DataPackage Exception", ExceptionUtils.getStackTrace(e)); } catch (IOException e) { logger.error("IOException when build package from template", ExceptionUtils.getStackTrace(e)); } return null; }
Source:
private void dispose() { fContextService.removeDebugContextListener(this); fgServices.remove(fWindow); fCommandUpdates.clear(); fWindow = null; }

Target:
private void dispose() { fContextService.removeDebugContextListener(this); synchronized (fgServices) { fgServices.remove(fWindow); } fCommandUpdates.clear(); fWindow = null; }
Source:
public void shutdown() { Optional.ofNullable(heartbeatScheduler.get()).ifPresent(Scheduler::stop); }

Target:
public void shutdown() { heartbeatMonitor().shutdown(); }
Source:
public CloseableSpliterator<E> spliterator() { return null; }

Target:
public CloseableSpliterator<E> spliterator() { return Closeables.spliterator(set.spliterator()); }