auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testFailJoiningNodeBecauseNeedConfigUpdateOnActiveGrid() throws Exception { prepareTestGrid(); IgniteEx ig = startGrid(1); ig.cluster().state(ClusterState.ACTIVE); try { startGrid(0); fail("Node should start with fail"); } catch (Exception e) { <START> assertThat(X.cause(e, IgniteSpiException.class).getMessage(), containsString("Failed to join node to the active cluster")); <END> } }</code><technical_language>Typo: line long. assert error message contains correct error description config of cache 'poi' merged is impossible active grid</technical_language>

Target:
public void testFailJoiningNodeBecauseNeedConfigUpdateOnActiveGrid() throws Exception { prepareTestGrid(); IgniteEx ig = startGrid(1); ig.cluster().state(ClusterState.ACTIVE); try { startGrid(0); fail("Node should start with fail"); } catch (Exception e) { assertThat(X.cause(e, IgniteSpiException.class).getMessage(), containsString("the config of the cache 'poi' has to be merged which is impossible on active grid")); } }
Source:
<code>public void initialize(Map<String, Param> params) throws TikaConfigException { AnnotationUtils.assignFieldParams(recogniser, params); recogniser.initialize(params); LOG.info("Recogniser = {}", recogniser.getClass().getName()); LOG.info("Recogniser Available = {}", recogniser.isAvailable()); if (recogniser instanceof TensorflowRESTRecogniser || recogniser instanceof TensorflowImageRecParser) { LOG.info("minConfidence = {}, topN={}", minConfidence, topN); } else if (recogniser instanceof TensorflowRESTCaptioner) { <START> LOG.info("captions = {}, maxCaptionLength={}", captions, maxCaptionLength); <END> } }</code><technical_language>I feel is move logs recogniser.initialize() method</technical_language>

Target:
public void initialize(Map<String, Param> params) throws TikaConfigException { AnnotationUtils.assignFieldParams(recogniser, params); recogniser.initialize(params); LOG.info("Recogniser = {}", recogniser.getClass().getName()); LOG.info("Recogniser Available = {}", recogniser.isAvailable()); LOG.info("minConfidence = {}, topN={}", minConfidence, topN); }
Source:
<code>public static String getSSOTicket(String url, String username, String password, String ticketHeader) throws IOException { String ticket = null; httpClient = new CommonHttpClientBuilder().allowAnyCertificate(true).build(); HttpPost httpPost = new HttpPost(url); List<NameValuePair> params = new ArrayList<>(); params.add(new BasicNameValuePair("username", username)); params.add(new BasicNameValuePair("password", password)); httpPost.setEntity(new UrlEncodedFormEntity(params)); HttpResponse httpResponse = httpClient.execute(httpPost); if ((httpResponse.getStatusLine().getStatusCode() != HttpStatus.SC_CREATED) || (null == httpResponse.getEntity())) throw new IAMException("Authentication failed"); Header[] headers = httpResponse.getHeaders(ticketHeader); if (headers[0] != null) { Pattern pattern = Pattern.compile("(TGT-\\d+-\\S+)"); Matcher matcher = pattern.matcher(headers[0].toString()); if (matcher.find()) { ticket = matcher.group(1); } else throw new IAMException("TGT not found in IAM response"); } logger.debug("Token successfully generated for user " + username + "\n Token: " + ticket); <START> httpClient.close(); <END> return ticket; }</code><technical_language>close called in a try/finally block, otherwise, exception is thrown client closed</technical_language>

Target:
public String getSSOTicket(String url, String username, String password, String ticketHeader) { String ticket = null; try (CloseableHttpClient httpClient = new CommonHttpClientBuilder().allowAnyCertificate(true).build()) { HttpPost httpPost = new HttpPost(url); List<NameValuePair> params = new ArrayList<>(); params.add(new BasicNameValuePair("username", username)); params.add(new BasicNameValuePair("password", password)); httpPost.setEntity(new UrlEncodedFormEntity(params)); HttpResponse httpResponse = httpClient.execute(httpPost); if ((httpResponse.getStatusLine().getStatusCode() != HttpStatus.SC_CREATED) || (null == httpResponse.getEntity())) { throw new IAMException("Failed to acquire SSO ticket for the user" + username); } Header[] headers = httpResponse.getHeaders(ticketHeader); if (headers[0] != null) { Pattern pattern = Pattern.compile("(TGT-\\d+-\\S+)"); Matcher matcher = pattern.matcher(headers[0].toString()); if (matcher.find()) { ticket = matcher.group(1); } else { throw new IAMException("TGT not found in IAM response"); } } LOG.debug("SSO ticket successfully generated for user " + username + "\n Token: " + ticket); } catch (Exception e) { throw new IAMException("Authentication failed: Error occurred while acquiring SSO ticket for the user " + username, e); } return ticket; }
Source:
<code>public BuiltinList uadd(BitVector<BigInteger> bitVector) { BigInteger result = signedValue().add(bitVector.signedValue()); <START> return new BuiltinList(ImmutableList.<Term>of( <END> BitVector.of(result, bitwidth), BoolToken.of(checkUnsignedOverflow(result)))); }</code><technical_language>this</technical_language>

Target:
public BuiltinList uadd(BitVector<BigInteger> bitVector) { BigInteger result = unsignedValue().add(bitVector.unsignedValue()); return getBuiltinList(result, checkUnsignedOverflow(result)); }
Source:
<code>public static IService getService(IServerAttributes server, Connection connection) { String uniqueId = getAttribute(ATTR_SERVICE, server); if (StringUtils.isEmpty(uniqueId)) { return null; } if( connection == null ) { return null; } String projectName = OpenShiftResourceUniqueId.getProjectName(uniqueId); List<IService> services = connection.getResources(ResourceKind.SERVICE, projectName); IService service = OpenShiftResourceUniqueId.getByUniqueId(uniqueId, services); <START> WatchManager.getInstance().startWatch(service.getProject(), connection); <END> return service; }</code><technical_language>if service is null? Shouldnt null check here</technical_language>

