auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean isSegmentLoadedByServer(String serverKey, DataSegment segment) { DruidServerHolder holder = servers.get(serverKey); <START> if (holder != null) { <END> return holder.druidServer.getSegment(segment.getIdentifier()) != null; } else { return false; } }</code><technical_language>This is a nit, I find inverted logic this hard reading code. I if (holder == null) { return false; } return holder.druidServer.getSegment(segment.getIdentifier()) != null;</technical_language>

Target:
public boolean isSegmentLoadedByServer(String serverKey, DataSegment segment) { DruidServerHolder holder = servers.get(serverKey); return holder != null && holder.druidServer.getSegment(segment.getIdentifier()) != null; }
Source:
<code>public void doPatchsetCreatedHook(final Change change, final PatchSet patchSet) { <START> if (patchsetCreatedHook != null && patchsetCreatedHook.exists()) { <END> final List<String> args = new ArrayList<String>(); args.add(patchsetCreatedHook.getAbsolutePath()); args.add(change.getId().toString()); args.add(change.getProject().get()); args.add(change.getDest().getShortName()); args.add(patchSet.getRevision().get()); args.add(Integer.toString(patchSet.getPatchSetId())); runHook(getRepo(change), args); } }</code><technical_language>hook null constructor ensured assigned a non-null it. hook stat test invocation? do ChangeHookRunner is initially constructed? If do construction avoid stat calls change, enable disable hook runtime restarting server</technical_language>

Target:
public void doPatchsetCreatedHook(final Change change, final PatchSet patchSet) { final List<String> args = new ArrayList<String>(); args.add(patchsetCreatedHook.getAbsolutePath()); args.add("--change"); args.add(change.getKey().get()); args.add("--project"); args.add(change.getProject().get()); args.add("--branch"); args.add(change.getDest().getShortName()); args.add("--sha1"); args.add(patchSet.getRevision().get()); args.add("--patchset"); args.add(Integer.toString(patchSet.getPatchSetId())); runHook(getRepo(change), args); }
Source:
<code>public synchronized Location getLocation(Context context) { if (mLocation != null) { return mLocation; } start(context); if (isPlayServicesConnected()) { try { mLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient); if (mLocation != null) { if (isLocationManagerConnected()) { stopLocationUpdatesWithoutPlayServices(); } return mLocation; <START> } else { <END> stopLocationUpdatesWithPlayServices(); if (!isLocationManagerConnected()) { initializeLocationManager(context); } } } catch (SecurityException e) { Log.e(TAG, "Appium Settings has no access to location permission", e); } } if (isLocationManagerConnected() || mGoogleApiClient != null) { if (mGoogleApiClient != null && !isLocationManagerConnected()) { Object locationManager = context.getSystemService(LOCATION_SERVICE); if (locationManager != null) { mLocationManager = (LocationManager) locationManager; startLocationUpdatesWithoutPlayServices(); } } if (mLocationManager != null && mLocationProvider != null) { try { mLocation = mLocationManager.getLastKnownLocation(mLocationProvider); return mLocation; } catch (SecurityException e) { Log.e(TAG, String.format("Appium Settings has no access to %s location permission", mLocationProvider), e); } } } return null; }</code><technical_language>flip if condition</technical_language>

Target:
public synchronized Location getLocation(Context context) { if (mLocation != null) { return mLocation; } start(context); if (isPlayServicesConnected()) { try { mLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient); if (mLocation == null) { if (!isLocationManagerConnected()) { initializeLocationManager(context); } } else { if (isLocationManagerConnected()) { stopLocationUpdatesWithoutPlayServices(); } return mLocation; } } catch (SecurityException e) { Log.e(TAG, "Appium Settings has no access to location permission", e); } } if (isLocationManagerConnected() || mGoogleApiClient != null) { if (mGoogleApiClient != null && !isLocationManagerConnected()) { Object locationManager = context.getSystemService(LOCATION_SERVICE); if (locationManager != null) { mLocationManager = (LocationManager) locationManager; startLocationUpdatesWithoutPlayServices(); } } if (mLocationManager != null && mLocationProvider != null) { try { mLocation = mLocationManager.getLastKnownLocation(mLocationProvider); return mLocation; } catch (SecurityException e) { Log.e(TAG, String.format("Appium Settings has no access to %s location permission", mLocationProvider), e); } } } return null; }
Source:
<code>private CFG(BlockTree tree, Symbol.MethodSymbol symbol) { methodSymbol = symbol; exitBlock = createBlock(); currentBlock = createBlock(exitBlock); for (StatementTree statementTree : Lists.reverse(tree.body())) { build(statementTree); } for (Block b : gotos) { assert b.successors.isEmpty(); Tree s = b.terminator; assert s != null; String label; <START> if (s instanceof BreakStatementTree) { <END> label = ((BreakStatementTree) s).label().name(); } else { label = ((ContinueStatementTree) s).label().name(); } Block target = labels.get(label); if (target == null) { throw new IllegalStateException("Undeclared label: " + label); } b.successors.add(target); } for (Block b : blocks) { for (Block successor : b.successors) { successor.predecessors.add(b); } } }</code><technical_language>@benzonico this "instanceof" replaced "is"</technical_language>

Target:
private CFG(BlockTree tree, Symbol.MethodSymbol symbol) { methodSymbol = symbol; exitBlock = createBlock(); currentBlock = createBlock(exitBlock); for (StatementTree statementTree : Lists.reverse(tree.body())) { build(statementTree); } for (Block b : gotos) { assert b.successors.isEmpty(); Tree s = b.terminator; assert s != null; String label; if (s.is(Tree.Kind.BREAK_STATEMENT)) { label = ((BreakStatementTree) s).label().name(); } else { label = ((ContinueStatementTree) s).label().name(); } Block target = labels.get(label); if (target == null) { throw new IllegalStateException("Undeclared label: " + label); } b.successors.add(target); } for (Block b : blocks) { for (Block successor : b.successors) { successor.predecessors.add(b); } } }
Source:
<code>private synchronized CHANNEL getIdleChannel( AdvertisedSocketAddress catchUpAddress ) { CHANNEL channel = null; LinkedList<CHANNEL> channels = idleChannels.get( catchUpAddress ); if ( channels != null ) { channel = channels.poll(); if ( channel != null && !channel.isActive() ) { <START> dispose( channel ); <END> channel = null; } if ( channels.isEmpty() ) { idleChannels.remove( catchUpAddress ); } } return channel; }</code><technical_language>a while-loop here, channel !isActive()? e.g. exhaust suitable idle channels return null creation of a new</technical_language>

