auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void becomeUser( final String principalName, final IParameterProvider paramProvider ) { UserSession session = null; tenantedUserNameUtils = getTenantedUserNameUtils(); if ( tenantedUserNameUtils != null ) { session = new UserSession( principalName, null, false, paramProvider ); ITenant tenant = tenantedUserNameUtils.getTenant( principalName ); session.setAttribute( IPentahoSession.TENANT_ID_KEY, tenant.getId() ); session.setAuthenticated( tenant.getId(), principalName ); } else { session = new UserSession( principalName, null, false, paramProvider ); session.setAuthenticated( principalName ); } PentahoSessionHolder.setSession( session ); Authentication auth = createAuthentication( principalName ); <START> PentahoSessionHolder.getSession().setAttribute( "roles", auth.getAuthorities() ); <END> SecurityContextHolder.clearContext(); SecurityContextHolder.getContext().setAuthentication( auth ); PentahoSystem.sessionStartup( PentahoSessionHolder.getSession(), paramProvider ); }</code><technical_language>replace "roles" IPentahoSession.SESSION_ROLES</technical_language>

Target:
public void becomeUser( final String principalName, final IParameterProvider paramProvider ) { UserSession session = null; tenantedUserNameUtils = getTenantedUserNameUtils(); if ( tenantedUserNameUtils != null ) { session = new UserSession( principalName, null, false, paramProvider ); ITenant tenant = tenantedUserNameUtils.getTenant( principalName ); session.setAttribute( IPentahoSession.TENANT_ID_KEY, tenant.getId() ); session.setAuthenticated( tenant.getId(), principalName ); } else { session = new UserSession( principalName, null, false, paramProvider ); session.setAuthenticated( principalName ); } PentahoSessionHolder.setSession( session ); Authentication auth = createAuthentication( principalName ); PentahoSessionHolder.getSession().setAttribute( IPentahoSession.SESSION_ROLES, auth.getAuthorities() ); SecurityContextHolder.clearContext(); SecurityContextHolder.getContext().setAuthentication( auth ); PentahoSystem.sessionStartup( PentahoSessionHolder.getSession(), paramProvider ); }
Source:
<code>void sendMessage(final String message) { Preconditions.checkState(!closed); <START> client.send(message); <END> }</code><technical_language>thoughts checking client.isOpen()? I vaguely recall cases important check system testing. good error behavior covered unit tests verify handling for edge-cases hard reproduce manually</technical_language>

Target:
void sendMessage(final String message) { Preconditions.checkState(!closed); Preconditions.checkState(client.isOpen()); client.send(message); }
Source:
<code>private RolesAllowedRequestFilter(HttpServletRequest request, HttpServletResponse response, String[] rolesAllowed, boolean permitAll) { this.request = request; this.response = response; this.rolesAllowed = rolesAllowed; this.securityContext = CDI.current().select(SecurityContext.class).get(); this.permitAll = permitAll; <START> assert permitAll ^ rolesAllowed != null; <END> }</code><technical_language>I guess XOR works this is a logical test I a logic operator != is more suggestion assert permitAll != (rolesAllowed != null);</technical_language>

Target:
private RolesAllowedRequestFilter(HttpServletRequest request, HttpServletResponse response, String[] rolesAllowed, boolean permitAll) { this.request = request; this.response = response; this.rolesAllowed = rolesAllowed; this.securityContext = CDI.current().select(SecurityContext.class).get(); this.permitAll = permitAll; assert permitAll == (rolesAllowed == null); }
Source:
<code>static CassandraVersion fromEnvironment() { <START> String version = System.getenv(CassandraEnvironment.CASSANDRA_VERSION); <END> return Strings.isNullOrEmpty(version) ? new Cassandra22XVersion() : from(version); }</code><technical_language>getOrDefault preserve behaviour, rename fromEnvironmentOrDefault</technical_language>

Target:
static CassandraVersion fromEnvironment() { String version = CassandraEnvironment.getVersion(); return from(version); }
Source:
<code>public void testNoFrom() { <START> assertQuery("SELECT 1 + 2, 3 + 4", "SELECT 1 + 2, 3 + 4"); <END> }</code><technical_language>expected actual SQLs same, simpler assertQuery overload</technical_language>

Target:
public void testNoFrom() { assertQuery("SELECT 1 + 2, 3 + 4"); }
Source:
<code>private Iterator<Page> readPages() { if (read) { throw new RuntimeException("Already read"); } read = true; writable = false; try { InputStream input = new FileInputStream(targetFileName.toFile()); memoryContext.setBytes(BUFFER_SIZE); <START> Closeable resources = PrestoCloseables.combine(input, () -> memoryContext.setBytes(0)); <END> closer.register(resources); Iterator<Page> pages = PagesSerdeUtil.readPages(serde, new InputStreamSliceInput(input, BUFFER_SIZE)); return PrestoIterators.closeWhenExhausted(pages, resources); } catch (IOException e) { throw new PrestoException(GENERIC_INTERNAL_ERROR, "Failed to read spilled pages", e); } }</code><technical_language>nit: rename combineClosables/groupClosables static import</technical_language>

Target:
private Iterator<Page> readPages() { checkState(writable, "Repeated reads are disallowed to prevent potential resource leaks"); writable = false; try { InputStream input = targetFile.newInputStream(); Closeable resources = closer.register(combineCloseables(input, () -> memoryContext.setBytes(0))); memoryContext.setBytes(BUFFER_SIZE); Iterator<Page> pages = PagesSerdeUtil.readPages(serde, new InputStreamSliceInput(input, BUFFER_SIZE)); return PrestoIterators.closeWhenExhausted(pages, resources); } catch (IOException e) { throw new PrestoException(GENERIC_INTERNAL_ERROR, "Failed to read spilled pages", e); } }
Source:
<code>public void contextInitialized(ServletContextEvent event) { log.debug("Starting the OpenMRS webapp"); try { OpenmrsUtil.validateJavaVersion(); ServletContext servletContext = event.getServletContext(); loadConstants(servletContext); clearDWRFile(servletContext); setApplicationDataDirectory(servletContext); Properties props = getRuntimeProperties(); if (props != null) { setRuntimePropertiesFound(true); Context.setRuntimeProperties(props); String appDataRuntimeProperty = props .getProperty(OpenmrsConstants.APPLICATION_DATA_DIRECTORY_RUNTIME_PROPERTY, null); if (StringUtils.hasLength(appDataRuntimeProperty)) { OpenmrsUtil.setApplicationDataDirectory(null); } log.info("Using runtime properties file: " + OpenmrsUtil.getRuntimePropertiesFilePathName(WebConstants.WEBAPP_NAME)); } Thread.currentThread().setContextClassLoader(OpenmrsClassLoader.getInstance()); <START> if (!setupNeeded()) { <END> copyCustomizationIntoWebapp(servletContext, props); XmlWebApplicationContext context = (XmlWebApplicationContext) createWebApplicationContext(servletContext); configureAndRefreshWebApplicationContext(context, servletContext); servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, context); WebDaemon.startOpenmrs(event.getServletContext()); } else { setupNeeded = true; } } catch (Exception e) { setErrorAtStartup(e); log.error(MarkerFactory.getMarker("FATAL"), "Failed to obtain JDBC connection", e); } }</code><technical_language>setting log level</technical_language>

