auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public BigDecimal getBigDecimal(String key) { String value = getRawString(key); if (value == null) return notFound(); try { <START> return BigDecimal.valueOf(Long.valueOf(value)); <END> } catch (NumberFormatException e) { return parseError(key, value, e); } }</code><technical_language>getBigInteger, strange force a conversion Long first</technical_language>

Target:
public BigDecimal getBigDecimal(String key) { String value = interpolate(key); if (value == null) return notFound(); try { return new BigDecimal(value); } catch (NumberFormatException e) { return parseError(key, value, e); } }
Source:
<code>protected void actionPerformed( final GuiButton btn ) throws IOException { super.actionPerformed( btn ); if( btn instanceof GuiImgButton ) { final boolean backwards = Mouse.isButtonDown( 1 ); final GuiImgButton iBtn = (GuiImgButton) btn; if( iBtn.getSetting() != Settings.ACTIONS ) { final Enum cv = iBtn.getCurrentValue(); final Enum next = Platform.rotateEnum( cv, backwards, iBtn.getSetting().getPossibleValues() ); if( btn == this.terminalStyleBox ) { AEConfig.instance().getConfigManager().putSetting( iBtn.getSetting(), next ); } else if( btn == this.searchBoxSettings ) { AEConfig.instance().getConfigManager().putSetting( iBtn.getSetting(), next ); } else { <START> try <END> { NetworkHandler.instance().sendToServer( new PacketValueConfig( iBtn.getSetting().name(), next.name() ) ); } catch( final IOException e ) { AELog.debug( e ); } } iBtn.set( next ); if( next.getClass() == SearchBoxMode.class || next.getClass() == TerminalStyle.class ) { this.reinitalize(); } } } }</code><technical_language>![CRITICAL](<LINK_0> Refactor this code nest more 3 if/for/while/switch/try statements. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
protected void actionPerformed( final GuiButton btn ) throws IOException { super.actionPerformed( btn ); if( btn instanceof GuiImgButton ) { final boolean backwards = Mouse.isButtonDown( 1 ); final GuiImgButton iBtn = (GuiImgButton) btn; if( iBtn.getSetting() != Settings.ACTIONS ) { final Enum cv = iBtn.getCurrentValue(); final Enum next = Platform.rotateEnum( cv, backwards, iBtn.getSetting().getPossibleValues() ); if( btn == this.terminalStyleBox || btn == this.searchBoxSettings ) { AEConfig.instance().getConfigManager().putSetting( iBtn.getSetting(), next ); } else { try { NetworkHandler.instance().sendToServer( new PacketValueConfig( iBtn.getSetting().name(), next.name() ) ); } catch( final IOException e ) { AELog.debug( e ); } } iBtn.set( next ); if( next.getClass() == SearchBoxMode.class || next.getClass() == TerminalStyle.class ) { this.reinitalize(); } } } }
Source:
<code><START> public String formatDateToNumber(long timestamp) { <END> return dateInNumberFormat.format(new Date(timestamp)); }</code><technical_language>too</technical_language>

Target:
public String formatDateToNumber(long timestamp) { return shortDateFormat.format(new Date(timestamp)); }
Source:
<code>public void switchOnAdminMode() { <START> info("Switch ON admin mode"); <END> if (!isAdminModeOn()) { info("Admin mode is off. Switching it ON"); getHeader().switchingAdminMode(); } info("Admin mode is switched ON"); }</code><technical_language>Switching admin mode..</technical_language>

Target:
public void switchOnAdminMode() { info("Switching ON admin mode..."); if (!isAdminModeOn()) { info("Admin mode is off. Switching it ON"); getHeader().switchingAdminMode(); } else { info("Admin mode was switched on already, doing nothing"); } info("Admin mode is switched ON"); }
Source:
<code>public String toString() { <START> return String.format(Locale.ENGLISH, "{ResponseInfo:%s,status:%d, reqId:%s, xlog:%s, host:%s, duration:%d, error:%s}", <END> super.toString(), statusCode, reqId, xlog, host, duration, error); }</code><technical_language>duraion = (System.currentTimeMillis() - reqStartTime)/1000.0</technical_language>

Target:
public String toString() { return String.format(Locale.ENGLISH, "{ResponseInfo:%s,status:%d, reqId:%s, xlog:%s, host:%s, duration:%f s, error:%s}", super.toString(), statusCode, reqId, xlog, host, duration, error); }
Source:
<code>protected boolean proceedVdsStats() { boolean returnValue = true; try { runVdsCommand(VDSCommandType.GetStats, new VdsIdAndVdsVDSCommandParametersBase(getVds())); List<Guid> problematicDomainsIds = IrsBrokerCommand.fetchDomainsReportedAsProblematic(getVds().getStoragePoolId(), getVds().getDomains()); for (Guid domainId : problematicDomainsIds) { StorageDomainStatic domainInfo = getStorageDomainStaticDAO().get(domainId); <START> log.errorFormat("Storage Domain {0} of pool {1} is in problem in host {1}", <END> domainInfo != null ? domainInfo.getStorageName() : domainId, getStoragePool().getName(), getVds().getName()); if (domainInfo == null || domainInfo.getStorageDomainType().isDataDomain()) { returnValue = false; } } } catch (VdcBLLException e) { log.errorFormat("Could not get Host statistics for Host {0}, Error is {1}", getVds().getName(), e); returnValue = false; } return returnValue; }</code><technical_language>s/in host{1}/in host{2}/</technical_language>

Target:
protected boolean proceedVdsStats() { boolean returnValue = true; try { runVdsCommand(VDSCommandType.GetStats, new VdsIdAndVdsVDSCommandParametersBase(getVds())); List<Guid> problematicDomainsIds = IrsBrokerCommand.fetchDomainsReportedAsProblematic(getVds().getStoragePoolId(), getVds().getDomains()); for (Guid domainId : problematicDomainsIds) { StorageDomainStatic domainInfo = getStorageDomainStaticDAO().get(domainId); log.errorFormat("Storage Domain {0} of pool {1} is in problem in host {2}", domainInfo != null ? domainInfo.getStorageName() : domainId, getStoragePool().getName(), getVds().getName()); if (domainInfo == null || domainInfo.getStorageDomainType().isDataDomain()) { returnValue = false; } } } catch (VdcBLLException e) { log.errorFormat("Could not get Host statistics for Host {0}, Error is {1}", getVds().getName(), e); returnValue = false; } return returnValue; }
Source:
<code>private void addSubmodule(String url, String name) throws SAXException { SubmoduleAddCommand add = new SubmoduleAddCommand(repo); try { <START> Repository sub = add.setPath(name).setURI(url).call(); <END> } catch (GitAPIException e) { throw new SAXException(e); } }</code><technical_language>unused local variable</technical_language>

Target:
private void addSubmodule(String url, String name) throws SAXException { SubmoduleAddCommand add = new SubmoduleAddCommand(repo); if (monitor != null) add.setProgressMonitor(monitor); try { add.setPath(name).setURI(url).call(); } catch (GitAPIException e) { throw new SAXException(e); } }
Source:
<code><START> public static int add(int a, int b) { <END> return a + b; }</code><technical_language>Please methods in Calculator non-static rework examples accordingly. I fine create calculator _SUT_ in a field (in affected test classes) follows. java private final Calculator calculator = new Calculator();</technical_language>

Target:
public int add(int a, int b) { return a + b; }
Source:
<code>public void changeApiToken() throws IOException { user.checkPermission(Jenkins.ADMINISTER); <START> LOGGER.log(Level.WARNING, "Deprecated usage of changeApiToken"); <END> _changeApiToken(); tokenStore.generateTokenFromLegacy(apiToken); user.save(); }</code><technical_language>is point of logging? succeed quietly, fail, acc. security configuration</technical_language>

Target:
public void changeApiToken() throws IOException { user.checkPermission(Jenkins.ADMINISTER); LOGGER.log(Level.FINE, "Deprecated usage of changeApiToken"); ApiTokenStore.HashedToken existingLegacyToken = tokenStore.getLegacyToken(); _changeApiToken(); tokenStore.regenerateTokenFromLegacy(apiToken); if(existingLegacyToken != null){ tokenStats.removeId(existingLegacyToken.getUuid()); } user.save(); }
Source:
<code>public List<Programme> next() { ImmutableList.Builder<Programme> programmesBuilder = ImmutableList.builder(); int programmeCount = 0; <START> while (programmeCount < 30 && hasNext()) { <END> programmesBuilder.add(currentProgrammes.next()); programmeCount++; } return programmesBuilder.build(); }</code><technical_language>I 30 I hard-code 30, I meant page size</technical_language>

Target:
public List<Programme> next() { try { return ImmutableList.copyOf(currentResponse.getNext().getResults()); } catch (GlycerinException e) { throw Throwables.propagate(e); } }
Source:
<code>public void testBccSettingsSerialization() throws Exception { BccSettings settings = new BccSettings(); settings.setEnable(false); <START> String jsonTwo = mapper.writeValueAsString(settings); <END> System.out.println(jsonTwo); Assert.assertEquals(jsonTwo, "{\"enable\":false}"); }</code><technical_language>jsonOne. This is assuming numeral part of variable name is expected number of fields in serialized version. If case, elaborate naming convention</technical_language>

Target:
public void testBccSettingsSerialization() throws Exception { BccSettings settings = new BccSettings(); settings.setEnable(false); String json = mapper.writeValueAsString(settings); System.out.println(json); Assert.assertEquals(json, "{\"enable\":false}"); }
Source:
<code>private Schema getSchema(@Nonnull final SQLiteConnection sqliteConnection, @Nonnull final RelationKey relationKey) throws CatalogException { try { SQLiteStatement statement = sqliteConnection <START> .prepare("SELECT col_name,col_type FROM relation_schema JOIN relations USING (user_name,program_name,relation_name) WHERE user_name=? AND program_name=? AND relation_name=? ORDER BY col_index ASC"); <END> statement.bind(1, relationKey.getUserName()); statement.bind(2, relationKey.getProgramName()); statement.bind(3, relationKey.getRelationName()); ImmutableList.Builder<String> names = ImmutableList.builder(); ImmutableList.Builder<Type> types = ImmutableList.builder(); if (!statement.step()) { return null; } do { names.add(statement.columnString(0)); types.add(Type.valueOf(statement.columnString(1))); } while (statement.step()); statement.dispose(); return new Schema(types, names); } catch (final SQLiteException e) { throw new CatalogException(e); } }</code><technical_language>joining relations table filtering tombstone attribute</technical_language>

Target:
private Schema getSchema(@Nonnull final SQLiteConnection sqliteConnection, @Nonnull final RelationKey relationKey) throws CatalogException { try { SQLiteStatement statement = sqliteConnection .prepare("SELECT col_name,col_type FROM relation_schema WHERE user_name=? AND program_name=? AND relation_name=? ORDER BY col_index ASC"); statement.bind(1, relationKey.getUserName()); statement.bind(2, relationKey.getProgramName()); statement.bind(3, relationKey.getRelationName()); ImmutableList.Builder<String> names = ImmutableList.builder(); ImmutableList.Builder<Type> types = ImmutableList.builder(); if (!statement.step()) { return null; } do { names.add(statement.columnString(0)); types.add(Type.valueOf(statement.columnString(1))); } while (statement.step()); statement.dispose(); return new Schema(types, names); } catch (final SQLiteException e) { throw new CatalogException(e); } }
Source:
<code>public Object instantiate(Class actualType, JSONObject json) { if (Modifier.isAbstract(actualType.getModifiers())) { LOGGER.log(Level.FINE, "ignoring abstract {0} {1}", new Object[] {actualType, json}); return oldInterceptor.instantiate(actualType, json); } if (!Describable.class.isAssignableFrom(actualType)) { LOGGER.log(Level.FINE, "ignoring non-Describable {0} {1}", new Object[] {actualType, json}); return oldInterceptor.instantiate(actualType, json); } if (Boolean.TRUE.equals(processed.put(json, true))) { LOGGER.log(Level.FINE, "already processed {0} {1}", new Object[] {actualType, json}); return oldInterceptor.instantiate(actualType, json); } LOGGER.log(Level.FINE, "switching to newInstance {0} {1}", new Object[] {actualType, json}); try { return Jenkins.getActiveInstance().getDescriptor(actualType).newInstance(Stapler.getCurrentRequest(), json); } catch (Exception x) { <START> LOGGER.log(Level.WARNING, "falling back to default instantiation " + actualType + " " + json, x); <END> return oldInterceptor.instantiate(actualType, json); } }</code><technical_language>catches IllegalStateException getActiveInstance(). OK</technical_language>

Target:
public Object instantiate(Class actualType, JSONObject json) { if (isApplicable(actualType, json)) { LOGGER.log(Level.FINE, "switching to newInstance {0} {1}", new Object[] {actualType.getName(), json}); try { return Jenkins.getActiveInstance().getDescriptor(actualType).newInstance(Stapler.getCurrentRequest(), json); } catch (Exception x) { LOGGER.log(Level.WARNING, "falling back to default instantiation " + actualType.getName() + " " + json, x); } } return oldInterceptor.instantiate(actualType, json); }
Source:
<code><START> default Set<Long> getNonTransferredAddresses(LogUnitClient client, ImmutableList<Long> addressesToTransfer) { <END> if (addressesToTransfer.isEmpty()) { return new HashSet<>(); } long start = addressesToTransfer.get(0); long end = addressesToTransfer.get(addressesToTransfer.size() - 1); Set<Long> knownAddresses = CFUtils.getUninterruptibly(client.requestKnownAddresses(start, end)).getKnownAddresses(); return Sets.difference(new HashSet<>(addressesToTransfer), knownAddresses); }</code><technical_language>Is addressesToTransfer sorted</technical_language>

Target:
default Set<Long> getNonTransferredAddresses(LogUnitClient client, ImmutableList<Long> addressesToTransfer) throws TimeoutException { if (addressesToTransfer.isEmpty()) { return new HashSet<>(); } long start = addressesToTransfer.get(0); long end = addressesToTransfer.get(addressesToTransfer.size() - 1); if (start > end) { throw new IllegalArgumentException("Entries are not in sequential order."); } Set<Long> knownAddresses = CFUtils.getUninterruptibly(client.requestKnownAddresses(start, end), TimeoutException.class, NetworkException.class).getKnownAddresses(); return Sets.difference(new HashSet<>(addressesToTransfer), knownAddresses); }
Source:
<code>public void registerStateMachineWithManager(ByteBuffer requestedInitialState) throws InterruptedException { setRequestedInitialState(requestedInitialState); ListenableFuture<Boolean> initComplete = registerStateMachine(this, false); if (initComplete == null) { return; } try { <START> Boolean initSuccussful = initComplete.get(); <END> assert(initSuccussful); } catch (ExecutionException e) { Throwables.throwIfUnchecked(e); throw new RuntimeException(e.getCause()); } }</code><technical_language>Typo 'succussful" - rename</technical_language>

Target:
public void registerStateMachineWithManager(ByteBuffer requestedInitialState) throws InterruptedException { setRequestedInitialState(requestedInitialState); ListenableFuture<Boolean> initComplete = registerStateMachine(this, false); if (initComplete == null) { return; } try { Boolean initSuccessful = initComplete.get(); assert(initSuccessful); } catch (ExecutionException e) { Throwables.throwIfUnchecked(e); throw new RuntimeException(e.getCause()); } }
Source:
<code>public Snippet createSnippet(String title, String fileName, String content, Visibility visibility, String description) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm() .withParam("title", title) .withParam("file_name", fileName) <START> .withParam("content", content) <END> .withParam("visibility", visibility) .withParam("description", description); Response response = post(Response.Status.CREATED, formData, "snippets"); return (response.readEntity(Snippet.class)); }</code><technical_language>title, file_name, content required parameters</technical_language>