Target:
private synchronized CHANNEL getIdleChannel( AdvertisedSocketAddress catchUpAddress ) { CHANNEL channel = null; LinkedList<CHANNEL> channels = idleChannels.get( catchUpAddress ); if ( channels != null ) { while ( (channel = channels.poll()) != null ) { if ( channel.isActive() ) { break; } } if ( channels.isEmpty() ) { idleChannels.remove( catchUpAddress ); } } return channel; }
Source:
<code><START> private static int score(final MbusChannelElementsDto mbusChannelElements, <END> final ChannelElementValuesDto channelElementValues) { if (!matchesPartially(mbusChannelElements, channelElementValues)) { return -1; } int score = 0; if (mbusChannelElements.hasMbusIdentificationNumber() && channelElementValues.hasIdentificationNumber()) { score += 5; } if (mbusChannelElements.hasMbusManufacturerIdentification() && channelElementValues.hasManufacturerIdentification()) { score += 1; } if (mbusChannelElements.hasMbusVersion() && channelElementValues.hasVersion()) { score += 1; } if (mbusChannelElements.hasMbusDeviceTypeIdentification() && channelElementValues.hasDeviceTypeIdentification()) { score += 1; } return score; }</code><technical_language>Fix cyclomatic complexity sonar issue</technical_language>

Target:
private static int score(final MbusChannelElementsDto mbusChannelElements, final ChannelElementValuesDto channelElementValues) { if (!matchesPartially(mbusChannelElements, channelElementValues)) { return -1; } int score = 0; score += scoreForMbusIdentificationNumber(mbusChannelElements, channelElementValues, 5); score += scoreForMbusManufacturerIdentification(mbusChannelElements, channelElementValues, 1); score += scoreForMbusVersion(mbusChannelElements, channelElementValues, 1); score += scoreForMbusDeviceTypeIdentification(mbusChannelElements, channelElementValues, 1); return score; }
Source:
<code>public Image stereotypeIconToDisplay() { Image icon = null; boolean displayIcon = NotationUtils.getBooleanValue(hostView, StereotypeDisplayUtils.DISPLAY_ICON, false); if (displayIcon) { <START> Iterator<Stereotype> iter = getUMLElement().getAppliedStereotypes().iterator(); <END> while (iter.hasNext() && null == icon) { Stereotype appliedStereotype = iter.next(); icon = Activator.getIconElement(getUMLElement(), appliedStereotype, false); } } return icon; }</code><technical_language>a correct name for variable</technical_language>

Target:
public Image stereotypeIconToDisplay() { Image icon = null; boolean displayIcon = NotationUtils.getBooleanValue(hostView, StereotypeDisplayUtils.DISPLAY_ICON, false); if (displayIcon) { Stereotype appliedStereotype; Iterator<Stereotype> stereotypeIterator = getUMLElement().getAppliedStereotypes().iterator(); while (stereotypeIterator.hasNext() && null == icon) { appliedStereotype = stereotypeIterator.next(); icon = Activator.getIconElement(getUMLElement(), appliedStereotype, false); } } return icon; }
Source:
<code>private void logCommandInfo() { final char EQUAL = '='; final char SEP = ','; StringBuilder info = new StringBuilder(); String sep = ""; for (String o : createInfo.keySet()) { info.append(sep); info.append(o); info.append(EQUAL); info.append(createInfo.get(o)); <START> sep = (Character.valueOf(SEP)).toString(); <END> } log.infoFormat("{0} {1}", getClass().getName(), info.toString()); }</code><technical_language>define SEP final string "," instead of a character..</technical_language>

Target:
private void logCommandInfo() { final char EQUAL = '='; final String SEP = ","; StringBuilder info = new StringBuilder(); String sep = ""; for (String o : createInfo.keySet()) { info.append(sep); info.append(o); info.append(EQUAL); info.append(createInfo.get(o)); sep = SEP; } log.infoFormat("{0} {1}", getClass().getName(), info.toString()); }
Source:
<code>protected void reportResult(final String locationName, final RemotePolledService polledService, final PollStatus pollResult) { final OnmsMonitoringLocation location = this.monitoringLocationDao.get(locationName); final OnmsLocationSpecificStatus oldLocationSpecificStatus = this.locationSpecificStatusDao.getMostRecentStatusChange(location, polledService.getMonSvc()); <START> if (oldLocationSpecificStatus == null || oldLocationSpecificStatus.getPollResult().getStatusCode() != pollResult.getStatusCode()) { <END> final OnmsLocationSpecificStatus status = new OnmsLocationSpecificStatus(); status.setLocation(location); status.setMonitoredService(polledService.getMonSvc()); status.setPollResult(pollResult); this.locationSpecificStatusDao.saveStatusChange(status); try { sendRegainedOrLostServiceEvent(locationName, polledService.getMonSvc(), pollResult); } catch (final Exception e) { LOG.error("Unable to save result for location {}, monitored service ID {}.", locationSpecificStatusDao, polledService.getMonSvc().getId(), e); } } try { if (pollResult.getResponseTime() != null) { saveResponseTimeData(locationName, polledService.getMonSvc(), pollResult.getResponseTime(), polledService.getPkg()); } } catch (final Exception e) { LOG.error("Unable to save response time data for location {}, monitored service ID {}.", locationSpecificStatusDao, polledService.getMonSvc().getId(), e); } }</code><technical_language>update if reason changes</technical_language>

