auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void stepOut() { depth--; if(state == null) { if(seenImports) { <START> SSTImportDescriptor temp = decImports.getLast(); <END> if(temp.maxID == 0 || temp.name == null || temp.version == 0) throw new UnsupportedOperationException("Illegal Shared Symbol Table Import declared in local symbol table." + temp.name + "." + temp.version); LinkedList<SymbolTable> tempImports = new LinkedList<SymbolTable>(); tempImports.add(symbolTable.getSystemSymbolTable()); SymbolTable tempTable = null; for(SSTImportDescriptor desc : decImports) { tempTable = catalog.getTable(desc.name, desc.version); if(tempTable == null) { tempTable = new SubstituteSymbolTable(desc.name, desc.version, desc.maxID); } else if(tempTable.getMaxId() != desc.maxID) { tempTable = new SubstituteSymbolTable(tempTable, desc.version, desc.maxID); } tempImports.add(tempTable); } symbolTable = new LocalSymbolTable(new LocalSymbolTableImports(tempImports), decSymbols); seenImports = false; } else { for(String sym : decSymbols) { symbolTable.intern(sym); } } } else { switch (state) { case impDesc: state = State.impList; break; case impList: case sym: state = null; break; case preSym: case impMID: case impVer: case impName: throw new UnsupportedOperationException(); } } }</code><technical_language>decImports empty</technical_language>

Target:
public void stepOut() { depth--; if(state == State.LST_STRUCT) { state = null; if(seenImports) { LinkedList<SymbolTable> tempImports = new LinkedList<SymbolTable>(); tempImports.add(symbolTable.getSystemSymbolTable()); SymbolTable tempTable = null; for(SSTImportDescriptor desc : declaredImports) { tempTable = catalog.getTable(desc.name, desc.version); if(tempTable == null) { tempTable = new SubstituteSymbolTable(desc.name, desc.version, desc.maxID); } else if(tempTable.getMaxId() != desc.maxID) { tempTable = new SubstituteSymbolTable(tempTable, desc.version, desc.maxID); } tempImports.add(tempTable); } symbolTable = new LocalSymbolTable(new LocalSymbolTableImports(tempImports), declaredSymbols); seenImports = false; } else { for(String sym : declaredSymbols) { symbolTable.intern(sym); } } } else { switch (state) { case IMPORT_DESCRIPTOR: SSTImportDescriptor temp = declaredImports.getLast(); if(temp.maxID == 0 || temp.name == null || temp.version == 0){ throw new UnsupportedOperationException("Illegal Shared Symbol Table Import declared in local symbol table." + temp.name + "." + temp.version); } state = State.IMPORT_LIST; break; case IMPORT_LIST: case SYMBOL_LIST: state = State.LST_STRUCT; break; case PRE_SYMBOL_LIST: case IMPORT_MAX_ID: case IMPORT_VERSION: case IMPORT_NAME: throw new UnsupportedOperationException(); } } }
Source:
<code><START> public ServiceBusErrorSource getErrorSource() { <END> return errorSource; }</code><technical_language>Interesting this is exception itself. Is in JS</technical_language>

Target:
ServiceBusErrorSource getErrorSource() { return errorSource; }
Source:
<code>public void onRefresh() { mRepositoryFragment = null; mContentListFragment = null; mActivityFragment = null; mRepository = null; mIsStarring = null; mIsWatching = null; mBranches = null; mTags = null; clearRefDependentFragments(); setContentShown(false); invalidateTabs(); loadRepository(true); if (Gh4Application.get().isAuthorized()) { isWatching(true); isStarring(true); <START> } <END> super.onRefresh(); }</code><technical_language>this essentially duplicates load code above, I feel a more elegant solution this - retriggers loading of existing observable's data..</technical_language>

Target:
public void onRefresh() { mRepositoryFragment = null; mContentListFragment = null; mActivityFragment = null; mRepository = null; mIsStarring = null; mIsWatching = null; mBranches = null; mTags = null; clearRefDependentFragments(); setContentShown(false); invalidateTabs(); loadRepository(true); if (Gh4Application.get().isAuthorized()) { loadWatchingStatus(true); loadStarringStatus(true); } super.onRefresh(); }
Source:
<code><START> private ObjectNode httpRequest(ObjectNode query) throws IOException { <END> Objects.requireNonNull(query, "query"); String uri = String.format(Locale.ROOT, "/%s/%s/_search", indexName, typeName); Hook.QUERY_PLAN.run(query); final String json = mapper.writeValueAsString(query); LOGGER.debug("Elasticsearch Query: {}", json); HttpEntity entity = new StringEntity(json, ContentType.APPLICATION_JSON); Response response = restClient.performRequest("POST", uri, Collections.emptyMap(), entity); if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { final String error = EntityUtils.toString(response.getEntity()); final String message = String.format(Locale.ROOT, "Error while querying Elastic (on %s/%s) status: %s\nQuery:\n%s\nError:\n%s\n", response.getHost(), response.getRequestLine(), response.getStatusLine(), query, error); throw new RuntimeException(message); } try (InputStream is = response.getEntity().getContent()) { return (ObjectNode) mapper.readTree(is); } }</code><technical_language>IMO this return ElasticseachrJson.Result</technical_language>

Target:
private ElasticsearchJson.Result httpRequest(ObjectNode query) throws IOException { Objects.requireNonNull(query, "query"); String uri = String.format(Locale.ROOT, "/%s/%s/_search", indexName, typeName); Hook.QUERY_PLAN.run(query); final String json = mapper.writeValueAsString(query); LOGGER.debug("Elasticsearch Query: {}", json); HttpEntity entity = new StringEntity(json, ContentType.APPLICATION_JSON); Response response = restClient.performRequest("POST", uri, Collections.emptyMap(), entity); if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { final String error = EntityUtils.toString(response.getEntity()); final String message = String.format(Locale.ROOT, "Error while querying Elastic (on %s/%s) status: %s\nQuery:\n%s\nError:\n%s\n", response.getHost(), response.getRequestLine(), response.getStatusLine(), query, error); throw new RuntimeException(message); } try (InputStream is = response.getEntity().getContent()) { return mapper.readValue(is, ElasticsearchJson.Result.class); } }
Source:
<code>public Observable<U> getCached(@NonNull final T id) { checkNotNull(id); final U value = cache.get(getHashCodeForId(id)); <START> return value != null <END> ? Observable.just(value) : Observable.empty(); }</code><technical_language>invert negation</technical_language>