Target:
public void contextInitialized(ServletContextEvent event) { log.debug("Starting the OpenMRS webapp"); try { OpenmrsUtil.validateJavaVersion(); ServletContext servletContext = event.getServletContext(); loadConstants(servletContext); clearDWRFile(servletContext); setApplicationDataDirectory(servletContext); Properties props = getRuntimeProperties(); if (props != null) { setRuntimePropertiesFound(true); Context.setRuntimeProperties(props); String appDataRuntimeProperty = props .getProperty(OpenmrsConstants.APPLICATION_DATA_DIRECTORY_RUNTIME_PROPERTY, null); if (StringUtils.hasLength(appDataRuntimeProperty)) { OpenmrsUtil.setApplicationDataDirectory(null); } Logger contextLog = Logger.getLogger(getClass()); contextLog.setLevel(Level.INFO); contextLog.info("Using runtime properties file: " + OpenmrsUtil.getRuntimePropertiesFilePathName(WebConstants.WEBAPP_NAME)); } Thread.currentThread().setContextClassLoader(OpenmrsClassLoader.getInstance()); if (!setupNeeded()) { copyCustomizationIntoWebapp(servletContext, props); XmlWebApplicationContext context = (XmlWebApplicationContext) createWebApplicationContext(servletContext); configureAndRefreshWebApplicationContext(context, servletContext); servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, context); WebDaemon.startOpenmrs(event.getServletContext()); } else { setupNeeded = true; } } catch (Exception e) { setErrorAtStartup(e); log.error(MarkerFactory.getMarker("FATAL"), "Failed to obtain JDBC connection", e); } }
Source:
<code>private void doBootstrapParentChannel(Callback<Channel> callback) { _parentChannelLifecycle.create(new TimeoutCallback<>(_scheduler, _creationTimeout, TimeUnit.MILLISECONDS, new Callback<Channel>() { @Override public void onError(Throwable error) { callback.onError(error); <START> if (error instanceof ObjectCreationTimeoutException) <END> { LOG.error(error.getMessage(), error); } } @Override public void onSuccess(Channel channel) { channel.attr(NettyChannelAttributes.INITIALIZATION_FUTURE).get().addListener(alpnFuture -> { if (alpnFuture.isSuccess()) { callback.onSuccess(channel); } else { callback.onError(alpnFuture.cause()); } }); } }, new ObjectCreationTimeoutException( "Exceeded creation timeout of " + _creationTimeout + "ms: for HTTP/2 parent channel, remote=" + _address))); }</code><technical_language>Log error callback.onError</technical_language>

Target:
private void doBootstrapParentChannel(Callback<Channel> callback) { _parentChannelLifecycle.create(new TimeoutCallback<>(_scheduler, _channelCreationTimeoutMs, TimeUnit.MILLISECONDS, new Callback<Channel>() { @Override public void onError(Throwable error) { callback.onError(error); if (error instanceof ObjectCreationTimeoutException) { LOG.error(error.getMessage(), error); } } @Override public void onSuccess(Channel channel) { channel.attr(NettyChannelAttributes.INITIALIZATION_FUTURE).get().addListener(alpnFuture -> { if (alpnFuture.isSuccess()) { callback.onSuccess(channel); } else { callback.onError(alpnFuture.cause()); } }); } }, new ObjectCreationTimeoutException( "Exceeded creation timeout of " + _channelCreationTimeoutMs + "ms: for HTTP/2 parent channel, remote=" + _address))); }
Source:
<code>public void changeDeviceModel(@Identification final String organisationIdentification, final String manufacturer, final String modelCode, final String description) throws FunctionalException { final Organisation organisation = this.domainHelperService.findOrganisation(organisationIdentification); this.domainHelperService.isAllowed(organisation, PlatformFunction.CHANGE_MANUFACTURER); <START> final Manufacturer dbManufacturer = this.manufacturerRepository.findByManufacturerId(manufacturer); <END> final DeviceModel changedDeviceModel = this.deviceModelRepository.findByManufacturerIdAndModelCode(dbManufacturer, modelCode); if (changedDeviceModel == null) { LOGGER.info("DeviceModel not found."); throw new FunctionalException(FunctionalExceptionType.UNKNOWN_DEVICEMODEL, ComponentType.WS_CORE, new ExistingEntityException(Manufacturer.class, modelCode)); } else { changedDeviceModel.setDescription(description); this.deviceModelRepository.save(changedDeviceModel); } }</code><technical_language>Consistency other methods: dataseManufacturer is in other methods, suggestion here: databaseManufacturer</technical_language>

Target:
public void changeDeviceModel(@Identification final String organisationIdentification, final String manufacturer, final String modelCode, final String description) throws FunctionalException { final Organisation organisation = this.domainHelperService.findOrganisation(organisationIdentification); this.domainHelperService.isAllowed(organisation, PlatformFunction.CHANGE_MANUFACTURER); final Manufacturer dataseManufacturer = this.manufacturerRepository.findByManufacturerId(manufacturer); final DeviceModel changedDeviceModel = this.deviceModelRepository.findByManufacturerIdAndModelCode(dataseManufacturer, modelCode); if (changedDeviceModel == null) { LOGGER.info("DeviceModel not found."); throw new FunctionalException(FunctionalExceptionType.UNKNOWN_DEVICEMODEL, ComponentType.WS_CORE, new ExistingEntityException(Manufacturer.class, modelCode)); } else { changedDeviceModel.setDescription(description); this.deviceModelRepository.save(changedDeviceModel); } }
Source:
<code>protected void startActions() { try { fServer = new LSPServer(); } catch (IOException e) { <START> e.printStackTrace(); <END> } }</code><technical_language>getInstance().logError() instead of printStackTrace</technical_language>