Target:
protected void reportResult(final String locationName, final RemotePolledService polledService, final PollStatus pollResult) { sessionUtils.withTransaction(() -> { final OnmsMonitoringLocation location = this.monitoringLocationDao.get(locationName); final OnmsLocationSpecificStatus oldLocationSpecificStatus = this.locationSpecificStatusDao.getMostRecentStatusChange(location, polledService.getMonSvc()); if (oldLocationSpecificStatus == null || oldLocationSpecificStatus.getPollResult().getStatusCode() != pollResult.getStatusCode() || (pollResult.getReason() != null && !pollResult.getReason().equals(oldLocationSpecificStatus.getPollResult().getReason()))) { final OnmsLocationSpecificStatus status = new OnmsLocationSpecificStatus(); status.setLocation(location); status.setMonitoredService(polledService.getMonSvc()); status.setPollResult(pollResult); this.locationSpecificStatusDao.saveStatusChange(status); try { sendRegainedOrLostServiceEvent(locationName, polledService.getMonSvc(), pollResult); } catch (final Exception e) { LOG.error("Unable to save result for location {}, monitored service ID {}.", locationSpecificStatusDao, polledService.getMonSvc().getId(), e); } } try { if (pollResult.getResponseTime() != null) { saveResponseTimeData(locationName, polledService.getMonSvc(), pollResult.getResponseTime(), polledService.getPkg()); } } catch (final Exception e) { LOG.error("Unable to save response time data for location {}, monitored service ID {}.", locationSpecificStatusDao, polledService.getMonSvc().getId(), e); } return null; }); }
Source:
<code>public List<ActionImpl> getActions() { <START> return actions; <END> }</code><technical_language>(return copy)</technical_language>

Target:
public List<Action> getActions() { return actions; }
Source:
<code><START> public void assertCompleteness(@Nonnull final Set<String> sexGenotypes, <END> @Nonnull final Set<String> contigs) { for (final String sexGenotype : sexGenotypes) { for (final String contig : contigs) { checkKey(sexGenotype, contig); } } }</code><technical_language>assertCompleteness methods private validation methods this class is immutable</technical_language>

Target:
private void assertCompleteness(@Nonnull final Set<String> sexGenotypes, @Nonnull final Set<String> contigs) { for (final String sexGenotype : sexGenotypes) { for (final String contig : contigs) { checkKey(sexGenotype, contig); } } }
Source:
<code>public void readAdditionalItemData(NBTTagCompound nbt) { <START> spells = ((List<Spell>) NBTExtras.NBTToList(nbt.getTagList("spells", Constants.NBT.TAG_STRING), <END> (NBTTagString tag) -> Spell.get(tag.getString()))); super.readAdditionalItemData(nbt); }</code><technical_language>NBTExtras replacement mentioned</technical_language>

Target:
public void readAdditionalItemData(NBTTagCompound nbt) { spells = ((List<Spell>) NBTHelper.getList(nbt.getTagList("spells", Constants.NBT.TAG_STRING), tag -> Spell.get(((NBTTagString) tag).getString()))); super.readAdditionalItemData(nbt); }
Source:
<code>public void testQuantileAtValueDouble() { <START> QuantileDigest qdigest = new QuantileDigest(1); addAll(qdigest, doubleToSortableLong(0), doubleToSortableLong(1), doubleToSortableLong(2), doubleToSortableLong(3), doubleToSortableLong(4), doubleToSortableLong(5), doubleToSortableLong(6), doubleToSortableLong(7), doubleToSortableLong(8), doubleToSortableLong(9)); <END> functionAssertions.assertFunction(format("quantile_at_value(CAST(X'%s' AS qdigest(double)), 5.6)", toHexString(qdigest)), DOUBLE, 0.6); functionAssertions.assertFunction(format("quantile_at_value(CAST(X'%s' AS qdigest(double)), -1.23)", toHexString(qdigest)), DOUBLE, null); functionAssertions.assertFunction(format("quantile_at_value(CAST(X'%s' AS qdigest(double)), 12.3)", toHexString(qdigest)), DOUBLE, null); functionAssertions.assertFunction(format("quantile_at_value(CAST(X'%s' AS qdigest(double)), nan())", toHexString(qdigest)), DOUBLE, null); }</code><technical_language>suggestion QuantileDigest qdigest = new QuantileDigest(1); ImmutableList.of(0, 1, 2, 3, 4, 5, 6, 7, 8, 9).stream() .mapToLong(FloatingPointBitsConverterUtil::doubleToSortableLong) .forEach(qdigest::add);</technical_language>

Target:
public void testQuantileAtValueDouble() { QuantileDigest qdigest = new QuantileDigest(1); ImmutableList.of(0, 1, 2, 3, 4, 5, 6, 7, 8, 9).stream() .mapToLong(FloatingPointBitsConverterUtil::doubleToSortableLong) .forEach(qdigest::add); functionAssertions.assertFunction(format("quantile_at_value(CAST(X'%s' AS qdigest(double)), 5.6)", toHexString(qdigest)), DOUBLE, 0.6); functionAssertions.assertFunction(format("quantile_at_value(CAST(X'%s' AS qdigest(double)), -1.23)", toHexString(qdigest)), DOUBLE, null); functionAssertions.assertFunction(format("quantile_at_value(CAST(X'%s' AS qdigest(double)), 12.3)", toHexString(qdigest)), DOUBLE, null); functionAssertions.assertFunction(format("quantile_at_value(CAST(X'%s' AS qdigest(double)), nan())", toHexString(qdigest)), DOUBLE, null); }
Source:
<code><START> protected void evalOpInternal(final Context context, final Supplier<GremlinExecutor> gremlinExecutorSupplier, <END> final BindingSupplier bindingsSupplier) throws OpProcessorException { ResponseHandlerContext rhc = new ResponseHandlerContext(context); try { evalOpInternal(rhc, gremlinExecutorSupplier, bindingsSupplier); } catch (Exception ex) { logger.warn("Unable to process script evaluation request: " + ex, ex); rhc.writeAndFlush(ResponseMessage.build(context.getRequestMessage()) .code(ResponseStatusCode.SERVER_ERROR) .statusAttributeException(ex) .statusMessage(ex.getMessage()).create()); } }</code><technical_language>good signature other people depend this. i thinking deprecate, this version of method, is necessary undesired. I guess, question is new method called called this method? other method private</technical_language>

