auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void logout() { <START> logoutButton.perform(click()); <END> logoutConfirmationButton.perform(click()); }</code><technical_language>login/logout test fails for this step testing a smaller device (I a Pixel). test scrolling logout button, fails button screen. this fix it: logoutButton.perform(scrollTo(), click());</technical_language>

Target:
public void logout() { scrollToThenClickOn(R.id.row_logout); clickOn(android.R.id.button1); }
Source:
<code>private static Path getCacheDir(SitePaths site, String name) { <START> Path loc = site.resolve(name).toPath(); <END> if (loc == null) { return null; } if (!Files.exists(loc)) { try { Files.createDirectories(loc); } catch (IOException e) { log.warn("Can't create disk cache: " + loc.toAbsolutePath()); return null; } } if (!Files.isWritable(loc)) { log.warn("Can't write to disk cache: " + loc.toAbsolutePath()); return null; } log.info("Enabling disk cache " + loc.toAbsolutePath()); return loc; }</code><technical_language>IIRC name null here. resolve(null) fails here. need: if (Strings.isNullOrEmpty(name)) { return null; }</technical_language>

Target:
private static Path getCacheDir(SitePaths site, String name) { if (name == null) { return null; } Path loc = site.resolve(name).toPath(); if (!Files.exists(loc)) { try { Files.createDirectories(loc); } catch (IOException e) { log.warn("Can't create disk cache: " + loc.toAbsolutePath()); return null; } } if (!Files.isWritable(loc)) { log.warn("Can't write to disk cache: " + loc.toAbsolutePath()); return null; } log.info("Enabling disk cache " + loc.toAbsolutePath()); return loc; }
Source:
<code>private static GitHub getGitHub() throws IOException { GitHubBuilder builder; try { builder = GitHubBuilder.fromCredentials(); } catch (IOException noAuthorizationDetails) { builder = new GitHubBuilder(); } OkHttpClient client = new OkHttpClient(); <START> client.setCache(new Cache(Paths.get(".", ".cache").toFile(), FileUtils.ONE_MB * 10)); <END> return builder .withConnector(new OkHttpConnector(new OkUrlFactory(client))) .build(); }</code><technical_language>making cache size configurable</technical_language>

Target:
private static GitHub getGitHub() throws IOException { OkHttpClient client = new OkHttpClient(); client.setCache(new Cache(Paths.get(".", ".cache").toFile(), FileUtils.ONE_MB * 10)); return new GitHubBuilder() .withConnector(new RawGitOkHttpConnector(new OkUrlFactory(client))) .build(); }
Source:
<code>public void setAndKeepttl() { String status = jedis.set(bfoo, binaryValue, setParams().nx().ex(expireSeconds)); assertTrue(Keyword.OK.name().equalsIgnoreCase(status)); status = jedis.set(bfoo, binaryValue, setParams().keepttl()); assertTrue(Keyword.OK.name().equalsIgnoreCase(status)); long ttl = jedis.ttl(bfoo); assertTrue(0 < ttl && ttl <= expireSeconds); <START> } <END></code><technical_language>set again, this time modifier check ttl is gone</technical_language>

Target:
public void setAndKeepttl() { String status = jedis.set(bfoo, binaryValue, setParams().nx().ex(expireSeconds)); assertTrue(Keyword.OK.name().equalsIgnoreCase(status)); status = jedis.set(bfoo, binaryValue, setParams().keepttl()); assertTrue(Keyword.OK.name().equalsIgnoreCase(status)); long ttl = jedis.ttl(bfoo); assertTrue(0 < ttl && ttl <= expireSeconds); jedis.set(bfoo, binaryValue); ttl = jedis.ttl(bfoo); assertTrue(ttl < 0); }
Source:
<code>private void checkFieldType(String fieldName, long columnIndex, RealmFieldType expectedType) { RealmFieldType columnType = proxyState.getRow$realm().getColumnType(columnIndex); if (columnType != expectedType) { String indefiniteVowel = ""; if (expectedType == RealmFieldType.INTEGER || expectedType == RealmFieldType.LIST) { indefiniteVowel = "n"; } throw new IllegalArgumentException(String.format("'%s' is not a%s '%s', but a%s '%s'.", <START> fieldName, indefiniteVowel, expectedType, indefiniteVowel, columnType)); <END> } }</code><technical_language>another vowel check for columnType</technical_language>

Target:
private void checkFieldType(String fieldName, long columnIndex, RealmFieldType expectedType) { RealmFieldType columnType = proxyState.getRow$realm().getColumnType(columnIndex); if (columnType != expectedType) { String expectedIndefiniteVowel = ""; if (expectedType == RealmFieldType.INTEGER || expectedType == RealmFieldType.OBJECT) { expectedIndefiniteVowel = "n"; } String columnTypeIndefiniteVowel = ""; if (expectedType == RealmFieldType.INTEGER || expectedType == RealmFieldType.OBJECT) { columnTypeIndefiniteVowel = "n"; } throw new IllegalArgumentException(String.format("'%s' is not a%s '%s', but a%s '%s'.", fieldName, expectedIndefiniteVowel, expectedType, columnTypeIndefiniteVowel, columnType)); } }
Source:
<code>public void postExecution(ActionEvaluationResponse response) { <START> if(response == null || null == response.getExecutedAction()) { <END> return; } final ActionRequest request = response.getRequest(); final String metricKey = response.getExecutedAction().getMetricKey(); if(null == response.getException()) { MetricUtil.getInstance() .registerActionFailure(request.getOpcode(), metricKey, response.getElapsedTime()); } if(response.isCached()) { MetricUtil.getInstance().registerActionCacheHit(request.getOpcode(), metricKey); } else { MetricUtil.getInstance().registerActionCacheMiss(request.getOpcode(), metricKey); } MetricUtil.getInstance() .registerActionSuccess(request.getOpcode(), metricKey, response.getElapsedTime()); }</code><technical_language>follow pattern for null check</technical_language>