Target:
public Observable<U> getCached(@NonNull final T id) { checkNotNull(id); final U value = cache.get(getHashCodeForId(id)); return value == null ? Observable.empty() : Observable.just(value); }
Source:
<code>public DBI build(Environment environment, DataSourceFactory configuration, ManagedDataSource dataSource, String name) { <START> final String validationQuery = configuration.getValidationQuery(); <END> final DBI dbi = new DBI(dataSource); environment.lifecycle().manage(dataSource); ExecutorService executorService = environment.lifecycle().executorService("DBIHealthCheck") .workQueue(new ArrayBlockingQueue<Runnable>(1)) .minThreads(1) .maxThreads(1).build(); environment.healthChecks().register(name, new DBIHealthCheck(executorService, dbi, validationQuery, configuration.getValidationQueryTimeout().or(Duration.seconds(5)))); dbi.setSQLLog(new LogbackLog(LOGGER, Level.TRACE)); dbi.setTimingCollector(new InstrumentedTimingCollector(environment.metrics(), new SanerNamingStrategy())); if (configuration.isAutoCommentsEnabled()) { dbi.setStatementRewriter(new NamePrependingStatementRewriter(new ColonPrefixNamedParamStatementRewriter())); } dbi.registerArgumentFactory(new OptionalArgumentFactory(configuration.getDriverClass())); dbi.registerContainerFactory(new ImmutableListContainerFactory()); dbi.registerContainerFactory(new ImmutableSetContainerFactory()); dbi.registerContainerFactory(new OptionalContainerFactory()); dbi.registerArgumentFactory(new JodaDateTimeArgumentFactory()); dbi.registerMapper(new JodaDateTimeMapper()); return dbi; }</code><technical_language>This is query validate connections in pool (depending settings, while idle, borrow, return), timeout wrapping is implemented statement level in Tomcat pool DW uses. Presuming trust pool's validation activities, checking age of org.apache.tomcat.jdbc.pool.PooledConnection#getLastValidated provides adequate healthcheck (and healthcheck timeout lifecycle settings for pool)</technical_language>

Target:
public DBI build(Environment environment, DataSourceFactory configuration, ManagedDataSource dataSource, String name) { final String validationQuery = configuration.getValidationQuery(); final DBI dbi = new DBI(dataSource); environment.lifecycle().manage(dataSource); environment.healthChecks().register(name, new DBIHealthCheck( environment.getHealthCheckExecutorService(), configuration.getValidationQueryTimeout().or(Duration.seconds(5)), dbi, validationQuery)); dbi.setSQLLog(new LogbackLog(LOGGER, Level.TRACE)); dbi.setTimingCollector(new InstrumentedTimingCollector(environment.metrics(), new SanerNamingStrategy())); if (configuration.isAutoCommentsEnabled()) { dbi.setStatementRewriter(new NamePrependingStatementRewriter(new ColonPrefixNamedParamStatementRewriter())); } dbi.registerArgumentFactory(new OptionalArgumentFactory(configuration.getDriverClass())); dbi.registerContainerFactory(new ImmutableListContainerFactory()); dbi.registerContainerFactory(new ImmutableSetContainerFactory()); dbi.registerContainerFactory(new OptionalContainerFactory()); dbi.registerArgumentFactory(new JodaDateTimeArgumentFactory()); dbi.registerMapper(new JodaDateTimeMapper()); return dbi; }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { setVolumeControlStream(AudioManager.STREAM_MUSIC); <START> AnkiDroidApp.updateContextWithLanguage(this); <END> Themes.setTheme(this); super.onCreate(savedInstanceState); mCustomTabActivityHelper = new CustomTabActivityHelper(); }</code><technical_language>explain in attachBaseContext updateContextWithLanguage if this duplication is necessary, superfluous</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { Timber.i("AnkiActivity::onCreate"); setVolumeControlStream(AudioManager.STREAM_MUSIC); Themes.setTheme(this); super.onCreate(savedInstanceState); mCustomTabActivityHelper = new CustomTabActivityHelper(); }
Source:
<code><START> private String[] parseFQ(String fq) { <END> fq = StringUtils.trimToEmpty(fq); if (StringUtils.isNotEmpty(fq)) { boolean globalInclusive = true; int start = fq.indexOf('('); int end = fq.indexOf(')'); if ((start != -1) ^ (end != -1)) return null; if (start != -1) { if (fq.charAt(0) == '-') { globalInclusive = false; } fq = fq.substring(start + 1, end); } String[] fv = fq.split(":"); if (fv.length >= 2 && StringUtils.isNotBlank(fv[0]) && StringUtils.isNotBlank(fv[1])) { boolean localInclusive = fv[0].charAt(0) != '-'; String key = localInclusive ? fv[0] : fv[0].substring(1); String calculatedKey = globalInclusive ^ localInclusive ? "-" + key : key; String value = fq.replace(fv[0] + ":", ""); return new String[]{ calculatedKey, value }; } } return null; }</code><technical_language>array element result of this method, worth returning a single String</technical_language>

Target:
private String parseFQ(String fq) { fq = StringUtils.trimToEmpty(fq); if (StringUtils.isNotEmpty(fq)) { boolean globalInclusive = true; int start = fq.indexOf('('); int end = fq.indexOf(')'); if ((start != -1) ^ (end != -1)) return null; if (start != -1) { if (fq.charAt(0) == '-') { globalInclusive = false; } fq = fq.substring(start + 1, end); } String[] fv = fq.split(":"); if (fv.length >= 2 && StringUtils.isNotBlank(fv[0]) && StringUtils.isNotBlank(fv[1])) { boolean localInclusive = fv[0].charAt(0) != '-'; String key = localInclusive ? fv[0] : fv[0].substring(1); return globalInclusive ^ localInclusive ? "-" + key : key; } } return null; }
Source:
<code>public static Properties loadProps(String filename, List<String> onlyIncludeKeys) throws IOException { <START> Properties props = new Properties(); <END> if (filename != null) { try (InputStream propStream = Files.newInputStream(Paths.get(filename))) { props.load(propStream); } } else { System.out.println("Did not load any properties since the property file is not specified"); } if (onlyIncludeKeys == null || onlyIncludeKeys.size() == 0) return props; Properties requestedProps = new Properties(); onlyIncludeKeys.forEach(key -> { String value = props.getProperty(key); if (value != null) requestedProps.setProperty(key, value); }); return requestedProps; }</code><technical_language>missing @return</technical_language>

