auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private FlexTable buildTable() { FlexTable table = new FlexTable(); table.addStyleName("dataTable"); table.setText(0, 0, "URI"); table.setText(0, 1, "Last update date"); table.setText(0, 2, "Last update user"); <START> table.setText(0, 3, "Is download allowed?"); <END> table.setText(0, 4, "Delete on save"); table.getRowFormatter().addStyleName(0, "titleBar"); return table; }</code><technical_language>Downloadable</technical_language>

Target:
private FlexTable buildTable() { FlexTable table = new FlexTable(); table.addStyleName("dataTable"); table.setText(0, 0, "URI"); table.setText(0, 1, "Last update date"); table.setText(0, 2, "Last update user"); table.setText(0, 3, "Downloadable"); table.setText(0, 4, "Delete on save"); table.getRowFormatter().addStyleName(0, "titleBar"); return table; }
Source:
<code>private void checkSuperOnlyInvokedInDerivedClassConstructor(SuperTreeImpl superTree) { <START> if (!isInConstructor(superTree) || isInBaseClass(getEnclosingConstructor(superTree))) { <END> addIssue(superTree, MESSAGE_SUPER_ONLY_IN_DERIVED_CLASS_CONSTRUCTOR); } }</code><technical_language>@ivandalbosco Minor: another possibility move tests visitSuper</technical_language>

Target:
private void checkSuperOnlyInvokedInDerivedClassConstructor(SuperTreeImpl superTree) { addIssue(superTree, MESSAGE_SUPER_ONLY_IN_DERIVED_CLASS_CONSTRUCTOR); }
Source:
<code>public static <V extends Persistable & Versionable> PaxosStateLog<V> create(SplittingParameters<V> parameters) { return new SplittingPaxosStateLog<>( parameters.legacyLog(), parameters.currentLog(), parameters.markLegacyWrite(), parameters.markLegacyRead(), parameters.cutoffInclusive(), <START> new AtomicLong(Math.min(parameters.legacyLog().getLeastLogEntry(), parameters.cutoffInclusive()))); <END> }</code><technical_language>Discussed offline: This is ok long internal server is fully ready this completed for clients</technical_language>

Target:
public static <V extends Persistable & Versionable> PaxosStateLog<V> create(SplittingParameters<V> parameters) { Preconditions.checkState(parameters.cutoffInclusive() == PaxosAcceptor.NO_LOG_ENTRY || parameters.currentLog().getGreatestLogEntry() >= parameters.cutoffInclusive(), "Cutoff value must either be -1, or the current log must contain an entry after the cutoff."); return new SplittingPaxosStateLog<>( parameters.legacyLog(), parameters.currentLog(), parameters.markLegacyWrite(), parameters.markLegacyRead(), parameters.cutoffInclusive(), new AtomicLong(parameters.legacyLog().getLeastLogEntry())); }
Source:
<code>@Override protected void beforeTest() throws Exception { super.beforeTest(); if (USE_TEST_CLUSTER && zkCluster == null) { <START> Map<String,Object>[] customProps = new Map[ZK_SRVS]; <END> if (sslEnabled) fillSslProperties(customProps); zkCluster = ZookeeperDiscoverySpiTestUtil.createTestingCluster(ZK_SRVS, customProps); zkCluster.start(); waitForZkClusterReady(zkCluster); } reset(); }</code><technical_language>Do base class need SSL? I suggest making 2 protected methods: clusterCustomProperties connectionString overridden implemented in SSL test</technical_language>

Target:
@Override protected void beforeTest() throws Exception { super.beforeTest(); if (USE_TEST_CLUSTER && zkCluster == null) { zkCluster = ZookeeperDiscoverySpiTestUtil.createTestingCluster(ZK_SRVS, clusterCustomProperties()); zkCluster.start(); waitForZkClusterReady(zkCluster); } reset(); }
Source:
<code>public ChaosHarlequinEffect() { super(Outcome.Benefit); <START> this.staticText = "Exile the top card of your library. If that card is a land card, Chaos Harlequin gets -4/-0 until end of turn. Otherwise, Chaos Harlequin gets +2/+0 until end of turn"; <END> }</code><technical_language>{this} in place of name</technical_language>

Target:
public ChaosHarlequinEffect() { super(Outcome.Benefit); this.staticText = "Exile the top card of your library. If that card is a land card, {this} gets -4/-0 until end of turn. Otherwise, {this} gets +2/+0 until end of turn"; }
Source:
<code>public void writeReport(final File output, final List<Header> headers) { final MetricsFile<SamComparisonMetric, ?> comparisonMetricFile = new MetricsFile<>(); <START> for (final Header h : headers) { <END> comparisonMetricFile.addHeader(h); } comparisonMetricFile.addAllMetrics(Collections.singletonList(comparisonMetric)); comparisonMetricFile.write(output); }</code><technical_language>replaced headers.forEach(comparisonMetricFile::addHeader);</technical_language>

Target:
public void writeReport(final File output, final List<Header> headers) { final MetricsFile<SamComparisonMetric, ?> comparisonMetricFile = new MetricsFile<>(); headers.forEach(comparisonMetricFile::addHeader); comparisonMetricFile.addAllMetrics(Collections.singletonList(comparisonMetric)); comparisonMetricFile.write(output); }
Source:
<code>public static boolean accept(Project project, File parent, File file) { try { File f1 = parent.getCanonicalFile(); File f2 = file.getCanonicalFile(); if (f2.equals(f1)) { <START> LOGGER.log(Level.INFO, "Skipping links to itself...: {0} {1}", <END> new Object[]{parent.getAbsolutePath(), file.getAbsolutePath()}); return false; } File t1 = f1; while ((t1 = t1.getParentFile()) != null) { if (f2.equals(t1)) { LOGGER.log(Level.INFO, "Skipping links to parent...: {0} {1}", new Object[]{parent.getAbsolutePath(), file.getAbsolutePath()}); return false; } } return accept(project, file); } catch (IOException ex) { LOGGER.log(Level.WARNING, "Failed to resolve name: {0} {1}", new Object[]{parent.getAbsolutePath(), file.getAbsolutePath()}); } return false; }</code><technical_language>messages self-explanatory (i.e. clear strings)</technical_language>

