auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected View onCreateContentView(LayoutInflater inflater, ViewGroup parent) { View view = inflater.inflate(R.layout.list_fragment_content, parent, false); mEmptyViewContainer = (NestedScrollView) view.findViewById(R.id.empty_view_container); TextView emptyView = (TextView) view.findViewById(android.R.id.empty); int emptyTextResId = getEmptyTextResId(); if (emptyTextResId != 0) { emptyView.setText(emptyTextResId); } mLayoutManager = new LinearLayoutManager(view.getContext()); mRecyclerView = (RecyclerView) view.findViewById(R.id.list); mRecyclerView.setLayoutManager(mLayoutManager); onRecyclerViewInflated(mRecyclerView, inflater); if (hasDividers()) { mRecyclerView.addItemDecoration(new DividerItemDecoration(view.getContext())); } if (!hasCards()) { mRecyclerView.setBackgroundResource( UiUtils.resolveDrawable(getActivity(), R.attr.listBackground)); } mFastScroller = (RecyclerFastScroller) view.findViewById(R.id.fast_scroller); mFastScroller.attachRecyclerView(mRecyclerView); int color = UiUtils.resolveColor(view.getContext(), R.attr.colorControlNormal); <START> color = Color.argb(93, Color.red(color), Color.green(color), Color.blue(color)); <END> mFastScroller.setHandleNormalColor(color); return view; }</code><technical_language>Is a specific reason XML defined color here? I prefer that</technical_language>

Target:
protected View onCreateContentView(LayoutInflater inflater, ViewGroup parent) { View view = inflater.inflate(R.layout.list_fragment_content, parent, false); mEmptyViewContainer = (NestedScrollView) view.findViewById(R.id.empty_view_container); TextView emptyView = (TextView) view.findViewById(android.R.id.empty); int emptyTextResId = getEmptyTextResId(); if (emptyTextResId != 0) { emptyView.setText(emptyTextResId); } mLayoutManager = new LinearLayoutManager(view.getContext()); mRecyclerView = (RecyclerView) view.findViewById(R.id.list); mRecyclerView.setLayoutManager(mLayoutManager); onRecyclerViewInflated(mRecyclerView, inflater); if (hasDividers()) { mRecyclerView.addItemDecoration(new DividerItemDecoration(view.getContext())); } if (!hasCards()) { mRecyclerView.setBackgroundResource( UiUtils.resolveDrawable(getActivity(), R.attr.listBackground)); } mFastScroller = (RecyclerFastScroller) view.findViewById(R.id.fast_scroller); mFastScroller.attachRecyclerView(mRecyclerView); return view; }
Source:
<code>public List<Object> prepend(List<Object> list, Object object) { <START> final List<Object> result = Lists.newArrayList(); <END> result.add(object); result.addAll(list); return result; }</code><technical_language>Size result list properly : final List<Object> result = new ArrayList<Object>(list.size() + 1);</technical_language>

Target:
public List<Object> prepend(List<Object> list, Object object) { final List<Object> result = new ArrayList<Object>(list.size() + 1); result.add(object); result.addAll(list); return result; }
Source:
<code>public void getStartingMember() throws Exception { Member server0 = new Member(); server0.setId("server-0"); concurrency.add(() -> cluster.startServerVM(0, webContext.getLocator().getPort())); concurrency.add(() -> { ClusterManagementGetResult<Member, MemberInformation> result = null; <START> while (result == null) { <END> try { result = client.get(server0); } catch (ClusterManagementException e) { } } return result; }); concurrency.executeInParallel(); }</code><technical_language>I recommend GeodeAwaitility instead of a while-loop timeout (I realize ConcurrencyRule is ultimately providing cancellation): await() .ignoreException(ClusterManagementException.class) .until(() -> client.get(server0) != null);</technical_language>

Target:
public void getStartingMember() throws Exception { Member server0 = new Member(); server0.setId("server-0"); Future<Void> startServer = executorServiceRule.submit(() -> { cluster.startServerVM(0, webContext.getLocator().getPort()); }); await() .ignoreException(ClusterManagementException.class) .untilAsserted(() -> assertThat(client.get(server0).getStatusCode()).isEqualTo( ClusterManagementResult.StatusCode.OK)); startServer.get(getTimeout().toMillis(), MILLISECONDS); }
Source:
<code>public static String findAvailableHostAddress() throws UnknownHostException, SocketException { List<NetworkInterface> netlist = new ArrayList<NetworkInterface>(); Enumeration<?> netInterfaces = NetworkInterface.getNetworkInterfaces(); while (netInterfaces.hasMoreElements()) { NetworkInterface networkInterface = (NetworkInterface)netInterfaces.nextElement(); LOGGER.info("networkInterface = " + networkInterface.toString()); if (networkInterface.isLoopback()) { continue; } netlist.add(0, networkInterface); } for (NetworkInterface list:netlist) { Enumeration<?> enumInetAddress = list.getInetAddresses(); while (enumInetAddress.hasMoreElements()) { InetAddress ip = (InetAddress) enumInetAddress.nextElement(); LOGGER.info("ip = " + ip.toString()); if (!ip.isLoopbackAddress()) { <START> if (ip.getHostAddress().equalsIgnoreCase("127.0.0.1")){ <END> continue; } if (ip instanceof Inet6Address) { continue; } if (ip instanceof Inet4Address) { return ip.getHostAddress(); } } return ip.getLocalHost().getHostAddress(); } } LOGGER.error("Can't find available HostAddress!"); throw new UnknownHostException("Can't find available HostAddress!"); }</code><technical_language>isLoopbackAddress enough</technical_language>

