auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private String problemsForSubmittingChanges(List<ChangeData> changes, IdentifiedUser identifiedUser) { for (ChangeData c : changes) { try { ChangeControl changeControl = c.changeControl().forUser( identifiedUser); if (!changeControl.isVisible(dbProvider.get())) { return DEFAULT_BLOCKED_HIDDEN_TOPIC_TOOLTIP; } if (!changeControl.canSubmit()) { return DEFAULT_BLOCKED_TOPIC_TOOLTIP; } checkSubmitRule(c, c.currentPatchSet(), false); } catch (OrmException e) { <START> log.error(String.valueOf(e)); <END> throw new OrmRuntimeException(e); } catch (ResourceConflictException e) { return DEFAULT_BLOCKED_TOPIC_TOOLTIP; } } return null; }</code><technical_language>Log stack trace: log.error("Error checking if change is submittable", e); aside, e.toString() is preferable e null (which is case for a caught exception)</technical_language>

Target:
private String problemsForSubmittingChanges(List<ChangeData> changes, IdentifiedUser identifiedUser) { for (ChangeData c : changes) { try { ChangeControl changeControl = c.changeControl().forUser( identifiedUser); if (!changeControl.isVisible(dbProvider.get())) { return BLOCKED_HIDDEN_TOPIC_TOOLTIP; } if (!changeControl.canSubmit()) { return BLOCKED_TOPIC_TOOLTIP; } checkSubmitRule(c, c.currentPatchSet(), false); } catch (OrmException e) { log.error("Error checking if change is submittable", e); throw new OrmRuntimeException(e); } catch (ResourceConflictException e) { return BLOCKED_TOPIC_TOOLTIP; } } return null; }
Source:
<code>public IdentityHashMap<TableScanNode, Void> visitPlan(PlanNode node, Void context) { <START> IdentityHashMap<TableScanNode, Void> ret = new IdentityHashMap<>(); <END> node.getSources().forEach(source -> ret.putAll(source.accept(this, context))); return ret; }</code><technical_language>Map<TableScanNode, Void> result = new IdentityHashMap<>();</technical_language>

Target:
public Map<TableScanNode, Void> visitPlan(PlanNode node, Void context) { Map<TableScanNode, Void> ret = new IdentityHashMap<>(); node.getSources().forEach(source -> ret.putAll(source.accept(this, context))); return ret; }
Source:
<code>private long calculateSleep(long notifyCount, long numWorkers) { long sleep = notifyCount / numWorkers / 100; if (sleep < MIN_SLEEP_SEC) { return MIN_SLEEP_SEC; } <START> return sleep; <END> }</code><technical_language>want a max also... 5 10 mins</technical_language>

Target:
private long calculateSleep(long notifyCount, long numWorkers) { long sleep = notifyCount / numWorkers / 100; if (sleep < MIN_SLEEP_SEC) { return MIN_SLEEP_SEC; } else if (sleep > MAX_SLEEP_SEC) { return MAX_SLEEP_SEC; } return sleep; }
Source:
<code>private String escapeKey(String key) { String toBeEscaped = SPACE.matcher(key).replaceAll("\\\\ "); toBeEscaped = COMMA.matcher(toBeEscaped).replaceAll("\\\\,"); <START> return EQUAL.matcher(toBeEscaped).replaceAll("\\="); <END> }</code><technical_language>I EQUAL do same</technical_language>

Target:
private String escapeKey(String key) { String toBeEscaped = SPACE.matcher(key).replaceAll("\\\\ "); return COMMA.matcher(toBeEscaped).replaceAll("\\\\,"); }
Source:
<code>public Response send(final Request req, final String home, final String method, final Collection<Map.Entry<String, String>> headers, final InputStream content, final int connect, final int read, final SSLContext context) throws IOException { final SSLContext resolvedContext; <START> if (context == null) { <END> resolvedContext = context(); } else { resolvedContext = context; } return this.origin.send( req, home, method, headers, content, connect, read, resolvedContext ); }</code><technical_language>@joris-lambrechts If start "default" SSLContext in BaseRequest, this null-check</technical_language>

Target:
public Response send(final Request req, final String home, final String method, final Collection<Map.Entry<String, String>> headers, final InputStream content, final int connect, final int read, final SSLContext context) throws IOException { return this.origin.send( req, home, method, headers, content, connect, read, context() ); }
Source:
<code>private JSONObject triggerClauseToJson(TriggerClause clause) throws JSONException { JSONObject ret = new JSONObject(); if (clause instanceof EqualsClauseInTrigger) { EqualsClauseInTrigger eq = (EqualsClauseInTrigger)clause; ret.put("type", "eq"); ret.put("alias", eq.getAlias()); ret.put("field", eq.getField()); <START> ret.put("value", eq.getValue()); <END> }else if (clause instanceof RangeClauseInTrigger) { RangeClauseInTrigger range = (RangeClauseInTrigger)clause; ret.put("type", "range"); ret.put("alias", range.getAlias()); ret.put("field", range.getField()); ret.putOpt("lowerLimit", range.getLowerLimit()); ret.putOpt("upperLimit", range.getUpperLimit()); ret.putOpt("lowerIncluded", range.getLowerIncluded()); ret.putOpt("upperIncluded", range.getUpperIncluded()); } else if(clause instanceof NotEqualsClauseInTrigger) { NotEqualsClauseInTrigger neq = (NotEqualsClauseInTrigger)clause; ret.put("type", "not").put("clause", triggerClauseToJson(neq.getEquals())); } else if (clause instanceof AndClauseInTrigger) { JSONArray clauses = new JSONArray(); for (TriggerClause subClause : ((AndClauseInTrigger)clause).getClauses()) { clauses.put(triggerClauseToJson(subClause)); } ret.put("type", "and").put("clauses", clauses); } else if (clause instanceof OrClauseInTrigger) { JSONArray clauses = new JSONArray(); for (TriggerClause subClause : ((OrClauseInTrigger) clause).getClauses()) { clauses.put(triggerClauseToJson(subClause)); } ret.put("type", "or").put("clauses", clauses); }else{ throw new RuntimeException("not support trigger clause"); } return ret; }</code><technical_language>gson.toJsonTree(src).getAsJsonObject() here</technical_language>