Target:
public static boolean accept(Project project, File parent, File file) { try { File f1 = parent.getCanonicalFile(); File f2 = file.getCanonicalFile(); if (f2.equals(f1)) { LOGGER.log(Level.INFO, "Skipping links to itself...: link '{1}' -> '{0}'", new Object[]{parent.getAbsolutePath(), file.getAbsolutePath()}); return false; } File t1 = f1; while ((t1 = t1.getParentFile()) != null) { if (f2.equals(t1)) { LOGGER.log(Level.INFO, "Skipping links to parent...: link '{1}' -> '{0}'", new Object[]{t1.getAbsolutePath(), file.getAbsolutePath()}); return false; } } return accept(project, file); } catch (IOException ex) { LOGGER.log(Level.WARNING, "Failed to resolve name: parent '{0}' file '{1}'", new Object[]{parent.getAbsolutePath(), file.getAbsolutePath()}); } return false; }
Source:
<code>public String getLog() throws IOException { <START> return FileIO.toString("myrobotlab.log"); <END> }</code><technical_language>log file name pulled out a constant, alternatively, a member variable override if wanted</technical_language>

Target:
public String getLog() throws IOException { return FileIO.toString(MYROBOTLAB_LOG); }
Source:
<code>public static Set<IAnalysisParameterProvider> getParameterProvidersForModule(IAnalysisModule module, ITmfTrace trace) { Set<IAnalysisParameterProvider> providerSet = TmfAnalysisParameterProviders.getParameterProvidersFor(module.getId()); synchronized (fParameterProviders) { if (!fParameterProviders.containsKey(module.getId())) { return providerSet; } List<Class<? extends IAnalysisParameterProvider>> parameterProviders = checkNotNull(fParameterProviders.get(module.getId())); for (Class<? extends IAnalysisParameterProvider> providerClass : parameterProviders) { try { IAnalysisParameterProvider provider = fParamProviderInstances.get(providerClass); if (provider == null) { provider = <START> providerClass.getConstructor().newInstance(); <END> fParamProviderInstances.put(providerClass, provider); } if (provider.appliesToTrace(trace)) { providerSet.add(provider); } } catch (IllegalArgumentException | SecurityException | InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { Activator.logError(Messages.TmfAnalysisManager_ErrorParameterProvider, e); } } } return Collections.unmodifiableSet(providerSet); }</code><technical_language>external @NonNull annotation</technical_language>

Target:
public static Set<IAnalysisParameterProvider> getParameterProvidersForModule(IAnalysisModule module, ITmfTrace trace) { Set<IAnalysisParameterProvider> providerSet = TmfAnalysisParameterProviders.getParameterProvidersFor(module.getId()); synchronized (fParameterProviders) { if (!fParameterProviders.containsKey(module.getId())) { return providerSet; } List<Class<? extends IAnalysisParameterProvider>> parameterProviders = checkNotNull(fParameterProviders.get(module.getId())); for (Class<? extends IAnalysisParameterProvider> providerClass : parameterProviders) { try { @Nullable IAnalysisParameterProvider provider = fParamProviderInstances.get(providerClass); if (provider == null) { provider = providerClass.getConstructor().newInstance(); fParamProviderInstances.put(providerClass, provider); } if (provider.appliesToTrace(trace)) { providerSet.add(provider); } } catch (IllegalArgumentException | SecurityException | InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { Activator.logError(Messages.TmfAnalysisManager_ErrorParameterProvider, e); } } } return Collections.unmodifiableSet(providerSet); }
Source:
<code>public static String formatAnnotation(Annotation a) { String annoName = a.def().name.substring(a.def().name.lastIndexOf('.') + 1); if (a.fieldValues.isEmpty()) { return "@" + annoName; } <START> StringJoiner sj = new StringJoiner(",", "@" + annoName + "(", ")"); <END> for (Map.Entry<String, Object> f : a.fieldValues.entrySet()) { AnnotationFieldType aft = a.def().fieldTypes.get(f.getKey()); sj.add(f.getKey() + "=" + IndexFileWriter.formatAnnotationValue(aft, f.getValue())); } return sj.toString(); }</code><technical_language>is space comma? annotations more readable</technical_language>

Target:
public static String formatAnnotation(Annotation a) { String fullAnnoName = a.def().name; String simpleAnnoName = fullAnnoName.substring(fullAnnoName.lastIndexOf('.') + 1); if (a.fieldValues.isEmpty()) { return "@" + simpleAnnoName; } StringJoiner sj = new StringJoiner(", ", "@" + simpleAnnoName + "(", ")"); for (Map.Entry<String, Object> f : a.fieldValues.entrySet()) { AnnotationFieldType aft = a.def().fieldTypes.get(f.getKey()); sj.add(f.getKey() + "=" + IndexFileWriter.formatAnnotationValue(aft, f.getValue())); } return sj.toString(); }
Source:
<code>public TypeBinding getEquivalentOuterVariable(InferenceVariable variable, InferenceVariable[] outerVariables) { ThreeSets three = this.boundsPerVariable.get(variable); if (three != null) { for (TypeBound bound : three.sameBounds) { for (InferenceVariable iv : outerVariables) if (TypeBinding.equalsEquals(bound.right, iv)) return iv; } } for (InferenceVariable iv : outerVariables) { three = this.boundsPerVariable.get(iv); if <START> (three != null) <END> { for (TypeBound bound : three.sameBounds) if (TypeBinding.equalsEquals(bound.right, variable)) return iv; } } return null; }</code><technical_language>IIRC, this needs changed three!=null&& three.sameBounds != null</technical_language>

Target:
public TypeBinding getEquivalentOuterVariable(InferenceVariable variable, InferenceVariable[] outerVariables) { ThreeSets three = this.boundsPerVariable.get(variable); if (three != null) { for (TypeBound bound : three.sameBounds) { for (InferenceVariable iv : outerVariables) if (TypeBinding.equalsEquals(bound.right, iv)) return iv; } } for (InferenceVariable iv : outerVariables) { three = this.boundsPerVariable.get(iv); if (three != null && three.sameBounds != null) { for (TypeBound bound : three.sameBounds) if (TypeBinding.equalsEquals(bound.right, variable)) return iv; } } return null; }
Source:
<code>public ChargeQueryResponse queryPaymentStatus(ChargeEntity charge) { try { GatewayClient.Response response = authoriseClient.postRequestFor(ROUTE_FOR_QUERY_ORDER, charge.getGatewayAccount(), buildQueryOrderRequestFor(charge)); GatewayResponse<EpdqQueryResponse> epdqGatewayResponse = getEpdqGatewayResponse(response, EpdqQueryResponse.class); <START> if (!epdqGatewayResponse.getBaseResponse().isPresent()) epdqGatewayResponse.throwGatewayError(); <END> return toChargeQueryResponse(epdqGatewayResponse.getBaseResponse().get()); } catch (GenericGatewayErrorException | GatewayConnectionTimeoutErrorException | GatewayConnectionErrorException e) { throw new WebApplicationException("Things went wrong"); } }</code><technical_language>deliberately mapping Optionals - is a reason for this? This bit fine return epdqGatewayResponse.getBaseResponse() .map(EpdqQueryResponse::toChargeQueryResponse) .orElseThrow(() -> new WebApplicationException("Things wrong")); it</technical_language>

Target:
public ChargeQueryResponse queryPaymentStatus(ChargeEntity charge) { try { GatewayClient.Response response = authoriseClient.postRequestFor(ROUTE_FOR_QUERY_ORDER, charge.getGatewayAccount(), buildQueryOrderRequestFor(charge)); GatewayResponse<EpdqQueryResponse> epdqGatewayResponse = getEpdqGatewayResponse(response, EpdqQueryResponse.class); return epdqGatewayResponse.getBaseResponse() .map(EpdqQueryResponse::toChargeQueryResponse) .orElseThrow(() -> new WebApplicationException("Things went wrong")); } catch (GatewayErrorException e) { throw new WebApplicationException("Things went wrong"); } }
Source:
<code>public void testToImmutable() { MatchingFrame frame = new MatchingFrame(arity); for (int i=0; i<arity; ++i) { frame.set(i, values[i]); } Tuple tuple = Tuples.flatTupleOf(values); Tuple tupleFromTuple = tuple.toImmutable(); <START> Tuple tupleFromFrame = tuple.toImmutable(); <END> assertTrue("equality tuple", Objects.equals(tuple, tupleFromTuple)); assertTrue("equality tuple", Objects.equals(tupleFromTuple, tuple)); assertTrue("equality frame", Objects.equals(frame, tupleFromFrame)); assertTrue("equality frame", Objects.equals(tupleFromFrame, frame)); if (arity > 0) { frame.setValue(0, "x"); assertFalse("equality frame", Objects.equals(frame, tupleFromFrame)); assertFalse("equality frame", Objects.equals(tupleFromFrame, frame)); } }</code><technical_language>copy-paste bug, frame.toImmutable()</technical_language>

Target:
public void testToImmutable() { MatchingFrame frame = new MatchingFrame(arity); for (int i=0; i<arity; ++i) { frame.set(i, values[i]); } Tuple tuple = Tuples.flatTupleOf(values); Tuple tupleFromTuple = tuple.toImmutable(); Tuple tupleFromFrame = frame.toImmutable(); assertTrue("equality tuple", Objects.equals(tuple, tupleFromTuple)); assertTrue("equality tuple", Objects.equals(tupleFromTuple, tuple)); assertTrue("equality frame", Objects.equals(frame, tupleFromFrame)); assertTrue("equality frame", Objects.equals(tupleFromFrame, frame)); if (arity > 0) { frame.setValue(0, "x"); assertFalse("equality frame", Objects.equals(frame, tupleFromFrame)); assertFalse("equality frame", Objects.equals(tupleFromFrame, frame)); } }
Source:
<code>DictionaryMergeIterator(Indexed<String>[] dimValueLookups, boolean useDirect) { final Ordering<String> stringOrdering = Comparators.naturalNullsFirst(); pQueue = new PriorityQueue<>( dimValueLookups.length, (lhs, rhs) -> stringOrdering.compare(lhs.rhs.peek(), rhs.rhs.peek()) ); conversions = new IntBuffer[dimValueLookups.length]; for (int i = 0; i < conversions.length; i++) { if (dimValueLookups[i] == null) { continue; } Indexed<String> indexed = dimValueLookups[i]; if (useDirect) { int allocationSize = indexed.size() * Ints.BYTES; log.info("Allocating dictionary merging direct buffer with size[%,d]", allocationSize); final ByteBuffer conversionDirectBuffer = ByteBuffer.allocateDirect(allocationSize); conversions[i] = conversionDirectBuffer.asIntBuffer(); directBufferAllocations.add(new Pair<>(conversionDirectBuffer, allocationSize)); } else { conversions[i] = IntBuffer.allocate(indexed.size()); } final PeekingIterator<String> iter = Iterators.peekingIterator( Iterators.transform( indexed.iterator(), <START> input -> NullHandling.nullToEmptyIfNeeded(input) <END> ) ); if (iter.hasNext()) { pQueue.add(Pair.of(i, iter)); } } }</code><technical_language>method ref</technical_language>

Target:
DictionaryMergeIterator(Indexed<String>[] dimValueLookups, boolean useDirect) { final Ordering<String> stringOrdering = Comparators.naturalNullsFirst(); pQueue = new PriorityQueue<>( dimValueLookups.length, (lhs, rhs) -> stringOrdering.compare(lhs.rhs.peek(), rhs.rhs.peek()) ); conversions = new IntBuffer[dimValueLookups.length]; for (int i = 0; i < conversions.length; i++) { if (dimValueLookups[i] == null) { continue; } Indexed<String> indexed = dimValueLookups[i]; if (useDirect) { int allocationSize = indexed.size() * Integer.BYTES; log.info("Allocating dictionary merging direct buffer with size[%,d]", allocationSize); final ByteBuffer conversionDirectBuffer = ByteBuffer.allocateDirect(allocationSize); conversions[i] = conversionDirectBuffer.asIntBuffer(); directBufferAllocations.add(new Pair<>(conversionDirectBuffer, allocationSize)); } else { conversions[i] = IntBuffer.allocate(indexed.size()); } final PeekingIterator<String> iter = Iterators.peekingIterator( Iterators.transform( indexed.iterator(), NullHandling::nullToEmptyIfNeeded ) ); if (iter.hasNext()) { pQueue.add(Pair.of(i, iter)); } } }
Source:
<code>public Set<VmDeviceGeneralType> getDeviceTypesWithProperties(Version version) { if (!FeatureSupported.deviceCustomProperties(version)) { return Collections.emptySet(); } <START> Set<VmDeviceGeneralType> types; <END> EnumMap<VmDeviceGeneralType, Map<String, Pattern>> map = deviceProperties.get(version); if (map.isEmpty()) { types = Collections.emptySet(); } else { types = Collections.unmodifiableSet(map.keySet()); } return types; }</code><technical_language>a matter of taste - types avoided for sake of return statements if-else block</technical_language>

Target:
public Set<VmDeviceGeneralType> getDeviceTypesWithProperties(Version version) { if (!FeatureSupported.deviceCustomProperties(version)) { return Collections.emptySet(); } EnumMap<VmDeviceGeneralType, Map<String, Pattern>> map = deviceProperties.get(version); if (map.isEmpty()) { return Collections.emptySet(); } else { return Collections.unmodifiableSet(map.keySet()); } }
Source:
<code>private static void assertGetResult(VmTemplate result) { assertNotNull(result); assertEquals(EXISTING_TEMPLATE_ID, result.getId()); <START> assertEquals("Template generation wasn't loaded as expected", new Long(1), result.getDbGeneration()); <END> }</code><technical_language>Long.valueOf(1)</technical_language>

Target:
private static void assertGetResult(VmTemplate result) { assertNotNull(result); assertEquals(EXISTING_TEMPLATE_ID, result.getId()); assertTrue("Template generation wasn't loaded as expected", result.getDbGeneration() == 1); }
Source:
<code>private void awaitInternal(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (jobClient == null) { return; } ExecutorService executor = Executors.newFixedThreadPool( <START> 1, new ThreadFactoryBuilder().setNameFormat("TableResult-await-thread").build()); <END> try { CompletableFuture<Void> future = CompletableFuture.runAsync(() -> { while (!data.isFirstRowReady()) { try { Thread.sleep(100); } catch (InterruptedException e) { throw new TableException("Thread is interrupted"); } } }, executor); if (timeout >= 0) { future.get(timeout, unit); } else { future.get(); } } finally { executor.shutdown(); } }</code><technical_language>avoid guava</technical_language>

Target:
private void awaitInternal(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (jobClient == null) { return; } ExecutorService executor = Executors.newFixedThreadPool(1, r -> new Thread(r, "TableResult-await-thread")); try { CompletableFuture<Void> future = CompletableFuture.runAsync(() -> { while (!data.isFirstRowReady()) { try { Thread.sleep(100); } catch (InterruptedException e) { throw new TableException("Thread is interrupted"); } } }, executor); if (timeout >= 0) { future.get(timeout, unit); } else { future.get(); } } finally { executor.shutdown(); } }
Source:
<code>public Quota getUnlimitedQuota(storage_pool storagePool, boolean isDefaultQuota) { if (storagePool == null || storagePool.getId() == null) { log.error("Unlimited Quota cannot be created, Storage pool is not valid "); return null; } Quota quota = new Quota(); Guid quotaId = Guid.NewGuid(); quota.setId(quotaId); quota.setStoragePoolId(storagePool.getId()); quota.setQuotaName(getDefaultQuotaName(storagePool)); quota.setDescription("Automatic generated Quota for Data Center " + storagePool.getname()); quota.setThresholdVdsGroupPercentage(getIntegerConfig(ConfigValues.QuotaThresholdVdsGroup)); quota.setThresholdStoragePercentage(getIntegerConfig(ConfigValues.QuotaThresholdStorage)); quota.setGraceVdsGroupPercentage(getIntegerConfig(ConfigValues.QuotaGraceVdsGroup)); <START> quota.setGraceStoragePercentage(getIntegerConfig(ConfigValues.QuotaGraceStorage)); <END> quota.setIsDefaultQuota(isDefaultQuota); quota.setQuotaVdsGroups(new ArrayList<QuotaVdsGroup>()); quota.setQuotaStorages(new ArrayList<QuotaStorage>()); QuotaStorage quotaStorage = new QuotaStorage(); quotaStorage.setStorageSizeGB(UNLIMITED); quota.setGlobalQuotaStorage(quotaStorage); QuotaVdsGroup quotaVdsGroup = new QuotaVdsGroup(); quotaVdsGroup.setVirtualCpu(UNLIMITED.intValue()); quotaVdsGroup.setMemSizeMB(UNLIMITED); quota.setGlobalQuotaVdsGroup(quotaVdsGroup); return quota; }</code><technical_language>If decided refactor it,it great if refactor methods. useful on. BTW Consider adding getIntegerConfig other method types Config class maybe, more cleaner Config.<Integer> GetValue, clean code in places</technical_language>

Target:
public Quota getUnlimitedQuota(storage_pool storagePool, boolean isDefaultQuota) { if (storagePool == null || storagePool.getId() == null) { log.error("Unlimited Quota cannot be created, Storage pool is not valid "); return null; } Quota quota = new Quota(); Guid quotaId = Guid.NewGuid(); quota.setId(quotaId); quota.setStoragePoolId(storagePool.getId()); quota.setQuotaName(getDefaultQuotaName(storagePool)); quota.setDescription("Automatic generated Quota for Data Center " + storagePool.getname()); quota.setThresholdVdsGroupPercentage(getQuotaThresholdVdsGroup()); quota.setThresholdStoragePercentage(getQuotaThresholdStorage()); quota.setGraceVdsGroupPercentage(getQuotaGraceVdsGroup()); quota.setGraceStoragePercentage(getQuotaGraceStorage()); quota.setIsDefaultQuota(isDefaultQuota); quota.setQuotaVdsGroups(new ArrayList<QuotaVdsGroup>()); quota.setQuotaStorages(new ArrayList<QuotaStorage>()); QuotaStorage quotaStorage = new QuotaStorage(); quotaStorage.setStorageSizeGB(UNLIMITED); quota.setGlobalQuotaStorage(quotaStorage); QuotaVdsGroup quotaVdsGroup = new QuotaVdsGroup(); quotaVdsGroup.setVirtualCpu(UNLIMITED.intValue()); quotaVdsGroup.setMemSizeMB(UNLIMITED); quota.setGlobalQuotaVdsGroup(quotaVdsGroup); return quota; }
Source:
<code>protected void onFinishInflate() { super.onFinishInflate(); View.inflate(getContext(), R.layout.merge_server_declaration, this); final EditText serverAddressDeclaration = Views.findById(this, R.id.bot_server_declaration); View connectToServer = Views.findById(this, R.id.bot_server_connect); connectToServer.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { <START> String serverAddress = String.valueOf(serverAddressDeclaration.getText()); <END> serverDeclarationListener.onConnect(serverAddress); } }); }</code><technical_language>I serverAddressDeclaration.getText().toString() instead</technical_language>

