auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void createPendingSegmentsTable(final String tableName) { createTable( tableName, ImmutableList.of( String.format( "CREATE TABLE %1$s (\n" + " id VARCHAR(255) NOT NULL,\n" + " dataSource VARCHAR(255) NOT NULL,\n" + " created_date VARCHAR(255) NOT NULL,\n" + " start VARCHAR(255) NOT NULL,\n" + " %send%s VARCHAR(255) NOT NULL,\n" + " sequence_name VARCHAR(255) NOT NULL,\n" + " sequence_prev_id VARCHAR(255) NOT NULL,\n" + " sequence_name_prev_id_sha1 VARCHAR(255) NOT NULL,\n" <START> + " payload %2$s NOT NULL,\n" <END> + " PRIMARY KEY (id),\n" + " UNIQUE (sequence_name_prev_id_sha1)\n" + ")", tableName, getQuoteString(), getQuoteString(), getPayloadType() ) ) ); }</code><technical_language>%2$s is positional needs adjusted payload type moved position 2 position 4. Or, alternatively this same, move getQuoteString end %3$send%3$s %send%s</technical_language>

Target:
public void createPendingSegmentsTable(final String tableName) { createTable( tableName, ImmutableList.of( String.format( "CREATE TABLE %1$s (\n" + " id VARCHAR(255) NOT NULL,\n" + " dataSource VARCHAR(255) NOT NULL,\n" + " created_date VARCHAR(255) NOT NULL,\n" + " start VARCHAR(255) NOT NULL,\n" + " %3$send%3$s VARCHAR(255) NOT NULL,\n" + " sequence_name VARCHAR(255) NOT NULL,\n" + " sequence_prev_id VARCHAR(255) NOT NULL,\n" + " sequence_name_prev_id_sha1 VARCHAR(255) NOT NULL,\n" + " payload %2$s NOT NULL,\n" + " PRIMARY KEY (id),\n" + " UNIQUE (sequence_name_prev_id_sha1)\n" + ")", tableName, getPayloadType(), getQuoteString() ) ) ); }
Source:
<code>public SRAFileReader(final SRAAccession acc) { this.acc = acc; if (!acc.isValid()) { <START> throw new RuntimeException("Passes invalid SRA accession into SRA reader: " + acc); <END> } try { run = gov.nih.nlm.ncbi.ngs.NGS.openReadCollection(acc.toString()); virtualHeader = loadSamHeader(); cachedReferences = loadReferences(); } catch (final Exception e) { throw new RuntimeException(e); } recordRangeInfo = SRAIterator.getRecordsRangeInfo(run); index = new SRAIndex(virtualHeader, recordRangeInfo); }</code><technical_language>IllegalArgumentException</technical_language>

Target:
public SRAFileReader(final SRAAccession acc) { this.acc = acc; if (!acc.isValid()) { throw new IllegalArgumentException("Invalid SRA accession was passed to SRA reader: " + acc); } try { run = gov.nih.nlm.ncbi.ngs.NGS.openReadCollection(acc.toString()); virtualHeader = loadSamHeader(); } catch (final Exception e) { throw new RuntimeException(e); } cachedReferences = new ReferenceCache(run, virtualHeader); recordRangeInfo = SRAIterator.getRecordsRangeInfo(run); index = new SRAIndex(virtualHeader, recordRangeInfo); }
Source:
<code>public @Nullable R apply(@Nullable R input) { <START> checkNotNull(input); <END> if (fieldMask.getPathsList() .isEmpty()) { return input; } if (input instanceof EntityRecord) { return (R) maskEntityRecord((EntityRecord) input); } return applyMask(fieldMask, input); }</code><technical_language>This @Nullable for parameter</technical_language>

Target:
public @Nullable R apply(@Nullable R input) { if (null == input || fieldMask.getPathsList() .isEmpty()) { return input; } if (input instanceof EntityRecord) { return (R) maskEntityRecord((EntityRecord) input); } return applyMask(fieldMask, input); }
Source:
<code>public AutomationWatchService(AbstractFileProvider provider, String watchingDir) { this.provider = provider; this.watchingDir = watchingDir; File file = new File(watchingDir); if (!file.exists()) { <START> file.mkdirs(); <END> } }</code><technical_language>a "reading" feature, I expect create folders. If a folder exist, throw IllegalArgumentException. nasty do if trigger a folder creation a relative path ConfigAdmin</technical_language>

Target:
public AutomationWatchService(AbstractFileProvider provider, String watchingDir) { this.provider = provider; this.watchingDir = watchingDir; File file = new File(watchingDir); if (!file.exists()) { throw new IllegalArgumentException(String.format("Directory \"%s\" not exist!", file.getAbsolutePath())); } }
Source:
<code>private void probeGetsEmptied() { <START> new PollingProber(10000, 1000).check(new Probe() <END> { @Override public boolean isSatisfied() { return queue.isEmpty(); } @Override public String describeFailure() { return "Queue should have been empty"; } }); }</code><technical_language>constants</technical_language>

Target:
private void probeGetsEmptied() { new PollingProber(PROBE_EMPTIED_TIMEOUT_MILLIS, PROBE_EMPTIED_DELAY_MILLIS).check(new Probe() { @Override public boolean isSatisfied() { return queue.isEmpty(); } @Override public String describeFailure() { return "Queue should have been empty"; } }); }
Source:
<code>private void reportIssue(CatchTree catchTree, CatchTree catchTreeToBeCompared) { String typeName = typeName(catchTreeToBeCompared.parameter().type()); <START> String message = "Combine this catch with the one for \"" + typeName + "\", which has the same body." + context.getJavaVersion().java7CompatibilityMessage(); <END> List<JavaFileScannerContext.Location> flow = Lists.newArrayList(new JavaFileScannerContext.Location("Combine with this catch", catchTreeToBeCompared)); reportIssue(catchTree.parameter(), message, flow, null); }</code><technical_language>@benzonico more clear report line of other catch, ie: Combine this catch line "X", body., simplify code compute typeName</technical_language>

Target:
private void reportIssue(CatchTree catchTree, CatchTree catchTreeToBeCompared) { String message = "Combine this catch with the one at line " + catchTreeToBeCompared.catchKeyword().line() + ", which has the same body." + context.getJavaVersion().java7CompatibilityMessage(); List<JavaFileScannerContext.Location> flow = Lists.newArrayList(new JavaFileScannerContext.Location("Combine with this catch", catchTreeToBeCompared)); reportIssue(catchTree.parameter(), message, flow, null); }
Source:
<code>protected String getContextId(String name) { boolean includeHostName = camelContext != null && camelContext.getManagementStrategy().getManagementAgent().getIncludeHostName(); <START> if (includeHostName != null && includeHostName) { <END> return hostName + "/" + (name != null ? name : VALUE_UNKNOWN); } else { return name != null ? name : VALUE_UNKNOWN; } }</code><technical_language>primitive boolean compared null</technical_language>