Target:
public static String findAvailableHostAddress() throws UnknownHostException, SocketException { List<NetworkInterface> netlist = new ArrayList<NetworkInterface>(); Enumeration<?> netInterfaces = NetworkInterface.getNetworkInterfaces(); while (netInterfaces.hasMoreElements()) { NetworkInterface networkInterface = (NetworkInterface)netInterfaces.nextElement(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("networkInterface = " + networkInterface.toString()); } if (networkInterface.isLoopback()) { continue; } netlist.add(0, networkInterface); } for (NetworkInterface list:netlist) { Enumeration<?> enumInetAddress = list.getInetAddresses(); while (enumInetAddress.hasMoreElements()) { InetAddress ip = (InetAddress) enumInetAddress.nextElement(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("ip = " + ip.toString()); } if (!ip.isLoopbackAddress() && !ip.isLinkLocalAddress()) { if (ip.getHostAddress().equalsIgnoreCase("127.0.0.1")){ continue; } if (ip instanceof Inet6Address) { continue; } if (ip instanceof Inet4Address) { return ip.getHostAddress(); } } return ip.getLocalHost().getHostAddress(); } } LOGGER.error("Can't find available HostAddress!"); throw new UnknownHostException("Can't find available HostAddress!"); }
Source:
<code>public void aCsvModelIsValidWhenDelimiterAndFieldsAreSet() { DefaultCSVMetaDataBuilder builder = new DefaultCSVMetaDataBuilder(); CSVMetaDataModel model = builder.setDelimiter(",").addField("name", DataType.STRING).addField("age", DataType.DECIMAL).build(); Assert.assertThat(model, CoreMatchers.notNullValue()); Assert.assertThat(model.getDelimiter(), CoreMatchers.is(",")); <START> Assert.assertThat(model.getFields().size(), CoreMatchers.is(2)); <END> }</code><technical_language>a hasSize matcher</technical_language>

Target:
public void aCsvModelIsValidWhenDelimiterAndFieldsAreSet() { DefaultCSVMetaDataBuilder builder = new DefaultCSVMetaDataBuilder(); CSVMetaDataModel model = builder.setDelimiter(COMMA_DELIMITER).addField(FIELD_NAME, DataType.STRING).addField(FIELD_AGE, DataType.DECIMAL).build(); assertThat(model, notNullValue()); assertThat(model.getDelimiter(), is(COMMA_DELIMITER)); assertThat(model.getFields(), hasSize(2)); }
Source:
<code>public static Schema discoverSchema(Source ... fixedSources) throws SAXException { return newSchema(Stream.of( Arrays.stream(fixedSources), stream(libraryServiceLoaderFor(CacheManagerServiceConfigurationParser.class)).map(p -> { try { return p.getXmlSchema(); } catch (IOException e) { <START> throw new AssertionError(e); <END> } }), stream(libraryServiceLoaderFor(CacheServiceConfigurationParser.class)).map(p -> { try { return p.getXmlSchema(); } catch (IOException e) { throw new AssertionError(e); } }), stream(libraryServiceLoaderFor(CacheResourceConfigurationParser.class)).map(p -> { try { return p.getXmlSchema(); } catch (IOException e) { throw new AssertionError(e); } })).flatMap(identity()).toArray(Source[]::new)); }</code><technical_language>Throwing AssertionError is unexpected behavior change -- IOException floated through</technical_language>

Target:
public static Schema discoverSchema(Source ... fixedSources) throws SAXException, IOException { ArrayList<Source> schemaSources = new ArrayList<>(asList(fixedSources)); for (CacheManagerServiceConfigurationParser<?> p : libraryServiceLoaderFor(CacheManagerServiceConfigurationParser.class)) { schemaSources.add(p.getXmlSchema()); } for (CacheServiceConfigurationParser<?> p : libraryServiceLoaderFor(CacheServiceConfigurationParser.class)) { schemaSources.add(p.getXmlSchema()); } for (CacheResourceConfigurationParser p : libraryServiceLoaderFor(CacheResourceConfigurationParser.class)) { schemaSources.add(p.getXmlSchema()); } return newSchema(schemaSources.toArray(new Source[0])); }
Source:
<code>public void onPlaying() { super.onPlaying(); updateNotification(R.drawable.ic_pause_white); videoPlayPause.setBackgroundResource(R.drawable.ic_pause_white); lockManager.acquireWifiAndCpu(); hideControls(DEFAULT_CONTROLS_DURATION, DEFAULT_CONTROLS_HIDE_TIME); <START> new CheckForNewAppVersionTask().execute(); <END> }</code><technical_language>do run check here, too</technical_language>

Target:
public void onPlaying() { super.onPlaying(); updateWindowFlags(ONGOING_PLAYBACK_WINDOW_FLAGS); resetNotification(); updateNotification(R.drawable.ic_pause_white); videoPlayPause.setBackgroundResource(R.drawable.ic_pause_white); hideControls(DEFAULT_CONTROLS_DURATION, DEFAULT_CONTROLS_HIDE_TIME); startForeground(NOTIFICATION_ID, notBuilder.build()); lockManager.acquireWifiAndCpu(); }
Source:
<code>public int compareTo(PicassoFutureTask other) { Picasso.Priority p1 = hunter.getPriority(); Picasso.Priority p2 = other.hunter.getPriority(); return (p1 == p2 <START> ? hunter.getSequence() - other.hunter.getSequence() : p2.ordinal() - p1.ordinal()); <END> }</code><technical_language>@JvmField properties code this change</technical_language>

Target:
public int compareTo(PicassoFutureTask other) { Picasso.Priority p1 = hunter.priority; Picasso.Priority p2 = other.hunter.priority; return (p1 == p2 ? hunter.sequence - other.hunter.sequence : p2.ordinal() - p1.ordinal()); }
Source:
<code>private ReserveFileMap inventoryExistingReserveFiles() { <START> ReserveFileMap reserveFiles = new ReserveFileMap(); <END> File[] fileSizeDirs = reserveDir.listFiles(FILE_SIZE_DIR_FILTER); if (fileSizeDirs != null) { for (File fileSizeDir : fileSizeDirs) { long sizeInBytes = Long.parseLong(fileSizeDir.getName()); File[] reserveFilesForSize = fileSizeDir.listFiles(RESERVE_FILE_FILTER); if (reserveFilesForSize != null) { for (File reserveFile : reserveFilesForSize) { reserveFiles.add(sizeInBytes, reserveFile); } } } } return reserveFiles; }</code><technical_language>add metrics this</technical_language>