Target:
public Snippet createSnippet(String title, String fileName, String content, Visibility visibility, String description) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm() .withParam("title", title, true) .withParam("file_name", fileName, true) .withParam("content", content, true) .withParam("visibility", visibility) .withParam("description", description); Response response = post(Response.Status.CREATED, formData, "snippets"); return (response.readEntity(Snippet.class)); }
Source:
<code>public TObject maxKey(String key, AccessToken creds, TransactionToken transaction, String environment) throws TException { checkAccess(creds, transaction); AtomicSupport store = getStore(transaction, environment); AtomicOperation atomic = null; TObject max = null; while (atomic == null || !atomic.commit()) { atomic = store.startAtomicOperation(); try { Map<TObject, Set<Long>> data = atomic.browse(key); <START> int size = data.size(); <END> int c = 0; for (Entry<TObject, Set<Long>> entry : data.entrySet()) { if(c == size - 1) { TObject tobject = entry.getKey(); max = tobject; break; } c++; } } catch (AtomicStateException e) { atomic = null; max = null; } } return max; }</code><technical_language>Iterables.getLast</technical_language>

Target:
public TObject maxKey(String key, AccessToken creds, TransactionToken transaction, String environment) throws TException { checkAccess(creds, transaction); AtomicSupport store = getStore(transaction, environment); AtomicOperation atomic = null; TObject max = null; while (atomic == null || !atomic.commit()) { atomic = store.startAtomicOperation(); try { Map<TObject, Set<Long>> data = atomic.browse(key); max = Iterables.getLast(data.keySet(), max); } catch (AtomicStateException e) { atomic = null; max = null; } } return max; }
Source:
<code>private String supportedVersionsToString(Set<Version> versionSet) { if (versionSet == null) { return null; } StringBuilder sb = new StringBuilder(); for (Version version : versionSet) { <START> sb.append(version.toString()); <END> } if (sb.length() > 0) { sb.deleteCharAt(sb.length() - 1); } return sb.toString(); }</code><technical_language>is separator versions. mind replacing this : for (int i = 0 ; i < versionSet.size() ; i++) { sb.append(version.toString()); if (i < versionSet.size() - 1) { sb.append(','); } } return sb.toString(); In addition, this common around, pulled new class, VersionUtils ? (the class added next time is a need for this)</technical_language>