Target:
protected String getContextId(String name) { boolean includeHostName = camelContext != null && camelContext.getManagementStrategy().getManagementAgent().getIncludeHostName(); if (includeHostName) { return hostName + "/" + (name != null ? name : VALUE_UNKNOWN); } else { return name != null ? name : VALUE_UNKNOWN; } }
Source:
<code>public boolean publishEvent(Event event) throws NotifierException { try { APIEvent apiEvent = (APIEvent) event; ObjectMapper mapper = new ObjectMapper(); String jsonString = mapper.writeValueAsString(apiEvent); byte[] bytesEncoded = Base64.encodeBase64(jsonString.getBytes()); Object[] objects = new Object[]{apiEvent.getType(), apiEvent.getTimeStamp(), new String(bytesEncoded)}; <START> APIUtil.publishEventToStream(APIConstants.NOTIFICATION_STREAM_ID, APIConstants.NOTIFICATION_EVENT_PUBLISHER, <END> objects); return true; } catch (Exception e) { throw new NotifierException(e); } }</code><technical_language>publishEventToStream -> publishEvent</technical_language>

Target:
public boolean publishEvent(Event event) throws NotifierException { try { APIEvent apiEvent = (APIEvent) event; byte[] bytesEncoded = Base64.encodeBase64(new Gson().toJson(apiEvent).getBytes()); Object[] objects = new Object[]{apiEvent.getType(), apiEvent.getTimeStamp(), new String(bytesEncoded)}; org.wso2.carbon.databridge.commons.Event payload = new org.wso2.carbon.databridge.commons.Event( APIConstants.NOTIFICATION_STREAM_ID, System.currentTimeMillis(), null, null, objects); APIUtil.publishEvent(APIConstants.NOTIFICATION_EVENT_PUBLISHER, null, payload); return true; } catch (Exception e) { throw new NotifierException(e); } }
Source:
<code>static RangeCondition<Long> forDiscreteRange(long min, long max, long step) { if (max < min || step < 0) { <START> throw new IllegalArgumentException(); <END> } long increment = Math.max(step, 1L); Set<Long> times = new TreeSet<>(); for (long t = min; t < max; t += increment) { times.add(t); } times.add(max); return fromCollection(times); }</code><technical_language>Please add here</technical_language>

Target:
static RangeCondition<Long> forDiscreteRange(long min, long max, long step) { if (max < min || step < 0) { throw new IllegalArgumentException("Invalid range: max should be < min and step >= 0 (max: " + max + ", min:" + min + ", step: " + step + ')'); } long increment = Math.max(step, 1L); Set<Long> times = new TreeSet<>(); for (long t = min; t < max; t += increment) { times.add(t); } times.add(max); return fromCollection(times); }
Source:
<code>public List<Citation> getByCitationNumberAndDOB(String citationNumber, LocalDate dob) { UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(tylerConfiguration.rootUrl) .queryParam("citationNumber", citationNumber).queryParam("dob", dob.format(dobFormatter)); HttpHeaders headers = new HttpHeaders(); headers.add("apikey", tylerConfiguration.apiKey); HttpEntity<?> query = new HttpEntity<>(headers); ResponseEntity<List<TylerCitation>> tylerCitationsResponse = null; ParameterizedTypeReference<List<TylerCitation>> type = new ParameterizedTypeReference<List<TylerCitation>>() { }; URI uri = builder.build().encode().toUri(); List<TylerCitation> tylerCitations = null; try { tylerCitationsResponse = restTemplate.exchange(uri, HttpMethod.GET, query, type); tylerCitations = tylerCitationsResponse.getBody(); } catch (HttpClientErrorException ex) { System.out.println(ex.getMessage()); System.out.print(ex.getResponseBodyAsString()); } <START> return tylerTransformer.citationsFromTylerCitations(tylerCitations); <END> }</code><technical_language>This is called TylerTransformer method problem need word Tyler in it. tylerTransformer.convertCitations() is sufficient something</technical_language>

Target:
public List<Citation> getByCitationNumberAndDOB(String citationNumber, LocalDate dob) { UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(tylerConfiguration.rootUrl) .queryParam("citationNumber", citationNumber).queryParam("dob", dob.format(dobFormatter)); return performRestTemplateCall(builder.build().encode().toUri()); }
Source:
<code>public IPv4Address apply(VdsNetworkInterface nic) { IPv4Address ipv4Address = new IPv4Address(); if (nic.getIpv4BootProtocol() == Ipv4BootProtocol.STATIC_IP) { <START> ipv4Address.setAddress("".equals(nic.getIpv4Address()) <END> ? null : nic.getIpv4Address()); ipv4Address.setNetmask("".equals(nic.getIpv4Subnet()) ? null : nic.getIpv4Subnet()); ipv4Address.setGateway("".equals(nic.getIpv4Gateway()) ? null : nic.getIpv4Gateway()); } ipv4Address.setBootProtocol(nic.getIpv4BootProtocol()); return ipv4Address; }</code><technical_language>commonly pattern in engine be: if (StringUtils.isNotEmpty(nic.getIpv4Address())) { ipv4Address.setAddress(nic.getIpv4Address(); }</technical_language>

Target:
public IPv4Address apply(VdsNetworkInterface nic) { IPv4Address ipv4Address = new IPv4Address(); if (nic.getIpv4BootProtocol() == Ipv4BootProtocol.STATIC_IP) { ipv4Address.setAddress(nic.getIpv4Address()); ipv4Address.setNetmask(nic.getIpv4Subnet()); ipv4Address.setGateway(nic.getIpv4Gateway()); } ipv4Address.setBootProtocol(nic.getIpv4BootProtocol()); return ipv4Address; }
Source:
<code>public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (!stopped.get()) { future.cancel(true); future = executor.schedule(this::sendEvent, timeout, TimeUnit.MILLISECONDS); <START> LOG.info("Idling workspace " + WorkspaceIdProvider.getWorkspaceId() + " scheduled [timeout=" <END> + timeout / 1000 + " seconds]"); } chain.doFilter(request, response); }</code><technical_language>Writing disk HTTP request is bad for performances. Please remove this log</technical_language>

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (!stopped.get()) { future.cancel(true); future = executor.schedule(this::sendEvent, timeout, TimeUnit.MILLISECONDS); } chain.doFilter(request, response); }
Source:
<code>private void alertIfLowDiskSpaceOnHost() { Map<String, Long> disksUsage = _vds.getLocalDisksUsage(); if (disksUsage == null || disksUsage.isEmpty()) { return; } List<String> disksWithLowSpace = new ArrayList<String>(); List<String> disksWithCriticallyLowSpace = new ArrayList<String>(); final Integer lowSpace = Config.<Integer> GetValue(ConfigValues.VdsLowFreeSpace); <START> final Integer criticallyLowSpace = Config.<Integer> GetValue(ConfigValues.VdsCriticallyLowFreeSpace); <END> for (Entry<String, Long> diskUsage : disksUsage.entrySet()) { if (diskUsage.getValue() <= criticallyLowSpace) { disksWithCriticallyLowSpace.add(diskUsage.getKey()); } else if (diskUsage.getValue() <= lowSpace) { disksWithLowSpace.add(diskUsage.getKey()); } } logLowDiskSpaceOnHostDisks(disksWithLowSpace, lowSpace, AuditLogType.VDS_LOW_DISK_SPACE); logLowDiskSpaceOnHostDisks(disksWithCriticallyLowSpace, criticallyLowSpace, AuditLogType.VDS_LOW_DISK_SPACE_ERROR); }</code><technical_language>If is marked final , private static final</technical_language>