Target:
public static Properties loadProps(String filename, List<String> onlyIncludeKeys) throws IOException { Properties props = new Properties(); if (filename != null) { try (InputStream propStream = Files.newInputStream(Paths.get(filename))) { props.load(propStream); } } else { System.out.println("Did not load any properties since the property file is not specified"); } if (onlyIncludeKeys == null || onlyIncludeKeys.isEmpty()) return props; Properties requestedProps = new Properties(); onlyIncludeKeys.forEach(key -> { String value = props.getProperty(key); if (value != null) requestedProps.setProperty(key, value); }); return requestedProps; }
Source:
<code>public void execute(IProgressMonitor monitor) throws CVSException, InterruptedException { super.execute(monitor); if (tempFile.length() == 0) { tempFile.delete(); reportEmptyDiff(); return; } if (this.isMultiPatch && (!patchHasContents && !patchHasNewFiles && !emptyDiffReported)){ <START> tempFile.delete(); <END> reportEmptyDiff(); return; } copyFile(); }</code><technical_language>temp file deleted anyway</technical_language>

Target:
public void execute(IProgressMonitor monitor) throws CVSException, InterruptedException { super.execute(monitor); if (tempFile.length() == 0) { tempFile.delete(); reportEmptyDiff(); return; } if (this.isMultiPatch && (!patchHasContents && !patchHasNewFiles)){ tempFile.delete(); reportEmptyDiff(); return; } copyFile(); }
Source:
<code><START> public static String getBMXUrl() { <END> return bmxUrl; }</code><technical_language>This method static. Apache servers for 2 URLs</technical_language>

Target:
public String getBMXUrl() { return bmxUrl; }
Source:
<code>public ServletRegistration( ServiceHolder<Servlet> servletHolder, ExtendedServletDTO servletDTO, ErrorPageDTO errorPageDTO, ServletContextHelper servletContextHelper, ContextController contextController, ServletContext servletContext, ClassLoader legacyTCCL) { super(servletHolder, servletDTO, servletContextHelper, contextController, legacyTCCL); this.errorPageDTO = errorPageDTO; <START> if (servletDTO.multipartEnabled && (factory != null)) { multipartSupport = factory.newInstance(servletDTO, servletContext); } else { multipartSupport = null; } <END> }</code><technical_language>Consider this lazily part of parseRequest ensure application code is stack File IO get proper security checks</technical_language>

Target:
public ServletRegistration( ServiceHolder<Servlet> servletHolder, ExtendedServletDTO servletDTO, ErrorPageDTO errorPageDTO, ServletContextHelper servletContextHelper, ContextController contextController, ServletContext servletContext, ClassLoader legacyTCCL) { super(servletHolder, servletDTO, servletContextHelper, contextController, legacyTCCL); this.errorPageDTO = errorPageDTO; if (servletDTO.multipartEnabled) { if (factory == null) { throw new IllegalStateException( "Multipart support not enabled due to missing, optional commons-fileupload dependency!"); } multipartSupport = factory.newInstance(servletDTO, servletContext); } else { multipartSupport = null; } }
Source:
<code>public boolean acquireWifiLock(IBinder binder, int lockMode, String tag, WorkSource ws) { <START> mLog.trace("acquireWifiLock uid=%").c(Binder.getCallingUid()).flush(); <END> if (mWifiLockManager.acquireWifiLock(lockMode, tag, binder, ws)) { mWifiController.sendMessage(CMD_LOCKS_CHANGED); return true; } return false; }</code><technical_language>tracing lockMode helpful</technical_language>

Target:
public boolean acquireWifiLock(IBinder binder, int lockMode, String tag, WorkSource ws) { mLog.trace("acquireWifiLock uid=% lockMode=%") .c(Binder.getCallingUid()) .c(lockMode).flush(); if (mWifiLockManager.acquireWifiLock(lockMode, tag, binder, ws)) { mWifiController.sendMessage(CMD_LOCKS_CHANGED); return true; } return false; }
Source:
<code>private void mark(State state, Map<NonTerminal, Set<NonTerminalState>> nonTerminalCallers) { if (!entryNullable.contains(state)) { entryNullable.add(state); if (state instanceof NextableState) { if (isNullable(state)) for (State s : ((NextableState) state).next) mark(s, nonTerminalCallers); } else { <START> assert state instanceof ExitState: "I was expecting this element to be of type ExitState"; <END> for (State s : nonTerminalCallers.get(state.nt)) { if (entryNullable.contains(s)) { for (State child : ((NextableState)s).next) { mark(child, nonTerminalCallers); } } } } } }</code><technical_language>again, need print state if want this debuggable</technical_language>

