auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>void highCollisionBroadcast(Control event) { if (System.currentTimeMillis() > lastHighCollisionBroadcast + minTimeBetweenBroadcast) { try { WebSocketBroadcast.Message message = WebSocketBroadcast.newMessage(getClass(), event); eventBus.post(message); <START> lastHighCollisionBroadcast = System.currentTimeMillis(); <END> log.warn("Sent high collision broadcast"); } catch (JsonProcessingException ex) { log.error("Unable to convert control message", ex); } } }</code><technical_language>assignment is threadsafe</technical_language>

Target:
void highCollisionBroadcast(Control event) { long now = System.currentTimeMillis(); long lastCheckTimeExpected = lastHighCollisionBroadcast.get(); if (now > lastCheckTimeExpected + minTimeBetweenBroadcast && lastHighCollisionBroadcast.compareAndSet(lastCheckTimeExpected, now)) { try { WebSocketBroadcast.Message message = WebSocketBroadcast.newMessage(getClass(), event); eventBus.post(message); log.warn("Sent high collision broadcast"); } catch (JsonProcessingException ex) { log.error("Unable to convert control message", ex); } } }
Source:
<code>protected Object parseValue(CommandSource source, CommandArgs args) throws ArgumentParseException { <START> return args.hasNext() ? this.element.parseValue(source, args) : this.value; <END> }</code><technical_language>this achieve? I this is called</technical_language>

Target:
protected Object parseValue(CommandSource source, CommandArgs args) throws ArgumentParseException { return args.hasNext() ? null : this.element.parseValue(source, args); }
Source:
<code>public Set<String> keySet() { final ImmutableSet.Builder<String> builder = ImmutableSet.builder(); <START> final ImmutableSet<String> keySet = ImmutableSet.copyOf(headers.keySet()); <END> for (final String key: keySet) { builder.add(toDecodedString(key)); } return builder.build(); }</code><technical_language>This copy ImmutableSet unnecessary. iterable keySet</technical_language>

Target:
public Set<String> keySet() { final ImmutableSet.Builder<String> builder = ImmutableSet.builder(); for (final String key: headers.keySet()) { builder.add(toDecodedString(key)); } return builder.build(); }
Source:
<code>public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } StorageDomainDynamic other = (StorageDomainDynamic) obj; return (ObjectUtils.objectsEqual(id, other.id) && ObjectUtils.objectsEqual(availableDiskSize, other.availableDiskSize) && ObjectUtils.objectsEqual(usedDiskSize, other.usedDiskSize) <START> && ObjectUtils.objectsEqual(externalStatus, other.externalStatus)); <END> }</code><technical_language>Objects.equals()</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } StorageDomainDynamic other = (StorageDomainDynamic) obj; return (ObjectUtils.objectsEqual(id, other.id) && ObjectUtils.objectsEqual(availableDiskSize, other.availableDiskSize) && ObjectUtils.objectsEqual(usedDiskSize, other.usedDiskSize) && Objects.equals(externalStatus, other.externalStatus)); }
Source:
<code>private void replaceTarget(String target, @StringRes int replacementRes, String url) { char[] currentPreambleChars = new char[mBuilder.length()]; mBuilder.getChars(0, mBuilder.length(), currentPreambleChars, 0); String currentPreamble = String.valueOf(currentPreambleChars); <START> int targetIndex = currentPreamble.indexOf(target); <END> if (targetIndex != -1) { String replacement = mContext.getString(replacementRes); mBuilder.replace(targetIndex, targetIndex + target.length(), replacement); int end = targetIndex + replacement.length(); mBuilder.setSpan(mLinkSpan, targetIndex, end, 0); mBuilder.setSpan(new CustomTabsSpan(url), targetIndex, end, 0); } }</code><technical_language>@TheCraftKid whoops, forgot mention I updated patch. Turns out SpannableStringBuilder#toString() method I of replaced mBuilder.toString().indexOf(target);</technical_language>

Target:
private void replaceTarget(String target, @StringRes int replacementRes, String url) { int targetIndex = mBuilder.toString().indexOf(target); if (targetIndex != -1) { String replacement = mContext.getString(replacementRes); mBuilder.replace(targetIndex, targetIndex + target.length(), replacement); int end = targetIndex + replacement.length(); mBuilder.setSpan(mLinkSpan, targetIndex, end, 0); mBuilder.setSpan(new CustomTabsSpan(url), targetIndex, end, 0); } }
Source:
<code>public boolean isModified() { <START> return this.modified || config.isModified() || configNaiveBayes.isModified() || configRandomForest.isModified() || configSVM.isModified(); <END> }</code><technical_language>getLogistic|NaiveBayes|...config()</technical_language>

Target:
public boolean isModified() { return this.modified || getLogisticRegressionConfiguration().isModified() || getNaiveBayesConfiguration().isModified() || getRandomForestConfiguration().isModified() || getSVMConfiguration().isModified(); }
Source:
<code>private void validateUpdateWipeAfterDelete(VMStatus status, boolean isFloating) { DiskImage disk = createDiskImage(); when(diskDao.get(diskImageGuid)).thenReturn(disk); command.getParameters().getDiskInfo().setWipeAfterDelete(true); <START> if (isFloating) { initializeCommand(); command.getParameters().setDiskVmElement(null); mockNullVm(); } else { initializeCommand(createVm(status)); } <END> ValidateTestUtils.runAndAssertValidateSuccess(command); }</code><technical_language>repeated in places, extracted a method</technical_language>

Target:
private void validateUpdateWipeAfterDelete(VMStatus status, boolean isFloating) { DiskImage disk = createDiskImage(); when(diskDao.get(diskImageGuid)).thenReturn(disk); command.getParameters().getDiskInfo().setWipeAfterDelete(true); initCommandForDisk(status, isFloating); ValidateTestUtils.runAndAssertValidateSuccess(command); }
Source:
<code>protected void setUp() throws Exception { sessionManagerListener = new SessionManagerListener.Stub() { @Override public void notify(Session updated, int notification) { super.notify(updated, notification); if (notification == SessionListener.OPENING) { ResourceSet resourceSet = session.getTransactionalEditingDomain().getResourceSet(); EList<Resource> resources = resourceSet.getResources(); for (Resource resource : resources) { <START> assertFalse("test.ecore semantic <END> resource is loaded at SessionListener.OPENING notification", resource.getURI().toString().contains(SEMANTIC_MODEL_FILENAME)); } } } @Override public void notifyAddSession(Session newSession) { ResourceSet resourceSet = session.getTransactionalEditingDomain().getResourceSet(); EList<Resource> resources = resourceSet.getResources(); for (Resource resource : resources) { assertFalse("test.ecore semantic resource is loaded at notifyAddSession", resource.getURI().toString().contains(SEMANTIC_MODEL_FILENAME)); } } }; SessionManager.INSTANCE.addSessionsListener(sessionManagerListener); super.setUp(); }</code><technical_language>constant SEMANTIC_MODEL_FILENAME</technical_language>