Target:
public static IService getService(IServerAttributes server, Connection connection) { String uniqueId = getAttribute(ATTR_SERVICE, server); if (StringUtils.isEmpty(uniqueId)) { return null; } if( connection == null ) { return null; } String projectName = OpenShiftResourceUniqueId.getProjectName(uniqueId); List<IService> services = connection.getResources(ResourceKind.SERVICE, projectName); IService service = OpenShiftResourceUniqueId.getByUniqueId(uniqueId, services); if (server != null) { WatchManager.getInstance().startWatch(service.getProject(), connection); } return service; }
Source:
<code>public void runAfterDelay() throws Exception { CountDownLatch cdl1 = new CountDownLatch(1); CountDownLatch cdl2 = new CountDownLatch(1); long delayMs = 30; long before = System.nanoTime(); DelayedExecutionThread det = new DelayedExecutionThread(delayMs, TimeUnit.MILLISECONDS, () -> { cdl1.countDown(); Uninterruptibles.awaitUninterruptibly(cdl2); }); State state = det.state(); assertTrue("State not not started: " + state, state == State.NOT_STARTED); det.start(); assumeTrue(System.nanoTime() - before < TimeUnit.MILLISECONDS.toNanos(delayMs)); cdl1.await(); assertTrue("Executed too early", System.nanoTime() - before >= TimeUnit.MILLISECONDS.toNanos(delayMs)); state = det.state(); assertTrue("State not running: " + state, state == State.RUNNING); assertEquals(0, cdl1.getCount()); state = det.state(); assertTrue("State not correct: " + state, state == State.COMPLETED || state == State.RUNNING); <START> } <END></code><technical_language>call cdl2. countDown() check state again</technical_language>

Target:
public void runAfterDelay() throws Exception { CountDownLatch cdl1 = new CountDownLatch(1); CountDownLatch cdl2 = new CountDownLatch(1); long delayMs = 30; long before = System.nanoTime(); DelayedExecutionThread det = new DelayedExecutionThread(delayMs, TimeUnit.MILLISECONDS, () -> { cdl1.countDown(); Uninterruptibles.awaitUninterruptibly(cdl2); }); State state = det.state(); assertTrue("State not not started: " + state, state == State.NOT_STARTED); det.start(); assumeTrue(System.nanoTime() - before < TimeUnit.MILLISECONDS.toNanos(delayMs)); cdl1.await(); assertTrue("Executed too early", System.nanoTime() - before >= TimeUnit.MILLISECONDS.toNanos(delayMs)); state = det.state(); assertTrue("State not running: " + state, state == State.RUNNING); cdl2.countDown(); det.waitUntilDone(); state = det.state(); assertTrue("State not completed: " + state, state == State.COMPLETED); }
Source:
<code>public LogFixture(Logger logger, Level level) { <START> this.logger = logger; <END> logger.addAppender(this); logger.setLevel(level); }</code><technical_language>If I understand this "fix" properly, basically creating a new appender for test, auto-closing. Plus, creating a new logger for test. LogFixture in a level, auto-generate logger name, need passed in, if avoid copy-paste errors</technical_language>

Target:
private LogFixture(Logger logger, Level level) { this.logger = logger; logger.addAppender(this); logger.setLevel(level); }
Source:
<code>public void testCreateViewTimestamp() throws Exception { Properties props = new Properties(); final String schemaName = "S_" + generateUniqueName(); final String tableName = "T_" + generateUniqueName(); final String viewName = "V_" + generateUniqueName(); final String dataTableFullName = SchemaUtil.getTableName(schemaName, tableName); final String viewFullName = SchemaUtil.getTableName(schemaName, viewName); String tableDDL = "CREATE TABLE " + dataTableFullName + " (\n" + "ID1 VARCHAR(15) NOT NULL,\n" + "ID2 VARCHAR(15) NOT NULL,\n" + "CREATED_DATE DATE,\n" + "CREATION_TIME BIGINT,\n" + "LAST_USED DATE,\n" + "CONSTRAINT PK PRIMARY KEY (ID1, ID2)) "; String viewDDL = "CREATE VIEW " + viewFullName + " AS SELECT * " + "FROM " + dataTableFullName; long startTS = EnvironmentEdgeManager.currentTimeMillis(); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { conn.createStatement().execute(tableDDL); conn.createStatement().execute(viewDDL); <START> conn.commit(); <END> CreateTableIT.verifyLastDDLTimestamp(schemaName, viewName, viewFullName, startTS, conn); } }</code><technical_language>nit: need commit() DDL statements</technical_language>

Target:
public void testCreateViewTimestamp() throws Exception { String tenantId = null; createViewTimestampHelper(tenantId); }
Source:
<code>public static Map<Column, TypeConverter<?, ?>> autoDetectConverters(DataContext dataContext, final List<Column> columns, int sampleSize) { final Map<Column, TypeConverter<?, ?>> result = new HashMap<Column, TypeConverter<?, ?>>(); columns.stream() .filter(col -> col.getType() != null) .filter(col -> col.getType().getSuperType().equals(SuperColumnType.LITERAL_TYPE)) .collect(Collectors.toMap(Column::getTable,Arrays::asList)) .forEach((tab, cols) ->{ <START> autoDetectConvertersInternally(dataContext,tab,cols,sampleSize,result); <END> }); return result; }</code><technical_language>Extremely minor, this needs braces</technical_language>

Target:
public static Map<Column, TypeConverter<?, ?>> autoDetectConverters(DataContext dataContext, final List<Column> columns, int sampleSize) { final Map<Column, TypeConverter<?, ?>> result = new HashMap<Column, TypeConverter<?, ?>>(); columns.stream() .filter(col -> col.getType() != null) .filter(col -> col.getType().getSuperType().equals(SuperColumnType.LITERAL_TYPE)) .collect(Collectors.toMap(Column::getTable,Arrays::asList)) .forEach((tab, cols) -> autoDetectConvertersInternally(dataContext,tab,cols,sampleSize,result)); return result; }
Source:
<code>public void tearDown() throws Exception { if (executor != null) executor.shutdownNow(); if (app != null) Entities.destroyAll(app.getManagementContext()); <START> if (exampleEntity != null) Entities.destroyAll(exampleEntity.getApplication().getManagementContext()); <END> }</code><technical_language>NPE - change if (exampleEntity != null && exampleEntity.getApplication() != null) (happened ExampleAppInFile.groovy classpath due annoying Eclipse behaviour)</technical_language>