Target:
protected void evalOpInternal(final Context context, final Supplier<GremlinExecutor> gremlinExecutorSupplier, final BindingSupplier bindingsSupplier) throws OpProcessorException { final ResponseHandlerContext rhc = new ResponseHandlerContext(context); try { evalOpInternal(rhc, gremlinExecutorSupplier, bindingsSupplier); } catch (Exception ex) { logger.warn("Unable to process script evaluation request: " + ex, ex); rhc.writeAndFlush(ResponseMessage.build(context.getRequestMessage()) .code(ResponseStatusCode.SERVER_ERROR) .statusAttributeException(ex) .statusMessage(ex.getMessage()).create()); } }
Source:
<code>public void runAtDriver(RuntimeContainer container) { Connection connection = null; try { connection = SnowflakeRuntimeHelper.connect(container, rowProperties.getConnectionProperties()); if (rowProperties.usePreparedStatement.getValue()) { try (PreparedStatement pstmt = connection.prepareStatement(rowProperties.query.getValue())) { SnowflakePreparedStatementUtils.fillPreparedStatement(pstmt, rowProperties.preparedStatementTable); pstmt.execute(); } } else { try (Statement statement = connection.createStatement()) { statement.executeQuery(rowProperties.query.getValue()); } } } catch (SQLException e) { if (dieOnError) { throw new ComponentException(e); } LOGGER.error(I18N_MESSAGES.getMessage("error.queryExecution"), e); } catch (IOException ioe) { if (dieOnError) { throw new ComponentException(ioe); <START> } <END> LOGGER.error(I18N_MESSAGES.getMessage("error.acquiringConnection"), ioe); } finally { if (connection != null) { try { SnowflakeRuntimeHelper.closeConnection(container, connection, rowProperties.getConnectionProperties()); } catch (SQLException e) { if (dieOnError) { throw new ComponentException(e); } LOGGER.error(I18N_MESSAGES.getMessage("error.closeConnection"), e); } } } }</code><technical_language>proposal: move this if clause in some private void throwComponentException(Exception e) method</technical_language>

Target:
public void runAtDriver(RuntimeContainer container) { Connection connection = null; try { connection = createConnection(container); if (rowProperties.usePreparedStatement()) { try (PreparedStatement pstmt = connection.prepareStatement(rowProperties.getQuery())) { SnowflakePreparedStatementUtils.fillPreparedStatement(pstmt, rowProperties.preparedStatementTable); pstmt.execute(); } } else { try (Statement statement = connection.createStatement()) { statement.executeQuery(rowProperties.getQuery()); } } } catch (SQLException e) { throwComponentException(e, "error.queryExecution"); } catch (IOException ioe) { throwComponentException(ioe, "error.acquiringConnection"); } finally { if (connection != null) { try { closeConnection(container, connection); } catch (SQLException e) { throw new ComponentException(e); } } } }
Source:
<code>protected boolean setAndValidateDiskProfiles() { if (getParameters().getDiskImage() != null <START> && DiskStorageType.IMAGE == getParameters().getDiskImage().getDiskStorageType()) { <END> Map<DiskImage, Guid> map = new HashMap<>(); map.put(getParameters().getDiskImage(), getStorageDomainId()); return validate(DiskProfileHelper.setAndValidateDiskProfiles(map)); } return true; }</code><technical_language>unneeded checks</technical_language>

Target:
protected boolean setAndValidateDiskProfiles() { return validate(DiskProfileHelper.setAndValidateDiskProfiles(Collections.singletonMap(getParameters().getDiskImage(), getStorageDomainId()))); }
Source:
<code>public int getNumPersistentStores() { return (int) getStoreNames().stream() .map(storeName -> getStorageFactoryClassName(storeName)) .filter(factoryName -> factoryName.isPresent()) <START> .filter(factoryName -> factoryName.get().equals(PERSISTENT_STORE_FACTORY)) <END> .count(); }</code><technical_language>This is inconsistent StoreProperties.isPersistedToDisk. there, is "persisted" if is in-memory store. do here</technical_language>

Target:
public int getNumPersistentStores() { return (int) getStoreNames().stream() .map(storeName -> getStorageFactoryClassName(storeName)) .filter(factoryName -> factoryName.isPresent()) .filter(factoryName -> !factoryName.get().equals(INMEMORY_KV_STORAGE_ENGINE_FACTORY)) .count(); }
Source:
<code>public static PillPayloadV2 decryptedToPillPayloadVersion3(final byte[] decryptedRawMotion) throws InvalidEncryptedPayloadException { final long maxAccelerationMS2; final long cosTheta; final long motionMask; try (final LittleEndianDataInputStream littleEndianDataInputStream = new LittleEndianDataInputStream(new ByteArrayInputStream(decryptedRawMotion))) { <START> final byte rawMaxByte = littleEndianDataInputStream.readByte(); <END> maxAccelerationMS2 = UnsignedBytes.toInt(rawMaxByte) << 7; cosTheta = littleEndianDataInputStream.readByte() & 0xFFL; motionMask = littleEndianDataInputStream.readLong(); }catch (IOException ioe){ throw new InvalidEncryptedPayloadException(ioe.getMessage()); } return PillPayloadV2.createWithMotionMask(1000 * maxAccelerationMS2, motionMask, cosTheta); }</code><technical_language>^ I this needs unsigned</technical_language>

Target:
public static PillPayloadV2 decryptedToPillPayloadVersion3(final byte[] decryptedRawMotion) throws InvalidEncryptedPayloadException { final double maxAccelerationMS2; final long cosTheta; final long motionMask; try (final LittleEndianDataInputStream littleEndianDataInputStream = new LittleEndianDataInputStream(new ByteArrayInputStream(decryptedRawMotion))) { final byte rawMaxByte = littleEndianDataInputStream.readByte(); maxAccelerationMS2 = (UnsignedBytes.toInt(rawMaxByte) << 7) * COUNTS_IN_G; cosTheta = littleEndianDataInputStream.readByte() & 0xFFL; motionMask = littleEndianDataInputStream.readLong(); }catch (IOException ioe){ throw new InvalidEncryptedPayloadException(ioe.getMessage()); } return PillPayloadV2.createWithMotionMask((long) (1000 * maxAccelerationMS2), motionMask, cosTheta); }
Source:
<code>public void testDestroy() throws Exception { final Checker checker = new Checker(); final DebugAuditAdapter auditAdapter = new DebugAuditAdapter(); checker.addListener(auditAdapter); final DebugFilter filter = new DebugFilter(); <START> checker.addFilter(filter); <END> final TestBeforeExecutionFileFilter fileFilter = new TestBeforeExecutionFileFilter(); checker.addBeforeExecutionFileFilter(fileFilter); checker.destroy(); getAcceptFileStartedMethod().invoke(checker, "Some File Name"); getFireAuditStartedMethod().invoke(checker); getFireAuditFinished().invoke(checker); checker.fireFileStarted("Some File Name"); checker.fireFileFinished("Some File Name"); final SortedSet<LocalizedMessage> messages = new TreeSet<>(); messages.add(new LocalizedMessage(0, 0, "a Bundle", "message.key", new Object[] {"arg"}, null, getClass(), null)); checker.fireErrors("Some File Name", messages); assertFalse("Checker.destroy() doesn't remove listeners.", auditAdapter.wasCalled()); assertFalse("Checker.destroy() doesn't remove filters.", filter.wasCalled()); assertFalse("Checker.destroy() doesn't remove file filters.", fileFilter.wasCalled()); }</code><technical_language>bad examples of reflection appeared here. invoked - checker.process(.....)</technical_language>