Target:
private JsonObject triggerClauseToJson(TriggerClause clause) { String type; JsonObject ret; if (clause instanceof EqualsClauseInTrigger || clause instanceof RangeClauseInTrigger) { ret = new Gson().toJsonTree(clause).getAsJsonObject(); if (clause instanceof EqualsClauseInTrigger) { type = "eq"; }else { type = "range"; } } else { ret = new JsonObject(); if (clause instanceof NotEqualsClauseInTrigger) { NotEqualsClauseInTrigger neq = (NotEqualsClauseInTrigger) clause; ret.add("clause", triggerClauseToJson(neq.getEquals())); type = "not"; } else if (clause instanceof AndClauseInTrigger) { JsonArray clauses = new JsonArray(); for (TriggerClause subClause : ((AndClauseInTrigger) clause).getClauses()) { clauses.add(triggerClauseToJson(subClause)); } ret.add("clauses", clauses); type = "and"; } else if (clause instanceof OrClauseInTrigger) { JsonArray clauses = new JsonArray(); for (TriggerClause subClause : ((OrClauseInTrigger) clause).getClauses()) { clauses.add(triggerClauseToJson(subClause)); } ret.add("clauses", clauses); type = "or"; } else { throw new RuntimeException("not support trigger clause"); } } ret.addProperty("type", type); return ret; }
Source:
<code>public ViewPage clickApplication(String applicationName) { getDriver().findElementWithoutWaiting(By.xpath( <START> " END> return new ViewPage(); }</code><technical_language>This xpath is duplicated. I put in a static field ease maintenance</technical_language>

Target:
public ViewPage clickApplication(String applicationName) { getDriver().findElementWithoutWaiting(applicationElement(applicationName)).click(); return new ViewPage(); }
Source:
<code>public static Optional<Long> savedAccountQuestion(final Question question, final ImmutableList<AccountQuestionResponses> todayQuestionResponseList) { for (AccountQuestionResponses accountQuestionResponses : todayQuestionResponseList) { if (accountQuestionResponses.questionId.equals(question.id)) { final Long accountQuestionId = accountQuestionResponses.id; <START> return Optional.of(accountQuestionId); <END> } } return Optional.absent(); }</code><technical_language>Optional.of(accountQuestionResponses.id)</technical_language>

Target:
public static Optional<Long> savedAccountQuestion(final Question question, final ImmutableList<AccountQuestionResponses> todayQuestionResponseList) { for (AccountQuestionResponses accountQuestionResponses : todayQuestionResponseList) { if (accountQuestionResponses.questionId.equals(question.id)) { final Long accountQuestionId = accountQuestionResponses.id; return Optional.of(accountQuestionResponses.id); } } return Optional.absent(); }
Source:
<code><START> private void setFixedLengthStreamingMode(HttpURLConnection connection, long length) { <END> try { HttpURLConnection.class.getMethod("setFixedLengthStreamingMode", long.class).invoke(connection, length); } catch (Exception e) { throw new IllegalArgumentException("Cannot transfer 2 GB or larger chunks due to JDK 1.6 limitations." + " Use chunked encoding or multi-part upload, if possible, or use a different http driver." + " For more information: <LINK_0>"); } }</code><technical_language>[minor] static</technical_language>

Target:
private static void setFixedLengthStreamingMode(HttpURLConnection connection, long length) { try { HttpURLConnection.class.getMethod("setFixedLengthStreamingMode", long.class).invoke(connection, length); } catch (Exception e) { throw new IllegalArgumentException("Cannot transfer 2 GB or larger chunks due to JDK 1.6 limitations." + " Use chunked encoding or multi-part upload, if possible, or use a different http driver." + " For more information: <LINK_0>"); } }
Source:
<code>public CompositeCommand combine(CompositeCommand cc) { cc.commands.forEach(commands::add); return this; <START> } <END></code><technical_language>missing</technical_language>

Target:
public CompositeCommand combine(CompositeCommand cc) { commands.addAll(cc.commands); return this; }
Source:
<code>public Kiji retain() { <START> Preconditions.checkState(mRetainCount.incrementAndGet() >= 0, <END> "Cannot retain a closed Kiji."); return this; }</code><technical_language>This shoud "> 1". Also, in error message, include counter value</technical_language>

Target:
public Kiji retain() { Preconditions.checkState(mRetainCount.getAndIncrement() >= 0, String.format( "Cannot retain a closed resource: retain counter is %s.", mRetainCount.get())); return this; }
Source:
<code>public void registerHandler(ITraceEventHandler handler) { int pos = Collections.binarySearch(fHandlers, handler, HANDLER_COMPARATOR); if (pos < 0) { fHandlers.add(-pos - 1, handler); } else { <START> fHandlers.add(handler); <END> } }</code><technical_language>Do need add this is in list</technical_language>

Target:
public void registerHandler(ITraceEventHandler handler) { int pos = Collections.binarySearch(fHandlers, handler, HANDLER_COMPARATOR); if (pos < 0) { fHandlers.add(-pos - 1, handler); } }
Source:
<code>public void deleteAll() { <START> dataService.findAll(GroupMetadata.GROUP, Group.class).forEach(this::delete); <END> }</code><technical_language>This delete groups of findAll pagination works, forEachBatched here: java // LanguageRepositoryDecorator: forEachBatched(entities -> delete(entities.stream()), 1000);</technical_language>

Target:
public void deleteAll() { forEachBatched(entities -> delete(entities.stream()), 1000); }
Source:
<code><START> private long now() { <END> final int mspersec = 1000; final long sinceepoch = new Date().getTime(); final long milliseconds = sinceepoch % mspersec; return sinceepoch - milliseconds; }</code><technical_language>@cvrebert this static, field</technical_language>

Target:
private static long now() { final long sinceepoch = new Date().getTime(); return sinceepoch - (sinceepoch % Tv.THOUSAND); }
Source:
<code>public void updateLastDownload(String taxonomy, Long lastDownload){ <START> SharedPreferences mSettings = OFFApplication.getInstance().getSharedPreferences("prefs", 0); <END> mSettings.edit().putLong("lastDownload" + taxonomy, lastDownload).apply(); Log.i("INFO_URL", "End of import for : " + taxonomy); }</code><technical_language>suggestion SharedPreferences mSettings = OFFApplication.getInstance().getSharedPreferences("prefs", TAXONOMY_NOT_TO_BE_LOADED);</technical_language>

Target:
public void updateLastDownload(String taxonomy, Long lastDownload){ SharedPreferences mSettings = OFFApplication.getInstance().getSharedPreferences("prefs", 0); mSettings.edit().putLong("lastDownload" + taxonomy, lastDownload).apply(); Log.i("INFO_URL", "Set lastDownload of " + taxonomy + " to " + lastDownload); }
Source:
<code>public Response callback() { <START> return Response.serverError().build(); <END> }</code><technical_language>a detailed error message for debugging this is called</technical_language>

Target:
public Response callback() { LOGGER.error( new RuntimeException(), "This endpoint is to be handled by the pac4j filter to redirect users, request should never reach here." ); return Response.serverError().build(); }
Source:
<code>protected void buildVmGraphicsDevices() { boolean graphicsOverriden = vm.isRunOnce() && vm.getGraphicsInfos() != null && !vm.getGraphicsInfos().isEmpty(); Map<GraphicsType, GraphicsInfo> infos = vm.getGraphicsInfos(); Map<String, Object> specParamsFromVm = null; if (infos != null) { specParamsFromVm = new HashMap(); addVmGraphicsOptions(infos, specParamsFromVm, <START> false); <END> } if (graphicsOverriden) { buildVmGraphicsDevicesOverriden(infos, specParamsFromVm); } else { buildVmGraphicsDevicesFromDb(specParamsFromVm); } }</code><technical_language>I dropped right</technical_language>

Target:
protected void buildVmGraphicsDevices() { boolean graphicsOverriden = vm.isRunOnce() && vm.getGraphicsInfos() != null && !vm.getGraphicsInfos().isEmpty(); Map<GraphicsType, GraphicsInfo> infos = vm.getGraphicsInfos(); Map<String, Object> specParamsFromVm = null; if (infos != null) { specParamsFromVm = new HashMap(); addVmGraphicsOptions(infos, specParamsFromVm); } if (graphicsOverriden) { buildVmGraphicsDevicesOverriden(infos, specParamsFromVm); } else { buildVmGraphicsDevicesFromDb(specParamsFromVm); } }
Source:
<code>public void onEventMainThread(ReportBackListTask task) { if(task.position == position) { totalPages = task.totalPages; currentPage = task.page; List<ReportBack> reportBacks = task.reportBacks; <START> if(reportBacks != null) <END> { adapter.addAll(reportBacks); } else { Toast.makeText(getActivity(), "report back data failed", Toast.LENGTH_SHORT).show(); } } }</code><technical_language>is this null? if add a FIXME add a crashlytics. Dont if show user fail message</technical_language>

Target:
public void onEventMainThread(ReportBackListTask task) { if(task.position == position) { totalPages = task.totalPages; currentPage = task.page; List<ReportBack> reportBacks = task.reportBacks; adapter.addAll(reportBacks); } }
Source:
<code>public List<String> build() { ImmutableList.Builder<String> args = new ImmutableList.Builder<String>(); Preconditions.checkArgument(!inputs.isEmpty(), "At least one input must be specified"); Preconditions.checkArgument(!outputs.isEmpty(), "At least one output must be specified"); args.add(override ? "-y" : "-n"); args.add("-v", this.verbosity.toString()); if (user_agent != null) { args.add("-user-agent", user_agent); } if (startOffset != null) { args.add("-ss", FFmpegUtils.millisecondsToString(startOffset)); } if (format != null) { args.add("-f", format); } if (read_at_native_frame_rate) { args.add("-re"); } if (progress != null) { args.add("-progress", progress.toString()); } args.addAll(extra_args); for (String input : inputs) { args.add("-i", input); } if (pass > 0) { args.add("-pass", Integer.toString(pass)); if (pass_prefix != null) { <START> args.add("-passlogfile").add(pass_directory + pass_prefix); <END> } } for (FFmpegOutputBuilder output : this.outputs) { args.addAll(output.build(pass)); } return args.build(); }</code><technical_language>I need chain adds, add takes multiple arguments</technical_language>

Target:
public List<String> build() { ImmutableList.Builder<String> args = new ImmutableList.Builder<String>(); Preconditions.checkArgument(!inputs.isEmpty(), "At least one input must be specified"); Preconditions.checkArgument(!outputs.isEmpty(), "At least one output must be specified"); args.add(override ? "-y" : "-n"); args.add("-v", this.verbosity.toString()); if (user_agent != null) { args.add("-user-agent", user_agent); } if (startOffset != null) { args.add("-ss", FFmpegUtils.millisecondsToString(startOffset)); } if (format != null) { args.add("-f", format); } if (read_at_native_frame_rate) { args.add("-re"); } if (progress != null) { args.add("-progress", progress.toString()); } args.addAll(extra_args); for (String input : inputs) { args.add("-i", input); } if (pass > 0) { args.add("-pass", Integer.toString(pass)); if (pass_prefix != null) { args.add("-passlogfile", pass_directory + pass_prefix); } } for (FFmpegOutputBuilder output : this.outputs) { args.addAll(output.build(pass)); } return args.build(); }
Source:
<code><START> public MaterialValueManager.Value getMaterialValues() { <END> return ((GlowServer) Bukkit.getServer()).getMaterialValueManager().getValue(getType()); }</code><technical_language>Pluralized methods return collections renamed return type</technical_language>

Target:
public MaterialValueManager.ValueCollection getMaterialValues() { return ((GlowServer) Bukkit.getServer()).getMaterialValueManager().getValues(getType()); }
Source:
<code>public void start() { keyspace = config.getCacheKeyspace(); maxResultSetSize = config.getNfcMaxResultSetSize(); session = cassandraClient.getSession(); session.execute( getSchemaCreateKeyspace( keyspace ) ); session.execute( getSchemaCreateTable( keyspace ) ); preparedExistQuery = <START> session.prepare( "SELECT count(*) FROM " + keyspace + ".nfc WHERE storekey=? and path=?;" ); <END> preparedCountByStore = session.prepare( "SELECT count(*) FROM " + keyspace + ".nfc WHERE storekey=?;" ); preparedQueryByStore = session.prepare( "SELECT * FROM " + keyspace + ".nfc WHERE storekey=?;" ); preparedDeleteByStore = session.prepare( "DELETE FROM " + keyspace + ".nfc WHERE storekey=?;" ); preparedDelete = session.prepare( "DELETE FROM " + keyspace + ".nfc WHERE storekey=? AND path=?;" ); preparedInsert = session.prepare( "INSERT INTO " + keyspace + ".nfc (storekey,path,creation,expiration) VALUES (?,?,?,?) USING TTL ?;" ); }</code><technical_language>Here, do a count(1) select 1 similar, return faster find a match? actual count appears irrelevant long is one. performance all</technical_language>

Target:
public void start() { inMemoryCache = cacheProducer.getCache( "nfc-in-memory-cache" ); keyspace = config.getCacheKeyspace(); maxResultSetSize = config.getNfcMaxResultSetSize(); session = cassandraClient.getSession(); session.execute( getSchemaCreateKeyspace( keyspace ) ); session.execute( getSchemaCreateTable( keyspace ) ); preparedExistQuery = session.prepare( "SELECT expiration FROM " + keyspace + ".nfc WHERE storekey=? and path=?;" ); preparedCountByStore = session.prepare( "SELECT count(*) FROM " + keyspace + ".nfc WHERE storekey=?;" ); preparedQueryByStore = session.prepare( "SELECT * FROM " + keyspace + ".nfc WHERE storekey=?;" ); preparedDeleteByStore = session.prepare( "DELETE FROM " + keyspace + ".nfc WHERE storekey=?;" ); preparedDelete = session.prepare( "DELETE FROM " + keyspace + ".nfc WHERE storekey=? AND path=?;" ); preparedInsert = session.prepare( "INSERT INTO " + keyspace + ".nfc (storekey,path,creation,expiration) VALUES (?,?,?,?) USING TTL ?;" ); }
Source:
<code>public void run() { startTime = System.currentTimeMillis(); try { <START> TajoConf conf = tajoClient.getConf(); <END> if (conf.getBoolVar(TajoConf.ConfVars.TAJO_MASTER_HA_ENABLE)) { if (!HAServiceUtil.isMasterAlive(conf.get(TajoConf.ConfVars.TAJO_MASTER_CLIENT_RPC_ADDRESS .varname), conf)) { tajoClient.close(); tajoClient = new TajoClient(new TajoConf()); } } response = tajoClient.executeQuery(query); if (response == null) { LOG.error("Internal Error: SubmissionResponse is NULL"); error = new Exception("Internal Error: SubmissionResponse is NULL"); } else if (response.getResultCode() == ClientProtos.ResultCode.OK) { if (response.getIsForwarded()) { queryId = new QueryId(response.getQueryId()); getQueryResult(queryId); } else { if (!response.hasTableDesc() && !response.hasResultSet()) { } else { getSimpleQueryResult(response); } progress.set(100); } } } catch (Exception e) { LOG.error(e.getMessage(), e); error = e; } finally { running.set(false); finishTime = System.currentTimeMillis(); if (queryId != null) { tajoClient.closeQuery(queryId); } } }</code><technical_language>This is TajoAdmin.checkMasterStatus(). If move checkMasterStatus() other util classes, please update this code, too</technical_language>

Target:
public void run() { startTime = System.currentTimeMillis(); try { TajoConf conf = tajoClient.getConf(); tajoClient = TajoHAClientUtil.getTajoClient(conf, tajoClient); response = tajoClient.executeQuery(query); if (response == null) { LOG.error("Internal Error: SubmissionResponse is NULL"); error = new Exception("Internal Error: SubmissionResponse is NULL"); } else if (response.getResultCode() == ClientProtos.ResultCode.OK) { if (response.getIsForwarded()) { queryId = new QueryId(response.getQueryId()); getQueryResult(queryId); } else { if (!response.hasTableDesc() && !response.hasResultSet()) { } else { getSimpleQueryResult(response); } progress.set(100); } } } catch (Exception e) { LOG.error(e.getMessage(), e); error = e; } finally { running.set(false); finishTime = System.currentTimeMillis(); if (queryId != null) { tajoClient.closeQuery(queryId); } } }
Source:
<code>public void handleNetworkException(VDSNetworkException ex) { boolean saveToDb = true; <START> if(isInServerRebootTimeout()) { <END> return; } if (cachedVds.getStatus() != VDSStatus.Down) { if (isHostInGracePeriod(false)) { if (cachedVds.getStatus() != VDSStatus.Connecting && cachedVds.getStatus() != VDSStatus.PreparingForMaintenance && cachedVds.getStatus() != VDSStatus.NonResponsive) { setStatus(VDSStatus.Connecting, cachedVds); logChangeStatusToConnecting(); } else { saveToDb = false; } unrespondedAttempts.incrementAndGet(); } else { if (cachedVds.getStatus() == VDSStatus.Maintenance) { saveToDb = false; } else { List<VmDynamic> vmsRunningOnVds = vmDynamicDao.getAllRunningForVds(getVdsId()); if (cachedVds.getStatus() != VDSStatus.NonResponsive) { setStatus(VDSStatus.NonResponsive, cachedVds); moveVmsToUnknown(vmsRunningOnVds); int skippedIterationsBeforeFirstTry = Config.<Integer>getValue(ConfigValues.NumberVdsRefreshesBeforeTryToStartUnknownVms); autoRestartUnknownVmsIteration = 0 - skippedIterationsBeforeFirstTry; logHostFailToRespond(ex); resourceManager.getEventListener().vdsNotResponding(cachedVds); } else { saveToDb = false; } restartVmsWithLeaseIfNeeded(vmsRunningOnVds); } } } if (saveToDb) { updateDynamicData(cachedVds.getDynamicData()); updateStatisticsData(cachedVds.getStatisticsData()); } }</code><technical_language>Please reformat add log ignoring exception: if (isInServerRebootTimeout()) { log.warn("Ignoring communication error for host '{}', reboot timeout passed: {}", cachedVds.getHostName(), ex.getMessage()); log.debug("Exception", ex); return; }</technical_language>

Target:
public void handleNetworkException(VDSNetworkException ex) { boolean saveToDb = true; if (isInServerRebootTimeout()) { log.warn("Ignoring communication error for host '{}', because reboot timeout hasn't passed: {}", cachedVds.getHostName(), ex.getMessage()); log.debug("Exception", ex); return; } if (cachedVds.getStatus() != VDSStatus.Down) { if (isHostInGracePeriod(false)) { if (cachedVds.getStatus() != VDSStatus.Connecting && cachedVds.getStatus() != VDSStatus.PreparingForMaintenance && cachedVds.getStatus() != VDSStatus.NonResponsive) { setStatus(VDSStatus.Connecting, cachedVds); logChangeStatusToConnecting(); } else { saveToDb = false; } unrespondedAttempts.incrementAndGet(); } else { if (cachedVds.getStatus() == VDSStatus.Maintenance) { saveToDb = false; } else { List<VmDynamic> vmsRunningOnVds = vmDynamicDao.getAllRunningForVds(getVdsId()); if (cachedVds.getStatus() != VDSStatus.NonResponsive) { setStatus(VDSStatus.NonResponsive, cachedVds); moveVmsToUnknown(vmsRunningOnVds); int skippedIterationsBeforeFirstTry = Config.<Integer>getValue(ConfigValues.NumberVdsRefreshesBeforeTryToStartUnknownVms); autoRestartUnknownVmsIteration = 0 - skippedIterationsBeforeFirstTry; logHostFailToRespond(ex); resourceManager.getEventListener().vdsNotResponding(cachedVds); } else { saveToDb = false; } restartVmsWithLeaseIfNeeded(vmsRunningOnVds); } } } if (saveToDb) { updateDynamicData(cachedVds.getDynamicData()); updateStatisticsData(cachedVds.getStatisticsData()); } }
Source:
<code>public VmsCpuUsageExample() { Log.printFormattedLine("Starting %s ...", getClass().getSimpleName()); CloudSim simulation = new CloudSim(); @SuppressWarnings("unused") Datacenter datacenter0 = createDatacenter(simulation); broker = new DatacenterBrokerSimple(simulation); vmlist = new ArrayList<>(NUMBER_OF_VMS); cloudletList = new ArrayList<>(NUMBER_OF_VMS); int mips = 1000; int pesNumber = 1; for (int i = 1; i <= NUMBER_OF_VMS; i++) { Vm vm = createVm(pesNumber, mips * i, i - 1); vmlist.add(vm); Cloudlet cloudlet = createCloudlet(pesNumber, i-1); cloudletList.add(cloudlet); cloudlet.setVm(vm); } broker.submitVmList(vmlist); broker.submitCloudletList(cloudletList); final double finishTime = simulation.start(); <START> List<Cloudlet> newList = broker.getCloudletFinishedList(); <END> new CloudletsTableBuilder(broker.getCloudletFinishedList()).build(); showCpuUtilizationForAllVms(finishTime); Log.printFormattedLine("%s finished!", getClass().getSimpleName()); }</code><technical_language>Please remove this line (newList)</technical_language>

Target:
public VmsCpuUsageExample() { Log.printFormattedLine("Starting %s ...", getClass().getSimpleName()); CloudSim simulation = new CloudSim(); @SuppressWarnings("unused") Datacenter datacenter0 = createDatacenter(simulation); broker = new DatacenterBrokerSimple(simulation); vmlist = new ArrayList<>(NUMBER_OF_VMS); cloudletList = new ArrayList<>(NUMBER_OF_VMS); int mips = 1000; int pesNumber = 1; for (int i = 1; i <= NUMBER_OF_VMS; i++) { Vm vm = createVm(pesNumber, mips * i, i - 1); vmlist.add(vm); Cloudlet cloudlet = createCloudlet(pesNumber, i-1); cloudletList.add(cloudlet); cloudlet.setVm(vm); } broker.submitVmList(vmlist); broker.submitCloudletList(cloudletList); final double finishTime = simulation.start(); new CloudletsTableBuilder(broker.getCloudletFinishedList()).build(); showCpuUtilizationForAllVms(finishTime); Log.printFormattedLine("%s finished!", getClass().getSimpleName()); }
Source:
<code>public ComplexMetricExtractor getExtractor() { <START> throw new UnsupportedOperationException("How can this be?"); <END> }</code><technical_language>A message "Bloom filter aggregator is query-time only" more constructive</technical_language>

Target:
public ComplexMetricExtractor getExtractor() { throw new UnsupportedOperationException("Bloom filter aggregators are query-time only"); }
Source:
<code>protected void declareNamespaces(XQueryContext context) throws XPathException { Map.Entry<String, String> entry; for (Map.Entry<String, String> stringStringEntry : namespaces.entrySet()) { entry = stringStringEntry; context.declareNamespace( entry.getKey(), entry.getValue()); <START> } <END> }</code><technical_language>I this needs tidying up. entry is redundant, stringStringEntry renamed entry</technical_language>

Target:
protected void declareNamespaces(XQueryContext context) throws XPathException { for (Map.Entry<String, String> entry : namespaces.entrySet()) { context.declareNamespace(entry.getKey(), entry.getValue()); } }
Source:
<code>public synchronized Request getNextRequestBlock() { if (request == null) { throw new IllegalStateException("no request body"); } int num = getCurrentNum(); int szx = getCurrentSzx(); Request block = new Request(request.getCode()); block.setType(request.getType()); block.setDestinationContext(request.getDestinationContext()); block.setOptions(new OptionSet(request.getOptions())); block.addMessageObservers(request.getMessageObservers()); <START> block.addMessageObserver(new FailureForwardingMessageObserver(request)); <END> if (num == 0) { block.getOptions().setSize1(request.getPayloadSize()); } if (request.isUnintendedPayload()) { block.setUnintendedPayload(); } int currentSize = getCurrentSize(); int from = num * currentSize; int to = Math.min((num + 1) * currentSize, request.getPayloadSize()); int length = to - from; byte[] blockPayload = new byte[length]; System.arraycopy(request.getPayload(), from, blockPayload, 0, length); block.setPayload(blockPayload); boolean m = (to < request.getPayloadSize()); block.getOptions().setBlock1(szx, m, num); setComplete(!m); return block; }</code><technical_language>This send event ? for : block.addMessageObservers(request.getMessageObservers()); for : block.addMessageObserver(new FailureForwardingMessageObserver(request));</technical_language>

Target:
public synchronized Request getNextRequestBlock() { if (request == null) { throw new IllegalStateException("no request body"); } int num = getCurrentNum(); int szx = getCurrentSzx(); Request block = new Request(request.getCode()); block.setType(request.getType()); block.setDestinationContext(request.getDestinationContext()); block.setOptions(new OptionSet(request.getOptions())); block.addMessageObservers(request.getMessageObservers()); if (num == 0) { block.getOptions().setSize1(request.getPayloadSize()); } if (request.isUnintendedPayload()) { block.setUnintendedPayload(); } int currentSize = getCurrentSize(); int from = num * currentSize; int to = Math.min((num + 1) * currentSize, request.getPayloadSize()); int length = to - from; byte[] blockPayload = new byte[length]; System.arraycopy(request.getPayload(), from, blockPayload, 0, length); block.setPayload(blockPayload); boolean m = (to < request.getPayloadSize()); block.getOptions().setBlock1(szx, m, num); setComplete(!m); return block; }
Source:
<code>public void createSchema() throws Exception { final Connection db = getConnection(); db.setAutoCommit(false); try (final Statement statement = db.createStatement()) { String autoIncrement = ""; if (driver.contains("mysql")) { autoIncrement = "AUTO_INCREMENT"; } statement.executeUpdate( "CREATE TABLE " + this.table + " (id INTEGER PRIMARY KEY " + autoIncrement + ", created VARCHAR(255)" + ", name VARCHAR(255)" + ", data TEXT" + ")"); statement.executeUpdate( <START> "CREATE UNIQUE INDEX name_index ON " + this.table + "(name)"); <END> db.commit(); } catch (Exception e) { db.rollback(); throw e; } finally { db.setAutoCommit(true); } }</code><technical_language>matter, a space (name) ? this.table + " (name)"</technical_language>

Target:
public void createSchema() throws Exception { beginTransaction(); try (final Statement statement = getConnection().createStatement()) { String autoIncrement = ""; if (driver.contains("mysql")) { autoIncrement = "AUTO_INCREMENT"; } statement.executeUpdate( "CREATE TABLE " + this.table + " (id INTEGER PRIMARY KEY " + autoIncrement + ", created VARCHAR(255)" + ", name VARCHAR(255)" + ", data TEXT" + ")"); statement.executeUpdate( "CREATE UNIQUE INDEX name_index ON " + this.table + " (name)"); commitTransaction(); } catch (Exception e) { rollbackTransaction(); throw e; } }
Source:
<code>public ProvisioningConfigurationParcelable toStableParcelable() { final ProvisioningConfigurationParcelable p = new ProvisioningConfigurationParcelable(); p.enableIPv4 = mEnableIPv4; p.enableIPv6 = mEnableIPv6; p.usingMultinetworkPolicyTracker = mUsingMultinetworkPolicyTracker; p.usingIpReachabilityMonitor = mUsingIpReachabilityMonitor; p.requestedPreDhcpActionMs = mRequestedPreDhcpActionMs; p.initialConfig = mInitialConfig == null ? null : mInitialConfig.toStableParcelable(); p.staticIpConfig = IpConfigurationParcelableUtil.toStableParcelable(mStaticIpConfig); p.apfCapabilities = IpConfigurationParcelableUtil.toStableParcelable(mApfCapabilities); p.provisioningTimeoutMs = mProvisioningTimeoutMs; p.ipv6AddrGenMode = mIPv6AddrGenMode; p.network = <START> clone(mNetwork); <END> p.displayName = mDisplayName; return p; }</code><technical_language>this clone()? Network objects immutable. Is this dealing a subclass is parcelable, OneAddressPerFamilyNetwork</technical_language>

Target:
public ProvisioningConfigurationParcelable toStableParcelable() { final ProvisioningConfigurationParcelable p = new ProvisioningConfigurationParcelable(); p.enableIPv4 = mEnableIPv4; p.enableIPv6 = mEnableIPv6; p.usingMultinetworkPolicyTracker = mUsingMultinetworkPolicyTracker; p.usingIpReachabilityMonitor = mUsingIpReachabilityMonitor; p.requestedPreDhcpActionMs = mRequestedPreDhcpActionMs; p.initialConfig = mInitialConfig == null ? null : mInitialConfig.toStableParcelable(); p.staticIpConfig = IpConfigurationParcelableUtil.toStableParcelable(mStaticIpConfig); p.apfCapabilities = IpConfigurationParcelableUtil.toStableParcelable(mApfCapabilities); p.provisioningTimeoutMs = mProvisioningTimeoutMs; p.ipv6AddrGenMode = mIPv6AddrGenMode; p.network = mNetwork; p.displayName = mDisplayName; return p; }
Source:
<code>"exceptions") public void queueListeningTestCase() throws InterruptedException, JMSException, ClientConnectorException { <START> LOGGER.info("JMS Transport Sender is sending a message to the queue " + <END> JMSTestConstants.QUEUE_NAME_1); JMSClientConnector sender = new JMSClientConnector(); jmsServer.receiveMessagesFromQueue(); sender.send(carbonMessage, null, properties); sender.send(carbonMessage, null, properties); }</code><technical_language>a single naming pattern. If "logger" is common naming convention stick it</technical_language>

Target:
public void queueListeningTestCase() throws InterruptedException, JMSException, ClientConnectorException { logger.info("JMS Transport Sender is sending a message to the queue " + JMSTestConstants.QUEUE_NAME_1); JMSClientConnector sender = new JMSClientConnector(); jmsServer.receiveMessagesFromQueue(); sender.send(carbonMessage, null, properties); sender.send(carbonMessage, null, properties); }
Source:
<code><START> protected void encode(final ChannelHandlerContext context, final RntbdContextRequest message, final ByteBuf out) throws IllegalStateException { <END> final RntbdContextRequest request = message; out.markWriterIndex(); try { request.encode(out); } catch (final IllegalStateException error) { out.resetWriterIndex(); throw error; } Logger.debug("{}: ENCODE COMPLETE: request={}", context.channel(), request); }</code><technical_language>@David-Noble-at-work</technical_language>

Target:
protected void encode(final ChannelHandlerContext context, final RntbdContextRequest message, final ByteBuf out) throws IllegalStateException { out.markWriterIndex(); try { message.encode(out); } catch (final IllegalStateException error) { out.resetWriterIndex(); throw error; } Logger.debug("{}: ENCODE COMPLETE: request={}", context.channel(), message); }
Source:
<code>public void onRemove() { ArrayList<VdcActionParametersBase> pb = new ArrayList<VdcActionParametersBase>(); for (Object a : sourceListModel.getSelectedItems()) { Network network = (Network) a; <START> if (network.isExternal()) { <END> pb.add(new RemoveNetworkParameters(network.getId(), getForce().getIsSelected())); } else { pb.add(new RemoveNetworkParameters(network.getId())); } } Frontend.getInstance().runMultipleAction(VdcActionType.RemoveNetwork, pb); sourceListModel.setConfirmWindow(null); }</code><technical_language>belong in this patch next one?..</technical_language>

Target:
public void onRemove() { ArrayList<VdcActionParametersBase> pb = new ArrayList<VdcActionParametersBase>(); for (Object a : sourceListModel.getSelectedItems()) { Network network = (Network) a; pb.add(new RemoveNetworkParameters(network.getId())); } Frontend.getInstance().runMultipleAction(VdcActionType.RemoveNetwork, pb); sourceListModel.setConfirmWindow(null); }
Source:
<code>protected Iterable<IAnalysisModule> getDependentAnalyses() { ITmfTrace trace = getTrace(); if (trace == null) { throw new IllegalStateException(); } IAnalysisModule module = trace.getAnalysisModule(TidAnalysisModule.ID); if (module == null) { return Collections.emptySet(); } IAnalysisModule <START> module2 = <END> trace.getAnalysisModule(KernelAnalysisModule.ID); if (module2 == null) { return ImmutableSet.of(module); } return ImmutableSet.of(module, module2); }</code><technical_language>rename more interesting</technical_language>

Target:
protected Iterable<IAnalysisModule> getDependentAnalyses() { ITmfTrace trace = getTrace(); if (trace == null) { throw new IllegalStateException(); } IAnalysisModule tidAnalysis = trace.getAnalysisModule(TidAnalysisModule.ID); if (tidAnalysis == null) { return Collections.emptySet(); } IAnalysisModule kernelAnalysis = trace.getAnalysisModule(KernelAnalysisModule.ID); if (kernelAnalysis == null) { return ImmutableSet.of(tidAnalysis); } return ImmutableSet.of(tidAnalysis, kernelAnalysis); }
Source:
<code>private String retrieveVcfHead(String vcfFilePath) throws IOException { String vcfHead = ""; Scanner scanner = new Scanner(new GZIPInputStream(new FileInputStream(vcfFilePath))); while (scanner.hasNextLine()) { String line = scanner.nextLine(); if (line.startsWith("#")) { vcfHead += line + "\n"; <START> } <END> } scanner.close(); return vcfHead; }</code><technical_language>this reading file? I need } else { break; }</technical_language>

Target:
private String retrieveVcfHead(String vcfFilePath) throws IOException { String vcfHead = ""; Scanner scanner = new Scanner(new GZIPInputStream(new FileInputStream(vcfFilePath))); while (scanner.hasNextLine()) { String line = scanner.nextLine(); if (line.startsWith("#")) { vcfHead += line + "\n"; } else { break; } } scanner.close(); return vcfHead; }
Source:
<code>public List<AggregatorFactory> getRequiredColumns() { return fields.stream() .map( input -> new CardinalityAggregatorFactory( input.getOutputName(), null, Collections.singletonList(input), byRow, round ) <START> ).collect(Collectors.toList()); <END> }</code><technical_language>Line breaked )</technical_language>