Target:
public void tearDown() throws Exception { if (executor != null) executor.shutdownNow(); if (app != null) Entities.destroyAll(app.getManagementContext()); if (exampleEntity != null && exampleEntity.getApplication() != null) Entities.destroyAll(exampleEntity.getApplication().getManagementContext()); }
Source:
<code>private boolean checkPagingSpec(PagingSpec pagingSpec, boolean descending) { for (Integer value : pagingSpec.getPagingIdentifiers().values()) { <START> if (descending ^ value < 0) { <END> return false; } } return pagingSpec.getThreshold() >= 0; }</code><technical_language>This is a part of java spec familiar with. Is this ((descending ? 1 : 0) ^ value) < 0 descending ^ (value < 0)</technical_language>

Target:
private boolean checkPagingSpec(PagingSpec pagingSpec, boolean descending) { for (Integer value : pagingSpec.getPagingIdentifiers().values()) { if (descending ^ (value < 0)) { return false; } } return pagingSpec.getThreshold() >= 0; }
Source:
<code>private void getPrecipitationHeight_CubicChunks_Replace(BlockPos pos, CallbackInfoReturnable<BlockPos> cbi) { if (isColumn) { <START> BlockPos ret = new BlockPos(pos.getX(), getHeightValue(blockToLocal(pos.getZ()), blockToLocal(pos.getZ())), pos.getZ()); <END> cbi.setReturnValue(ret); cbi.cancel(); } }</code><technical_language>getZ() times</technical_language>

Target:
private void getPrecipitationHeight_CubicChunks_Replace(BlockPos pos, CallbackInfoReturnable<BlockPos> cbi) { if (isColumn) { BlockPos ret = new BlockPos(pos.getX(), getHeightValue(blockToLocal(pos.getX()), blockToLocal(pos.getZ())), pos.getZ()); cbi.setReturnValue(ret); cbi.cancel(); } }
Source:
<code>public Mono<AccessToken> getToken(TokenRequestContext request) { List<CredentialUnavailableException> exceptions = new ArrayList<>(4); return Flux.fromIterable(credentials) .flatMap(p -> p.getToken(request) .doOnNext(t -> logger.info("Azure Identity => Attempted credential returns a token", p.getClass().getSimpleName())) .onErrorResume(CredentialUnavailableException.class, t -> { exceptions.add(t); logger.info("Azure Identity => Attempted credential is unavailable.", p.getClass().getSimpleName()); return Mono.empty(); }), 1) .next() .switchIfEmpty(Mono.defer(() -> { StringBuilder message = new StringBuilder("Tried " + credentials.stream().map(c -> c.getClass().getSimpleName()) .collect(Collectors.joining(", ")) + " but failed to acquire a token for any of them. Please verify the" + " environment for the credentials" <START> + " and see more details in the causes below."); <END> CredentialUnavailableException last = exceptions.get(exceptions.size() - 1); for (int z = exceptions.size() - 2; z >= 0; z--) { CredentialUnavailableException current = exceptions.get(z); last = new CredentialUnavailableException(current.getMessage(), last); } return Mono.error(new CredentialUnavailableException(message.toString(), last)); })); }</code><technical_language>clear are? identifies if want find quickly in log</technical_language>

Target:
public Mono<AccessToken> getToken(TokenRequestContext request) { List<CredentialUnavailableException> exceptions = new ArrayList<>(4); return Flux.fromIterable(credentials) .flatMap(p -> p.getToken(request) .doOnNext(t -> logger.info("Azure Identity => Attempted credential returns a token", p.getClass().getSimpleName())) .onErrorResume(Exception.class, t -> { if (!t.getClass().getSimpleName().equals("CredentialUnavailableException")) { return Mono.error(new ClientAuthenticationException( unavailableError + p.getClass().getSimpleName() + " authentication failed. Error Details: " + t.getMessage(), null, t)); } exceptions.add((CredentialUnavailableException) t); logger.info("Azure Identity => Attempted credential is unavailable.", p.getClass().getSimpleName()); return Mono.empty(); }), 1) .next() .switchIfEmpty(Mono.defer(() -> { CredentialUnavailableException last = exceptions.get(exceptions.size() - 1); for (int z = exceptions.size() - 2; z >= 0; z--) { CredentialUnavailableException current = exceptions.get(z); last = new CredentialUnavailableException(current.getMessage() + "\r\n" + last.getMessage(), last.getCause()); } return Mono.error(last); })); }
Source:
<code>public void init(Map<String, Object> conf, SinkContext context) { String path = (String) conf.get(KEY_PATH); String portFile = (String) conf.get(KEY_PORT_FILE); isFlatMetrics = TypeUtils.getBoolean(conf.getOrDefault(KEY_FLAT_METRICS, true)); includeServiceNamespace = TypeUtils.getBoolean( conf.getOrDefault(KEY_INCLUDE_TOPOLOGY_NAME, false)); topologyName = context.getTopologyName(); int port = TypeUtils.getInteger(conf.getOrDefault(KEY_PORT, 0)); if (port == 0) { if (portFile != null) { try { port = TypeUtils.getInteger(Files.lines(Paths.get(portFile)).findFirst().get().trim()); } catch (IOException e) { <START> throw new IllegalArgumentException("Could not parse " + KEY_PORT_FILE + " " + portFile <END> + " Make sure the file only contains the port on which the service should run" + " and is UTF8 encoded", e); } } else { throw new IllegalArgumentException("Neither 'port' nor 'port_file' " + "were specified in config for metrics sink " + context.getSinkId()); } } startHttpServer(path, port); }</code><technical_language>print content in file</technical_language>

Target:
public void init(Map<String, Object> conf, SinkContext context) { String path = (String) conf.get(KEY_PATH); String portFile = (String) conf.get(KEY_PORT_FILE); isFlatMetrics = TypeUtils.getBoolean(conf.getOrDefault(KEY_FLAT_METRICS, true)); includeTopologyName = TypeUtils.getBoolean( conf.getOrDefault(KEY_INCLUDE_TOPOLOGY_NAME, false)); long cacheMaxSize = TypeUtils.getLong(conf.getOrDefault(KEY_METRICS_CACHE_MAX_SIZE, 1000000)); long cacheTtlSec = TypeUtils.getLong(conf.getOrDefault(KEY_METRICS_CACHE_TTL_SEC, 600)); metricsCache = CacheBuilder.newBuilder() .maximumSize(cacheMaxSize) .expireAfterWrite(cacheTtlSec, TimeUnit.SECONDS) .build(); topologyName = context.getTopologyName(); int port = TypeUtils.getInteger(conf.getOrDefault(KEY_PORT, 0)); if (port == 0) { if (!Strings.isNullOrEmpty(portFile)) { try { port = TypeUtils.getInteger(Files.lines(Paths.get(portFile)).findFirst() .get().trim()); } catch (IOException | SecurityException | IllegalArgumentException e) { throw new IllegalArgumentException("Could not parse " + KEY_PORT_FILE + " " + portFile + " Make sure the file is readable," + " only contains the port on which the service should run" + " and is UTF8 encoded", e); } } else { throw new IllegalArgumentException("Neither 'port' nor 'port_file' " + "were specified in config for metrics sink " + context.getSinkId()); } } startHttpServer(path, port); }
Source:
<code>public String getWebviewDevtoolsPort() { <START> return (String) getCapability(AndroidMobileCapabilityType.WEBVIEW_DEVTOOLS_PORT); <END> }</code><technical_language>int</technical_language>