Target:
public void testDestroy() throws Exception { final Checker checker = new Checker(); final DebugAuditAdapter auditAdapter = new DebugAuditAdapter(); checker.addListener(auditAdapter); final DebugFilter filter = new DebugFilter(); checker.addFilter(filter); final TestBeforeExecutionFileFilter fileFilter = new TestBeforeExecutionFileFilter(); checker.addBeforeExecutionFileFilter(fileFilter); checker.destroy(); checker.process(Collections.singletonList(new File("Some File Name"))); final SortedSet<LocalizedMessage> messages = new TreeSet<>(); messages.add(new LocalizedMessage(0, 0, "a Bundle", "message.key", new Object[] {"arg"}, null, getClass(), null)); checker.fireErrors("Some File Name", messages); assertFalse("Checker.destroy() doesn't remove listeners.", auditAdapter.wasCalled()); assertFalse("Checker.destroy() doesn't remove filters.", filter.wasCalled()); assertFalse("Checker.destroy() doesn't remove file filters.", fileFilter.wasCalled()); }
Source:
<code>public EventBookingDTO updateBookingStatus(final String eventId, final Long userId, final BookingStatus bookingStatus, final Map additionalEventInformation) throws SegueDatabaseException { <START> dao.updateStatus(eventId, userId, null, bookingStatus, additionalEventInformation); <END> return this.getBookingByEventIdAndUserId(eventId, userId); }</code><technical_language>return this overloaded method's result requesting record twice</technical_language>

Target:
public EventBookingDTO updateBookingStatus(final String eventId, final Long userId, final BookingStatus bookingStatus, final Map additionalEventInformation) throws SegueDatabaseException { return updateBookingStatus(eventId, userId, null, bookingStatus, additionalEventInformation); }
Source:
<code>private void updatePing(EntityRef entity) { if(startMap.containsKey(entity) && endMap.containsKey(entity)) { ClientComponent clientComp = entity.getComponent(ClientComponent.class); long pingTime = Duration.between(startMap.get(entity), endMap.get(entity)).toMillis(); <START> clientComp.ping = String.valueOf(pingTime) + "ms"; <END> } }</code><technical_language>issue ping variable replicated clients is fixed a entity.saveComponent(clientComp) here</technical_language>

Target:
private void updatePing(EntityRef entity) { if (startMap.containsKey(entity) && endMap.containsKey(entity)) { long pingTime = Duration.between(startMap.get(entity), endMap.get(entity)).toMillis(); pingMap.put(entity, pingTime); } }
Source:
<code>protected void runOCBinary(MultiStatus multiStatus) { ConsoleUtils.registerConsoleListener(new ConsoleListener(this)); final MessageConsole console = showConsole(); final MessageConsoleStream os = console.newMessageStream(); os.setEncoding("UTF-8"); BufferedOutputStream stream = new BufferedOutputStream(os); try { final InputStream logs = new BufferedInputStream(capability.getLogs(true, key.container, OpenShiftBinaryOption.SKIP_TLS_VERIFY)); byte data = new byte [1024]; int read = 0; <START> while(running && !os.isClosed() && (read = logs.read(data)) != -1){ <END> os.write(data, 0, read); } } catch (OpenShiftException e) { OpenShiftUIActivator.getDefault().getLogger().logError(e); try { if(stream != null) stream.write(e.getMessage().getBytes()); } catch (IOException e1) { OpenShiftUIActivator.getDefault().getLogger().logError(e1); } } catch (IOException e) { if(!DOCUMENT_IS_CLOSED.equals(e.getMessage())) { OpenShiftUIActivator.getDefault().getLogger().logError("Exception reading pod log inputstream", e); } } finally { try { if(stream != null) stream.close(); } catch (IOException e) { OpenShiftUIActivator.getDefault().getLogger().logError("Exception while closing pod log inputstream", e); } } }</code><technical_language>is more safe !os.isClosed() condition os closed while logs is queried. If more efficient check !os.isClosed() reading avoid unnecessary work, checks, done</technical_language>

Target:
protected void runOCBinary(MultiStatus multiStatus) { ConsoleUtils.registerConsoleListener(new ConsoleListener(this)); final MessageConsole console = showConsole(); final MessageConsoleStream os = console.newMessageStream(); os.setEncoding("UTF-8"); try { final InputStream logs = new BufferedInputStream(capability.getLogs(true, key.container, OpenShiftBinaryOption.SKIP_TLS_VERIFY)); byte data = new byte [8192]; int read = 0; while(running && (read = logs.read(data)) != -1 && !os.isClosed()){ os.write(data, 0, read); } } catch (OpenShiftException e) { OpenShiftUIActivator.getDefault().getLogger().logError(e); try { if(os != null) os.write(e.getMessage().getBytes()); } catch (IOException e1) { OpenShiftUIActivator.getDefault().getLogger().logError(e1); } } catch (IOException e) { if(!DOCUMENT_IS_CLOSED.equals(e.getMessage())) { OpenShiftUIActivator.getDefault().getLogger().logError("Exception reading pod log inputstream", e); } } finally { try { if(os != null) os.close(); } catch (IOException e) { OpenShiftUIActivator.getDefault().getLogger().logError("Exception while closing pod log inputstream", e); } } }
Source:
<code>private void addButtonAlignment(Button button, ButtonAlignment alignment) { switch (alignment) { case LEFT: button.addStyleName(resources.windowCss().buttonAlignLeft()); break; case RIGHT: button.addStyleName(resources.windowCss().buttonAlignRight()); <START> break; <END> } }</code><technical_language>add default statement replace if..else</technical_language>