Target:
public void postExecution(ActionEvaluationResponse response) { if(null == response || null == response.getExecutedAction()) { return; } final ActionRequest request = response.getRequest(); final String metricKey = response.getExecutedAction().getMetricKey(); if(null == response.getException()) { MetricUtil.getInstance() .registerActionFailure(request.getOpcode(), metricKey, response.getElapsedTime()); } if(response.isCached()) { MetricUtil.getInstance().registerActionCacheHit(request.getOpcode(), metricKey); } else { MetricUtil.getInstance().registerActionCacheMiss(request.getOpcode(), metricKey); } MetricUtil.getInstance() .registerActionSuccess(request.getOpcode(), metricKey, response.getElapsedTime()); }
Source:
<code>public String getPartitionId(RowData element) { keyBuffer.setLength(fixedPrefixLength); for (int i = fixedPrefix.length; i < dynamicFieldGetters.length; i++) { RowData.FieldGetter getter = dynamicFieldGetters[i]; Object fieldValue = getter.getFieldOrNull(element); <START> keyBuffer.append(fieldValue); <END> keyBuffer.append(delimiter); if (keyBuffer.length() >= MAX_PARTITION_KEY_LENGTH) { break; } } int length = Math.min( keyBuffer.length() - delimiter.length(), MAX_PARTITION_KEY_LENGTH); return keyBuffer.substring(0, length); }</code><technical_language>limiting supported data types for partitions somewhere? assume data type (esp in internal data structures) a good toString method. If I check SupportsPartitioning, limited this STRING type</technical_language>

Target:
public String getPartitionId(RowData element) { keyBuffer.setLength(keyBufferStaticPrefixLength); for (int i = fieldNamesStaticPrefixLength; i < fieldNames.size(); i++) { String fieldName = fieldNames.get(i); if (!staticFields.containsKey(fieldName)) { keyBuffer.append(dynamicFieldGetters.get(fieldName).getFieldOrNull(element)); } else { keyBuffer.append(staticFields.get(fieldName)); } keyBuffer.append(delimiter); if (keyBuffer.length() >= MAX_PARTITION_KEY_LENGTH) { break; } } int length = Math.min(keyBuffer.length() - delimiter.length(), MAX_PARTITION_KEY_LENGTH); return keyBuffer.substring(0, length); }
Source:
<code>private static List<VisitableElement<?>> wrap(String property, String value, Double distance) { <START> return Arrays.asList( <END> new VisitableJsonElementImpl(FAKE_PROPERTY_OPERATOR, property), new VisitableJsonElementImpl(FAKE_DISTANCE_OPERATOR, distance), new VisitableJsonElementImpl(FAKE_VALUE_OPERATOR, Collections.singletonList(value))); }</code><technical_language>Do want this list immutable? If ImmutableList.of instead of Arrays.asList</technical_language>

Target:
private static List<VisitableElement<?>> wrap(String property, String value, Double distance) { return ImmutableList.of( new VisitableJsonElementImpl(FAKE_PROPERTY_OPERATOR, property), new VisitableJsonElementImpl(FAKE_DISTANCE_OPERATOR, distance), new VisitableJsonElementImpl(FAKE_VALUE_OPERATOR, Collections.singletonList(value))); }
Source:
<code>private static BibEntry createABibEntryAuthor(String author) { <START> BibEntry bibEntry = new BibEntry(); bibEntry.setField(StandardField.AUTHOR, author); <END> return bibEntry; }</code><technical_language>suggestion return new BibEntry() .withField(StandardField.AUTHOR, author);</technical_language>

Target:
private static BibEntry createABibEntryAuthor(String author) { return new BibEntry().withField(StandardField.AUTHOR, author); }
Source:
<code>private ProgramEnrollment getProgramEnrollment(String lookupName, Map<String, String> lookupFields, String configName) { List<ProgramEnrollment> programEnrollments = null; switch (lookupName) { case BY_MOTECH_ID_AND_PROGRAM_NAME: { programEnrollments = programEnrollmentService.getProgramEnrollmentByPatientMotechId(configName, lookupFields.get(PATIENT_MOTECH_ID)); break; } case BY_UUID_AMD_PROGRAM_NAME: { programEnrollments = programEnrollmentService.getProgramEnrollmentByPatientUuid(configName, lookupFields.get(PATIENT_UUID)); break; } default: { LOGGER.error("Lookup with name doesn't exist for patient object", lookupName); break; } } <START> if(CollectionUtils.isNotEmpty(programEnrollments)) { <END> List<ProgramEnrollment> filteredProgramEnrollments = new ArrayList<>(); for (ProgramEnrollment programEnrollment : programEnrollments) { if (programEnrollment.getProgram().getName().equals(lookupFields.get(PROGRAM_NAME))) { filteredProgramEnrollments.add(programEnrollment); } } if (CollectionUtils.isNotEmpty(filteredProgramEnrollments)) { return filteredProgramEnrollments.get(0); } } ProgramEnrollment notEnrolled = new ProgramEnrollment(); notEnrolled.setEnrolled(ProgramEnrollment.NOT_ENROLLED); return notEnrolled; }</code><technical_language>please add this logic separate method</technical_language>

Target:
private ProgramEnrollment getProgramEnrollment(String lookupName, Map<String, String> lookupFields, String configName) { List<ProgramEnrollment> programEnrollments = null; switch (lookupName) { case BY_MOTECH_ID_AND_PROGRAM_NAME: { programEnrollments = programEnrollmentService.getProgramEnrollmentByPatientMotechId(configName, lookupFields.get(PATIENT_MOTECH_ID)); break; } case BY_UUID_AMD_PROGRAM_NAME: { programEnrollments = programEnrollmentService.getProgramEnrollmentByPatientUuid(configName, lookupFields.get(PATIENT_UUID)); break; } default: { LOGGER.error("Lookup with name doesn't exist for patient object", lookupName); break; } } return filterByProgramName(programEnrollments, lookupFields.get(PROGRAM_NAME)); }
Source:
<code>public void resetTraceEntry(TimeChartAnalysisEntry timeAnalysisEntry) { Iterator<ITimeEvent> iterator = timeAnalysisEntry.getTimeEventsIterator(); TimeChartEvent event = null; boolean hasNext = true; while (!interrupted && hasNext) { synchronized (timeAnalysisEntry) { hasNext = iterator.hasNext(); <START> event = (TimeChartEvent) iterator.next(); <END> } if (hasNext) { event.setColorSettingPriority(ColorSettingsManager.PRIORITY_NONE); if (event.getItemizedEntry() != null) { resetTraceEntry(event.getItemizedEntry()); } } } }</code><technical_language>NoSuchElementException thrown</technical_language>