Target:
private void alertIfLowDiskSpaceOnHost() { Map<String, Long> disksUsage = _vds.getLocalDisksUsage(); if (disksUsage == null || disksUsage.isEmpty()) { return; } List<String> disksWithLowSpace = new ArrayList<String>(); List<String> disksWithCriticallyLowSpace = new ArrayList<String>(); for (Entry<String, Long> diskUsage : disksUsage.entrySet()) { if (diskUsage.getValue() != null) { if (diskUsage.getValue() <= LOW_SPACE_CRITICAL_THRESHOLD) { disksWithCriticallyLowSpace.add(diskUsage.getKey()); } else if (diskUsage.getValue() <= LOW_SPACE_THRESHOLD) { disksWithLowSpace.add(diskUsage.getKey()); } } } logLowDiskSpaceOnHostDisks(disksWithLowSpace, LOW_SPACE_THRESHOLD, AuditLogType.VDS_LOW_DISK_SPACE); logLowDiskSpaceOnHostDisks(disksWithCriticallyLowSpace, LOW_SPACE_CRITICAL_THRESHOLD, AuditLogType.VDS_LOW_DISK_SPACE_ERROR); }
Source:
<code>public void testMultipleChannels() { List<MySignal> signals = new ArrayList<>(); signals.add(new MySignal(sender, 0)); signals.add(new MySignal(sender, 0)); signals.add(new MySignal(sender, 0)); signals.add(new MySignal(sender, 1)); signals.add(new MySignal(sender, 1)); signals.add(new MySignal(sender, 1)); signals.add(new MySignal(sender, 2)); signals.add(new MySignal(sender, 2)); signals.add(new MySignal(sender, 2)); Collections.shuffle(signals); synchronized(this) { for (MySignal sig : signals) { sender.sendSignal(sig); } } <START> sleep(1250); <END> for (int nb : listener.nbReceived) { assertEquals(1, nb); } }</code><technical_language>2000</technical_language>

Target:
public void testMultipleChannels() { List<MySignal> signals = new ArrayList<>(); signals.add(new MySignal(sender, 0)); signals.add(new MySignal(sender, 0)); signals.add(new MySignal(sender, 0)); signals.add(new MySignal(sender, 1)); signals.add(new MySignal(sender, 1)); signals.add(new MySignal(sender, 1)); signals.add(new MySignal(sender, 2)); signals.add(new MySignal(sender, 2)); signals.add(new MySignal(sender, 2)); Collections.shuffle(signals); synchronized(this) { for (MySignal sig : signals) { sender.sendSignal(sig); } } sleep(2000); for (int nb : listener.nbReceived) { assertEquals(1, nb); } }
Source:
<code>public List<SchemaDescriptor> getAllSchemas(TransactionController tc) throws StandardException{ List<SchemaDescriptor> lists =new ArrayList<>(); TabInfoImpl ti=coreInfo[SYSSCHEMAS_CORE_NUM]; SYSSCHEMASRowFactory rf=(SYSSCHEMASRowFactory)ti.getCatalogRowFactory(); ScanController sc=tc.openScan( ti.getHeapConglomerate(), false, 0, TransactionController.MODE_RECORD, TransactionController.ISOLATION_REPEATABLE_READ, null, null, 0, null, null, 0); ExecRow outRow=rf.makeEmptyRow(); SchemaDescriptor schemaDescr; while(sc.fetchNext(outRow.getRowArray())){ schemaDescr=(SchemaDescriptor)rf.buildDescriptor(outRow,null,this); lists.add(schemaDescr); } <START> sc.close(); <END> return lists; }</code><technical_language>exception is thrown sc.close()? this lead a resource (descriptor) leak</technical_language>

Target:
public List<SchemaDescriptor> getAllSchemas(TransactionController tc) throws StandardException{ List<SchemaDescriptor> lists =new ArrayList<>(); TabInfoImpl ti=coreInfo[SYSSCHEMAS_CORE_NUM]; SYSSCHEMASRowFactory rf=(SYSSCHEMASRowFactory)ti.getCatalogRowFactory(); try (ScanController sc = tc.openScan( ti.getHeapConglomerate(), false, 0, TransactionController.MODE_RECORD, TransactionController.ISOLATION_REPEATABLE_READ, null, null, 0, null, null, 0)) { ExecRow outRow = rf.makeEmptyRow(); SchemaDescriptor schemaDescr; while (sc.fetchNext(outRow.getRowArray())) { schemaDescr = (SchemaDescriptor) rf.buildDescriptor(outRow, null, this); lists.add(schemaDescr); } } return lists; }
Source:
<code>public void onPostChanged(OnPostChanged event) { <START> AppLog.e(T.API, "causeOfChange: " + event.causeOfChange); <END> if (event.causeOfChange instanceof CauseOfOnPostChanged.RemoteAutoSavePost) { int postLocalId = ((RemoteAutoSavePost) event.causeOfChange).getLocalPostId(); PostModel post = mPostStore.getPostByLocalPostId(postLocalId); SiteModel site = mSiteStore.getSiteByLocalId(post.getLocalSiteId()); sShouldRemoteAutoSavePosts.remove(postLocalId); mPostUploadNotifier.incrementUploadedPostCountFromForegroundNotification(post); mPostUploadNotifier.updateNotificationSuccessForPost(post, site, false); finishUpload(); } }</code><technical_language>want consider logging this info severity, wdyt</technical_language>