Target:
private void addButtonAlignment(Button button, ButtonAlignment alignment) { switch (alignment) { case LEFT: button.addStyleName(resources.windowCss().buttonAlignLeft()); break; case RIGHT: default: button.addStyleName(resources.windowCss().buttonAlignRight()); } }
Source:
<code>public synchronized void onLocationChanged(Location location) { Log.d(TAG, "Location Updated"); if (mLastLocation == null) { mNavProvider.locationUpdated(location); } else if (!LocationUtils.isDuplicate(mLastLocation, location)) { mNavProvider.locationUpdated(location); } <START> if ((BuildConfig.NAV_GPS_LOGGING) &&(mNavProvider.sectoCurDistance <= 300)) { <END> writeToLog(location); } mLastLocation = location; if (mNavProvider.getFinished()) { if (BuildConfig.NAV_GPS_LOGGING) { if (mFinishedTime == 0) { mFinishedTime = System.currentTimeMillis(); } else if (System.currentTimeMillis() - mFinishedTime >= 30000) { stopSelf(); } } else { stopSelf(); } } }</code><technical_language>Instead of hardcoding 300 here, reference variable defined (I think) for Get Ready notification</technical_language>

Target:
public synchronized void onLocationChanged(Location location) { Log.d(TAG, "Location Updated"); if (mLastLocation == null) { mNavProvider.locationUpdated(location); } else if (!LocationUtils.isDuplicate(mLastLocation, location)) { mNavProvider.locationUpdated(location); } if (BuildConfig.NAV_GPS_LOGGING && mNavProvider.mSectoCurDistance <= RECORDING_THRESHOLD) { writeToLog(location); } mLastLocation = location; if (mNavProvider.getFinished()) { if (BuildConfig.NAV_GPS_LOGGING) { if (mFinishedTime == 0) { mFinishedTime = System.currentTimeMillis(); } else if (System.currentTimeMillis() - mFinishedTime >= 30000) { stopSelf(); } } else { stopSelf(); } } }
Source:
<code>public AsyncDocumentClient build() { ifThrowIllegalArgException(this.serviceEndpoint == null, "cannot build client without service endpoint"); ifThrowIllegalArgException( <START> this.masterKeyOrResourceToken == null && (permissionFeed == null || permissionFeed.isEmpty()) <END> && this.tokenResolver == null && this.cosmosKeyCredential == null, "cannot build client without any one of masterKey, " + "resource token, permissionFeed, tokenResolver and cosmos key credential"); ifThrowIllegalArgException(cosmosKeyCredential != null && StringUtils.isEmpty(cosmosKeyCredential.getMasterKey()), "cannot build client without key credential"); RxDocumentClientImpl client = new RxDocumentClientImpl(serviceEndpoint, masterKeyOrResourceToken, permissionFeed, connectionPolicy, desiredConsistencyLevel, configs, tokenResolver, cosmosKeyCredential); client.init(); return client; }</code><technical_language>nit: this logic is duplicated CosmosClient - in place</technical_language>

Target:
public AsyncDocumentClient build() { ifThrowIllegalArgException(this.serviceEndpoint == null, "cannot build client without service endpoint"); ifThrowIllegalArgException( this.masterKeyOrResourceToken == null && (permissionFeed == null || permissionFeed.isEmpty()) && this.tokenResolver == null && this.cosmosKeyCredential == null, "cannot build client without any one of masterKey, " + "resource token, permissionFeed, tokenResolver and cosmos key credential"); ifThrowIllegalArgException(cosmosKeyCredential != null && StringUtils.isEmpty(cosmosKeyCredential.key()), "cannot build client without key credential"); RxDocumentClientImpl client = new RxDocumentClientImpl(serviceEndpoint, masterKeyOrResourceToken, permissionFeed, connectionPolicy, desiredConsistencyLevel, configs, tokenResolver, cosmosKeyCredential); client.init(); return client; }
Source:
<code>public void onLeavePrepare() { <START> log.debug("Executing onLeavePrepare with generation and memberId {}", generation(), memberId()); <END> Set<TopicPartition> droppedPartitions = new HashSet<>(subscriptions.assignedPartitions()); if (subscriptions.partitionsAutoAssigned() && !droppedPartitions.isEmpty()) { final Exception e; if (generation() != Generation.NO_GENERATION) { e = invokePartitionsRevoked(droppedPartitions); } else { e = invokePartitionsLost(droppedPartitions); } subscriptions.assignFromSubscribed(Collections.emptySet()); if (e != null) { throw new KafkaException("User rebalance callback throws an error", e); } } }</code><technical_language>generation change hb in this line line 702 below, this entry exact number, read out generation() object</technical_language>

Target:
public void onLeavePrepare() { final Generation currentGeneration = generation(); final String memberId = currentGeneration.memberId; log.debug("Executing onLeavePrepare with generation and memberId {}", currentGeneration, memberId); Set<TopicPartition> droppedPartitions = new HashSet<>(subscriptions.assignedPartitions()); if (subscriptions.partitionsAutoAssigned() && !droppedPartitions.isEmpty()) { final Exception e; if (generation() != Generation.NO_GENERATION) { e = invokePartitionsRevoked(droppedPartitions); } else { e = invokePartitionsLost(droppedPartitions); } subscriptions.assignFromSubscribed(Collections.emptySet()); if (e != null) { throw new KafkaException("User rebalance callback throws an error", e); } } }
Source:
<code>Mono<Response<AppendBlobItem>> appendBlockFromUrlWithResponse(String sourceUrl, BlobRange sourceRange, byte[] sourceContentMD5, AppendBlobAccessConditions destAccessConditions, SourceModifiedAccessConditions sourceAccessConditions, Context context) { sourceRange = sourceRange == null ? new BlobRange(0) : sourceRange; destAccessConditions = destAccessConditions == null ? new AppendBlobAccessConditions() : destAccessConditions; URL url; try { url = new URL(sourceUrl); } catch (MalformedURLException ex) { <START> throw logger.logExceptionAsError(new IllegalArgumentException(ex)); <END> } return this.azureBlobStorage.appendBlobs().appendBlockFromUrlWithRestResponseAsync(null, null, url, 0, sourceRange.toString(), sourceContentMD5, null, null, null, null, getCustomerProvidedKey(), destAccessConditions.getLeaseAccessConditions(), destAccessConditions.getAppendPositionAccessConditions(), destAccessConditions.getModifiedAccessConditions(), sourceAccessConditions, context) .map(rb -> new SimpleResponse<>(rb, new AppendBlobItem(rb.getDeserializedHeaders()))); }</code><technical_language>prefer add a message this, too. "'sourceUrl' is a valid url.", Ex)</technical_language>