Target:
public Integer getWebviewDevtoolsPort() { return (Integer) getCapability(AndroidMobileCapabilityType.WEBVIEW_DEVTOOLS_PORT); }
Source:
<code>void create() { <START> logger.info("Cache getting created."); <END> statusTransitioner.checkMaintenance(); try { store.create(); } catch (CacheAccessException e) { throw new RuntimeException("Couldn't create Cache", e); } logger.info("Cache successfully created."); }</code><technical_language>a message like: Creating cache storage. is happening there. Cache is created point. holds for other create log statements for destroy ones</technical_language>

Target:
void create() { logger.info("Creating Cache storage."); statusTransitioner.checkMaintenance(); try { store.create(); } catch (CacheAccessException e) { throw new RuntimeException("Couldn't create Cache storage ", e); } logger.info("Cache storage successfully created."); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ((WordPress) getApplication()).component().inject(this); setContentView(R.layout.login_activity); <START> if (!hasLoginNavFragment()) { <END> addLoginNavFragment(); } if (savedInstanceState == null) { addLoginPrologueFragment(); } }</code><technical_language>call addLoginNavFragment here, do if hasLoginNavFragment done addLoginNavFragment? I fine (with a slight preference suggested way), I hope mind mentioning this</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ((WordPress) getApplication()).component().inject(this); setContentView(R.layout.login_activity); if (!hasLoginNavFragment()) { addLoginNavFragment(); } if (!hasLoginEmailCheckerFragment()) { addLoginEmailCheckerFragment(); } if (savedInstanceState == null) { addLoginPrologueFragment(); } }
Source:
<code>public void parsePropertyFiles_OnInvalidFilePath_ThrowsException() { final String invalidFile = "?on-invalid-file-path.properties"; initWithProperties(EMPTY_PROPERTIES); propertyReports.add(invalidFile); ReportParser reportParser = new ReportParser(configuration); thrown.expect(ValidationException.class); thrown.expectMessage(containsString(invalidFile)); <START> thrown.expectMessage(endsWith("doesn't exist or the properties file is invalid!")); <END> reportParser.parsePropertiesFiles(propertyReports); }</code><technical_language>error message point out properties files is invalid</technical_language>

Target:
public void parsePropertyFiles_OnInvalidFilePath_ThrowsException() { final String invalidFile = "?on-invalid-file-path.properties"; initWithProperties(EMPTY_PROPERTIES); classificationFiles.add(invalidFile); ReportParser reportParser = new ReportParser(configuration); thrown.expect(ValidationException.class); thrown.expectMessage(containsString(invalidFile)); thrown.expectMessage(endsWith("doesn't exist or the properties file is invalid!")); reportParser.parseClassificationsFiles(classificationFiles); }
Source:
<code>public Inbox<I> build() { Delivery delivery = ServerEnvironment.instance() .delivery(); checkNotNull(entityStateType, "Entity state type must be set"); checkArgument(!eventEndpoints.isEmpty() || !commandEndpoints.isEmpty(), <START> "There must be at least one event or command endpoint"); <END> Inbox<I> inbox = new Inbox<>(this, delivery); delivery.register(inbox); return inbox; }</code><technical_language>Please finish sentence period. Also, consider reporting of conditions met</technical_language>

Target:
public Inbox<I> build() { Delivery delivery = ServerEnvironment.instance() .delivery(); checkNotNull(entityStateType, "Entity state type must be set."); checkArgument(!eventEndpoints.isEmpty() || !commandEndpoints.isEmpty(), "There must be at least one event or command endpoint."); Inbox<I> inbox = new Inbox<>(this, delivery); delivery.register(inbox); return inbox; }
Source:
<code>private SCMs mergeScms() { <START> SCMs scms = BasicCruiseConfig.this.scms; <END> for (PartialConfig part : this.parts) { scms.addAll(part.getScms()); } return scms; }</code><technical_language>I is safe modify scms instance xml part, clone append a new list</technical_language>

Target:
private SCMs mergeScms() { SCMs scms = new SCMs(); scms.addAll(BasicCruiseConfig.this.scms); for (PartialConfig part : this.parts) { scms.addAll(part.getScms()); } SCMs mergedScms = new SCMs(); for (SCM scm : scms) { if (forEdit) { if (scm.isLocal()) { mergedScms.add(scm); } } else { mergedScms.add(scm); } } return mergedScms; }
Source:
<code>public void deleteFromRealm_twice() { <START> realm.beginTransaction(); <END> snapshot.deleteFromRealm(0); snapshot.deleteFromRealm(0); realm.commitTransaction(); }</code><technical_language>assertions</technical_language>