Target:
public List<AggregatorFactory> getRequiredColumns() { return fields.stream() .map( field -> new CardinalityAggregatorFactory( field.getOutputName(), null, Collections.singletonList(field), byRow, round ) ) .collect(Collectors.toList()); }
Source:
<code>public void testRegisterProcessorAndGetIdShouldFailForDuplicateProcessorRegistration() { final String testHostName = "localhost"; final String testProcessId = "testProcessorId"; ProcessorData processorData1 = new ProcessorData(testHostName, testProcessId); zkUtils.registerProcessorAndGetId(processorData1); ZkUtils zkUtils1 = getZkUtils(); zkUtils1.connect(); ProcessorData duplicateProcessorData = new ProcessorData(testHostName, testProcessId); <START> expectedException.expect(IllegalStateException.class); <END> zkUtils1.registerProcessorAndGetId(duplicateProcessorData); }</code><technical_language>I this ExpectedException idiom :) useful</technical_language>

Target:
public void testRegisterProcessorAndGetIdShouldFailForDuplicateProcessorRegistration() { final String testHostName = "localhost"; final String testProcessId = "testProcessorId"; ProcessorData processorData1 = new ProcessorData(testHostName, testProcessId); zkUtils.registerProcessorAndGetId(processorData1); ZkUtils zkUtils1 = getZkUtils(); zkUtils1.connect(); ProcessorData duplicateProcessorData = new ProcessorData(testHostName, testProcessId); expectedException.expect(SamzaException.class); zkUtils1.registerProcessorAndGetId(duplicateProcessorData); }
Source:
<code>private Response getSearchResponse(Account account, Map<String, String> queryParams) { String url = directDebitConnectorUriGenerator.directDebitPaymentsURI(account, queryParams); Response connectorResponse = client .target(url) .request() .header(HttpHeaders.ACCEPT, APPLICATION_JSON) .get(); <START> LOGGER.info("response from dd connector for payment search: {}", connectorResponse); <END> if (connectorResponse.getStatus() == SC_OK) { return processResponse(connectorResponse); } throw new SearchPaymentsException(connectorResponse); }</code><technical_language>logging this is useful</technical_language>