Target:
Mono<Response<AppendBlobItem>> appendBlockFromUrlWithResponse(String sourceUrl, BlobRange sourceRange, byte[] sourceContentMD5, AppendBlobAccessConditions destAccessConditions, SourceModifiedAccessConditions sourceAccessConditions, Context context) { sourceRange = sourceRange == null ? new BlobRange(0) : sourceRange; destAccessConditions = destAccessConditions == null ? new AppendBlobAccessConditions() : destAccessConditions; URL url; try { url = new URL(sourceUrl); } catch (MalformedURLException ex) { throw logger.logExceptionAsError(new IllegalArgumentException("'sourceUrl' is not a valid url.")); } return this.azureBlobStorage.appendBlobs().appendBlockFromUrlWithRestResponseAsync(null, null, url, 0, sourceRange.toString(), sourceContentMD5, null, null, null, null, getCustomerProvidedKey(), destAccessConditions.getLeaseAccessConditions(), destAccessConditions.getAppendPositionAccessConditions(), destAccessConditions.getModifiedAccessConditions(), sourceAccessConditions, context) .map(rb -> new SimpleResponse<>(rb, new AppendBlobItem(rb.getDeserializedHeaders()))); }
Source:
<code>protected boolean isBetweenInclusiveOperator(ExpressionDTO prev, ExpressionDTO temp) { String prevOperator = prev.getOperator(); String tempOperator = temp.getOperator(); try { if (prevOperator.equals(BLCOperator.GREATER_OR_EQUAL.name()) && tempOperator.equals(BLCOperator.LESS_OR_EQUAL.name())) { return Long.parseLong(temp.getValue()) > Long.parseLong(prev.getValue()); } else if (prevOperator.equals(BLCOperator.LESS_OR_EQUAL.name()) && tempOperator.equals(BLCOperator.GREATER_OR_EQUAL.name())) { return Long.parseLong(prev.getValue()) > Long.parseLong(temp.getValue()); } return false; <START> } catch (NumberFormatException e) { <END> return false; } }</code><technical_language>log error warning</technical_language>

Target:
protected boolean isBetweenInclusiveOperator(ExpressionDTO prev, ExpressionDTO temp) { String prevOperator = prev.getOperator(); String prevVal = prev.getValue(); String tempOperator = temp.getOperator(); String tempVal = temp.getValue(); try { if (prevOperator.equals(BLCOperator.GREATER_OR_EQUAL.name()) && tempOperator.equals(BLCOperator.LESS_OR_EQUAL.name())) { return Long.parseLong(tempVal) > Long.parseLong(prevVal); } else if (prevOperator.equals(BLCOperator.LESS_OR_EQUAL.name()) && tempOperator.equals(BLCOperator.GREATER_OR_EQUAL.name())) { return Long.parseLong(prevVal) > Long.parseLong(tempVal); } return false; } catch (NumberFormatException e) { LOG.warn(String.format("Used string values in expression %s %s && %s %s", prevOperator, prevVal, tempOperator, tempVal)); return false; } }
Source:
<code>public Cube getCube(int cubeX, int cubeY, int cubeZ, Requirement req) { if (req == Requirement.GET_WATCHED){ PlayerCubeMap playerCubeMap = ((PlayerCubeMap)this.world.getPlayerChunkMap()); CubeWatcher cubeWatcher = playerCubeMap.getCubeWatcher(cubeX, cubeY, cubeZ); if(cubeWatcher == null) return null; else <START> return cubeWatcher.getCube(); <END> } Cube cube = cubeMap.get(cubeX, cubeY, cubeZ); if (req == Requirement.GET_CACHED || (cube != null && req.compareTo(Requirement.GENERATE) <= 0)) { return cube; } IColumn column = getColumn(cubeX, cubeZ, req); if (column == null) { return cube; } if (cube == null) { cube = AsyncWorldIOExecutor.syncCubeLoad(worldServer, cubeIO, this, cubeX, cubeY, cubeZ); onCubeLoaded(cube, column); } return postCubeLoadAttempt(cubeX, cubeY, cubeZ, cube, column, req); }</code><technical_language>Formatting</technical_language>

Target:
public Cube getCube(int cubeX, int cubeY, int cubeZ, Requirement req) { Cube cube = getLoadedCube(cubeX, cubeY, cubeZ); if (req == Requirement.GET_CACHED || (cube != null && req.compareTo(Requirement.GENERATE) <= 0)) { return cube; } IColumn column = getColumn(cubeX, cubeZ, req); if (column == null) { return cube; } if (cube == null) { cube = AsyncWorldIOExecutor.syncCubeLoad(worldServer, cubeIO, this, cubeX, cubeY, cubeZ); onCubeLoaded(cube, column); } return postCubeLoadAttempt(cubeX, cubeY, cubeZ, cube, column, req); }
Source:
<code><START> public Scope scope() { <END> return this.scope; }</code><technical_language>IMO, this method removed, need a getter in a builder pattern</technical_language>

Target:
public RuleScope scope() { return this.scope; }
Source:
<code>public void removeAndRestoreLogMessage() { gaeSimulation.loginAsAdmin("admin"); gaeSimulation.clearLogs(); <START> Instant twoDaysAgo = TimeHelper.getInstantDaysOffsetFromNow(-2); <END> insertLogMessagesAtTime(logMessages.get(LOG_MESSAGE_INDEX_TWO_DAYS_AGO), twoDaysAgo.toEpochMilli()); Instant yesterday = TimeHelper.getInstantDaysOffsetFromNow(-1); insertLogMessagesAtTime(logMessages.get(LOG_MESSAGE_INDEX_YESTERDAY), yesterday.toEpochMilli()); Instant today = TimeHelper.getInstantDaysOffsetFromNow(0); insertLogMessagesAtTime(logMessages.get(LOG_MESSAGE_INDEX_TODAY), today.toEpochMilli()); }</code><technical_language>A lot of Instants in this test class common, e.g. twoDaysAgo, yesterday, today. Is wise extract static variables in test class reuse them</technical_language>