Target:
public void deleteFromRealm_twice() { realm.beginTransaction(); snapshot.deleteFromRealm(0); snapshot.deleteFromRealm(0); realm.commitTransaction(); assertFalse(snapshot.get(0).isValid()); }
Source:
<code>private void registerIndexEditor(BundleContext bundleContext, IndexTracker tracker, LuceneIndexMBean mBean, Map<String, ?> config) throws IOException { boolean enableCopyOnWrite = PropertiesUtil.toBoolean(config.get(PROP_COPY_ON_WRITE), PROP_COPY_ON_WRITE_DEFAULT); if (enableCopyOnWrite){ initializeIndexCopier(bundleContext, config); editorProvider = new LuceneIndexEditorProvider(indexCopier, tracker, extractedTextCache, augmentorFactory, mountInfoProvider, activeDeletedBlobCollector, mBean, statisticsProvider) .withAsyncIndexesSizeStatsUpdate(asyncIndexesSizeStatsUpdate); log.info("Enabling CopyOnWrite support. Index files would be copied under {}", indexDir.getAbsolutePath()); } else { editorProvider = new LuceneIndexEditorProvider(null, tracker, extractedTextCache, augmentorFactory, mountInfoProvider, activeDeletedBlobCollector, mBean, statisticsProvider) .withAsyncIndexesSizeStatsUpdate(asyncIndexesSizeStatsUpdate); } <START> editorProvider.setBlobStore(blobStore); <END> if (hybridIndex){ editorProvider.setIndexingQueue(checkNotNull(documentQueue)); } Dictionary<String, Object> props = new Hashtable<String, Object>(); props.put("type", TYPE_LUCENE); regs.add(bundleContext.registerService(IndexEditorProvider.class.getName(), editorProvider, props)); oakRegs.add(registerMBean(whiteboard, TextExtractionStatsMBean.class, editorProvider.getExtractedTextCache().getStatsMBean(), TextExtractionStatsMBean.TYPE, "TextExtraction statistics")); }</code><technical_language>remove lines 529 534 add async stats update suggestion editorProvider .withAsyncIndexesSizeStatsUpdate(asyncIndexesSizeStatsUpdate) .setBlobStore(blobStore);</technical_language>

Target:
private void registerIndexEditor(BundleContext bundleContext, IndexTracker tracker, LuceneIndexMBean mBean, Map<String, ?> config) throws IOException { boolean enableCopyOnWrite = PropertiesUtil.toBoolean(config.get(PROP_COPY_ON_WRITE), PROP_COPY_ON_WRITE_DEFAULT); if (enableCopyOnWrite){ initializeIndexCopier(bundleContext, config); editorProvider = new LuceneIndexEditorProvider(indexCopier, tracker, extractedTextCache, augmentorFactory, mountInfoProvider, activeDeletedBlobCollector, mBean, statisticsProvider); log.info("Enabling CopyOnWrite support. Index files would be copied under {}", indexDir.getAbsolutePath()); } else { editorProvider = new LuceneIndexEditorProvider(null, tracker, extractedTextCache, augmentorFactory, mountInfoProvider, activeDeletedBlobCollector, mBean, statisticsProvider); } editorProvider.setBlobStore(blobStore); editorProvider.withAsyncIndexesSizeStatsUpdate(asyncIndexesSizeStatsUpdate); if (hybridIndex){ editorProvider.setIndexingQueue(checkNotNull(documentQueue)); } Dictionary<String, Object> props = new Hashtable<String, Object>(); props.put("type", TYPE_LUCENE); regs.add(bundleContext.registerService(IndexEditorProvider.class.getName(), editorProvider, props)); oakRegs.add(registerMBean(whiteboard, TextExtractionStatsMBean.class, editorProvider.getExtractedTextCache().getStatsMBean(), TextExtractionStatsMBean.TYPE, "TextExtraction statistics")); }
Source:
<code>public static void setUp() throws Exception { File availableClaimsFile = testFolder.newFile("attributeMap.properties"); availableClaimsFilePath = availableClaimsFile.getCanonicalPath(); Properties availableClaims = new Properties(); availableClaims.put("testClaim1", "testValue1"); availableClaims.put("testClaim2", "testValue2"); availableClaims.put("testClaim3", "testValue3"); availableClaims.store(new FileWriter(availableClaimsFile), "test"); File profilesJson = testFolder.newFile("profiles.json"); profilesDotJsonPath = profilesJson.getCanonicalPath(); Map<String, Object> outterMap = new HashMap<>(); Map<String, Object> profile1Map = new HashMap<>(); Map<String, Object> profile2Map = new HashMap<>(); outterMap.put("profile1", ImmutableMap.of(GUEST_CLAIMS, profile1Map)); outterMap.put("profile2", ImmutableMap.of(GUEST_CLAIMS, profile2Map)); profile1Map.put("testClaim1", "profile1Value1"); profile1Map.put("testClaim2", "profile1Value2"); profile1Map.put("testClaim3", "profile1Value3"); profile1Map.put("testClaim4", "profile1Value4"); profile2Map.put("testClaim1", "profile2Value1"); profile2Map.put("testClaim2", "profile2Value2"); profile2Map.put("testClaim3", "profile2Value3"); profile2Map.put("testClaim4", "profile2Value4"); <START> String json = GSON.toJson(outterMap); <END> FileUtils.write(profilesJson, json); }</code><technical_language>I concerned Gson generate test data test handle ... Gson again</technical_language>

Target:
public static void setUp() throws Exception { File availableClaimsFile = testFolder.newFile("attributeMap.properties"); try (InputStream is = GuestClaimsHandlerExtTest.class.getResourceAsStream("/attributeMap.properties")) { FileUtils.copyToFile(is, availableClaimsFile); } availableClaimsFilePath = availableClaimsFile.getCanonicalPath(); File profilesJson = testFolder.newFile("profiles.json"); try (InputStream is = GuestClaimsHandlerExtTest.class.getResourceAsStream("/profiles.json")) { FileUtils.copyToFile(is, profilesJson); } profilesDotJsonPath = profilesJson.getCanonicalPath(); }
Source:
<code>public void validateRelayState(String relayState, boolean strictRelayState) { LOGGER.debug("Validating RelayState"); if (relayState != null && relayState.length() > 80) { if (strictRelayState) { throw new IllegalArgumentException("RelayState must be 80 bytes or shorter"); } else { <START> LOGGER.warn("RelayState has invalid size: {}", relayState.length()); <END> } } if (relayState != null && (relayState.contains("<") || relayState.contains(">"))) { throw new IllegalArgumentException("RelayState cannot contain '<' or '>'"); } }</code><technical_language>a user perspective this happens? double-check SP send a relay state long? hate for out-of-the-box DIB authentication break if turn this option on. do warn log of throwing exception</technical_language>

Target:
public void validateRelayState(String relayState, boolean strictRelayState) { LOGGER.debug("Validating RelayState"); if (relayState != null && relayState.length() > 80) { LOGGER.warn("RelayState has invalid size: {}", relayState.length()); if (strictRelayState) { throw new IllegalArgumentException("RelayState must be 80 bytes or shorter"); } } if (relayState != null && (relayState.contains("<") || relayState.contains(">"))) { throw new IllegalArgumentException("RelayState cannot contain '<' or '>'"); } }
Source:
<code>public static boolean isPrime(long val) { return API.Match(val).of( Case($(2L), true), <START> Case($(n -> n > 2), n -> !primes().takeWhile(d -> d <= Math.sqrt(n)).exists(d -> n % d == 0)), <END> Case($(), false) ); }</code><technical_language>n bigger 2 here? - consider extracting Math.sqrt(n), recalculating time</technical_language>