Target:
private Response getSearchResponse(Account account, Map<String, String> queryParams) { String url = directDebitConnectorUriGenerator.directDebitPaymentsURI(account, queryParams); Response connectorResponse = client .target(url) .request() .header(HttpHeaders.ACCEPT, APPLICATION_JSON) .get(); if (connectorResponse.getStatus() == SC_OK) { return processResponse(connectorResponse); } throw new SearchPaymentsException(connectorResponse); }
Source:
<code>public void onCreate() { super.onCreate(); if (!isPreBetaRelease()) { initExceptionHandling(); } refWatcher = Prefs.isMemoryLeakTestEnabled() ? LeakCanary.install(this) : RefWatcher.DISABLED; AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); bus = new Bus(); ViewAnimations.init(getResources()); currentTheme = unmarshalCurrentTheme(); appLanguageState = new AppLanguageState(this); funnelManager = new FunnelManager(this); sessionFunnel = new SessionFunnel(this); editTokenStorage = new EditTokenStorage(); database = new Database(this); enableWebViewDebugging(); Api.setConnectionFactory(new OkHttpConnectionFactory()); ImagePipelineConfig config = OkHttpImagePipelineConfigFactory .newBuilder(this, OkHttpConnectionFactory.getClient()) .build(); Fresco.initialize(this, config); zeroHandler = new WikipediaZeroHandler(this); pageCache = new PageCache(this); AccountUtil.createAccountForLoggedInUser(); UserOptionContentResolver.registerAppSyncObserver(this); registerReadingListPageObserver(); <START> startService(new <END> Intent(this, NotificationPollService.class)); }</code><technical_language>prevent unnecessary network requests, this run user is logged in</technical_language>

