auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean hasNext() { return <START> nextIndex() < <END> fEnd; }</code><technical_language>test list size. more understandable fCursor</technical_language>

Target:
public boolean hasNext() { return nextIndex() < fList.size(); }
Source:
<code>public void profileChangeFingerprint(WebContext ctx) { U userAccount = getUser().getUserObject(getUserClass()); userAccount = userAccount.getMapper().refreshOrFail(userAccount); assertNotNew(userAccount); userAccount.getUserAccountData().getLogin().resetFingerprint(); userAccount.getMapper().update(userAccount); <START> ctx.respondWith().redirectToGet("/profile"); <END> }</code><technical_language>redirect user wondergem root in this case? I this triggers a user logged out instantly</technical_language>

Target:
public void profileChangeFingerprint(WebContext ctx) { U userAccount = getUser().getUserObject(getUserClass()); userAccount = userAccount.getMapper().refreshOrFail(userAccount); assertNotNew(userAccount); userAccount.getUserAccountData().getLogin().resetFingerprint(); userAccount.getMapper().update(userAccount); ctx.respondWith().redirectToGet(wondergemRoot); }
Source:
<code>private void loadAndPut(String environment) throws IOException { String name = "/" + environment + ".properties"; InputStream stream = DefaultEnvironment.class.getResourceAsStream(name); <START> Properties properties = new Properties(); <END> if (stream != null) { properties.load(stream); this.properties.putAll(properties); } else { LOG.warn("Could not find the file '%s.properties' to load. If you ask for any property, null will be returned", environment); } }</code><technical_language>code is fine, this method Java is poor work properties. :(</technical_language>

Target:
private void loadAndPut(String environment) throws IOException { String name = "/" + environment + ".properties"; InputStream stream = DefaultEnvironment.class.getResourceAsStream(name); Properties properties = new Properties(); if (stream != null) { properties.load(stream); this.properties.putAll(properties); } else { LOG.warn( "Could not find the file '{}.properties' to load. If you ask for any property, null will be returned", environment); } }
Source:
<code>void addCommand(String name, String command) { if (commands == null) { commands = <START> Maps.newHashMap(); <END> } commands.put(name, command); }</code><technical_language>newTreeMap raw JSON is ordered in a sane order, for sake of a poor human reading output</technical_language>

Target:
void addCommand(String name, String command) { if (commands == null) { commands = Maps.newTreeMap(); } commands.put(name, command); }
Source:
<code>private String getDataStoreName() { try { final TenantContext tenantContext = _tenantContextFactory.getContext(tenant); final JobContext jobContext = tenantContext.getJob(job); final String jobFileName = jobContext.getJobFile().getName(); final RepositoryFile jobRepositoryFile = tenantContext.getTenantRootFolder().getFolder("jobs") .getFile(jobFileName); final JaxbJobReader reader = new JaxbJobReader(tenantContext.getConfiguration()); final File jobFile = new File(jobRepositoryFile.toResource().getQualifiedPath()); <START> return reader.readMetadata(jobFile).getDatastoreName(); <END> } catch (RuntimeException e) { logger.error("DataStore name could not be resolved. {}", e); return null; } }</code><technical_language>Wow, a lot of code for datastore name. some sort of utility function this</technical_language>

Target:
private String getDataStoreName() { try { final File jobFile = getJobFile(); final TenantContext tenantContext = _tenantContextFactory.getContext(tenant); final JaxbJobReader reader = new JaxbJobReader(tenantContext.getConfiguration()); return reader.readMetadata(jobFile).getDatastoreName(); } catch (RuntimeException e) { logger.warn("DataStore name could not be resolved. {}", e); return null; } }
Source:
<code>public void checkSpecificAccessControl() { String questionId = getRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_ID); if (questionId != null) { FeedbackQuestionAttributes feedbackQuestionAttributes = logic.getFeedbackQuestion(questionId); FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession( feedbackQuestionAttributes.getFeedbackSessionName(), feedbackQuestionAttributes.getCourseId()); gateKeeper.verifyAccessible( logic.getInstructorForGoogleId(feedbackQuestionAttributes.getCourseId(), userInfo.getId()), feedbackSession); return; } String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); <START> if (feedbackSessionName == null) { <END> gateKeeper.verifyAccessible( logic.getInstructorForGoogleId(courseId, userInfo.getId()), logic.getCourse(courseId)); } else { gateKeeper.verifyAccessible( logic.getInstructorForGoogleId(courseId, userInfo.id), logic.getFeedbackSession(feedbackSessionName, courseId)); } }</code><technical_language>is usage of checking responses for a specific session</technical_language>

Target:
public void checkSpecificAccessControl() { String questionId = getRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_ID); if (questionId != null) { FeedbackQuestionAttributes feedbackQuestionAttributes = logic.getFeedbackQuestion(questionId); FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession( feedbackQuestionAttributes.getFeedbackSessionName(), feedbackQuestionAttributes.getCourseId()); gateKeeper.verifyAccessible( logic.getInstructorForGoogleId(feedbackQuestionAttributes.getCourseId(), userInfo.getId()), feedbackSession); return; } String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); if (courseId != null) { gateKeeper.verifyAccessible( logic.getInstructorForGoogleId(courseId, userInfo.getId()), logic.getCourse(courseId)); } }
Source:
<code>private List<ElasticsearchVertex> getElasticsearchVertices(SearchHits hits, FetchHints fetchHints, Authorizations authorizations) { <START> return StreamUtils.stream(hits) <END> .map(hit -> { String elementId = hit.getField(Elasticsearch5SearchIndex.ELEMENT_ID_FIELD_NAME).getValue(); return new ElasticsearchVertex( getGraph(), elementId, fetchHints, authorizations ); }).collect(Collectors.toList()); }</code><technical_language>a fan of static imports for this, I static import StreamUtils.stream matter</technical_language>