Target:
private void inventoryExistingReserveFiles() throws IOException { File[] fileSizeDirs = reserveDir.listFiles(FILE_SIZE_DIR_FILTER); if (fileSizeDirs == null) { throw new IOException("Error while listing directories in " + reserveDir.getAbsolutePath()); } for (File fileSizeDir : fileSizeDirs) { long sizeInBytes = getFileSizeForDirName(fileSizeDir.getName()); File[] reserveFilesForSize = fileSizeDir.listFiles(RESERVE_FILE_FILTER); if (reserveFilesForSize == null) { throw new IOException("Error while listing files in " + fileSizeDir.getAbsolutePath()); } for (File reserveFile : reserveFilesForSize) { reserveFiles.add(sizeInBytes, reserveFile); } } }
Source:
<code>private boolean handleSocksProxyPreferenceChange(Preference preference, String newValue) { if (newValue.equals("")) { preference.setSummary(getString(R.string.do_not_use_proxy) + " " + getString(R.string.generic_example) + ": " + getString(R.string.socks_proxy_address_example)); return true; <START> } else if (newValue.matches("^socks.://(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}):(\\d{1,5})$")) { <END> preference.setSummary(getString(R.string.use_proxy) + " " + newValue); return true; } else { Toast.makeText(getActivity(), R.string.toast_invalid_socks_proxy_address, Toast.LENGTH_SHORT) .show(); return false; } }</code><technical_language>This socks5://host.com:8080</technical_language>

Target:
private boolean handleSocksProxyPreferenceChange(Preference preference, String newValue) { if (newValue.equals("")) { preference.setSummary(getString(R.string.do_not_use_proxy) + " " + getString(R.string.generic_example) + ": " + getString(R.string.socks_proxy_address_example)); return true; } else if (newValue.matches("^socks5://.*:\\d{1,5}$")) { preference.setSummary(getString(R.string.use_proxy) + " " + newValue); return true; } else { Toast.makeText(getActivity(), R.string.toast_invalid_socks_proxy_address, Toast.LENGTH_SHORT) .show(); return false; } }
Source:
<code><START> public ITmfTimestamp readEnd() { <END> try { Long pos = fFile.length() - 1; while (pos > 0) { while (pos > 0) { fFile.seek(pos - 1); if (fFile.read() == '\n') { break; } pos--; } ITmfLocation location = new TmfLongLocation(pos); TmfContext context = new TmfContext(location, ITmfContext.UNKNOWN_RANK); CustomXmlEvent event = parseEvent(context); if (event != null) { return event.getTimestamp(); } pos--; } } catch (IOException e) { return null; } return null; }</code><technical_language>synchronized</technical_language>

Target:
public synchronized ITmfTimestamp readEnd() { try { Long pos = fFile.length() - 1; while (pos > 0) { while (pos > 0) { fFile.seek(pos - 1); if (fFile.read() == '\n') { break; } pos--; } ITmfLocation location = new TmfLongLocation(pos); ITmfContext context = seekEvent(location); ITmfEvent event = parseEvent(context); context.dispose(); if (event != null) { return event.getTimestamp(); } pos--; } } catch (IOException e) { return null; } return null; }
Source:
<code>public GoloFunction(String name, Visibility visibility, Scope scope) { this.name = name; this.visibility = visibility; this.scope = scope; <START> this.main = this.name.equals("main"); <END> }</code><technical_language>check function is unary</technical_language>

Target:
public GoloFunction(String name, Visibility visibility, Scope scope) { this.name = name; this.visibility = visibility; this.scope = scope; }
Source:
<code>public RelDataType rowType() { synchronized (lock) { Preconditions.checkState(prepareResult != null || plannerResult != null, <START> "must be called after sql has been prepared"); <END> return plannerResult != null ? plannerResult.rowType() : prepareResult.getRowType(); } }</code><technical_language>message is consistent condition, if SQL planned, precondition is met. place SqlLifecycle#rowType() is called a preceding call SqlLifecycle#plan() is in DruidStatement#prepare(). However, in method, is call PrepareResult#getRowType() return of earlier call SqlLifecycle#prepare(). If is done changes needed</technical_language>

Target:
public RelDataType rowType() { synchronized (lock) { return plannerResult != null ? plannerResult.rowType() : prepareResult.getRowType(); } }
Source:
<code>private static AbstractBeanDefinition throwAmbiguousCustomImplementationException(Collection<BeanDefinition> definitions) { <START> List<String> implementationClassNames = new ArrayList<String>(); <END> for (BeanDefinition bean : definitions) { implementationClassNames.add(bean.getBeanClassName()); } throw new IllegalStateException( String.format("Ambiguous custom implementations detected! Found %s but expected a single implementation!", StringUtils.collectionToCommaDelimitedString(implementationClassNames))); }</code><technical_language>Blank line multi-line method implementations</technical_language>

Target:
private static AbstractBeanDefinition throwAmbiguousCustomImplementationException( Collection<BeanDefinition> definitions) { List<String> implementationClassNames = new ArrayList<String>(); for (BeanDefinition bean : definitions) { implementationClassNames.add(bean.getBeanClassName()); } throw new IllegalStateException( String.format("Ambiguous custom implementations detected! Found %s but expected a single implementation!", definitions.stream() .map(BeanDefinition::getBeanClassName) .collect(Collectors.joining(", ")))); }
Source:
<code>long getRetryDelayInMs() { <START> int delayInMs = (int) Math.min(minSleepTime.toMillis() * Math.pow(scaleFactor, getAttempts() - 1), maxSleepTime.toMillis()); <END> int jitter = ThreadLocalRandom.current().nextInt(Math.max(1, (int) (delayInMs * 0.1))); return delayInMs + jitter; }</code><technical_language>typically, getters class</technical_language>

Target:
long getRetryDelayInMs() { int delayInMs = (int) Math.min(minSleepTime.toMillis() * Math.pow(scaleFactor, attempts.get() - 1), maxSleepTime.toMillis()); int jitter = ThreadLocalRandom.current().nextInt(Math.max(1, (int) (delayInMs * 0.1))); return delayInMs + jitter; }
Source:
<code>public void testReturnContainerCPULimitAndRequest() { float limit = Containers.getCpuLimit(container); <START> float request = (Containers.getCpuRequest(container)); <END> assertEquals(limit, CPU_LIMIT); assertEquals(request, CPU_REQUEST); }</code><technical_language>is this surrounded parenthesis</technical_language>

Target:
public void testReturnContainerCPULimitAndRequest() { float limit = Containers.getCpuLimit(container); float request = Containers.getCpuRequest(container); assertEquals(limit, CPU_LIMIT); assertEquals(request, CPU_REQUEST); }
Source:
<code><START> public Builder<T> withDeleteResolver(@NonNull DeleteResolver deleteResolver) { <END> super.withDeleteResolver(deleteResolver); return this; }</code><technical_language>I think, return type CompleteBuilder<T>? user set MapFunc probably, problems in previous PRs, sorry, thought</technical_language>