Target:
private void mark(State state, Map<NonTerminal, Set<NonTerminalState>> nonTerminalCallers) { if (!entryNullable.contains(state)) { entryNullable.add(state); if (state instanceof NextableState) { if (isNullable(state)) for (State s : ((NextableState) state).next) mark(s, nonTerminalCallers); } else { assert state instanceof ExitState: "Expected element of type ExitState: " + state; for (State s : nonTerminalCallers.get(state.nt)) { if (entryNullable.contains(s)) { for (State child : ((NextableState)s).next) { mark(child, nonTerminalCallers); } } } } } }
Source:
<code>public ChangePreview getChangePreview(RefactoringChange change) throws RefactoringException, CoreException { RefactoringSession session = getRefactoringSession(change.getSessionId()); PreviewNode previewNode = session.getChangePreview(change.getChangeId()); ChangePreviewViewerDescriptor descriptor = previewNode.getChangePreviewViewerDescriptor(); <START> if(descriptor != null){ <END> IChangePreviewViewer viewer = descriptor.createViewer(); if(viewer != null) { return previewNode.feedInput(viewer, Collections.EMPTY_LIST); } } return null; }</code><technical_language>This code is formatted, space required left brace <code>) {</code> <code>if</code>. avoid nesting changing negative statement positive: java if (descriptior == null) { return null; }</technical_language>

Target:
public ChangePreview getChangePreview(RefactoringChange change) throws RefactoringException { RefactoringSession session = getRefactoringSession(change.getSessionId()); PreviewNode previewNode = session.getChangePreview(change.getChangeId()); try { ChangePreviewViewerDescriptor descriptor = previewNode.getChangePreviewViewerDescriptor(); if (descriptor != null) { IChangePreviewViewer viewer = descriptor.createViewer(); if (viewer != null) { return previewNode.feedInput(viewer, Collections.EMPTY_LIST); } } } catch (CoreException e) { throw new RefactoringException(e.getMessage()); } return null; }
Source:
<code>public double[] getDerivatives() { <START> return _derivatives; <END> }</code><technical_language>Return clone copy</technical_language>

Target:
public double[] getDerivatives() { return _derivatives.clone(); }
Source:
<code>protected void loadSshConfig() throws BuildException { if (sshConfig != null) { if (!new File(sshConfig).exists()) { throw new BuildException("The SSH configuration file specified doesn't exist: " + sshConfig); } log("Loading SSH configuration file " + sshConfig, Project.MSG_DEBUG); ConfigRepository.Config config = null; try { config = OpenSSHConfig.parseFile(sshConfig).getConfig(host); } catch (IOException e) { throw new BuildException("Failed to load the SSH configuration file " + sshConfig, e); } host = config.getHostname(); <START> if (userInfo.getName() == null) { <END> userInfo.setName(config.getUser()); } if (userInfo.getKeyfile() == null) { log("Using SSH key file " + config.getValue("IdentityFile") + " for host " + host, Project.MSG_INFO); userInfo.setKeyfile(config.getValue("IdentityFile")); } } }</code><technical_language>this check happen load sshConfig file? avoid loading parsing of file? load file if userInfo name keyfile available</technical_language>

Target:
protected void loadSshConfig() throws BuildException { if (sshConfig != null && (userInfo.getName() == null || userInfo.getKeyfile() == null)) { if (!new File(sshConfig).exists()) { throw new BuildException("The SSH configuration file specified doesn't exist: " + sshConfig); } log("Loading SSH configuration file " + sshConfig, Project.MSG_DEBUG); ConfigRepository.Config config = null; try { config = OpenSSHConfig.parseFile(sshConfig).getConfig(host); } catch (IOException e) { throw new BuildException("Failed to load the SSH configuration file " + sshConfig, e); } host = config.getHostname(); if (userInfo.getName() == null) { userInfo.setName(config.getUser()); } if (userInfo.getKeyfile() == null) { log("Using SSH key file " + config.getValue("IdentityFile") + " for host " + host, Project.MSG_INFO); userInfo.setKeyfile(config.getValue("IdentityFile")); } } }
Source:
<code>public IonValue get(String fieldName) { int field_idx = find_field_helper(fieldName); IonValue field; if (field_idx < 0) { <START> if(hasNullFieldName) throw new UnknownSymbolException("Because a field exists with an unknown name we cannot say for certain whether the requested field exists or not."); <END> field = null; } else { field = get_child(field_idx); } return field; }</code><technical_language>This condition needs a test</technical_language>

Target:
public IonValue get(String fieldName) { int field_idx = find_field_helper(fieldName); IonValue field; if (field_idx < 0) { if(hasNullFieldName) throw new UnknownSymbolException("Unable to determine whether the field exists because the struct contains field names with unknown text."); field = null; } else { field = get_child(field_idx); } return field; }
Source:
<code>private final IStatus hasADefinedRelationship() { final ElementTypeConfiguration etc = this.conf.getEditedElement(); if (null == etc) { return createErrorStatus(Messages.RelationshipOwnerValidator_NoRelationshipDefined); } final <START> EClass eclass = ((MetamodelTypeConfiguration) etc).getEClass(); <END> if (eclass.isAbstract()) { return createErrorStatus(Messages.RelationshipOwnerValidator_ChosenRelationshipIsAbstract); } return Status.OK_STATUS; }</code><technical_language>change this line done in hasFeatureAcceptingRelationShip method</technical_language>

Target:
private final IStatus hasADefinedRelationship() { final ElementTypeConfiguration etc = this.conf.getEditedElement(); if (null == etc) { return createErrorStatus(Messages.RelationshipOwnerValidator_NoRelationshipDefined); } final EClass eclass = getBaseMetamodelEClass(etc); if (null != eclass) { if (eclass.isAbstract()) { return createErrorStatus(Messages.RelationshipOwnerValidator_ChosenRelationshipIsAbstract); } } return Status.OK_STATUS; }
Source:
<code>private void cacheCaseModelQuerySet(QueryContext queryContext, DualTableSingleMatchModelQuerySet ret) { <START> if(ret.getSetBody().size() > 50 && ret.getSetBody().size() < CaseGroupResultCache.MAX_PREFETCH_CASE_BLOCK) { <END> queryContext.getQueryCache(CaseGroupResultCache.class).reportBulkCaseBody(this.getCurrentQuerySetId(), ret.getSetBody()); } }</code><technical_language>magic int</technical_language>

Target:
private void cacheCaseModelQuerySet(QueryContext queryContext, DualTableSingleMatchModelQuerySet ret) { int modelQueryMagnitude = ret.getSetBody().size(); if(modelQueryMagnitude > QueryContext.BULK_QUERY_THRESHOLD && modelQueryMagnitude < CaseGroupResultCache.MAX_PREFETCH_CASE_BLOCK) { queryContext.getQueryCache(CaseGroupResultCache.class).reportBulkCaseBody(this.getCurrentQuerySetId(), ret.getSetBody()); } }
Source:
<code>protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); <START> if (instanceState != null) { <END> instanceState.saveState(outState); } outState.putBoolean(KEY_FORM_LOAD_HAS_TRIGGERED, hasFormLoadBeenTriggered); outState.putBoolean(KEY_FORM_LOAD_FAILED, hasFormLoadFailed); outState.putString(KEY_LOC_ERROR, locationRecieverErrorAction); outState.putString(KEY_LOC_ERROR_PATH, badLocationXpath); outState.putBoolean(KEY_INCOMPLETE_ENABLED, mIncompleteEnabled); outState.putBoolean(KEY_HAS_SAVED, hasSaved); outState.putString(KEY_RESIZING_ENABLED, ResizingImageView.resizeMethod); outState.putBoolean(KEY_IS_READ_ONLY, instanceIsReadOnly); formEntryRestoreSession.saveFormEntrySession(outState); if (indexOfWidgetWithVideoPlaying != -1) { outState.putInt(KEY_WIDGET_WITH_VIDEO_PLAYING, indexOfWidgetWithVideoPlaying); outState.putInt(KEY_POSITION_OF_VIDEO_PLAYING, positionOfVideoProgress); } if (symetricKey != null) { try { outState.putString(KEY_AES_STORAGE_KEY, new Base64Wrapper().encodeToString(symetricKey.getEncoded())); } catch (ClassNotFoundException e) { throw new RuntimeException("Base 64 encoding unavailable! Can't pass storage key"); } } uiController.saveInstanceState(outState); }</code><technical_language>scenarios lead instanceState null</technical_language>