Target:
protected void setUp() throws Exception { sessionManagerListener = new SessionManagerListener.Stub() { @Override public void notify(Session updated, int notification) { super.notify(updated, notification); if (notification == SessionListener.OPENING) { ResourceSet resourceSet = session.getTransactionalEditingDomain().getResourceSet(); EList<Resource> resources = resourceSet.getResources(); for (Resource resource : resources) { assertFalse(SEMANTIC_MODEL_FILENAME + " semantic resource is loaded at SessionListener.OPENING notification", resource.getURI().toString().contains(SEMANTIC_MODEL_FILENAME)); } } } @Override public void notifyAddSession(Session newSession) { ResourceSet resourceSet = session.getTransactionalEditingDomain().getResourceSet(); EList<Resource> resources = resourceSet.getResources(); for (Resource resource : resources) { assertFalse(SEMANTIC_MODEL_FILENAME + " semantic resource is loaded at notifyAddSession", resource.getURI().toString().contains(SEMANTIC_MODEL_FILENAME)); } } }; SessionManager.INSTANCE.addSessionsListener(sessionManagerListener); super.setUp(); }
Source:
<code>public Integer count(List<Object> sequence, Object object) { <START> int result = 0; <END> if (object == null) { for (Object input : sequence) { if (input == null) { ++result; } } } else { for (Object input : sequence) { if (object.equals(input)) { ++result; } } } return Integer.valueOf(result); }</code><technical_language>Change implementation return Integer.valueOf(Collections.frequency(sequence, object));</technical_language>

Target:
public Integer count(List<Object> sequence, Object object) { return Integer.valueOf(Collections.frequency(sequence, object)); }
Source:
<code>public DeferredQueryTreeContentManager(AbstractTreeViewer viewer) { super(viewer); <START> listeners = new ArrayList<IDeferredQueryTreeListener>(); <END> }</code><technical_language>please of org.eclipse.core.runtime.ListenerList<E> ArrayList here</technical_language>

Target:
public DeferredQueryTreeContentManager(AbstractTreeViewer viewer) { super(viewer); listeners = new ListenerList<IDeferredQueryTreeListener>(); }
Source:
<code>protected void createTableWidget(final EObject sourceElement, final EStructuralFeature feature, final Collection<?> rows) { final Table table = createTable(sourceElement, feature, rows); if (table == null) { displayError("Cannot initialize the table"); return; } nattableManager = NattableModelManagerFactory.INSTANCE.createNatTableModelManager(table, new EObjectSelectionExtractor()); natTableWidget = nattableManager.createNattable(self, SWT.NONE, null); if (nattableManager instanceof TreeNattableModelManager) { <START> if (null != rows && !rows.isEmpty()) { <END> final RowHideShowLayer layer = nattableManager.getBodyLayerStack().getRowHideShowLayer(); for (int cpt = 0; cpt < rows.size(); cpt++) { natTableWidget.doCommand(new RowHideCommand(layer, 0)); } } ((TreeNattableModelManager) nattableManager).doCollapseExpandAction(CollapseAndExpandActionsEnum.EXPAND_ALL, null); } self.addDisposeListener(getDisposeListener()); natTableWidget.setBackground(self.getBackground()); natTableWidget.layout(); self.layout(); }</code><technical_language>If want hard code root hidden, create nattable property editor. If want create one, done a new feature of papyrus table, a custom NamedStyled (like for hidden categories). In this case, managed in PapyrusTreeLayer I think</technical_language>

Target:
protected void createTableWidget(final EObject sourceElement, final EStructuralFeature feature, final Collection<?> rows) { final Table table = createTable(sourceElement, feature, rows); if (table == null) { displayError("Cannot initialize the table"); return; } nattableManager = NattableModelManagerFactory.INSTANCE.createNatTableModelManager(table, new EObjectSelectionExtractor()); natTableWidget = nattableManager.createNattable(self, SWT.NONE, null); if (nattableManager instanceof TreeNattableModelManager) { ((TreeNattableModelManager) nattableManager).doCollapseExpandAction(CollapseAndExpandActionsEnum.EXPAND_ALL, null); } self.addDisposeListener(getDisposeListener()); natTableWidget.setBackground(self.getBackground()); natTableWidget.layout(); self.layout(); }
Source:
<code>public void testCorruptStageInstallUpdate() throws IOException, BundleException, URISyntaxException { File config = OSGiTestsActivator.getContext().getDataFile(getName()); final Equinox equinox = new Equinox( Collections.singletonMap(Constants.FRAMEWORK_STORAGE, config.getAbsolutePath())); try { equinox.init(); } catch (BundleException e) { fail("Unexpected exception in init()", e); } File dirBundleFile = createBundle(config, "dir.bundle", false, true); File jarBundleFile = createBundle(config, "jar.bundle", false, false); BundleContext bc = equinox.getBundleContext(); Bundle dirBundle = bc.installBundle(dirBundleFile.toURI().toASCIIString()); URLConverter converter = bc.getService(bc.getServiceReference(URLConverter.class)); URL dirFileURL = converter.resolve(dirBundle.getEntry("/")); File dirFile = new File(dirFileURL.getPath()); File rootStore = dirFile.getParentFile().getParentFile().getParentFile(); <START> File nextIDBundleDir = new File(rootStore, (dirBundle.getBundleId() + 1) + "/0/bundleFile"); <END> Files.createDirectories(nextIDBundleDir.toPath()); Bundle jarBundle = bc.installBundle(jarBundleFile.toURI().toASCIIString()); assertEquals("Wrong BSN", "bundlejar.bundle", jarBundle.getSymbolicName()); }</code><technical_language>matter this point previous bundle exploded jar? test work creating a garbage directory for bundle 1 a regular bundle install</technical_language>