Target:
public void onPostChanged(OnPostChanged event) { if (event.causeOfChange instanceof CauseOfOnPostChanged.RemoteAutoSavePost) { int postLocalId = ((RemoteAutoSavePost) event.causeOfChange).getLocalPostId(); PostModel post = mPostStore.getPostByLocalPostId(postLocalId); SiteModel site = mSiteStore.getSiteByLocalId(post.getLocalSiteId()); sShouldRemoteAutoSavePosts.remove(postLocalId); mPostUploadNotifier.incrementUploadedPostCountFromForegroundNotification(post); mPostUploadNotifier.updateNotificationSuccessForPost(post, site, false); finishUpload(); } }
Source:
<code>private void setPeristentExportTriggers(Table table) { if (token.tokenType != Tokens.EXPORT) { return; } String target = readMigrateTarget(); List<String> triggers = new ArrayList<>(); read(); if (token.tokenType == Tokens.ON) { read(); <START> while (token.tokenType != Tokens.OPENBRACKET) { <END> if (token.tokenType == Tokens.DELETE) { triggers.add(Tokens.T_DELETE); } else if (token.tokenType == Tokens.INSERT) { triggers.add(Tokens.T_INSERT); } else if (token.tokenType == Tokens.UPDATE) { triggers.add(Tokens.T_UPDATE); } else if (token.tokenType == Tokens.UPDATEOLD) { triggers.add(Tokens.T_UPDATEOLD); } else if (token.tokenType == Tokens.UPDATENEW) { triggers.add(Tokens.T_UPDATENEW); } else if (token.tokenType != Tokens.COMMA){ throw unexpectedToken(); } read(); } if (triggers.contains(Tokens.T_UPDATE) && (triggers.contains(Tokens.T_UPDATEOLD) || triggers.contains(Tokens.T_UPDATENEW))){ throw unexpectedToken("Cann't combine " + Tokens.T_UPDATE + " with " + Tokens.T_UPDATEOLD + " or " + Tokens.T_UPDATENEW); } if (triggers.contains(Tokens.T_UPDATEOLD) && triggers.contains(Tokens.T_UPDATENEW)) { throw unexpectedToken("Use " + Tokens.T_UPDATE + " instead of both " + Tokens.T_UPDATEOLD + " and " + Tokens.T_UPDATENEW); } } if (triggers.isEmpty()) { triggers= Arrays.asList("INSERT"); } target = target.toUpperCase(); PersistentExport export = new PersistentExport(target, triggers); table.persistentExport = export; }</code><technical_language>logic accepts syntax of ... EXPORT TARGET x INSERT DELETE (..., DELETE/INSERT/UPDATE/etc. multiple times. I syntax is ... EXPORT TARGET x INSERT [, DELETE] [, UPDATE] (..., want guard ... EXPORT TARGET x INSERT, INSERT ... verb appearing more once. Right</technical_language>

Target:
private void setPeristentExportTriggers(Table table) { if (token.tokenType != Tokens.EXPORT) { return; } String target = readMigrateTarget(); List<String> triggers = readExportTrigger(false); target = target.toUpperCase(); PersistentExport export = new PersistentExport(target, triggers); table.persistentExport = export; }
Source:
<code>private void readCheckerEnablementVerifier() { IExtensionPoint ep = getExtensionPoint(CHECKER_ENABLEMENT_EXTENSION_POINT_NAME); for (IConfigurationElement ce : ep.getConfigurationElements()) { try { <START> checkerEnablementVerifier = (ICheckerEnablementVerifier) ce.createExecutableExtension(CLASS_ATTR); <END> } catch (CoreException e) { CodanCorePlugin.log(e); } } }</code><technical_language>Instead of letting verifier win, allow of say. If of verifiers returns false, checker run</technical_language>

Target:
private void readCheckerEnablementVerifier() { IExtensionPoint ep = getExtensionPoint(CHECKER_ENABLEMENT_EXTENSION_POINT_NAME); for (IConfigurationElement ce : ep.getConfigurationElements()) { try { checkerEnablementVerifiers.add((ICheckerEnablementVerifier) ce.createExecutableExtension(CLASS_ATTR)); } catch (CoreException e) { CodanCorePlugin.log(e); } } }
Source:
<code><START> private <T> void registerComponentGauges() { <END> Gauge.Builder<?> builder = Gauge.builder("spring.integration.channels", this, (c) -> this.applicationContext.getBeansOfType(MessageChannel.class).size()); builder.tags(this.componentCountTagProvider.apply("channels")) .description("The Number of Message Channels") .register(this.meterRegistry); builder = Gauge.builder("spring.integration.handlers", this, (c) -> this.applicationContext.getBeansOfType(MessageHandler.class).size()); builder.tags(this.componentCountTagProvider.apply("handlers")) .description("The Number of Message Handlers") .register(this.meterRegistry); builder = Gauge.builder("spring.integration.sources", this, (c) -> this.applicationContext.getBeansOfType(MessageSource.class).size()); builder.tags(this.componentCountTagProvider.apply("sources")) .description("The number of Message Sources") .register(this.meterRegistry); }</code><technical_language>generic type is unrelated</technical_language>

Target:
private void registerComponentGauges() { Gauge.Builder<?> builder = Gauge.builder("spring.integration.channels", this, (c) -> this.applicationContext.getBeansOfType(MessageChannel.class).size()); builder.tags(this.componentCountTagProvider.apply("channels")) .description("The Number of Message Channels") .register(this.meterRegistry); builder = Gauge.builder("spring.integration.handlers", this, (c) -> this.applicationContext.getBeansOfType(MessageHandler.class).size()); builder.tags(this.componentCountTagProvider.apply("handlers")) .description("The Number of Message Handlers") .register(this.meterRegistry); builder = Gauge.builder("spring.integration.sources", this, (c) -> this.applicationContext.getBeansOfType(MessageSource.class).size()); builder.tags(this.componentCountTagProvider.apply("sources")) .description("The number of Message Sources") .register(this.meterRegistry); }
Source:
<code>public void playerWin(Player p) { if (GameMode.DISABLED == mode) return; Player win = activePlayers.get(0); win.teleport(SettingsManager.getInstance().getLobbySpawn()); restoreInv(win); msgmgr.broadcastFMessage(PrefixType.INFO, "game.playerwin","arena-"+gameID, "victim-"+p.getName(), "player-"+win.getName()); LobbyManager.getInstance().display(new String[] { win.getName(), "", "Won the ", "Survival Games!" }, gameID); mode = GameMode.FINISHING; <START> <END> if(config.getBoolean("reward.enabled", false)){ win.getInventory().addItem(new ItemStack(config.getInt("reward.item"), config.getInt("reward.amount"))); } clearSpecs(); win.setHealth(p.getMaxHealth()); win.setFoodLevel(20); win.setFireTicks(0); win.setFallDistance(0); sm.playerWin(win, gameID, new Date().getTime() - startTime); sm.saveGame(gameID, win, getActivePlayers() + getInactivePlayers(), new Date().getTime() - startTime); activePlayers.clear(); inactivePlayers.clear(); spawns.clear(); loadspawns(); LobbyManager.getInstance().updateWall(gameID); }</code><technical_language>Whitespace changes</technical_language>

Target:
public void playerWin(Player p) { if (GameMode.DISABLED == mode) return; Player win = activePlayers.get(0); win.teleport(SettingsManager.getInstance().getLobbySpawn()); restoreInv(win); msgmgr.broadcastFMessage(PrefixType.INFO, "game.playerwin","arena-"+gameID, "victim-"+p.getName(), "player-"+win.getName()); LobbyManager.getInstance().display(new String[] { win.getName(), "", "Won the ", "Survival Games!" }, gameID); mode = GameMode.FINISHING; if(config.getBoolean("reward.enabled", false)){ List<String> items = config.getStringList("reward.contents"); for(int i=0; i<=(items.size()-1); i++){ ItemStack item = ItemReader.read(items.get(i)); win.getInventory().addItem(item); } } clearSpecs(); win.setHealth(p.getMaxHealth()); win.setFoodLevel(20); win.setFireTicks(0); win.setFallDistance(0); sm.playerWin(win, gameID, new Date().getTime() - startTime); sm.saveGame(gameID, win, getActivePlayers() + getInactivePlayers(), new Date().getTime() - startTime); activePlayers.clear(); inactivePlayers.clear(); spawns.clear(); loadspawns(); LobbyManager.getInstance().updateWall(gameID); }
Source:
<code>public SimpleExpression<A> getValue() { if (value == null) { <START> value = Expressions.template(target.getType(), "{0} over ({1})", (List<?>) ImmutableList.of(target, super.getValue())); <END> } return value; }</code><technical_language>suggestion SimpleExpression<A> = this.value; if (value == null) {</technical_language>

Target:
public SimpleExpression<A> getValue() { SimpleExpression<A> value = this.value; if (value == null) { this.value = value = Expressions.template(target.getType(), "{0} over ({1})", (List<?>) ImmutableList.of(target, super.getValue())); } return value; }
Source:
<code>public void myGroups(final AsyncCallback<List<GroupDetail>> callback) { run(callback, new Action<List<GroupDetail>>() { public List<GroupDetail> run(final ReviewDb db) throws OrmException, NoSuchGroupException, Failure { List<GroupDetail> groups = new ArrayList<GroupDetail>(); try { for(AccountGroup group : myGroupsFactory.create().call()) { groups.add(groupDetailFactory.create(group.getId()).call()); } } catch (Exception e) { <START> throw new Failure(e); <END> } return groups; } }); }</code><technical_language>I feel confortable this exception treatment.. I another option changing Handler.java throw a specialized exception instead Exception is out of this feature scope..</technical_language>

Target:
public void myGroups(final AsyncCallback<List<GroupDetail>> callback) { run(callback, new Action<List<GroupDetail>>() { public List<GroupDetail> run(final ReviewDb db) throws OrmException, NoSuchGroupException, Failure { List<GroupDetail> groupDetails = new ArrayList<GroupDetail>(); for(AccountGroup group : myGroupsFactory.create().call()) { groupDetails.add(groupDetailFactory.create(group.getId()).call()); } return groupDetails; } }); }
Source:
<code>public SnapshotFileBatchTextSinkConfig(String name, @Nullable String basePath, @Nullable String delimiter) { super(name, basePath, null); <START> this.delimiter = delimiter == null ? "\t" : delimiter; <END> }</code><technical_language>a cleaner a no-args constructor calls this tab delimiter. need do null check in initialize()</technical_language>

Target:
public SnapshotFileBatchTextSinkConfig(String name, @Nullable String basePath, @Nullable String delimiter) { super(name, basePath, null); this.delimiter = delimiter; }
Source:
<code>public static BlockState adapt(BlockData blockData) { checkNotNull(blockData); int cacheKey = WorldEditPlugin.getInstance().getBukkitImplAdapter() != null ? WorldEditPlugin.getInstance().getBukkitImplAdapter().getInternalBlockStateId(blockData) .orElseGet(() -> blockData.getAsString().hashCode()) <START> : blockData.getAsString().hashCode(); <END> return blockStateCache.computeIfAbsent(cacheKey, input -> { try { return WorldEdit.getInstance().getBlockFactory().parseFromInput(blockData.getAsString(), TO_BLOCK_CONTEXT).toImmutableState(); } catch (InputParseException e) { e.printStackTrace(); return null; } }); }</code><technical_language>Is a test perform validate this collide? I prefer incrementing Atomic Integer, if this proven work okay</technical_language>

Target:
public static BlockState adapt(BlockData blockData) { checkNotNull(blockData); if (WorldEditPlugin.getInstance().getBukkitImplAdapter() == null) { return blockStateStringCache.computeIfAbsent(blockData.getAsString(), input -> { try { return WorldEdit.getInstance().getBlockFactory().parseFromInput(input, TO_BLOCK_CONTEXT).toImmutableState(); } catch (InputParseException e) { e.printStackTrace(); return null; } }); } else { return blockStateCache.computeIfAbsent( WorldEditPlugin.getInstance().getBukkitImplAdapter().getInternalBlockStateId(blockData).orElseGet( () -> blockData.getAsString().hashCode() ), input -> { try { return WorldEdit.getInstance().getBlockFactory().parseFromInput(blockData.getAsString(), TO_BLOCK_CONTEXT).toImmutableState(); } catch (InputParseException e) { e.printStackTrace(); return null; } }); } }
Source:
<code><START> public void extractColumns(QueryContext query) { <END> Set<String> columns = new HashSet<>(); for (ExpressionContext expression : query._selectExpressions) { expression.getColumns(columns); } if (query._filter != null) { query._filter.getColumns(columns); } if (query._groupByExpressions != null) { for (ExpressionContext expression : query._groupByExpressions) { expression.getColumns(columns); } } if (query._havingFilter != null) { query._havingFilter.getColumns(columns); } if (query._orderByExpressions != null) { for (OrderByExpressionContext orderByExpression : query._orderByExpressions) { orderByExpression.getColumns(columns); } } if (query._aggregationFunctions != null) { for (AggregationFunction aggregationFunction : query._aggregationFunctions) { List<ExpressionContext> inputExpressions = aggregationFunction.getInputExpressions(); for (ExpressionContext expression : inputExpressions) { expression.getColumns(columns); } } } query._columns = columns; }</code><technical_language>is this a public method? is invoking this</technical_language>

Target:
private void extractColumns(QueryContext query) { Set<String> columns = new HashSet<>(); for (ExpressionContext expression : query._selectExpressions) { expression.getColumns(columns); } if (query._filter != null) { query._filter.getColumns(columns); } if (query._groupByExpressions != null) { for (ExpressionContext expression : query._groupByExpressions) { expression.getColumns(columns); } } if (query._havingFilter != null) { query._havingFilter.getColumns(columns); } if (query._orderByExpressions != null) { for (OrderByExpressionContext orderByExpression : query._orderByExpressions) { orderByExpression.getColumns(columns); } } if (query._aggregationFunctions != null) { for (AggregationFunction aggregationFunction : query._aggregationFunctions) { List<ExpressionContext> inputExpressions = aggregationFunction.getInputExpressions(); for (ExpressionContext expression : inputExpressions) { expression.getColumns(columns); } } } query._columns = columns; }
Source:
<code>public void validate(Factory factory) throws ForbiddenException, ServerException { Author author = factory.getCreator(); if (author == null || author.getUserId() == null) { throw new ServerException(format("Invalid factory without author stored. Please contact the support about the factory ID '%s'", factory.getId())); } final String userId = EnvironmentContext.getCurrent().getSubject().getUserId(); <START> if (userId == null || !userId.equals(author.getUserId())) { <END> throw new ForbiddenException(format("You are not authorized for the factory '%s'", factory.getId())); } }</code><technical_language>author is null author.getUserId() null due previous block check simplified if (!author.getUserId().equals(userId)) {</technical_language>

Target:
public void validate(Factory factory) throws ForbiddenException, ServerException { Author author = factory.getCreator(); if (author == null || author.getUserId() == null) { throw new ServerException(format("Invalid factory without author stored. Please contact the support about the factory ID '%s'", factory.getId())); } final String userId = EnvironmentContext.getCurrent().getSubject().getUserId(); if (!author.getUserId().equals(userId)) { throw new ForbiddenException(format("You are not authorized for the factory '%s'", factory.getId())); } }
Source:
<code>public <T> T getValue(ConfigValues name, String version) { T returnValue; Map<String, Object> values = null; <START> if ((values = _vdcOptionCache.get(name.toString())) != null && (values.containsKey(version) || values.containsKey("general"))) { <END> returnValue = (T) values.get(version); } else { VdcOption option = new VdcOption(); option.setoption_name(name.toString()); option.setoption_value(null); returnValue = (T) getValue(option); if (values != null) { values.put(version, returnValue); } else { Map<String, Object> defaultValues = new HashMap<String, Object>(); defaultValues.put(version, returnValue); _vdcOptionCache.put(option.getoption_name(), defaultValues); log.debug("Adding new value to configuration cache."); } log.debugFormat("Didn't find the value of {0} in DB for version {1} - using default: {2}", name, version, returnValue); } return returnValue; }</code><technical_language>i dont understand this solution, this fix error is in usage, caller "general" in version, this hack needed, no</technical_language>

Target:
public <T> T getValue(ConfigValues name, String version) { T returnValue; Map<String, Object> values = null; if ((values = _vdcOptionCache.get(name.toString())) != null && (values.containsKey(version))) { returnValue = (T) values.get(version); } else { VdcOption option = new VdcOption(); option.setoption_name(name.toString()); option.setoption_value(null); returnValue = (T) getValue(option); if (values != null) { values.put(version, returnValue); } else { Map<String, Object> defaultValues = new HashMap<String, Object>(); defaultValues.put(version, returnValue); _vdcOptionCache.put(option.getoption_name(), defaultValues); log.debug("Adding new value to configuration cache."); } log.debugFormat("Didn't find the value of {0} in DB for version {1} - using default: {2}", name, version, returnValue); } return returnValue; }
Source:
<code>public void restoreState() { File stateFile = getWorkingSetStateFile(); if (stateFile != null && stateFile.exists()) { try { restoreInProgress = true; <START> FileInputStream input = new FileInputStream(stateFile); <END> try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8))) { IMemento memento = XMLMemento.createReadRoot(reader); restoreWorkingSetState(memento); restoreMruList(memento); } } catch (IOException | WorkbenchException e) { handleInternalError(e, WorkbenchMessages.ProblemRestoringWorkingSetState_title, WorkbenchMessages.ProblemRestoringWorkingSetState_message); } finally { restoreInProgress = false; } if (savePending) { saveState(); savePending = false; } } }</code><technical_language>input try()</technical_language>

Target:
public void restoreState() { File stateFile = getWorkingSetStateFile(); if (stateFile != null && stateFile.exists()) { try { restoreInProgress = true; try (FileInputStream input = new FileInputStream(stateFile); BufferedReader reader = new BufferedReader( new InputStreamReader(input, StandardCharsets.UTF_8))) { IMemento memento = XMLMemento.createReadRoot(reader); restoreWorkingSetState(memento); restoreMruList(memento); } } catch (IOException | WorkbenchException e) { handleInternalError(e, WorkbenchMessages.ProblemRestoringWorkingSetState_title, WorkbenchMessages.ProblemRestoringWorkingSetState_message); } finally { restoreInProgress = false; } if (savePending) { saveState(); savePending = false; } } }
Source:
<code>public AnAction[] getChildren( @Nullable AnActionEvent e) { if (sessionManager == null && connectionService == null) { SarosPluginContext.initComponent(this); } if (e == null || sessionManager.getSession() != null) { return new AnAction[0]; } if (!isSharableResource(e)) { return new AnAction[0]; } Roster roster = connectionService.getRoster(); if (roster == null) { return new AnAction[0]; } <START> int userCount = 0; <END> List<AnAction> list = new ArrayList<>(); for (RosterEntry rosterEntry : roster.getEntries()) { Presence presence = roster.getPresence(rosterEntry.getUser()); if (presence.getType() == Presence.Type.available) { list.add(new ShareWithUserAction(new JID(rosterEntry.getUser()), userCount)); userCount++; } } return list.toArray(new AnAction[0]); }</code><technical_language>Classic: Start counting zero</technical_language>

Target:
public AnAction[] getChildren( @Nullable AnActionEvent e) { if (sessionManager == null && connectionService == null) { SarosPluginContext.initComponent(this); } if (e == null || sessionManager.getSession() != null) { return new AnAction[0]; } if (!isSharableResource(e)) { return new AnAction[0]; } Roster roster = connectionService.getRoster(); if (roster == null) { return new AnAction[0]; } int userCount = 1; List<AnAction> list = new ArrayList<>(); for (RosterEntry rosterEntry : roster.getEntries()) { Presence presence = roster.getPresence(rosterEntry.getUser()); if (presence.getType() == Presence.Type.available) { list.add(new ShareWithUserAction(new JID(rosterEntry.getUser()), userCount)); userCount++; } } return list.toArray(new AnAction[0]); }
Source:
<code>public static CosmosClientBuilder cloneCosmosClientBuilder(CosmosClientBuilder builder) { CosmosClientBuilder copy = new CosmosClientBuilder(); copy.endpoint(builder.getEndpoint()) .key(builder.getKey()) .directMode(builder.getDirectConnectionConfig()) .gatewayMode(builder.getGatewayConnectionConfig()) .consistencyLevel(builder.getConsistencyLevel()) .keyCredential(builder.getKeyCredential()) .permissions(builder.getPermissions()) .authorizationTokenResolver(builder.getAuthorizationTokenResolver()) .resourceToken(builder.getResourceToken()) .contentResponseOnWriteEnabled(builder.isContentResponseOnWriteEnabled()) .userAgentSuffix(builder.getUserAgentSuffix()) .throttlingRetryOptions(builder.getThrottlingRetryOptions()) .preferredRegions(builder.getPreferredRegions()) <START> .endpointDiscoverEnabled(builder.isEndpointDiscoveryEnabled()) <END> .multipleWriteRegionsEnabled(builder.isMultipleWriteRegionsEnabled()) .readRequestsFallbackEnabled(builder.isReadRequestsFallbackEnabled()); return copy; }</code><technical_language>suggestion endpointDiscoveryEnabled</technical_language>

Target:
public static CosmosClientBuilder cloneCosmosClientBuilder(CosmosClientBuilder builder) { CosmosClientBuilder copy = new CosmosClientBuilder(); copy.endpoint(builder.getEndpoint()) .key(builder.getKey()) .directMode(builder.getDirectConnectionConfig()) .gatewayMode(builder.getGatewayConnectionConfig()) .consistencyLevel(builder.getConsistencyLevel()) .keyCredential(builder.getKeyCredential()) .permissions(builder.getPermissions()) .authorizationTokenResolver(builder.getAuthorizationTokenResolver()) .resourceToken(builder.getResourceToken()) .contentResponseOnWriteEnabled(builder.isContentResponseOnWriteEnabled()) .userAgentSuffix(builder.getUserAgentSuffix()) .throttlingRetryOptions(builder.getThrottlingRetryOptions()) .preferredRegions(builder.getPreferredRegions()) .endpointDiscoveryEnabled(builder.isEndpointDiscoveryEnabled()) .multipleWriteRegionsEnabled(builder.isMultipleWriteRegionsEnabled()) .readRequestsFallbackEnabled(builder.isReadRequestsFallbackEnabled()); return copy; }
Source:
<code>private static void sanityCheckReplicationFactor(KsDef ks, CassandraKeyValueServiceConfig config, Set<String> dcs) { Map<String, String> strategyOptions = Maps.newHashMap(ks.getStrategy_options()); for (String dc : dcs) { if (strategyOptions.get(dc) == null) { logErrorOrThrow("The datacenter for this cassandra cluster is invalid. " + " failed dc: " + dc <START> + " strategyOptions: " + strategyOptions, config.ignoreBadDatacenterConfigurationChecks()); <END> } } String dc = dcs.iterator().next(); int currentRf = Integer.parseInt(strategyOptions.get(dc)); if (currentRf != config.replicationFactor()) { throw new UnsupportedOperationException("Your current Cassandra keyspace (" + ks.getName() + ") has a replication factor not matching your Atlas Cassandra configuration." + " Change them to match, but be mindful of what steps you'll need to" + " take to correctly repair or cleanup existing data in your cluster."); } }</code><technical_language>this config.safetyDisabled() || config.ignoreBadDatacenterConfigurationChecks()</technical_language>

Target:
private static void sanityCheckReplicationFactor(KsDef ks, CassandraKeyValueServiceConfig config, Set<String> dcs) { Map<String, String> strategyOptions = Maps.newHashMap(ks.getStrategy_options()); for (String dc : dcs) { if (strategyOptions.get(dc) == null) { logErrorOrThrow("The datacenter for this cassandra cluster is invalid. " + " failed dc: " + dc + " strategyOptions: " + strategyOptions, config.ignoreDatacenterConfigurationChecks()); } } if (Integer.parseInt(strategyOptions.get(dcs.iterator().next())) != config.replicationFactor()) { throw new UnsupportedOperationException("Your current Cassandra keyspace (" + ks.getName() + ") has a replication factor not matching your Atlas Cassandra configuration." + " Change them to match, but be mindful of what steps you'll need to" + " take to correctly repair or cleanup existing data in your cluster."); } }
Source:
<code>protected boolean requiresRuntime(OperationContext context) { <START> return context.isDefaultRequiresRuntime() && context.getRunningMode() != RunningMode.ADMIN_ONLY; <END> }</code><technical_language>in --admin-only? This is a service related management. Apologies in advance if discussed this I forgot. I a vague feeling happened</technical_language>

Target:
protected boolean requiresRuntime(OperationContext context) { return context.isDefaultRequiresRuntime(); }
Source:
<code>public void switchListById(int id) { if (id < 0) { return; } StoredList list = cgData.getList(id); if (list == null) { return; } listId = list.id; title = list.title; Settings.saveLastList(listId); showProgress(true); showFooterLoadingCaches(); final List<Geocache> caches = adapter.getCheckedCaches(); <START> cgData.moveToList(caches, listId); <END> currentLoader = (AbstractSearchLoader) getSupportLoaderManager().initLoader(CacheListType.OFFLINE.ordinal(), new Bundle(), this); currentLoader.reset(); currentLoader.startLoading(); invalidateOptionsMenuCompatible(); }</code><technical_language>inline caches for brevity: java cgData.moveToList(adapter.getCheckedCaches(), listId);</technical_language>

Target:
public void switchListById(int id) { if (id < 0) { return; } StoredList list = cgData.getList(id); if (list == null) { return; } listId = list.id; title = list.title; Settings.saveLastList(listId); showProgress(true); showFooterLoadingCaches(); cgData.moveToList(adapter.getCheckedCaches(), listId); currentLoader = (AbstractSearchLoader) getSupportLoaderManager().initLoader(CacheListType.OFFLINE.ordinal(), new Bundle(), this); currentLoader.reset(); currentLoader.startLoading(); invalidateOptionsMenuCompatible(); }
Source:
<code>public int getWindowFunctionExpressionCount() { return 0; <START> } <END></code><technical_language>"real" implementation defined ParsedSelectStmt work for statements if moved here, instead. I envision a future scenario m_windowFunctionExpressions want "count" it. I envision this a measurable optimization, especially a method implementation qualifies for "final method" optimization. (inferior, possibly short-sighted) alternative path self-consistency push m_windowFunctionExpressions completely ParsedSelectStmt, forcing complete this "abstracting away" of references m_windowFunctionExpressions other AbstractParsedStmt types,</technical_language>

Target:
public int getWindowFunctionExpressionCount() { return m_windowFunctionExpressions.size(); }
Source:
<code>public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException) throws IOException, ServletException { BufferedRequestWrapper bufferedRequest = new BufferedRequestWrapper(request); <START> log.debug(MessageFormat.format("requestXML:{0},uri:{1}", bufferedRequest.getInputStreamString(), request.getRequestURI())); <END> BaseResponseDto dto = mobileAppTokenProvider.generateResponseDto(ReturnMessage.UNAUTHORIZED); response.setContentType("application/json; charset=UTF-8"); response.setCharacterEncoding(StandardCharsets.UTF_8.name()); PrintWriter out = response.getWriter(); String jsonString = objectMapper.writeValueAsString(dto); out.print(jsonString); }</code><technical_language>"[Access Denied] uri: {0} body: {1}"</technical_language>