Target:
public void resetTraceEntry(TimeChartAnalysisEntry timeAnalysisEntry) { Iterator<ITimeEvent> iterator = timeAnalysisEntry.getTimeEventsIterator(); TimeChartEvent event = null; boolean hasNext = true; while (!interrupted && hasNext) { synchronized (timeAnalysisEntry) { while ((hasNext = iterator.hasNext()) == true) { event = (TimeChartEvent) iterator.next(); break; } } if (hasNext && event != null) { event.setColorSettingPriority(ColorSettingsManager.PRIORITY_NONE); if (event.getItemizedEntry() != null) { resetTraceEntry(event.getItemizedEntry()); } } } }
Source:
<code>public void run() { for (int i = 0; i < <START> 100; ++i) <END> { try { WeakReference<Class<?>> ref = loadClassInLoader(); Runtime.getRuntime().gc(); } catch (Throwable e) { System.err.println(e); break; } } completed.set(true); }</code><technical_language>Put constant</technical_language>

Target:
public void run() { for (int i = 0; i < NUM_ITERATIONS; ++i) { try { WeakReference<Class<?>> ref = $noinline$loadClassInLoader(); Runtime.getRuntime().gc(); Thread.yield(); } catch (Throwable e) { System.err.println(e); break; } } completed.set(true); }
Source:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); res = this.getResources(); app = (cgeoapplication) this.getApplication(); prefs = getSharedPreferences(Settings.preferences, Context.MODE_PRIVATE); base = new cgBase(app); <START> Settings.setLanguage(Settings.isUseEnglish()); <END> }</code><technical_language>Please don't, this call setLanguage() activity creation</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); res = this.getResources(); app = (cgeoapplication) this.getApplication(); prefs = getSharedPreferences(Settings.preferences, Context.MODE_PRIVATE); base = new cgBase(app); }
Source:
<code>public void testMessageDigest_MultipleThreads_Misuse() throws Exception { ExecutorService es = Executors.newFixedThreadPool(THREAD_COUNT); final CountDownLatch latch = new CountDownLatch(THREAD_COUNT); final MessageDigest md = MessageDigest.getInstance("SHA-256"); final byte[] message = new byte[64]; for (int i = 0; i < THREAD_COUNT; i++) { es.submit(new Callable<Void>() { @Override public Void call() throws Exception { <START> latch.countDown(); <END> for (int j = 0; j < 100; j++) { md.update(message); md.digest(); } return null; } }); } es.shutdown(); es.awaitTermination(1, TimeUnit.MINUTES); }</code><technical_language>Error, point of CountdownLatch ? calling await() anywhere. (When do, forget check return value...)</technical_language>

Target:
public void testMessageDigest_MultipleThreads_Misuse() throws Exception { ExecutorService es = Executors.newFixedThreadPool(THREAD_COUNT); final CountDownLatch latch = new CountDownLatch(THREAD_COUNT); final MessageDigest md = MessageDigest.getInstance("SHA-256"); final byte[] message = new byte[64]; for (int i = 0; i < THREAD_COUNT; i++) { es.submit(new Callable<Void>() { @Override public Void call() throws Exception { latch.countDown(); latch.await(); for (int j = 0; j < 100; j++) { md.update(message); md.digest(); } return null; } }); } es.shutdown(); assertTrue("Test should not timeout", es.awaitTermination(1, TimeUnit.MINUTES)); }
Source:
<code>public void postAcknowledge(final MessageReference ref, AckReason reason) { QueueImpl queue = (QueueImpl) ref.getQueue(); queue.decDelivering(ref); <START> if (isNonDestructive() && reason == AckReason.NORMAL) { <END> ref.setInDelivery(false); } if (reason == AckReason.EXPIRED) { messagesExpired.incrementAndGet(); } else if (reason == AckReason.KILLED) { messagesKilled.incrementAndGet(); } else if (reason == AckReason.REPLACED) { messagesReplaced.incrementAndGet(); } else { messagesAcknowledged.incrementAndGet(); } if (ref.isPaged()) { return; } Message message; try { message = ref.getMessage(); } catch (Throwable e) { ActiveMQServerLogger.LOGGER.unableToPerformPostAcknowledge(e); message = null; } if (message == null || (isNonDestructive() && reason == AckReason.NORMAL)) return; boolean durableRef = message.isDurable() && queue.isDurable(); try { message.decrementRefCount(); } catch (Exception e) { ActiveMQServerLogger.LOGGER.errorDecrementingRefCount(e); } if (durableRef) { int count = message.decrementDurableRefCount(); if (count == 0) { try { storageManager.deleteMessage(message.getMessageID()); } catch (Exception e) { ActiveMQServerLogger.LOGGER.errorRemovingMessage(e, message.getMessageID()); } } } }</code><technical_language>field access</technical_language>

Target:
public void postAcknowledge(final MessageReference ref, AckReason reason) { QueueImpl queue = (QueueImpl) ref.getQueue(); queue.decDelivering(ref); if (nonDestructive && reason == AckReason.NORMAL) { ref.setInDelivery(false); } if (reason == AckReason.EXPIRED) { messagesExpired.incrementAndGet(); } else if (reason == AckReason.KILLED) { messagesKilled.incrementAndGet(); } else if (reason == AckReason.REPLACED) { messagesReplaced.incrementAndGet(); } else { messagesAcknowledged.incrementAndGet(); } if (ref.isPaged()) { return; } Message message; try { message = ref.getMessage(); } catch (Throwable e) { ActiveMQServerLogger.LOGGER.unableToPerformPostAcknowledge(e); message = null; } if (message == null || (nonDestructive && reason == AckReason.NORMAL)) return; boolean durableRef = message.isDurable() && queue.isDurable(); try { message.decrementRefCount(); } catch (Exception e) { ActiveMQServerLogger.LOGGER.errorDecrementingRefCount(e); } if (durableRef) { int count = message.decrementDurableRefCount(); if (count == 0) { try { storageManager.deleteMessage(message.getMessageID()); } catch (Exception e) { ActiveMQServerLogger.LOGGER.errorRemovingMessage(e, message.getMessageID()); } } } }
Source:
<code>public Listener() { super("ListenerThread"); <START> portBindMaxRetry = Integer.getInteger("zookeeper.electionPortBindRetry", 3); <END> }</code><technical_language>recommend adding info log this property is set reads some validation in place property is negative. change reasonable - others think</technical_language>