Target:
public void testCorruptStageInstallUpdate() throws IOException, BundleException { File config = OSGiTestsActivator.getContext().getDataFile(getName()); final Equinox equinox = new Equinox( Collections.singletonMap(Constants.FRAMEWORK_STORAGE, config.getAbsolutePath())); try { equinox.init(); } catch (BundleException e) { fail("Unexpected exception in init()", e); } File dirBundleFile = createBundle(config, "dir.bundle", false, true); File jarBundleFile = createBundle(config, "jar.bundle", false, false); BundleContext bc = equinox.getBundleContext(); Bundle dirBundle = bc.installBundle(dirBundleFile.toURI().toASCIIString()); assertEquals("Wrong BSN", "bundledir.bundle", dirBundle.getSymbolicName()); URLConverter converter = bc.getService(bc.getServiceReference(URLConverter.class)); URL dirFileURL = converter.resolve(dirBundle.getEntry("/")); File dirFile = new File(dirFileURL.getPath()); File rootStore = dirFile.getParentFile().getParentFile().getParentFile(); dirBundle.uninstall(); long next = dirBundle.getBundleId() + 1; next = doTestExistingBundleFile(bc, next, rootStore, jarBundleFile, "bundlejar.bundle", true); next = doTestExistingBundleFile(bc, next, rootStore, jarBundleFile, "bundlejar.bundle", false); next = doTestExistingBundleFile(bc, next, rootStore, dirBundleFile, "bundledir.bundle", true); next = doTestExistingBundleFile(bc, next, rootStore, dirBundleFile, "bundledir.bundle", false); }
Source:
<code>public PagedFlux<ContainerItem> listContainers(ListContainersOptions options) { return new PagedFlux<>( () -> listContainersSegment(null, options) <START> .map(response -> new PagedResponseBase<>( <END> response.request(), response.statusCode(), response.headers(), response.value().containerItems(), response.value().nextMarker(), response.deserializedHeaders())), (marker) -> listContainersSegment(marker, options) .map(response -> new PagedResponseBase<>( response.request(), response.statusCode(), response.headers(), response.value().containerItems(), response.value().nextMarker(), response.deserializedHeaders()))); }</code><technical_language>want mapping function a function class? private PagedResponseBase<ServiceListContainersSegmentHeaders, ContainerItem> mapContainerListing(ServicesListContainersSegmentResponse response) { return new PagedResponseBase<>(response.request(), response.statusCode(), response.headers(), response.value().containerItems(), response.value().nextMarker(), response.deserializedHeaders()); }</technical_language>

Target:
public PagedFlux<ContainerItem> listContainers(ListContainersOptions options) { return listContainersWithOptionalTimeout(options, null); }
Source:
<code>public String toString() { if (getBuild() != null) { return getBuild().toString(); } <START> return getProject().getName(); <END> }</code><technical_language>If this is for debugging, adding buildCompleted string more useful</technical_language>

Target:
public String toString() { String s; if (getBuild() != null) { s = getBuild().toString(); } else { s = getProject().getName(); } if (isBuildCompleted()) { s += " (completed)"; } return s; }
Source:
<code>public void testBehaviorSwitches() { <START> assertMarkup("<p></p>", "__NOTOC__"); <END> assertMarkup("<p></p>", "__FORCETOC__"); assertMarkup("<p></p>", "__NOEDITSECTION__"); assertMarkup("<p></p>", "__NEWSECTIONLINK__"); assertMarkup("<p></p>", "__NONEWSECTIONLINK__"); assertMarkup("<p></p>", "__NOGALLERY__"); assertMarkup("<p></p>", "__HIDDENCAT__"); assertMarkup("<p></p>", "__NOCONTENTCONVERT__"); assertMarkup("<p></p>", "__NOCC__"); assertMarkup("<p></p>", "__NOTITLECONVERT__"); assertMarkup("<p></p>", "__NOTC__"); assertMarkup("<p></p>", "__START__"); assertMarkup("<p></p>", "__END__"); assertMarkup("<p></p>", "__INDEX__"); assertMarkup("<p></p>", "__NOINDEX__"); assertMarkup("<p></p>", "__STATICREDIRECT__"); assertMarkup("<p></p>", "__DISAMBIG__"); }</code><technical_language>intention result in empty paragraph? wondering if a block in stead of a phrase modifier. do think</technical_language>

Target:
public void testBehaviorSwitches() { assertMarkup("", "__NOTOC__"); assertMarkup("", "__FORCETOC__"); assertMarkup("", "__NOEDITSECTION__"); assertMarkup("", "__NEWSECTIONLINK__"); assertMarkup("", "__NONEWSECTIONLINK__"); assertMarkup("", "__NOGALLERY__"); assertMarkup("", "__HIDDENCAT__"); assertMarkup("", "__NOCONTENTCONVERT__"); assertMarkup("", "__NOCC__"); assertMarkup("", "__NOTITLECONVERT__"); assertMarkup("", "__NOTC__"); assertMarkup("", "__START__"); assertMarkup("", "__END__"); assertMarkup("", "__INDEX__"); assertMarkup("", "__NOINDEX__"); assertMarkup("", "__STATICREDIRECT__"); assertMarkup("", "__DISAMBIG__"); }
Source:
<code>protected CompletableFuture<LogListInfo> handleRequest(@Nonnull HandlerRequest<EmptyRequestBody, EmptyMessageParameters> request, @Nonnull RestfulGateway gateway) throws RestHandlerException { if (logFileLocation.logFile == null || StringUtils.isNullOrWhitespaceOnly(logFileLocation.logFile.getParent())) { return CompletableFuture.completedFuture(new LogListInfo(Collections.emptyList())); <START> } else { <END> final File[] logFiles = new File(logFileLocation.logFile.getParent()).listFiles(); final List<LogInfo> logsWithLength = Arrays.stream(logFiles) .filter(File::isFile) .map(logFile -> new LogInfo(logFile.getName(), logFile.length())) .collect(Collectors.toList()); return CompletableFuture.completedFuture(new LogListInfo(logsWithLength)); } }</code><technical_language>else keyword removed (the code clearer), returned in if</technical_language>