Target:
public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException) throws IOException, ServletException { BufferedRequestWrapper bufferedRequest = new BufferedRequestWrapper(request); log.debug(MessageFormat.format("[Access Denied] uri: {0} body: {1}",request.getRequestURI(),bufferedRequest.getInputStreamString())); BaseResponseDto dto = mobileAppTokenProvider.generateResponseDto(ReturnMessage.UNAUTHORIZED); response.setContentType("application/json; charset=UTF-8"); response.setCharacterEncoding(StandardCharsets.UTF_8.name()); PrintWriter out = response.getWriter(); String jsonString = objectMapper.writeValueAsString(dto); out.print(jsonString); }
Source:
<code>public Set<String> getSelectedRecipients() { <START> return Optional.ofNullable(selectedRecipients).orElse(new HashSet<>()); <END> }</code><technical_language>orElseGet here</technical_language>

Target:
public Set<String> getSelectedRecipients() { return Optional.ofNullable(selectedRecipients).orElseGet(HashSet::new); }
Source:
<code>public void testGetNumericWithoutArg() throws SQLException { <START> assumeCallableStatementsSupported(); <END> try (CallableStatement call = con.prepareCall(func + pkgName + "getNumericWithoutArg () }")) { call.registerOutParameter(1, Types.NUMERIC); call.execute(); assertEquals(new BigDecimal(42), call.getObject(1, BigDecimal.class)); } }</code><technical_language>This in a setUp method</technical_language>