Target:
public Listener() { super("ListenerThread"); final Integer maxRetry = Integer.getInteger(ELECTION_PORT_BIND_RETRY, DEFAULT_PORT_BIND_MAX_RETRY); if (maxRetry >= 0) { LOG.info("Election port bind maximum retries is {}", maxRetry); portBindMaxRetry = maxRetry; } else { LOG.info("'{}' contains invalid value: {}(must be >= 0). " + "Use default value of instead.", ELECTION_PORT_BIND_RETRY, maxRetry, DEFAULT_PORT_BIND_MAX_RETRY); portBindMaxRetry = DEFAULT_PORT_BIND_MAX_RETRY; } }
Source:
<code>public String toString() { StringBuilder result = new StringBuilder(); <START> result.append("DashBoard settings{ New item registry : "); <END> for (ItemRegistry item : this.newItemsRegistry) { result.append(item.toString()).append(" / "); } return result.append("}").toString(); }</code><technical_language>Please try auto generate toString() method</technical_language>

Target:
public String toString() { return "DashboardSettings{" + "newItemsRegistry=" + newItemsRegistry + '}'; }
Source:
<code>public CRUDHealth checkHealth() { boolean isHealthy = true; Collection<MongoConfiguration> configs = dbResolver.getConfigurations(); List<String> details = new ArrayList<>(configs.size()); DBObject ping = new BasicDBObject("ping", 1); for (MongoConfiguration config : configs) { try { CommandResult result = config.getDB().command(ping); if (!result.get("ok").equals(1.0)) { isHealthy = false; <START> details.add(new StringBuilder(config.toString()).append("\n").append("ping:NOK").toString()); <END> } else { details.add(new StringBuilder(config.toString()).append("\n").append("ping:OK").toString()); } } catch (Exception e) { isHealthy = false; details.add(new StringBuilder(config.toString()).append("\n").append("ping:").append(e).toString()); } } return new CRUDHealth(isHealthy, details.toString()); }</code><technical_language>ping:NOT_OK for instead of ping:NOK</technical_language>

Target:
public CRUDHealth checkHealth() { boolean isHealthy = true; Collection<MongoConfiguration> configs = dbResolver.getConfigurations(); List<String> details = new ArrayList<>(configs.size()); DBObject ping = new BasicDBObject("ping", 1); for (MongoConfiguration config : configs) { try { CommandResult result = config.getDB().command(ping); if (!result.get("ok").equals(1.0)) { isHealthy = false; details.add(new StringBuilder(getMongoConfigDetails(config)).append("=>").append("ping:NOT_OK") .toString()); } else { details.add( new StringBuilder(getMongoConfigDetails(config)).append("=>").append("ping:OK").toString()); } } catch (Exception e) { isHealthy = false; details.add(new StringBuilder(getMongoConfigDetails(config)).append("=>").append("ping:").append(e) .toString()); } } return new CRUDHealth(isHealthy, details.toString()); }
Source:
<code>public void testArbitaryElementsAreNotFiltered() { Object element = new Object(); <START> Assert.assertFalse(element instanceof ITask); <END> TaskReviewArtifactFilter filter = new TaskReviewArtifactFilter(); boolean wasntFiltered = filter.select(null, element); Assert.assertTrue(wasntFiltered); }</code><technical_language>need this</technical_language>

Target:
public void testArbitaryElementsAreNotFiltered() { Object element = new Object(); TaskReviewArtifactFilter filter = new TaskReviewArtifactFilter(); boolean wasFiltered = !filter.select(null, element); assertFalse(wasFiltered); }
Source:
<code>public void updateUserProfile(AuthzToken authzToken, UserProfile userDetails) throws IamAdminServicesException, AuthorizationException, TException { TenantManagementKeycloakImpl keycloakclient = new TenantManagementKeycloakImpl(); try { String username = authzToken.getClaimsMap().get(Constants.USER_NAME); String gatewayId = authzToken.getClaimsMap().get(Constants.GATEWAY_ID); if (!gatewayId.equals(userDetails.getGatewayId())) { throw new IamAdminServicesException("gatewayId in user profile doesn't match authorization token!"); } if (!username.equals(userDetails.getUserId())) { <START> throw new IamAdminServicesException("userId in user profile doesn't match authorization token!"); <END> } PasswordCredential credential = getTenantAdminPasswordCredential(gatewayId); keycloakclient.updateUserProfile(credential, gatewayId, username, userDetails); } catch (ApplicationSettingsException e) { throw new IamAdminServicesException("Unable to create service clients. Reason: " + e.getMessage()); } }</code><technical_language>add a error log username user id</technical_language>

Target:
public void updateUserProfile(AuthzToken authzToken, UserProfile userDetails) throws IamAdminServicesException, AuthorizationException, TException { TenantManagementKeycloakImpl keycloakclient = new TenantManagementKeycloakImpl(); try { String username = authzToken.getClaimsMap().get(Constants.USER_NAME); String gatewayId = authzToken.getClaimsMap().get(Constants.GATEWAY_ID); if (!gatewayId.equals(userDetails.getGatewayId())) { throw new IamAdminServicesException("gatewayId in user profile doesn't match authorization token!"); } if (!username.equals(userDetails.getUserId())) { String msg = "userId in user profile "+userDetails.getUserId()+" doesn't match authorization token "+username+""; logger.error(msg); throw new IamAdminServicesException("userId in user profile doesn't match authorization token!"); } PasswordCredential credential = getTenantAdminPasswordCredential(gatewayId); keycloakclient.updateUserProfile(credential, gatewayId, username, userDetails); } catch (ApplicationSettingsException e) { throw new IamAdminServicesException("Unable to create service clients. Reason: " + e.getMessage()); } }
Source:
<code>public void onPlayerJoin(PlayerJoinEvent event) { Player player = event.getPlayer(); if (!player.hasPlayedBefore()) { <START> for (Object map : kits.getKits().keySet()) { <END> Kit kit = kits.getKits().get(map); if (CommandBook.inst().hasPermission(player, "commandbook.kits.onfirstlogin."+map)) { kit.distribute(player); } } } }</code><technical_language>Do EntrySet, iterating Map.Entry<String, Kit></technical_language>