Target:
private String supportedVersionsToString(Set<Version> versionSet) { if (versionSet == null) { return null; } StringBuilder sb = new StringBuilder(); boolean first = true; for (Version version : versionSet) { if (first) { first = false; } else { sb.append(","); } sb.append(version.toString()); } return sb.toString(); }
Source:
<code>private static Map<String, String> normalizeHeaderValues(final Map<String, String> headerValues) { <START> final HashMap<String, String> headers = new HashMap<>(); <END> for (final Map.Entry<String, String> entry : headerValues.entrySet()) { headers.put(entry.getKey().toLowerCase(), entry.getValue()); } return headers; }</code><technical_language>Typically Map left hand side HashMap</technical_language>

Target:
private static Map<String, String> normalizeHeaderValues(final Map<String, String> headerValues) { final Map<String, String> headers = new HashMap<>(); for (final Map.Entry<String, String> entry : headerValues.entrySet()) { headers.put(entry.getKey().toLowerCase(), entry.getValue()); } return headers; }
Source:
<code>public CloudConfig(String cluster, boolean enabled, CloudProvider cloudProvider, String cloudID, List<String> cloudInfoSource, String cloudProcessorName) { super(cluster); _record.setBooleanField(CloudConfigProperty.CLOUD_ENABLED.name(), enabled); _record.setSimpleField(CloudConfigProperty.CLOUD_PROVIDER.name(), cloudProvider.name()); _record.setSimpleField(CloudConfigProperty.CLOUD_ID.name(), cloudID); <START> _record.setSimpleField(CloudConfigProperty.CLOUD_INFO_PROCESSOR_NAME.name(), cloudProcessorName); _record.setListField(CloudConfigProperty.CLOUD_INFO_SOURCE.name(), cloudInfoSource); <END> }</code><technical_language>Do a check here. add entries cloudProvider is CUSTOM</technical_language>