Target:
protected void onFinishInflate() { super.onFinishInflate(); View.inflate(getContext(), R.layout.merge_server_declaration, this); final EditText serverAddressDeclaration = Views.findById(this, R.id.bot_server_declaration); View connectToServer = Views.findById(this, R.id.bot_server_connect); connectToServer.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { String serverAddress = serverAddressDeclaration.getText().toString(); serverDeclarationListener.onConnect(serverAddress); } }); }
Source:
<code><START> protected DocumentModel captureAndVerifyAnnotationEventNotification(Supplier<DocumentModel> supplier, <END> String annotationEventType, String documentEventType) { try (CapturingEventListener listener = new CapturingEventListener(annotationEventType, documentEventType)) { DocumentModel annotationDocumentModel = supplier.get(); DocumentModel annotationParentDocumentModel = session.getDocument(new IdRef( (String) annotationDocumentModel.getPropertyValue(COMMENT_PARENT_ID))); transactionalFeature.nextTransaction(); assertTrue(listener.hasBeenFired(annotationEventType)); assertTrue(listener.hasBeenFired(documentEventType)); List<Event> handledEvents = listener.getCapturedEvents() .stream() .filter(e -> annotationEventType.equals(e.getName())) .collect(Collectors.toList()); assertEquals(1, handledEvents.size()); Event expectedEvent = handledEvents.get(0); assertEquals(annotationEventType, expectedEvent.getName()); checkDocumentEventContext(expectedEvent, annotationDocumentModel, annotationParentDocumentModel, annotatedDocumentModel); checkReceivedMail(emailsResult.getMails(), annotationDocumentModel, annotatedDocumentModel, handledEvents.get(0), annotationEventType); return annotationDocumentModel; } }</code><technical_language>anymore indeed. I version of test</technical_language>