Target:
public void onPlayerJoin(PlayerJoinEvent event) { Player player = event.getPlayer(); if (!player.hasPlayedBefore()) { for (Entry<String, Kit> map : kits.getKits().entrySet()) { if (CommandBook.inst().hasPermission(player, "commandbook.kits.onfirstlogin." + map)) { map.getValue().distribute(player); } } } }
Source:
<code>public HttpResponse doCreateAdminUser(StaplerRequest req, StaplerResponse rsp) throws IOException { Jenkins j = Jenkins.getInstance(); j.checkPermission(Jenkins.ADMINISTER); HudsonPrivateSecurityRealm securityRealm = (HudsonPrivateSecurityRealm)j.getSecurityRealm(); User admin = securityRealm.getUser(SetupWizard.initialSetupAdminUserName); try { if(admin != null) { admin.delete(); } User u = securityRealm.createAccountFromSetupWizard(req); if(admin != null) { admin = null; } try { getInitialAdminPasswordFile().delete(); } catch (InterruptedException e) { throw new IOException(e); } InstallUtil.proceedToNextStateFrom(InstallState.CREATE_ADMIN_USER); Authentication a = new UsernamePasswordAuthenticationToken(u.getId(),req.getParameter("password1")); a = securityRealm.getSecurityComponents().manager.authenticate(a); SecurityContextHolder.getContext().setAuthentication(a); CrumbIssuer crumbIssuer = Jenkins.getInstance().getCrumbIssuer(); JSONObject data = new JSONObject(); if (crumbIssuer != null) { data.accumulate("crumbRequestField", crumbIssuer.getCrumbRequestField()).accumulate("crumb", crumbIssuer.getCrumb(req)); } return HttpResponses.okJSON(data); } catch (AccountCreationFailedException e) { <START> rsp.setStatus(400); <END> return HttpResponses.forwardToView(securityRealm, "/jenkins/install/SetupWizard/setupWizardFirstUser.jelly"); } finally { if(admin != null) { admin.save(); } } }</code><technical_language>400? I AccountCreationFailedException is for validating input data, right</technical_language>

Target:
public HttpResponse doCreateAdminUser(StaplerRequest req, StaplerResponse rsp) throws IOException { Jenkins j = Jenkins.getInstance(); j.checkPermission(Jenkins.ADMINISTER); HudsonPrivateSecurityRealm securityRealm = (HudsonPrivateSecurityRealm) j.getSecurityRealm(); User admin = securityRealm.getUser(SetupWizard.initialSetupAdminUserName); try { if (admin != null) { admin.delete(); } User newUser = securityRealm.createAccountFromSetupWizard(req); if (admin != null) { admin = null; } try { getInitialAdminPasswordFile().delete(); } catch (InterruptedException e) { throw new IOException(e); } InstallUtil.proceedToNextStateFrom(InstallState.CREATE_ADMIN_USER); Authentication auth = new UsernamePasswordAuthenticationToken(newUser.getId(), req.getParameter("password1")); auth = securityRealm.getSecurityComponents().manager.authenticate(auth); SecurityContextHolder.getContext().setAuthentication(auth); CrumbIssuer crumbIssuer = Jenkins.getInstance().getCrumbIssuer(); JSONObject data = new JSONObject(); if (crumbIssuer != null) { data.accumulate("crumbRequestField", crumbIssuer.getCrumbRequestField()).accumulate("crumb", crumbIssuer.getCrumb(req)); } return HttpResponses.okJSON(data); } catch (AccountCreationFailedException e) { rsp.setStatus(422); return HttpResponses.forwardToView(securityRealm, "/jenkins/install/SetupWizard/setupWizardFirstUser.jelly"); } finally { if (admin != null) { admin.save(); } } }
Source:
<code>protected DfLastaFlutePhysicalHolder preparePhysicalHolder(File rootDir) { final DfLastaFlutePhysicalHolder physicalHolder = new DfLastaFlutePhysicalHolder(); final FileHierarchyTracer tracer = new FileHierarchyTracer(); tracer.trace(rootDir, new FileHierarchyTracingHandler() { <START> @Override <END> public boolean isTargetFileOrDir(File currentFile) { return true; } @Override public void handleFile(File currentFile) throws IOException { final String path = toPath(currentFile); if (path.contains("/app/web/") && path.endsWith("Action.java")) { physicalHolder.addAction(currentFile); } } }); return physicalHolder; }</code><technical_language>Please remove @Override suppress differences. I want modify DfEngineWorkDir differences for review-able</technical_language>

Target:
protected DfLastaFlutePhysicalHolder preparePhysicalHolder(File rootDir) { final DfLastaFlutePhysicalHolder physicalHolder = new DfLastaFlutePhysicalHolder(); final FileHierarchyTracer tracer = new FileHierarchyTracer(); tracer.trace(rootDir, new FileHierarchyTracingHandler() { public boolean isTargetFileOrDir(File currentFile) { return true; } public void handleFile(File currentFile) throws IOException { final String path = toPath(currentFile); if (path.contains("/app/web/") && path.endsWith("Action.java")) { physicalHolder.addAction(currentFile); } } }); return physicalHolder; }
Source:
<code>public SootMethodRef makeMethodRef(SootClass declaringClass, String name, List<Type> parameterTypes, Type returnType, boolean isStatic) { if (declaringClass.getName().equals(SootMethodRefHandleImpl.METHODHANDLE_SIGNATURE) || declaringClass.getName().equals(SootMethodRefHandleImpl.VARHANDLE_SIGNATURE)) { <START> return new SootMethodRefHandleImpl(declaringClass, name, parameterTypes, returnType, isStatic); <END> } return new SootMethodRefImpl(declaringClass, name, parameterTypes, returnType, isStatic); }</code><technical_language>rename PoymorphicIvokeMethodRef similar</technical_language>

Target:
public SootMethodRef makeMethodRef(SootClass declaringClass, String name, List<Type> parameterTypes, Type returnType, boolean isStatic) { if (PolymorphicMethodRef.handlesClass(declaringClass)) { return new PolymorphicMethodRef(declaringClass, name, parameterTypes, returnType, isStatic); } return new SootMethodRefImpl(declaringClass, name, parameterTypes, returnType, isStatic); }
Source:
<code>public SpongeSelector(SelectorType type, Map<String, String> arguments, boolean requiresLocation) { this.type = type; <START> this.arguments = arguments; <END> this.requiresLocation = requiresLocation; }</code><technical_language>This immutable map, do ImmutableMap.copyOf(arguments) here, in builder's build() method giving this constructor</technical_language>

