auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void releaseBitmap() { if (mBitmapCanvas != null) { mBitmapCanvas.setBitmap(null); mBitmapCanvas = null; } if (mDrawBitmap != null) { mDrawBitmap.get().recycle(); mDrawBitmap.clear(); mDrawBitmap = null; } System.gc(); }

Target:
public void releaseBitmap() { if (mBitmapCanvas != null) { mBitmapCanvas.setBitmap(null); mBitmapCanvas = null; } if (mDrawBitmap != null) { mDrawBitmap.get().recycle(); mDrawBitmap.clear(); mDrawBitmap = null; } }
Source:
private String appendNamespace(String name) { if (namespace.isEmpty()) { return name; } return namespace + SEPARATOR + name; }

Target:
private String appendNamespace(String name) { return namespace.isEmpty()? name : namespace + SEPARATOR + name; }
Source:
public void bossBarProgressChanged(final BossBar bar, final float oldProgress, final float newProgress) { if (Math.abs(newProgress - this.impl$lastSentProgress) > EPSILON) { this.impl$lastSentProgress = newProgress; this.sendUpdate(SUpdateBossInfoPacket.Operation.UPDATE_PCT); } }

Target:
public void bossBarProgressChanged(final BossBar bar, final float oldProgress, final float newProgress) { if (Math.abs(newProgress - this.impl$lastSentProgress) > ServerBossInfoMixin.EPSILON) { this.impl$lastSentProgress = newProgress; this.sendUpdate(SUpdateBossInfoPacket.Operation.UPDATE_PCT); } }
Source:
private CompletionStage<Void> handleInStoreExpirationInternal(K key, MarshallableEntry<K, V> marshallableEntry) { CompletableFuture<Boolean> completableFuture = new CompletableFuture<>(); CompletableFuture<Boolean> previousFuture = expiring.putIfAbsent(key, completableFuture); if (previousFuture == null) { completableFuture.whenComplete((ignore, t) -> expiring.remove(key)); AdvancedCache<K, V> cacheToUse = cache.withFlags(Flag.SKIP_SHARED_CACHE_STORE, Flag.ZERO_LOCK_ACQUISITION_TIMEOUT); CompletionStage<Boolean> resultStage; if (marshallableEntry != null) { Metadata metadata = marshallableEntry.getMetadata(); resultStage = cacheToUse.removeLifespanExpired(key, marshallableEntry.getValue(), metadata.lifespan() == -1 ? null : metadata.lifespan()); } else { resultStage = cacheToUse.removeLifespanExpired(key, null, null); } return CompletionStages.ignoreValue(resultStage.whenComplete((b, t) -> { if (t != null) { completableFuture.completeExceptionally(t); } else { completableFuture.complete(b); } })); } return CompletionStages.ignoreValue(previousFuture); }

Target:
private CompletionStage<Void> handleInStoreExpirationInternal(K key, MarshallableEntry<K, V> marshallableEntry) { CompletableFuture<Boolean> completableFuture = new CompletableFuture<>(); CompletableFuture<Boolean> previousFuture = expiring.putIfAbsent(key, completableFuture); if (previousFuture == null) { AdvancedCache<K, V> cacheToUse = cache.withFlags(Flag.SKIP_SHARED_CACHE_STORE, Flag.ZERO_LOCK_ACQUISITION_TIMEOUT); CompletionStage<Boolean> resultStage; if (marshallableEntry != null) { Metadata metadata = marshallableEntry.getMetadata(); resultStage = cacheToUse.removeLifespanExpired(key, marshallableEntry.getValue(), metadata.lifespan() == -1 ? null : metadata.lifespan()); } else { resultStage = cacheToUse.removeLifespanExpired(key, null, null); } return CompletionStages.ignoreValue(resultStage.whenComplete((b, t) -> { expiring.remove(key); if (t != null) { completableFuture.completeExceptionally(t); } else { completableFuture.complete(b); } })); } return CompletionStages.ignoreValue(previousFuture); }
Source:
public void swapReadWriteBuffers() { FBO fbo = get(new ResourceUrn("engine:sceneOpaque")); fboLookup.put(new ResourceUrn("engine:sceneOpaque"), get(new ResourceUrn("engine:sceneOpaquePingPong"))); fboLookup.put(new ResourceUrn("engine:sceneOpaquePingPong"), fbo); notifySubscribers(); }

Target:
public void swapReadWriteBuffers() { FBO fbo = get(READONLY_GBUFFER); fboLookup.put(READONLY_GBUFFER, get(WRITEONLY_GBUFFER)); fboLookup.put(WRITEONLY_GBUFFER, fbo); notifySubscribers(); }
Source:
static Map<String, Object> mergeFailingOnReplacement(Map<String, Object> first, Map<String, Object> second) { Objects.requireNonNull(first, "merging requires two non-null maps but the first map was null"); Objects.requireNonNull(second, "merging requires two non-null maps but the second map was null"); Map<String, Object> results = new HashMap<>(first); Set<String> prefixes = second.keySet().stream().map(MetadataCreateIndexService::prefix).collect(Collectors.toSet()); List<String> matchedPrefixes = new ArrayList<>(); results.keySet().forEach(k -> { if (prefixes.contains(prefix(k))) { matchedPrefixes.add(k); } }); if (matchedPrefixes.size() > 0) { throw new IllegalArgumentException("mapping fields " + matchedPrefixes + " cannot be replaced during template composition"); } results.putAll(second); return results; }

Target:
static Map<String, Object> mergeFailingOnReplacement(Map<String, Object> first, Map<String, Object> second) { Objects.requireNonNull(first, "merging requires two non-null maps but the first map was null"); Objects.requireNonNull(second, "merging requires two non-null maps but the second map was null"); Map<String, Object> results = new HashMap<>(first); Set<String> prefixes = second.keySet().stream().map(MetadataCreateIndexService::prefix).collect(Collectors.toSet()); List<String> matchedPrefixes = results.keySet().stream().filter(k -> prefixes.contains(prefix(k))).collect(Collectors.toList()); if (matchedPrefixes.size() > 0) { throw new IllegalArgumentException("mapping fields " + matchedPrefixes + " cannot be replaced during template composition"); } results.putAll(second); return results; }
Source:
protected Long nullUnsafeScalar(LocalTime value) { return value.atDate( LocalDate.of( 1970, Month.JANUARY, 1 ) ).atZone( ZoneOffset.UTC ).toInstant().toEpochMilli(); }