Target:
protected void startActions() { try { fServer = new LSPServer(); } catch (IOException e) { getInstance().logError(e.getMessage()); } }
Source:
<code>public void registerApollo(String apolloFlag) { <START> if (apolloFlag != null && apolloFlag.equalsIgnoreCase("true")) { <END> this.apolloEnabled = true; } else { this.apolloEnabled = false; } }</code><technical_language>rewrite: this.apolloEnabled = "true".equalsIgnoreCase(apolloFlag)</technical_language>

Target:
public void registerApollo(String apolloFlag) { this.apolloEnabled = "true".equalsIgnoreCase(apolloFlag); }
Source:
<code>protected boolean canDoAction() { boolean returnValue = super.canDoAction(); if (returnValue && (getParameters().getSysPrepUserName() == null ^ getParameters().getSysPrepPassword() == null)) { addCanDoActionMessage(VdcBllMessages.VM_CANNOT_RUN_ONCE_WITH_ILLEGAL_SYSPREP_PARAM); returnValue = false; } <START> if(getParameters().getDestinationVdsId() != null && !getCurrentUser().isAdmin()) { <END> addCanDoActionMessage(VdcBllMessages.VM_CANNOT_RUN_ONCE_NOT_ADMIN_FOR_DESTINATION_VDS_PARAM); returnValue = false; } return returnValue; }</code><technical_language>action fail if: & getParam().getDestHost == getVm().getDestHost()</technical_language>

Target:
protected boolean canDoAction() { boolean returnValue = super.canDoAction(); if (returnValue && (getParameters().getSysPrepUserName() == null ^ getParameters().getSysPrepPassword() == null)) { addCanDoActionMessage(VdcBllMessages.VM_CANNOT_RUN_ONCE_WITH_ILLEGAL_SYSPREP_PARAM); returnValue = false; } return returnValue; }
Source:
<code>private void fillCacheUntilEndOrFull(int rowIdx, PTFPartition p) throws HiveException { BoundaryCache cache = p.getBoundaryCache(); if (cache == null || p.size() <= 0) { return; } Map.Entry<Integer, Object> ceilingEntry = cache.getMaxEntry(); if (ceilingEntry != null) { rowIdx = ceilingEntry.getKey(); } Object rowVal = null; Object lastRowVal = null; while (rowIdx < p.size()) { rowVal = computeValue(p.getAt(rowIdx)); if (!isEqual(rowVal, lastRowVal)){ <START> if (!cache.putIfNotFull(rowIdx, rowVal)){ <END> break; } } lastRowVal = rowVal; ++rowIdx; } if (cache.putIfNotFull(rowIdx, null)) { cache.setComplete(true); } }</code><technical_language>detect cache is full continuing read? Do end reading lines for rowVal twice</technical_language>

Target:
private void fillCacheUntilEndOrFull(int rowIdx, PTFPartition p) throws HiveException { BoundaryCache cache = p.getBoundaryCache(); if (cache == null || p.size() <= 0) { return; } Object rowVal = null; Map.Entry<Integer, Object> ceilingEntry = cache.getMaxEntry(); if (ceilingEntry != null) { rowIdx = ceilingEntry.getKey(); rowVal = ceilingEntry.getValue(); ++rowIdx; } Object lastRowVal = rowVal; while (rowIdx < p.size() && !cache.isFull()) { rowVal = computeValue(p.getAt(rowIdx)); if (!isEqual(rowVal, lastRowVal)){ cache.put(rowIdx, rowVal); } lastRowVal = rowVal; ++rowIdx; } if (cache.putIfNotFull(rowIdx, null)) { cache.setComplete(true); } }
Source:
<code>public Set<Capability> getCapabilities(FileSystem fs, Path path) { if (logger.isDebugEnabled()) { logger.debug("Parquet file path: " + path.toUri().getPath()); } Reader orcReader = null; RecordReader recordReader = null; try { orcReader = OrcFile.createReader(fs, path); recordReader = orcReader.rows(null); } catch (Exception e) { <START> if (logger.isDebugEnabled()) { <END> logger.debug(path.toUri().getPath() + " is not a ORC file."); logger.debug("Error in opening ORC file: " + e.getLocalizedMessage()); } return EnumSet.noneOf(Capability.class); } finally { if (recordReader != null) { try { recordReader.close(); } catch (IOException e) { logger.error(e); } } } return EnumSet.of(Capability.READ, Capability.SCHEMA); }</code><technical_language>useful log statements in production env.</technical_language>

Target:
public Set<Capability> getCapabilities(FileSystem fs, Path path) { if (logger.isDebugEnabled()) { logger.debug("orc file path: " + path.toUri().getPath()); } Reader orcReader = null; RecordReader recordReader = null; try { orcReader = OrcFile.createReader(fs, path); recordReader = orcReader.rows(null); } catch (Exception e) { if (logger.isDebugEnabled()) { logger.debug(path.toUri().getPath() + " is not a ORC file."); logger.debug("Error in opening ORC file: " + e.getLocalizedMessage()); } return EnumSet.noneOf(Capability.class); } finally { if (recordReader != null) { try { recordReader.close(); } catch (IOException e) { logger.error(e); } } } return EnumSet.of(Capability.READ, Capability.SCHEMA); }
Source:
<code>public CompilationResponse compileSync(InternalNIOCompilationRequest req) { CompilationResponse res = compiler.compileSync(req); if (res.isSuccessful()) { return new DefaultCompilationResponse(Boolean.TRUE, <START> LogUtils.getOutput(req.getInfo().getPrjPath().toAbsolutePath().toString(), <END> req.getKieCliRequest().getLogFile(), req.getKieCliRequest().getRequestUUID())); } else { return new DefaultCompilationResponse(Boolean.FALSE, LogUtils.getOutput(req.getInfo().getPrjPath().toAbsolutePath().toString(), req.getKieCliRequest().getLogFile(), req.getKieCliRequest().getRequestUUID())); } }</code><technical_language>This expression is repeated in if else branches.Why extract if reuse in branches</technical_language>