Target:
protected void captureAndVerifyAnnotationEventNotification(Supplier<DocumentModel> supplier, String annotationEventType, String documentEventType) { try (CapturingEventListener listener = new CapturingEventListener(annotationEventType, documentEventType)) { DocumentModel annotationDocumentModel = supplier.get(); DocumentModel annotationParentDocumentModel = session.getDocument(new IdRef( (String) annotationDocumentModel.getPropertyValue(COMMENT_PARENT_ID))); transactionalFeature.nextTransaction(); assertTrue(listener.hasBeenFired(annotationEventType)); assertTrue(listener.hasBeenFired(documentEventType)); List<Event> handledEvents = listener.getCapturedEvents() .stream() .filter(e -> annotationEventType.equals(e.getName())) .collect(Collectors.toList()); assertEquals(1, handledEvents.size()); Event expectedEvent = handledEvents.get(0); assertEquals(annotationEventType, expectedEvent.getName()); checkDocumentEventContext(expectedEvent, annotationDocumentModel, annotationParentDocumentModel, annotatedDocumentModel); checkReceivedMail(emailsResult.getMails(), annotationDocumentModel, annotatedDocumentModel, handledEvents.get(0), annotationEventType); } }
Source:
<code>public void setValue(String value) { this.fValue = value; fValueNumber = null; fValueTimestamp = null; if (value == null) { return; } if (fType == Type.NUM) { try { fValueNumber = NumberFormat.getInstance().parse(value).doubleValue(); } catch (ParseException e) { } } else if (fType == Type.TIMESTAMP) { try { <START> fValueTimestamp = new TmfNanoTimestamp((long) (1E9 * NumberFormat.getInstance().parse(value.toString()).doubleValue())); <END> } catch (ParseException e) { } } }</code><technical_language>is problem precision. I tested 1410354493.260164474 fValueTimestamp resulted a TmfNanoTimesatmp fValue=1410354493260164608 scale -9. So, compare filter for equal find exact timestamp of this</technical_language>