Target:
protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); instanceState.saveState(outState); outState.putBoolean(KEY_FORM_LOAD_HAS_TRIGGERED, hasFormLoadBeenTriggered); outState.putBoolean(KEY_FORM_LOAD_FAILED, hasFormLoadFailed); outState.putString(KEY_LOC_ERROR, locationRecieverErrorAction); outState.putString(KEY_LOC_ERROR_PATH, badLocationXpath); outState.putBoolean(KEY_INCOMPLETE_ENABLED, mIncompleteEnabled); outState.putBoolean(KEY_HAS_SAVED, hasSaved); outState.putString(KEY_RESIZING_ENABLED, ResizingImageView.resizeMethod); outState.putBoolean(KEY_IS_READ_ONLY, instanceIsReadOnly); formEntryRestoreSession.saveFormEntrySession(outState); if (indexOfWidgetWithVideoPlaying != -1) { outState.putInt(KEY_WIDGET_WITH_VIDEO_PLAYING, indexOfWidgetWithVideoPlaying); outState.putInt(KEY_POSITION_OF_VIDEO_PLAYING, positionOfVideoProgress); } if (symetricKey != null) { try { outState.putString(KEY_AES_STORAGE_KEY, new Base64Wrapper().encodeToString(symetricKey.getEncoded())); } catch (ClassNotFoundException e) { throw new RuntimeException("Base 64 encoding unavailable! Can't pass storage key"); } } uiController.saveInstanceState(outState); }
Source:
<code>protected IRequestHandler processHybrid(PageInfo pageInfo, Class<? extends IRequestablePage> pageClass, PageParameters pageParameters, Integer renderCount) { PageProvider provider = new PageProvider(pageInfo.getPageId(), pageClass, pageParameters, renderCount); provider.setPageSource((IPageSource)Application.get().getMapperContext()); if (provider.isNewPageInstance() && <START> !WebApplication.get().getPageSettings().getRecreateBookmarkablePagesAfterExpiry()) <END> { throw new PageExpiredException(String.format("Bookmarkable page id '%d' has expired.", pageInfo.getPageId())); } else { return new RenderPageRequestHandler(provider); } }</code><technical_language>cache of Application.get() a local variable avoid making ThreadLocal lookups</technical_language>

Target:
protected IRequestHandler processHybrid(PageInfo pageInfo, Class<? extends IRequestablePage> pageClass, PageParameters pageParameters, Integer renderCount) { PageProvider provider = new PageProvider(pageInfo.getPageId(), pageClass, pageParameters, renderCount); Application application = Application.get(); provider.setPageSource((IPageSource)application.getMapperContext()); if (provider.isNewPageInstance() && !application.getPageSettings().getRecreateBookmarkablePagesAfterExpiry()) { throw new PageExpiredException(String.format("Bookmarkable page id '%d' class '%s' has expired.", pageInfo.getPageId(), pageClass.getName())); } else { return new RenderPageRequestHandler(provider); } }
Source:
<code>@Test public void testRexSubQueryIn() { <START> final RelBuilder builder = RelBuilder.create(config().build()); <END> RelNode root = builder.scan("EMP") .filter( builder.in( builder.scan("DEPT") .filter( builder.call(SqlStdOperatorTable.EQUALS, builder.field("DNAME"), builder.literal("AAA"))) .project(builder.field("DEPTNO")) .build(), ImmutableList.of(builder.field("DEPTNO")))) .build(); final String expected = "LogicalFilter(condition=[IN($7, {\n" + "LogicalProject(DEPTNO=[$0])\n" + " LogicalFilter(condition=[=($1, 'AAA')])\n" + " LogicalTableScan(table=[[scott, DEPT]])\n" + "})])\n" + " LogicalTableScan(table=[[scott, EMP]])\n"; assertThat(root, hasTree(expected)); }</code><technical_language>delete this empty line</technical_language>

Target:
@Test void testRexSubQueryIn() { final RelBuilder builder = RelBuilder.create(config().build()); final RelNode root = builder.scan("EMP") .filter( builder.in( builder.scan("DEPT") .filter( builder.call(SqlStdOperatorTable.EQUALS, builder.field("DNAME"), builder.literal("Accounting"))) .project(builder.field("DEPTNO")) .build(), ImmutableList.of(builder.field("DEPTNO")))) .build(); final String expected = "LogicalFilter(condition=[IN($7, {\n" + "LogicalProject(DEPTNO=[$0])\n" + " LogicalFilter(condition=[=($1, 'Accounting')])\n" + " LogicalTableScan(table=[[scott, DEPT]])\n" + "})])\n" + " LogicalTableScan(table=[[scott, EMP]])\n"; assertThat(root, hasTree(expected)); }
Source:
<code>public TransferBatchRequestForNode next() { <START> List<Long> addresses = ImmutableList.copyOf(originalRequest.getAddresses()); <END> String nextNode = iter.next(); return new TransferBatchRequestForNode(addresses, nextNode); }</code><technical_language>Copying addresses time expensive, a immutableList field in this class instead of TransferBatchRequest (originalRequest) need is addresses</technical_language>

