auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void cyl(CommandContext args, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { Pattern block = we.getBlockPattern(player, args.getString(0)); String[] radiuses = args.getString(1).split(","); final double radiusX, radiusZ; switch (radiuses.length) { case 1: radiusX = radiusZ = Math.max(1, Double.parseDouble(radiuses[0])); break; case 2: radiusX = Math.max(1, Double.parseDouble(radiuses[0])); radiusZ = Math.max(1, Double.parseDouble(radiuses[1])); break; default: player.printError("You must either specify 1 or 2 radius values."); return; } int height = args.argsLength() > 2 ? args.getInteger(2) : 1; Vector pos = session.getPlacementPosition(player); int affected = editSession.makeCylinder(pos, block, radiusX, radiusZ, height, true); <START> player.findFreePosition(); <END> player.print(affected + " block(s) have been created."); }</code><technical_language>I disagree this change. If making cylinders other, I want plugin moving time</technical_language>

Target:
public void cyl(CommandContext args, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { Pattern block = we.getBlockPattern(player, args.getString(0)); String[] radiuses = args.getString(1).split(","); final double radiusX, radiusZ; switch (radiuses.length) { case 1: radiusX = radiusZ = Math.max(1, Double.parseDouble(radiuses[0])); break; case 2: radiusX = Math.max(1, Double.parseDouble(radiuses[0])); radiusZ = Math.max(1, Double.parseDouble(radiuses[1])); break; default: player.printError("You must either specify 1 or 2 radius values."); return; } int height = args.argsLength() > 2 ? args.getInteger(2) : 1; Vector pos = session.getPlacementPosition(player); int affected = editSession.makeCylinder(pos, block, radiusX, radiusZ, height, true); player.print(affected + " block(s) have been created."); }
Source:
<code>public boolean consumes(ISemanticToken token) { IASTNode node= token.getNode(); if (node instanceof IASTName) { if (node instanceof ICPPASTQualifiedName) { return false; } IBinding binding= token.getBinding(); if (binding instanceof ICPPEnumeration) { <START> IType fType = ((ICPPEnumeration) binding).getFixedType(); <END> return fType == null; } if (binding instanceof IEnumeration) { return true; } if (binding instanceof ICPPUnknownBinding) { if (heuristicallyResolvesToEnumeration((ICPPUnknownBinding) binding)) { return true; } } } return false; }</code><technical_language>Given: enum E1 { A, B }; enum E2 : short { C, D }; enum class E3 { E, F }; enum class E4 : short { G, H }; getFixedType() return non-null for E2, E3, E4, I assume want new highlighting apply E3 E4. want instead is ICPPEnumeration.isScoped(), return true for E3 E4</technical_language>

Target:
public boolean consumes(ISemanticToken token) { IASTNode node= token.getNode(); if (node instanceof IASTName) { if (node instanceof ICPPASTQualifiedName) { return false; } IBinding binding= token.getBinding(); if (binding instanceof ICPPUnknownBinding) { binding = heuristicallyResolvesToEnumeration((ICPPUnknownBinding) binding); } if (binding instanceof IEnumeration) { if (binding instanceof ICPPEnumeration) { return !((ICPPEnumeration) binding).isScoped(); } return true; } } return false; }
Source:
<code>public List<GHAsset> getAssets() throws IOException { <START> Requester builder = owner.root.retrieve().method("POST"); <END> GHAsset[] assets = builder.method("GET").withUrlPath(getApiTailUrl("assets")).toArray(GHAsset[].class); return Arrays.asList(GHAsset.wrap(assets, this)); }</code><technical_language>remove method("POST")</technical_language>

Target:
public List<GHAsset> getAssets() throws IOException { Requester builder = owner.root.createRequest(); GHAsset[] assets = builder.withUrlPath(getApiTailUrl("assets")).fetchArray(GHAsset[].class); return Arrays.asList(GHAsset.wrap(assets, this)); }
Source:
<code><START> public XBee64BitAddress(int[] address) { <END> this.address = new byte[address.length]; for (int i = 0; i < address.length; i++) this.address[i] = (byte)address[i]; }</code><technical_language>Throw a NullPointerException if address is null. int array provided establish a concrete length a min/max length</technical_language>

Target:
public XBee64BitAddress(int[] address) { if (address == null) throw new NullPointerException("Address cannot be null."); if (address.length > 2) throw new IllegalArgumentException("Address cannot contain more than 8 integers."); this.address = new byte[address.length]; for (int i = 0; i < address.length; i++) this.address[i] = (byte)address[i]; }
Source:
<code>private boolean hasImmutableAnnotation(DetailAST classDefToken) { final DetailAST modifiersToken = classDefToken.findFirstToken(TokenTypes.MODIFIERS); <START> for (DetailAST ast = modifiersToken.getFirstChild(); ast != null; ast = ast.getNextSibling()) { <END> if (ast.getType() == TokenTypes.ANNOTATION) { final DetailAST annotationIdent = ast.findFirstToken(TokenTypes.IDENT); return annotationIdent != null && IMMUTABLE_NOTATION.equals(annotationIdent.getText()); } } return false; }</code><technical_language>Consider AnnotationUtil.getAnnotation(...)</technical_language>

Target:
private boolean hasImmutableAnnotation(DetailAST classDefToken) { DetailAST immutableAnnotation = AnnotationUtil.getAnnotation(classDefToken, IMMUTABLE_NOTATION); return immutableAnnotation != null; }
Source:
<code>public void testConditionalReplaceFromNonOwner() { initAndTest(); Cache<Object, String> nonOwner = getFirstNonOwner("k1"); boolean retval = nonOwner.replace("k1", "valueX", "value2"); if (testRetVals) assertFalse(retval, "Should not have replaced"); assertOnAllCachesAndOwnership("k1", "value"); <START> assertFalse(nonOwner.getAdvancedCache().getComponentRegistry().getComponent(DistributionManager.class).getCacheTopology().isWriteOwner("k1")); <END> retval = nonOwner.replace("k1", "value", "value2"); asyncWait("k1", ReplaceCommand.class, getSecondNonOwner("k1")); if (testRetVals) assertTrue(retval,"Should have replaced"); assertOnAllCachesAndOwnership("k1", "value2"); }</code><technical_language>a helper method TestingUtil.extractComponent</technical_language>

Target:
public void testConditionalReplaceFromNonOwner() { initAndTest(); Cache<Object, String> nonOwner = getFirstNonOwner("k1"); boolean retval = nonOwner.replace("k1", "valueX", "value2"); if (testRetVals) assertFalse(retval, "Should not have replaced"); assertOnAllCachesAndOwnership("k1", "value"); assertFalse(extractComponent(nonOwner, DistributionManager.class).getCacheTopology().isWriteOwner("k1")); retval = nonOwner.replace("k1", "value", "value2"); asyncWait("k1", ReplaceCommand.class, getSecondNonOwner("k1")); if (testRetVals) assertTrue(retval,"Should have replaced"); assertOnAllCachesAndOwnership("k1", "value2"); }
Source:
<code>private static String getVUSOncogenicSummary(Alteration alteration) { List<Evidence> evidences = EvidenceUtils.getEvidence(Collections.singletonList(alteration), Collections.singleton(EvidenceType.VUS), null); String summary = null; Date lastEdit = null; for (Evidence evidence : evidences) { if (evidence.getLastEdit() == null) { continue; } if (lastEdit == null) { lastEdit = evidence.getLastEdit(); } else if (lastEdit.compareTo(evidence.getLastEdit()) < 0) { lastEdit = evidence.getLastEdit(); } } if (lastEdit != null) { SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy"); summary = "As of " + sdf.format(lastEdit) + ", no functional data about this alteration was available."; <START> } <END> return summary; }</code><technical_language>vus lastEdit</technical_language>

Target:
private static String getVUSOncogenicSummary(Alteration alteration) { List<Evidence> evidences = EvidenceUtils.getEvidence(Collections.singletonList(alteration), Collections.singleton(EvidenceType.VUS), null); String summary = "no functional data about this alteration was available."; Date lastEdit = null; for (Evidence evidence : evidences) { if (evidence.getLastEdit() == null) { continue; } if (lastEdit == null) { lastEdit = evidence.getLastEdit(); } else if (lastEdit.compareTo(evidence.getLastEdit()) < 0) { lastEdit = evidence.getLastEdit(); } } if (lastEdit != null) { SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy"); summary = "as of " + sdf.format(lastEdit) + ", " + summary; } return summary.substring(0, 1).toUpperCase() + summary.substring(1); }
Source:
<code>public RefreshLocalVisitor(IProgressMonitor monitor) { this.monitor = <START> SubMonitor.convert(monitor, <END> TOTAL_WORK); workspace = (Workspace) ResourcesPlugin.getWorkspace(); resourceChanged = false; String msg = Messages.resources_errorMultiRefresh; errors = new MultiStatus(ResourcesPlugin.PI_RESOURCES, IResourceStatus.FAILED_READ_LOCAL, msg, null); }</code><technical_language>one-argument version of convert, argument passed in is used</technical_language>

Target:
public RefreshLocalVisitor(IProgressMonitor monitor) { this.monitor = SubMonitor.convert(monitor); workspace = (Workspace) ResourcesPlugin.getWorkspace(); resourceChanged = false; String msg = Messages.resources_errorMultiRefresh; errors = new MultiStatus(ResourcesPlugin.PI_RESOURCES, IResourceStatus.FAILED_READ_LOCAL, msg, null); }
Source:
<code>public String getLanguage() { <START> if (null == this.language) { return ""; } return this.language; <END> }</code><technical_language>do in line. More lisibility</technical_language>

Target:
public String getLanguage() { return this.language!=null ? this.language : "" ; }
Source:
<code>private String getRelativeName(ObjectType objectType) { String name = objectType.getDisplayName(); <START> if (name.equals(namespace)) { <END> return name; } return !name.startsWith(namespace) ? name : name.substring(namespace.length() + 1); }</code><technical_language>I understand this change</technical_language>

Target:
private String getRelativeName(ObjectType objectType) { String name = objectType.getDisplayName(); return !name.startsWith(namespace) ? name : name.substring(namespace.length() + 1); }
Source:
<code>public Stage rerunStage(String pipelineName, String pipelineCounter, String stageName, HttpOperationResult result) { String identifier = StringUtils.join(Arrays.asList(pipelineName, pipelineCounter, stageName), "/"); HealthStateType healthStateType = HealthStateType.general(HealthStateScope.forStage(pipelineName, stageName)); Stage stage = null; try { stage = rerunStage(pipelineName, pipelineCounter, stageName, new ResultUpdatingErrorHandler(result)); if (result.isSuccess()) { result.accepted(String.format("Request to schedule stage %s accepted", identifier), "", healthStateType); } } catch (RuntimeException e) { String message = String.format( "Stage rerun request for stage [%s] could not be completed " + "because of an unexpected failure. Cause: %s", identifier, e.getMessage() ); LOGGER.error(message, e); <START> result.internalServerError(message, healthStateType); <END> } return stage; }</code><technical_language>catching RuntimeExceptions returning 500. Is do it? I throwing/catching runtime exceptions, create specific exceptions occur while triggering a stage</technical_language>

Target:
public Stage rerunStage(String pipelineName, String pipelineCounter, String stageName, HttpOperationResult result) { String identifier = StringUtils.join(Arrays.asList(pipelineName, pipelineCounter, stageName), "/"); HealthStateType healthStateType = HealthStateType.general(HealthStateScope.forStage(pipelineName, stageName)); Stage stage = null; try { stage = rerunStage(pipelineName, pipelineCounter, stageName, new ResultUpdatingErrorHandler(result)); if (result.isSuccess()) { result.accepted(String.format("Request to schedule stage %s accepted", identifier), "", healthStateType); } } catch (RuntimeException e) { if (result.isSuccess()) { String message = String.format( "Stage rerun request for stage [%s] could not be completed " + "because of an unexpected failure. Cause: %s", identifier, e.getMessage() ); LOGGER.error(message, e); result.internalServerError(message, healthStateType); } } return stage; }
Source:
<code>public int getOpacity() { Bitmap bm = bitmap; <START> return (bm == null || bm.hasAlpha() || bitmapPaint.getAlpha() < 255) <END> ? PixelFormat.TRANSLUCENT : PixelFormat.OPAQUE; }</code><technical_language>bm null</technical_language>

Target:
@Override public int getOpacity() { Bitmap bm = bitmap; return (bm.hasAlpha() || bitmapPaint.getAlpha() < 255) ? PixelFormat.TRANSLUCENT : PixelFormat.OPAQUE; }
Source:
<code>public <U> Vector<U> map(Function<? super T, ? extends U> mapper) { Objects.requireNonNull(mapper, "mapper is null"); final AtomicReference<Object[]> newLeading = new AtomicReference<>(Arrays.empty()); final Object[] newMiddle = new Object[middle.leafCount()]; final AtomicReference<Object[]> newTrailing = new AtomicReference<>(Arrays.empty()); <START> unsafeLeafIterator((leafCount, array, arrayStart, arrayLength) -> { <END> final Object[] copy = copyMap(mapper, array, arrayStart, arrayStart + arrayLength); if (leafCount == 0) { newLeading.set(copy); } else if (leafCount <= newMiddle.length) { newMiddle[leafCount - 1] = copy; } else { newTrailing.set(copy); } }); final BitMappedTrie<U> middle = BitMappedTrie.ofAll(newMiddle, this.middle.length(), BRANCHING_BASE); return ofAll(newLeading.get(), leadingOffset, middle, newTrailing.get(), trailingLength); }</code><technical_language>@paplorinc question above: > K, I introduce a Javaslang MutableWrapper for this then, assign values a lambda. > @danieldietrich? Please do introduce MutableWrapper. unsafeLeafIterator is wrong abstraction. I a suggestion, please hold horses. **Currently I need plan next release. This is top priority users serious problems.**</technical_language>

Target:
public <U> Vector<U> map(Function<? super T, ? extends U> mapper) { return ofAll(trie.map(mapper)); }
Source:
<code>private static String selectionToString(Table table) { <START> StringBuilder buffer = new StringBuilder(); <END> for (TableItem tableItem : table.getSelection()) { if (buffer.length() > 0) { buffer.append(System.lineSeparator()); } for (int column = 0; column < table.getColumnCount(); column++) { if (column > 0) { buffer.append('\t'); } buffer.append(tableItem.getText(column)); } } return buffer.toString(); }</code><technical_language>For new code I call builder instead of buffer</technical_language>

Target:
private static String selectionToString(Table table) { StringBuilder builder = new StringBuilder(); for (TableItem tableItem : table.getSelection()) { if (builder.length() > 0) { builder.append(System.lineSeparator()); } for (int column = 0; column < table.getColumnCount(); column++) { if (column > 0) { builder.append('\t'); } builder.append(tableItem.getText(column)); } } return builder.toString(); }
Source:
<code>public static final Image getDecoratedImage(final Image decoratorTarget, final List<IPapyrusDecoration> decorations, final Point size) { if (decoratorTarget == null) { return null; } if (decorations == null) { <START> return decoratorTarget; <END> } Image decoratedImage = null; String decoratedImageId = calcId(decoratorTarget, decorations); decoratedImage = Activator.getDefault().getImageRegistry().get(decoratedImageId); if (decoratedImage == null) { ImageDescriptor[] decorationImages = new ImageDescriptor[5]; IPapyrusDecoration[] decorationByPosition = new IPapyrusDecoration[5]; for (IPapyrusDecoration decoration : decorations) { IPapyrusDecoration existingDecoration = decorationByPosition[decoration.getPositionForJFace()]; if (existingDecoration == null || existingDecoration.getPriority() < decoration.getPriority()) { decorationImages[decoration.getPositionForJFace()] = decoration.getDecorationImageForME(); decorationByPosition[decoration.getPositionForJFace()] = decoration; } } ImageDescriptor decoratedImageDesc = new DecorationOverlayIcon(decoratorTarget, decorationImages, size); Activator.getDefault().getImageRegistry().put(decoratedImageId, decoratedImageDesc); return Activator.getDefault().getImageRegistry().get(decoratedImageId); } return decoratedImage; }</code><technical_language>Prefer 'return null' more code visiblity. -> previous test</technical_language>

Target:
public static final Image getDecoratedImage(final Image decoratorTarget, final List<IPapyrusDecoration> decorations, final Point size) { if (decoratorTarget == null) { return null; } if (decorations == null) { return decoratorTarget; } Image decoratedImage = null; String decoratedImageId = calcId(decoratorTarget, decorations); decoratedImage = Activator.getDefault().getImageRegistry().get(decoratedImageId); if (decoratedImage == null) { ImageDescriptor[] decorationImages = new ImageDescriptor[NB_DECORATIONS]; IPapyrusDecoration[] decorationByPosition = new IPapyrusDecoration[NB_DECORATIONS]; for (IPapyrusDecoration decoration : decorations) { IPapyrusDecoration existingDecoration = decorationByPosition[decoration.getPositionForJFace()]; if (existingDecoration == null || existingDecoration.getPriority() < decoration.getPriority()) { decorationImages[decoration.getPositionForJFace()] = decoration.getDecorationImageForME(); decorationByPosition[decoration.getPositionForJFace()] = decoration; } } ImageDescriptor decoratedImageDesc = new DecorationOverlayIcon(decoratorTarget, decorationImages, size); Activator.getDefault().getImageRegistry().put(decoratedImageId, decoratedImageDesc); return Activator.getDefault().getImageRegistry().get(decoratedImageId); } return decoratedImage; }
Source:
<code>public boolean doPreDeleteIdP(String idPName) throws IdentityProviderManagementException { String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext() .getTenantDomain(); try { destroyConnector(idPName, tenantDomain); } catch (IdentityProvisioningException e) { log.error("Error when provisioning IDP deletion", e); <START> throw new IdentityProviderManagementException("Error when provisioning IDP deletion",e); <END> } return true; }</code><technical_language>do log throw. throw is enough. wrong formatting ",e", ", e"</technical_language>

Target:
public boolean doPreDeleteIdP(String idPName) throws IdentityProviderManagementException { String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext() .getTenantDomain(); try { destroyConnector(idPName, tenantDomain); } catch (IdentityProvisioningException e) { throw new IdentityProviderManagementException("Error when provisioning IDP deletion", e); } return true; }
Source:
<code>private Optional<Metacard> generateMetacard( MimeType mimeType, MimeTypeToTransformerMapper mapper, TemporaryFileBackedOutputStream tfbos, String metacardId) { LOGGER.trace("ENTERING: generateMetacard"); List<InputTransformer> listOfCandidates = mapper.findMatches(InputTransformer.class, mimeType); if (LOGGER.isDebugEnabled()) { LOGGER.debug("List of matches for mimeType [{}]: {}", mimeType, listOfCandidates); } Metacard generatedMetacard = null; for (InputTransformer transformer : listOfCandidates) { try (InputStream inputStreamMessageCopy = tfbos.asByteSource().openStream()) { if (StringUtils.isEmpty(metacardId)) { generatedMetacard = transformer.transform(inputStreamMessageCopy); } else { generatedMetacard = transformer.transform(inputStreamMessageCopy, metacardId); } } catch (CatalogTransformerException e) { LOGGER.debug("Transformer could not create metacard.", transformer, e); } catch (IOException e) { LOGGER.debug("Could not open input stream", e); } if (generatedMetacard != null) { break; } } if (generatedMetacard == null) { <START> return Optional.empty(); <END> } LOGGER.trace("EXITING: generateMetacard"); return Optional.of(generatedMetacard); }</code><technical_language>guessMimeType() return null? If Optional.ofNullable()</technical_language>

Target:
private Optional<Metacard> generateMetacard( MimeType mimeType, MimeTypeToTransformerMapper mapper, TemporaryFileBackedOutputStream tfbos, String metacardId) { LOGGER.trace("ENTERING: generateMetacard"); List<InputTransformer> listOfCandidates = mapper.findMatches(InputTransformer.class, mimeType); if (LOGGER.isDebugEnabled()) { LOGGER.debug("List of matches for mimeType [{}]: {}", mimeType, listOfCandidates); } Metacard generatedMetacard = null; for (InputTransformer transformer : listOfCandidates) { try (InputStream inputStreamMessageCopy = tfbos.asByteSource().openStream()) { if (StringUtils.isEmpty(metacardId)) { generatedMetacard = transformer.transform(inputStreamMessageCopy); } else { generatedMetacard = transformer.transform(inputStreamMessageCopy, metacardId); } } catch (CatalogTransformerException e) { LOGGER.debug("Transformer could not create metacard.", transformer, e); } catch (IOException e) { LOGGER.debug("Could not open input stream", e); } if (generatedMetacard != null) { break; } } LOGGER.trace("EXITING: generateMetacard"); return Optional.ofNullable(generatedMetacard); }
Source:
<code>public void addFeatures() { DefaultBiomeFeatures.addStructures(this); DefaultBiomeFeatures.addStoneVariants(this); DefaultBiomeFeatures.addOres(this); addFeature(GenerationStage.Decoration.SURFACE_STRUCTURES, Biome.createDecoratedFeature(TropicraftFeatures.VILLAGE.get(), IFeatureConfig.NO_FEATURE_CONFIG, Placement.NOPE, IPlacementConfig.NO_PLACEMENT_CONFIG)); addStructure(TropicraftFeatures.VOLCANO.get(), IFeatureConfig.NO_FEATURE_CONFIG); addFeature(GenerationStage.Decoration.SURFACE_STRUCTURES, createDecoratedFeature(TropicraftFeatures.VOLCANO.get(), IFeatureConfig.NO_FEATURE_CONFIG, Placement.NOPE, IPlacementConfig.NO_PLACEMENT_CONFIG)); <START> addStructure(TropicraftFeatures.HOME_TREE.get(), new VillageConfig(Constants.MODID + ":home_tree/starts", 10)); <END> addFeature(GenerationStage.Decoration.SURFACE_STRUCTURES, createDecoratedFeature(TropicraftFeatures.HOME_TREE.get(), new VillageConfig(Constants.MODID + ":home_tree/starts", 10), Placement.NOPE, IPlacementConfig.NO_PLACEMENT_CONFIG)); }</code><technical_language>want this in biomes do we? jungle</technical_language>

Target:
public void addFeatures() { DefaultBiomeFeatures.addStructures(this); DefaultBiomeFeatures.addStoneVariants(this); DefaultBiomeFeatures.addOres(this); addFeature(GenerationStage.Decoration.SURFACE_STRUCTURES, Biome.createDecoratedFeature(TropicraftFeatures.VILLAGE.get(), IFeatureConfig.NO_FEATURE_CONFIG, Placement.NOPE, IPlacementConfig.NO_PLACEMENT_CONFIG)); addStructure(TropicraftFeatures.VOLCANO.get(), IFeatureConfig.NO_FEATURE_CONFIG); addFeature(GenerationStage.Decoration.SURFACE_STRUCTURES, createDecoratedFeature(TropicraftFeatures.VOLCANO.get(), IFeatureConfig.NO_FEATURE_CONFIG, Placement.NOPE, IPlacementConfig.NO_PLACEMENT_CONFIG)); }
Source:
<code>@After public void agentCleanup() throws IOException, InterruptedException { <START> if (testExecuted) { <END> s.toComputer().disconnect(new OfflineCause.UserCause(null, null)); j.jenkins.removeNode(s); } }</code><technical_language>suggestion if (s != null) { delete testExecuted flag</technical_language>

Target:
@After public void agentCleanup() throws IOException, InterruptedException { if (s != null) { j.jenkins.removeNode(s); } }
Source:
<code>private static @Nullable State getEventState(TimeEvent event) { if (event.hasValue()) { int value = event.getValue(); if (value == StateValues.READING_REQUEST) { return State.READ; } else if (value == StateValues.WRITING_REQUEST) { return State.WRITE; <START> } <END> } if (event instanceof TimeLinkEvent) { return State.LINK; } return null; }</code><technical_language>throw illegalstateexception here</technical_language>

Target:
private static @Nullable State getEventState(TimeEvent event) { if (event.hasValue()) { int value = event.getValue(); if (value == StateValues.READING_REQUEST) { return State.READ; } else if (value == StateValues.WRITING_REQUEST) { return State.WRITE; } throw new IllegalStateException("Disk Request Presentation provider: Unknown value: " + value); } if (event instanceof TimeLinkEvent) { return State.LINK; } return null; }
Source:
<code>public Collection<ParameterOption> getParameterOptions(URI uri, String param, Locale locale) { if (uri.toString().equals("system:i18n")) { Locale translation = locale != null ? locale : Locale.getDefault(); switch (param) { case "language": return getAvailable(locale, l -> new ParameterOption(l.getLanguage(), l.getDisplayLanguage(translation))); case "region": return getAvailable(locale, l -> new ParameterOption(l.getCountry(), l.getDisplayCountry(translation))); case "variant": return getAvailable(locale, l -> new ParameterOption(l.getVariant(), l.getDisplayVariant(translation))); case "timezone": Collection<ParameterOption> collection = new LinkedList<ParameterOption>(); String[] ids = TimeZone.getAvailableIDs(); <START> List<TimeZone> timeZones = Arrays.asList(ids).stream().map(TimeZone::getTimeZone) <END> .collect(Collectors.toList()); Collections.sort(timeZones, (s1, s2) -> s2.getRawOffset() - s1.getRawOffset()); for (TimeZone instance : timeZones) { collection.add(new ParameterOption(instance.getID(), getTimeZoneRepresentation(instance))); } return collection; default: return null; } } return null; }</code><technical_language>Instead of Arrays.asList(array).stream() Arrays.stream(array)</technical_language>

Target:
public Collection<ParameterOption> getParameterOptions(URI uri, String param, Locale locale) { if (uri.toString().equals("system:i18n")) { Locale translation = locale != null ? locale : Locale.getDefault(); return processParamType(param, locale, translation); } return null; }
Source:
<code>public static void main(String[] args) { try { String mode = args[0]; <START> if ("stop".equals(mode)) { <END> ServerLauncher.shutdown(true); } else { new OxdServerApplication().run(args); } } catch (Throwable e) { LOG.error("Failed to start oxd-server.", e); System.exit(1); } }</code><technical_language>if (args.length > 0 && "stop".equalsIgnoreCase(args[0])) { ServerLauncher.shutdown(true); return; }</technical_language>

Target:
public static void main(String[] args) { try { if (args.length > 0 && "stop".equalsIgnoreCase(args[0])) { ServerLauncher.shutdown(true); return; } else { new OxdServerApplication().run(args); } } catch (Throwable e) { if (args.length > 0 && "stop".equalsIgnoreCase(args[0])) { LOG.error("Failed to stop oxd-server.", e); } else { LOG.error("Failed to start oxd-server.", e); } System.exit(1); } }
Source:
<code>public void generateLibraryRs() throws MojoExecutionException { final Multimap<String, SymbolLoader> libMap = ArrayListMultimap.create(); for ( final Artifact lib : libraries ) { final File unpackedLibDirectory = mojo.getUnpackedLibFolder( lib ); final File rFile = new File( unpackedLibDirectory, "R.txt" ); if ( rFile.isFile() ) { final File libManifestFile = new File( unpackedLibDirectory, "AndroidManifest.xml" ); final String packageName = VariantConfiguration.getManifestPackage( libManifestFile ); log.debug( "Reading R for " + packageName + " at " + rFile ); final SymbolLoader libSymbols = loadSymbols( rFile ); libMap.put( packageName, libSymbols ); } } if ( libMap.isEmpty() ) { return; } final File projectR = new File( targetDirectory, "R.txt" ); final SymbolLoader fullSymbolValues = loadSymbols( projectR ); for ( final String packageName : libMap.keySet() ) { <START> log.info( "Generating R file for aar: " + packageName ); <END> final Collection<SymbolLoader> symbols = libMap.get( packageName ); final SymbolWriter writer = new SymbolWriter( genDirectory.getAbsolutePath(), packageName, fullSymbolValues ); for ( SymbolLoader symbolLoader : symbols ) { writer.addSymbolsToWrite( symbolLoader ); } writeSymbols( writer, packageName ); } }</code><technical_language>this is currently for aar for apklib</technical_language>

Target:
public void generateLibraryRs() throws MojoExecutionException { final Multimap<String, SymbolLoader> libMap = ArrayListMultimap.create(); for ( final Artifact lib : libraries ) { final File unpackedLibDirectory = mojo.getUnpackedLibFolder( lib ); final File rFile = new File( unpackedLibDirectory, "R.txt" ); if ( rFile.isFile() ) { final File libManifestFile = new File( unpackedLibDirectory, "AndroidManifest.xml" ); final String packageName = VariantConfiguration.getManifestPackage( libManifestFile ); log.debug( "Reading R for " + packageName + " at " + rFile ); final SymbolLoader libSymbols = loadSymbols( rFile ); libMap.put( packageName, libSymbols ); } } if ( libMap.isEmpty() ) { return; } final File projectR = new File( targetDirectory, "R.txt" ); final SymbolLoader fullSymbolValues = loadSymbols( projectR ); for ( final String packageName : libMap.keySet() ) { log.info( "Generating R file for " + libraryType + " : " + packageName ); final Collection<SymbolLoader> symbols = libMap.get( packageName ); final SymbolWriter writer = new SymbolWriter( genDirectory.getAbsolutePath(), packageName, fullSymbolValues ); for ( SymbolLoader symbolLoader : symbols ) { writer.addSymbolsToWrite( symbolLoader ); } writeSymbols( writer, packageName ); } }
Source:
<code>static String getSQL(Token[] statement) { boolean wasDelimiter = true; StringBuffer sb = new StringBuffer(); for (int i = 0; i < statement.length; i++) { if (!statement[i].isDelimiter && <START> (!wasDelimiter || (i != 0 && statement[i - 1].getSQL().equals(")")))) { <END> sb.append(' '); } sb.append(statement[i].getSQL()); wasDelimiter = statement[i].isDelimiter; } return sb.toString(); }</code><technical_language>java (!wasDelimiter || (i > 0 && ")".equals(statement[i - 1].getSQL()))</technical_language>

Target:
static String getSQL(Token[] statement) { boolean wasDelimiter = true; StringBuffer sb = new StringBuffer(); for (int i = 0; i < statement.length; i++) { if (!statement[i].isDelimiter && (!wasDelimiter || (i > 0 && ")".equals(statement[i - 1].getSQL())))) { sb.append(' '); } sb.append(statement[i].getSQL()); wasDelimiter = statement[i].isDelimiter; } return sb.toString(); }
Source:
<code>RequestStatus getStatus() { FreenetURI finalURI = getFinalURI(); InsertExceptionMode failureCode = null; String failureReasonShort = null; String failureReasonLong = null; if(putFailedMessage != null) { failureCode = putFailedMessage.code; failureReasonShort = putFailedMessage.getShortFailedMessage(); failureReasonShort = putFailedMessage.getLongFailedMessage(); } String mimeType = null; if(persistence == Persistence.FOREVER) { mimeType = clientMetadata.getMIMEType(); } File fnam = getOrigFilename(); if(fnam != null) fnam = new File(fnam.getPath()); int total=0, min=0, fetched=0, fatal=0, failed=0; <START> Date latestSuccess = CurrentTimeUTC.get(), latestFailure = null; <END> boolean totalFinalized = false; if(progressMessage != null) { if(progressMessage instanceof SimpleProgressMessage) { SimpleProgressMessage msg = (SimpleProgressMessage)progressMessage; total = (int) msg.getTotalBlocks(); min = (int) msg.getMinBlocks(); fetched = (int) msg.getFetchedBlocks(); latestSuccess = msg.getLatestSuccess(); fatal = (int) msg.getFatalyFailedBlocks(); failed = (int) msg.getFailedBlocks(); latestFailure = msg.getLatestFailure(); totalFinalized = msg.isTotalFinalized(); } } return new UploadFileRequestStatus( identifier, persistence, started, finished, succeeded, total, min, fetched, latestSuccess, fatal, failed, latestFailure, totalFinalized, priorityClass, finalURI, uri, failureCode, failureReasonShort, failureReasonLong, getDataSize(), mimeType, fnam, isCompressing()); }</code><technical_language>Multiple declarations in line too</technical_language>

Target:
RequestStatus getStatus() { FreenetURI finalURI = getFinalURI(); InsertExceptionMode failureCode = null; String failureReasonShort = null; String failureReasonLong = null; if(putFailedMessage != null) { failureCode = putFailedMessage.code; failureReasonShort = putFailedMessage.getShortFailedMessage(); failureReasonShort = putFailedMessage.getLongFailedMessage(); } String mimeType = null; if(persistence == Persistence.FOREVER) { mimeType = clientMetadata.getMIMEType(); } File fnam = getOrigFilename(); if(fnam != null) fnam = new File(fnam.getPath()); int total=0, min=0, fetched=0, fatal=0, failed=0; Date latestSuccess = CurrentTimeUTC.get(); Date latestFailure = null; boolean totalFinalized = false; if(progressMessage != null) { if(progressMessage instanceof SimpleProgressMessage) { SimpleProgressMessage msg = (SimpleProgressMessage)progressMessage; total = (int) msg.getTotalBlocks(); min = (int) msg.getMinBlocks(); fetched = (int) msg.getFetchedBlocks(); latestSuccess = msg.getLatestSuccess(); fatal = (int) msg.getFatalyFailedBlocks(); failed = (int) msg.getFailedBlocks(); latestFailure = msg.getLatestFailure(); totalFinalized = msg.isTotalFinalized(); } } return new UploadFileRequestStatus( identifier, persistence, started, finished, succeeded, total, min, fetched, latestSuccess, fatal, failed, latestFailure, totalFinalized, priorityClass, finalURI, uri, failureCode, failureReasonShort, failureReasonLong, getDataSize(), mimeType, fnam, isCompressing()); }
Source:
<code>public Set<Warning> getWarnings() { ExtensionList<UpdateSiteWarningsConfiguration> list = ExtensionList.lookup(UpdateSiteWarningsConfiguration.class); if (list.size() == 0) { <START> return null; <END> } Set<Warning> warnings = new HashSet<>(); UpdateSiteWarningsConfiguration configuration = list.get(0); for (Warning warning: configuration.getAllWarnings()) { if (configuration.isIgnored(warning)) { continue; } if (!warning.isPluginWarning(this.name)) { continue; } if (!warning.isRelevantToVersion(new VersionNumber(this.version))) { continue; } warnings.add(warning); } return warnings; }</code><technical_language>empty list is</technical_language>

Target:
public Set<Warning> getWarnings() { ExtensionList<UpdateSiteWarningsConfiguration> list = ExtensionList.lookup(UpdateSiteWarningsConfiguration.class); if (list.size() == 0) { return Collections.emptySet(); } Set<Warning> warnings = new HashSet<>(); UpdateSiteWarningsConfiguration configuration = list.get(0); for (Warning warning: configuration.getAllWarnings()) { if (configuration.isIgnored(warning)) { continue; } if (!warning.isPluginWarning(this.name)) { continue; } if (!warning.isRelevantToVersion(new VersionNumber(this.version))) { continue; } warnings.add(warning); } return warnings; }
Source:
<code>public void testTxRemoteNodeFailover(){ withAllIsolationsAndConcurrencies(new IgniteClosure<Object, Void>() { @Override public Void apply(Object o) { try { txRemoteNodeFailover(); } <START> catch (Exception ignore) { <END> ignore.printStackTrace(); assert false : "Impossible situation"; } return null; } }); }</code><technical_language>rename "ignore" "ignired" Please fail(): <LINK_0></technical_language>

Target:
public void testTxRemoteNodeFailover() throws Exception { startGrid(getTestIgniteInstanceName(0)); runWithAllIsolations(new IgniteCallable<Void>() { @Override public Void call() throws Exception { txRemoteNodeFailover(); return null; } }); stopAllGrids(); }
Source:
<code>private static void ignoreTest(ITestAnnotation annotation, Ignore ignore) { if (ignore != null) { annotation.setEnabled(false); if (annotation.getDescription() == null || annotation.getDescription().isEmpty()) { annotation.setDescription(ignore.value()); } else { <START> annotation.setDescription(ignore.value() + ": " + annotation.getDescription()); <END> } } }</code><technical_language>add empty() check for ignore.value() well, this concatenation if user for value(), end setting a description : regression kind of odd. I add empty check for decide set descriptions</technical_language>

Target:
private static void ignoreTest(ITestAnnotation annotation, Ignore ignore) { if (ignore == null) { return; } annotation.setEnabled(false); updateDescription(annotation, ignore); }
Source:
<code>public LanguageFilterServer() { <START> this.filterBoxService <END> = new FilterBoxService(this); this.filterWorkspaceService = new FilterWorkspaceService(); }</code><technical_language>Remove this</technical_language>

Target:
public LanguageFilterServer() { filterBoxService = new FilterBoxService(this); filterWorkspaceService = new FilterWorkspaceService(); }
Source:
<code>private <T extends Node<?> & TestDescriptor> T firstChild(TestDescriptor engineDescriptor, Class<T> testDescriptorClass) { return (T) engineDescriptor.getChildren().stream() .filter(testDescriptorClass::isInstance) .findFirst() <START> .orElseGet(() -> fail("No child with class " + testDescriptorClass + " found")); <END> }</code><technical_language>Nitpicking: "with class" --> "of type"</technical_language>

Target:
private <T extends Node<?> & TestDescriptor> T firstChild(TestDescriptor engineDescriptor, Class<T> testDescriptorClass) { return (T) engineDescriptor.getChildren().stream() .filter(testDescriptorClass::isInstance) .findFirst() .orElseGet(() -> fail("No child of type " + testDescriptorClass + " found")); }
Source:
<code>public void doubleDirectory() throws Exception { int gcWaitTime = 1000; <START> File firstDir = new File("dir1"); <END> File secondDir = new File("dir2"); ServerConfiguration conf = TestBKConfiguration.newServerConfiguration(); conf.setGcWaitTime(gcWaitTime); conf.setLedgerStorageClass(DbLedgerStorage.class.getName()); conf.setLedgerDirNames(new String[] { firstDir.getCanonicalPath(), secondDir.getCanonicalPath() }); Bookie bookie = new Bookie(conf); assertEquals(2, ((DbLedgerStorage) bookie.getLedgerStorage()).getLedgerStorageList().size()); bookie.shutdown(); FileUtils.deleteDirectory(firstDir); FileUtils.deleteDirectory(secondDir); }</code><technical_language>nit: a approach create subdir tmpDir initialized in this test suite. File firstDir = new File(tmpDir, "dir1"); File secondDir = new File(tmpDir, "dir2");</technical_language>

Target:
public void doubleDirectory() throws Exception { int gcWaitTime = 1000; File firstDir = new File(tmpDir, "dir1"); File secondDir = new File(tmpDir, "dir2"); ServerConfiguration conf = TestBKConfiguration.newServerConfiguration(); conf.setGcWaitTime(gcWaitTime); conf.setLedgerStorageClass(DbLedgerStorage.class.getName()); conf.setLedgerDirNames(new String[] { firstDir.getCanonicalPath(), secondDir.getCanonicalPath() }); Bookie bookie = new Bookie(conf); assertEquals(2, ((DbLedgerStorage) bookie.getLedgerStorage()).getLedgerStorageList().size()); bookie.shutdown(); }
Source:
<code>private void duplicateRow() { final Setting setting = getActionContext().getSetting(); final EObject eObject = setting.getEObject(); final EStructuralFeature eStructuralFeature = setting.getEStructuralFeature(); <START> final EditingDomain editingDomain = getActionContext().getEditingDomain(); <END> final List<?> toDuplicate = Arrays.asList( ((IStructuredSelection) getTableViewer().getSelection()).toArray()); final Collection<Object> copies = copyElements( eObject, eStructuralFeature, editingDomain, toDuplicate); getTableViewer().setSelection(new StructuredSelection(copies.iterator().next()), true); }</code><technical_language>a get editingdomain methid in abstract table ;-)</technical_language>

Target:
private void duplicateRow() { final Setting setting = getActionContext().getSetting(); final EObject eObject = setting.getEObject(); final EStructuralFeature eStructuralFeature = setting.getEStructuralFeature(); final List<?> toDuplicate = Arrays.asList( ((IStructuredSelection) getTableViewer().getSelection()).toArray()); final Collection<Object> copies = copyElements( eObject, eStructuralFeature, getEditingDomainForContainment(), toDuplicate); getTableViewer().setSelection(new StructuredSelection(copies.iterator().next()), true); }
Source:
<code>private Student generateStudentWithoutSectionObject() { Student expected = new Student("email@email.com", "name 1", "googleId.1", "comment 1", "courseId1", "team 1", null); <START> return expected; <END> }</code><technical_language>combine line above</technical_language>

Target:
private Student generateStudentWithoutSectionObject() { return new Student("email@email.com", "name 1", "googleId.1", "comment 1", "courseId1", "team 1", null); }
Source:
<code>RateLimitingRequestThrottler(DriverContext context, NanoClock clock) { this.logPrefix = context.sessionName(); this.clock = clock; DriverConfigProfile config = context.config().getDefaultProfile(); int maxRequestsPerSecond = config.getInt(DefaultDriverOption.REQUEST_THROTTLER_MAX_REQUESTS_PER_SECOND); <START> this.stateRef = new AtomicReference<>(State.initial(maxRequestsPerSecond, clock.nanoTime())); <END> this.maxQueueSize = config.getInt(DefaultDriverOption.REQUEST_THROTTLER_MAX_QUEUE_SIZE); Duration drainInterval = config.getDuration(DefaultDriverOption.REQUEST_THROTTLER_DRAIN_INTERVAL); this.drainIntervalNanos = drainInterval.toNanos(); this.scheduler = ((InternalDriverContext) context).nettyOptions().adminEventExecutorGroup().next(); LOG.debug( "[{}] Initializing with maxRequestsPerSecond = {}, maxQueueSize = {}, drainInterval = {}", logPrefix, maxRequestsPerSecond, maxQueueSize, drainInterval); }</code><technical_language>Nice idea a Clock implementation for testing</technical_language>

Target:
RateLimitingRequestThrottler(DriverContext context, NanoClock clock) { this.logPrefix = context.sessionName(); this.clock = clock; DriverConfigProfile config = context.config().getDefaultProfile(); this.maxRequestsPerSecond = config.getInt(DefaultDriverOption.REQUEST_THROTTLER_MAX_REQUESTS_PER_SECOND); this.maxQueueSize = config.getInt(DefaultDriverOption.REQUEST_THROTTLER_MAX_QUEUE_SIZE); Duration drainInterval = config.getDuration(DefaultDriverOption.REQUEST_THROTTLER_DRAIN_INTERVAL); this.drainIntervalNanos = drainInterval.toNanos(); this.lastUpdateNanos = clock.nanoTime(); this.storedPermits = maxRequestsPerSecond; this.scheduler = ((InternalDriverContext) context).nettyOptions().adminEventExecutorGroup().next(); LOG.debug( "[{}] Initializing with maxRequestsPerSecond = {}, maxQueueSize = {}, drainInterval = {}", logPrefix, maxRequestsPerSecond, maxQueueSize, drainInterval); }
Source:
<code>public Mono<T> getValue() { if (cache != null) { return Mono.just(cache); } return Mono.defer(() -> { if (!wip.getAndSet(true)) { try { cache = supplier.get(); sink.next(cache); } catch (Exception e) { <START> sink.error(e); <END> } finally { wip.set(false); } } return emitterProcessor.next(); }); }</code><technical_language>If thread runs supplier.get() throws error, subsequent getValue() calls return error. Instead, if attempt failed, next call getValue() attempt get supplier</technical_language>

Target:
public Mono<T> getValue() { return Mono.defer(() -> { if (cache != null) { return Mono.just(cache); } if (!wip.getAndSet(true)) { try { cache = supplier.get(); sink.next(cache); } catch (Exception e) { sink.error(e); } } return replayProcessor.next(); }); }
Source:
<code>public Xid[] recover(int flag) throws XAException { if (LOG.isTraceEnabled()) { <START> LOG.trace("DummyXAResource.recover(flag=" + flag + ")"); <END> } return null; }</code><technical_language>info</technical_language>

Target:
public Xid[] recover(int flag) throws XAException { LOG.info("DummyXAResource.recover(flag=" + flag + ")"); return null; }
Source:
<code>protected void configure() { final CommandName gerrit = Commands.named("gerrit"); command(gerrit, "approve").to(ReviewCommand.class); command(gerrit, "create-account").to(CreateAccountCommand.class); command(gerrit, "create-group").to(CreateGroupCommand.class); command(gerrit, "create-project").to(CreateProject.class); command(gerrit, "gsql").to(AdminQueryShell.class); command(gerrit, "set-reviewers").to(SetReviewersCommand.class); command(gerrit, "receive-pack").to(Receive.class); command(gerrit, "replicate").to(Replicate.class); command(gerrit, "set-project-parent").to(AdminSetParent.class); command(gerrit, "review").to(ReviewCommand.class); <START> command(gerrit, "archive-project").to(ArchiveProject.class); <END> command(gerrit, "deactivate-account").to(DeactivateAccountCommand.class); }</code><technical_language>This change belong this change</technical_language>

Target:
protected void configure() { final CommandName gerrit = Commands.named("gerrit"); command(gerrit, "approve").to(ReviewCommand.class); command(gerrit, "create-account").to(CreateAccountCommand.class); command(gerrit, "create-group").to(CreateGroupCommand.class); command(gerrit, "rename-group").to(RenameGroupCommand.class); command(gerrit, "create-project").to(CreateProjectCommand.class); command(gerrit, "gsql").to(AdminQueryShell.class); command(gerrit, "set-reviewers").to(SetReviewersCommand.class); command(gerrit, "receive-pack").to(Receive.class); command(gerrit, "replicate").to(Replicate.class); command(gerrit, "set-project-parent").to(AdminSetParent.class); command(gerrit, "review").to(ReviewCommand.class); command(gerrit, "deactivate-account").to(DeactivateAccountCommand.class); }
Source:
<code>private static String parameterListString(List<String> duplicatedParameters) { <START> StringBuilder duplicatedParametersString = new StringBuilder(); <END> for (String duplicatedParameter : duplicatedParameters) { duplicatedParametersString.append(String.format("\"%s\", ", duplicatedParameter)); } return duplicatedParametersString.substring(0, duplicatedParametersString.length() - 2); }</code><technical_language>@vilchik-elena com.google.common.base.Joiner? e.g. return "\"" + Joiner.on("\", \"").join(duplicatedParameters) + "\"";</technical_language>

Target:
private static String parameterListString(List<String> duplicatedParameters) { return "\"" + Joiner.on("\", \"").join(duplicatedParameters) + "\""; }
Source:
<code>private void delay() { try { LOGGER.debug( "Waiting ms before attempting to re-retrieve and cache product {}", downloaderConfig.getDelayBetweenAttemptsMS(), filePath); Thread.sleep(downloaderConfig.getDelayBetweenAttemptsMS()); } catch (InterruptedException e1) { <START> Thread.currentThread().interrupt(); <END> } }</code><technical_language>want do a loop sleep for time left. Typically, compute end time long end = System.currentTimeMillis() + downloaderConfig.getDelayBetweenAttemptsMS() while loop loop compute time left left = end - System.currentTimeMillis() bail out if <= 0L do a Thread.sleep(left). propagate interruption loop in a finally clause if a flag set catch</technical_language>

Target:
private void delay() { try { LOGGER.debug( "Waiting ms before attempting to re-retrieve and cache product {}", downloaderConfig.getDelayBetweenAttemptsMS(), filePath); Thread.sleep(downloaderConfig.getDelayBetweenAttemptsMS()); } catch (InterruptedException e1) { } }
Source:
<code>private void saveAndRemoveEntries(Predicate<Map.Entry<SaveableReference, VersionRange>> matchingPredicate) { Map<SaveableReference,VersionRange> localCopy = null; synchronized (this) { localCopy = new HashMap<SaveableReference,VersionRange>(data); } List<SaveableReference> removed = new ArrayList<SaveableReference>(); for (Iterator<Map.Entry<SaveableReference,VersionRange>> it = localCopy.entrySet().iterator(); it.hasNext();) { Map.Entry<SaveableReference,VersionRange> entry = it.next(); if (matchingPredicate.apply(entry)) { Saveable s = entry.getKey().get(); if (s != null) { try { s.save(); } catch (Exception x) { LOGGER.log(Level.WARNING, "failed to save " + s, x); } } removed.add(entry.getKey()); } } synchronized (this) { for (SaveableReference ref : removed) { <START> data.remove(ref); <END> } } }</code><technical_language>data.keySet().removeAll(removed) suffices, sure</technical_language>

Target:
private void saveAndRemoveEntries(Predicate<Map.Entry<SaveableReference, VersionRange>> matchingPredicate) { Map<SaveableReference,VersionRange> localCopy = null; synchronized (this) { localCopy = new HashMap<SaveableReference,VersionRange>(data); } List<SaveableReference> removed = new ArrayList<SaveableReference>(); for (Map.Entry<SaveableReference,VersionRange> entry : localCopy.entrySet()) { if (matchingPredicate.apply(entry)) { Saveable s = entry.getKey().get(); if (s != null) { try { s.save(); } catch (Exception x) { LOGGER.log(Level.WARNING, "failed to save " + s, x); } } removed.add(entry.getKey()); } } synchronized (this) { data.keySet().removeAll(removed); } }