Target:
protected CompletableFuture<LogListInfo> handleRequest(@Nonnull HandlerRequest<EmptyRequestBody, EmptyMessageParameters> request, @Nonnull RestfulGateway gateway) throws RestHandlerException { if (logDir == null) { return CompletableFuture.completedFuture(new LogListInfo(Collections.emptyList())); } final File[] logFiles = logDir.listFiles(); if (logFiles == null) { return FutureUtils.completedExceptionally(new IOException("Could not list files in " + logDir)); } final List<LogInfo> logsWithLength = Arrays.stream(logFiles) .filter(File::isFile) .map(logFile -> new LogInfo(logFile.getName(), logFile.length())) .collect(Collectors.toList()); return CompletableFuture.completedFuture(new LogListInfo(logsWithLength)); }
Source:
<code>public ResourceVerifier verifyListAttributeContainsValue(String attributeName, ModelNode value, String errorMessageSuffix) throws Exception { waitFor(() -> { ModelNodeResult actualResult = ops.readAttribute(resourceAddress, attributeName); return actualResult.isSuccess() && actualResult.hasDefined(Constants.RESULT); }); final ModelNodeResult modelNodeResult = ops.readAttribute(resourceAddress, attributeName); modelNodeResult.assertSuccess(); Assert.assertTrue("Given value '" + value.toString() + "' is not present in list attribute '" + attributeName + "'!" + (errorMessageSuffix == null || errorMessageSuffix.isEmpty() ? "" : " " + errorMessageSuffix), modelNodeResult.listValue().stream() <START> .peek(modelNode -> log.debug("Comparing '{}' with list member '{}'.", modelNode.toString(), value.toString())) <END> .anyMatch(modelNode -> modelNode.equals(value))); return this; }</code><technical_language>data this log? trace log level instead? asking..</technical_language>

Target:
public ResourceVerifier verifyListAttributeContainsValue(String attributeName, ModelNode value, String errorMessageSuffix) throws Exception { waitFor(() -> { ModelNodeResult actualResult = ops.readAttribute(resourceAddress, attributeName); return actualResult.isSuccess() && actualResult.hasDefined(Constants.RESULT) && isModelNodePresentInListAttributeValue(attributeName, value); }); final ModelNodeResult modelNodeResult = ops.readAttribute(resourceAddress, attributeName); modelNodeResult.assertSuccess(); Assert.assertTrue("Given value '" + value.toString() + "' is not present in list attribute '" + attributeName + "'!" + (errorMessageSuffix == null || errorMessageSuffix.isEmpty() ? "" : " " + errorMessageSuffix), isModelNodePresentInListAttributeValue(attributeName, value)); return this; }
Source:
<code>private boolean isAdAggregatorIdValid(Bond bond, HostInterfaceLineModel lineModel) { String bondAdAggregatorId = Objects.toString(bond.getAdAggregatorId(), <START> ""); <END> for (HostInterface nic : lineModel.getInterfaces()) { String nicAggregatorId = Objects.toString(nic.getInterface().getAdAggregatorId(), ""); if (!bondAdAggregatorId.equals(nicAggregatorId)) { return false; } } return true; }</code><technical_language>I do understand empty string, instead of "null" null, is required here, mind</technical_language>

Target:
private boolean isAdAggregatorIdValid(Bond bond, HostInterfaceLineModel lineModel) { String bondAdAggregatorId = Objects.toString(bond.getAdAggregatorId()); if (bondAdAggregatorId==null) { return false; } for (HostInterface nic : lineModel.getInterfaces()) { String nicAggregatorId = Objects.toString(nic.getInterface().getAdAggregatorId()); if (!bondAdAggregatorId.equals(nicAggregatorId)) { return false; } } return true; }
Source:
<code>public AlluxioURIStatus(FileInfo fileInfo, HiveFileContext hiveFileContext) { super(fileInfo); <START> this.hiveFileContext = hiveFileContext; <END> }</code><technical_language>requireNonNull</technical_language>

Target:
public AlluxioURIStatus(FileInfo fileInfo, HiveFileContext hiveFileContext) { super(fileInfo); this.hiveFileContext = requireNonNull(hiveFileContext, "hiveFileContext is null"); }
Source:
<code>private void testEditQuestionNumberAction() { ______TS("edit question number success"); assertEquals(true, feedbackEditPage.clickEditQuestionButton(2)); feedbackEditPage.selectQuestionNumber(2, 1); feedbackEditPage.clickSaveExistingQuestionButton(2); assertEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED, feedbackEditPage.getStatus()); ______TS("questions still editable even if questions numbers became inconsistent"); FeedbackQuestionAttributes firstQuestion = BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1); assertEquals(1, firstQuestion.questionNumber); FeedbackQuestionAttributes secondQuestion = BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 2); assertEquals(2, secondQuestion.questionNumber); secondQuestion.questionNumber = 1; BackDoor.editFeedbackQuestion(secondQuestion); <START> <END> feedbackEditPage = getFeedbackEditPage(); assertTrue(feedbackEditPage.clickEditQuestionButton(1)); assertTrue(feedbackEditPage.clickEditQuestionButton(2)); secondQuestion.questionNumber = 2; BackDoor.editFeedbackQuestion(secondQuestion); feedbackEditPage = getFeedbackEditPage(); }</code><technical_language>Verify question numbers editing</technical_language>

Target:
private void testEditQuestionNumberAction() { ______TS("edit question number success"); assertEquals(true, feedbackEditPage.clickEditQuestionButton(2)); feedbackEditPage.selectQuestionNumber(2, 1); feedbackEditPage.clickSaveExistingQuestionButton(2); assertEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED, feedbackEditPage.getStatus()); ______TS("questions still editable even if questions numbers became inconsistent"); FeedbackQuestionAttributes firstQuestion = BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1); assertEquals(1, firstQuestion.questionNumber); FeedbackQuestionAttributes secondQuestion = BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 2); assertEquals(2, secondQuestion.questionNumber); int originalSecondQuestionNumber = secondQuestion.questionNumber; secondQuestion.questionNumber = firstQuestion.questionNumber; BackDoor.editFeedbackQuestion(secondQuestion); feedbackEditPage = getFeedbackEditPage(); assertTrue(feedbackEditPage.clickEditQuestionButton(1)); assertTrue(feedbackEditPage.clickEditQuestionButton(2)); secondQuestion.questionNumber = originalSecondQuestionNumber; BackDoor.editFeedbackQuestion(secondQuestion); feedbackEditPage = getFeedbackEditPage(); }
Source:
<code>public synchronized void createOrUpdateMeter(Class<?> clazz, String key, String metricName, long value) { Map<String, Metric> metricMap = getMetricsForKey(key); if (!metricMap.containsKey(metricName)) { Meter meter = _metricRegistry.meter(MetricRegistry.name(clazz, key, metricName)); meter.mark(value); metricMap.put(metricName, meter); } else { Metric metric = metricMap.get(metricName); if (metric instanceof Meter) { ((Meter) metric).mark(value); <START> } <END> } }</code><technical_language>above, log throw if a meter</technical_language>