Target:
public TransferBatchRequestForNode next() { String nextNode = iter.next(); return new TransferBatchRequestForNode(originalAddresses, nextNode); }
Source:
<code>protected synchronized void replyReceived() { timeoutcounter = 0; switch (readState[currentPin]) { case NONE: break; case READVALUE1: case READINGVALUE1: readState[currentPin] = READVALUE2; return; case READVALUE2: case READINGVALUE2: readState[currentPin] = READMODE; return; case READMODE: case READINGMODE: readState[currentPin] = NONE; return; default: log.error("Pin unexpected read state, can't advance {}", currentPin, readState[currentPin]); readState[currentPin] = NONE; return; } switch (writeState[currentPin]) { case NONE: return; case WRITEVALUE1: case WRITINGVALUE1: writeState[currentPin] = WRITEVALUE2; return; case WRITEVALUE2: case WRITINGVALUE2: writeState[currentPin] = WRITEMODE; return; case WRITEMODE: case WRITINGMODE: writeState[currentPin] = NONE; <START> return; <END> default: log.error("Pin unexpected write state, can't advance {}", currentPin, writeState[currentPin]); writeState[currentPin] = NONE; } }</code><technical_language>this return restored well</technical_language>

Target:
protected synchronized void replyReceived() { timeoutcounter = 0; switch (readState[currentPin]) { case NONE: break; case READVALUE1: case READINGVALUE1: readState[currentPin] = READVALUE2; return; case READVALUE2: case READINGVALUE2: readState[currentPin] = READMODE; return; case READMODE: case READINGMODE: readState[currentPin] = NONE; return; default: log.error("Pin unexpected read state, can't advance {}", currentPin, readState[currentPin]); readState[currentPin] = NONE; return; } switch (writeState[currentPin]) { case NONE: return; case WRITEVALUE1: case WRITINGVALUE1: writeState[currentPin] = WRITEVALUE2; return; case WRITEVALUE2: case WRITINGVALUE2: writeState[currentPin] = WRITEMODE; return; case WRITEMODE: case WRITINGMODE: writeState[currentPin] = NONE; return; default: log.error("Pin unexpected write state, can't advance {}", currentPin, writeState[currentPin]); writeState[currentPin] = NONE; return; } }
Source:
<code><START> private int encode(int bucketIndex, int value) <END> { return (bucketIndex << VALUE_BITS) | value; }</code><technical_language>static</technical_language>

Target:
private static int encode(int bucketIndex, int value) { return (bucketIndex << VALUE_BITS) | value; }
Source:
<code>public List<InventoryDetails> createInventoryDetailList(final Integer numOfEntries) { final List<InventoryDetails> inventoryDetails = new ArrayList<InventoryDetails>(); for (int i = 0; i < numOfEntries; i++) { final int id = i + 1; final InventoryDetails invDetails = new InventoryDetails(); invDetails.setLotId(id); invDetails.setGid(id); invDetails.setGermplasmName("GermplsmName"+i); invDetails.setCross("Cross"+i); invDetails.setSource("SeedSource"+i); invDetails.setGroupId(i); invDetails.setReplicationNumber(1); invDetails.setPlotNumber(1); <START> invDetails.setInstanceNumber(1); <END> invDetails.setInstanceNumber(1); invDetails.setEntryId(1); inventoryDetails.add(invDetails); } return inventoryDetails; }</code><technical_language>minor notice - setting invDetails.setInstanceNumber(1) times</technical_language>

Target:
public List<InventoryDetails> createInventoryDetailList(final Integer numOfEntries) { final List<InventoryDetails> inventoryDetails = new ArrayList<InventoryDetails>(); for (int i = 0; i < numOfEntries; i++) { final int id = i + 1; final InventoryDetails invDetails = new InventoryDetails(); invDetails.setLotId(id); invDetails.setGid(id); invDetails.setGermplasmName("GermplsmName"+i); invDetails.setCross("Cross"+i); invDetails.setSource("SeedSource"+i); invDetails.setGroupId(i); invDetails.setReplicationNumber(1); invDetails.setPlotNumber(1); invDetails.setInstanceNumber(1); invDetails.setEntryId(1); inventoryDetails.add(invDetails); } return inventoryDetails; }
Source:
<code>public boolean hasDSpacePermission(Authentication authentication, Serializable targetId, String targetType, DSpaceRestPermission permission) { DSpaceRestPermission restPermission = DSpaceRestPermission.convert(permission); if (!DSpaceRestPermission.READ.equals(restPermission) && !DSpaceRestPermission.WRITE.equals(restPermission) && !DSpaceRestPermission.DELETE.equals(restPermission)) { return false; } if (!StringUtils.equalsIgnoreCase(targetType, WorkspaceItemRest.NAME)) { return false; } Request request = requestService.getCurrentRequest(); Context context = ContextUtil.obtainContext(request.getServletRequest()); EPerson ePerson = null; WorkspaceItem witem = null; try { <START> ePerson = ePersonService.findByEmail(context, (String) authentication.getPrincipal()); <END> Integer dsoId = Integer.parseInt(targetId.toString()); if (ePerson == null) { return false; } witem = wis.find(context, dsoId); if (witem == null) { return true; } if (witem.getSubmitter() != null) { if (witem.getSubmitter().getID().equals(ePerson.getID())) { return true; } } } catch (SQLException e) { log.error(e.getMessage(), e); } return false; }</code><technical_language>is this based context.getCurrentUser()</technical_language>

Target:
public boolean hasDSpacePermission(Authentication authentication, Serializable targetId, String targetType, DSpaceRestPermission permission) { DSpaceRestPermission restPermission = DSpaceRestPermission.convert(permission); if (!DSpaceRestPermission.READ.equals(restPermission) && !DSpaceRestPermission.WRITE.equals(restPermission) && !DSpaceRestPermission.DELETE.equals(restPermission)) { return false; } if (!StringUtils.equalsIgnoreCase(targetType, WorkspaceItemRest.NAME)) { return false; } Request request = requestService.getCurrentRequest(); Context context = ContextUtil.obtainContext(request.getServletRequest()); EPerson ePerson = null; WorkspaceItem witem = null; try { ePerson = context.getCurrentUser(); Integer dsoId = Integer.parseInt(targetId.toString()); if (ePerson == null) { return false; } witem = wis.find(context, dsoId); if (witem == null) { return true; } if (witem.getSubmitter() != null) { if (witem.getSubmitter().getID().equals(ePerson.getID())) { return true; } } } catch (SQLException e) { log.error(e.getMessage(), e); } return false; }
Source:
<code>private void recalculateMemory() { <START> if(isPersistent()) { <END> int mem = DataUtils.PAGE_MEMORY; DataType keyType = map.getKeyType(); for (int i = 0; i < keys.length; i++) { mem += keyType.getMemory(keys[i]); } if (this.isLeaf()) { DataType valueType = map.getValueType(); for (int i = 0; i < keys.length; i++) { mem += valueType.getMemory(values[i]); } } else { mem += this.getRawChildPageCount() * DataUtils.PAGE_MEMORY_CHILD; } addMemory(mem - memory); } }</code><technical_language>throwing exception is get called in non-persistent mode</technical_language>