Target:
protected Long nullUnsafeScalar(LocalTime value) { return value.atDate( EPOCH_DAY ).toInstant( ZoneOffset.UTC ).toEpochMilli(); }
Source:
private boolean isDevEnvironment() { Boolean result = false; String[] activeProfiles = environment.getActiveProfiles(); for (String profile : activeProfiles) { if (profile.equals(ENVIRONMENT_DEV_PROFILE)) { result = true; break; } } return result; }

Target:
private boolean isDevEnvironment() { String[] activeProfiles = environment.getActiveProfiles(); for (String profile : activeProfiles) { if (profile.equals(ENVIRONMENT_DEV_PROFILE)) { return true; } } return false; }
Source:
public void addDesc(Entity entity) { if (entity != null) { if(indentation <= Report.DEFAULT_INDENTATION || showImage) { imageCode = "<span id='" + entity.getId() + "'></span>"; } add("<font color='0xffffff'><a href=\"#entity:" + entity.getId() + "\">" + entity.getShortName() + "</a></font>", true); String colorcode = Integer.toHexString(PlayerColors.getColor( entity.getOwner().getColorIndex()).getRGB() & 0x00f0f0f0); add("<B><font color='" + colorcode + "'>" + entity.getOwner().getName() + "</font></B>"); } }

Target:
public void addDesc(Entity entity) { if (entity != null) { if ((indentation <= Report.DEFAULT_INDENTATION) || showImage) { imageCode = "<span id='" + entity.getId() + "'></span>"; } add("<font color='0xffffff'><a href=\"#entity:" + entity.getId() + "\">" + entity.getShortName() + "</a></font>", true); String colorcode = Integer.toHexString(PlayerColors.getColor( entity.getOwner().getColorIndex()).getRGB() & 0x00f0f0f0); add("<B><font color='" + colorcode + "'>" + entity.getOwner().getName() + "</font></B>"); } }
Source:
public boolean equals(Object obj) { if ((obj != null) && (obj instanceof ClusterFeature)) { ClusterFeature clusterFeature = (ClusterFeature) obj; if (ObjectUtils.objectsEqual(getVdsGroupId(), clusterFeature.getVdsGroupId()) && enabled == clusterFeature.isEnabled() && (ObjectUtils.objectsEqual(getFeature(), clusterFeature.getFeature()))) { return true; } } return false; }

Target:
public boolean equals(Object obj) { if ((obj != null) && (obj instanceof ClusterFeature)) { ClusterFeature clusterFeature = (ClusterFeature) obj; if (Objects.equals(getFeatureId(), clusterFeature.getFeatureId()) && Objects.equals(getFeature(), clusterFeature.getFeature()) && Objects.equals(getVersion(), clusterFeature.getVersion()) && Objects.equals(getDescription(), clusterFeature.getDescription()) && Objects.equals(getApplicationMode(), clusterFeature.getApplicationMode()) && enabled == clusterFeature.isEnabled() && Objects.equals(getClusterId(), clusterFeature.getClusterId())) { return true; } } return false; }
Source:
public void processElement(ProcessContext c) throws Exception { final BoundedSource<T> source = c.element(); List<? extends BoundedSource<T>> splitSources = source.splitIntoBundles( DESIRED_SHARD_SIZE, c.getPipelineOptions() ); totalShardCount.addValue((long) splitSources.size()); LOG.info("Split into shards", splitSources.size()); final List<ExportShard<T>> shards = new ArrayList<>(splitSources.size()); int i = 0; for (BoundedSource<T> splitSource : splitSources) { final String filename = IOChannelUtils.constructName( "part", ShardNameTemplate.INDEX_OF_MAX, "", ++i, splitSources.size() ); shards.add(new ExportShard<>(splitSource, filename)); } Collections.shuffle(shards); i = 0; for (ExportShard<T> shard : shards) { c.output(KV.of(i++, shard)); } }

Target:
public void processElement(ProcessContext c) throws Exception { final BoundedSource<T> source = c.element(); List<? extends BoundedSource<T>> splitSources = source.splitIntoBundles( DESIRED_SHARD_SIZE, c.getPipelineOptions() ); totalShardCount.addValue((long) splitSources.size()); LOG.info("Split into shards", splitSources.size()); final List<ExportShard<T>> shards = new ArrayList<>(splitSources.size()); int i = 0; for (BoundedSource<T> splitSource : splitSources) { final String filename = IOChannelUtils.constructName( "part", ShardNameTemplate.INDEX_OF_MAX, "", i++, splitSources.size() ); shards.add(new ExportShard<>(splitSource, filename)); } Collections.shuffle(shards); i = 0; for (ExportShard<T> shard : shards) { c.output(KV.of(i++, shard)); } }
Source:
public void updateTableConfig(TableConfig tableConfig) throws IOException { TenantConfig tenantConfig = tableConfig.getTenantConfig(); String brokerTag = tenantConfig.getBroker(); String serverTag = tenantConfig.getServer(); if (brokerTag == null || serverTag == null) { if (!_isSingleTenantCluster) { throw new InvalidTableConfigException("server and broker tenants must be specified for multi-tenant cluster"); } } validateTableTenantConfig(tableConfig); setExistingTableConfig(tableConfig); }

Target:
public void updateTableConfig(TableConfig tableConfig) throws IOException { validateTableTenantConfig(tableConfig); setExistingTableConfig(tableConfig); }
Source:
public Set<Material> getBreedingFoods() { return EnumSet.noneOf(Material.class); }

Target:
public Set<Material> getBreedingFoods() { return DEFAULT_BREEDING_FOODS; }
Source:
public void selectAndReveal(ITimeGraphEntry entry) { fTimeGraphCtrl.expandEntry(entry.getParent()); setSelection(entry); adjustVerticalScrollBar(); }

Target:
public void selectAndReveal(ITimeGraphEntry entry) { fTimeGraphCtrl.expand(entry.getParent()); setSelection(entry); adjustVerticalScrollBar(); }
Source:
public final Object closeFile(final SFileDescriptor file) { file.closeFile(); return Nil.nilObject; }

Target:
public final Object closeFile(final SFileDescriptor file) { file.closeFile(); return file; }
Source:
public void clear() { pos = 0; if (this.buf == null) { return; } this.buf.clear(); }

Target:
public void clear() { resetPosition(); if (fBuffer == null) { return; } fBuffer.clear(); }
Source:
public void testSingleExecutionHookViaRegisterMethod() { RxJavaPlugins p = new RxJavaPlugins(); p.registerSingleExecutionHook(new RxJavaSingleExecutionHookTestImpl()); RxJavaSingleExecutionHook impl = p.getSingleExecutionHook(); assertTrue(impl instanceof RxJavaSingleExecutionHookTestImpl); }