Target:
public CompilationResponse compileSync(InternalNIOCompilationRequest req) { CompilationResponse res = compiler.compileSync(req); if (res.isSuccessful()) { return getDefaultCompilationResponse(Boolean.TRUE, req); } else { return getDefaultCompilationResponse(Boolean.FALSE, req); } }
Source:
<code>static float getCompensatedMinSpaceLeft(SpaceWrapper wrapper) { <START> return 1.1f * ((wrapper.getLast().getX() - wrapper.getFirst().getX()) / (wrapper.getLast() <END> .getPreviousNodesCount() - wrapper.getFirst().getPreviousNodesCount()) ); }</code><technical_language>magic number</technical_language>

Target:
static float getCompensatedMinSpaceLeft(SpaceWrapper wrapper) { return SPACE_COMPENSATION * ((wrapper.getLast().getX() - wrapper.getFirst().getX()) / (wrapper.getLast() .getPreviousNodesCount() - wrapper.getFirst().getPreviousNodesCount())); }
Source:
<code>private static LauncherStatus run(final String[] args) throws IOException, InjectionException { final Configuration commandLineConf = parseCommandLine(args); final Injector commandLineInjector = Tang.Factory.getTang().newInjector(commandLineConf); final boolean onLocal = commandLineInjector.getNamedInstance(Parameters.OnLocal.class); final int splits = commandLineInjector.getNamedInstance(Parameters.Splits.class); final Configuration runTimeConf = onLocal ? getLocalRuntimeConfiguration(splits) : getYarnRuntimeConfiguration(); final Configuration driverConf = getDriverConfiguration(commandLineConf); final int timeout = commandLineInjector.getNamedInstance(Parameters.Timeout.class); final LauncherStatus status = DriverLauncher.getLauncher(runTimeConf).run(driverConf, timeout); <START> return status; <END> }</code><technical_language>nit: redundant local variable. it, IntelliJ complains :-)</technical_language>

Target:
private static LauncherStatus run(final String[] args) throws IOException, InjectionException { final Configuration commandLineConf = parseCommandLine(args); final Injector commandLineInjector = Tang.Factory.getTang().newInjector(commandLineConf); final boolean onLocal = commandLineInjector.getNamedInstance(Parameters.OnLocal.class); final int splits = commandLineInjector.getNamedInstance(Parameters.Splits.class); final Configuration runTimeConf = onLocal ? getLocalRuntimeConfiguration(splits) : getYarnRuntimeConfiguration(); final Configuration driverConf = getDriverConfiguration(commandLineConf); final int timeout = commandLineInjector.getNamedInstance(Parameters.Timeout.class); return DriverLauncher.getLauncher(runTimeConf).run(driverConf, timeout); }
Source:
<code>private ActionListener createWriteDataActionListener(final Class<? extends Analyzer<?>> analyzerClass, final String filenameExtension) { return new ActionListener() { @Override public void actionPerformed(ActionEvent e) { final AnalysisJob copyAnalysisJob = _analysisJobBuilder.toAnalysisJob(false); final AnalysisJobBuilder copyAnalysisJobBuilder = new AnalysisJobBuilder( _analysisJobBuilder.getConfiguration(), copyAnalysisJob); final AnalyzerComponentBuilder<? extends Analyzer<?>> analyzer = copyAnalysisJobBuilder .addAnalyzer(analyzerClass); analyzer.addInputColumns(copyAnalysisJobBuilder.getAvailableInputColumns(Object.class)); final String formattedDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); final FileResource resource = createResource("datacleaner-" + formattedDate + "-output", filenameExtension); <START> if (filenameExtension.equals(".xls") || filenameExtension.equals(".xlsx")) { <END> final File file = resource.getFile(); analyzer.setConfiguredProperty("File", file); } else { analyzer.setConfiguredProperty("File", resource); } final ConfiguredPropertyDescriptor sheetNameProperty = analyzer.getDescriptor().getConfiguredProperty( "Sheet name"); if (sheetNameProperty != null) { analyzer.setConfiguredProperty(sheetNameProperty, "data"); } final RunAnalysisActionListener runAnalysis = new RunAnalysisActionListener(_dcModule, copyAnalysisJobBuilder); ExecuteJobWithoutAnalyzersDialog.this.close(); runAnalysis.run(); } }; }</code><technical_language>This is unclear "if" is here. I imagine CreateExcelAnalyzer is a java.io.File? If construct if fact clear: if (analyzer.getComponentClass() == CreateExcelAnalyzer.class) { ..</technical_language>

Target:
private ActionListener createWriteDataActionListener(final Class<? extends Analyzer<?>> analyzerClass, final String filenameExtension) { return new ActionListener() { @Override public void actionPerformed(ActionEvent e) { final AnalysisJob copyAnalysisJob = _analysisJobBuilder.toAnalysisJob(false); final AnalysisJobBuilder copyAnalysisJobBuilder = new AnalysisJobBuilder( _analysisJobBuilder.getConfiguration(), copyAnalysisJob); final AnalyzerComponentBuilder<? extends Analyzer<?>> analyzer = copyAnalysisJobBuilder .addAnalyzer(analyzerClass); analyzer.addInputColumns(copyAnalysisJobBuilder.getAvailableInputColumns(Object.class)); final String formattedDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); final FileResource resource = createResource("datacleaner-" + formattedDate + "-output", filenameExtension); if (analyzerClass == CreateExcelSpreadsheetAnalyzer.class) { final File file = resource.getFile(); analyzer.setConfiguredProperty("File", file); } else { analyzer.setConfiguredProperty("File", resource); } final ConfiguredPropertyDescriptor sheetNameProperty = analyzer.getDescriptor().getConfiguredProperty( "Sheet name"); if (sheetNameProperty != null) { analyzer.setConfiguredProperty(sheetNameProperty, "data"); } final RunAnalysisActionListener runAnalysis = new RunAnalysisActionListener(_dcModule, copyAnalysisJobBuilder); ExecuteJobWithoutAnalyzersDialog.this.close(); runAnalysis.run(); } }; }
Source:
<code>AuthenticationResult getAccessToken() throws AuthenticationException { if (mTokenCacheAccessor == null) { return null; } <START> TokenCacheItem tokenCacheItem = mTokenCacheAccessor.getRegularTokenCacheItemWithAT(mAuthRequest.getResource(), <END> mAuthRequest.getClientId(), getUser()); if (tokenCacheItem == null && lookUpCachedTokenWithNoUserForADFS()) { tokenCacheItem = mTokenCacheAccessor.getRegularTokenCacheItemWithAT(mAuthRequest.getResource(), mAuthRequest.getClientId(), null); if (tokenCacheItem == null) { return tryMRRT(); } } if (isValidCache(tokenCacheItem)) { if (isUserMisMatch(tokenCacheItem)) { Logger.v(TAG, "User in retrieved token cache item does not match the user provided in the request."); throw new AuthenticationException(ADALError.AUTH_FAILED_USER_MISMATCH); } Logger.v(TAG, "Valid token cache item, return AT back."); return AuthenticationResult.createResult(tokenCacheItem); } return tryRT(); }</code><technical_language>final #WontFix</technical_language>