Target:
public SpongeSelector(SelectorType type, Map<String, String> arguments, boolean requiresLocation) { this.type = type; this.arguments = ImmutableMap.copyOf(arguments); this.requiresLocation = requiresLocation; }
Source:
<code>protected CachingClusteredClient makeClient( final ListeningExecutorService backgroundExecutorService, final Cache cache, final int mergeLimit ) { return new CachingClusteredClient( WAREHOUSE, new TimelineServerView() { @Override public void registerSegmentCallback(Executor exec, SegmentCallback callback) { } @Override public VersionedIntervalTimeline<String, ServerSelector> getTimeline(DataSource dataSource) { return timeline; } @Override public <T> QueryRunner<T> getQueryRunner(DruidServer server) { return serverView.getQueryRunner(server); } @Override public void registerServerCallback(Executor exec, ServerCallback callback) { } }, cache, jsonMapper, backgroundExecutorService, new CacheConfig() { @Override public boolean isPopulateCache() { return true; } @Override public boolean isUseCache() { return true; } @Override public boolean isQueryCacheable(Query query) { <START> return !query.isDescending(); <END> } @Override public int getCacheBulkMergeLimit() { return mergeLimit; } } ); }</code><technical_language>is caching disabled for descending queries ? this correct</technical_language>

Target:
protected CachingClusteredClient makeClient( final ListeningExecutorService backgroundExecutorService, final Cache cache, final int mergeLimit ) { return new CachingClusteredClient( WAREHOUSE, new TimelineServerView() { @Override public void registerSegmentCallback(Executor exec, SegmentCallback callback) { } @Override public VersionedIntervalTimeline<String, ServerSelector> getTimeline(DataSource dataSource) { return timeline; } @Override public <T> QueryRunner<T> getQueryRunner(DruidServer server) { return serverView.getQueryRunner(server); } @Override public void registerServerCallback(Executor exec, ServerCallback callback) { } }, cache, jsonMapper, backgroundExecutorService, new CacheConfig() { @Override public boolean isPopulateCache() { return true; } @Override public boolean isUseCache() { return true; } @Override public boolean isQueryCacheable(Query query) { return true; } @Override public int getCacheBulkMergeLimit() { return mergeLimit; } } ); }
Source:
<code><START> public static boolean isValidMtu(final Integer mtu) { <END> if (mtu == null) { return false; } return MTU_MIN_SIZE <= mtu && mtu <= MTU_MAX_SIZE; }</code><technical_language>Nice @gmueller-ewerk, thanks</technical_language>

Target:
public static boolean isValidMtu(final Integer mtu) { if (isNull(mtu)) { return false; } return (MTU_MIN_SIZE <= mtu) && (mtu <= MTU_MAX_SIZE); }
Source:
<code>private static boolean isTextEqual(DetailAST instanceOfNode, DetailAST notEqualNode) { <START> return getFullText(instanceOfNode).equals(getFullText(notEqualNode)); <END> }</code><technical_language>instanceOfNode != null && isNullTest(notEqualNode) remove conditions other methods</technical_language>

Target:
private static boolean isTextEqual(DetailAST instanceOfNode, DetailAST notEqualNode) { return instanceOfNode != null && isNullTest(notEqualNode) && getFullText(instanceOfNode).equals(getFullText(notEqualNode)); }
Source:
<code><START> public void requestSpecialDays(final DlmsDeviceMessageMetadata messageMetadata, <END> final SpecialDaysRequest specialDaysRequest) throws OsgpException, ProtocolAdapterException { LnClientConnection conn = null; try { final SpecialDaysRequestData specialDaysRequestData = specialDaysRequest.getSpecialDaysRequestData(); LOGGER.info("******************************************************"); LOGGER.info("********** Set Special Days: 0-0:11.0.0.255 **********"); LOGGER.info("******************************************************"); final List<SpecialDay> specialDays = specialDaysRequestData.getSpecialDays(); for (final SpecialDay specialDay : specialDays) { LOGGER.info("Date :{}, dayId : ", specialDay.getSpecialDayDate(), specialDay.getDayId()); } LOGGER.info("******************************************************"); final DlmsDevice device = this.domainHelperService.findDlmsDevice(messageMetadata); conn = this.dlmsConnectionFactory.getConnection(device); final AccessResultCode accessResultCode = this.setSpecialDaysCommandExecutor.execute(conn, device, specialDays); if (!AccessResultCode.SUCCESS.equals(accessResultCode)) { throw new ProtocolAdapterException("Set special days reported result is: " + accessResultCode); } } finally { if (conn != null) { conn.close(); } } }</code><technical_language>![MAJOR](<LINK_1> Refactor this method throw checked exception instead of: com.alliander.osgp.shared.exceptionhandling.OsgpException, org.osgp.adapter.protocol.dlms.exceptions.ProtocolAdapterException [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
public void requestSpecialDays(final DlmsDeviceMessageMetadata messageMetadata, final SpecialDaysRequest specialDaysRequest) throws OsgpException, ProtocolAdapterException { LnClientConnection conn = null; try { final SpecialDaysRequestData specialDaysRequestData = specialDaysRequest.getSpecialDaysRequestData(); LOGGER.info(VISUAL_SEPARATOR); LOGGER.info("********** Set Special Days: 0-0:11.0.0.255 **********"); LOGGER.info(VISUAL_SEPARATOR); final List<SpecialDay> specialDays = specialDaysRequestData.getSpecialDays(); for (final SpecialDay specialDay : specialDays) { LOGGER.info("Date :{}, dayId : ", specialDay.getSpecialDayDate(), specialDay.getDayId()); } LOGGER.info(VISUAL_SEPARATOR); final DlmsDevice device = this.domainHelperService.findDlmsDevice(messageMetadata); conn = this.dlmsConnectionFactory.getConnection(device); final AccessResultCode accessResultCode = this.setSpecialDaysCommandExecutor.execute(conn, device, specialDays); if (!AccessResultCode.SUCCESS.equals(accessResultCode)) { throw new ProtocolAdapterException("Set special days reported result is: " + accessResultCode); } } finally { if (conn != null) { conn.close(); } } }
Source:
<code>public void reconnect(final long hostId) throws CloudRuntimeException, AgentUnavailableException { Boolean result = propagateAgentEvent(hostId, Event.ShutdownRequested); if (result == null) { super.reconnect(hostId); <START> <END> } else { if (!result) { throw new CloudRuntimeException("Failed to propagating agent change request event:" + Event.ShutdownRequested + " to host:" + hostId); } } }</code><technical_language>Instead of adding else block if nested, simply a return; statement here</technical_language>

Target:
public void reconnect(final long hostId) throws CloudRuntimeException, AgentUnavailableException { Boolean result = propagateAgentEvent(hostId, Event.ShutdownRequested); if (result == null) { super.reconnect(hostId); return; } if (!result) { throw new CloudRuntimeException("Failed to propagate agent change request event:" + Event.ShutdownRequested + " to host:" + hostId); } }
Source:
<code>public void testUnmarshallTopLevelEmptyEventProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateErrorEventCatching emptyTopEvent = getCatchingIntermediateNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_NO_OUTGOING_EDGE); assertGeneralSet(emptyTopEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); <START> assertErrorEventExecutionSet(emptyTopEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, ""); <END> assertDataIOSet(emptyTopEvent.getDataIOSet(), EMPTY_VALUE); }</code><technical_language>suggestion assertErrorEventExecutionSet(emptyTopEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, EMPTY_VALUE);</technical_language>