Target:
public void testSingleExecutionHookViaRegisterMethod() { RxJavaPlugins p = new RxJavaPlugins(); RxJavaSingleExecutionHook customHook = mock(RxJavaSingleExecutionHook.class); p.registerSingleExecutionHook(customHook); RxJavaSingleExecutionHook impl = p.getSingleExecutionHook(); assertSame(impl, customHook); }
Source:
public static ICalBean parse(Reader r, String characterSet) { try (UnfoldingReader reader = new UnfoldingReader(r, characterSet)) { ICalBean cal = new ICalBean(); Property property = reader.readProperty(); if (!property.equals(ICalProperties.BEGIN_ICALENDAR)) { return null; } cal.addProperty(property); while ((property = reader.readProperty()) != null) { cal.addProperty(property); } return cal; } catch (Exception e) { throw new ProcessingException("invalid ical format", e); } }

Target:
public static ICalBean parse(Reader r, String characterSet) { return BEANS.get(ICalVCardHelper.class).parse(r, characterSet, BEANS.get(ICalBean.class)); }
Source:
private C getConf(final C conf) { conf.setUseMock(useMock); conf.set("sc.useMongo", "true"); if (user != null) { conf.setMongoUser(user); } if (pass != null) { conf.setMongoPassword(pass); } conf.setMongoDBName(mongoDBName); conf.setRyaInstanceName(mongoDBName); conf.setMongoHostname(host); conf.setMongoPort(port); conf.setUseAggregationPipeline(usePipeline); return conf; }

Target:
private C getConf(final C conf) { conf.setUseMock(useMock); conf.set("sc.useMongo", "true"); if (user != null) { conf.setMongoUser(user); } if (pass != null) { conf.setMongoPassword(pass); } conf.setRyaInstanceName(mongoDBName); conf.setMongoHostname(host); conf.setMongoPort(port); conf.setUseAggregationPipeline(usePipeline); return conf; }
Source:
public Object execute(final ExecutionEvent event) throws ExecutionException { final Repository repository = getRepository(true, event); if (repository == null) { return null; } boolean useStagingView = Activator.getDefault().getPreferenceStore() .getBoolean(UIPreferences.ALWAYS_USE_STAGING_VIEW); if (useStagingView) { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { try { StagingView view = (StagingView) PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getActivePage() .showView(StagingView.VIEW_ID); view.setFocus(); } catch (PartInitException e) { Activator.logError(e.getMessage(), e); } } }); } else { final Shell shell = getShell(event); IResource[] resourcesInScope; try { IResource[] selectedResources = getSelectedResources(event); if (selectedResources.length > 0) { IWorkbenchPart part = getPart(event); resourcesInScope = GitScopeUtil.getRelatedChanges(part, selectedResources); } else resourcesInScope = new IResource[0]; } catch (InterruptedException e) { return null; } CommitUI commitUi = new CommitUI(shell, repository, resourcesInScope, false); commitUi.commit(); } return null; }

Target:
public Object execute(final ExecutionEvent event) throws ExecutionException { final Repository repository = getRepository(true, event); if (repository == null) { return null; } boolean useStagingView = Activator.getDefault().getPreferenceStore() .getBoolean(UIPreferences.ALWAYS_USE_STAGING_VIEW); if (useStagingView) { PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { @Override public void run() { try { StagingView view = (StagingView) PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getActivePage() .showView(StagingView.VIEW_ID); view.setFocus(); } catch (PartInitException e) { Activator.logError(e.getMessage(), e); } } }); } else { final Shell shell = getShell(event); IResource[] resourcesInScope; try { IResource[] selectedResources = getSelectedResources(event); if (selectedResources.length > 0) { IWorkbenchPart part = getPart(event); resourcesInScope = GitScopeUtil.getRelatedChanges(part, selectedResources); } else resourcesInScope = new IResource[0]; } catch (InterruptedException e) { return null; } CommitUI commitUi = new CommitUI(shell, repository, resourcesInScope, false); commitUi.commit(); } return null; }
Source:
public static long parseParamDate(final String diff) throws java.text.ParseException { String secs = "00"; String mins = "00"; String hours = "00"; String date = "01"; String month = "01"; String year = "0000"; final String[] units = diff.split("[.]"); for (final String unit : units) { if (unit.matches("[YMDhms][0-9]+")) { final char unitdesc = unit.charAt(0); switch (unitdesc) { case 's': secs = unit.replace("s", "00"); secs = secs.substring(secs.length()-2, secs.length()); break; case 'm': mins = unit.replace("m", "00"); mins = mins.substring(mins.length()-2, mins.length()); break; case 'h': hours = unit.replace("h", "0"); hours = hours.substring(hours.length()-2, hours.length()); break; case 'D': date = unit.replace("D", "00"); date = date.substring(date.length()-2, date.length()); break; case 'M': month = unit.replace("M", "00"); month = month.substring(month.length()-2, month.length()); break; case 'Y': year = unit.replace("Y", "0000"); year = year.substring(year.length()-4, year.length()); break; } } } final StringBuilder dateString = new StringBuilder(year) .append("-") .append(month) .append("-") .append(date) .append("T") .append(hours) .append(":") .append(mins) .append(":") .append(secs) .append(".000Z"); return Constants.DATE_FORMAT.parse(dateString.toString()).getTime(); }