Target:
AuthenticationResult getAccessToken() throws AuthenticationException { if (mTokenCacheAccessor == null) { return null; } final TokenCacheItem accessTokenItem = mTokenCacheAccessor.getATFromCache(mAuthRequest.getResource(), mAuthRequest.getClientId(), mAuthRequest.getUserFromRequest()); if (accessTokenItem == null) { Logger.v(TAG, "No valid access token exists, try with refresh token."); return tryRT(); } Logger.v(TAG, "Return AT from cache."); return AuthenticationResult.createResult(accessTokenItem); }
Source:
<code>private PercentType sendIncrease(int bulb, int rgbwSteps, String bridgeId) { logger.debug("milight: sendIncrease"); String messageBytes = null; switch (bulb) { case 0: case 1: case 2: case 3: case 4: messageBytes = "3C:00:55"; break; case 5: messageBytes = "23:00:55"; break; } int currentPercent = getCurrentState(bulb, bridgeId, BindingType.brightness).intValue(); int newPercent = currentPercent + 10; if (newPercent > 100) { newPercent = 100; } PercentType newValue = new PercentType(newPercent); if (bulb > 5) { int increasePercent = newPercent * (rgbwSteps - 2) / 100 + 2; messageBytes = "4E:" + Integer.toHexString(increasePercent) + ":55"; logger.debug("Bulb '{}' set to '{}' dimming Steps", bulb, rgbwSteps); } else if (bulb < 5) { newPercent = (int) Math.round( (Math.round(getCurrentState(bulb, bridgeId, BindingType.brightness).intValue() / 9.090909090909091) + 1) * 9.090909090909091); newValue = new PercentType(newPercent); logger.debug("milight: Bulb '{}' getting increased to '{}'", bulb, newPercent); } try { sendOn(bulb, bridgeId); Thread.sleep(100); <START> } catch (InterruptedException e) { <END> } sendMessage(messageBytes, bridgeId); setCurrentState(bulb, bridgeId, newValue, BindingType.brightness); return newValue; }</code><technical_language>Is correct catch "swallow" InterruptedException (and well)</technical_language>

Target:
private PercentType sendIncrease(int bulb, int rgbwSteps, String bridgeId) { logger.debug("milight: sendIncrease"); String messageBytes = null; switch (bulb) { case 0: case 1: case 2: case 3: case 4: messageBytes = "3C:00:55"; break; case 5: messageBytes = "23:00:55"; break; } int currentPercent = getCurrentState(bulb, bridgeId, BindingType.brightness).intValue(); if (currentPercent == 0) { try { sendOn(bulb, bridgeId); Thread.sleep(100); } catch (InterruptedException e) { } } int newPercent = currentPercent + 10; if (newPercent > 100) { newPercent = 100; } PercentType newValue = new PercentType(newPercent); if (bulb > 5) { int increasePercent = newPercent * (rgbwSteps - 2) / 100 + 2; messageBytes = "4E:" + Integer.toHexString(increasePercent) + ":55"; logger.debug("Bulb '{}' set to '{}' dimming Steps", bulb, rgbwSteps); } else if (bulb < 5) { newPercent = (int) Math.round( (Math.round(getCurrentState(bulb, bridgeId, BindingType.brightness).intValue() / 9.090909090909091) + 1) * 9.090909090909091); newValue = new PercentType(newPercent); logger.debug("milight: Bulb '{}' getting increased to '{}'", bulb, newPercent); } sendMessage(messageBytes, bridgeId); setCurrentState(bulb, bridgeId, newValue, BindingType.brightness); return newValue; }
Source:
<code>protected void doOKAction() { if (getOKAction().isEnabled()) { GoogleLogin login = GoogleLogin.getInstance(); Module selectedModule = myModuleComboBox.getSelectedModule(); String sdk = ""; String war = ""; AppEngineGradleFacet facet = AppEngineGradleFacet.getAppEngineFacetByModule(selectedModule); <START> if (facet != null) { <END> AppEngineConfigurationProperties model = facet.getConfiguration().getState(); sdk = model.APPENGINE_SDKROOT; war = model.WAR_DIR; } String client_secret = login.fetchOAuth2ClientSecret(); String client_id = login.fetchOAuth2ClientId(); String refresh_token = login.fetchOAuth2RefreshToken(); if (StringUtils.isEmptyOrNull(client_secret) || StringUtils.isEmptyOrNull(client_id) || StringUtils.isEmptyOrNull(refresh_token)) { LOG.error("StartUploading while logged in, but it doesn't have full credentials."); Messages.showErrorDialog(this.getPeer().getOwner(), "Login credentials are not valid.", "Login"); return; } if (Strings.isNullOrEmpty(sdk) || Strings.isNullOrEmpty(war) || Strings.isNullOrEmpty(myProjectId.getText()) || selectedModule == null) { LOG.error("StartUploading was called with bad module/sdk/war"); return; } close(OK_EXIT_CODE); new AppEngineUpdater(myProject, selectedModule, sdk, war, myProjectId.getText(), myVersion.getText(), client_secret, client_id, refresh_token).startUploading(); } }</code><technical_language>I guess facet null. is right</technical_language>