Target:
public CloudConfig(String cluster, boolean enabled, CloudProvider cloudProvider, String cloudID, List<String> cloudInfoSource, String cloudProcessorName) { super(cluster); _record.setBooleanField(CloudConfigProperty.CLOUD_ENABLED.name(), enabled); _record.setSimpleField(CloudConfigProperty.CLOUD_PROVIDER.name(), cloudProvider.name()); _record.setSimpleField(CloudConfigProperty.CLOUD_ID.name(), cloudID); if (cloudProvider.equals(CloudProvider.CUSTOMIZED)) { _record .setSimpleField(CloudConfigProperty.CLOUD_INFO_PROCESSOR_NAME.name(), cloudProcessorName); _record.setListField(CloudConfigProperty.CLOUD_INFO_SOURCE.name(), cloudInfoSource); } }
Source:
<code>public List<String> retrieveAllArtifacts(String label) throws ArtifactSynchronizerException { List<String> gatewayRuntimeArtifactsArray = new ArrayList<>(); try { String baseURL = APIConstants.HTTPS_PROTOCOL_URL_PREFIX + System.getProperty(APIConstants.KEYMANAGER_HOSTNAME) + ":" + System.getProperty(APIConstants.KEYMANAGER_PORT) + APIConstants.INTERNAL_WEB_APP_EP; <START> String endcodedgatewayLabel= URLEncoder.encode(label, APIConstants.DigestAuthConstants.CHARSET); <END> String path = APIConstants.GatewayArtifactSynchronizer.GATEAY_SYNAPSE_ARTIFACTS + "?gatewayLabel="+ endcodedgatewayLabel; String endpoint = baseURL + path; HttpResponse httpResponse = invokeService(endpoint); String responseString = EntityUtils.toString(httpResponse.getEntity(), APIConstants.DigestAuthConstants.CHARSET); JSONObject artifactObject = new JSONObject(responseString); JSONArray jArray = (JSONArray)artifactObject.get("list"); if (jArray != null) { for (int i = 0; i < jArray.length(); i++) { gatewayRuntimeArtifactsArray.add(jArray.get(i).toString()); } } return gatewayRuntimeArtifactsArray; } catch (IOException e) { String msg = "Error while executing the http client " ; log.error(msg, e); throw new ArtifactSynchronizerException(msg, e); } }</code><technical_language>formatting issue</technical_language>

Target:
public List<String> retrieveAllArtifacts(String label) throws ArtifactSynchronizerException { List<String> gatewayRuntimeArtifactsArray = new ArrayList<>(); CloseableHttpResponse httpResponse = null; try { String endcodedgatewayLabel= URLEncoder.encode(label, APIConstants.DigestAuthConstants.CHARSET); String path = APIConstants.GatewayArtifactSynchronizer.GATEAY_SYNAPSE_ARTIFACTS + "?gatewayLabel="+ endcodedgatewayLabel; String endpoint = baseURL + path; httpResponse = invokeService(endpoint); String responseString; if (httpResponse.getEntity() != null ) { responseString = EntityUtils.toString(httpResponse.getEntity(), APIConstants.DigestAuthConstants.CHARSET); httpResponse.close(); } else { throw new ArtifactSynchronizerException("HTTP response is empty"); } JSONObject artifactObject = new JSONObject(responseString); JSONArray jArray = (JSONArray)artifactObject.get("list"); if (jArray != null) { for (int i = 0; i < jArray.length(); i++) { gatewayRuntimeArtifactsArray.add(jArray.get(i).toString()); } } return gatewayRuntimeArtifactsArray; } catch (IOException e) { String msg = "Error while executing the http client"; log.error(msg, e); throw new ArtifactSynchronizerException(msg, e); } }
Source:
<code>public PrologEnvironment newPrologEnvironment() { PrologEnvironment env = envFactory.create(getClass().getClassLoader()); ObjectStream ruleStream = getPrologRules(); if (ruleStream != null) { try { PushbackReader in = new PushbackReader(new InputStreamReader(ruleStream, Charset.forName("UTF-8")), Prolog.PUSHBACK_SIZE); JavaObjectTerm streamObject = new JavaObjectTerm(in); if (!env.execute(Prolog.BUILTIN, "consult_stream", <START> SymbolTerm.makeSymbol("submitrules"), streamObject)) { <END> throw new CompileException("Cannot consult" + streamObject.toString()); } } catch (CompileException err) { log.error("Cannot consult provided submit_rules.pl", err); } finally { try { ruleStream.close(); } catch (IOException err) { log.error("Close of ruleStream failed", err); } } } else { VariableTerm var = new VariableTerm(); StructureTerm head = new StructureTerm("submit_rule", var); StructureTerm defaultRule= new StructureTerm(":", SymbolTerm.makeSymbol("com.google.gerrit.rules.common"), new StructureTerm("default_submit", var)); StructureTerm clause = new StructureTerm(":-", head, defaultRule); env.execute(Prolog.BUILTIN, "assertz", clause); } return env; }</code><technical_language>Lets call this "rules.pl" instead of "submitrules". matches name of file user creates, name put warning/error log statements</technical_language>