Target:
public static Date parseParamDate(final String diff) throws java.text.ParseException { final String dateString = "0000-01-01T00:00:00.000UTC"; final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZZZ"); final char[] dateChars = dateString.toCharArray(); String timeZone = "UTC"; final String[] units = diff.split("[.]"); for (final String unit : units) { if (unit.matches("[YMDhms][0-9]+") || unit.matches("[Z]...")) { final char unitdesc = unit.charAt(0); switch (unitdesc) { case 's': updateDateArray(dateChars, unit.replace("s", "00"), 19, 2); break; case 'm': updateDateArray(dateChars, unit.replace("m", "00"), 16, 2); break; case 'h': updateDateArray(dateChars, unit.replace("h", "00"), 13, 2); break; case 'D': updateDateArray(dateChars, unit.replace("D", "00"), 10, 2); break; case 'M': updateDateArray(dateChars, unit.replace("M", "00"), 7, 2); break; case 'Y': updateDateArray(dateChars, unit.replace("Y", "0000"), 4, 4); break; case 'Z': updateDateArray(dateChars, unit.replace("Z", ""), 26, 3); timeZone = unit.replace("Z", ""); break; } } else { throw new ParseException("Cannot process date token: '" + unit + "'", diff.indexOf(unit)); } } dateFormat.setTimeZone(TimeZone.getTimeZone(timeZone)); return dateFormat.parse(new String(dateChars)); }
Source:
public void testJFaceWizardButtons() { Assume.assumeTrue("UI Harness is requires for that test", Display.getCurrent() != null); final WizardDialog dialog = new WizardDialog(shell, new Wizard() { @Override public void addPages() { addPage(new WizardPage("Page 1") { public void createControl(Composite parent) { setControl(new Label(parent, SWT.NONE)); } }); addPage(new WizardPage("Page 2") { public void createControl(Composite parent) { setControl(new Label(parent, SWT.NONE)); } }); } @Override public boolean performFinish() { return true; } }); dialog.setBlockOnOpen(false); UIThreadRunnable.syncExec(new VoidResult() { @Override public void run() { dialog.open(); } }); Shell shell = dialog.getShell(); SWTBotButton nextButton = bot.buttonWithId(null, Integer.valueOf(IDialogConstants.NEXT_ID)); nextButton.click(); Assert.assertEquals("Page 2", dialog.getCurrentPage().getName()); SWTBotButton finishButton = bot.buttonWithId(null, Integer.valueOf(IDialogConstants.FINISH_ID)); finishButton.click(); Assert.assertTrue(shell.isDisposed()); Assert.assertNull(dialog.getShell()); }

Target:
public void testJFaceWizardButtons() { Assume.assumeTrue("UI Harness is requires for that test", Display.getCurrent() != null); final WizardDialog dialog = new WizardDialog(shell, new Wizard() { @Override public void addPages() { addPage(new WizardPage("Page 1") { @Override public void createControl(Composite parent) { setControl(new Label(parent, SWT.NONE)); } }); addPage(new WizardPage("Page 2") { @Override public void createControl(Composite parent) { setControl(new Label(parent, SWT.NONE)); } }); } @Override public boolean performFinish() { return true; } }); dialog.setBlockOnOpen(false); UIThreadRunnable.syncExec(new VoidResult() { @Override public void run() { dialog.open(); } }); Shell shell = dialog.getShell(); SWTBotButton nextButton = bot.buttonWithId(null, Integer.valueOf(IDialogConstants.NEXT_ID)); nextButton.click(); Assert.assertEquals("Page 2", dialog.getCurrentPage().getName()); SWTBotButton finishButton = bot.buttonWithId(null, Integer.valueOf(IDialogConstants.FINISH_ID)); finishButton.click(); Assert.assertTrue(shell.isDisposed()); Assert.assertNull(dialog.getShell()); }
Source:
protected void initializeReadMany( IDocumentQueryClient queryClient, String collectionResourceId, SqlQuerySpec sqlQuerySpec, Map<PartitionKeyRange, SqlQuerySpec> rangeQueryMap, FeedOptions feedOptions, UUID activityId, String collectionRid) { Map<String, String> commonRequestHeaders = createCommonHeadersAsync(this.getFeedOptions(null, null)); for (Map.Entry<PartitionKeyRange, SqlQuerySpec> entry : rangeQueryMap.entrySet()) { final PartitionKeyRange targetRange = entry.getKey(); final SqlQuerySpec query = entry.getValue(); TriFunction<PartitionKeyRange, String, Integer, RxDocumentServiceRequest> createRequestFunc = ( partitionKeyRange, continuationToken, pageSize) -> { Map<String, String> headers = new HashMap<>(commonRequestHeaders); headers.put(HttpConstants.HttpHeaders.CONTINUATION, continuationToken); headers.put(HttpConstants.HttpHeaders.PAGE_SIZE, Strings.toString(pageSize)); return this.createDocumentServiceRequest(headers, query, null, partitionKeyRange, collectionRid); }; Function<RxDocumentServiceRequest, Mono<FeedResponse<T>>> executeFunc = (request) -> { return this.executeRequestAsync(request); }; DocumentProducer<T> dp = createDocumentProducer(collectionRid, targetRange, null, -1, feedOptions, query, commonRequestHeaders, createRequestFunc, executeFunc, () -> client.getResetSessionTokenRetryPolicy() .getRequestPolicy()); documentProducers.add(dp); } }

Target:
protected void initializeReadMany( IDocumentQueryClient queryClient, String collectionResourceId, SqlQuerySpec sqlQuerySpec, Map<PartitionKeyRange, SqlQuerySpec> rangeQueryMap, FeedOptions feedOptions, UUID activityId, String collectionRid) { Map<String, String> commonRequestHeaders = createCommonHeadersAsync(this.getFeedOptions(null, null)); for (Map.Entry<PartitionKeyRange, SqlQuerySpec> entry : rangeQueryMap.entrySet()) { final PartitionKeyRange targetRange = entry.getKey(); final SqlQuerySpec querySpec = entry.getValue(); TriFunction<PartitionKeyRange, String, Integer, RxDocumentServiceRequest> createRequestFunc = ( partitionKeyRange, continuationToken, pageSize) -> { Map<String, String> headers = new HashMap<>(commonRequestHeaders); headers.put(HttpConstants.HttpHeaders.CONTINUATION, continuationToken); headers.put(HttpConstants.HttpHeaders.PAGE_SIZE, Strings.toString(pageSize)); return this.createDocumentServiceRequest(headers, querySpec, null, partitionKeyRange, collectionRid); }; Function<RxDocumentServiceRequest, Mono<FeedResponse<T>>> executeFunc = (request) -> { return this.executeRequestAsync(request); }; DocumentProducer<T> dp = createDocumentProducer(collectionRid, targetRange, null, -1, feedOptions, querySpec, commonRequestHeaders, createRequestFunc, executeFunc, () -> client.getResetSessionTokenRetryPolicy() .getRequestPolicy()); documentProducers.add(dp); } }
Source:
public static BooleanStatus create() { BooleanStatus b = new BooleanStatus(false); AutoLoader a = new AutoLoader(); a.setShouldBeRunning(b); a.updateWhen(Igneous.globalPeriodic); Elevator.raising.setFalseWhen(BooleanMixing.onRelease(b)); return b; }

Target:
public static BooleanStatus create() { BooleanStatus b = new BooleanStatus(false); AutoLoader a = new AutoLoader(); a.setShouldBeRunning(b); a.updateWhen(Igneous.globalPeriodic); Elevator.raising.setFalseWhen(BooleanMixing.onRelease(b)); Elevator.lowering.setTrueWhen(BooleanMixing.onRelease(b)); return b; }
Source:
public static void main(String[] args) { JCommanderTwitterStream jcts = new JCommanderTwitterStream(); new JCommander(jcts, args); if (jcts.isHelp()) { JCommander jc = new JCommander(jcts, args); jc.usage(); return; } String[] keywords; if (jcts.getKeywords().size() > 0) { keywords = jcts.getKeywords().toArray(new String[jcts.getKeywords().size()]); } else { keywords = new String[1]; keywords[0] = ""; } String stringKeywords = String.join(" ", keywords); if (jcts.isStream()) { if (jcts.getLimit() < Integer.MAX_VALUE) { System.err.println("You can't have stream with limit."); System.exit(-1); } streamTweets(stringKeywords, jcts.getLocation(), jcts.isHideRetweets()); } else { printTweets(stringKeywords, jcts.getLocation(), jcts.getLimit(), jcts.isHideRetweets()); } return; }

Target:
public static void main(String[] args) { JCommanderTwitterStream jcts = new JCommanderTwitterStream(); new JCommander(jcts, args); if (jcts.isHelp()) { JCommander jc = new JCommander(jcts, args); jc.usage(); return; } String stringKeywords = jcts.getKeywords().stream().collect(joining(" ")); if (jcts.isStream()) { try { if (jcts.getLimit() < Integer.MAX_VALUE) { throw new ParameterException("You can't have stream with limit."); } streamTweets(stringKeywords, jcts.getLocation(), jcts.isHideRetweets()); } catch (URLs.ConnectionException | URLs.HTTPQueryException | MalformedURLException | ParameterException | GeolocationSearch.NoKeyException | GeolocationSearch.SearchLocationException e) { System.err.println(e.getMessage()); System.exit(1); } } else { try { printTweets(stringKeywords, jcts.getLocation(), jcts.getLimit(), jcts.isHideRetweets()); } catch (TwitterException | URLs.ConnectionException | GeolocationSearch.SearchLocationException | MalformedURLException | GeolocationSearch.NoKeyException | URLs.HTTPQueryException e) { System.err.println(e.getMessage()); System.exit(1); } } }
Source:
public String toString() { return "FittingOrgWordsMatchVoter [charsToFilter=" + charsToFilter + ", minFittingOrgWordsRatio=" + minFittingOrgWordsRatio + ", minFittingWordSimilarity=" + minFittingWordSimilarity + ", wordToRemoveMaxLength=" + wordToRemoveMaxLength + "]"; }

Target:
public String toString() { return Objects.toStringHelper(this).add("matchStength", getMatchStrength()) .add("charsToFilter", charsToFilter) .add("minFittingOrgWordsRatio", minFittingOrgWordsRatio) .add("minFittingOrgWordSimilarity", minFittingWordSimilarity) .add("wordToRemoveMaxLength", wordToRemoveMaxLength) .toString(); }
Source:
default boolean isAppRunning(String apk) { AndroidService androidService = AndroidService.getInstance(); String res = androidService.getCurrentDeviceFocus(); if (res.contains(apk)) { LOGGER.info("Actual device focus is as expected and contains package or activity: '" + apk + "'."); return true; } else { LOGGER.error("Not expected apk '" + apk + "' is in focus. Actual result is: " + res); return false; } }

Target:
default boolean isAppRunning(String apk) { String res = getCurrentDeviceFocus(); if (res.contains(apk)) { LOGGER.info("Actual device focus is as expected and contains package or activity: '" + apk + "'."); return true; } else { LOGGER.error("Not expected apk '" + apk + "' is in focus. Actual result is: " + res); return false; } }
Source:
protected void onLoad() throws IOException, ConfigInvalidException { Map<String, GroupReference> groupsByName = readGroupList(); rulesId = getObjectId("rules.pl"); Config rc = readConfig(PROJECT_CONFIG); project = new Project(projectName); Project p = project; p.setDescription(rc.getString(PROJECT, null, KEY_DESCRIPTION)); if (p.getDescription() == null) { p.setDescription(""); } p.setParentName(rc.getString(ACCESS, null, KEY_INHERIT_FROM)); p.setUseContributorAgreements(getEnum(rc, RECEIVE, null, KEY_REQUIRE_CONTRIBUTOR_AGREEMENT, Project.InheritableBoolean.INHERIT)); p.setUseSignedOffBy(getEnum(rc, RECEIVE, null, KEY_REQUIRE_SIGNED_OFF_BY, Project.InheritableBoolean.INHERIT)); p.setRequireChangeID(getEnum(rc, RECEIVE, null, KEY_REQUIRE_CHANGE_ID, Project.InheritableBoolean.INHERIT)); p.setMaxObjectSizeLimit(rc.getString(RECEIVE, null, KEY_MAX_OBJECT_SIZE_LIMIT)); p.setSubmitType(getEnum(rc, SUBMIT, null, KEY_ACTION, defaultSubmitAction)); p.setUseContentMerge(getEnum(rc, SUBMIT, null, KEY_MERGE_CONTENT, Project.InheritableBoolean.INHERIT)); p.setState(getEnum(rc, PROJECT, null, KEY_STATE, defaultStateValue)); p.setDefaultDashboard(rc.getString(DASHBOARD, null, KEY_DEFAULT)); p.setLocalDefaultDashboard(rc.getString(DASHBOARD, null, KEY_LOCAL_DEFAULT)); loadAccountsSection(rc, groupsByName); loadContributorAgreements(rc, groupsByName); loadAccessSections(rc, groupsByName); loadNotifySections(rc, groupsByName); loadLabelSections(rc); loadCommentLinkSections(rc); loadPluginSections(rc); loadGitChecks(rc); maxObjectSizeLimit = rc.getLong(RECEIVE, null, KEY_MAX_OBJECT_SIZE_LIMIT, 0); }

Target:
protected void onLoad() throws IOException, ConfigInvalidException { Map<String, GroupReference> groupsByName = readGroupList(); rulesId = getObjectId("rules.pl"); Config rc = readConfig(PROJECT_CONFIG); project = new Project(projectName); Project p = project; p.setDescription(rc.getString(PROJECT, null, KEY_DESCRIPTION)); if (p.getDescription() == null) { p.setDescription(""); } p.setParentName(rc.getString(ACCESS, null, KEY_INHERIT_FROM)); p.setUseContributorAgreements(getEnum(rc, RECEIVE, null, KEY_REQUIRE_CONTRIBUTOR_AGREEMENT, Project.InheritableBoolean.INHERIT)); p.setUseSignedOffBy(getEnum(rc, RECEIVE, null, KEY_REQUIRE_SIGNED_OFF_BY, Project.InheritableBoolean.INHERIT)); p.setRequireChangeID(getEnum(rc, RECEIVE, null, KEY_REQUIRE_CHANGE_ID, Project.InheritableBoolean.INHERIT)); p.setMaxObjectSizeLimit(rc.getString(RECEIVE, null, KEY_MAX_OBJECT_SIZE_LIMIT)); p.setSubmitType(getEnum(rc, SUBMIT, null, KEY_ACTION, defaultSubmitAction)); p.setUseContentMerge(getEnum(rc, SUBMIT, null, KEY_MERGE_CONTENT, Project.InheritableBoolean.INHERIT)); p.setState(getEnum(rc, PROJECT, null, KEY_STATE, defaultStateValue)); p.setDefaultDashboard(rc.getString(DASHBOARD, null, KEY_DEFAULT)); p.setLocalDefaultDashboard(rc.getString(DASHBOARD, null, KEY_LOCAL_DEFAULT)); loadAccountsSection(rc, groupsByName); loadContributorAgreements(rc, groupsByName); loadAccessSections(rc, groupsByName); loadNotifySections(rc, groupsByName); loadLabelSections(rc); loadCommentLinkSections(rc); loadPluginSections(rc); loadReceiveSection(rc); }
Source:
public Status deserialize(JsonNode rootNode, Configuration configuration) { String status = rootNode.asText(); if (UNKNOWN_STATUSES.contains(status)) { return Status.UNDEFINED; } else { return Status.valueOf(status.toUpperCase(Locale.US)); } }

Target:
public Status deserialize(JsonNode rootNode, Configuration configuration) { Locale.setDefault(Locale.US); String status = rootNode.asText(); if (UNKNOWN_STATUSES.contains(status)) { return Status.UNDEFINED; } else { return Status.valueOf(status.toUpperCase()); } }
Source:
private Resource.ResourceType getResourceTypeEnum() { Resource.ResourceType resourceTypeResult = null; if (resourceTypeName != null) { try { resourceTypeResult = Resource.ResourceType.valueOf(resourceTypeName); } catch (IllegalArgumentException e) { throw new InvalidParameterValueException("Please specify a valid resource type name."); } } else if (resourceType != null) { try { resourceTypeResult = Resource.ResourceType.values()[resourceType]; } catch (ArrayIndexOutOfBoundsException e) { throw new InvalidParameterValueException("Please specify a valid resource type."); } } return resourceTypeResult; }

Target:
private Resource.ResourceType getResourceTypeEnum() { Resource.ResourceType resourceTypeResult = null; if (resourceTypeName != null) { try { resourceTypeResult = Resource.ResourceType.valueOf(resourceTypeName); } catch (IllegalArgumentException e) { throw new InvalidParameterValueException("Please specify a valid resource type name."); } } else if (resourceType != null) { resourceTypeResult = Resource.ResourceType.fromOrdinal(resourceType); if (resourceTypeResult == null) { throw new InvalidParameterValueException("Please specify a valid resource type."); } } return resourceTypeResult; }
Source:
public void testRequirementVersionMatcherOnPreciseMatch() { RequirementMatcher matcher = new RequirementMatcher(SimpleReq.class, "ersion", new VersionMatcher("1.1")); assertTrue("Version attribute should be matched to version matcher with value 1.1", matcher.matches(simpleConfig)); }

Target:
public void testRequirementVersionMatcherOnPreciseMatch() { RequirementMatcher matcher = new RequirementMatcher(SimpleReq.class, "version", new VersionMatcher("1.1")); assertTrue("Version attribute should be matched to version matcher with value 1.1", matcher.matches(simpleConfig)); }
Source:
public void testCreateDynamicGraphAllIndependent() { DynamicGraph<ITestNGMethod> graph = newGraph(IndependentTestClassSample.class); assertThat(graph.getFreeNodes()).hasSize(2); assertThat(graph.getEdges().isEmpty()); }

Target:
public void testCreateDynamicGraphAllIndependent() { DynamicGraph<ITestNGMethod> graph = newGraph(IndependentTestClassSample.class); assertThat(graph.getFreeNodes()).hasSize(2); assertThat(graph.getEdges()).isEmpty(); }
Source:
private boolean notNullSeqContainsOnlyWhitespaces(CharSequence actual) { for (int i = 0; i < actual.length(); i++) { if (!Character.isWhitespace(actual.charAt(i))) return false; } return true; }

Target:
private boolean notNullSeqContainsOnlyWhitespaces(CharSequence actual) { for (int i = 0; i < actual.length(); i++) { if (!isWhitespace(actual.charAt(i))) return false; } return true; }
Source:
private void setupMyId() throws IOException { File myIdFile = new File(dataDir, "myid"); if (!myIdFile.isFile()) { return; } BufferedReader br = new BufferedReader(new FileReader(myIdFile)); String myIdString; try { myIdString = br.readLine(); } finally { br.close(); } try { serverId = Long.parseLong(myIdString); MDC.put("myid", myIdString); } catch (NumberFormatException e) { throw new IllegalArgumentException("serverid " + myIdString + " is not a number"); } if (serverId < 1 || serverId > 255) { throw new IllegalArgumentException("myid must have a value between 1 and 255."); } }

Target:
private void setupMyId() throws IOException { File myIdFile = new File(dataDir, "myid"); if (!myIdFile.isFile()) { return; } BufferedReader br = new BufferedReader(new FileReader(myIdFile)); String myIdString; try { myIdString = br.readLine(); } finally { br.close(); } try { serverId = Long.parseLong(myIdString); MDC.put("myid", myIdString); } catch (NumberFormatException e) { throw new IllegalArgumentException("serverid " + myIdString + " is not a number"); } validateMyid(serverId); }
Source:
public static String encodeBase64String(byte[] binaryData) { if(binaryData == null){ return null; } return com.google.common.io.BaseEncoding.base64().encode(binaryData); }

Target:
public static String encodeBase64String(byte[] binaryData) { if (binaryData == null) { return null; } return BaseEncoding.base64().encode(binaryData); }
Source:
Set<String> getValidHosts() { return AAD_WHITELIST_HOSTS; }

Target:
Set<String> getValidHosts() { return AAD_WHITELISTED_HOSTS; }
Source:
public final Integer read() { int length = 1; final boolean lenCodingBit = false; try { while (coreBlockInputStream.readBit() == lenCodingBit) { length++; } final int readBits = coreBlockInputStream.readBits(length - 1); final int value = readBits | 1 << (length - 1); return value - offset; } catch (IOException e) { throw new RuntimeException(e); } }

Target:
public final Integer read() { int length = 1; final boolean lenCodingBit = false; try { while (coreBlockInputStream.readBit() == lenCodingBit) { length++; } final int readBits = coreBlockInputStream.readBits(length - 1); final int value = readBits | 1 << (length - 1); return value - offset; } catch (IOException e) { throw new RuntimeIOException(e); } }
Source:
public void testRegisterLoadBalancerWithIP() { LoadBalancer loadBalancer = new LoadBalancer(); loadBalancer.setType(LoadBalancerType.PUBLIC); loadBalancer.setIp(LB_IP); loadBalancer.setEndpoint(LB_ENDPOINT); when(loadBalancerPersistenceService.findByStackId(any())).thenReturn(Set.of(loadBalancer)); ThreadBasedUserCrnProvider.doAs(TEST_USER_CRN, () -> underTest.registerLoadBalancerDomainWithFreeIPA(stack)); verify(dnsV1Endpoint, times(1)).addDnsARecord(any()); }

Target:
public void testRegisterLoadBalancerWithIP() { LoadBalancer loadBalancer = new LoadBalancer(); loadBalancer.setType(LoadBalancerType.PUBLIC); loadBalancer.setIp(LB_IP); loadBalancer.setEndpoint(LB_ENDPOINT); when(loadBalancerPersistenceService.findByStackId(any())).thenReturn(Set.of(loadBalancer)); when(loadBalancerConfigService.selectLoadBalancer(any(), any())).thenReturn(Optional.of(loadBalancer)); ThreadBasedUserCrnProvider.doAs(TEST_USER_CRN, () -> underTest.registerLoadBalancerDomainWithFreeIPA(stack)); verify(dnsV1Endpoint, times(1)).addDnsARecord(any()); }
Source:
public void cancelPendingRequests(Client client) { if (client.usesQueueMode()) { queuedRequestSender.cancelPendingRequests(client); } else { defaultRequestSender.cancelPendingRequests(client); } }

Target:
public void cancelPendingRequests(Client client) { defaultRequestSender.cancelPendingRequests(client); queuedRequestSender.cancelPendingRequests(client); }
Source:
public IResource[] getSupplementaryResources() { IFolder supplFolder = getTraceSupplementaryFolder(getResourceName()); if (supplFolder.exists()) { try { return supplFolder.members(); } catch (CoreException e) { Activator.getDefault().logError("Error deleting supplementary folder " + supplFolder, e); } } return new IResource[0]; }

Target:
public IResource[] getSupplementaryResources() { IFolder supplFolder = getTraceSupplementaryFolder(getResourceName()); if (supplFolder.exists()) { try { return supplFolder.members(); } catch (CoreException e) { Activator.getDefault().logError(Messages.TmfCommonProjectElement_ErrorDeletingSF + supplFolder, e); } } return new IResource[0]; }
Source:
static String gatherRevision(ExecutionEvent event) throws IOException { final GitFlowRepository gfRepo = GitFlowHandlerUtil .getRepository(event); Ref exactRef = gfRepo.getRepository() .exactRef(gfRepo.getConfig().getDevelopFull()); if (exactRef == null) { throw new IllegalStateException( "Gitflow command called on non-Gitflow repository"); } return exactRef.getName(); }

Target:
static String gatherRevision(ExecutionEvent event) throws IOException { final GitFlowRepository gfRepo = GitFlowHandlerUtil .getRepository(event); Ref develop = gfRepo.getRepository() .exactRef(gfRepo.getConfig().getDevelopFull()); if (develop == null) { throw new IllegalStateException( "Gitflow command called on non-Gitflow repository"); } return develop.getName(); }
Source:
public LocalReplayInfo parseMetaData(Path replayFile) { logger.debug("Parsing metadata of replay file: {}", replayFile); Optional<String> metadata = Files.lines(replayFile).findFirst(); if (metadata.isPresent()) { return gson.fromJson(metadata.get(), LocalReplayInfo.class); } throw new IOException(String.format("Failed to extract metadata from replay file: {}", replayFile)); }

Target:
public LocalReplayInfo parseMetaData(Path replayFile) { logger.debug("Parsing metadata of replay file: {}", replayFile); try (Stream<String> stream = Files.lines(replayFile)) { return stream .findFirst() .map(jsonString -> gson.fromJson(jsonString, LocalReplayInfo.class)) .orElseThrow(() -> new IOException(String.format("Failed to extract metadata from replay file: {}", replayFile))); } }
Source:
public SpecificSegmentsSpec(@JsonProperty("segments") List<String> segments) { this.segments = segments; }

Target:
public SpecificSegmentsSpec(@JsonProperty("segments") List<String> segments) { this.segments = segments; Collections.sort(this.segments); }
Source:
private static String[] explode(String pattern) { if (pattern == null) { return new String[]{}; } return pattern.split(","); }

Target:
private static String[] explode(String pattern) { if (pattern == null) { return EMPTY_PATHS; } return pattern.split(","); }
Source:
@Override public <T> TypeAdapter<T> create(final Gson gson, TypeToken<T> type) { if (type.getRawType() != Device.class || recursiveCall.get() != null) { recursiveCall.set(null); return null; } recursiveCall.set(Boolean.TRUE); final TypeAdapter<Device> delegate = (TypeAdapter) gson.getDelegateAdapter(this, type); return (TypeAdapter) new TypeAdapter<Device>() { @Override public void write(JsonWriter out, Device value) throws IOException { delegate.write(out, value); } @Override public Device read(JsonReader in) throws IOException { String json = in.nextString(); JsonParser parser = new JsonParser(); JsonElement root = parseString(parser, json, null); return root == null ? null : delegate.fromJsonTree(root); } private JsonElement parseString(JsonParser parser, String json, String prevJson) throws IOException { if (json == null || json.trim().isEmpty()) { return null; } JsonElement root = parser.parse(json); if (root instanceof JsonPrimitive) { prevJson = json; json = root.getAsString(); if (Objects.equals(json, prevJson)) { throw new JsonSyntaxException("Unexpected Json: " + json); } return parseString(parser, json, prevJson); } return root; } }; }

Target:
@Override public <T> TypeAdapter<T> create(final Gson gson, TypeToken<T> type) { if (type.getRawType() != Device.class || recursiveCall.get() != null) { recursiveCall.set(null); return null; } recursiveCall.set(Boolean.TRUE); return (TypeAdapter) gson.getDelegateAdapter(this, type); }
Source:
public HttpConnection setRequestBody(final String input) { this.input = new InputStreamGenerator() { @Override public InputStream getInputStream() { return new ByteArrayInputStream(input.getBytes()); } }; this.inputLength = input.getBytes().length; return this; }

Target:
public HttpConnection setRequestBody(final String input) { try { final byte[] bytes = input.getBytes("UTF-8"); this.inputLength = bytes.length; this.input = new InputStreamGenerator() { @Override public InputStream getInputStream() { return new ByteArrayInputStream(bytes); } }; } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } return this; }
Source:
public void invalidTeamDomainShouldFail() { StandardSlackService service = new StandardSlackService("", "my", false, "#general", false,"token"); service.publish("message"); }