Target:
public void onCreate() { super.onCreate(); if (!isPreBetaRelease()) { initExceptionHandling(); } refWatcher = Prefs.isMemoryLeakTestEnabled() ? LeakCanary.install(this) : RefWatcher.DISABLED; AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); bus = new Bus(); ViewAnimations.init(getResources()); currentTheme = unmarshalCurrentTheme(); appLanguageState = new AppLanguageState(this); funnelManager = new FunnelManager(this); sessionFunnel = new SessionFunnel(this); editTokenStorage = new EditTokenStorage(); database = new Database(this); enableWebViewDebugging(); Api.setConnectionFactory(new OkHttpConnectionFactory()); ImagePipelineConfig config = OkHttpImagePipelineConfigFactory .newBuilder(this, OkHttpConnectionFactory.getClient()) .build(); Fresco.initialize(this, config); zeroHandler = new WikipediaZeroHandler(this); pageCache = new PageCache(this); AccountUtil.createAccountForLoggedInUser(); UserOptionContentResolver.registerAppSyncObserver(this); registerReadingListPageObserver(); NotificationPollService.start(this); }
Source:
<code>protected void setContent(Event event, Position position, BoundRequestBuilder requestBuilder) { <START> if (!additionalParams.equals("")) { <END> Map<String, List<String>> paramsToAdd = splitParams(additionalParams, "="); for (Entry<String, List<String>> en : paramsToAdd.entrySet()) { for (String value : en.getValue()) { requestBuilder.addBodyPart(new StringPart(en.getKey(), value, null, StandardCharsets.UTF_8)); } } } requestBuilder.addBodyPart(new StringPart(payloadParamName, prepareJsonPayload(event, position), "application/json", StandardCharsets.UTF_8)); }</code><technical_language>Please isEmpty fix other place find this</technical_language>