Target:
public void testGetNumericWithoutArg() throws SQLException { try (CallableStatement call = con.prepareCall(func + pkgName + "getNumericWithoutArg () }")) { call.registerOutParameter(1, Types.NUMERIC); call.execute(); assertEquals(new BigDecimal(42), call.getObject(1, BigDecimal.class)); } }
Source:
<code>private void extendAndInvalidateLine() { mPolyline.addPoint(new GeoPoint(40.0, -11.0)); mPolyline.addPoint(new GeoPoint(40.5, -11.5)); mPolyline.addPoint(new GeoPoint(41.0, -11.0)); mPolyline.addPoint(new GeoPoint(41.5, -11.5)); <START> mMapping.add(80.f); <END> mMapping.add(60.f); mMapping.add(100.f); mMapping.add(100.f); mContainer.add(80.f); mContainer.add(60.f); mContainer.add(100.f); mContainer.add(100.f); mMapping.init(0,100, 0,120); mContainer.refresh(); mMapView.invalidate(); textViewCurrentLocation.setText("New scalar range from 0 to 100\nfor hue ranging from 0 to 120."); btnProceed.setText("Reset Polyline"); }</code><technical_language>Same: add container, mapping</technical_language>

Target:
private void extendAndInvalidateLine() { addDataToPolyline(mExtendedData); mMapping.init(MIN_SCALAR, MAX_SCALAR_EXTENDED, MIN_HUE, MAX_HUE); mContainer.refresh(); mMapView.invalidate(); textInformation.setText(String.format(mInformation, MIN_SCALAR, MAX_SCALAR_EXTENDED, MIN_HUE , MAX_HUE)); btnProceed.setText(sReset); }
Source:
<code>public static <T extends Enum<T>> T resolve(Class<T> type, String token) { try { return Enum.valueOf(type, token.toUpperCase()); } catch (Exception e) { Exceptions.propagateIfFatal(e); try { @SuppressWarnings("unchecked") <START> T[] values = (T[]) type.getMethod("values").invoke(null); <END> for (T v: values) if (v.name().equalsIgnoreCase(token)) return v; throw e; } catch (Exception e2) { throw Exceptions.propagate(e2); } } }</code><technical_language>Is want Class.getEnumConstants(), reflection here</technical_language>

Target:
public static <T extends Enum<T>> T resolve(Class<T> type, String token) { try { return Enum.valueOf(type, token.toUpperCase()); } catch (Exception e) { Exceptions.propagateIfFatal(e); try { for (T v: type.getEnumConstants()) if (v.name().equalsIgnoreCase(token)) return v; throw e; } catch (Exception e2) { throw Exceptions.propagate(e2); } } }