Target:
public void removeAndRestoreLogMessage() { gaeSimulation.loginAsAdmin("admin"); gaeSimulation.clearLogs(); insertLogMessagesAtTime(logMessages.get(LOG_MESSAGE_INDEX_TWO_DAYS_AGO), TWO_DAYS_AGO.toEpochMilli()); insertLogMessagesAtTime(logMessages.get(LOG_MESSAGE_INDEX_YESTERDAY), YESTERDAY.toEpochMilli()); insertLogMessagesAtTime(logMessages.get(LOG_MESSAGE_INDEX_TODAY), TODAY.toEpochMilli()); }
Source:
<code>public boolean appliesTo(Object selection) { EObject eo = EMFHelper.getEObject(selection); if <START> (eo != null && <END> eo instanceof Element) { return UMLRTProfileUtils.isUMLRTProfileApplied((Element) eo); } return false; }</code><technical_language>need this condition (null is instance of class)</technical_language>

Target:
public boolean appliesTo(Object selection) { EObject eo = EMFHelper.getEObject(selection); if (eo instanceof Element) { return UMLRTProfileUtils.isUMLRTProfileApplied((Element) eo); } return false; }
Source:
<code>protected Result pushDownDereferences(Context context, JoinNode joinNode, BiMap<DereferenceExpression, VariableReferenceExpression> expressions) { Assignments.Builder leftSideDereferences = Assignments.builder(); Assignments.Builder rightSideDereferences = Assignments.builder(); for (Map.Entry<VariableReferenceExpression, DereferenceExpression> entry : expressions.inverse().entrySet()) { VariableReferenceExpression baseSymbol = getBase(entry.getValue(), context.getVariableAllocator().getTypes()); if (joinNode.getLeft().getOutputVariables().contains(baseSymbol)) { leftSideDereferences.put(entry.getKey(), castToRowExpression(entry.getValue())); } else { rightSideDereferences.put(entry.getKey(), castToRowExpression(entry.getValue())); } } PlanNode leftNode = createProjectBelow(joinNode.getLeft(), leftSideDereferences.build(), context.getIdAllocator()); PlanNode rightNode = createProjectBelow(joinNode.getRight(), rightSideDereferences.build(), context.getIdAllocator()); return Result.ofPlanNode(new JoinNode( context.getIdAllocator().getNextId(), joinNode.getType(), leftNode, rightNode, joinNode.getCriteria(), <START> ImmutableList.<VariableReferenceExpression>builder().addAll(leftNode.getOutputVariables()).addAll(rightNode.getOutputVariables()).build(), <END> joinNode.getFilter(), joinNode.getLeftHashVariable(), joinNode.getRightHashVariable(), joinNode.getDistributionType())); }</code><technical_language>formatting ImmutableList.<VariableReferenceExpression>builder() .addAll(leftNode.getOutputVariables()) .addAll(rightNode.getOutputVariables()) .build(),</technical_language>

Target:
protected Result pushDownDereferences(Context context, JoinNode joinNode, BiMap<DereferenceExpression, VariableReferenceExpression> expressions) { Assignments.Builder leftSideDereferences = Assignments.builder(); Assignments.Builder rightSideDereferences = Assignments.builder(); for (Map.Entry<VariableReferenceExpression, DereferenceExpression> entry : expressions.inverse().entrySet()) { VariableReferenceExpression baseSymbol = getBase(entry.getValue(), context.getVariableAllocator().getTypes()); if (joinNode.getLeft().getOutputVariables().contains(baseSymbol)) { leftSideDereferences.put(entry.getKey(), castToRowExpression(entry.getValue())); } else { rightSideDereferences.put(entry.getKey(), castToRowExpression(entry.getValue())); } } PlanNode leftNode = createProject(joinNode.getLeft(), leftSideDereferences.build(), context.getIdAllocator()); PlanNode rightNode = createProject(joinNode.getRight(), rightSideDereferences.build(), context.getIdAllocator()); return Result.ofPlanNode(new JoinNode( context.getIdAllocator().getNextId(), joinNode.getType(), leftNode, rightNode, joinNode.getCriteria(), ImmutableList.<VariableReferenceExpression>builder() .addAll(leftNode.getOutputVariables()) .addAll(rightNode.getOutputVariables()) .build(), joinNode.getFilter(), joinNode.getLeftHashVariable(), joinNode.getRightHashVariable(), joinNode.getDistributionType())); }
Source:
<code>public void addHostsAndBlockWeight(String[] hosts, long weight, StorageType[] storageTypes) { if (hosts == null || hosts.length == 0) { return; } addUniqueWeight(weight); for (int i = 0; i < hosts.length; i++) { long weightForSsd = 0; if (storageTypes != null && storageTypes.length == hosts.length && storageTypes[i] == StorageType.SSD) { <START> weightForSsd = weight; <END> } addHostAndBlockWeight(hosts[i], weight, weightForSsd); } }</code><technical_language>break this if condition? this? if (storageTypes != null && storageTypes.length == hosts.length){ for (int i = 0; i < hosts.length; i++) { long weightForSsd = 0; if (storageTypes[i] == StorageType.SSD){ weightForSsd = weight; } addHostAndBlockWeight(hosts[i], weight, weightForSsd); } }</technical_language>

Target:
public void addHostsAndBlockWeight(String[] hosts, long weight, StorageType[] storageTypes) { if (hosts == null || hosts.length == 0) { return; } addUniqueWeight(weight); if (storageTypes != null && storageTypes.length == hosts.length) { for (int i = 0; i < hosts.length; i++) { long weightForSsd = 0; if (storageTypes[i] == StorageType.SSD) { weightForSsd = weight; } addHostAndBlockWeight(hosts[i], weight, weightForSsd); } } else { for (String hostname : hosts) { addHostAndBlockWeight(hostname, weight, 0); } } }
Source:
<code>public ResponseEntity<?> removeSession(@RequestHeader("X-Auth-Token") String xAuth) { if (!Strings.isNullOrEmpty(xAuth)) { Optional<AuthenticationToken> tokenOptional = tokenRepository.findByToken(xAuth); AuthenticationToken token = tokenOptional.orElseThrow(XAuthTokenNotFoundException::new); <START> if (!token.isValid()) { <END> throw new InvalidTokenException(); } else { token.revoke(); tokenRepository.saveAndFlush(token); return createResponseEntity(HttpStatus.OK, "Successfully logged out"); } } else { throw new IllegalArgumentException("No X-Auth-Token present"); } }</code><technical_language>this amount of logic, finally time for a dedicated AuthenticationService</technical_language>

Target:
public ResponseEntity<?> removeSession(@RequestHeader("X-Auth-Token") String xAuth) { authenticationService.removeAuthToken(xAuth); return createResponseEntity(HttpStatus.OK, "Successfully logged out"); }