Target:
public PrologEnvironment newPrologEnvironment() throws CompileException, IOException{ PrologEnvironment env = envFactory.create(getClass().getClassLoader()); ObjectStream ruleStream; ruleStream = getPrologRules(); if (ruleStream != null) { try { PushbackReader in = new PushbackReader(new InputStreamReader(ruleStream, Charset.forName("UTF-8")), Prolog.PUSHBACK_SIZE); JavaObjectTerm streamObject = new JavaObjectTerm(in); if (!env.execute(Prolog.BUILTIN, "consult_stream", SymbolTerm.makeSymbol("rules.pl"), streamObject)) { throw new CompileException("Cannot consult " + getProject().getName() + " " + getConfig().getRevision()); } } finally { ruleStream.close(); } } else { VariableTerm var = new VariableTerm(); StructureTerm head = new StructureTerm("submit_rule", var); StructureTerm defaultRule = new StructureTerm(":", SymbolTerm.makeSymbol("com.google.gerrit.rules.common"), new StructureTerm("default_submit", var)); StructureTerm clause = new StructureTerm(":-", head, defaultRule); env.execute(Prolog.BUILTIN, "assertz", clause); } return env; }
Source:
<code>public void sendMessage(String message, boolean success) { if (uuid == null || uuid.isEmpty()) { return; } else if (hookURL == null || hookURL.isEmpty()) { <START> System.err.println("Notifications UUID is specified but no notifications webhook URL found in config file"); <END> } else { LOG.debug("Sending notifications message"); String messageToSend = createText(message, success); String jsonMessage; if (this.hookURL.contains("://hooks.slack.com")) { SlackMessage slackPojo = new SlackMessage(); slackPojo.setText(messageToSend); Gson gson = new Gson(); jsonMessage = gson.toJson(slackPojo); } else { LOG.debug("Can not resolve webhook URL"); return; } if (jsonMessage != null && !jsonMessage.isEmpty()) { generalSendMessage(jsonMessage); } } }</code><technical_language>Good idea, check for this condition start-up exit more obvious</technical_language>

Target:
public void sendMessage(String message, boolean success) { if (disabled) { return; } else { LOG.debug("Sending notifications message."); String messageToSend = createText(message, success); String jsonMessage; if (this.hookURL.contains("://hooks.slack.com")) { LOG.warn("Destination is Slack. Message is not 100% compatible."); } Message messageObject = new Message(); messageObject.setText(messageToSend); messageObject.setUuid(this.uuid); Gson gson = new Gson(); jsonMessage = gson.toJson(messageObject); if (jsonMessage != null && !jsonMessage.isEmpty()) { generalSendMessage(jsonMessage); } } }
Source:
<code>protected List<OSProcess> processSort(List<OSProcess> processes, int limit, ProcessSort sort) { if (sort != null) { switch (sort) { case CPU: Collections.sort(processes, CPU_DESC_SORT); break; case MEMORY: Collections.sort(processes, RSS_DESC_SORT); break; case OLDEST: Collections.sort(processes, UPTIME_DESC_SORT); break; case NEWEST: Collections.sort(processes, UPTIME_ASC_SORT); break; case PID: Collections.sort(processes, PID_ASC_SORT); break; case PARENTPID: Collections.sort(processes, PARENTPID_ASC_SORT); break; case NAME: Collections.sort(processes, NAME_ASC_SORT); break; default: throw new IllegalArgumentException("Unimplemented enum type: " + sort.toString()); } } <START> if (limit == 0) <END> return processes; int maxProcs = processes.size(); if (limit > 0 && maxProcs > limit) { maxProcs = limit; } List<OSProcess> procs = new ArrayList<>(); for (int i = 0; i < maxProcs; i++) { procs.add(processes.get(i)); } return procs; }</code><technical_language>Good idea avoid copying list return, want do this in case list size is equal limit, consider moving this integrating other list logic. (Also consider a sublist a new list a bunch of adds.)</technical_language>

Target:
protected List<OSProcess> processSort(List<OSProcess> processes, int limit, ProcessSort sort) { if (sort != null) { switch (sort) { case CPU: Collections.sort(processes, CPU_DESC_SORT); break; case MEMORY: Collections.sort(processes, RSS_DESC_SORT); break; case OLDEST: Collections.sort(processes, UPTIME_DESC_SORT); break; case NEWEST: Collections.sort(processes, UPTIME_ASC_SORT); break; case PID: Collections.sort(processes, PID_ASC_SORT); break; case PARENTPID: Collections.sort(processes, PARENTPID_ASC_SORT); break; case NAME: Collections.sort(processes, NAME_ASC_SORT); break; default: throw new IllegalArgumentException("Unimplemented enum type: " + sort.toString()); } } if (limit == 0 || limit >= processes.size()) return processes; int maxProcs = processes.size(); if (limit > 0 && maxProcs > limit) { maxProcs = limit; } List<OSProcess> procs = new ArrayList<>(); for (int i = 0; i < maxProcs; i++) { procs.add(processes.get(i)); } return procs; }
Source:
<code>public void retryTimesPredicateWithMatchingPredicate() { final AtomicInteger atomicInteger = new AtomicInteger(3); Completable.fromAction(new Action() { @Override public void run() throws Exception { if (atomicInteger.decrementAndGet() != 0) { throw new RuntimeException(); } throw new IllegalArgumentException(); } }) .retry(Integer.MAX_VALUE, new Predicate<Throwable>() { @Override public boolean test(final Throwable throwable) throws Exception { return !(throwable instanceof IllegalArgumentException); } }) .test() <START> .assertFailure(IllegalArgumentException.class); <END> }</code><technical_language>hm, I check atomicInteger verify actual number of action retries</technical_language>

Target:
public void retryTimesPredicateWithMatchingPredicate() { final AtomicInteger atomicInteger = new AtomicInteger(3); final AtomicInteger numberOfSubscribeCalls = new AtomicInteger(0); Completable.fromAction(new Action() { @Override public void run() throws Exception { numberOfSubscribeCalls.incrementAndGet(); if (atomicInteger.decrementAndGet() != 0) { throw new RuntimeException(); } throw new IllegalArgumentException(); } }) .retry(Integer.MAX_VALUE, new Predicate<Throwable>() { @Override public boolean test(final Throwable throwable) throws Exception { return !(throwable instanceof IllegalArgumentException); } }) .test() .assertFailure(IllegalArgumentException.class); assertEquals(3, numberOfSubscribeCalls.get()); }
Source:
<code>public void edit(final GlusterVolumeGeoRepActionConfirmationModel object) { driver.edit(object); <START> forceEditor.setLabel(object.getForceLabel() == null ? constants.notAvailableLabel() : object.getMessage()); <END> messageLabel.setText(object.getMessage() == null ? constants.notAvailableLabel() : object.getMessage()); }</code><technical_language>is this required? bind automatically</technical_language>