Target:
public synchronized void createOrUpdateMeter(Class<?> clazz, String key, String metricName, long value) { validateArguments(clazz, key, metricName); String fullMetricName = MetricRegistry.name(clazz, key, metricName); Meter meter = _metricRegistry.getMeters().get(fullMetricName); if (meter == null) { meter = _metricRegistry.meter(fullMetricName); } meter.mark(value); }
Source:
<code>private void executeCommand(ChannelHandlerContext ctx, Command command) throws Exception { RedisResponse response; if (isAuthenticated) { if (command.isOfType(RedisCommandType.SHUTDOWN)) { this.server.shutdown(); return; } if (hasTransaction() && !command.isTransactional()) { response = executeWithTransaction(ctx, command); } else { response = executeWithoutTransaction(command); } if (hasTransaction() && command.isOfType(RedisCommandType.MULTI)) { response = RedisResponse.string(RedisConstants.COMMAND_QUEUED); } } else if (command.isOfType(RedisCommandType.AUTH)) { response = command.execute(this); } else { response = RedisResponse.error(RedisConstants.ERROR_NOT_AUTH); } if (response != null) { writeToChannel(response); } else { <START> if (command.getCommandType() != RedisCommandType.PUBLISH) { <END> writeToChannel(command.getResponse()); } } if (command.isOfType(RedisCommandType.QUIT)) { channelInactive(ctx); } }</code><technical_language>this if expression "!command.isOfType(RedisCommandType.PUBLISH)". get this a single "writeToChannel" call so: if (response == null && !command.isOfType(PUBLISH) { response = command.getResponse(); } if (response != null) { writeToChannel(response); }</technical_language>

Target:
private void executeCommand(ChannelHandlerContext ctx, Command command) throws Exception { RedisResponse response; if (isAuthenticated) { if (command.isOfType(RedisCommandType.SHUTDOWN)) { this.server.shutdown(); return; } if (hasTransaction() && !command.isTransactional()) { response = executeWithTransaction(ctx, command); } else { response = executeWithoutTransaction(command); } logResponse(command); if (hasTransaction() && command.isOfType(RedisCommandType.MULTI)) { response = RedisResponse.string(RedisConstants.COMMAND_QUEUED); } } else if (command.isOfType(RedisCommandType.AUTH)) { response = command.execute(this); } else { response = RedisResponse.error(RedisConstants.ERROR_NOT_AUTH); } if (response == null && !command.isOfType(PUBLISH)) { writeToChannel(command.getResponse()); } else if (response != null) { writeToChannel(response); } if (command.isOfType(RedisCommandType.QUIT)) { channelInactive(ctx); } }
Source:
<code>public Table getTable(TableName tableName, ExecutorService pool) throws IOException { BigtableDataClient client = session.getDataClient(); AsyncExecutor asyncMutator = new AsyncExecutor(client, AsyncExecutor.MAX_INFLIGHT_RPCS_DEFAULT, AsyncExecutor.MAX_INFLIGHT_RPCS_DEFAULT, pool); HBaseRequestAdapter adapter = createAdapter(tableName); BatchExecutor batchExecutor = new BatchExecutor(asyncMutator, options, MoreExecutors.listeningDecorator(pool), adapter); <START> return new BigtableTable(this, tableName, options,client, adapter, batchExecutor); <END> }</code><technical_language>options, client</technical_language>

Target:
public Table getTable(TableName tableName, ExecutorService pool) throws IOException { BigtableDataClient client = session.getDataClient(); AsyncExecutor asyncExecutor = new AsyncExecutor(client, AsyncExecutor.MAX_INFLIGHT_RPCS_DEFAULT, AsyncExecutor.MAX_INFLIGHT_RPCS_DEFAULT, pool); HBaseRequestAdapter adapter = createAdapter(tableName); BatchExecutor batchExecutor = new BatchExecutor(asyncExecutor, options, MoreExecutors.listeningDecorator(pool), adapter); return new BigtableTable(this, tableName, options, client, adapter, batchExecutor); }
Source:
<code>public InputStream createInputStream(String filename, IProgressMonitor monitor) throws IOException { String url = OpenshiftUIConstants.URL_VALIDATOR.isValid(filename)?filename:new File(filename).toURI().toString(); <START> try (ByteArrayOutputStream out = new ByteArrayOutputStream()) { <END> IStatus status = OpenshiftUIConstants.TRANSPORT_UTILITY.download(filename, url, out, monitor); if (!status.isOK()) { throw new IOException(status.getMessage()); } return new ByteArrayInputStream(out.toByteArray()); } }</code><technical_language>prefer call OpenshiftUIConstants.TRANSPORT_UTILITY.download if a valid URL, else expect a file return a fileinputstream</technical_language>

Target:
public InputStream createInputStream(String filename, IProgressMonitor monitor) throws IOException { if (OpenshiftUIConstants.URL_VALIDATOR.isValid(filename)) { try (ByteArrayOutputStream out = new ByteArrayOutputStream()) { IStatus status = OpenshiftUIConstants.TRANSPORT_UTILITY.download(filename, filename, out, monitor); if (!status.isOK()) { throw new IOException(status.getMessage()); } return new ByteArrayInputStream(out.toByteArray()); } } else { return new FileInputStream(filename); } }
Source:
<code>protected Map<String, Pair<String, String>> getExclusiveLocks() { Map<String, Pair<String, String>> locks = new HashMap<String, Pair<String, String>>(); VDSGroup cluster = getVdsGroup(); if (cluster == null || cluster.supportsVirtService()) { locks.put(getParameters().getVdsId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.VDS, <START> VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); <END> } return locks; }</code><technical_language>Vds lock acquired for gluster hosts</technical_language>

Target:
protected Map<String, Pair<String, String>> getExclusiveLocks() { Map<String, Pair<String, String>> locks = new HashMap<String, Pair<String, String>>(); locks.put(getParameters().getVdsId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.VDS, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); return locks; }
Source:
<code>public Mono<ReactiveGridFsResource> getResource(GridFSFile file) { Assert.notNull(file, "GridFSFile must not be null!"); <START> return Mono.fromSupplier(() -> new ReactiveGridFsResource(file, this.doGetBucket(), dataBufferFactory)); <END> }</code><technical_language>rewrite this method doGetBucket().map(it ->new ReactiveGridFsResource( )) instead of introducing a new constructor</technical_language>

Target:
public Mono<ReactiveGridFsResource> getResource(GridFSFile file) { Assert.notNull(file, "GridFSFile must not be null!"); return this.doGetBucket() .map(it -> new ReactiveGridFsResource(file, it.downloadToPublisher(file.getId()), dataBufferFactory)); }
Source:
<code>private static AuditListener createListener(String format, String outputLocation) throws UnsupportedEncodingException, FileNotFoundException { OutputStream out; boolean closeOutputStream; if (outputLocation != null) { out = new FileOutputStream(outputLocation); closeOutputStream = true; } else { out = System.out; closeOutputStream = false; } AuditListener listener; if ("xml".equals(format)) { listener = new XMLLogger(out, closeOutputStream); } else if ("plain".equals(format)) { listener = new DefaultLogger(out, closeOutputStream); } else { if (closeOutputStream) { <START> IOUtils.closeQuietly(out); <END> } throw new IllegalStateException("Invalid output format. Found '" + format + "' but expected 'plain' or 'xml'."); } return listener; }</code><technical_language>@baratali, Guava? <LINK_0> I want additional dependency in Checkstyle</technical_language>

Target:
private static AuditListener createListener(String format, String outputLocation) throws UnsupportedEncodingException, FileNotFoundException { OutputStream out; boolean closeOutputStream; if (outputLocation != null) { out = new FileOutputStream(outputLocation); closeOutputStream = true; } else { out = System.out; closeOutputStream = false; } AuditListener listener; if ("xml".equals(format)) { listener = new XMLLogger(out, closeOutputStream); } else if ("plain".equals(format)) { listener = new DefaultLogger(out, closeOutputStream); } else { if (closeOutputStream) { Utils.close(out); } throw new IllegalStateException("Invalid output format. Found '" + format + "' but expected 'plain' or 'xml'."); } return listener; }
Source:
<code>synchronized void handleResult(List<MutateRowsResponse> results) { mutateRowsFuture = null; if (results.size() != 1) { setFailure(io.grpc.Status.INTERNAL.withDescription("Expected only a single response.") .asRuntimeException()); return; <START> } <END> List<MutateRowsResponse.Entry> entries = new ArrayList<>(); for (MutateRowsResponse response : results) { entries.addAll(response.getEntriesList()); } if (entries.isEmpty()) { setFailure(io.grpc.Status.INTERNAL .withDescription("No MutateRowsResponses entries were found.").asRuntimeException()); return; } try { if (operationsAreComplete()) { LOG.warn("Got duplicate responses for bulk mutation."); setComplete(); return; } if (entries.isEmpty()) { setFailure(io.grpc.Status.INTERNAL.withDescription("No MutateRowResponses were found.") .asRuntimeException()); return; } handleResponses(entries); handleExtraFutures(entries); setComplete(); } catch (Throwable e) { setFailure(e); } }</code><technical_language>mind adding a TODO add support for multiple MutateRowsResponses? server currently send them, in future support sub-batching of Mutations</technical_language>

Target:
synchronized void handleResult(List<MutateRowsResponse> results) { mutateRowsFuture = null; List<MutateRowsResponse.Entry> entries = new ArrayList<>(); for (MutateRowsResponse response : results) { entries.addAll(response.getEntriesList()); } if (entries.isEmpty()) { setFailure(io.grpc.Status.INTERNAL .withDescription("No MutateRowsResponses entries were found.").asRuntimeException()); return; } try { if (operationsAreComplete()) { LOG.warn("Got duplicate responses for bulk mutation."); setComplete(); return; } if (entries.isEmpty()) { setFailure(io.grpc.Status.INTERNAL.withDescription("No MutateRowResponses were found.") .asRuntimeException()); return; } handleResponses(entries); handleExtraFutures(entries); setComplete(); } catch (Throwable e) { setFailure(e); } }
Source:
<code>public List<Response> getFromCanvas(@NotNull String oauthToken, @NotNull String url, Consumer<Response> callback) throws InvalidOauthTokenException, IOException { LOG.debug("Sending GET request to: " + url); final List<Response> responses = new ArrayList<>(); <START> while (!StringUtils.isBlank(url)) { <END> Response response = getSingleResponseFromCanvas(oauthToken, url); if (response.getResponseCode() == 401) { throw new InvalidOauthTokenException(); } else if (response.getErrorHappened() || response.getResponseCode() != 200) { LOG.error("Errors retrieving responses from canvas for url: " + url); return Collections.emptyList(); } responses.add(response); url = response.getNextLink(); if (callback != null) { callback.accept(response); } } return responses; }</code><technical_language>Minor.. is slightly more readable StringUtils.isNotBlank(url) instead of !StringUtils.isBlank(url)</technical_language>

Target:
public List<Response> getFromCanvas(@NotNull String oauthToken, @NotNull String url, Consumer<Response> callback) throws InvalidOauthTokenException, IOException { LOG.debug("Sending GET request to: " + url); final List<Response> responses = new ArrayList<>(); while (StringUtils.isNotBlank(url)) { Response response = getSingleResponseFromCanvas(oauthToken, url); if (response.getResponseCode() == 401) { throw new InvalidOauthTokenException(); } else if (response.getErrorHappened() || response.getResponseCode() != 200) { LOG.error("Errors retrieving responses from canvas for url: " + url); return Collections.emptyList(); } responses.add(response); url = response.getNextLink(); if (callback != null) { callback.accept(response); } } return responses; }
Source:
<code>private static SslContext getClientSslContext(SSLConfig config) throws GeneralSecurityException, IOException { return SslContextBuilder.forClient() .keyManager(getKeyManagerFactory(config)) .trustManager(getTrustManagerFactory(config)) <START> .sslProvider(SslProvider.OPENSSL) <END> .ciphers(getCipherSuites(config)) .protocols(getEnabledProtocols(config)) .build(); }</code><technical_language>this is for server (JDK) - intended</technical_language>

Target:
private static SslContext getClientSslContext(SSLConfig config) throws GeneralSecurityException, IOException { logger.info("Using provider for client SslContext", SslContext.defaultClientProvider()); return SslContextBuilder.forClient() .keyManager(getKeyManagerFactory(config)) .trustManager(getTrustManagerFactory(config)) .ciphers(getCipherSuites(config)) .protocols(getEnabledProtocols(config)) .build(); }
Source:
<code>public void test_exactDivide_reverse(Frequency test, Frequency other, int expected) { if (!test.equals(other)) { <START> assertThrowsIllegalArg(() -> Frequency.P1W.exactDivide(Frequency.P1M)); <END> } }</code><technical_language>this be: assertThrowsIllegalArg(() -> other.exactDivide(test));</technical_language>

Target:
public void test_exactDivide_reverse(Frequency test, Frequency other, int expected) { if (!test.equals(other)) { assertThrowsIllegalArg(() -> other.exactDivide(test)); } }
Source:
<code>public void execute() throws Exception { while (!CassandraMonitor.hasCassadraStarted()) { logger.debug( "Cassandra has not yet started, hence Snapshot Backup will start after [" + WAIT_TIME_MS / 1000 + "] secs ..."); sleeper.sleep(WAIT_TIME_MS); } if (!lock.tryLock()) { <START> logger.error("Snapshot Operation is already running! Try again later."); <END> throw new Exception("Snapshot Operation already running"); } try { executeSnapshot(); } finally { lock.unlock(); } }</code><technical_language>nit: a warn, this is necessary caused application, due crons</technical_language>

Target:
public void execute() throws Exception { while (!CassandraMonitor.hasCassadraStarted()) { logger.debug( "Cassandra has not yet started, hence Snapshot Backup will start after [" + WAIT_TIME_MS / 1000 + "] secs ..."); sleeper.sleep(WAIT_TIME_MS); } if (!lock.tryLock()) { logger.warn("Snapshot Operation is already running! Try again later."); throw new Exception("Snapshot Operation already running"); } try { executeSnapshot(); } finally { lock.unlock(); } }
Source:
<code>public void subscribe(Pattern pattern, ConsumerRebalanceListener listener) { maybeThrowInvalidGroupIdException(); if (pattern == null || pattern.toString().equals("")) <START> throw new IllegalArgumentException("Topic pattern to subscribe to cannot be " + pattern == null ? "null" : "empty"); <END> acquireAndEnsureOpen(); try { throwIfNoAssignorsConfigured(); log.info("Subscribed to pattern: '{}'", pattern); this.subscriptions.subscribe(pattern, listener); this.coordinator.updatePatternSubscription(metadata.fetch()); this.metadata.requestUpdateForNewTopics(); } finally { release(); } }</code><technical_language>condition is false if add brackets. throw new IllegalArgumentException("Topic pattern subscribe " + (pattern == null ? "null" : "empty"));</technical_language>

Target:
public void subscribe(Pattern pattern, ConsumerRebalanceListener listener) { maybeThrowInvalidGroupIdException(); if (pattern == null || pattern.toString().equals("")) throw new IllegalArgumentException("Topic pattern to subscribe to cannot be " + (pattern == null ? "null" : "empty")); acquireAndEnsureOpen(); try { throwIfNoAssignorsConfigured(); log.info("Subscribed to pattern: '{}'", pattern); this.subscriptions.subscribe(pattern, listener); this.coordinator.updatePatternSubscription(metadata.fetch()); this.metadata.requestUpdateForNewTopics(); } finally { release(); } }
Source:
<code>public void onDisable() { boolean stopping = false; if (isStopping != null) { try { stopping = (boolean) isStopping.invoke(); } catch (Throwable throwable) { throwable.printStackTrace(); } } for (User user : getOnlineUsers()) { if (user.isVanished()) { user.setVanished(false); user.sendMessage(tl("unvanishedReload")); } if (stopping) { user.setLogoutLocation(); if (!user.isHidden()) { user.setLastLogout(System.currentTimeMillis()); } user.stopTransaction(); <START> user.dispose(); <END> continue; } user.stopTransaction(); } cleanupOpenInventories(); if (i18n != null) { i18n.onDisable(); } if (backup != null) { backup.stopTask(); } Economy.setEss(null); Trade.closeLog(); getUserMap().getUUIDMap().shutdown(); HandlerList.unregisterAll(this); }</code><technical_language>This is wrong run here. instead user.cleanup() - user.dispose() create async task eventually call user.cleanup, throw exception. (Or should, server is shutting down)</technical_language>

Target:
public void onDisable() { for (User user : getOnlineUsers()) { if (user.isVanished()) { user.setVanished(false); user.sendMessage(tl("unvanishedReload")); } if (ServerState.isStopping()) { user.setLastLocation(); if (!user.isHidden()) { user.setLastLogout(System.currentTimeMillis()); } user.cleanup(); } else { user.stopTransaction(); } } cleanupOpenInventories(); if (i18n != null) { i18n.onDisable(); } if (backup != null) { backup.stopTask(); } Economy.setEss(null); Trade.closeLog(); getUserMap().getUUIDMap().shutdown(); HandlerList.unregisterAll(this); }
Source:
<code><START> public static void setTransactionSynchronizationRegistry(TransactionSynchronizationRegistry tsr) { <END> if (tsr != transactionSynchronizationRegistry) { synchronized (WildFlyCustomJtaPlatform.class) { if (tsr != transactionSynchronizationRegistry) { transactionSynchronizationRegistry = tsr; } } } }</code><technical_language>Do want checking object instance equals()</technical_language>

Target:
public static void setTransactionSynchronizationRegistry(TransactionSynchronizationRegistry tsr) { if ((Assert.checkNotNullParam("tsr", tsr)) != transactionSynchronizationRegistry) { synchronized (WildFlyCustomJtaPlatform.class) { if (tsr != transactionSynchronizationRegistry) { transactionSynchronizationRegistry = tsr; } } } }
Source:
<code>public void disabledCommand() { jedis.set("mykey", "hello world"); <START> jedis.del("mykey"); <END> }</code><technical_language>try-catch fail assertion exception message here</technical_language>

Target:
public void disabledCommand() { jedis.set("mykey", "hello world2"); try { jedis.del("mykey"); fail("'DEL' command should be unknown"); } catch (JedisDataException expected) { assertEquals("ERR unknown command 'DEL'", expected.getMessage()); } String value = jedis.get("mykey"); assertEquals("hello world2", value); }
Source:
<code>protected TaskLauncherInitializer getDefaultTaskLauncherInitializer(InternalJob job) { TaskLauncherInitializer tli = new TaskLauncherInitializer(); tli.setTaskId(getId()); tli.setJobOwner(job.getJobInfo().getJobOwner()); <START> tli.setRestUrl(System.getProperty("rest.server.url")); <END> tli.setPreScript(getPreScript()); tli.setPostScript(getPostScript()); tli.setControlFlowScript(getFlowScript()); tli.setTaskInputFiles(getInputFilesList()); tli.setTaskOutputFiles(getOutputFilesList()); tli.setNamingService( job.getTaskDataSpaceApplications().get(getId().longValue()).getNamingServiceStub()); tli.setIterationIndex(getIterationIndex()); tli.setReplicationIndex(getReplicationIndex()); Map<String, String> gInfo = getGenericInformationOverridden(job); tli.setGenericInformation(gInfo); tli.setForkEnvironment(getForkEnvironment()); if (isWallTimeSet()) { tli.setWalltime(wallTime); } tli.setPreciousLogs(isPreciousLogs()); tli.setVariables(job.getVariables()); tli.setPingPeriod(PASchedulerProperties.SCHEDULER_NODE_PING_FREQUENCY.getValueAsInt()); tli.setPingAttempts(PASchedulerProperties.SCHEDULER_NODE_PING_ATTEMPTS.getValueAsInt()); return tli; }</code><technical_language>Extract in a constant is publicly prefix _pa_ _proactive_ debugging? convenient standardize naming parameters, properties, etc. added for passing Scheduler REST URL</technical_language>

Target:
protected TaskLauncherInitializer getDefaultTaskLauncherInitializer(InternalJob job) { TaskLauncherInitializer tli = new TaskLauncherInitializer(); tli.setTaskId(getId()); tli.setJobOwner(job.getJobInfo().getJobOwner()); tli.setSchedulerRestUrl(PASchedulerProperties.SCHEDULER_REST_URL.getValueAsStringOrNull()); tli.setPreScript(getPreScript()); tli.setPostScript(getPostScript()); tli.setControlFlowScript(getFlowScript()); tli.setTaskInputFiles(getInputFilesList()); tli.setTaskOutputFiles(getOutputFilesList()); tli.setNamingService( job.getTaskDataSpaceApplications().get(getId().longValue()).getNamingServiceStub()); tli.setIterationIndex(getIterationIndex()); tli.setReplicationIndex(getReplicationIndex()); Map<String, String> gInfo = getGenericInformationOverridden(job); tli.setGenericInformation(gInfo); tli.setForkEnvironment(getForkEnvironment()); if (isWallTimeSet()) { tli.setWalltime(wallTime); } tli.setPreciousLogs(isPreciousLogs()); tli.setVariables(job.getVariables()); tli.setPingPeriod(PASchedulerProperties.SCHEDULER_NODE_PING_FREQUENCY.getValueAsInt()); tli.setPingAttempts(PASchedulerProperties.SCHEDULER_NODE_PING_ATTEMPTS.getValueAsInt()); return tli; }
Source:
<code>public PortfolioItemSummary summarize() { StringBuilder buf = new StringBuilder(96); CurrencyAmount base = product.getUnderlying().getBaseCurrencyAmount(); CurrencyAmount counter = product.getUnderlying().getCounterCurrencyAmount(); buf.append(product.getLongShort()); buf.append(' '); buf.append(SummarizerUtils.fx(base, counter)); buf.append(" : "); buf.append(SummarizerUtils.date(product.getExpiryDate())); CurrencyPair currencyPair = product.getCurrencyPair(); return SummarizerUtils.summary( <START> this, ProductType.FX_VANILLA_OPTION, buf.toString(), currencyPair.getBase(), currencyPair.getCounter()); <END> }</code><technical_language>Capture premium do for IR options</technical_language>

Target:
public PortfolioItemSummary summarize() { StringBuilder buf = new StringBuilder(96); CurrencyAmount base = product.getUnderlying().getBaseCurrencyAmount(); CurrencyAmount counter = product.getUnderlying().getCounterCurrencyAmount(); buf.append(product.getLongShort()); buf.append(' '); buf.append(SummarizerUtils.fx(base, counter)); buf.append(" Premium "); buf.append(SummarizerUtils.amount(premium.getValue().mapAmount(v -> Math.abs(v)))); buf.append(" : "); buf.append(SummarizerUtils.date(product.getExpiryDate())); CurrencyPair currencyPair = product.getCurrencyPair(); return SummarizerUtils.summary( this, ProductType.FX_VANILLA_OPTION, buf.toString(), currencyPair.getBase(), currencyPair.getCounter()); }
Source:
<code><START> public boolean equalValues(QosBase obj) { <END> if (this == obj) return true; if (getClass() != obj.getClass()) return false; CpuQos other = (CpuQos) obj; if (cpuLimit == null) { if (other.cpuLimit != null) return false; } else if (!cpuLimit.equals(other.cpuLimit)) return false; return true; }</code><technical_language>code</technical_language>

Target:
public boolean equalValues(QosBase obj) { if (!(obj instanceof CpuQos)) { return false; } CpuQos other = (CpuQos) obj; return ObjectUtils.objectsEqual(cpuLimit, other.getCpuLimit()); }
Source:
<code>public void logMessage(String level, String message) { switch (level) { <START> case "error": <END> LOGGER.error(message); break; case "info": LOGGER.info(message); break; case "debug": LOGGER.debug(message); break; } }</code><technical_language>support levels? (warn, trace fatal)</technical_language>

Target:
public void logMessage(String level, String message) { switch (level) { case "logger.log.level.trace": LOGGER.trace(message); break; case "logger.log.level.debug": LOGGER.debug(message); break; case "logger.log.level.info": LOGGER.info(message); break; case "logger.log.level.warn": LOGGER.warn(message); break; default: LOGGER.error(message); break; } }