Target:
protected void setContent(Event event, Position position, BoundRequestBuilder requestBuilder) { if (additionalParams != null && !additionalParams.isEmpty()) { Map<String, List<String>> paramsToAdd = splitIntoKeyValues(additionalParams, "="); for (Entry<String, List<String>> param : paramsToAdd.entrySet()) { for (String singleParamValue : param.getValue()) { requestBuilder.addBodyPart(new StringPart(param.getKey(), singleParamValue, null, StandardCharsets.UTF_8)); } } } requestBuilder.addBodyPart(new StringPart(payloadParamName, prepareJsonPayload(event, position), "application/json", StandardCharsets.UTF_8)); }
Source:
<code>public CacheImpl(String name) { this.name = name; <START> this.encoderClass = IdentityEncoder.class; <END> this.wrapperClass = ByteArrayWrapper.class; }</code><technical_language>This class some leftover imports</technical_language>

Target:
public CacheImpl(String name) { this.name = name; this.keyEncoderClass = IdentityEncoder.class; this.valueEncoderClass = IdentityEncoder.class; this.keyWrapperClass = ByteArrayWrapper.class; this.valueWrapperClass = ByteArrayWrapper.class; }
Source:
<code>public void removeUnsupportedAttributes(DisplayerSettings displayerSettings) { <START> String componentId = displayerSettings.getComponentId(); <END> Map<String,String> settingsMap = displayerSettings.getSettingsFlatMap(); for (String setting : new HashSet<>(settingsMap.keySet())) { if (!supportedEditorAttrStrings.contains(setting) && componentId != null && !setting.startsWith(componentId)) { displayerSettings.removeDisplayerSetting(setting); } } }</code><technical_language>for loop unnecessarily evaluated in case componentId == null. want return in a case</technical_language>