Target:
private void recalculateMemory() { int mem = DataUtils.PAGE_MEMORY; DataType keyType = map.getKeyType(); for (int i = 0; i < keys.length; i++) { mem += keyType.getMemory(keys[i]); } if (this.isLeaf()) { DataType valueType = map.getValueType(); for (int i = 0; i < keys.length; i++) { mem += valueType.getMemory(values[i]); } } else { mem += this.getRawChildPageCount() * DataUtils.PAGE_MEMORY_CHILD; } addMemory(mem - memory); }
Source:
<code>public void testDynamicProviderExceptionsAreNotPropagated() { MetricsCollector collectorMock = mock(MetricsCollector.class); MetricsRegistry metricsRegistry = new MetricsRegistryImpl(Logger.getLogger(MetricsRegistryImpl.class), MANDATORY); metricsRegistry.registerDynamicMetricsProvider((taggerSupplier, context) -> { throw new RuntimeException("Intentionally failing metrics collection"); }); try { <START> metricsRegistry.collect(collectorMock); <END> } catch (AssertionError ex) { } }</code><technical_language>Needs a fail() this statement, test pass metricsRegistry.collect throw AssertionError. Also, annotate test @RequireAssertEnabled ensure assertions enabled</technical_language>

Target:
public void testDynamicProviderExceptionsAreNotPropagated() { MetricsCollector collectorMock = mock(MetricsCollector.class); MetricsRegistry metricsRegistry = new MetricsRegistryImpl(Logger.getLogger(MetricsRegistryImpl.class), MANDATORY); metricsRegistry.registerDynamicMetricsProvider((taggerSupplier, context) -> { throw new RuntimeException("Intentionally failing metrics collection"); }); try { metricsRegistry.collect(collectorMock); fail("Should throw AssertionError"); } catch (AssertionError ex) { } }
Source:
<code>public int getApplicationStartedOrder() { <START> return ((MetricsServiceImpl) Framework.getRuntime().getComponent(MetricsService.class.getName())).getApplicationStartedOrder() + 1; <END> }</code><technical_language>min of MetricsService RepositoryService</technical_language>

Target:
public int getApplicationStartedOrder() { Component component = (Component) Framework.getRuntime().getComponent(MetricsService.class.getName()); return component.getApplicationStartedOrder() + 1; }
Source:
<code>public static void generate( Project project, BuckFileManager buckFileManager, VisibilityExtension visibilityExtension, TestExtension testExtension) { File moduleDir = project.getBuildFile().getParentFile(); File visibilityFile = new File(moduleDir, visibilityExtension.visibilityFileName); boolean hasVisibilityFile = visibilityFile.isFile(); File integrationTestsFile = new File(moduleDir, testExtension.integrationTestDir); <START> boolean hasIntegrationTests = testExtension.enableIntegrationTests && integrationTestsFile.isDirectory(); <END> List<Rule> rules = createRules(project, hasIntegrationTests); Multimap<String, String> extraLoadStatements = TreeMultimap.create(); if (hasVisibilityFile) { rules.forEach(rule -> rule.fileConfiguredVisibility(true)); extraLoadStatements.put( ":" + visibilityExtension.visibilityFileName, visibilityExtension.visibilityFunction); } File buckFile = project.file(OkBuckGradlePlugin.BUCK); buckFileManager.writeToBuckFile(rules, buckFile, extraLoadStatements); }</code><technical_language>this target.getIntegrationTest().getSources().isEmpty() I scope return empty configuration scope integrationTest configuration is resolvable</technical_language>

Target:
public static void generate( Project project, BuckFileManager buckFileManager, VisibilityExtension visibilityExtension, TestExtension testExtension) { File moduleDir = project.getBuildFile().getParentFile(); File visibilityFile = new File(moduleDir, visibilityExtension.visibilityFileName); boolean hasVisibilityFile = visibilityFile.isFile(); boolean hasIntegrationTests = testExtension.enableIntegrationTests; List<Rule> rules = createRules(project, hasIntegrationTests); Multimap<String, String> extraLoadStatements = TreeMultimap.create(); if (hasVisibilityFile) { rules.forEach(rule -> rule.fileConfiguredVisibility(true)); extraLoadStatements.put( ":" + visibilityExtension.visibilityFileName, visibilityExtension.visibilityFunction); } File buckFile = project.file(OkBuckGradlePlugin.BUCK); buckFileManager.writeToBuckFile(rules, buckFile, extraLoadStatements); }
Source:
<code><START> private Module getAdditionalBindings() { <END> return new AbstractModule() { @Override protected void configure() { bind(AdminContainerConfig.class).to(AdminConfigImpl.class); bind(AdminResourcesFilter.class); } }; }</code><technical_language>This method enforces AdminConfigImpl binding, while inject custom instance of it. injecting custom implementation results in duplicate binding exception</technical_language>

Target:
private Module getAdditionalBindings() { return new AbstractModule() { @Override protected void configure() { bind(AdminResourcesFilter.class); } }; }
Source:
<code>private Map<String, String> createUniqueWorkspaceNameMap() { Map<String, String> uniqueWorkspaceNameMap = new HashMap<>(); List<String[]> splittedWorkspaceNames = Arrays.asList(launchData.getRecentWorkspaces()).stream() <START> .filter(s -> s != null && !s.isEmpty()).map(s -> s.split("\\\\")) END> .collect(Collectors.toList()); for (int i = 1; !splittedWorkspaceNames.isEmpty(); i++) { final int c = i; Function<String[], String> stringArraytoName = s -> String.join("\\", Arrays.copyOfRange(s, s.length - c, s.length)); List<String> uniqueNames = splittedWorkspaceNames.stream().map(stringArraytoName) .collect(Collectors.groupingBy(s -> s, Collectors.counting())).entrySet().stream() .filter(e -> e.getValue() == 1).map(e -> e.getKey()).collect(Collectors.toList()); splittedWorkspaceNames.removeIf(a -> { String joined = stringArraytoName.apply(a); if (uniqueNames.contains(joined)) { uniqueWorkspaceNameMap.put(joined, String.join("\\", a)); return true; } return false; }); } return uniqueWorkspaceNameMap; }</code><technical_language>\\ works for Windows. java.io.File.separator System.getProperty("file.separator")</technical_language>