Target:
public void invalidTeamDomainShouldFail() { StandardSlackService service = new StandardSlackService( StandardSlackService.builder() .withBaseUrl("") .withTeamDomain("my") .withBotUser(false) .withRoomId("#general") .withReplyBroadcast(false) .withPopulatedToken("token")); service.publish("message"); }
Source:
public String getUsageTips() { int defaultHttpPort = 9763; int defaultHttpsPort = 9443; int httpPort; int httpsPort; int portOffset = getPortOffset(); if (portOffset == 0) { httpPort = defaultHttpPort; httpsPort = defaultHttpsPort; } else { httpPort = defaultHttpPort + portOffset; httpsPort = defaultHttpsPort + portOffset; } return resourceBundle.getString(UIEventAdapterConstants.ADAPTER_USAGE_TIPS_PREFIX) + httpPort + resourceBundle.getString(UIEventAdapterConstants.ADAPTER_USAGE_TIPS_MID1) + httpsPort + resourceBundle.getString(UIEventAdapterConstants.ADAPTER_USAGE_TIPS_MID2) + httpPort + resourceBundle.getString(UIEventAdapterConstants.ADAPTER_USAGE_TIPS_MID3) + httpsPort + resourceBundle.getString(UIEventAdapterConstants.ADAPTER_USAGE_TIPS_POSTFIX); }