Target:
public void setValue(String value) { this.fValue = value; fValueNumber = null; fValueTimestamp = null; if (value == null) { return; } if (fType == Type.NUM) { try { fValueNumber = NumberFormat.getInstance().parse(value).doubleValue(); } catch (ParseException e) { } } else if (fType == Type.TIMESTAMP) { try { fValueTimestamp = new TmfNanoTimestamp(fTimestampFormat.parseValue(value.toString())); } catch (ParseException e) { } } }
Source:
<code>private PluginDescriptor getPluginDescriptor(JSONObject p, String pluginName) { String pluginDescription = p.get("pluginDescription").isString().stringValue(); PluginDescriptor desc = new PluginDescriptor(pluginName, pluginDescription); JSONArray fields = p.get("configurableFields").isArray(); for (int j = 0; j < fields.size(); j++) { JSONObject field = fields.get(j).isObject(); String name = field.get("name").isString().stringValue(); <START> String value = field.get("value").isString().stringValue(); <END> JSONObject meta = field.get("meta").isObject(); String metaType = meta.get("type").isString().stringValue(); String descr = meta.get("description").isString().stringValue(); boolean pass = false; boolean cred = false; boolean file = false; if (metaType.equalsIgnoreCase("password")) pass = true; else if (metaType.equalsIgnoreCase("fileBrowser")) file = true; else if (metaType.equalsIgnoreCase("credential")) cred = true; Field f = new Field(name, value, descr, pass, cred, file); desc.getConfigurableFields().add(f); } return desc; }</code><technical_language>Is safe if is empty</technical_language>