Target:
public void removeUnsupportedAttributes(DisplayerSettings displayerSettings) { String componentId = displayerSettings.getComponentId(); if (componentId != null) { Map<String, String> settingsMap = displayerSettings.getSettingsFlatMap(); for (String setting : new HashSet<>(settingsMap.keySet())) { if (!supportedEditorAttrStrings.contains(setting) && !setting.startsWith(componentId)) { displayerSettings.removeDisplayerSetting(setting); } } } }
Source:
<code>public void visitToken(DetailAST ast) { <START> if (isInEnumClassOrRecordBlock(ast)) { <END> final DetailAST modifiers = ast.findFirstToken(TokenTypes.MODIFIERS); switch (ast.getType()) { case TokenTypes.ENUM_DEF: if (violateImpliedStaticOnNestedEnum && modifiers.findFirstToken(TokenTypes.LITERAL_STATIC) == null) { log(ast, MSG_KEY, STATIC_KEYWORD); } break; case TokenTypes.INTERFACE_DEF: if (violateImpliedStaticOnNestedInterface && modifiers.findFirstToken(TokenTypes.LITERAL_STATIC) == null) { log(ast, MSG_KEY, STATIC_KEYWORD); } break; case TokenTypes.RECORD_DEF: if (violateImpliedStaticOnNestedRecord && modifiers.findFirstToken(TokenTypes.LITERAL_STATIC) == null) { log(ast, MSG_KEY, STATIC_KEYWORD); } break; default: throw new IllegalStateException(ast.toString()); } } }</code><technical_language>isInTypeBlock ? isInEnumOrClassOrRecordBlock</technical_language>