Target:
public CompleteBuilder<T> withDeleteResolver(@NonNull DeleteResolver deleteResolver) { super.withDeleteResolver(deleteResolver); return this; }
Source:
<code>public SourcePath getSwiftModuleOutputPath() { <START> return ExplicitBuildTargetSourcePath.of(getBuildTarget(), Paths.get(outputPath.toString(), moduleName + ".swiftmodule")); <END> }</code><technical_language>This produce a module name produced compilation in case of sanitisation. Instead, return precomputed modulePath so: return ExplicitBuildTargetSourcePath.of(getBuildTarget(), modulePath);</technical_language>

Target:
public SourcePath getSwiftModuleOutputPath() { return ExplicitBuildTargetSourcePath.of(getBuildTarget(), modulePath); }
Source:
<code>public void close() { closeQuietly(api); <START> } <END></code><technical_language>reason for a method delegates a single call</technical_language>

Target:
public void close() throws IOException { Closeables.close(api, true); }
Source:
<code>protected void populateItemAccountingLines(Map parameterMap) { if (!(getDocument() instanceof PurchaseOrderAmendmentDocument)) { super.populateItemAccountingLines(parameterMap); return; } int itemCount = 0; for (PurApItem item : ((PurchasingAccountsPayableDocument) getDocument()).getItems()) { populateAccountingLine(item.getNewSourceLine(), KFSPropertyConstants.DOCUMENT + "." + KFSPropertyConstants.ITEM + "[" + itemCount + "]." + KFSPropertyConstants.NEW_SOURCE_LINE, parameterMap); int sourceLineCount = 0; for (PurApAccountingLine purApLine : item.getSourceAccountingLines()) { populateAccountingLine(purApLine, KFSPropertyConstants.DOCUMENT + "." + KFSPropertyConstants.ITEM + "[" + itemCount + "]." + KFSPropertyConstants.SOURCE_ACCOUNTING_LINE + "[" + sourceLineCount + "]", parameterMap); <START> sourceLineCount += 1; <END> } itemCount++; } }</code><technical_language>consistent, sourceLineCount++</technical_language>

Target:
protected void populateItemAccountingLines(Map parameterMap) { if (!(getDocument() instanceof PurchaseOrderAmendmentDocument)) { super.populateItemAccountingLines(parameterMap); return; } int itemCount = 0; for (PurApItem item : ((PurchasingAccountsPayableDocument) getDocument()).getItems()) { populateAccountingLine(item.getNewSourceLine(), KFSPropertyConstants.DOCUMENT + "." + KFSPropertyConstants.ITEM + "[" + itemCount + "]." + KFSPropertyConstants.NEW_SOURCE_LINE, parameterMap); int sourceLineCount = 0; for (PurApAccountingLine purApLine : item.getSourceAccountingLines()) { populateAccountingLine(purApLine, KFSPropertyConstants.DOCUMENT + "." + KFSPropertyConstants.ITEM + "[" + itemCount + "]." + KFSPropertyConstants.SOURCE_ACCOUNTING_LINE + "[" + sourceLineCount + "]", parameterMap); sourceLineCount += 1; } itemCount += 1; } }
Source:
<code>protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { final ServiceName serviceName = MessagingServices.getActiveMQServiceName(PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR))); final ServiceName jmsServiceName = JMSServices.getJmsManagerBaseServiceName(serviceName); final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR)); final String name = address.getLastElement().getValue(); <START> ServiceController<?> service = context.getServiceRegistry(false).getService(jmsServiceName); <END> JMSServerManager server = JMSServerManager.class.cast(service.getValue()); try { server.destroyQueue(name, true); } catch (Exception e) { throw new OperationFailedException(e); } context.removeService(JMSServices.getJmsQueueBaseServiceName(serviceName).append(name)); for (String entry : CommonAttributes.DESTINATION_ENTRIES.unwrap(context, model)) { final ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(entry); ServiceName binderServiceName = bindInfo.getBinderServiceName(); context.removeService(binderServiceName); } for (String legacyEntry: CommonAttributes.LEGACY_ENTRIES.unwrap(context, model)) { final ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(legacyEntry); ServiceName binderServiceName = bindInfo.getBinderServiceName(); context.removeService(binderServiceName); } }</code><technical_language>This getServiceRegistry(true). a practical effect this op exclusive op lock in Stage.RUNTIME, good a form of illustration code 'true' if code is accessing MSC intent modify runtime state</technical_language>

Target:
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { final ServiceName serviceName = MessagingServices.getActiveMQServiceName(PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR))); final ServiceName jmsServiceName = JMSServices.getJmsManagerBaseServiceName(serviceName); final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR)); final String name = address.getLastElement().getValue(); ServiceController<?> service = context.getServiceRegistry(true).getService(jmsServiceName); JMSServerManager server = JMSServerManager.class.cast(service.getValue()); try { server.destroyQueue(JMS_QUEUE_PREFIX + name, true); } catch (Exception e) { throw new OperationFailedException(e); } context.removeService(JMSServices.getJmsQueueBaseServiceName(serviceName).append(name)); for (String entry : CommonAttributes.DESTINATION_ENTRIES.unwrap(context, model)) { final ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(entry); ServiceName binderServiceName = bindInfo.getBinderServiceName(); context.removeService(binderServiceName); } for (String legacyEntry: CommonAttributes.LEGACY_ENTRIES.unwrap(context, model)) { final ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(legacyEntry); ServiceName binderServiceName = bindInfo.getBinderServiceName(); context.removeService(binderServiceName); } }
Source:
<code>private VariableTypeList filterDatasetVariables(final VariableTypeList variables, final boolean isMeasurementDataset) { final VariableTypeList newVariables = new VariableTypeList(); if (variables != null) { for (final DMSVariableType variable : variables.getVariableTypes()) { final boolean partOfHiddenDatasetColumns = DataSetBuilder.HIDDEN_DATASET_COLUMNS.contains(variable.getId()); final boolean isOccAndNurseryAndMeasurementDataset = variable.getId() == TermId.TRIAL_INSTANCE_FACTOR.getId() && isMeasurementDataset; final boolean isMeasurementDatasetAndIsTrialFactors = isMeasurementDataset && PhenotypicType.TRIAL_ENVIRONMENT == variable.getRole(); final boolean isTrialAndOcc = variable.getId() == TermId.TRIAL_INSTANCE_FACTOR.getId(); <START> final boolean isTreatmentFactorDuplicate = variable.getVariableType() == null && !StringUtils.isEmpty(variable.getTreatmentLabel()); <END> if (!partOfHiddenDatasetColumns && !isOccAndNurseryAndMeasurementDataset && !isMeasurementDatasetAndIsTrialFactors && !isTreatmentFactorDuplicate || isTrialAndOcc) { newVariables.add(variable); } } } return newVariables; }</code><technical_language>@mariebawanan I proper fix for this is remove duplicates in variables VariableTypeList instead of filtering out duplicates here</technical_language>