Target:
public void edit(final GlusterVolumeGeoRepActionConfirmationModel object) { driver.edit(object); }
Source:
<code>public void validate(AbstractLauncherSettings settings) { <START> for (SettingsValidationRule rule : validationRules) { <END> if (rule.isBrokenBy(settings)) { logger.warn(rule.getInvalidationMessage()); rule.correct(settings); } } }</code><technical_language>Actually, I settings object immutable for a more functional approach (avoid side effects explicity types). wait for another PR ^^ This migth get rid of additional validator class altogher. I quickly sketched this, captures full logic contained in validator: java validationRules .stream() .filter(rule -> rule.isBrokenBy(settings)) .forEach(rule -> { logger.warn(rule.getInvalidationMessage()); rule.correct(settings); }); Eventually, I replace .forEach(...) a .reduce(...) operation like..</technical_language>

Target:
public static void validate(AbstractLauncherSettings settings) { for (SettingsValidationRule rule : RULES) { if (rule.isBrokenBy(settings)) { logger.warn(rule.getInvalidationMessage()); rule.correct(settings); } } }
Source:
<code>public static long decodeTimestamp(long seconds, long serializedNanos, long baseTimestampInSeconds) { long millis = (seconds + baseTimestampInSeconds) * MILLIS_PER_SECOND; long nanos = parseNanos(serializedNanos); if (nanos > 999999999 || nanos < 0) { <START> throw new IllegalArgumentException("nanos > 999999999 or < 0"); <END> } if (millis < 0 && nanos != 0) { millis -= 1000; } return millis + (nanos / 1_000_000); }</code><technical_language>nano field of encoded timestamp in ORC 0 999999999 inclusive, XXX</technical_language>

Target:
public static long decodeTimestamp(long seconds, long serializedNanos, long baseTimestampInSeconds) { long millis = (seconds + baseTimestampInSeconds) * MILLIS_PER_SECOND; long nanos = parseNanos(serializedNanos); if (nanos > 999999999 || nanos < 0) { throw new IllegalArgumentException("nanos field of an encoded timestamp in ORC must be between 0 and 999999999 inclusive, got " + nanos); } if (millis < 0 && nanos != 0) { millis -= 1000; } return millis + (nanos / 1_000_000); }
Source:
<code>public ByteBuffer getBlob(final int row) { if (type == Type.BLOB_TYPE) { <START> <END> return byteValue; } throw new UnsupportedOperationException(); }</code><technical_language>(empty line)</technical_language>

Target:
public ByteBuffer getBlob(final int row) { if (type == Type.BLOB_TYPE) { return blobValue; } throw new UnsupportedOperationException(); }
Source:
<code>public void onHarvest(ActivateEvent event, EntityRef entity, BushDefinitionComponent bushComponent, BlockComponent blockComponent) { EntityRef harvester = event.getInstigator(); if (!event.isConsumed() && areValidHarvestEntities(entity, harvester) <START> && harvester.hasComponent(PlayerCharacterComponent.class)) { <END> if (isInLastStage(bushComponent)) { dropProduce(bushComponent.produce, event.getTargetLocation(), harvester, entity); if (bushComponent.sustainable) { doBushGrowth(blockComponent.getPosition(), bushComponent, -1); } else { entity.send(new DoDestroyPlant()); worldProvider.setBlock(blockComponent.getPosition(), blockManager.getBlock(BlockManager.AIR_ID)); entity.destroy(); } event.consume(); } } }</code><technical_language>This stops functionality Harvester Cart in Additional Rails. I for other player able harvest bush</technical_language>

Target:
public void onHarvest(ActivateEvent event, EntityRef entity, BushDefinitionComponent bushComponent, BlockComponent blockComponent) { EntityRef harvester = event.getInstigator(); if (!event.isConsumed() && areValidHarvestEntities(entity, harvester)) { if (isInLastStage(bushComponent)) { dropProduce(bushComponent.produce, event.getTargetLocation(), harvester, entity); if (bushComponent.sustainable) { doBushGrowth(blockComponent.getPosition(), bushComponent, -1); } else { entity.send(new DoDestroyPlant()); worldProvider.setBlock(blockComponent.getPosition(), blockManager.getBlock(BlockManager.AIR_ID)); entity.destroy(); } event.consume(); } } }
Source:
<code>private int commonPrefixLength(List<String> classNames) { int size = Math.min(classNames.size(), typeSpecStack.size()); for (int i = 0; i < size; i++) { String a = classNames.get(i); String b = typeSpecStack.get(i).name; if (!a.equals(b)) { for (; i > 0; i--) { <START> if (!parentTypeHasMemberType(classNames.get(i), i)) { <END> return i; } } return 0; } } return size; }</code><technical_language>wrong. guess is want invert this: if parent a member type return 0; if do return i</technical_language>

Target:
private int commonPrefixLength(List<String> classNames) { int size = Math.min(classNames.size(), typeSpecStack.size()); for (int i = 0; i < size; i++) { String a = classNames.get(i); String b = typeSpecStack.get(i).name; if (!a.equals(b)) return i; } return size; }
Source:
<code>boolean topologyChanged(TopologySnapshot prev) { <START> return prev != null && !prev.nids.equals(nids) && !Collections.disjoint(nids, prev.nids); <END> }</code><technical_language>suggestion return prev != null && !prev.nids.equals(nids);</technical_language>

Target:
boolean topologyChanged(TopologySnapshot prev) { return prev != null && !prev.nids.equals(nids); }
Source:
<code>public void testPropertiesFrom(File configFile, String[] supportedCipherSuites) throws Exception { try { TlsConfiguration tlsConfiguration = new TlsConfiguration(DEFAULT_KEYSTORE); tlsConfiguration.initialise(true, JSSE_NAMESPACE); SSLSocket socket = (SSLSocket) tlsConfiguration.getSocketFactory().createSocket(); SSLServerSocket serverSocket = (SSLServerSocket) tlsConfiguration.getServerSocketFactory().createServerSocket(); <START> Assert.assertEquals(new HashSet<String>(Arrays.asList(supportedCipherSuites)), new HashSet<String>(Arrays.asList(socket.getEnabledCipherSuites()))); <END> Assert.assertEquals(new HashSet<String>(Arrays.asList(supportedCipherSuites)), new HashSet<String>(Arrays.asList(socket.getEnabledCipherSuites()))); } finally { deleteFile(configFile); } }</code><technical_language>hamcrest</technical_language>