Target:
protected void doOKAction() { if (getOKAction().isEnabled()) { GoogleLogin login = GoogleLogin.getInstance(); Module selectedModule = myModuleComboBox.getSelectedModule(); String sdk = ""; String war = ""; AppEngineGradleFacet facet = AppEngineGradleFacet.getAppEngineFacetByModule(selectedModule); if (facet != null) { AppEngineConfigurationProperties model = facet.getConfiguration().getState(); sdk = model.APPENGINE_SDKROOT; war = model.WAR_DIR; } String client_secret = login.fetchOAuth2ClientSecret(); String client_id = login.fetchOAuth2ClientId(); String refresh_token = login.fetchOAuth2RefreshToken(); if (StringUtils.isEmptyOrNull(client_secret) || StringUtils.isEmptyOrNull(client_id) || StringUtils.isEmptyOrNull(refresh_token)) { LOG.error("StartUploading while logged in, but it doesn't have full credentials."); Messages.showErrorDialog(this.getPeer().getOwner(), "Login credentials are not valid.", "Login"); return; } if (Strings.isNullOrEmpty(sdk) || Strings.isNullOrEmpty(war) || Strings.isNullOrEmpty(myProjectId.getText()) || selectedModule == null) { Messages.showErrorDialog(this.getPeer().getOwner(), "Could not deploy due to missing information (sdk/war/projectid).", "Deploy"); LOG.error("StartUploading was called with bad module/sdk/war"); return; } close(OK_EXIT_CODE); new AppEngineUpdater(myProject, selectedModule, sdk, war, myProjectId.getText(), myVersion.getText(), client_secret, client_id, refresh_token).startUploading(); } }
Source:
<code>protected Bitmap doInBackground(OCFile... params) { file = params[0]; final String imageKey = String.valueOf(file.getRemoteId().hashCode()); Log_OC.d("Thumbnail", imageKey); Bitmap thumbnail = getBitmapFromDiskCache(imageKey); if (thumbnail == null) { Resources r = mContext.getResources(); int px = (int) Math.round(TypedValue.applyDimension( TypedValue.COMPLEX_UNIT_DIP, 150, r.getDisplayMetrics() )); if (file.isDown()){ Bitmap bitmap = BitmapFactory.decodeFile(file.getStoragePath()); if (bitmap != null) { thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px); addBitmapToCache(imageKey, thumbnail); } } else { try { int status = -1; <START> String uri = client.getBaseUri() + "/index.php/apps/files/api/v1/thumbnail/100/100/"+URLEncoder.encode(file.getRemotePath(), "UTF-8").replaceAll("%2F", "/"); <END> Log_OC.d("Thumbnail", "URI: " + uri); GetMethod get = new GetMethod(uri); status = client.executeMethod(get); if(status == HttpStatus.SC_OK) { byte[] bytes = get.getResponseBody(); Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length); thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px); if (thumbnail != null){ addBitmapToCache(imageKey, thumbnail); } } } catch(Exception e){ e.printStackTrace(); } } } return thumbnail; }</code><technical_language>in refactoring a bit this add a "Thumbnail" resource in owncloud-library, merge this first. while, some level details: - Uri.encode(file.getRemotePath(), "/") job URLEncoder.encode(file.getRemotePath(), "UTF-8").replaceAll("%2F", "/"), shorter. - Instead of hardcoding 100 x 100, define constants THUMB_WIDTH, THUMB_HEIGHT ; better, try request lowest resolution appropiate get 32dp thumbnails, depending screen density</technical_language>

Target:
protected Bitmap doInBackground(OCFile... params) { file = params[0]; final String imageKey = String.valueOf(file.getRemoteId().hashCode()); Log_OC.d("Thumbnail", imageKey); Bitmap thumbnail = getBitmapFromDiskCache(imageKey); if (thumbnail == null) { Resources r = mContext.getResources(); int px = Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 32, r.getDisplayMetrics())); if (file.isDown()) { Bitmap bitmap = BitmapFactory.decodeFile(file.getStoragePath()); if (bitmap != null) { thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px); addBitmapToCache(imageKey, thumbnail); } } else { try { int status = -1; String uri = client.getBaseUri() + "/index.php/apps/files/api/v1/thumbnail/" + px + "/" + px + "/" + Uri.encode(file.getRemotePath(), "/"); Log_OC.d("Thumbnail", "URI: " + uri); GetMethod get = new GetMethod(uri); status = client.executeMethod(get); if (status == HttpStatus.SC_OK) { byte[] bytes = get.getResponseBody(); Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length); thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px); if (thumbnail != null) { addBitmapToCache(imageKey, thumbnail); } } } catch (Exception e) { e.printStackTrace(); } } } return thumbnail; }
Source:
<code>public Set<String> getUsersAsSet(AbstractBuild<?,?> build) { <START> if (users == null || users.equals("") || build == null) <END> return Collections.emptySet(); Set<String> set = new HashSet<String>(); for (String user : users.split(",")) { user = user.trim(); LOGGER.log(Level.FINER, "ManualCondition.getUsersAsSet(): user={0}", user); if (user.startsWith("$")){ user = user.substring(1); if (user.startsWith("{") && user.endsWith("}")) user = user.substring(1, user.length() -1); LOGGER.log(Level.INFO, "ManualCondition.getUsersAsSet(): build.getBuildVariableResolver().resolve(user=${0})={1}", new Object {user, build.getBuildVariableResolver().resolve(user)}); user = build.getBuildVariableResolver().resolve(user); } if (user != null && user.trim().length() > 0) set.add(user); } LOGGER.log(Level.INFO, "ManualCondition.getUsersAsSet(): return set={0}", set); return set; }</code><technical_language>This condition is correct I see. build is null, result empty. E.g. getUsersAsSet() returning empty list change</technical_language>

Target:
public Set<String> getUsersAsSet(AbstractBuild<?,?> build) { if (users == null || users.equals("")) return Collections.emptySet(); Set<String> set = new HashSet<String>(); for (String user : users.split(",")) { user = user.trim(); LOGGER.log(Level.FINER, "ManualCondition.getUsersAsSet(): user={0}", user); if (user.startsWith("$")){ user = user.substring(1); if (user.startsWith("{") && user.endsWith("}")) user = user.substring(1, user.length() -1); LOGGER.log(Level.INFO, "ManualCondition.getUsersAsSet(): build.getBuildVariableResolver().resolve(user=${0})={1}", new Object {user, build.getBuildVariableResolver().resolve(user)}); user = build.getBuildVariableResolver().resolve(user); } if (user != null && user.trim().length() > 0) set.add(user); } LOGGER.log(Level.INFO, "ManualCondition.getUsersAsSet(): return set={0}", set); return set; }
Source:
<code>public void onServiceConnected(ComponentName componentName, IBinder iBinder) { super.onServiceConnected(componentName, iBinder); getService().registeronServiceStateChangeListener(this); getService().registeronServiceStateChangeListener(mFolderListFragment); <START> getService().registeronServiceStateChangeListener(mDeviceListFragment); <END> }</code><technical_language>registerOn</technical_language>