Target:
protected VariableTypeList filterDatasetVariables(final VariableTypeList variables, final boolean isMeasurementDataset) { final VariableTypeList newVariables = new VariableTypeList(); if (variables != null) { for (final DMSVariableType variable : variables.getVariableTypes()) { final boolean partOfHiddenDatasetColumns = DataSetBuilder.HIDDEN_DATASET_COLUMNS.contains(variable.getId()); final boolean isOccAndNurseryAndMeasurementDataset = variable.getId() == TermId.TRIAL_INSTANCE_FACTOR.getId() && isMeasurementDataset; final boolean isMeasurementDatasetAndIsTrialFactors = isMeasurementDataset && PhenotypicType.TRIAL_ENVIRONMENT == variable.getRole(); final boolean isTrialAndOcc = variable.getId() == TermId.TRIAL_INSTANCE_FACTOR.getId(); final boolean isTreatmentFactorDuplicate = variable.getVariableType() == null && !StringUtils.isEmpty(variable.getTreatmentLabel()); if (!partOfHiddenDatasetColumns && !isOccAndNurseryAndMeasurementDataset && !isMeasurementDatasetAndIsTrialFactors && !isTreatmentFactorDuplicate || isTrialAndOcc) { newVariables.add(variable); } } } return newVariables; }
Source:
<code>public boolean equals(Object other) { if (other == null) { return false; } if (this.getClass() != other.getClass()) { return false; } if (this == other) { return true; } <START> if (!messageId.equals(other.toString())) { return false; } return true; <END> }</code><technical_language>suggestion return Objects.equals(messageId, other.toString());</technical_language>