Target:
public void testUnmarshallTopLevelEmptyEventProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateErrorEventCatching emptyTopEvent = getCatchingIntermediateNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_NO_OUTGOING_EDGE); assertGeneralSet(emptyTopEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertErrorEventExecutionSet(emptyTopEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, EMPTY_VALUE); assertDataIOSet(emptyTopEvent.getDataIOSet(), EMPTY_VALUE); }
Source:
<code>public Optional<ApplicationContainerContextFactory<ApplicationContainerContext>> getApplicationContainerContextFactory() { <START> return Optional.ofNullable( <END> (ApplicationContainerContextFactory<ApplicationContainerContext>) this.applicationContainerContextFactory); }</code><technical_language>store Optional instead? Prevents accidental NPEs if this class. Is 'noinspection unchecked' annotation</technical_language>

Target:
public Optional<ApplicationContainerContextFactory<ApplicationContainerContext>> getApplicationContainerContextFactory() { @SuppressWarnings("unchecked") Optional<ApplicationContainerContextFactory<ApplicationContainerContext>> factoryOptional = (Optional) this.applicationContainerContextFactoryOptional; return factoryOptional; }
Source:
<code>private static <T> T loadFile(InputStream labelIn, TypeBase type) { try (InputStream in = labelIn) { return new ObjectMapper().readValue(in, type); } catch (Exception e) { <START> e.printStackTrace(); <END> throw new RuntimeException("Error during initialization!", e); } }</code><technical_language>hm, in theory this necessary. call stack, stack trace printed at: <LINK_0> , logging level set >debug</technical_language>

Target:
private static <T> T loadFile(InputStream labelIn, TypeBase type) { try (InputStream in = labelIn) { return new ObjectMapper().readValue(in, type); } catch (Exception e) { throw new RuntimeException("Error during initialization!", e); } }
Source:
<code>MixpanelAPI(Context context, Future<SharedPreferences> referrerPreferences, String token) { mContext = context; mToken = token; mPeople = new PeopleImpl(); mMessages = getAnalyticsMessages(); mConfig = getConfig(); mPersistentIdentity = getPersistentIdentity(context, referrerPreferences, token); mUpdatesListener = new UpdatesListener(); mDecideUpdates = null; final String peopleId = mPersistentIdentity.getPeopleDistinctId(); if (null != peopleId) { mDecideUpdates = constructDecideUpdates(token, peopleId, mUpdatesListener); } registerMixpanelActivityLifecycleCallbacks(); if (null != mDecideUpdates) { mMessages.installDecideCheck(mDecideUpdates); } <START> <END> try { Class<?> clazz = Class.forName("android.support.v4.content.LocalBroadcastManager"); Method methodGetInstance = clazz.getMethod("getInstance", Context.class); Method methodRegisterReceiver = clazz.getMethod("registerReceiver", BroadcastReceiver.class, IntentFilter.class); Object localBroadcastManager = methodGetInstance.invoke(null, context); final MixpanelAPI instance = this; methodRegisterReceiver.invoke(localBroadcastManager, new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { JSONObject properties = new JSONObject(); Bundle args = intent.getBundleExtra("event_args"); if (args != null) { for (String key : args.keySet()) { try { properties.put(key, args.get(key)); } catch (JSONException e) { Log.d(LOGTAG, "failed to add key \"" + key + "\" to properties for tracking bolts event", e); } } } instance.track("$" + intent.getStringExtra("event_name"), properties); } }, new IntentFilter("com.parse.bolts.measurement_event")); } catch (Exception e) { Log.d(LOGTAG, "App Links tracking will not be enabled due to this exception.", e); } }</code><technical_language>great get this out of main flow of constructor- for readability testing- a private method</technical_language>

Target:
MixpanelAPI(Context context, Future<SharedPreferences> referrerPreferences, String token) { mContext = context; mToken = token; mPeople = new PeopleImpl(); mMessages = getAnalyticsMessages(); mConfig = getConfig(); mPersistentIdentity = getPersistentIdentity(context, referrerPreferences, token); mUpdatesListener = new UpdatesListener(); mDecideUpdates = null; final String peopleId = mPersistentIdentity.getPeopleDistinctId(); if (null != peopleId) { mDecideUpdates = constructDecideUpdates(token, peopleId, mUpdatesListener); } registerMixpanelActivityLifecycleCallbacks(); if (null != mDecideUpdates) { mMessages.installDecideCheck(mDecideUpdates); } }
Source:
<code>public PathEntity(final Path path, final ContentType contentType, final String contentEncoding) { super(contentType, contentEncoding); <START> this.path = Args.notNull(path, "File"); <END> }</code><technical_language>"path"</technical_language>