Target:
private Map<String, String> createUniqueWorkspaceNameMap() { final String fileSeparator = File.separator; Map<String, String> uniqueWorkspaceNameMap = new HashMap<>(); List<String[]> splittedWorkspaceNames = Arrays.asList(launchData.getRecentWorkspaces()).stream() .filter(s -> s != null && !s.isEmpty()).map(s -> s.split(Pattern.quote(fileSeparator))) .collect(Collectors.toList()); for (int i = 1; !splittedWorkspaceNames.isEmpty(); i++) { final int c = i; Function<String[], String> stringArraytoName = s -> String.join(fileSeparator, Arrays.copyOfRange(s, s.length - c, s.length)); List<String> uniqueNames = splittedWorkspaceNames.stream().map(stringArraytoName) .collect(Collectors.groupingBy(s -> s, Collectors.counting())).entrySet().stream() .filter(e -> e.getValue() == 1).map(e -> e.getKey()).collect(Collectors.toList()); splittedWorkspaceNames.removeIf(a -> { String joined = stringArraytoName.apply(a); if (uniqueNames.contains(joined)) { uniqueWorkspaceNameMap.put(joined, String.join(fileSeparator, a)); return true; } return false; }); } return uniqueWorkspaceNameMap; }
Source:
<code>public JdbcPageSink(JdbcOutputTableHandle handle, JdbcClient jdbcClient) { try { connection = jdbcClient.getConnection(handle); <START> connection.setAutoCommit(false); <END> } catch (SQLException e) { throw new PrestoException(JDBC_ERROR, e); } try { statement = connection.prepareStatement(jdbcClient.buildInsertSql(handle)); } catch (SQLException e) { throw new PrestoException(JDBC_ERROR, e); } columnTypes = handle.getColumnTypes(); }</code><technical_language>In setAutoCommit throws, constructor throws, connection closed</technical_language>

Target:
public JdbcPageSink(JdbcOutputTableHandle handle, JdbcClient jdbcClient) { try { connection = jdbcClient.getConnection(handle); } catch (SQLException e) { throw new PrestoException(JDBC_ERROR, e); } try { connection.setAutoCommit(false); statement = connection.prepareStatement(jdbcClient.buildInsertSql(handle)); } catch (SQLException e) { closeWithSuppression(connection, e); throw new PrestoException(JDBC_ERROR, e); } columnTypes = handle.getColumnTypes(); }
Source:
<code>public static String formatDateToIso8601Utc(Date dateInUtc) { if (dateInUtc == null) { return ""; } SimpleDateFormat sdf = new SimpleDateFormat(Const.TIME_FORMAT_ISO_8601_UTC); <START> return sdf.format(dateInUtc); <END> }</code><technical_language>I issue! need do sdf.setTimeZone(SystemParams.TIME_ZONE); for work user.timezone VM flag. other TimeHelper methods do this</technical_language>

Target:
public static String formatDateToIso8601Utc(Date dateInUtc) { if (dateInUtc == null) { return ""; } SimpleDateFormat sdf = new SimpleDateFormat(Const.TIME_FORMAT_ISO_8601_UTC); sdf.setTimeZone(SystemParams.TIME_ZONE); return sdf.format(dateInUtc); }
Source:
<code>public Optional<Scoreboard> getServerScoreboard() { <START> final Optional<WorldServer> optWorldServer = DimensionManager.getWorldByDimensionId(0); <END> return optWorldServer.isPresent() ? Optional.of((Scoreboard) optWorldServer.get().getScoreboard()) : Optional.empty(); }</code><technical_language>Optional.transform :)</technical_language>

Target:
public Optional<Scoreboard> getServerScoreboard() { return DimensionManager.getWorldByDimensionId(0).map(worldServer -> (Scoreboard) worldServer.getScoreboard()); }
Source:
<code>ReadableByteChannel open() throws IOException { boolean isDefaultFileSystem = pageCache.getCachedFileSystem() instanceof DefaultFileSystemAbstraction; <START> if ( !isDefaultFileSystem ) <END> { Optional<PagedFile> existingMapping = pageCache.getExistingMapping( file ); if ( existingMapping.isPresent() ) { try ( PagedFile pagedFile = existingMapping.get() ) { return pagedFile.openReadableByteChannel(); } } } return fs.open( file, "r" ); }</code><technical_language>please reverse this condition (switch if else blocks avoid negation)</technical_language>

Target:
ReadableByteChannel open() throws IOException { if ( !pageCache.fileSystemSupportsFileOperations() ) { Optional<PagedFile> existingMapping = pageCache.getExistingMapping( file ); if ( existingMapping.isPresent() ) { try ( PagedFile pagedFile = existingMapping.get() ) { return pagedFile.openReadableByteChannel(); } } } return fs.open( file, "r" ); }
Source:
<code>private void advance() { next = null; while (next == null && mapIterator.hasNext()) { Map.Entry<K, OffHeapValueHolder<V>> entry = mapIterator.next(); final long now = timeSource.getTimeMillis(); if (entry.getValue().isExpired(now, TimeUnit.MILLISECONDS)) { <START> onExpiration(entry.getKey(), entry.getValue()); <END> continue; } next = entry; } }</code><technical_language>Confused - remove fire event</technical_language>

Target:
private void advance() { next = null; while (next == null && mapIterator.hasNext()) { Map.Entry<K, OffHeapValueHolder<V>> entry = mapIterator.next(); final long now = timeSource.getTimeMillis(); if (entry.getValue().isExpired(now, TimeUnit.MILLISECONDS)) { containsKey(entry.getKey()); continue; } next = entry; } }
Source:
<code>public synchronized Map<String, ? extends DockerMachine> getMachines() { if (machines != null) { <START> return Collections.unmodifiableMap(machines); <END> } return Collections.emptyMap(); }</code><technical_language>This method is in DockerInternalRuntime, I skip wrapping machines unmodifiableMap. BTW inline this ternary operator :smile:</technical_language>

Target:
public synchronized Map<String, ? extends DockerMachine> getMachines() { return machines != null ? machines : Collections.emptyMap(); }