Target:
public static boolean isPrime(long val) { return API.Match(val).of( Case($(2L), true), Case($(n -> n > 2), n -> { final double upperLimitToCheck = Math.sqrt(n); return !primes().takeWhile(d -> d <= upperLimitToCheck).exists(d -> n % d == 0); }), Case($(), false) ); }
Source:
<code>private void setup() { <START> random = new Random(); <END> hadoopConf = new Configuration(); hadoopConf.set("fs.hdfs.impl", org.apache.hadoop.hdfs.DistributedFileSystem.class.getName()); hadoopConf.set("fs.file.impl", org.apache.hadoop.fs.LocalFileSystem.class.getName()); listDirectoryOperation = path -> { FileSystem fs = path.getFileSystem(hadoopConf); return new HadoopDirectoryLister.HadoopFileInfoIterator(fs.listLocatedStatus(path)); }; }</code><technical_language>Random is thread safe, tests ran in multiple threads. Please ThreadLocalRandom instead (inline ThreadLocalRandom.current() everywhere)</technical_language>

Target:
private void setup() { hadoopConf = new Configuration(); hadoopConf.set("fs.hdfs.impl", org.apache.hadoop.hdfs.DistributedFileSystem.class.getName()); hadoopConf.set("fs.file.impl", org.apache.hadoop.fs.LocalFileSystem.class.getName()); listDirectoryOperation = path -> { FileSystem fs = path.getFileSystem(hadoopConf); return new HadoopFileInfoIterator(fs.listLocatedStatus(path)); }; }
Source:
<code><START> public static GitPerson toGitPerson(UserIdentity committer) { <END> GitPerson p = new GitPerson(); p.name = committer.getName(); p.email = committer.getEmail(); p.date = committer.getDate(); p.tz = committer.getTimeZone(); return p; }</code><technical_language>necessary</technical_language>

Target:
private static GitPerson toGitPerson(UserIdentity committer) { GitPerson p = new GitPerson(); p.name = committer.getName(); p.email = committer.getEmail(); p.date = committer.getDate(); p.tz = committer.getTimeZone(); return p; }
Source:
<code>public boolean unloadQueuedChunks() { if (this.worldServer.getDisableLevelSaving()) { return false; } final int MaxNumToUnload = 400; Iterator<CubeCoords> iter = this.cubesToUnload.iterator(); while (iter.hasNext()) { <START> CubeCoords coords = iter.next(); <END> if (this.dependencyManager.isRequired(coords)) { continue; } long columnAddress = AddressTools.getAddress(coords.getCubeX(), coords.getCubeZ()); Column column = this.loadedColumns.get(columnAddress); if (column == null) { continue; } Cube cube = column.removeCube(coords.getCubeY()); if (cube != null) { this.recursivelyRemoveForceLoadedCube(cube); cube.onUnload(); this.worldServer.getGeneratorPipeline().getDependentCubeManager().unregister(cube); this.cubeIO.saveCube(cube); } if (!column.hasCubes()) { column.onChunkUnload(); this.loadedColumns.remove(columnAddress); this.cubeIO.saveColumn(column); } iter.remove(); } return false; }</code><technical_language>limit amount of unloaded cubes tick. unloadQueuedChunks called tick</technical_language>

Target:
public boolean unloadQueuedChunks() { if (this.worldServer.getDisableLevelSaving()) { return false; } final int MaxNumToUnload = 400; Iterator<CubeCoords> iter = this.cubesToUnload.iterator(); int processed = 0; while (iter.hasNext() && processed < MaxNumToUnload) { CubeCoords coords = iter.next(); if (this.dependencyManager.isRequired(coords)) { continue; } long columnAddress = AddressTools.getAddress(coords.getCubeX(), coords.getCubeZ()); Column column = this.loadedColumns.get(columnAddress); if (column == null) { continue; } Cube cube = column.removeCube(coords.getCubeY()); if (cube != null) { this.recursivelyRemoveForceLoadedCube(cube); cube.onUnload(); this.worldServer.getGeneratorPipeline().getDependentCubeManager().unregister(cube); this.cubeIO.saveCube(cube); } if (!column.hasCubes()) { column.onChunkUnload(); this.loadedColumns.remove(columnAddress); this.cubeIO.saveColumn(column); } iter.remove(); ++processed; } return false; }
Source:
<code>private void castSubType( String typeName, Type type, Value value, StringBuilder pathBuilder ) throws TypeCastingException { pathBuilder.append( '.' ); pathBuilder.append( typeName ); <START> boolean hasChildren = value.hasChildren( typeName ); <END> if ( hasChildren == false && type.cardinality().min() > 0 && !(type instanceof TypePair) ) { throw new TypeCastingException( "Undefined required child node: " + pathBuilder.toString() ); } else if ( hasChildren ) { ValueVector vector = value.getChildren( typeName ); int size = vector.size(); if (!(type instanceof TypePair ) && checkCardinality(type, size)) { throw new TypeCastingException( "Child node " + pathBuilder.toString() + " has a wrong number of occurencies. Permitted range is [" + type.cardinality().min() + "," + type.cardinality().max() + "], found " + size ); } for( Value v : vector ) { type.cast( v, pathBuilder ); } } }</code><technical_language>final</technical_language>

Target:
private void castSubType( String typeName, Type type, Value value, StringBuilder pathBuilder ) throws TypeCastingException { pathBuilder.append( '.' ); pathBuilder.append( typeName ); final boolean hasChildren = value.hasChildren( typeName ); if ( hasChildren == false && type.cardinality().min() > 0 ) { throw new TypeCastingException( "Undefined required child node: " + pathBuilder.toString() ); } else if ( hasChildren ) { final ValueVector vector = value.getChildren( typeName ); final int size = vector.size(); if ( type.cardinality().min() > size || type.cardinality().max() < size ) { throw new TypeCastingException( "Child node " + pathBuilder.toString() + " has a wrong number of occurencies. Permitted range is [" + type.cardinality().min() + "," + type.cardinality().max() + "], found " + size ); } for( Value v : vector ) { type.cast( v, pathBuilder ); } } }
Source:
<code><START> public S3ClientOptions disableChunkedEncoding() { <END> setChunkedEncoding(false); return this; }</code><technical_language>surprising if a customer explicitly disabled chunked encoding magically re-enabled in auth error retry strategy. able pass client options in constructor of this class. created in invoke method of AmazonS3Client</technical_language>