Target:
public PathEntity(final Path path, final ContentType contentType, final String contentEncoding) { super(contentType, contentEncoding); this.path = Args.notNull(path, "Path"); }
Source:
<code>public static EnumerableSort create(RelNode child, RelCollation collation, RexNode offset, RexNode fetch) { final RelOptCluster cluster = child.getCluster(); final RelTraitSet traitSet = cluster.traitSetOf(EnumerableConvention.INSTANCE) .replace(collation); return new EnumerableSort(cluster, traitSet, child, <START> (RelCollation) traitSet.getTrait(collation.getTraitDef()), offset, <END> fetch); }</code><technical_language>This is needed</technical_language>

Target:
public static EnumerableSort create(RelNode child, RelCollation collation, RexNode offset, RexNode fetch) { final RelOptCluster cluster = child.getCluster(); final RelTraitSet traitSet = cluster.traitSetOf(EnumerableConvention.INSTANCE) .replace(collation); return new EnumerableSort(cluster, traitSet, child, collation, offset, fetch); }
Source:
<code>public String getAgencyName(@NonNull Resources resources) { switch (getProcessType()) { case 1: return "Debit / Gate"; default: <START> return "Credit / Top Up"; <END> } }</code><technical_language>string resources</technical_language>

Target:
public String getAgencyName(@NonNull Resources resources) { switch (getProcessType()) { case 1: return resources.getString(R.string.kmt_debit_desc); default: return resources.getString(R.string.kmt_credit_desc); } }
Source:
<code><START> public JAXBContext getContext(Class<?> clazz) throws JAXBException { <END> JAXBContext jaxbContext = this.jaxbContexts.get(clazz); if (jaxbContext == null) { jaxbContext = JAXBContext.newInstance(clazz); this.jaxbContexts.putIfAbsent(clazz, jaxbContext); } return jaxbContext; }</code><technical_language>Sorry, changing visibility caching</technical_language>

Target:
private JAXBContext getContext(Class<?> clazz) throws JAXBException { JAXBContext jaxbContext = this.jaxbContexts.get(clazz); if (jaxbContext == null) { jaxbContext = JAXBContext.newInstance(clazz); this.jaxbContexts.putIfAbsent(clazz, jaxbContext); } return jaxbContext; }
Source:
<code>private void generateQRCode() { new AsyncTask<Void, Void, Pair<String, Bitmap>>() { @Override protected Pair<String, Bitmap> doInBackground(Void... voids) { try { String filePath = qrCodeGenerator.generateQRCode(includedKeys); BitmapFactory.Options options = new BitmapFactory.Options(); options.inPreferredConfig = Bitmap.Config.ARGB_8888; Bitmap bitmap = FileUtils.getBitmap(filePath, options); return new Pair<>(filePath, bitmap); } catch (Exception ignored) { } return null; } @Override protected void onPostExecute(Pair<String, Bitmap> qrCode) { qrCodeFilePath.setValue(qrCode.first); qrCodeBitmap.setValue(qrCode.second); boolean serverPasswordSet = !generalSharedPreferences.getString(KEY_PASSWORD, "").isEmpty(); boolean adminPasswordSet = adminSharedPreferences.contains(KEY_ADMIN_PW); if (serverPasswordSet || adminPasswordSet) { if (serverPasswordSet && includedKeys.contains(KEY_PASSWORD) && adminPasswordSet && includedKeys.contains(KEY_ADMIN_PW)) { warning.setValue(R.string.qrcode_with_both_passwords); } else if (serverPasswordSet && includedKeys.contains(KEY_PASSWORD)) { warning.setValue(R.string.qrcode_with_server_password); } else if (adminPasswordSet && includedKeys.contains(KEY_ADMIN_PW)) { warning.setValue(R.string.qrcode_with_admin_password); } else { warning.setValue(R.string.qrcode_without_passwords); } } else { <START> warning.setValue(null); <END> } } }.execute(); }</code><technical_language>this qrcode_without_passwords</technical_language>

Target:
private void generateQRCode() { scheduler.scheduleInBackground( () -> { try { String filePath = qrCodeGenerator.generateQRCode(includedKeys); BitmapFactory.Options options = new BitmapFactory.Options(); options.inPreferredConfig = Bitmap.Config.ARGB_8888; Bitmap bitmap = FileUtils.getBitmap(filePath, options); return new Pair<>(filePath, bitmap); } catch (Exception ignored) { } return null; }, qrCode -> { qrCodeFilePath.setValue(qrCode.first); qrCodeBitmap.setValue(qrCode.second); boolean serverPasswordSet = !generalSharedPreferences.getString(KEY_PASSWORD, "").isEmpty(); boolean adminPasswordSet = adminSharedPreferences.contains(KEY_ADMIN_PW); if (serverPasswordSet || adminPasswordSet) { if (serverPasswordSet && includedKeys.contains(KEY_PASSWORD) && adminPasswordSet && includedKeys.contains(KEY_ADMIN_PW)) { warning.setValue(R.string.qrcode_with_both_passwords); } else if (serverPasswordSet && includedKeys.contains(KEY_PASSWORD)) { warning.setValue(R.string.qrcode_with_server_password); } else if (adminPasswordSet && includedKeys.contains(KEY_ADMIN_PW)) { warning.setValue(R.string.qrcode_with_admin_password); } else { warning.setValue(R.string.qrcode_without_passwords); } } else { warning.setValue(null); } } ); }
Source:
<code>protected int rwAnyNode(IASTNode node, int indirection) { final IASTNode parent = node.getParent(); if (parent instanceof ICPPASTConstructorInitializer) { return rwInCtorInitializer(node, indirection, (ICPPASTConstructorInitializer) parent); <START> } else if (parent instanceof IASTIdExpression) { <END> IASTNode grandparent = parent.getParent(); if (grandparent instanceof ICPPASTArraySubscriptExpression) { return super.rwAnyNode(parent, 1); } else if (grandparent instanceof ICPPASTUnaryExpression && ((CPPASTUnaryExpression) grandparent).getOperator() == IASTUnaryExpression.op_star) { return WRITE; } } return super.rwAnyNode(node, indirection); }</code><technical_language>logic in lines 37-64 is common C C++ moved VariableReadWriteFlags</technical_language>

Target:
protected int rwAnyNode(IASTNode node, int indirection) { final IASTNode parent = node.getParent(); if (parent instanceof ICPPASTConstructorInitializer) { return rwInCtorInitializer(node, indirection, (ICPPASTConstructorInitializer) parent); } return super.rwAnyNode(node, indirection); }