Target:
private PluginDescriptor getPluginDescriptor(JSONObject p, String pluginName) { String pluginDescription = p.get("pluginDescription").isString().stringValue(); PluginDescriptor desc = new PluginDescriptor(pluginName, pluginDescription); JSONArray fields = p.get("configurableFields").isArray(); for (int j = 0; j < fields.size(); j++) { JSONObject field = fields.get(j).isObject(); String name = field.get("name").isString().stringValue(); String value = field.get("value").isString().stringValue(); JSONObject meta = field.get("meta").isObject(); String metaType = meta.get("type").isString().stringValue(); String descr = meta.get("description").isString().stringValue(); boolean password = false; boolean credentials = false; boolean file = false; if (metaType.equalsIgnoreCase("password")) password = true; else if (metaType.equalsIgnoreCase("fileBrowser")) file = true; else if (metaType.equalsIgnoreCase("credential")) credentials = true; Field f = new Field(name, value, descr, password, credentials, file); desc.getConfigurableFields().add(f); } return desc; }
Source:
<code>public void loadUserWhenUserInfoSuccessResponseThenReturnUser() { String userInfoResponse = "{\n" + " \"id\": \"12345\",\n" + " \"name\": \"first last\",\n" + " \"login\": \"user1\",\n" + " \"email\": \"user1@example.com\"\n" + "}\n"; this.server.enqueue(jsonResponse(userInfoResponse)); String userInfoUri = this.server.url("/user").toString(); ClientRegistration clientRegistration = this.clientRegistrationBuilder .userInfoUri(userInfoUri).build(); OAuth2User user = this.userService.loadUser(new OAuth2UserRequest(clientRegistration, this.accessToken)); assertThat(user.getName()).isEqualTo("first last"); assertThat(user.getAttributes().size()).isEqualTo(4); <START> assertThat((Object) user.getAttribute("id")).isEqualTo("12345"); <END> assertThat((Object) user.getAttribute("name")).isEqualTo("first last"); assertThat((Object) user.getAttribute("login")).isEqualTo("user1"); assertThat((Object) user.getAttribute("email")).isEqualTo("user1@example.com"); assertThat(user.getAuthorities().size()).isEqualTo(1); assertThat(user.getAuthorities().iterator().next().getAuthority()).isEqualTo("ROLE_USER"); }</code><technical_language>Change Object String</technical_language>

Target:
public void loadUserWhenUserInfoSuccessResponseThenReturnUser() { String userInfoResponse = "{\n" + " \"id\": \"12345\",\n" + " \"name\": \"first last\",\n" + " \"login\": \"user1\",\n" + " \"email\": \"user1@example.com\"\n" + "}\n"; this.server.enqueue(jsonResponse(userInfoResponse)); String userInfoUri = this.server.url("/user").toString(); ClientRegistration clientRegistration = this.clientRegistrationBuilder .userInfoUri(userInfoUri).build(); OAuth2User user = this.userService.loadUser(new OAuth2UserRequest(clientRegistration, this.accessToken)); assertThat(user.getName()).isEqualTo("first last"); assertThat(user.getAttributes().size()).isEqualTo(4); assertThat((String) user.getAttribute("id")).isEqualTo("12345"); assertThat((String) user.getAttribute("name")).isEqualTo("first last"); assertThat((String) user.getAttribute("login")).isEqualTo("user1"); assertThat((String) user.getAttribute("email")).isEqualTo("user1@example.com"); assertThat(user.getAuthorities().size()).isEqualTo(1); assertThat(user.getAuthorities().iterator().next().getAuthority()).isEqualTo("ROLE_USER"); }
Source:
<code>public void testUpdate() throws Exception { setUpEntityQueryExpectations(1, false); setUpEntityQueryExpectations(1, true); setUpVDSGroupExpectations(GUIDS[1]); setUriInfo(setUpActionExpectations(VdcActionType.UpdateNetworkOnCluster, NetworkClusterAttachmentParameters.class, new String[] {}, new Object[] {}, true, true)); <START> verifyUpdate(resource.update(getModel(0)), 0); <END> }</code><technical_language>please add newly updatable fields expectation & verification</technical_language>

Target:
public void testUpdate() throws Exception { setUpEntityQueryExpectations(1, false); setUpEntityQueryExpectations(1, true); setUpVDSGroupExpectations(GUIDS[1]); setUriInfo(setUpActionExpectations(VdcActionType.UpdateNetworkOnCluster, NetworkClusterParameters.class, new String[] {}, new Object[] {}, true, true)); verifyUpdate(resource.update(getModel(0)), 0); }
Source:
<code>public void testObserver() throws Exception { try { final EntityManagerFactory emf = Persistence.createEntityManagerFactory( "jpajtastandalone-datastoreobserver" ); Assert.fail( "StartStoppable provider not executed" ); } catch (RuntimeException e) { <START> boolean found = false; <END> Throwable cause = e; do { if ( cause.getMessage().equals( "STARTED!" ) ) { break; } cause = cause.getCause(); } while ( cause != null ); if ( cause == null ) { Assert.fail( "StartStoppable proviTder not executed" ); } } }</code><technical_language>Is variable used</technical_language>

Target:
public void testObserver() throws Exception { try { final EntityManagerFactory emf = Persistence.createEntityManagerFactory( "jpajtastandalone-datastoreobserver" ); Assert.fail( "StartStoppable provider not executed" ); } catch (RuntimeException e) { Throwable cause = e; do { if ( cause.getMessage().equals( "STARTED!" ) ) { break; } cause = cause.getCause(); } while ( cause != null ); if ( cause == null ) { Assert.fail( "StartStoppable provider not executed" ); } } }
Source:
<code>public Connector tagImageActionName() { return integrationContext -> { Map<String, Object> inBoundVariables = integrationContext.getInBoundVariables(); System.out.println("tagImageActionName inbound variables keys: " + inBoundVariables.keySet()); System.out.println("tagImageActionName inbound variables values: " + inBoundVariables.values()); <START> <END> boolean expectedValue = (Boolean) inBoundVariables.get("expectedKey"); integrationContext.addOutBoundVariable("approved", expectedValue); assertThat(((String) inBoundVariables.get("input-variable-name-2"))).isEqualTo("input-variable-name-2"); return integrationContext; }; }</code><technical_language>a logger instead of System.out</technical_language>

Target:
public Connector tagImageActionName() { return integrationContext -> { Map<String, Object> inBoundVariables = integrationContext.getInBoundVariables(); LOGGER.info("tagImageActionName inbound variables keys: " + inBoundVariables.keySet()); LOGGER.info("tagImageActionName inbound variables values: " + inBoundVariables.values()); boolean expectedValue = (Boolean) inBoundVariables.get("expectedKey"); integrationContext.addOutBoundVariable("approved", expectedValue); assertThat(((String) inBoundVariables.get("input-variable-name-2"))).isEqualTo("input-variable-name-2"); return integrationContext; }; }
Source:
<code>private List<InternalJob> loadJobs(final boolean fullState, final Collection<JobStatus> status, final long period) { return executeReadOnlyTransaction(session -> { logger.info("Loading Jobs from database"); Query query; <START> if (period > 0) { <END> query = session.getNamedQuery("loadJobsWithPeriod") .setParameter("minSubmittedTime", System.currentTimeMillis() - period) .setParameterList("status", status) .setReadOnly(true); } else { query = session.getNamedQuery("loadJobs").setParameterList("status", status).setReadOnly(true); } List<Long> ids = query.list(); logger.info(ids.size() + " Jobs to fetch from database"); return loadInternalJobs(fullState, session, ids); }); }</code><technical_language>This called periodInMilliseconds</technical_language>