Target:
private List<ElasticsearchVertex> getElasticsearchVertices(SearchHits hits, FetchHints fetchHints, Authorizations authorizations) { return stream(hits) .map(hit -> { String elementId = hit.getField(Elasticsearch5SearchIndex.ELEMENT_ID_FIELD_NAME).getValue(); return new ElasticsearchVertex( getGraph(), elementId, fetchHints, authorizations ); }).collect(Collectors.toList()); }
Source:
<code>public void readExternal(DataInputStream in, PrototypeFactory pf) throws IOException, DeserializationException { isEqOp = ExtUtil.readBool(in); readExpressions(in, pf); if (isEqOp) { op = XPathEqExpr.EQ; } else { op = XPathEqExpr.NEQ; } computedCacheability = ExtUtil.readBool(in); <START> exprIsCacheable = ExtUtil.readBool(in); <END> computedContextTypes = ExtUtil.readBool(in); contextRefIsRelevant = ExtUtil.readBool(in); originalContextRefIsRelevant = ExtUtil.readBool(in); }</code><technical_language>feels a lot of context state managed cleaner delegate a composed cacheState object (which easier change this more safely requiring safely updating 5-6 implementaitons</technical_language>

Target:
public void readExternal(DataInputStream in, PrototypeFactory pf) throws IOException, DeserializationException { isEqOp = ExtUtil.readBool(in); readExpressions(in, pf); if (isEqOp) { op = XPathEqExpr.EQ; } else { op = XPathEqExpr.NEQ; } cacheState = (CacheableExprState)ExtUtil.read(in, CacheableExprState.class, pf); }
Source:
<code>public static Predicate<Unit> unitIsOwnedAndMatchesTypeAndNotTransporting( final GamePlayer player, final UnitType unitType) { return Matches.unitIsOwnedBy(player) .and(Matches.unitIsOfType(unitType)) <START> .and(Unit::isTransporting); <END> }</code><technical_language>I this change unintended</technical_language>

Target:
public static Predicate<Unit> unitIsOwnedAndMatchesTypeAndNotTransporting( final GamePlayer player, final UnitType unitType) { return Matches.unitIsOwnedBy(player) .and(Matches.unitIsOfType(unitType)) .and(Predicate.not(Unit::isTransporting)); }
Source:
<code>public static ConfigDef getConfig() { Map<String, ConfigDef.ConfigKey> everything = new HashMap<>(CONFIG_DEF.configKeys()); everything.putAll(StorageCommonConfig.getConfig().configKeys()); everything.putAll(PartitionerConfig.getConfig().configKeys()); Set<String> skip = new HashSet<>(); skip.add(StorageSinkConnectorConfig.ROTATE_SCHEDULE_INTERVAL_MS_CONFIG); skip.add(StorageSinkConnectorConfig.SHUTDOWN_TIMEOUT_CONFIG); ConfigDef visible = new ConfigDef(); visible.define( STORAGE_CLASS_CONFIG, Type.CLASS, Importance.HIGH, STORAGE_CLASS_DOC, "Storage", 1, Width.NONE, STORAGE_CLASS_DISPLAY <START> ); <END> visible.define( FORMAT_CLASS_CONFIG, Type.CLASS, Importance.HIGH, FORMAT_CLASS_DOC, "Connector", 1, Width.NONE, FORMAT_CLASS_DISPLAY ); for (ConfigDef.ConfigKey key : everything.values()) { if(!skip.contains(key.name)) { visible.define(key); } } return visible; }</code><technical_language>define default value? If so, addDefaults needed, right</technical_language>

Target:
public static ConfigDef getConfig() { Map<String, ConfigDef.ConfigKey> everything = new HashMap<>(CONFIG_DEF.configKeys()); everything.putAll(StorageCommonConfig.getConfig().configKeys()); everything.putAll(PartitionerConfig.getConfig().configKeys()); Set<String> skip = new HashSet<>(); skip.add(STORAGE_CLASS_CONFIG); skip.add(FORMAT_CLASS_CONFIG); ConfigDef visible = new ConfigDef(); visible.define( STORAGE_CLASS_CONFIG, Type.CLASS, HdfsStorage.class.getName(), Importance.HIGH, STORAGE_CLASS_DOC, "Storage", 1, Width.NONE, STORAGE_CLASS_DISPLAY ); visible.define( FORMAT_CLASS_CONFIG, Type.CLASS, AvroFormat.class.getName(), Importance.HIGH, FORMAT_CLASS_DOC, "Connector", 1, Width.NONE, FORMAT_CLASS_DISPLAY ); for (ConfigDef.ConfigKey key : everything.values()) { if (!skip.contains(key.name)) { visible.define(key); } } return visible; }
Source:
<code>private String getDefaultEmulatedMachineLabel() { <START> DataCenterWithCluster dataCenterWithCluster = getModel().getDataCenterWithClustersList().getSelectedItem(); <END> String newClusterEmulatedMachine; if (dataCenterWithCluster == null) { newClusterEmulatedMachine = ""; } else { newClusterEmulatedMachine = (dataCenterWithCluster.getCluster().getEmulatedMachine() == null) ? "" : dataCenterWithCluster.getCluster().getEmulatedMachine(); } newClusterEmulatedMachine = constants.clusterDefaultOption() + "(" + newClusterEmulatedMachine + ")"; return newClusterEmulatedMachine; }</code><technical_language>Safer approach getModel().getSelectedCluster()</technical_language>

Target:
private String getDefaultEmulatedMachineLabel() { VDSGroup vdsGroup = getModel().getSelectedCluster(); String newClusterEmulatedMachine = constants.clusterDefaultOption(); if (vdsGroup != null) { String emulatedMachine = (vdsGroup.getEmulatedMachine() == null) ? "" : vdsGroup.getEmulatedMachine(); newClusterEmulatedMachine += "(" + emulatedMachine + ")"; } return newClusterEmulatedMachine; }
Source:
<code>public void sharedMemorySetTest() { <START> assertEquals("Shared memory is not set", redisWithSharedMemory.getShmSize(), 1024 * FileUtils.ONE_MB); <END> HostConfig hostConfig = redisWithSharedMemory.getDockerClient().inspectContainerCmd(redisWithSharedMemory.getContainerId()) .exec().getHostConfig(); assertEquals("Shared memory not set on container", hostConfig.getShmSize(), 1024 * FileUtils.ONE_MB); }</code><technical_language>I remove this assert</technical_language>

Target:
public void sharedMemorySetTest() { try (GenericContainer containerWithSharedMemory = new GenericContainer("busybox:1.29") .withSharedMemorySize(1024L * FileUtils.ONE_MB)) { containerWithSharedMemory.start(); HostConfig hostConfig = containerWithSharedMemory.getDockerClient().inspectContainerCmd(containerWithSharedMemory.getContainerId()) .exec().getHostConfig(); assertEquals("Shared memory not set on container", hostConfig.getShmSize(), 1024 * FileUtils.ONE_MB); } }
Source:
<code>protected VDSReturnValue executeVerb(StorageDomainStatic storage) { try { GetVmsInfoVDSCommandParameters tempVar = new GetVmsInfoVDSCommandParameters( getParameters().getStoragePoolId()); <START> tempVar.setStorageDomainId(getParameters().getStorageDomainId()); <END> tempVar.setVmIdList(getParameters().getIds()); return Backend.getInstance().getResourceManager() .RunVdsCommand(VDSCommandType.GetVmsInfo, tempVar); } catch (RuntimeException e) { AuditLogableBase logable = new AuditLogableBase(); logable.addCustomValue("StorageDomainName", storage.getStorageName()); AuditLogDirector.log(logable, AuditLogType.IMPORTEXPORT_GET_VMS_INFO_FAILED); throw e; } }</code><technical_language>domain id parameters storage object method parameter</technical_language>

Target:
private VDSReturnValue executeVerb(StorageDomainStatic storage) { try { return Backend.getInstance().getResourceManager() .RunVdsCommand(VDSCommandType.GetVmsInfo, buildGetVmsInfoParameters(storage)); } catch (RuntimeException e) { AuditLogableBase logable = new AuditLogableBase(); logable.addCustomValue("StorageDomainName", storage.getStorageName()); AuditLogDirector.log(logable, AuditLogType.IMPORTEXPORT_GET_VMS_INFO_FAILED); throw e; } }
Source:
<code>private static ZipDumpReader create( final SystemLoadListener listener, final String dumpName, final ZipFile zipFile ) { if ( zipFile.getEntry( "dump.json" ) != null ) { return new ZipDumpReader( listener, PathRef.of(), zipFile ); } else if ( zipFile.getEntry( dumpName + "/dump.json" ) != null ) { return new ZipDumpReader( listener, PathRef.of( dumpName ), zipFile ); } else { String rootDumpDir = null; final Enumeration<ZipArchiveEntry> entries = zipFile.getEntries(); while ( entries.hasMoreElements() ) { final ZipArchiveEntry entry = entries.nextElement(); final Matcher matcher = ROOT_DUMP_DIR_PATTERN.matcher( entry.getName() ); if ( matcher.find() ) { <START> rootDumpDir = matcher.group( 1 ); <END> break; } } if ( rootDumpDir != null ) { return new ZipDumpReader( listener, PathRef.of( rootDumpDir ), zipFile ); } else { throw new RepoLoadException( "Archive is not a valid dump archive: [" + dumpName + "]" ); } } }</code><technical_language>simplify code a bit return ZipDumpReader right</technical_language>

Target:
private static ZipDumpReader create( final SystemLoadListener listener, final String dumpName, final ZipFile zipFile ) { if ( zipFile.getEntry( "dump.json" ) != null ) { return new ZipDumpReader( listener, PathRef.of(), zipFile ); } else if ( zipFile.getEntry( dumpName + "/dump.json" ) != null ) { return new ZipDumpReader( listener, PathRef.of( dumpName ), zipFile ); } else { final Enumeration<ZipArchiveEntry> entries = zipFile.getEntries(); while ( entries.hasMoreElements() ) { final ZipArchiveEntry entry = entries.nextElement(); final Matcher matcher = ROOT_DUMP_DIR_PATTERN.matcher( entry.getName() ); if ( matcher.matches() ) { return new ZipDumpReader( listener, PathRef.of( matcher.group( 1 ) ), zipFile ); } } throw new RepoLoadException( "Archive is not a valid dump archive: [" + dumpName + "]" ); } }
Source:
<code>protected void stopPartitionReplication(PartitionId partitionId) throws ReplicationException { PartitionInfo partitionInfo = partitionToPartitionInfo.remove(partitionId); if (partitionInfo == null) { logger.warn("Partition not exist when remove from {}. ", partitionId, dataNodeId); return; } removeRemoteReplicaInfoFromReplicaThread(partitionInfo.getRemoteReplicaInfos()); if (replicationConfig.replicationPersistTokenOnShutdownOrReplicaRemove) { try { persistor.write(partitionInfo.getLocalReplicaId().getMountPath(), false); } catch (IOException | ReplicationException e) { <START> throw new ReplicationException( <END> "Exception on token write when removing Partition " + partitionId + " from: " + dataNodeId); } } }</code><technical_language>I failure write token fail stopping of replication, prevent a new replica added. log error continue. Some records get reprocessed, is okay</technical_language>

Target:
protected void stopPartitionReplication(PartitionId partitionId) { PartitionInfo partitionInfo = partitionToPartitionInfo.remove(partitionId); if (partitionInfo == null) { logger.warn("Partition not exist when remove from {}. ", partitionId, dataNodeId); return; } removeRemoteReplicaInfoFromReplicaThread(partitionInfo.getRemoteReplicaInfos()); if (replicationConfig.replicationPersistTokenOnShutdownOrReplicaRemove) { try { persistor.write(partitionInfo.getLocalReplicaId().getMountPath(), false); } catch (IOException | ReplicationException e) { logger.error( "Exception " + e + " on token write when removing Partition " + partitionId + " from: " + dataNodeId); } } }
Source:
<code>public List<String> getBarcodes() { final String barcodeString = getAttribute(BARCODE_TAG); <START> if(barcodeString == null){ <END> return null; } else if( barcodeString.isEmpty()){ return Collections.emptyList(); } else { return Arrays.asList( barcodeString.split(BARCODE_SEPARATOR)); } }</code><technical_language>fix spacing suggestion if (barcodeString == null) {</technical_language>

Target:
public List<String> getBarcodes() { final String barcodeString = getAttribute(BARCODE_TAG); if (barcodeString == null) { return null; } else if (barcodeString.isEmpty()) { return Collections.emptyList(); } else { return Arrays.asList(barcodeString.split(SamConstants.BARCODE_SEQUENCE_DELIMITER)); } }
Source:
<code>public static CoordinatesCalculateDialog getInstance(final Geopoint gp, final CalcState calculationState) { final Bundle args = new Bundle(); if (gp != null) { args.putParcelable(GEOPOINT_ARG, gp); } <START> final CoordinatesCalculateDialog cid = new CoordinatesCalculateDialog(); <END> cid.setArguments(args); cid.setCalcState(calculationState); return cid; }</code><technical_language>cid -> dialog, gp -> geopoint</technical_language>

Target:
public static CoordinatesCalculateDialog getInstance(final Geopoint gp, final CalcState calculationState) { final Bundle args = new Bundle(); if (gp != null) { args.putParcelable(GEOPOINT_ARG, gp); } final CoordinatesCalculateDialog ccd = new CoordinatesCalculateDialog(); ccd.setArguments(args); ccd.setSavedState(calculationState); return ccd; }
Source:
<code>private StructuredRecord createStructuredRecord(CSVRecord record) { StructuredRecord.Builder builder = StructuredRecord.builder(outSchema); int i = 0; for (Field field : fields) { String val = record.get(i); Schema fieldSchema = field.getSchema(); if (val.isEmpty()) { boolean isNullable = fieldSchema.isNullable(); Schema.Type fieldType = isNullable ? fieldSchema.getNonNullable().getType() : fieldSchema.getType(); if (fieldType == Schema.Type.STRING) { builder.set(field.getName(), ""); } else if (!isNullable) { throw new IllegalArgumentException(String.format( "The %dth field named '%s' is of non-nullable type '%s', " + "but was parsed as an empty string for CSV record '%s'", <START> i + 1, field.getName(), field.getSchema().getType(), record)); <END> } } else { builder.convertAndSet(field.getName(), val); } ++i; } return builder.build(); }</code><technical_language>(eliminate usage of "th" numbers, good): "Field #%d (named '%s') is of non-nullable type '%s', " +</technical_language>

Target:
private StructuredRecord createStructuredRecord(CSVRecord record) { StructuredRecord.Builder builder = StructuredRecord.builder(outSchema); int i = 0; for (Field field : fields) { String val = record.get(i); Schema fieldSchema = field.getSchema(); if (val.isEmpty()) { boolean isNullable = fieldSchema.isNullable(); Schema.Type fieldType = isNullable ? fieldSchema.getNonNullable().getType() : fieldSchema.getType(); if (fieldType == Schema.Type.STRING) { builder.set(field.getName(), ""); } else if (!isNullable) { throw new IllegalArgumentException(String.format( "Field #%d (named '%s') is of non-nullable type '%s', " + "but was parsed as an empty string for CSV record '%s'", i, field.getName(), field.getSchema().getType(), record)); } } else { builder.convertAndSet(field.getName(), val); } ++i; } return builder.build(); }
Source:
<code>public void setParamsToEntity(Map<VirtualMachineProfile.Param, Object> map) { if (this.vmEntityVO != null) { Map<String, String> details = this.vmEntityVO.getDetails(); <START> if (details == null) { <END> details = new HashMap<String, String>(); } if (map != null && !map.isEmpty()) { for (Map.Entry<VirtualMachineProfile.Param, Object> entry : map.entrySet()) { if (null != entry && null != entry.getValue() && null != entry.getKey()) { details.put(entry.getKey().getName(), entry.getValue().toString()); } } this.vmEntityVO.setDetails(details); } } }</code><technical_language>get validate details map is empty</technical_language>

Target:
public void setParamsToEntity(Map<VirtualMachineProfile.Param, Object> map) { if (MapUtils.isNotEmpty(map)) { if (this.vmEntityVO != null) { Map<String, String> details = this.vmEntityVO.getDetails(); if (details == null) { details = new HashMap<String, String>(); } for (Map.Entry<VirtualMachineProfile.Param, Object> entry : map.entrySet()) { if (null != entry && null != entry.getValue() && null != entry.getKey()) { details.put(entry.getKey().getName(), entry.getValue().toString()); } } this.vmEntityVO.setDetails(details); } } }
Source:
<code>public boolean accept(InputFile inputFile) { if (!Php.KEY.equals(inputFile.language())) { return true; } String relativePath = inputFile.uri().toString(); if (WildcardPattern.match(WildcardPattern.create(excludedPatterns), relativePath)) { LOG.debug("File [" + inputFile.uri() + "] is excluded by '" + PhpPlugin.PHP_EXCLUSIONS_KEY + "' property and will not be analyzed"); return false; } if (new AverageLineLengthCalculator(inputFile).getAverageLineLength() > DEFAULT_AVERAGE_LINE_LENGTH_THRESHOLD) { <START> LOG.debug("File [" + inputFile.uri() + "] is excluded because its default average line length is greater than " + DEFAULT_AVERAGE_LINE_LENGTH_THRESHOLD); <END> return false; } return true; }</code><technical_language>I need word "default" here. IMO more high-level in message. E.g. .. is excluded considered generated (average line length is big)</technical_language>

Target:
public boolean accept(InputFile inputFile) { if (!Php.KEY.equals(inputFile.language())) { return true; } String relativePath = inputFile.uri().toString(); if (WildcardPattern.match(WildcardPattern.create(excludedPatterns), relativePath)) { LOG.debug("File [" + inputFile.uri() + "] is excluded by '" + PhpPlugin.PHP_EXCLUSIONS_KEY + "' property and will not be analyzed"); return false; } if (new AverageLineLengthCalculator(inputFile).getAverageLineLength() > DEFAULT_AVERAGE_LINE_LENGTH_THRESHOLD) { LOG.debug("File [" + inputFile.uri() + "] is excluded because it is considered generated (average line length is too big)."); return false; } return true; }
Source:
<code>public void refresh(HelixDataAccessor accessor) { long startTime = System.currentTimeMillis(); PropertyKey.Builder keyBuilder = accessor.keyBuilder(); Set<PropertyKey> currentIdealStateKeys = new HashSet<>(); for (String idealState : accessor.getChildNames(keyBuilder.idealStates())) { currentIdealStateKeys.add(keyBuilder.idealStates(idealState)); } Set<PropertyKey> cachedKeys = new HashSet<>(); Map<PropertyKey, IdealState> cachedIdealStateMap = Maps.newHashMap(); for (String idealState : _idealStateCache.keySet()) { cachedKeys.add(keyBuilder.idealStates(idealState)); cachedIdealStateMap .put(keyBuilder.idealStates(idealState), _idealStateCache.get(idealState)); } cachedKeys.retainAll(currentIdealStateKeys); Set<PropertyKey> reloadKeys = new HashSet<>(currentIdealStateKeys); reloadKeys.removeAll(cachedKeys); Map<PropertyKey, IdealState> updatedMap = refreshProperties(accessor, reloadKeys, new ArrayList<>(cachedKeys), <START> cachedIdealStateMap, reloadKeys); <END> Map<String, IdealState> newIdealStateMap = Maps.newHashMap(); for (IdealState idealState : updatedMap.values()) { newIdealStateMap.put(idealState.getResourceName(), idealState); } _idealStateCache = new HashMap<>(newIdealStateMap); _idealStateMap = new HashMap<>(newIdealStateMap); long endTime = System.currentTimeMillis(); LogUtil.logInfo(LOG, _controlContextProvider.getClusterEventId(), "Refresh " + _idealStateMap.size() + " idealStates for cluster " + _clusterName + ", took " + (endTime - startTime) + " ms"); }</code><technical_language>Input empty list</technical_language>

Target:
public void refresh(HelixDataAccessor accessor) { long startTime = System.currentTimeMillis(); PropertyKey.Builder keyBuilder = accessor.keyBuilder(); Set<PropertyKey> currentIdealStateKeys = new HashSet<>(); for (String idealState : accessor.getChildNames(keyBuilder.idealStates())) { currentIdealStateKeys.add(keyBuilder.idealStates(idealState)); } Set<PropertyKey> cachedKeys = new HashSet<>(); Map<PropertyKey, IdealState> cachedIdealStateMap = Maps.newHashMap(); for (String idealState : _idealStateCache.keySet()) { cachedKeys.add(keyBuilder.idealStates(idealState)); cachedIdealStateMap .put(keyBuilder.idealStates(idealState), _idealStateCache.get(idealState)); } cachedKeys.retainAll(currentIdealStateKeys); Set<PropertyKey> reloadKeys = new HashSet<>(currentIdealStateKeys); reloadKeys.removeAll(cachedKeys); Map<PropertyKey, IdealState> updatedMap = refreshProperties(accessor, reloadKeys, new ArrayList<>(cachedKeys), cachedIdealStateMap, new HashSet<>()); Map<String, IdealState> newIdealStateMap = Maps.newHashMap(); for (IdealState idealState : updatedMap.values()) { newIdealStateMap.put(idealState.getResourceName(), idealState); } _idealStateCache = new HashMap<>(newIdealStateMap); _idealStateMap = new HashMap<>(newIdealStateMap); long endTime = System.currentTimeMillis(); LogUtil.logInfo(LOG, _controlContextProvider.getClusterEventId(), "Refresh " + _idealStateMap.size() + " idealStates for cluster " + _clusterName + ", took " + (endTime - startTime) + " ms"); }
Source:
<code>protected boolean requestRequiresAuthentication(final HttpServletRequest request, final HttpServletResponse response) { <START> val accessTokenRequest = isAccessTokenRequest(request, response); <END> val revokeTokenRequest = isRevokeTokenRequest(request, response); if (revokeTokenRequest) { return clientNeedAuthentication(request, response); } if (!accessTokenRequest) { val extractor = extractAccessTokenGrantRequest(request); if (extractor.isPresent()) { val ext = extractor.get(); return ext.requestMustBeAuthenticated(); } } else { val extractor = extractAccessTokenGrantRequest(request); if (extractor.isPresent()) { val ext = extractor.get(); return ext.getResponseType() != OAuth20ResponseTypes.DEVICE_CODE; } } return false; }</code><technical_language>Move this call 128</technical_language>

Target:
protected boolean requestRequiresAuthentication(final HttpServletRequest request, final HttpServletResponse response) { val revokeTokenRequest = isRevokeTokenRequest(request, response); if (revokeTokenRequest) { return clientNeedAuthentication(request, response); } val accessTokenRequest = isAccessTokenRequest(request, response); if (!accessTokenRequest) { val extractor = extractAccessTokenGrantRequest(request); if (extractor.isPresent()) { val ext = extractor.get(); return ext.requestMustBeAuthenticated(); } } else { val extractor = extractAccessTokenGrantRequest(request); if (extractor.isPresent()) { val ext = extractor.get(); return ext.getResponseType() != OAuth20ResponseTypes.DEVICE_CODE; } } return false; }
Source:
<code>public StoredConfig getUserConfig() throws IOException, ConfigInvalidException { <START> FileBasedConfig c = openUserConfig(getSystemConfig(), FS.DETECTED); <END> if (c.isOutdated()) { LOG.debug("loading user config {}", userConfig); c.load(); } return c; }</code><technical_language>This, too, create new configs load them. intended. Again, code of openUserConfig done now</technical_language>

Target:
public StoredConfig getUserConfig() throws IOException, ConfigInvalidException { FileBasedConfig c = userConfig.get(); if (c == null) { userConfig.compareAndSet(null, openUserConfig(getSystemConfig(), FS.DETECTED)); c = userConfig.get(); } else { getSystemConfig(); } if (c.isOutdated()) { LOG.debug("loading user config {}", userConfig); c.load(); } return c; }
Source:
<code>private BitmapDescriptor getClusterIcon(Cluster<Person> cluster) { <START> List<Drawable> profilePhotos; profilePhotos = new ArrayList<Drawable>(Math.min(4, cluster.getSize())); <END> int width = mDimension; int height = mDimension; for (Person p : cluster.getItems()) { if (profilePhotos.size() == 4) break; Drawable drawable = getResources().getDrawable(p.profilePhoto); drawable.setBounds(0, 0, width, height); profilePhotos.add(drawable); } MultiDrawable multiDrawable = new MultiDrawable(profilePhotos); multiDrawable.setBounds(0, 0, width, height); mClusterImageView.setImageDrawable(multiDrawable); Bitmap icon = mClusterIconGenerator.makeIcon(String.valueOf(cluster.getSize())); return BitmapDescriptorFactory.fromBitmap(icon); }</code><technical_language>I newline unintentional, Drawable type reference meant removed? suggestion List<Drawable> profilePhotos = new ArrayList<>(Math.min(4, cluster.getSize()));</technical_language>

Target:
private BitmapDescriptor getClusterIcon(Cluster<Person> cluster) { List<Drawable> profilePhotos = new ArrayList<>(Math.min(4, cluster.getSize())); int width = mDimension; int height = mDimension; for (Person p : cluster.getItems()) { if (profilePhotos.size() == 4) break; Drawable drawable = getResources().getDrawable(p.profilePhoto); drawable.setBounds(0, 0, width, height); profilePhotos.add(drawable); } MultiDrawable multiDrawable = new MultiDrawable(profilePhotos); multiDrawable.setBounds(0, 0, width, height); mClusterImageView.setImageDrawable(multiDrawable); Bitmap icon = mClusterIconGenerator.makeIcon(String.valueOf(cluster.getSize())); return BitmapDescriptorFactory.fromBitmap(icon); }
Source:
<code>private void checkCompletedSubgoals(State state) { int len = this.recipeSubgoals.size(); for (int i = 0; i < len; i++) { <START> if (this.recipeSubgoals.get(i).goalCompleted(state)) { <END> this.completedSubgoals[i] = true; } } }</code><technical_language>instead of if, do this.completedSubgoals[i] |= this.recipeSubgoals.get(i).goalCompleted(state);</technical_language>

Target:
private void checkCompletedSubgoals(State state) { int len = this.recipeSubgoals.size(); for (int i = 0; i < len; i++) { this.completedSubgoals[i] |= this.recipeSubgoals.get(i).goalCompleted(state); } }
Source:
<code>private void logErrorFully(Response.Status status, Throwable throwable) { if (LOG.isDebugEnabled()) { <START> LOG.debug("Failed with " + status, throwable); <END> } }</code><technical_language>parameterized logging, we? way, need check if debug log is enabled</technical_language>

Target:
private void logErrorFully(Response.Status status, Throwable throwable) { LOG.debug("Failed with {}", status, throwable); }
Source:
<code>public static KubernetesClientConfig create(final Optional<String> name, final Config systemConfig, final Config requestConfig) { Config config; <START> if (requestConfig.get("agent.command_executor.type", String.class, "").equals("kubernetes")) { <END> config = requestConfig; } else { config = systemConfig; } return KubernetesClientConfig.create(name, config); }</code><technical_language>explain change config key name "kubernetes" "agent..." ? I guess original code is better. Docker configuration naming. "agent..." is longer define in WF definition</technical_language>

Target:
public static KubernetesClientConfig create(final Optional<String> name, final Config systemConfig, final Config requestConfig) { String clusterName = null; if (name.isPresent()) { clusterName = name.get(); } Config extractedSystemConfig = null; if (systemConfig != null && systemConfig.get("agent.command_executor.type", String.class, "").equals("kubernetes")) { if (clusterName == null) { clusterName = systemConfig.get(KUBERNETES_CLIENT_PARAMS_PREFIX + "name", String.class); } final String keyPrefix = KUBERNETES_CLIENT_PARAMS_PREFIX + clusterName + "."; extractedSystemConfig = StorageManager.extractKeyPrefix(systemConfig, keyPrefix); } Config extractedRequestConfig = null; if (requestConfig != null && requestConfig.has("kubernetes")) { if (clusterName == null) { clusterName = requestConfig.get("name", String.class); } extractedRequestConfig = requestConfig.getNested("kubernetes"); } final Config config; if (extractedSystemConfig != null && extractedRequestConfig != null) { config = extractedSystemConfig.merge(extractedRequestConfig); } else if (extractedRequestConfig != null) { config = extractedRequestConfig; } else if (extractedSystemConfig != null) { config = extractedSystemConfig; } else { throw new ConfigException("systemConfig and requestConfig does not exist"); } return KubernetesClientConfig.createKubeConfig(clusterName, config); }
Source:
<code>public Set<TSnePoint> fetchTSnePlotWithExpression(String experimentAccession, int perplexity, String geneId) { return tSnePlotServiceDao.fetchTSnePlotWithExpression(experimentAccession, perplexity, geneId).stream() .map( pointDto -> TSnePoint.create( <START> Math.round(pointDto.x()*100.0)/100.0 ,Math.round(pointDto.y()*100.0)/100.0, pointDto.expressionLevel(), pointDto.name())) <END> .collect(toSet()); }</code><technical_language>Also, more careful spacing commas numerical operators. Follow conventions in code</technical_language>

Target:
public Set<TSnePoint> fetchTSnePlotWithExpression(String experimentAccession, int perplexity, String geneId) { return tSnePlotServiceDao.fetchTSnePlotWithExpression(experimentAccession, perplexity, geneId).stream() .map( pointDto -> TSnePoint.create( MathUtils.round(pointDto.x(), 2), MathUtils.round(pointDto.y(), 2), pointDto.expressionLevel(), pointDto.name())) .collect(toSet()); }
Source:
<code>public void leaderCanProcessMultiClientGetCommitTimestampRequest() { MultiClientConjureTimelockService service = cluster.currentLeaderFor(client.namespace()).multiClientService(); Set<String> expectedNamespaces = ImmutableSet.of("alpha", "beta"); List<NamespacedGetCommitTimestampsResponse> commitTimestamps = service.getCommitTimestamps(AUTH_HEADER, getGetCommitTimestampsRequests(expectedNamespaces)); Set<String> namespaces = commitTimestamps.stream() .map(NamespacedGetCommitTimestampsResponse::getNamespace) .collect(Collectors.toSet()); <START> assertThat(namespaces).hasSameElementsAs(expectedNamespaces); <END> }</code><technical_language>This is a bit pedantic, get commit timestamps a leader ID hidden (it's logId LockWatchStateUpdate). worth a similar check above</technical_language>

Target:
public void leaderCanProcessMultiClientGetCommitTimestampRequest() { MultiClientConjureTimelockService service = cluster.currentLeaderFor(client.namespace()).multiClientService(); Set<String> expectedNamespaces = ImmutableSet.of("alpha", "beta"); List<NamespacedGetCommitTimestampsResponse> commitTimestamps = service.getCommitTimestamps( AUTH_HEADER, defaultNamespacedGetCommitTimestampsRequests(expectedNamespaces)); Set<String> namespaces = commitTimestamps.stream() .map(NamespacedGetCommitTimestampsResponse::getNamespace) .collect(Collectors.toSet()); assertThat(namespaces).hasSameElementsAs(expectedNamespaces); Set<UUID> leadershipIds = commitTimestamps.stream() .map(NamespacedGetCommitTimestampsResponse::getLockWatchUpdate) .map(LockWatchStateUpdate::logId) .collect(Collectors.toSet()); assertThat(leadershipIds).hasSameSizeAs(expectedNamespaces); }
Source:
<code>public String[] getConflictingIds(TaskEditorInput input) { <START> List<String> conflictingIds = Lists.newArrayList(); <END> conflictingIds.add(ITasksUiConstants.ID_PAGE_PLANNING); @SuppressWarnings("restriction") String artifactFlag = input.getTask().getAttribute(ITasksCoreConstants.ATTRIBUTE_ARTIFACT); if (artifactFlag != null && artifactFlag.equals("true")) { final String CONTEXT_PAGE = "org.eclipse.mylyn.context.ui"; conflictingIds.add(CONTEXT_PAGE); } return (String[]) conflictingIds.toArray(); }</code><technical_language>ImmutableList.builder()</technical_language>

Target:
public String[] getConflictingIds(TaskEditorInput input) { List<String> conflictingIds = ImmutableList.of(ITasksUiConstants.ID_PAGE_PLANNING); @SuppressWarnings("restriction") String artifactFlag = input.getTask().getAttribute(ITasksCoreConstants.ATTRIBUTE_ARTIFACT); if (Boolean.parseBoolean(artifactFlag)) { final String CONTEXT_PAGE = "org.eclipse.mylyn.context.ui"; conflictingIds.add(CONTEXT_PAGE); } return conflictingIds.toArray(new String[conflictingIds.size()]); }
Source:
<code>ElasticsearchSearchResult<H> loadBlocking() { SearchProjectionTransformContext transformContext = extractContext.createProjectionTransformContext(); <START> LoadingResult<?> loadingResult = extractContext.getProjectionHitMapper().loadBlocking( null ); <END> int readIndex = 0; int writeIndex = 0; for ( ; readIndex < extractedHits.size(); ++readIndex ) { transformContext.reset(); H transformed = transformUnsafe( rootProjection, loadingResult, extractedHits.get( readIndex ), transformContext ); if ( transformContext.hasFailedLoad() ) { continue; } extractedHits.set( writeIndex, transformed ); ++writeIndex; } if ( writeIndex < readIndex ) { extractedHits.subList( writeIndex, readIndex ).clear(); } @SuppressWarnings("unchecked") List<H> loadedHits = Collections.unmodifiableList( (List<? extends H>) extractedHits ); extractedHits = null; return new ElasticsearchSearchResultImpl<>( extractContext.getResponseBody(), hitCount, loadedHits, extractedAggregations , took, timedOut ); }</code><technical_language>problem for multi-entity loading: if a timeout of 2ms, spent 1ms retrieving results Elasticsearch, allowing loading 2ms, in end allow 3ms. address this, pass a timeout, pass a deadline (Instant long representing nanos, prefer). if want pass a timeout, subtract elapsed time</technical_language>

Target:
ElasticsearchSearchResult<H> loadBlocking() { SearchProjectionTransformContext transformContext = extractContext.createProjectionTransformContext(); LoadingResult<?> loadingResult = extractContext.getProjectionHitMapper().loadBlocking(); int readIndex = 0; int writeIndex = 0; for ( ; readIndex < extractedHits.size(); ++readIndex ) { transformContext.reset(); H transformed = transformUnsafe( rootProjection, loadingResult, extractedHits.get( readIndex ), transformContext ); if ( transformContext.hasFailedLoad() ) { continue; } extractedHits.set( writeIndex, transformed ); ++writeIndex; } if ( writeIndex < readIndex ) { extractedHits.subList( writeIndex, readIndex ).clear(); } @SuppressWarnings("unchecked") List<H> loadedHits = Collections.unmodifiableList( (List<? extends H>) extractedHits ); extractedHits = null; return new ElasticsearchSearchResultImpl<>( extractContext.getResponseBody(), hitCount, loadedHits, extractedAggregations , took, timedOut ); }
Source:
<code><START> public String getAccessibility() { <END> return accessibility; }</code><technical_language>for accessibility ETextAccessibility instead of a String</technical_language>

Target:
public ETextAccessibility getAccessibility() { return accessibility; }
Source:
<code>public Object stSphericalArea(BenchmarkData data) { return GeoFunctions.stSphericalArea(data.geometry); <START> } <END></code><technical_language>Perhaps, add 2D area show performance difference is</technical_language>

Target:
public Object stSphericalArea(BenchmarkData data) { return GeoFunctions.stSphericalArea(data.geography); }
Source:
<code><START> private String parseSentenceClose() throws ParseException { <END> int index = nextNonBlank(); if (index < 0 || expression.charAt(index) != ';') { throw new ParseException(errorMessage(SENTENCE_NOT_CLOSED_PROPERLY_ERROR), parseIndex); } parseIndex = index + 1; while (parseIndex < expression.length()) { if (!isBlank(expression.charAt(parseIndex))) { throw new ParseException(errorMessage(SENTENCE_NOT_CLOSED_PROPERLY_ERROR), parseIndex); } parseIndex++; } return ";"; }</code><technical_language>Return of method is used</technical_language>

Target:
private void parseSentenceClose() throws ParseException { int index = nextNonBlank(); if (index < 0 || expression.charAt(index) != ';') { throw new ParseException(errorMessage(SENTENCE_NOT_CLOSED_PROPERLY_ERROR), parseIndex); } parseIndex = index + 1; while (parseIndex < expression.length()) { if (isNoneBlank(expression.charAt(parseIndex))) { throw new ParseException(errorMessage(SENTENCE_NOT_CLOSED_PROPERLY_ERROR), parseIndex); } parseIndex++; } }
Source:
<code>public static String getArgValue(String[] args, String key) { int pos = ArrayUtils.indexOf(args, <START> "-" + <END> key); if (pos < 0 || pos >= args.length) { return null; } if (pos == args.length - 1 || args[pos + 1] == null || args[pos + 1].startsWith("-")) { return StringConstants.EMPTY; } return args[pos + 1]; }</code><technical_language>StringConstants.Minus</technical_language>

Target:
public static String getArgValue(String[] args, String key) { int pos = ArrayUtils.indexOf(args, StringConstants.MINUS + key); if (pos < 0 || pos >= args.length) { return null; } if (pos == args.length - 1 || args[pos + 1] == null || args[pos + 1].startsWith(StringConstants.MINUS)) { return StringConstants.EMPTY; } return args[pos + 1]; }
Source:
<code>public void createStatus() throws IOException { RepositoryId repo = new RepositoryId("o", "n"); CommitStatus status = new CommitStatus(); status.setDescription("description"); status.setTargetUrl("http://target/url"); status.setState(CommitStatus.STATE_SUCCESS); <START> status.getContext("context"); <END> service.createStatus(repo, "123", status); Map<String, String> params = new HashMap<String, String>(); params.put("description", status.getDescription()); params.put("target_url", status.getTargetUrl()); params.put("state", status.getState()); params.put("context", status.getContext()); verify(client).post("/repos/o/n/statuses/123", params, CommitStatus.class); }</code><technical_language>setContext</technical_language>

Target:
public void createStatus() throws IOException { RepositoryId repo = new RepositoryId("o", "n"); CommitStatus status = new CommitStatus(); status.setDescription("description"); status.setTargetUrl("http://target/url"); status.setState(CommitStatus.STATE_SUCCESS); status.setContext("context"); service.createStatus(repo, "123", status); Map<String, String> params = new HashMap<String, String>(); params.put("description", status.getDescription()); params.put("target_url", status.getTargetUrl()); params.put("state", status.getState()); params.put("context", status.getContext()); verify(client).post("/repos/o/n/statuses/123", params, CommitStatus.class); }
Source:
<code>public static void main(String[] args) throws IOException { Options options = new Options(); options.addOption(Option.builder("d") .longOpt("dest") .desc("Set destination directory for .class files") .hasArg() .argName("dir") .build()); options.addOption(Option.builder("v") .longOpt("verbose") .desc("Make the compiler more noisy") .build() ); options.addOption(Option.builder("h") .longOpt("help") .desc("Show this help information.") .build() ); CommandLineParser cliparser = new DefaultParser(); CommandLine line; try { line = cliparser.parse(options, args); } catch (ParseException exp) { System.err.println(exp.getMessage()); printHelp(options); return; } if (line.hasOption('h')) { printHelp(options); return; } String outDir = line.getOptionValue('d', "target" + File.separator + "classes"); if (!outDir.endsWith(File.separator)) { outDir += File.separator; } verbose = line.hasOption('v'); ArrayList<ProgramNode> trees = new ArrayList<>(); ProgramNode prelude = generateIRTree(App.class.getResourceAsStream("Prelude.bla"), "Babble\\Prelude.bla"); trees.add(prelude); for (String inPath : line.getArgs()) { File file = new File(inPath); ProgramNode babbleFile = generateIRTree(new FileInputStream(file), file.getPath()); trees.add(babbleFile); } <START> compileTrees(outDir, trees.toArray(new ProgramNode[0])); <END> if (verbose) { System.out.println("[ OK ] Compiled."); } }</code><technical_language>This toArray call... change compileTrees a list of ProgramNodes</technical_language>

Target:
public static void main(String[] args) throws IOException { Options options = new Options(); options.addOption(Option.builder("d") .longOpt("dest") .desc("Set destination directory for .class files") .hasArg() .argName("dir") .build()); options.addOption(Option.builder("v") .longOpt("verbose") .desc("Make the compiler more noisy") .build() ); options.addOption(Option.builder("h") .longOpt("help") .desc("Show this help information.") .build() ); CommandLineParser cliparser = new DefaultParser(); CommandLine line; try { line = cliparser.parse(options, args); } catch (ParseException exp) { System.err.println(exp.getMessage()); printHelp(options); return; } if (line.hasOption('h')) { printHelp(options); return; } String outDir = line.getOptionValue('d', "target" + File.separator + "classes"); if (!outDir.endsWith(File.separator)) { outDir += File.separator; } verbose = line.hasOption('v'); ArrayList<ProgramNode> trees = new ArrayList<>(); ProgramNode prelude = generateIRTree(App.class.getResourceAsStream("Prelude.bla"), "Babble\\Prelude.bla"); trees.add(prelude); for (String inPath : line.getArgs()) { File file = new File(inPath); ProgramNode babbleFile = generateIRTree(new FileInputStream(file), file.getPath()); trees.add(babbleFile); } List<String> errors = compileTrees(outDir, trees); if (errors.isEmpty()) { if (verbose) { System.out.println("[ OK ] Compiled."); } } else { System.out.println(String.format("[ ERROR ] %d Errors while compiling.", errors.size())); throw new CompileException(); } }
Source:
<code>public void onDisable() { if (instance == null || minecraftVersion == MinecraftVersion.UNIT_TEST) { return; } Bukkit.getScheduler().cancelTasks(this); if (ticker != null) { ticker.halt(); ticker.run(); } PlayerProfile.iterator().forEachRemaining(profile -> { if (profile.isDirty()) { profile.save(); } }); <START> getRegistry().getWorlds().forEach((world, storage) -> { <END> try { storage.save(true); } catch (Exception x) { getLogger().log(Level.SEVERE, x, () -> "An Error occurred while saving Slimefun-Blocks in World '" + world + "' for Slimefun " + getVersion()); } }); for (UniversalBlockMenu menu : registry.getUniversalInventories().values()) { menu.save(); } backupService.run(); AContainer.processing = null; AContainer.progress = null; AGenerator.processing = null; AGenerator.progress = null; Reactor.processing = null; Reactor.progress = null; instance = null; for (Player p : Bukkit.getOnlinePlayers()) { p.closeInventory(); } }</code><technical_language>Please .forEach(...), a negative impact performance. is advised standard for loop format instead</technical_language>

Target:
public void onDisable() { if (instance == null || minecraftVersion == MinecraftVersion.UNIT_TEST) { return; } Bukkit.getScheduler().cancelTasks(this); if (ticker != null) { ticker.halt(); ticker.run(); } PlayerProfile.iterator().forEachRemaining(profile -> { if (profile.isDirty()) { profile.save(); } }); for (Map.Entry<String, BlockStorage> entry : getRegistry().getWorlds().entrySet()) { try { entry.getValue().save(true); } catch (Exception x) { getLogger().log(Level.SEVERE, x, () -> "An Error occurred while saving Slimefun-Blocks in World '" + entry.getKey() + "' for Slimefun " + getVersion()); } } for (UniversalBlockMenu menu : registry.getUniversalInventories().values()) { menu.save(); } backupService.run(); AContainer.processing = null; AContainer.progress = null; AGenerator.processing = null; AGenerator.progress = null; Reactor.processing = null; Reactor.progress = null; instance = null; for (Player p : Bukkit.getOnlinePlayers()) { p.closeInventory(); } }