Target:
public S3ClientOptions disableChunkedEncoding() { this.chunkedEncodingDisabled = true; return this; }
Source:
<code>public SpringCache getCache(final String name) { <START> return cacheByName.computeIfAbsent(name, n -> { <END> final Cache<Object, Object> nativeCache = this.nativeCacheManager.getCache(n); return new SpringCache(nativeCache); }); }</code><technical_language>call stop this map wanna empty this map. WDYT</technical_language>

Target:
public SpringCache getCache(final String name) { return springCaches.computeIfAbsent(name, n -> { final Cache<Object, Object> nativeCache = this.nativeCacheManager.getCache(n); return new SpringCache(nativeCache); }); }
Source:
<code>protected void processIterableBatch(InvocationContext ctx, PutMapCommand cmd, PersistenceManager.AccessMode mode, Predicate<Object> filter) { if (getStatisticsEnabled()) cacheStores.addAndGet(cmd.getMap().size()); Iterator<MarshalledEntry> iterator = cmd.getMap().keySet().stream() .filter(filter) .map(key -> createMarshalledEntry(ctx, key)) .iterator(); if (iterator.hasNext()) { <START> persistenceManager.writeBatchToAllNonTxStores(() -> iterator, mode, cmd.getFlagsBitSet()); <END> } }</code><technical_language>I this is right. Iterable.iterator() is supposed return a fresh Iterator time, some store implementations rely that</technical_language>

Target:
protected void processIterableBatch(InvocationContext ctx, PutMapCommand cmd, PersistenceManager.AccessMode mode, Predicate<Object> filter) { if (getStatisticsEnabled()) cacheStores.addAndGet(cmd.getMap().size()); Iterable<MarshalledEntry> iterable = () -> cmd.getMap().keySet().stream() .filter(filter) .map(key -> createMarshalledEntry(ctx, key)) .iterator(); persistenceManager.writeBatchToAllNonTxStores(iterable, mode, cmd.getFlagsBitSet()); }
Source:
<code>protected boolean validate() { setStoragePoolId(getVm().getStoragePoolId()); if (!isValidParametersList() || !checkImagesStatus() || !validateSpaceRequirements() || !performVmRelatedChecks()) { return false; } for (LiveMigrateDiskParameters parameters : getParameters().getParametersList()) { <START> getReturnValue().setValid(isDiskNotShareable(parameters.getImageId()) && isDiskSnapshotNotPluggedToOtherVmsThatAreNotDown(parameters.getImageId()) && isTemplateInDestStorageDomain(parameters.getImageId(), parameters.getTargetStorageDomainId()) && performStorageDomainsChecks(parameters) && isSameSourceAndDest(parameters)); if (!getReturnValue().isValid()) { return false; } <END> } if (!setAndValidateDiskProfiles()) { return false; } return validateCreateAllSnapshotsFromVmCommand(); }</code><technical_language>I a hunch some of removed</technical_language>

Target:
protected boolean validate() { setStoragePoolId(getVm().getStoragePoolId()); if (!isValidParametersList() || !validateDestDomainsSpaceRequirements()) { return false; } for (LiveMigrateDiskParameters parameters : getParameters().getParametersList()) { getReturnValue().setValid(isDiskNotShareable(parameters.getImageId()) && isDiskSnapshotNotPluggedToOtherVmsThatAreNotDown(parameters.getImageId()) && isTemplateInDestStorageDomain(parameters.getImageId(), parameters.getTargetStorageDomainId()) && validateDestStorage(getStorageDomainById(parameters.getTargetStorageDomainId(), getStoragePoolId())) && isSameSourceAndDest(parameters)); if (!getReturnValue().isValid()) { return false; } } if (!setAndValidateDiskProfiles()) { return false; } return validateCreateAllSnapshotsFromVmCommand(); }
Source:
<code>private String getAllDataFromObisCode(final LnClientConnection conn, final ClassIdObisAttr obisAttr) throws ProtocolAdapterException, IOException, TimeoutException { String output = ""; final int noOfAttr = obisAttr.getNoAttr(); for (int attributeValue = 1; attributeValue <= noOfAttr; attributeValue++) { <START> LOGGER.info("Creating output for attr: {}/{}", obisAttr.getObisCode().value(), attributeValue, noOfAttr); <END> output += this.getAllDataFromAttribute(conn, obisAttr.getClassNumber(), obisAttr.getObisCode(), attributeValue); } return output; }</code><technical_language>Change log level debug</technical_language>

Target:
private String getAllDataFromObisCode(final LnClientConnection conn, final ClassIdObisAttr obisAttr) throws ProtocolAdapterException, IOException, TimeoutException { String output = ""; final int noOfAttr = obisAttr.getNoAttr(); for (int attributeValue = 1; attributeValue <= noOfAttr; attributeValue++) { LOGGER.debug("Creating output for attr: {}/{}", obisAttr.getObisCode().value(), attributeValue, noOfAttr); output += this.getAllDataFromAttribute(conn, obisAttr.getClassNumber(), obisAttr.getObisCode(), attributeValue); } return output; }
Source:
<code>public AuthenticationResult getToken(String authorizationUrl) throws Exception { if (StringExtensions.IsNullOrBlank(authorizationUrl)) { <START> throw new IllegalArgumentException("finalUrl"); <END> } HashMap<String, String> parameters = getUrlParameters(authorizationUrl); String encodedState = parameters.get("state"); String state = decodeProtocolState(encodedState); if (!StringExtensions.IsNullOrBlank(state)) { Uri stateUri = Uri.parse("http://state/path?" + state); String authorizationUri = stateUri.getQueryParameter("a"); String resource = stateUri.getQueryParameter("r"); if (!StringExtensions.IsNullOrBlank(authorizationUri) && !StringExtensions.IsNullOrBlank(resource) && resource.equalsIgnoreCase(mRequest.getResource())) { AuthenticationResult result = processUIResponseParams(parameters); if (result != null && result.getStatus() == AuthenticationResult.AuthenticationStatus.Succeeded) { if (!result.getCode().isEmpty()) { return getTokenForCode(result.getCode()); } else if (!StringExtensions.IsNullOrBlank(result.getAccessToken())) { return result; } else { throw new AuthenticationException(ADALError.AUTH_FAILED_NO_TOKEN); } } else { throw new AuthenticationException(ADALError.AUTH_FAILED_NO_TOKEN, result.getErrorCode() + " " + result.getErrorDescription()); } } else { throw new AuthenticationException(ADALError.AUTH_FAILED_BAD_STATE); } } else { throw new AuthenticationException(ADALError.AUTH_FAILED_NO_STATE); } }</code><technical_language>"authorizationUrl"</technical_language>