Target:
private List<InternalJob> loadJobs(final boolean fullState, final Collection<JobStatus> status, final long period) { return executeReadOnlyTransaction(session -> { logger.info("Loading Jobs from database"); Query query; if (period > 0L) { query = session.getNamedQuery("loadJobsWithPeriod") .setParameter("minSubmittedTime", System.currentTimeMillis() - period) .setParameterList("status", status) .setReadOnly(true); } else { query = session.getNamedQuery("loadJobs").setParameterList("status", status).setReadOnly(true); } List<Long> ids = query.list(); logger.info(ids.size() + " Jobs to fetch from database"); return loadInternalJobs(fullState, session, ids); }); }
Source:
<code><START> public String process(String query) { <END> _logger.info("Processing query: {}", query); try { URI uri = new URI(query); String path = getPath(query, _logger); if (path != null && path.equalsIgnoreCase(DiagnosticsRequestType.DATASTREAM_STATE.toString())) { return processDatastreamStateRequest(uri); } else { _logger.error("Could not process query with path {}", query, path); } } catch (Exception e) { _logger.error("Failed to process query {}", query, e); } return null; }</code><technical_language>nit: want rename processDiagnostic imply this method handles diagnostic related queries</technical_language>

Target:
public String process(String query) { _logger.info("Processing query: {}", query); try { URI uri = new URI(query); String path = getPath(query, _logger); if (path != null && path.equalsIgnoreCase(DiagnosticsRequestType.DATASTREAM_STATE.toString())) { String response = processDatastreamStateRequest(uri); _logger.info("Query: returns response: {}", query, response); return response; } else { _logger.error("Could not process query with path {}", query, path); } } catch (Exception e) { _logger.error("Failed to process query {}", query, e); } return null; }
Source:
<code>private void assertRedirect(URI baseUri, HttpClient client, String path, String redirect) { HttpUriBuilder uriBuilder = uriBuilderFrom(baseUri); StringResponse response = client.execute( prepareGet() .setFollowRedirects(false) .setUri(uriBuilder.appendPath(path).build()) .build(), createStringResponseHandler()); assertEquals(response.getStatusCode(), HttpStatus.TEMPORARY_REDIRECT.code()); <START> assertEquals(response.getHeader("Location"), redirect); <END> assertNull(response.getHeader(CONTENT_TYPE), CONTENT_TYPE + " header should be absent"); assertEquals(response.getBody(), "", "Response body"); }</code><technical_language>HttpHeaders.LOCATION</technical_language>

Target:
private void assertRedirect(URI baseUri, HttpClient client, String path, String redirect) { HttpUriBuilder uriBuilder = uriBuilderFrom(baseUri); StringResponse response = client.execute( prepareGet() .setFollowRedirects(false) .setUri(uriBuilder.appendPath(path).build()) .build(), createStringResponseHandler()); assertEquals(response.getStatusCode(), HttpStatus.TEMPORARY_REDIRECT.code()); assertEquals(response.getHeader(LOCATION), redirect); assertNull(response.getHeader(CONTENT_TYPE), CONTENT_TYPE + " header should be absent"); assertEquals(response.getBody(), "", "Response body"); }
Source:
<code>public void testEstimatedAndSplitForLargeTable() throws Exception { TableName tableName = newTestTableName(); try (Admin admin = connection.getAdmin()) { admin.createTable( new HTableDescriptor(tableName).addFamily(new HColumnDescriptor(COLUMN_FAMILY))); try (BufferedMutator mutator = connection.getBufferedMutator(tableName)) { for (int i = 0; i < 1000; i++ ) { mutator.mutate( new Put(Bytes.toBytes("row" + i)) .addColumn(COLUMN_FAMILY, QUALIFIER1, getLargeValue())); } } List<SampleRowKeysResponse> sampleRowKeys = getSampleKeys(tableName); try { CloudBigtableIO.Source source = new CloudBigtableIO.Source(new CloudBigtableScanConfiguration( projectId, zoneId, clusterId, tableName.getQualifierAsString(), new Scan())); long estimatedSizeBytes = source.getEstimatedSizeBytes(null); SampleRowKeysResponse lastSample = sampleRowKeys.get(sampleRowKeys.size() - 1); Assert.assertEquals(lastSample.getOffsetBytes(), estimatedSizeBytes); List<SourceWithKeys> bundles = source.splitIntoBundles(sampleRowKeys.get(0).getOffsetBytes() / 2, null); END_ROW key, which cannot be split. <START> Assert.assertEquals(sampleRowKeys.size() * 2 - 1, bundles.size()); <END> } finally { admin.deleteTable(tableName); } } }</code><technical_language>Check expected number of keys bundles</technical_language>

Target:
public void testEstimatedAndSplitForLargeTable() throws Exception { TableName tableName = newTestTableName(); try (Admin admin = connection.getAdmin()) { admin.createTable( new HTableDescriptor(tableName).addFamily(new HColumnDescriptor(COLUMN_FAMILY))); final int rowCount = 1000; try (BufferedMutator mutator = connection.getBufferedMutator(tableName)) { for (int i = 0; i < rowCount; i++ ) { mutator.mutate( new Put(Bytes.toBytes("row" + i)) .addColumn(COLUMN_FAMILY, QUALIFIER1, getLargeValue())); } } List<SampleRowKeysResponse> sampleRowKeys = getSampleKeys(tableName); try { BoundedSource<Result> source = CloudBigtableIO.read(new CloudBigtableScanConfiguration(projectId, zoneId, clusterId, tableName.getQualifierAsString(), new Scan())); long estimatedSizeBytes = source.getEstimatedSizeBytes(null); SampleRowKeysResponse lastSample = sampleRowKeys.get(sampleRowKeys.size() - 1); Assert.assertEquals(lastSample.getOffsetBytes(), estimatedSizeBytes); List<? extends BoundedSource<Result>> bundles = source.splitIntoBundles(sampleRowKeys.get(0).getOffsetBytes() / 2, null); END_ROW key, which cannot be split. Assert.assertEquals(sampleRowKeys.size() * 2 - 1, bundles.size()); int count = 0; for (BoundedSource<Result> bundle : bundles) { BoundedReader<Result> reader = bundle.createReader(null); reader.start(); while(reader.getCurrent() != null) { count++; reader.advance(); } reader.close(); } Assert.assertEquals(rowCount, count); } finally { admin.deleteTable(tableName); } } }
Source:
<code>static boolean shouldPublishImmediately(PostModel postModel) { boolean optionAvailable = shouldPublishImmediatelyOptionBeAvailable(postModel); Date pubDate = DateTimeUtils.dateFromIso8601(postModel.getDateCreated()); Date now = new Date(); <START> return optionAvailable && !pubDate.after(now); <END> }</code><technical_language>avoid creating Date objects returning false immediately if !shouldPublishImmediatelyOptionBeAvailable(postModel)</technical_language>