Target:
public void testPropertiesFrom(File configFile, String[] supportedCipherSuites) throws Exception { try { TlsConfiguration tlsConfiguration = new TlsConfiguration(DEFAULT_KEYSTORE); tlsConfiguration.initialise(true, JSSE_NAMESPACE); SSLSocket socket = (SSLSocket) tlsConfiguration.getSocketFactory().createSocket(); SSLServerSocket serverSocket = (SSLServerSocket) tlsConfiguration.getServerSocketFactory().createServerSocket(); assertThat(socket.getEnabledCipherSuites(), arrayContainingInAnyOrder(supportedCipherSuites)); assertThat(serverSocket.getEnabledCipherSuites(), arrayContainingInAnyOrder(supportedCipherSuites)); } finally { deleteFile(configFile); } }
Source:
<code>private boolean containsAcl(OzoneAcl ozoneAcl, List<OzoneAcl> ozoneAcls) { for (OzoneAcl acl : ozoneAcls) { if (acl.getType().equals(ozoneAcl.getType()) && acl.getName().equals(ozoneAcl.getName()) <START> && acl.getAclBitSet().equals(ozoneAcl.getAclBitSet()) <END> && acl.getAclScope().equals(ozoneAcl.getAclScope())) { return true; } } return false; }</code><technical_language>containersAcl() work for case added is OR-ed existing BitSet .equals same</technical_language>

Target:
private boolean containsAcl(OzoneAcl ozoneAcl, List<OzoneAcl> ozoneAcls) { for (OzoneAcl acl : ozoneAcls) { boolean result = compareAcls(ozoneAcl, acl); if (result) { return result; } } return false; }
Source:
<code><START> private boolean mountGlusterMetaVolume() { <END> VDSReturnValue retVal = runVdsCommand(VDSCommandType.MountGlusterMetaVolume, new VdsIdVDSCommandParametersBase(getVdsId())); if (!retVal.getSucceeded()) { log.error("Failed to mount gluster meta volume on server {}: {}", getVdsName(), retVal.getVdsError().getMessage()); } return true; }</code><technical_language>this done if meta-volume exists</technical_language>

Target:
private boolean mountGlusterMetaVolume() { if (getGlusterVolumeDao().getByName(getVdsGroupId(), Config.<String> getValue(ConfigValues.GlusterMetaVolumeName)) != null) { VDSReturnValue retVal = runVdsCommand(VDSCommandType.MountGlusterMetaVolume, new VdsIdVDSCommandParametersBase(getVdsId())); if (!retVal.getSucceeded()) { log.error("Failed to mount gluster meta volume on server {}: {}", getVdsName(), retVal.getVdsError().getMessage()); } } return true; }
Source:
<code>public void test() throws Exception { startDefaultMaster(); final HeliosClient client = defaultClient(); final CreateJobResponse createIdMismatch = client.createJob( new Job(JobId.fromString("bad:job:deadbeef"), "busyBox", IDLE_COMMAND, EMPTY_ENV, <START> EMPTY_PORTS, EMPTY_REGISTRATION, EMPTY_VOLUMES, null)).get(); <END> assertEquals(CreateJobResponse.Status.INVALID_JOB_DEFINITION, createIdMismatch.getStatus()); }</code><technical_language>consider creating EMPTY_EXPIRY constant</technical_language>

Target:
public void test() throws Exception { startDefaultMaster(); final HeliosClient client = defaultClient(); final CreateJobResponse createIdMismatch = client.createJob( new Job(JobId.fromString("bad:job:deadbeef"), "busyBox", IDLE_COMMAND, EMPTY_ENV, EMPTY_PORTS, EMPTY_REGISTRATION, EMPTY_VOLUMES, EMPTY_EXPIRES)).get(); assertEquals(CreateJobResponse.Status.INVALID_JOB_DEFINITION, createIdMismatch.getStatus()); }
Source:
<code>public void testHighlight() { final Rectangle cellBounds = SWTBotUtils.getCellBounds(fTableBot.widget, ROW, <START> COLUMN); <END> Map<RGB, Integer> colorBefore = ImageHelper.getScreenGrab(cellBounds).getHistogram(); fTableBot.click(0, COLUMN); fBot.text().typeText("HostF\n", 100); fTableBot.select(4); Map<RGB, Integer> colorAfter = ImageHelper.getScreenGrab(cellBounds).getHistogram(); assertTrue(colorBefore.containsKey(BLACK)); assertTrue(colorBefore.containsKey(WHITE)); assertFalse(colorBefore.containsKey(YELLOW)); assertTrue(colorAfter.containsKey(BLACK)); assertTrue(colorAfter.containsKey(WHITE)); assertTrue(colorAfter.containsKey(YELLOW)); Map<RGB, Integer> diff = new HashMap<>(); for (Entry<RGB, Integer> entry : colorAfter.entrySet()) { RGB key = entry.getKey(); if (colorBefore.containsKey(key)) { diff.put(key, entry.getValue() - colorBefore.get(key)); } else { diff.put(key, entry.getValue()); } } assertTrue(diff.get(WHITE).equals(-diff.get(YELLOW))); }</code><technical_language><field name>_COLUMN</technical_language>