Target:
public void onServiceConnected(ComponentName componentName, IBinder iBinder) { super.onServiceConnected(componentName, iBinder); getService().registerOnServiceStateChangeListener(this); getService().registerOnServiceStateChangeListener(mFolderListFragment); getService().registerOnServiceStateChangeListener(mDeviceListFragment); }
Source:
<code>public ConsumerGroupMetadata(String groupId, int generationId, String memberId, <START> Optional<String> groupInstanceId) { <END> this.groupId = groupId; this.generationId = generationId; this.memberId = memberId; this.groupInstanceId = groupInstanceId; }</code><technical_language>nice overload sets groupId</technical_language>

Target:
public ConsumerGroupMetadata(String groupId, int generationId, String memberId, Optional<String> groupInstanceId) { this.groupId = Objects.requireNonNull(groupId, "group.id can't be null"); this.generationId = generationId; this.memberId = Objects.requireNonNull(memberId, "member.id can't be null"); this.groupInstanceId = Objects.requireNonNull(groupInstanceId, "group.instance.id can't be null"); }
Source:
<code>private void validate() { <START> if (this.getCloudID() == null) { <END> throw new HelixException( "This Cloud Configuration is Invalid. The CloudID is missing from the config."); } if (this.getCloudProvider() == null) { throw new HelixException( "This Cloud Configuration is Invalid. The Cloud Provider is missing from the config."); } else if (this.getCloudProvider().equals(CloudProvider.CUSTOMIZED.name())) { if (this.getCloudInfoProcessorName() == null || this.getCloudInfoSources() == null || this.getCloudInfoSources().size() == 0) { throw new HelixException( "This Cloud Configuration is Invalid. CUSTOMIZED provider has been chosen without defining CloudInfoProcessorName or CloudInfoSources"); } } }</code><technical_language>Is "this" necessary</technical_language>

Target:
private void validate() { if (this.getCloudProvider() == null) { throw new HelixException( "This Cloud Configuration is Invalid. The Cloud Provider is missing from the config."); } else if (this.getCloudProvider().equals(CloudProvider.CUSTOMIZED.name())) { if (this.getCloudInfoProcessorName() == null || this.getCloudInfoSources() == null || this.getCloudInfoSources().size() == 0) { throw new HelixException( "This Cloud Configuration is Invalid. CUSTOMIZED provider has been chosen without defining CloudInfoProcessorName or CloudInfoSources"); } } }
Source:
<code>public void Start() { if (!havePermission) { final SoundRecorder me = this; form.runOnUiThread(new Runnable() { @Override public void run() { <START> form.askPermission(new BulkPermissionRequest(me, "AudioRecord", <END> Manifest.permission.RECORD_AUDIO, Manifest.permission.WRITE_EXTERNAL_STORAGE) { @Override public void onGranted() { me.havePermission = true; me.Start(); } }); } }); return; } if (controller != null) { Log.i(TAG, "Start() called, but already recording to " + controller.file); return; } Log.i(TAG, "Start() called"); if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { form.dispatchErrorOccurredEvent( this, "Start", ErrorMessages.ERROR_MEDIA_EXTERNAL_STORAGE_NOT_AVAILABLE); return; } try { controller = new RecordingController(savedRecording); } catch (PermissionException e) { form.dispatchPermissionDeniedEvent(this, "Start", e); return; } catch (Throwable t) { form.dispatchErrorOccurredEvent( this, "Start", ErrorMessages.ERROR_SOUND_RECORDER_CANNOT_CREATE, t.getMessage()); return; } try { controller.start(); } catch (Throwable t) { controller = null; form.dispatchErrorOccurredEvent( this, "Start", ErrorMessages.ERROR_SOUND_RECORDER_CANNOT_CREATE, t.getMessage()); return; } StartedRecording(); }</code><technical_language>argument is name of calling function, "Start", "AudioRecord"</technical_language>

Target:
public void Start() { if (!havePermission) { final SoundRecorder me = this; form.runOnUiThread(new Runnable() { @Override public void run() { form.askPermission(new BulkPermissionRequest(me, "Start", Manifest.permission.RECORD_AUDIO, Manifest.permission.WRITE_EXTERNAL_STORAGE) { @Override public void onGranted() { me.havePermission = true; me.Start(); } }); } }); return; } if (controller != null) { Log.i(TAG, "Start() called, but already recording to " + controller.file); return; } Log.i(TAG, "Start() called"); if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { form.dispatchErrorOccurredEvent( this, "Start", ErrorMessages.ERROR_MEDIA_EXTERNAL_STORAGE_NOT_AVAILABLE); return; } try { controller = new RecordingController(savedRecording); } catch (PermissionException e) { form.dispatchPermissionDeniedEvent(this, "Start", e); return; } catch (Throwable t) { form.dispatchErrorOccurredEvent( this, "Start", ErrorMessages.ERROR_SOUND_RECORDER_CANNOT_CREATE, t.getMessage()); return; } try { controller.start(); } catch (Throwable t) { controller = null; form.dispatchErrorOccurredEvent( this, "Start", ErrorMessages.ERROR_SOUND_RECORDER_CANNOT_CREATE, t.getMessage()); return; } StartedRecording(); }
Source:
<code><START> protected FileStrategyConfiguration ( <END> final Types type, final Integer syncFileAfterRecords, final Duration syncFileAfterDuration, final String workingDir, final String publishDir) { this.type = type; this.syncDileAfterRecords = syncFileAfterRecords; this.syncFileAfterDuration = syncFileAfterDuration; this.workingDir = workingDir; this.publishDir = publishDir; }</code><technical_language>This constructor private, I think</technical_language>

Target:
private FileStrategyConfiguration ( final Types type, final Integer syncFileAfterRecords, final Duration syncFileAfterDuration, final String workingDir, final String publishDir) { this.type = type; this.syncFileAfterRecords = syncFileAfterRecords; this.syncFileAfterDuration = syncFileAfterDuration; this.workingDir = workingDir; this.publishDir = publishDir; }
Source:
<code>public static void main(String[] args) throws Exception { Karyon.builder() <START> .using(ArchaiusKaryonSuite.builder() <END> .withConfigName("helloworld") .withApplicationOverrides(MapConfig.builder() .put("@appId", "Hello World!") .build() ) .build() ) .addProfile("local") .addModules( new ArchaiusLog4J2ConfigurationModule(), new ProvisionDebugModule(), new JettyModule(), new AdminServerModule(), new AdminUIServerModule(), new ArchaiusModule(), new ShutdownServerModule(), new JerseyServletModule() { @Override protected void configureServlets() { serve("/*").with(GuiceContainer.class); bind(GuiceContainer.class).asEagerSingleton(); bind(ArchaiusEndpoint.class).asEagerSingleton(); bind(HelloWorldApp.class).asEagerSingleton(); bind(HealthIndicator.class).to(FooServiceHealthIndicator.class); bind(LongDelayService.class).asEagerSingleton(); } @Override public String toString() { return "JerseyServletModule"; } }) .disable(GovernatorFeatures.SHUTDOWN_ON_ERROR) .startAndAwaitTermination(); }</code><technical_language>instead of "using", .withInitialConfig(CompositeConfig.builder().withConfigName("helloworld").withApplicationOverrides(...)) I fully thought add this CompositeConfig layered hierarchy yet. ultimately, I relationship Karyon Configuration is composition instead of inheritance</technical_language>