Target:
public String getUsageTips() { return resourceBundle.getString(UIEventAdapterConstants.ADAPTER_USAGE_TIPS_PREFIX) + httpPort + resourceBundle.getString(UIEventAdapterConstants.ADAPTER_USAGE_TIPS_MID1) + httpsPort + resourceBundle.getString(UIEventAdapterConstants.ADAPTER_USAGE_TIPS_MID2) + httpPort + resourceBundle.getString(UIEventAdapterConstants.ADAPTER_USAGE_TIPS_MID3) + httpsPort + resourceBundle.getString(UIEventAdapterConstants.ADAPTER_USAGE_TIPS_POSTFIX); }
Source:
public void refreshTabs() { boolean iSCurrentDiagramClosed = false; boolean isLastVistedDiagramShowed = false; INavigationHistory navigationHistory = this.getSite().getPage().getNavigationHistory(); INavigationLocation[] navigationLocations = navigationHistory.getLocations(); INavigationLocation currentLocation = navigationHistory.getCurrentLocation(); if (currentLocation != null && (currentLocation instanceof PapyrusNavigationLocation)) { URI currentPageURI = ((PapyrusNavigationLocation) currentLocation).getPageURI(); if (currentPageURI != null) { try { EObject currentDiagram = ServiceUtils.getInstance().getModelSet(((PapyrusMultiDiagramEditor) this).getServicesRegistry()).getEObject(currentPageURI, false); if (currentDiagram != null) { IPageManager pageManager = ServiceUtilsForEObject.getInstance().getIPageManager(currentDiagram); if (pageManager != null) { if (!pageManager.isOpen(currentDiagram)) { iSCurrentDiagramClosed = true; } } } } catch (ServiceException e) { Activator.log.error(e); } } } if (iSCurrentDiagramClosed && (navigationLocations.length > 2)) { isLastVistedDiagramShowed = findAndShowLastVisitedDiagram(navigationLocations, navigationLocations.length - 2); } if (!isLastVistedDiagramShowed) { super.refreshTabs(); } }