Target:
public void visitToken(DetailAST ast) { if (isInTypeBlock(ast)) { final DetailAST modifiers = ast.findFirstToken(TokenTypes.MODIFIERS); switch (ast.getType()) { case TokenTypes.ENUM_DEF: if (violateImpliedStaticOnNestedEnum && modifiers.findFirstToken(TokenTypes.LITERAL_STATIC) == null) { log(ast, MSG_KEY, STATIC_KEYWORD); } break; case TokenTypes.INTERFACE_DEF: if (violateImpliedStaticOnNestedInterface && modifiers.findFirstToken(TokenTypes.LITERAL_STATIC) == null) { log(ast, MSG_KEY, STATIC_KEYWORD); } break; case TokenTypes.RECORD_DEF: if (violateImpliedStaticOnNestedRecord && modifiers.findFirstToken(TokenTypes.LITERAL_STATIC) == null) { log(ast, MSG_KEY, STATIC_KEYWORD); } break; default: throw new IllegalStateException(ast.toString()); } } }
Source:
<code>public void visitNode(AstNode node) { if (node.is(PythonGrammar.NOT_TEST)) { <START> checkAtom(node.getFirstChild().getNextSibling()); <END> } else { node.getChildren(PythonGrammar.ATOM).forEach(this::checkAtom); } }</code><technical_language>checkAtom(node.getLastChild())</technical_language>

Target:
public void visitNode(AstNode node) { List<AstNode> children = node.getChildren(); boolean hasParentheses = children.size() == 3 && children.get(0).is(PythonPunctuator.LPARENTHESIS); if (hasParentheses) { AstNode child1 = children.get(1); if(child1.getChildren(PythonGrammar.TEST).size() == 1 && child1.getFirstChild(PythonPunctuator.COMMA) == null && !child1.hasDirectChildren(PythonGrammar.COMP_FOR)) { AstNode test = child1.getFirstChild(PythonGrammar.TEST); if (!test.hasDirectChildren(PythonKeyword.IF)) { AstNode testChild0 = test.getFirstChild(); if (testChild0.is(PythonGrammar.ATOM) && testChild0.getFirstChild().is(PythonPunctuator.LPARENTHESIS)) { addIssue(children.get(0), MESSAGE).secondary(children.get(2), null); } } } } }