Target:
public void testHighlight() { final Rectangle cellBounds = SWTBotUtils.getCellBounds(fTableBot.widget, ROW, SOURCE_COLUMN); Map<RGB, Integer> colorBefore = ImageHelper.getScreenGrab(cellBounds).getHistogram(); fTableBot.click(0, SOURCE_COLUMN); fBot.text().typeText("HostF\n", 100); fTableBot.select(ROW - 1); Map<RGB, Integer> colorAfter = ImageHelper.getScreenGrab(cellBounds).getHistogram(); assertTrue(colorBefore.containsKey(fBackground)); assertTrue(colorBefore.containsKey(fForeground)); assertFalse(colorBefore.containsKey(YELLOW)); assertTrue(colorAfter.containsKey(fBackground)); assertTrue(colorAfter.containsKey(fForeground)); assertTrue(colorAfter.containsKey(YELLOW)); Map<RGB, Integer> diff = new HashMap<>(); for (Entry<RGB, Integer> entry : colorAfter.entrySet()) { RGB key = entry.getKey(); if (colorBefore.containsKey(key)) { diff.put(key, entry.getValue() - colorBefore.get(key)); } else { diff.put(key, entry.getValue()); } } assertTrue(diff.get(fBackground).equals(-diff.get(YELLOW))); }
Source:
<code>private void createTrim(MUIElement element) { MWindow win = getWindowFor(element); <START> if (win instanceof MTrimmedWindow) { <END> MTrimmedWindow window = (MTrimmedWindow) win; Shell winShell = (Shell) window.getWidget(); String trimId = element.getElementId() + getMinimizedElementSuffix(element); MToolControl trimStack = (MToolControl) modelService.find(trimId, window); if (trimStack == null) { trimStack = MenuFactoryImpl.eINSTANCE.createToolControl(); trimStack.setElementId(trimId); trimStack.setContributionURI(TrimStack.CONTRIBUTION_URI); trimStack.getTags().add("TrimStack"); MTrimBar bar = getBarForElement(element, window); int index = getCachedIndex(element); if (index == -1 || index >= bar.getChildren().size()) bar.getChildren().add(trimStack); else bar.getChildren().add(index, trimStack); bar.setVisible(true); if (bar.getWidget() == null) { bar.setToBeRendered(true); context.get(IPresentationEngine.class).createGui(bar, winShell, window.getContext()); } } else { MUIElement parent = trimStack.getParent(); parent.setVisible(true); if (parent.getWidget() == null) { parent.setToBeRendered(true); context.get(IPresentationEngine.class).createGui(parent, winShell, window.getContext()); } trimStack.setToBeRendered(true); } } }</code><technical_language>I prefer pattern. // MTrimWindow a trim if (!win instnace of ) { return; }</technical_language>

Target:
private void createTrim(MUIElement element) { MWindow win = getWindowFor(element); if (!(win instanceof MTrimmedWindow)) { return; } MTrimmedWindow window = (MTrimmedWindow) win; Shell winShell = (Shell) window.getWidget(); String trimId = element.getElementId() + getMinimizedElementSuffix(element); MToolControl trimStack = (MToolControl) modelService.find(trimId, window); if (trimStack == null) { trimStack = MenuFactoryImpl.eINSTANCE.createToolControl(); trimStack.setElementId(trimId); trimStack.setContributionURI(TrimStack.CONTRIBUTION_URI); trimStack.getTags().add("TrimStack"); MTrimBar bar = getBarForElement(element, window); int index = getCachedIndex(element); if (index == -1 || index >= bar.getChildren().size()) bar.getChildren().add(trimStack); else bar.getChildren().add(index, trimStack); bar.setVisible(true); if (bar.getWidget() == null) { bar.setToBeRendered(true); context.get(IPresentationEngine.class) .createGui(bar, winShell, window.getContext()); } } else { MUIElement parent = trimStack.getParent(); parent.setVisible(true); if (parent.getWidget() == null) { parent.setToBeRendered(true); context.get(IPresentationEngine.class).createGui(parent, winShell, window.getContext()); } trimStack.setToBeRendered(true); } }
Source:
<code>protected void setAnyRouter() { <START> setAttribute(MongoDBRouterCluster.ANY_ROUTER, Iterables.tryFind(getRouters(), new Predicate<MongoDBRouter>() { <END> @Override public boolean apply(MongoDBRouter input) { return input.getAttribute(Startable.SERVICE_UP); }}).orNull()); }</code><technical_language>EntityPredicates.attributeEqualTo(Startable.SERVICE_UP, true) Note avoid strange NPE hit if is a router SERVICE_UP attribute equal null</technical_language>

Target:
protected void setAnyRouter() { setAttribute(MongoDBRouterCluster.ANY_ROUTER, Iterables.tryFind(getRouters(), EntityPredicates.attributeEqualTo(Startable.SERVICE_UP, true)).orNull()); setAttribute(MongoDBRouterCluster.ANY_RUNNING_ROUTER, Iterables.tryFind(getRouters(), new Predicate<MongoDBRouter>() { @Override public boolean apply(MongoDBRouter input) { return input.getAttribute(MongoDBRouter.RUNNING); }}).orNull()); }
Source:
<code>public Object call(Properties bindings, Object[] args) { if (args.length == 3) { Object v = args[0]; Object targetProjectName = args[1]; Object targetColumnName = args[2]; long targetProjectID; ProjectLookup lookup; <START> if ((v instanceof String || v instanceof Long || v instanceof Integer || v instanceof WrappedCell) <END> && (targetProjectName instanceof String && targetColumnName instanceof String)) { try { targetProjectID = ProjectManager.singleton.getProjectID((String) targetProjectName); } catch (GetProjectIDException e) { return new EvalError(e.getMessage()); } try { lookup = ProjectManager.singleton.getLookupCacheManager().getLookup(targetProjectID, (String) targetColumnName); } catch (LookupException e) { return new EvalError(e.getMessage()); } if (v instanceof WrappedCell) { return lookup.getRows(((WrappedCell) v).cell.value); } else { return lookup.getRows(v); } } } return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a string or long or int or cell, a project name to look up, and a column name in that project"); }</code><technical_language>Hmm, I relax this v instance of Number ? undoubtedly some folks want perform lookups key's potentially Double, Short, Float additionally. This allow simplify messaging users</technical_language>

Target:
public Object call(Properties bindings, Object[] args) { if (args.length == 3) { Object v = args[0]; Object targetProjectName = args[1]; Object targetColumnName = args[2]; long targetProjectID; ProjectLookup lookup; if (v != null && targetProjectName instanceof String && targetColumnName instanceof String) { try { targetProjectID = ProjectManager.singleton.getProjectID((String) targetProjectName); } catch (GetProjectIDException e) { return new EvalError(e.getMessage()); } try { lookup = ProjectManager.singleton.getLookupCacheManager().getLookup(targetProjectID, (String) targetColumnName); } catch (LookupException e) { return new EvalError(e.getMessage()); } if (v instanceof WrappedCell) { return lookup.getRows(((WrappedCell) v).cell.value); } else { return lookup.getRows(v); } } } return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a cell or cell value, a project name to look up, and a column name in that project"); }