Target:
public void refreshTabs() { boolean isCurrentDiagramClosed = false; boolean isLastVisitedDiagramShowed = false; INavigationHistory navigationHistory = this.getSite().getPage().getNavigationHistory(); INavigationLocation[] navigationLocations = navigationHistory.getLocations(); INavigationLocation currentLocation = navigationHistory.getCurrentLocation(); if (currentLocation != null && (currentLocation instanceof PapyrusNavigationLocation)) { URI currentPageURI = ((PapyrusNavigationLocation) currentLocation).getPageURI(); if (currentPageURI != null) { try { EObject currentDiagram = ServiceUtils.getInstance().getModelSet(((PapyrusMultiDiagramEditor) this).getServicesRegistry()).getEObject(currentPageURI, false); if (currentDiagram != null) { IPageManager pageManager = ServiceUtilsForEObject.getInstance().getIPageManager(currentDiagram); if (pageManager != null) { if (!pageManager.isOpen(currentDiagram)) { isCurrentDiagramClosed = true; } } } } catch (ServiceException e) { Activator.log.error(e); } } } if (isCurrentDiagramClosed && (navigationLocations.length > 2)) { isLastVisitedDiagramShowed = findAndShowLastVisitedDiagram(navigationLocations, navigationLocations.length - 2); } if (!isLastVisitedDiagramShowed) { super.refreshTabs(); } }
Source:
public QueryAuditEventsResponseType retrieveAudits(QueryAuditEventsRequestType request) { QueryAuditEventsResponseType response = null; try { CONNECTClient<AuditQueryLogPortType> client = getCONNECTClient(getQueryAuditEventsPortDescriptor()); response = (QueryAuditEventsResponseType) client.invokePort(AuditQueryLogPortType.class, QUERY_AUDIT_EVENTS, request); } catch (Exception ex) { LOG.debug("Failed to call the web service " + NhincConstants.ADAPTER_AUDIT_QUERY_LOG_SERVICE_NAME + ex.getLocalizedMessage(), ex); } return response; }

Target:
public QueryAuditEventsResponseType retrieveAudits(QueryAuditEventsRequestType request) { QueryAuditEventsResponseType response = null; try { CONNECTClient<AuditQueryLogPortType> client = getCONNECTClient(getQueryAuditEventsPortDescriptor()); response = (QueryAuditEventsResponseType) client.invokePort(AuditQueryLogPortType.class, QUERY_AUDIT_EVENTS, request); } catch (Exception ex) { LOG.error("Failed to call the web service {}: {}", NhincConstants.ADAPTER_AUDIT_QUERY_LOG_SERVICE_NAME, ex.getLocalizedMessage(), ex); } return response; }