Target:
public static void main(String[] args) throws Exception { Karyon .from(new ArchaiusKaryonModule() .withConfigName("helloworld") .withApplicationOverrides(MapConfig.builder() .put("@appId", "Hello World!") .build() ) ) .addProfile("local") .addModules( new ArchaiusLog4J2ConfigurationModule(), new ProvisionDebugModule(), new JettyModule(), new AdminServerModule(), new AdminUIServerModule(), new ShutdownServerModule(), new JerseyServletModule() { @Override protected void configureServlets() { serve("/REST/*").with(GuiceContainer.class); bind(GuiceContainer.class).asEagerSingleton(); bind(ArchaiusEndpoint.class).asEagerSingleton(); bind(HelloWorldApp.class).asEagerSingleton(); bind(HealthIndicator.class).to(FooServiceHealthIndicator.class); bind(LongDelayService.class).asEagerSingleton(); } @Override public String toString() { return "JerseyServletModule"; } } ) .disableFeature(KaryonFeatures.SHUTDOWN_ON_ERROR) .start() .awaitTermination(); }
Source:
<code>public void the_user_clicks_on_the_button(String text) throws Throwable { List<WebElement> buttons = getDriver().findElements(By.tagName("button")); WebDriverWait webDriverWait = new WebDriverWait(getDriver(), TIMEOUT); WebElement elem = webDriverWait.until(elementToBeClickable( buttons.stream().filter(button -> button.getText().equals(text)).findFirst().get())); elem.click(); <START> waitForAjax(); <END> }</code><technical_language>I Pagefactory AjaxElementLocatorFactory for this</technical_language>

Target:
public void the_user_clicks_on_the_button(String text) { List<WebElement> buttons = getDriver().findElements(By.tagName("button")); WebElement element = DriverProvider.wait(getDriver()).until(elementToBeClickable( buttons.stream().filter(button -> button.getText().equals(text)).findFirst().get())); element.click(); waitForAjax(); }
Source:
<code>public static void main(final String[] args) { AsyncDolphinLauncher.launch("MLRREEF", args, AsyncDolphinConfiguration.newBuilder() .setWorkerClass(MLRWorker.class) .setUpdaterClass(MLRUpdater.class) .setPreValueCodecClass(DenseVectorCodec.class) .setValueCodecClass(DenseVectorCodec.class) .setServerSerializerClass(DenseVectorSerializer.class) .setWorkerSerializerClass(MLRDataSerializer.class) <START> .addParameterClass(MLRParameters.NumClasses.class) <END> .addParameterClass(MLRParameters.NumFeatures.class) .addParameterClass(MLRParameters.InitialStepSize.class) .addParameterClass(MLRParameters.Lambda.class) .addParameterClass(MLRParameters.WorkerLogPeriod.class) .addParameterClass(MLRParameters.NumFeaturesPerPartition.class) .addParameterClass(MLRParameters.ModelGaussian.class) .addParameterClass(MLRParameters.DecayPeriod.class) .addParameterClass(MLRParameters.DecayRate.class) .addParameterClass(MLRParameters.TrainErrorDatasetSize.class) .addParameterClass(MLRParameters.NumBatchPerLossLog.class) .build()); }</code><technical_language>NMFREEF, import MLRParameters statically adding import static edu.snu.cay.dolphin.async.mlapps.nmf.NMFParameters.*;</technical_language>

Target:
public static void main(final String[] args) { AsyncDolphinLauncher.launch("MLRREEF", args, AsyncDolphinConfiguration.newBuilder() .setWorkerClass(MLRWorker.class) .setUpdaterClass(MLRUpdater.class) .setPreValueCodecClass(DenseVectorCodec.class) .setValueCodecClass(DenseVectorCodec.class) .setServerSerializerClass(DenseVectorSerializer.class) .setWorkerSerializerClass(MLRDataSerializer.class) .addParameterClass(NumClasses.class) .addParameterClass(NumFeatures.class) .addParameterClass(InitialStepSize.class) .addParameterClass(Lambda.class) .addParameterClass(NumFeaturesPerPartition.class) .addParameterClass(ModelGaussian.class) .addParameterClass(DecayPeriod.class) .addParameterClass(DecayRate.class) .addParameterClass(TrainErrorDatasetSize.class) .build()); }
Source:
<code>public static void init() { String host = PropertiesManager.getValue(PropertiesManager.KEY_ELASTIC_HOST, "localhost"); Integer port = Convert.toInteger(PropertiesManager.getValue(PropertiesManager.KEY_ELASTIC_PORT, "9300")); try { LOG.log(Level.INFO, MessageFormat.format("Connecting to ElasticSearch at {0}", host + ":" + port)); client = new PreBuiltTransportClient(Settings.EMPTY).addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(host), port)); } catch (UnknownHostException ex) { throw new OpenStorefrontRuntimeException("Unable to find elastic search server host", "Check configuration; Check Host and Port; property: " + PropertiesManager.KEY_ELASTIC_HOST + " current value: " + host); } <START> updateFieldData(); <END> }</code><technical_language>Do need do this time start manager is a time thing. indexing a new record index correctly? this break next index update</technical_language>

Target:
public static void init() { String host = PropertiesManager.getValue(PropertiesManager.KEY_ELASTIC_HOST, "localhost"); Integer port = Convert.toInteger(PropertiesManager.getValue(PropertiesManager.KEY_ELASTIC_PORT, "9200")); lowLevelRestClient = RestClient.builder(new HttpHost(host, port, "http")).build(); client = new RestHighLevelClient(lowLevelRestClient); LOG.log(Level.INFO, MessageFormat.format("Connecting to ElasticSearch at {0}", host + ":" + port)); }