Target:
public AuthenticationResult getToken(String authorizationUrl) throws Exception { if (StringExtensions.IsNullOrBlank(authorizationUrl)) { throw new IllegalArgumentException("authorizationUrl"); } HashMap<String, String> parameters = getUrlParameters(authorizationUrl); String encodedState = parameters.get("state"); String state = decodeProtocolState(encodedState); if (!StringExtensions.IsNullOrBlank(state)) { Uri stateUri = Uri.parse("http://state/path?" + state); String authorizationUri = stateUri.getQueryParameter("a"); String resource = stateUri.getQueryParameter("r"); if (!StringExtensions.IsNullOrBlank(authorizationUri) && !StringExtensions.IsNullOrBlank(resource) && resource.equalsIgnoreCase(mRequest.getResource())) { AuthenticationResult result = processUIResponseParams(parameters); if (result != null && result.getStatus() == AuthenticationResult.AuthenticationStatus.Succeeded) { if (!result.getCode().isEmpty()) { return getTokenForCode(result.getCode()); } else if (!StringExtensions.IsNullOrBlank(result.getAccessToken())) { return result; } else { throw new AuthenticationException(ADALError.AUTH_FAILED_NO_TOKEN); } } else { throw new AuthenticationException(ADALError.AUTH_FAILED_NO_TOKEN, result.getErrorCode() + " " + result.getErrorDescription()); } } else { throw new AuthenticationException(ADALError.AUTH_FAILED_BAD_STATE); } } else { throw new AuthenticationException(ADALError.AUTH_FAILED_NO_STATE); } }
Source:
<code>public ByteArrayBufferImpl(byte[] buffer, int offset, int length) { this.buffer = Objects.requireNonNull(buffer, "buffer"); <START> if (offset + length > buffer.length) <END> { throw new IllegalArgumentException("length"); } this.offset = offset; this.length = length; }</code><technical_language>do care check for length positive here</technical_language>

Target:
public ByteArrayBufferImpl(byte[] buffer, int offset, int length) { this.buffer = Objects.requireNonNull(buffer, "buffer"); if (offset + length > buffer.length || length < 0 || offset < 0) { throw new IllegalArgumentException("length or offset"); } this.offset = offset; this.length = length; }
Source:
<code>public void afterRefreshTreatment(boolean succeeded) { try { <START> synchronized (this) { if (succeeded) { <END> unrespondedAttempts.set(0); setLastUpdate(); Guid storagePoolId = null; ArrayList<VDSDomainsData> domainsList = null; try { hostMonitoring.afterRefreshTreatment(); if (cachedVds != null && cachedVds.getStatus() != VDSStatus.Maintenance) { storagePoolId = cachedVds.getStoragePoolId(); domainsList = cachedVds.getDomains(); } hostMonitoring = null; } catch (IRSErrorException ex) { logAfterRefreshFailureMessage(ex); if (log.isDebugEnabled()) { logException(ex); } } catch (RuntimeException ex) { logAfterRefreshFailureMessage(ex); logException(ex); } if (domainsList != null) { updateVdsDomainsData(cachedVds, storagePoolId, domainsList); } } } } catch (Exception e) { log.error("Timer update runtime info failed. Exception:", ExceptionUtils.getRootCauseMessage(e)); log.debug("Exception:", e); } finally { lockManager.releaseLock(monitoringLock); } }</code><technical_language>reduce nesting level by: if (!succeeded) { lockManager.releaseLock(monitoringLock); return; } try { synchronized (this) { ... } ... } finally { lockManager.releaseLock(monitoringLock); } safe release lock of sync block</technical_language>

Target:
public void afterRefreshTreatment(boolean succeeded) { if (!succeeded) { lockManager.releaseLock(monitoringLock); return; } try { synchronized (this) { unrespondedAttempts.set(0); setLastUpdate(); Guid storagePoolId = null; ArrayList<VDSDomainsData> domainsList = null; try { hostMonitoring.afterRefreshTreatment(); if (cachedVds != null && cachedVds.getStatus() != VDSStatus.Maintenance) { storagePoolId = cachedVds.getStoragePoolId(); domainsList = cachedVds.getDomains(); } hostMonitoring = null; } catch (IRSErrorException ex) { logAfterRefreshFailureMessage(ex); if (log.isDebugEnabled()) { logException(ex); } } catch (RuntimeException ex) { logAfterRefreshFailureMessage(ex); logException(ex); } if (domainsList != null) { updateVdsDomainsData(cachedVds, storagePoolId, domainsList); } } } catch (Exception e) { log.error("Timer update runtime info failed. Exception:", ExceptionUtils.getRootCauseMessage(e)); log.debug("Exception:", e); } finally { lockManager.releaseLock(monitoringLock); } }
Source:
<code><START> public Boolean isPullSuccessIndicated() { <END> if (getStatus() == null) return false; return (getStatus().contains("Download complete") || getStatus().contains("Image is up to date") || getStatus() .contains("Downloaded newer image")); }</code><technical_language>primitive, in JSON null</technical_language>

Target:
public boolean isPullSuccessIndicated() { if (isErrorIndicated() || getStatus() == null) { return false; } return (getStatus().contains("Download complete") || getStatus().contains("Image is up to date") || getStatus() .contains("Downloaded newer image")); }
Source:
<code>private String removeUnprintableChars(String text) { StringBuilder stringbuilder = new StringBuilder(); <START> for(char c0 : text.toCharArray()) { <END> if (c0 != 167 && c0 != 127) { stringbuilder.append(c0); } } return stringbuilder.toString(); }</code><technical_language>Again, variable name</technical_language>

Target:
private String removeUnprintableChars(String text) { StringBuilder stringbuilder = new StringBuilder(); for(char c0 : text.toCharArray()) if (c0 != 167 && c0 != 127) stringbuilder.append(c0); return stringbuilder.toString(); }