Target:
static boolean shouldPublishImmediately(PostModel postModel) { if (!shouldPublishImmediatelyOptionBeAvailable(postModel)) { return false; } Date pubDate = DateTimeUtils.dateFromIso8601(postModel.getDateCreated()); Date now = new Date(); return !pubDate.after(now); }
Source:
<code>public void stopWorkspace(String workspaceId, Map<String, String> options) throws ServerException, NotFoundException, ConflictException { requireNonNull(workspaceId, "Required non-null workspace id"); final WorkspaceImpl workspace = normalizeState(workspaceDao.get(workspaceId), true); if (!workspace.isTemporary()) { workspace.getAttributes().put(UPDATED_ATTRIBUTE_NAME, Long.toString(currentTimeMillis())); workspaceDao.update(workspace); } runtimes .stopAsync(workspace, options) .whenComplete( (aVoid, throwable) -> { if (workspace.isTemporary()) { <START> removeWorkspaceQuietly(workspace); <END> } }); }</code><technical_language>I need this check workspace state is STARTING / RUNNING update attributes try stop it</technical_language>

Target:
public void stopWorkspace(String workspaceId, Map<String, String> options) throws ServerException, NotFoundException, ConflictException { requireNonNull(workspaceId, "Required non-null workspace id"); final WorkspaceImpl workspace = normalizeState(workspaceDao.get(workspaceId), true); checkWorkspaceIsRunningOrStarting(workspace); if (!workspace.isTemporary()) { workspace.getAttributes().put(UPDATED_ATTRIBUTE_NAME, Long.toString(currentTimeMillis())); workspaceDao.update(workspace); } runtimes .stopAsync(workspace, options) .whenComplete( (aVoid, throwable) -> { if (workspace.isTemporary()) { removeWorkspaceQuietly(workspace); } }); }
Source:
<code>public void receiveCommand(String itemName, Command command) { logger.trace("receiveCommand({},{}) called.", itemName, command.toString()); if (this.eventPublisher == null) { <START> logger.error("receiveCommand(): eventPublisher is NULL. Should NEVER occur."); <END> return; } super.receiveCommand(itemName, command); }</code><technical_language>Revert WARN</technical_language>

Target:
public void receiveCommand(String itemName, Command command) { logger.trace("receiveCommand({},{}) called.", itemName, command.toString()); if (this.eventPublisher == null) { logger.warn("receiveCommand(): eventPublisher is NULL. Should NEVER occur."); return; } super.receiveCommand(itemName, command); }
Source:
<code>private DefaultRepositorySystemSession newRepositorySystemSession(RepositorySystem system, String localRepoPath) { DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession(); LocalRepository localRepo = new LocalRepository(localRepoPath); session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo)); session.setOffline(this.offline); if (isProxyEnabled()) { DefaultProxySelector proxySelector = new DefaultProxySelector(); Proxy proxy = new Proxy(proxyProperties.getProtocol(), proxyProperties.getHost(), <START> Integer.parseInt(proxyProperties.getPort()), authentication); <END> proxySelector.add(proxy, proxyProperties.getNonProxyHosts()); session.setProxySelector(proxySelector); } return session; }</code><technical_language>port property int in place</technical_language>

Target:
private DefaultRepositorySystemSession newRepositorySystemSession(RepositorySystem system, String localRepoPath) { DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession(); LocalRepository localRepo = new LocalRepository(localRepoPath); session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo)); session.setOffline(this.offline); if (isProxyEnabled()) { DefaultProxySelector proxySelector = new DefaultProxySelector(); Proxy proxy = new Proxy(proxyProperties.getProtocol(), proxyProperties.getHost(), proxyProperties.getPort(), authentication); proxySelector.add(proxy, proxyProperties.getNonProxyHosts()); session.setProxySelector(proxySelector); } return session; }
Source:
<code>public BooleanWrapper removeNode(String nodeUrl, Client initiator) { Node node = null; if (this.nodes.containsKey(nodeUrl)) { <START> logger.info("Remove node " + nodeUrl + " from node source " + this.name); <END> node = this.nodes.remove(nodeUrl); } else if (this.downNodes.containsKey(nodeUrl)) { logger.info("Remove down node " + nodeUrl + " from node source " + this.name); node = this.downNodes.remove(nodeUrl); } if (node == null) { logger.error("Node " + nodeUrl + " cannot be removed from node source " + this.name + " because it is not known"); return new BooleanWrapper(false); } else { RMCore.topologyManager.removeNode(node); try { this.infrastructureManager.internalRemoveNode(node); } catch (RMException e) { logger.error(e.getCause().getMessage(), e); } return new BooleanWrapper(true); } }</code><technical_language>I is node source logging semantic [nodesourceName]</technical_language>

Target:
public BooleanWrapper removeNode(String nodeUrl, Client initiator) { Node node = null; if (this.nodes.containsKey(nodeUrl)) { logger.info("[" + this.name + "] removing node: " + nodeUrl); node = this.nodes.remove(nodeUrl); } else if (this.downNodes.containsKey(nodeUrl)) { logger.info("[" + this.name + "] removing down node: " + nodeUrl); node = this.downNodes.remove(nodeUrl); } if (node == null) { logger.error("[" + this.name + "] cannot remove node: " + nodeUrl + " because it is unknown"); return new BooleanWrapper(false); } else { RMCore.topologyManager.removeNode(node); try { this.infrastructureManager.internalRemoveNode(node); } catch (RMException e) { logger.error(e.getCause().getMessage(), e); } return new BooleanWrapper(true); } }