Target:
public boolean equals(Object other) { if (other == null) { return false; } if (this.getClass() != other.getClass()) { return false; } if (this == other) { return true; } return messageId.equals(other.toString()); }
Source:
<code>private WebElement getProjectExplorerItem(String path) { <START> String locator = " END> return redrawUiElementsWait.until( ExpectedConditions.visibilityOfElementLocated(By.xpath(String.format(locator, path)))); }</code><technical_language>This variable is redundant here. get rid of simplify code</technical_language>

Target:
private WebElement getProjectExplorerItem(String path) { return redrawUiElementsWait.until( ExpectedConditions.visibilityOfElementLocated( By.xpath(String.format(" }
Source:
<code>public String next() { String result; try { result = ReplChangeManager.encodeFileUri(files.get(i), chksums != null ? chksums.get(i) : null, null); } catch (IOException e) { <START> result = files.get(i); <END> } i++; return result; }</code><technical_language>i .. ReplChangeManager handle (null check is there) ..cm_root set scenario ..here in this layer throw exception for failure</technical_language>

Target:
public String next() { String result; try { result = ReplChangeManager.encodeFileUri(files.get(i), chksums != null ? chksums.get(i) : null, null); } catch (IOException e) { LOG.error("Encoding file URI failed with error " + e.getMessage()); throw new RuntimeException(e.getMessage()); } i++; return result; }
Source:
<code>public void visitNode(Tree tree) { ClassTree classTree = (ClassTree)tree; if (isSerializable(classTree) && !SerializableContract.hasSpecialHandlingSerializationMethods(classTree)) { classTree.members().stream() .filter(member -> member.is(Tree.Kind.VARIABLE)) .filter(member -> !isStatic((VariableTree) member)) .filter(member -> !isTransient((VariableTree) member)) .filter(member -> isSerializableAndValueBased(((VariableTree) member).type().symbolType())) <START> .forEach(member -> context.reportIssue( <END> this, ((VariableTree) member).simpleName(), "Make this value-based field transient so it is not included in the serialization of this class.")); } }</code><technical_language>need context, is a report issue method inheritance SubscriptionVisitor</technical_language>

Target:
public void visitNode(Tree tree) { ClassTree classTree = (ClassTree) tree; if (classTree.is(Tree.Kind.ANNOTATION_TYPE)) { classTree.members().stream() .map(member -> (MethodTree) member) .filter(meth -> isReturnTypeValueBased(meth)) .forEach(meth -> reportIssue(meth.simpleName(), MESSAGE)); } else if (isSerializable(classTree) && !SerializableContract.hasSpecialHandlingSerializationMethods(classTree)) { classTree.members().stream() .filter(ValueBasedObjectsShouldNotBeSerializedCheck::isVariable) .map(member -> (VariableTree) member) .filter(var -> !isStatic(var)) .filter(var -> !isTransient(var)) .filter(var -> isVarSerializableAndValueBased(var)) .forEach(var -> reportIssue(var.simpleName(), MESSAGE)); } }
Source:
<code>public Map<Integer, String> retrieveStockIds(List<Integer> gIds) { Map<Integer, String> gIdStockIdMap = new HashMap<>(); String sql = "SELECT a.gid,group_concat(inventory_id SEPARATOR ', ') " + "FROM listdata a " + "inner join ims_lot b ON a.gid = b.eid " + "INNER JOIN ims_transaction c ON b.lotid = c.lotid and a.lrecid = c.recordid " + "WHERE a.gid in (:gIds) GROUP BY a.gid"; Query query = this.getSession().createSQLQuery(sql).setParameterList("gIds", gIds); List<Object[]> result = query.list(); for (Object[] row : result) { <START> Integer lrecid = (Integer) row[0]; <END> String stockIds = (String) row[1]; gIdStockIdMap.put(lrecid, stockIds); } return gIdStockIdMap; }</code><technical_language>Rename this local variable gid well, renaming done for lrecId</technical_language>

Target:
public Map<Integer, String> retrieveStockIds(List<Integer> gIds) { Map<Integer, String> gIdStockIdMap = new HashMap<>(); String sql = "SELECT a.gid,group_concat(inventory_id SEPARATOR ', ') " + "FROM listdata a " + "inner join ims_lot b ON a.gid = b.eid " + "INNER JOIN ims_transaction c ON b.lotid = c.lotid and a.lrecid = c.recordid " + "WHERE a.gid in (:gIds) GROUP BY a.gid"; Query query = this.getSession().createSQLQuery(sql).setParameterList("gIds", gIds); List<Object[]> result = query.list(); for (Object[] row : result) { Integer gid = (Integer) row[0]; String stockIds = (String) row[1]; gIdStockIdMap.put(gid, stockIds); } return gIdStockIdMap; }
Source:
<code>public Object call(final List<String> keys, final List<String> args) throws IOException { final Jedis jedis = this.jedisPool.getResource(); try { <START> return jedis.evalsha(SafeEncoder.encode(this.sha1(jedis)), keys, args); <END> } finally { this.jedisPool.returnResource(jedis); } }</code><technical_language>sha1(...) memoize safe-encoded version of byte array</technical_language>

Target:
public Object call(final List<String> keys, final List<String> args) throws IOException { final Jedis jedis = this.jedisPool.getResource(); try { return jedis.evalsha(this.calculateSha1(jedis), keys, args); } finally { this.jedisPool.returnResource(jedis); } }
Source:
<code><START> public String getSketchValue() <END> { return Base64.encodeBase64String(sketchValue.getSketch().toByteArray()); }</code><technical_language>return sketchValue here. Jackson serialize SketchHolder objects. way, serialization code is located in place (SketchHolderJsonSerializer)</technical_language>

Target:
public SketchHolder getSketchValue() { return sketchValue; }
Source:
<code>public long getTokenExpiration(final String token) throws UnknownTokenException { long expiration = 0; try { validateToken(token); } catch (final UnknownTokenException e) { if (permissiveFailureEnabled && StringUtils <START> .containsIgnoreCase(e.toString(), "Unknown token")) { <END> return getJWTTokenExpiration(token); } else { throw e; } } try { char[] expStr = aliasService.getPasswordFromAliasForCluster(AliasService.NO_CLUSTER_NAME, token); if (expStr != null) { expiration = Long.parseLong(new String(expStr)); } } catch (Exception e) { log.errorAccessingTokenState(TokenUtils.getTokenDisplayText(token), e); } return expiration; }</code><technical_language>What? catch UnknownTokenException a string check error message? Why</technical_language>

Target:
public long getTokenExpiration(final String token) throws UnknownTokenException { long expiration = 0; try { validateToken(token); } catch (final UnknownTokenException e) { if (permissiveValidationEnabled && getJWTTokenExpiration(token).isPresent()) { return getJWTTokenExpiration(token).getAsLong(); } else { throw e; } } try { char[] expStr = aliasService.getPasswordFromAliasForCluster(AliasService.NO_CLUSTER_NAME, token); if (expStr != null) { expiration = Long.parseLong(new String(expStr)); } } catch (Exception e) { log.errorAccessingTokenState(TokenUtils.getTokenDisplayText(token), e); } return expiration; }
Source:
<code>public String getFunctionName() { <START> return "junitResults"; <END> }</code><technical_language>is hard explain users this instead of junit</technical_language>

Target:
public String getFunctionName() { return "junit"; }
Source:
<code>private Mono<Void> onConnect(WebsocketSession session) { LOGGER.info("Session connected: " + session); session .receive() <START> .map(messageCodec::decode) <END> .doOnNext(message -> metrics.markRequest()) .map(this::checkSid) .flatMap(msg -> handleCancel(session, msg)) .map(msg -> checkSidNonce(session, (GatewayMessage) msg)) .map(this::checkQualifier) .subscribe( request -> handleMessage(session, request), th -> { LOGGER.error("Exception occurred: {}, session={}", th, session.id()); if (th instanceof WebsocketRequestException) { WebsocketRequestException ex = (WebsocketRequestException) th; handleError(session, ex.releaseRequest().request().streamId(), th); } }); return session.onClose(() -> LOGGER.info("Session disconnected: " + session)); }</code><technical_language>if happen decoding sender send sid - exception connection closed, receive this stream</technical_language>

Target:
private Mono<Void> onConnect(WebsocketSession session) { LOGGER.info("Session connected: " + session); session .receive() .subscribe( byteBuf -> Mono.fromCallable(() -> messageCodec.decode(byteBuf)) .doOnNext(message -> metrics.markRequest()) .map(this::checkSid) .flatMap(msg -> handleCancel(session, msg)) .map(msg -> checkSidNonce(session, (GatewayMessage) msg)) .map(this::checkQualifier) .subscribe( request -> handleMessage(session, request), th -> { LOGGER.error("Exception occurred: {}, session={}", th, session.id()); if (th instanceof WebsocketRequestException) { WebsocketRequestException ex = (WebsocketRequestException) th; handleError(session, ex.releaseRequest().request().streamId(), th); } }), th -> LOGGER.error("Exception occurred on receiving from session {}", session, th)); return session.onClose(() -> LOGGER.info("Session disconnected: " + session)); }
Source:
<code>static ParseEventuallyQueue getEventuallyQueue() { Context context = ParsePlugins.Android.get().applicationContext(); synchronized (MUTEX) { boolean isLocalDatastoreEnabled = Parse.isLocalDatastoreEnabled(); if (eventuallyQueue == null || (isLocalDatastoreEnabled && eventuallyQueue instanceof ParseCommandCache) || (!isLocalDatastoreEnabled && eventuallyQueue instanceof ParsePinningEventuallyQueue)) { checkContext(); eventuallyQueue = isLocalDatastoreEnabled ? new ParsePinningEventuallyQueue(context, ParsePlugins.get().restClient()) : new ParseCommandCache(context, ParsePlugins.get().restClient()); if (isLocalDatastoreEnabled && ParseCommandCache.getPendingCount() > 0) { <START> new ParseCommandCache(context, ParsePlugins.get().restClient()); <END> } } return eventuallyQueue; } }</code><technical_language>nit: grab restClient reuse variable</technical_language>

Target:
static ParseEventuallyQueue getEventuallyQueue() { Context context = ParsePlugins.Android.get().applicationContext(); synchronized (MUTEX) { boolean isLocalDatastoreEnabled = Parse.isLocalDatastoreEnabled(); if (eventuallyQueue == null || (isLocalDatastoreEnabled && eventuallyQueue instanceof ParseCommandCache) || (!isLocalDatastoreEnabled && eventuallyQueue instanceof ParsePinningEventuallyQueue)) { checkContext(); ParseHttpClient httpClient = ParsePlugins.get().restClient(); eventuallyQueue = isLocalDatastoreEnabled ? new ParsePinningEventuallyQueue(context, httpClient) : new ParseCommandCache(context, httpClient); if (isLocalDatastoreEnabled && ParseCommandCache.getPendingCount() > 0) { new ParseCommandCache(context, httpClient); } } return eventuallyQueue; } }
Source:
<code>public List<Predicate<ItemStackSnapshot>> getIngredientPredicates() { <START> return recipeItems.stream() <END> .map(ItemStackUtil::snapshotOf) .map(MatchCraftingVanillaItemStack::new) .collect(Collectors.toList()); }</code><technical_language>this</technical_language>

Target:
public List<Predicate<ItemStackSnapshot>> getIngredientPredicates() { return this.recipeItems.stream() .map(ItemStackUtil::snapshotOf) .map(MatchCraftingVanillaItemStack::new) .collect(Collectors.toList()); }
Source:
<code><START> public AccessTokenDto(AccessToken accessToken, String name) { <END> super(accessToken.getToken(), accessToken.getType(), accessToken.getInitialValidSeconds(), accessToken.getValidUntil(), accessToken.getCreationTimestamp()); this.name = name; }</code><technical_language>leave this package private? This future refactorings easier, need care changing public interfaces ;-)</technical_language>

Target:
AccessTokenDto(AccessToken accessToken, String name) { super(accessToken.getToken(), accessToken.getType(), accessToken.getInitialValidSeconds(), accessToken.getValidUntil(), accessToken.getCreationTimestamp()); this.name = name; }
Source:
<code>public void testPBEDetect() { int cipherJVMCount = 0; Set<String> keyFactories = new HashSet<String>(); Provider[] providers = Security.getProviders(); for (Provider p : providers) { for (Provider.Service service : p.getServices()) { if (service.getType().equals("SecretKeyFactory") && service.getAlgorithm().indexOf(' ') == -1) { keyFactories.add(service.getAlgorithm()); } } } for (Provider p : providers) { for (Provider.Service service : p.getServices()) { if (service.getType().equals("Cipher") && service.getAlgorithm().startsWith("PBE") && keyFactories.contains(service.getAlgorithm())) { cipherJVMCount++; } } } JavaEncryption encryption = new JavaEncryption(); <START> HashMap detectedCiphers = encryption.detect(); <END> assertEquals(cipherJVMCount, detectedCiphers.size()); }</code><technical_language>add assertion detectedCiphers.size() > 0</technical_language>

Target:
public void testPBEDetect() { int cipherJVMCount = 0; Set<String> keyFactories = new HashSet<>(); Provider[] providers = Security.getProviders(); for (Provider p : providers) { for (Provider.Service service : p.getServices()) { if (service.getType().equals("SecretKeyFactory") && service.getAlgorithm().indexOf(' ') == -1) { keyFactories.add(service.getAlgorithm()); } } } for (Provider p : providers) { for (Provider.Service service : p.getServices()) { if (service.getType().equals("Cipher") && service.getAlgorithm().startsWith("PBE") && keyFactories.contains(service.getAlgorithm())) { cipherJVMCount++; } } } JavaEncryption encryption = new JavaEncryption(); HashMap detectedCiphers = encryption.detect(); assertTrue(detectedCiphers.size() > 0); assertEquals(cipherJVMCount, detectedCiphers.size()); }
Source:
<code>public ResponseEntity validate(@RequestBody Map<String, String> params) { try { BaseCallbackRequestModel model = umpUtils.parseParamsToModel(params, BaseCallbackRequestModel.class); if (model.isSuccess()){ return ResponseEntity.ok().build(); } } catch (VerifyException | IOException ignored) { <START> } <END> return ResponseEntity.status(-1).build(); }</code><technical_language>bad request</technical_language>

Target:
public ResponseEntity validate(@RequestBody Map<String, String> params) { try { BaseCallbackRequestModel model = umpUtils.parseParamsToModel(params, BaseCallbackRequestModel.class); if (model.isSuccess()){ return ResponseEntity.ok().build(); } } catch (VerifyException | IOException ignored) { } return ResponseEntity.badRequest().build(); }
Source:
<code>public List<ResponseInfo> sendAndPoll(List<RequestInfo> requestsToSend, Set<Integer> requestsToDrop, int pollTimeoutMs) { if (closed || !selector.isOpen()) { throw new IllegalStateException("The NetworkClient is closed."); } long startTime = time.milliseconds(); List<ResponseInfo> responseInfoList = new ArrayList<>(); try { for (RequestInfo requestInfo : requestsToSend) { pendingRequests.add(new RequestMetadata(requestInfo)); } List<NetworkSend> sends = prepareSends(requestsToDrop, responseInfoList); replenishConnections(); <START> dropInFlightRequests(requestsToDrop); <END> selector.poll(pollTimeoutMs, sends); handleSelectorEvents(responseInfoList); } catch (Exception e) { logger.error("Received an unexpected error during sendAndPoll(): ", e); networkMetrics.networkClientException.inc(); } finally { numPendingRequests.set(pendingRequests.size()); networkMetrics.networkClientSendAndPollTime.update(time.milliseconds() - startTime, TimeUnit.MILLISECONDS); } return responseInfoList; }</code><technical_language>a bit cleaner if call in caller of sendAndPoll</technical_language>

Target:
public List<ResponseInfo> sendAndPoll(List<RequestInfo> requestsToSend, Set<Integer> requestsToDrop, int pollTimeoutMs) { if (closed || !selector.isOpen()) { throw new IllegalStateException("The NetworkClient is closed."); } long startTime = time.milliseconds(); List<ResponseInfo> responseInfoList = new ArrayList<>(); try { for (RequestInfo requestInfo : requestsToSend) { pendingRequests.add(new RequestMetadata(requestInfo)); } List<NetworkSend> sends = prepareSends(requestsToDrop, responseInfoList); replenishConnections(); for (Integer correlationId : requestsToDrop) { String connectionId = correlationIdInFlightToConnectionId.get(correlationId); if (connectionId != null) { selector.close(connectionId); } } selector.poll(pollTimeoutMs, sends); handleSelectorEvents(responseInfoList); } catch (Exception e) { logger.error("Received an unexpected error during sendAndPoll(): ", e); networkMetrics.networkClientException.inc(); } finally { numPendingRequests.set(pendingRequests.size()); networkMetrics.networkClientSendAndPollTime.update(time.milliseconds() - startTime, TimeUnit.MILLISECONDS); } return responseInfoList; }
Source:
<code>public IProject[] getProjects() { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); if (!object.isContainer()) { IFile file = root.getFileForLocation(object.getLocation()); <START> <END> return new IProject[] {file.getProject()}; } else { if (object instanceof GitModelTree) { IContainer container = root.getContainerForLocation(object.getLocation()); return new IProject[] {container.getProject()}; } else if (object instanceof HasProjects) return ((HasProjects) object).getProjects(); else return null; } }</code><technical_language>style nit: remove unnecessary blank line</technical_language>

Target:
public IProject[] getProjects() { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); if (!object.isContainer()) { IFile file = root.getFileForLocation(object.getLocation()); return new IProject[] {file.getProject()}; } else { if (object instanceof GitModelTree) { IContainer container = root.getContainerForLocation(object.getLocation()); return new IProject[] {container.getProject()}; } else if (object instanceof GitModelWithProjects) return ((GitModelWithProjects) object).getProjects(); else return null; } }
Source:
<code>public void endFormat(WikiFormat format) { <START> if ((!format.getStyles().isEmpty()) || (!format.getParams().isEmpty())) { <END> this.lastEndFormat = format; } }</code><technical_language>need for extra parenthesis</technical_language>

Target:
public void endFormat(WikiFormat format) { if (!format.getStyles().isEmpty() || !format.getParams().isEmpty()) { this.lastEndFormat = format; } }
Source:
<code>public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException { FormatTools.checkPlaneParameters(this, no, buf.length, x, y, w, h); int vffIndex = no % vffs.length; <START> RandomAccessInputStream vff = new RandomAccessInputStream(vffs[vffIndex]); <END> try { if (headerSize[vffIndex] == 0) { skipHeader(vff); headerSize[vffIndex] = vff.getFilePointer(); } long planeSize = (long) FormatTools.getPlaneSize(this); vff.seek(headerSize[vffIndex] + planeSize * (no / vffs.length)); readPlane(vff, x, y, w, h, buf); byte[] row = new byte[(int) (w * (planeSize / (getSizeX() * getSizeY())))]; for (int yy=0; yy<h/2; yy++) { int topOffset = buf.length - (yy + 1) * row.length; int bottomOffset = yy * row.length; System.arraycopy(buf, bottomOffset, row, 0, row.length); System.arraycopy(buf, topOffset, buf, bottomOffset, row.length); System.arraycopy(row, 0, buf, topOffset, row.length); } return buf; } finally { vff.close(); } }</code><technical_language>Similar #3277, this put in a try-with-resources block</technical_language>

Target:
public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException { FormatTools.checkPlaneParameters(this, no, buf.length, x, y, w, h); int vffIndex = no % vffs.length; try (RandomAccessInputStream vff = new RandomAccessInputStream(vffs[vffIndex])) { if (headerSize[vffIndex] == 0) { skipHeader(vff); headerSize[vffIndex] = vff.getFilePointer(); } long planeSize = (long) FormatTools.getPlaneSize(this); vff.seek(headerSize[vffIndex] + planeSize * (no / vffs.length)); readPlane(vff, x, y, w, h, buf); byte[] row = new byte[(int) (w * (planeSize / (getSizeX() * getSizeY())))]; for (int yy=0; yy<h/2; yy++) { int topOffset = buf.length - (yy + 1) * row.length; int bottomOffset = yy * row.length; System.arraycopy(buf, bottomOffset, row, 0, row.length); System.arraycopy(buf, topOffset, buf, bottomOffset, row.length); System.arraycopy(row, 0, buf, topOffset, row.length); } return buf; } }
Source:
<code>private ZapMenuItem getMenuImportUrlGraphQl() { if (menuImportUrlGraphQl == null) { menuImportUrlGraphQl = new ZapMenuItem("graphql.topmenu.import.importremotegraphql"); menuImportUrlGraphQl.setToolTipText( Constant.messages.getString( "graphql.topmenu.import.importremotegraphql.tooltip")); <START> final ExtensionGraphQl shadowCopy = this; <END> menuImportUrlGraphQl.addActionListener( e -> View.getSingleton() .showMessageDialog( Constant.messages.getString( "graphql.importfromdialog.message"))); } return menuImportUrlGraphQl; }</code><technical_language>removed</technical_language>

Target:
private ZapMenuItem getMenuImportUrlGraphQl() { if (menuImportUrlGraphQl == null) { menuImportUrlGraphQl = new ZapMenuItem("graphql.topmenu.import.importremotegraphql"); menuImportUrlGraphQl.setToolTipText( Constant.messages.getString( "graphql.topmenu.import.importremotegraphql.tooltip")); menuImportUrlGraphQl.addActionListener( e -> View.getSingleton() .showMessageDialog( Constant.messages.getString( "graphql.importfromdialog.message"))); } return menuImportUrlGraphQl; }
Source:
<code>public boolean isSupported(Node node) { this.file = this.getAbstractFileFromNode(node); EamDb eamDb = null; try { <START> eamDb = EamDb.getInstance(); <END> } catch (EamDbException ex) { LOGGER.log(Level.WARNING, "Non-critical failure: EamDb threw an exception while while testing existance.", ex); } if(eamDb == null){ return this.file != null && this.file.getSize() > 0; } else{ return this.file != null && this.file.getSize() > 0 && !getCorrelationAttributesFromNode(node).isEmpty(); } }</code><technical_language>Is a reason EamDb.isEnabled() here</technical_language>

Target:
public boolean isSupported(Node node) { this.file = this.getAbstractFileFromNode(node); if(EamDb.isEnabled()){ return this.file != null && this.file.getSize() > 0 && !getCorrelationAttributesFromNode(node).isEmpty(); } else{ return this.file != null && this.file.getSize() > 0; } }