auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void addErrataCountForType(ErrataData errataData, ErrataType errataType) { Stream<Erratum> typedErrata = errataData.getErrata().stream().filter(erratum -> erratum.getType() == errataType); long totalcount = typedErrata.count(); if (totalcount > 0) { Map<ErrataSeverity, Long> errataBySeverity = errataData.getErrata().stream().collect( Collectors.groupingBy(Erratum::getSeverityOrDefault, Collectors.counting())); ErrataCount errataCount = new ErrataCount(); errataCount.setTotalCount((int) totalcount); errataBySeverity.entrySet() .stream() .forEach(entry -> errataCount.getCountBySeverity().put(entry.getKey(), entry.getValue().intValue())); errataData.getErrataCounts().getErrataCountByType().put(errataType, errataCount); <START> } <END> }</code><technical_language>wondering, more performant build map in shot, filtering time in this method</technical_language>

Target:
private void addErrataCountForType(ErrataData errataData, ErrataType errataType) { Stream<Erratum> typedErrata = errataData.getErrata().stream().filter(erratum -> erratum.getType() == errataType); long totalCount = typedErrata.count(); if (totalCount > 0) { Map<ErrataSeverity, Long> errataBySeverity = errataData.getErrata().stream().collect( Collectors.groupingBy(Erratum::getSeverityOrDefault, Collectors.counting())); ErrataCount errataCount = new ErrataCount(); errataCount.setTotalCount((int) totalCount); errataBySeverity.entrySet() .stream() .forEach(entry -> errataCount.getCountBySeverity().put(entry.getKey(), entry.getValue().intValue())); errataData.getErrataCounts().getErrataCountByType().put(errataType, errataCount); } }
Source:
<code>private static ParameterSpec<EventEnvelope>[] combinedSpecs() { <START> ParameterSpec<EventEnvelope>[] values1 = EventAcceptingMethodParams.values(); <END> ParameterSpec<EventEnvelope>[] values2 = StateSubscriberSpec.values(); @SuppressWarnings("unchecked") ParameterSpec<EventEnvelope>[] result = ObjectArrays.concat(values1, values2, ParameterSpec.class); return result; }</code><technical_language>avoid numbering variables, this approach copied some inappropriate scenario in future</technical_language>

Target:
private static ParameterSpec<EventEnvelope>[] combinedSpecs() { ParameterSpec<EventEnvelope>[] eventParams = EventAcceptingMethodParams.values(); ParameterSpec<EventEnvelope>[] stateParams = StateSubscriberSpec.values(); @SuppressWarnings("unchecked") ParameterSpec<EventEnvelope>[] result = ObjectArrays.concat(eventParams, stateParams, ParameterSpec.class); return result; }
Source:
<code>public DownloadParams getDownloadParams() { <START> return downloadParams; <END> }</code><technical_language>prefer returning a new instance DownloadParams downloadParams is null</technical_language>

Target:
public DownloadParams getDownloadParams() { if (downloadParams == null) { downloadParams = new DownloadParams(); } return downloadParams; }
Source:
<code>protected List<MemoryUsageTreeModel> getTree(ITmfStateSystem ss, TimeQueryFilter filter, @Nullable IProgressMonitor monitor) throws StateSystemDisposedException { boolean filtered = false; if (filter instanceof FilterTimeQueryFilter) { filtered = ((FilterTimeQueryFilter) filter).isFiltered(); } List<ITmfStateInterval> nameFullState = ss.queryFullState(ss.getCurrentEndTime()); List<ITmfStateInterval> activeFullState = ss.queryFullState(Long.max(filter.getStart(), ss.getStartTime())); List<Integer> tidQuarks = ss.getSubAttributes(-1, false); ImmutableList.Builder<MemoryUsageTreeModel> builder = ImmutableList.builder(); long <START> traceId = <END> getId(ITmfStateSystem.ROOT_ATTRIBUTE); builder.add(new MemoryUsageTreeModel(traceId, -1L, -1, getTrace().getName())); for (int quark : tidQuarks) { int memoryAttribute = ss.optQuarkRelative(quark, UstMemoryStrings.UST_MEMORY_MEMORY_ATTRIBUTE); int procNameQuark = ss.optQuarkRelative(quark, UstMemoryStrings.UST_MEMORY_PROCNAME_ATTRIBUTE); if (memoryAttribute != ITmfStateSystem.INVALID_ATTRIBUTE && procNameQuark != ITmfStateSystem.INVALID_ATTRIBUTE) { ITmfStateInterval threadMemoryInterval = activeFullState.get(memoryAttribute); if (!filtered || threadMemoryInterval.getEndTime() < filter.getEnd()) { String name = String.valueOf(nameFullState.get(procNameQuark).getValue()); int tid = Integer.parseInt(ss.getAttributeName(quark)); Long id = getId(quark); builder.add(new MemoryUsageTreeModel(id, traceId, tid, name)); } } } return builder.build(); }</code><technical_language>traceId</technical_language>

Target:
protected List<MemoryUsageTreeModel> getTree(ITmfStateSystem ss, TimeQueryFilter filter, @Nullable IProgressMonitor monitor) throws StateSystemDisposedException { boolean filtered = false; if (filter instanceof FilterTimeQueryFilter) { filtered = ((FilterTimeQueryFilter) filter).isFiltered(); } List<ITmfStateInterval> nameFullState = ss.queryFullState(ss.getCurrentEndTime()); List<ITmfStateInterval> activeFullState = ss.queryFullState(Long.max(filter.getStart(), ss.getStartTime())); List<Integer> tidQuarks = ss.getSubAttributes(-1, false); ImmutableList.Builder<MemoryUsageTreeModel> builder = ImmutableList.builder(); long rootId = getId(ITmfStateSystem.ROOT_ATTRIBUTE); builder.add(new MemoryUsageTreeModel(rootId, -1L, -1, getTrace().getName())); for (int quark : tidQuarks) { int memoryAttribute = ss.optQuarkRelative(quark, UstMemoryStrings.UST_MEMORY_MEMORY_ATTRIBUTE); int procNameQuark = ss.optQuarkRelative(quark, UstMemoryStrings.UST_MEMORY_PROCNAME_ATTRIBUTE); if (memoryAttribute != ITmfStateSystem.INVALID_ATTRIBUTE && procNameQuark != ITmfStateSystem.INVALID_ATTRIBUTE) { ITmfStateInterval threadMemoryInterval = activeFullState.get(memoryAttribute); if (!filtered || threadMemoryInterval.getEndTime() < filter.getEnd()) { String name = String.valueOf(nameFullState.get(procNameQuark).getValue()); int tid = Integer.parseInt(ss.getAttributeName(quark)); Long id = getId(quark); builder.add(new MemoryUsageTreeModel(id, rootId, tid, name)); } } } return builder.build(); }
Source:
<code>public void cancelTokens(File tokenFile, String userToProxy, Logger logger) throws HadoopSecurityManagerException { Credentials cred = null; try { cred = Credentials.readTokenStorageFile(new Path(tokenFile.toURI()), new Configuration()); for (Token<? extends TokenIdentifier> t : cred.getAllTokens()) { logger.info("Got token: " + t.toString()); logger.info("Token kind: " + t.getKind()); logger.info("Token id: " + new String(t.getIdentifier())); logger.info("Token service: " + t.getService()); if (t.getKind().equals(new Text("HIVE_DELEGATION_TOKEN"))) { logger.info("Cancelling hive token " + new String(t.getIdentifier())); cancelHiveToken(t, userToProxy); } else if (t.getKind().equals(new Text("RM_DELEGATION_TOKEN"))) { logger.info("Cancelling mr job tracker token " + new String(t.getIdentifier())); } else if (t.getKind().equals(new Text("HDFS_DELEGATION_TOKEN"))) { logger.info("Cancelling namenode token " + new String(t.getIdentifier())); } else if (t.getKind().equals(new Text("MR_DELEGATION_TOKEN"))) { logger.info("Cancelling jobhistoryserver mr token " + new String(t.getIdentifier())); } else { logger.info("unknown token type " + t.getKind()); } } } catch (Exception e) { <START> e.printStackTrace(); <END> } }</code><technical_language>this exception squashed</technical_language>

Target:
public void cancelTokens(File tokenFile, String userToProxy, Logger logger) throws HadoopSecurityManagerException { Credentials cred = null; try { cred = Credentials.readTokenStorageFile(new Path(tokenFile.toURI()), new Configuration()); for (Token<? extends TokenIdentifier> t : cred.getAllTokens()) { logger.info("Got token: " + t.toString()); logger.info("Token kind: " + t.getKind()); logger.info("Token id: " + new String(t.getIdentifier())); logger.info("Token service: " + t.getService()); if (t.getKind().equals(new Text("HIVE_DELEGATION_TOKEN"))) { logger.info("Cancelling hive token " + new String(t.getIdentifier())); cancelHiveToken(t, userToProxy); } else if (t.getKind().equals(new Text("RM_DELEGATION_TOKEN"))) { logger.info("Cancelling mr job tracker token " + new String(t.getIdentifier())); } else if (t.getKind().equals(new Text("HDFS_DELEGATION_TOKEN"))) { logger.info("Cancelling namenode token " + new String(t.getIdentifier())); } else if (t.getKind().equals(new Text("MR_DELEGATION_TOKEN"))) { logger.info("Cancelling jobhistoryserver mr token " + new String(t.getIdentifier())); } else { logger.info("unknown token type " + t.getKind()); } } } catch (Exception e) { throw new HadoopSecurityManagerException("Failed to cancel tokens " + e.getMessage() + e.getCause(), e); } }
Source:
<code>public PostgreSQLQuarterDiffFunction() { <START> super("(select sign(i2) * floor(abs(i2)) from ( select (date_part('year', t1) * 12 + date_part('month', t1))/-3 from (values (age(?1,?2))) as temp(t1)) as temp2(i2))"); <END> }</code><technical_language>a cast int enough</technical_language>

Target:
public PostgreSQLQuarterDiffFunction() { super("(select -cast(trunc((date_part('year', t1) * 12 + date_part('month', t1))/3) as integer) from (values (age(?1,?2))) as temp(t1))"); }
Source:
<code>public boolean isBare() { boolean bare = getConfig().getBoolean( ConfigConstants.CONFIG_CORE_SECTION, ConfigConstants.CONFIG_KEY_BARE, false); if (bare) return true; String workTree = getConfig().getString( ConfigConstants.CONFIG_CORE_SECTION, null, "worktree"); <START> if (workTree != null) <END> return false; if (getDirectory().getName().equals(Constants.DOT_GIT)) return false; return true; }</code><technical_language>if core.worktree set in configuration file, set caller of Repository. 8 forms of constructor takes arguments... of is work tree path, environment variable</technical_language>

Target:
public boolean isBare() { boolean bareSet = getConfig().getString( ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_BARE) != null; if (bareSet) return getConfig().getBoolean(ConfigConstants.CONFIG_CORE_SECTION, ConfigConstants.CONFIG_KEY_BARE, false); if (gitDirExplicit && workDir == null) return true; if (getDirectory().getName().equals(Constants.DOT_GIT)) return false; return true; }
Source:
<code>public void addRole(String username, String role) { throw new RuntimeException("Adding a role is not supporting in LDAP"); <START> <END> }</code><technical_language>extra space necessary</technical_language>

Target:
public void addRole(String username, String role) { throw new UnsupportedOperationException("Adding a role is not supporting in LDAP"); }
Source:
<code>public static Map<String, String> map(Map<String, String> attributes, Map<String, String> extensions) { Assert.notNull(attributes, "'attributes' must noy be null"); <START> Assert.notNull(extensions, "'extensions' must noy be null"); <END> Map<String, String> result = attributes.entrySet() .stream() .filter(attribute -> attribute.getValue() != null && !ContextAttributes.datacontenttype.name().equals(attribute.getKey())) .map(header -> new AbstractMap.SimpleEntry<>( CloudEventHeaders.PREFIX + header.getKey().toLowerCase(Locale.US), header.getValue())) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); result.putAll( extensions.entrySet() .stream() .filter(extension -> extension.getValue() != null) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)) ); Optional.ofNullable(attributes .get(ContextAttributes.datacontenttype.name())) .ifPresent((dataContentType) -> { result.put(MessageHeaders.CONTENT_TYPE, dataContentType); }); return result; }</code><technical_language>check spelling 'noy'</technical_language>

Target:
public static Map<String, String> map(Map<String, String> attributes, Map<String, String> extensions) { Assert.notNull(attributes, "'attributes' must not be null"); Assert.notNull(extensions, "'extensions' must not be null"); Map<String, String> result = attributes.entrySet() .stream() .filter(attribute -> attribute.getValue() != null && !ContextAttributes.datacontenttype.name().equals(attribute.getKey())) .map(header -> new AbstractMap.SimpleEntry<>( CloudEventHeaders.PREFIX + header.getKey().toLowerCase(Locale.US), header.getValue())) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); result.putAll( extensions.entrySet() .stream() .filter(extension -> extension.getValue() != null) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)) ); Optional.ofNullable(attributes .get(ContextAttributes.datacontenttype.name())) .ifPresent((dataContentType) -> { result.put(MessageHeaders.CONTENT_TYPE, dataContentType); }); return result; }
Source:
<code>private void load(File directory) throws ConfigurationException { if (!directory.exists()) { <START> log.warn("The directory \"" + directory.getAbsolutePath() <END> + "\" containing the configuration files doesn't " + "exist."); } else { File[] files = directory.listFiles(); if (files != null) { sort(files); for (File file : files) { if (file.getName().endsWith(".properties")) { try { ExtensionEntry entry = new ExtensionEntry(file); ExtensionEntry alreadyLoded = loadedEntries.get(entry.getName()); if (alreadyLoded != null) { throw new ConfigurationException(String.format("Could not load the configuration file \"%1$s\". The configuration file + \"%2$s\" already has the name %3$s", file.getAbsolutePath(), alreadyLoded.file.getAbsolutePath(), entry.getName())); } loadedEntries.put(entry.name, entry); } catch (IOException exception) { throw new ConfigurationException(String.format("Can't load object configuration file \"%1$s\"", file.getAbsolutePath())); } } } } } }</code><technical_language>string.format</technical_language>

Target:
private void load(File directory) throws ConfigurationException { if (!directory.exists()) { log.warn(String.format("The directory '%1$s' cotaning configuration files does not exist.", directory.getAbsolutePath())); } else { File[] files = directory.listFiles(); if (files != null) { sort(files); for (File file : files) { if (file.getName().endsWith(".properties")) { try { ExtensionEntry entry = new ExtensionEntry(file); ExtensionEntry alreadyLoded = loadedEntries.get(entry.getName()); if (alreadyLoded != null) { throw new ConfigurationException(String.format("Could not load the configuration file '%1$s'. The configuration file '%2$s' already has the name '%3$s'", file.getAbsolutePath(), alreadyLoded.file.getAbsolutePath(), entry.getName())); } loadedEntries.put(entry.name, entry); } catch (IOException exception) { throw new ConfigurationException(String.format("Can't load object configuration file '%1$s'", file.getAbsolutePath())); } } } } } }
Source:
<code>public void setColumns(List<ElasticsearchColumn> columns) { <START> this.columns = columns; <END> }</code><technical_language>a defensive copy (currently caller it)</technical_language>

Target:
public void setColumns(List<ElasticsearchColumn> columns) { this.columns = ImmutableList.copyOf(columns); }
Source:
<code>protected boolean canDoAction() { <START> boolean retValue = true; <END> List<OVirtNodeInfo> info = OVirtNodeInfo.get(); if (getVdsId() == null || getVdsId().equals(Guid.Empty)) { addCanDoActionMessage(VdcBllMessages.VDS_INVALID_SERVER_ID); retValue = false; } else if (getVds() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_HOST_NOT_EXIST); retValue = false; } else if (isOvirtReInstallOrUpgrade()) { StringBuilder isoFile = new StringBuilder(getParameters().getoVirtIsoFile()); if (getVds().getStatus() == VDSStatus.NonOperational) { addCanDoActionMessage(VdcBllMessages.VDS_CANNOT_INSTALL_STATUS_ILLEGAL); retValue = false; } VdsValidator.IsoValidStatus isoStat; RpmVersion ovirtHostOsVersion = VdsHandler.getOvirtHostOsVersion(getVds()); VdsValidator validator = new VdsValidator(getVds()); isoStat = validator.isIsoFileValid(isoFile, info, ovirtHostOsVersion); switch(isoStat) { case VALID: _isoFullPath = isoFile.toString(); retValue = true; break; case NOTCOMPATIBLE: addCanDoActionMessage(VdcBllMessages.VDS_CANNOT_UPGRADE_BETWEEN_MAJOR_VERSION); addCanDoActionMessage(String.format("$IsoVersion %1$s", ovirtHostOsVersion.getMajor())); retValue = false; break; case MISSINGFILE: addCanDoActionMessage(VdcBllMessages.VDS_CANNOT_INSTALL_MISSING_IMAGE_FILE); retValue = true; break; } } return retValue; }</code><technical_language>assume failure</technical_language>

Target:
protected boolean canDoAction() { boolean retValue = false; List<OVirtNodeInfo> info = OVirtNodeInfo.get(); if (getVdsId() == null || getVdsId().equals(Guid.Empty)) { addCanDoActionMessage(VdcBllMessages.VDS_INVALID_SERVER_ID); } else if (getVds() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_HOST_NOT_EXIST); } else if (isOvirtReInstallOrUpgrade()) { StringBuilder isoFile = new StringBuilder(getParameters().getoVirtIsoFile()); if (getVds().getStatus() == VDSStatus.NonOperational) { addCanDoActionMessage(VdcBllMessages.VDS_CANNOT_INSTALL_STATUS_ILLEGAL); } VdsValidator.IsoValidStatus isoStat; RpmVersion ovirtHostOsVersion = VdsHandler.getOvirtHostOsVersion(getVds()); VdsValidator validator = new VdsValidator(getVds()); isoStat = validator.isIsoFileValid(isoFile, info, ovirtHostOsVersion); switch(isoStat) { case VALID: _isoFullPath = isoFile.toString(); retValue = true; break; case NOTCOMPATIBLE: addCanDoActionMessage(VdcBllMessages.VDS_CANNOT_UPGRADE_BETWEEN_MAJOR_VERSION); addCanDoActionMessage(String.format("$IsoVersion %1$s", ovirtHostOsVersion.getMajor())); break; case MISSINGFILE: addCanDoActionMessage(VdcBllMessages.VDS_CANNOT_INSTALL_MISSING_IMAGE_FILE); break; } } return retValue; }
Source:
<code>public NameServer flush() { <START> return new NameServer(this.nameServerEntity.getEntity()); <END> }</code><technical_language>Please remove "this"</technical_language>

Target:
public NameServer flush() { return new NameServer(nameServerEntity.getEntity()); }
Source:
<code>private void saveLabelSections(Config rc) { List<String> existing = Lists.newArrayList(rc.getSubsections(LABEL)); if (!Lists.newArrayList(labelSections.keySet()).equals(existing)) { for (String name : existing) { rc.unsetSection(LABEL, name); } } Set<String> toUnset = Sets.newHashSet(existing); for (Map.Entry<String, LabelType> e : labelSections.entrySet()) { String name = e.getKey(); LabelType label = e.getValue(); toUnset.remove(name); rc.setString(LABEL, name, KEY_FUNCTION, label.getFunctionName()); if (!LabelType.defaultAbbreviation(name) .equals(label.getAbbreviatedName())) { rc.setString( LABEL, name, KEY_ABBREVIATION, label.getAbbreviatedName()); } else { rc.unset(LABEL, name, KEY_ABBREVIATION); } if (label.isCopyMinScore()) { rc.setBoolean(LABEL, name, KEY_COPY_MIN_SCORE, true); } else { rc.unset(LABEL, name, KEY_COPY_MIN_SCORE); } <START> if (label.isBlock()) { <END> rc.setBoolean(LABEL, name, KEY_BLOCK, true); } else { rc.unset(LABEL, name, KEY_BLOCK); } List<String> values = Lists.newArrayListWithCapacity(label.getValues().size()); for (LabelValue value : label.getValues()) { values.add(value.format()); } rc.setStringList(LABEL, name, KEY_VALUE, values); } for (String name : toUnset) { rc.unsetSection(LABEL, name); } }</code><technical_language>canOverride. This needs rebased</technical_language>

Target:
private void saveLabelSections(Config rc) { List<String> existing = Lists.newArrayList(rc.getSubsections(LABEL)); if (!Lists.newArrayList(labelSections.keySet()).equals(existing)) { for (String name : existing) { rc.unsetSection(LABEL, name); } } Set<String> toUnset = Sets.newHashSet(existing); for (Map.Entry<String, LabelType> e : labelSections.entrySet()) { String name = e.getKey(); LabelType label = e.getValue(); toUnset.remove(name); rc.setString(LABEL, name, KEY_FUNCTION, label.getFunctionName()); if (!LabelType.defaultAbbreviation(name) .equals(label.getAbbreviatedName())) { rc.setString( LABEL, name, KEY_ABBREVIATION, label.getAbbreviatedName()); } else { rc.unset(LABEL, name, KEY_ABBREVIATION); } if (label.isCopyMinScore()) { rc.setBoolean(LABEL, name, KEY_COPY_MIN_SCORE, true); } else { rc.unset(LABEL, name, KEY_COPY_MIN_SCORE); } if (!label.canOverride()) { rc.setBoolean(LABEL, name, KEY_CAN_OVERRIDE, false); } else { rc.unset(LABEL, name, KEY_CAN_OVERRIDE); } List<String> values = Lists.newArrayListWithCapacity(label.getValues().size()); for (LabelValue value : label.getValues()) { values.add(value.format()); } rc.setStringList(LABEL, name, KEY_VALUE, values); } for (String name : toUnset) { rc.unsetSection(LABEL, name); } }
Source:
<code>private Optional<Calibration> getRemotely(final String senseId, final Boolean strict) { final HashMap<String, AttributeValue> key = Maps.newHashMap(); key.put(SENSE_ATTRIBUTE_NAME, new AttributeValue().withS(senseId)); final GetItemRequest getItemRequest = new GetItemRequest() .withTableName(calibrationTableName) .withKey(key); final GetItemResult getItemResult = dynamoDBClient.getItem(getItemRequest); final Map<String, AttributeValue> item = getItemResult.getItem(); if (item == null) { <START> if (strict.equals(Boolean.TRUE)) { <END> LOGGER.warn("Sense does not have calibration", senseId); return Optional.absent(); } LOGGER.warn("Not in strict mode, returning default calibration for sense {}", senseId); return Optional.of(Calibration.createDefault(senseId)); } return Optional.of(Calibration.create(senseId, Integer.valueOf(item.get(DUST_OFFSET_ATTRIBUTE_NAME).getN()), item.get(METADATA_ATTRIBUTE_NAME).getS())); }</code><technical_language>if(strict){}</technical_language>

Target:
private Optional<Calibration> getRemotely(final String senseId, final Boolean strict) { final HashMap<String, AttributeValue> key = Maps.newHashMap(); key.put(SENSE_ATTRIBUTE_NAME, new AttributeValue().withS(senseId)); final GetItemRequest getItemRequest = new GetItemRequest() .withTableName(calibrationTableName) .withKey(key); final GetItemResult getItemResult = dynamoDBClient.getItem(getItemRequest); final Map<String, AttributeValue> item = getItemResult.getItem(); if (item == null) { if (strict) { LOGGER.warn("Sense does not have calibration", senseId); return Optional.absent(); } LOGGER.warn("Not in strict mode, returning default calibration for sense {}", senseId); return Optional.of(Calibration.createDefault(senseId)); } return Optional.of(Calibration.create(senseId, Integer.valueOf(item.get(DUST_OFFSET_ATTRIBUTE_NAME).getN()), item.get(METADATA_ATTRIBUTE_NAME).getS())); }
Source:
<code>public static void killJobOnCluster(String applicationId, Logger log) { try { YarnConfiguration yarnConf = new YarnConfiguration(); YarnClient yarnClient = YarnClient.createYarnClient(); yarnClient.init(yarnConf); yarnClient.start(); String[] split = applicationId.split("_"); ApplicationId aid = ApplicationId.newInstance(Long.parseLong(split[1]), Integer.parseInt(split[2])); log.info("start klling application: " + aid); yarnClient.killApplication(aid); log.info("successfully killed application: " + aid); } catch (Exception e) { <START> log.error("Failure while try to kill the hadoop job. Will skip and continue", e); <END> } }</code><technical_language>caller if job successfully killed? throw exception instead</technical_language>

Target:
public static void killJobOnCluster(String applicationId, Logger log) throws YarnException, IOException { YarnConfiguration yarnConf = new YarnConfiguration(); YarnClient yarnClient = YarnClient.createYarnClient(); yarnClient.init(yarnConf); yarnClient.start(); String[] split = applicationId.split("_"); ApplicationId aid = ApplicationId.newInstance(Long.parseLong(split[1]), Integer.parseInt(split[2])); log.info("start klling application: " + aid); yarnClient.killApplication(aid); log.info("successfully killed application: " + aid); }
Source:
<code>public Map<String, List<Integer>> readLineCoverage() { JacocoBuildAction jacocoAction = getJacocoBuildAction(); if (jacocoAction == null) { return null; } PathResolver pathResolver = new PathResolver(getWorkspace(), getSourceDirs()); HashMap<String, List<Integer>> lineCoverage = new HashMap<String, List<Integer>>(); try { <START> ExecutionFileLoader executionFileLoader = jacocoAction.getJacocoReport().parse(null, null); <END> for (IPackageCoverage packageCoverage : executionFileLoader.getBundleCoverage().getPackages()) { for (ISourceFileCoverage fileCoverage : packageCoverage.getSourceFiles()) { String relativePathFromProjectRoot = getRelativePathFromProjectRoot(pathResolver, fileCoverage); if (relativePathFromProjectRoot != null) { lineCoverage.put(relativePathFromProjectRoot, getPerLineCoverage(fileCoverage)); } } } } catch (IOException e) { e.printStackTrace(); return null; } return lineCoverage; }</code><technical_language>If need getJacocoReport(), gating this feature presence of a jacoco build step. need is for plugin in jenkins runtime components parse a coverage result. able parse result provide coverage. cobertura provider need cobertura plugin applied job either, mirror behavior adding a config option phab jenkins plugint accept path jacoco xml report</technical_language>

Target:
public Map<String, List<Integer>> readLineCoverage() { JacocoBuildAction jacocoAction = getJacocoBuildAction(); JacocoPublisher jacocoPublisher = getJacocoPublisher(); if (jacocoAction == null || jacocoPublisher == null) { return null; } PathResolver pathResolver = new PathResolver(getWorkspace(), getSourceDirs()); HashMap<String, List<Integer>> lineCoverage = new HashMap<String, List<Integer>>(); String[] includes = null; if (jacocoPublisher.getInclusionPattern() != null) { includes = new String[]{ jacocoPublisher.getInclusionPattern() }; } String[] excludes = null; if (jacocoPublisher.getExclusionPattern() != null) { excludes = new String[]{jacocoPublisher.getExclusionPattern()}; } try { ExecutionFileLoader executionFileLoader = jacocoAction.getJacocoReport().parse(includes, excludes); for (IPackageCoverage packageCoverage : executionFileLoader.getBundleCoverage().getPackages()) { for (ISourceFileCoverage fileCoverage : packageCoverage.getSourceFiles()) { String relativePathFromProjectRoot = getRelativePathFromProjectRoot(pathResolver, fileCoverage); if (relativePathFromProjectRoot != null) { lineCoverage.put(relativePathFromProjectRoot, getPerLineCoverage(fileCoverage)); } } } } catch (IOException e) { e.printStackTrace(); return null; } return lineCoverage; }
Source:
<code>public void copyTo(TemplateOptions to) { super.copyTo(to); if (to instanceof DockerTemplateOptions) { DockerTemplateOptions eTo = DockerTemplateOptions.class.cast(to); if (!volumes.isEmpty()) { eTo.volumes(volumes); } <START> if (hostname != null) { <END> eTo.hostname(hostname); } if (!dns.isEmpty()) { eTo.dns(dns); } if (memory != null) { eTo.memory(memory); } if (commands.isEmpty()) { eTo.commands(commands); } if (cpuShares != null) { eTo.cpuShares(cpuShares); } if (!env.isEmpty()) { eTo.env(env); } if (!portBindings.isEmpty()) { eTo.portBindings(portBindings); } } }</code><technical_language>null conditionals removed properties nullable null check</technical_language>

Target:
public void copyTo(TemplateOptions to) { super.copyTo(to); if (to instanceof DockerTemplateOptions) { DockerTemplateOptions eTo = DockerTemplateOptions.class.cast(to); if (!volumes.isEmpty()) { eTo.volumes(volumes); } eTo.hostname(hostname); if (!dns.isEmpty()) { eTo.dns(dns); } eTo.memory(memory); eTo.cpuShares(cpuShares); if (commands.isEmpty()) { eTo.commands(commands); } if (!env.isEmpty()) { eTo.env(env); } if (!portBindings.isEmpty()) { eTo.portBindings(portBindings); } } }
Source:
<code>private static Map<String, String> extractGenericInformation(JSONValue jsonGenericInformation) { Map<String, String> genericInformation = new HashMap<>(); if (jsonGenericInformation != null) { JSONArray genericInformationArray = jsonGenericInformation.isArray(); if (genericInformationArray != null) { <START> for (int i = 0; i < genericInformationArray.size(); i++) { <END> JSONObject genericInformationObject = genericInformationArray.get(i).isObject(); genericInformation.put(genericInformationObject.get("key").isString().stringValue(), genericInformationObject.get("value").isString().stringValue()); } } } return genericInformation; }</code><technical_language>create result Map initial capacity return empty in other cases</technical_language>

Target:
private static Map<String, String> extractGenericInformation(JSONValue jsonGenericInformation) { if (jsonGenericInformation != null) { JSONArray genericInformationArray = jsonGenericInformation.isArray(); if (genericInformationArray != null) { Map<String, String> genericInformation = new HashMap<>(genericInformationArray.size()); for (int i = 0; i < genericInformationArray.size(); i++) { JSONObject genericInformationObject = genericInformationArray.get(i).isObject(); genericInformation.put(getJsonStringValue(genericInformationObject, "key"), getJsonStringValue(genericInformationObject, "value")); } return genericInformation; } } return Collections.emptyMap(); }
Source:
<code>private String findCscCommand() throws MojoExecutionException { <START> if (!windowsModus) { <END> return cscCommand; } if (cscFolderLocation != null) { return cscFolderLocation.getAbsolutePath(); } for (File sdk : findAllInstalledSDKs(DEFAULT_CSC_PATHS)) { File file = new File(sdk, cscCommand); getLog().info( "Trying to find " + cscCommand + " in " + sdk.getAbsolutePath()); if (file.exists()) { cscFolderLocation = file.getAbsoluteFile(); return file.getAbsolutePath(); } } throw new MojoExecutionException("unable to find " + cscCommand + " in paths " + Arrays.toString(DEFAULT_CSC_PATHS) + "\n " + "You can specify the path manually by adding the argument \n" + " -DcscFolderLocation=\"C:\\path\\to\\csc.exe\""); }</code><technical_language>storing !windowsModus in a linuxModus var</technical_language>

Target:
private String findCscCommand() throws MojoExecutionException { if (isLinux()) { List<String> commands = new LinkedList<String>(); commands.add(cscCommand); commands.add("/help"); if (isMonoCommandInstalled(commands)) { return cscCommand; } throw new MojoExecutionException("The program '" + cscCommand + "' is currently not installed. You can install it by typing: " + "sudo apt-get install mono-" + cscCommand); } if (cscFolderLocation != null) { return cscFolderLocation.getAbsolutePath(); } for (File sdk : findAllInstalledSDKs(DEFAULT_CSC_PATHS)) { File file = new File(sdk, cscCommand); getLog().info( "Trying to find " + cscCommand + " in " + sdk.getAbsolutePath()); if (file.exists()) { cscFolderLocation = file.getAbsoluteFile(); return file.getAbsolutePath(); } } throw new MojoExecutionException("unable to find " + cscCommand + " in paths " + Arrays.toString(DEFAULT_CSC_PATHS) + "\n " + "You can specify the path manually by adding the argument \n" + " -DcscFolderLocation=\"C:\\path\\to\\csc.exe\""); }
Source:
<code>public static FastqQualityFormat detect(final long maxRecords, final CloseableIterator<SAMRecord> iterator) { final QualityEncodingDetector detector = new QualityEncodingDetector(); final long recordCount = detector.add(maxRecords, iterator); <START> log.debug(String.format("Read %s records from %s.", recordCount, iterator)); <END> return detector.generateBestGuess(FileContext.SAM, null); }</code><technical_language>iterator.toString() return? useful</technical_language>

Target:
public static FastqQualityFormat detect(final long maxRecords, final CloseableIterator<SAMRecord> iterator) { final QualityEncodingDetector detector = new QualityEncodingDetector(); final long recordCount = detector.add(maxRecords, iterator); log.debug(String.format("Read %s records.", recordCount)); return detector.generateBestGuess(FileContext.SAM, null); }
Source:
<code>protected <A extends AccountingLine> void validateAndPopulateAccountingLineWithDebitCreditAmounts( A accountingLine, AccountingXmlDocumentAccountingLine xmlLine) { if (hasAmountBeenSpecified(xmlLine.getAmount())) { throw new ValidationException( <START> "AV accounting line cannot use the 'amount' element to specify an amount; use the relevant debit/credit amount element instead"); <END> } KualiDecimal debitAmount = xmlLine.getDebitAmount(); KualiDecimal creditAmount = xmlLine.getCreditAmount(); if (hasAmountBeenSpecified(debitAmount)) { if (hasAmountBeenSpecified(creditAmount)) { throw new ValidationException("AV accounting line cannot specify both a debit amount and a credit amount"); } accountingLine.setDebitCreditCode(KFSConstants.GL_DEBIT_CODE); accountingLine.setAmount(debitAmount); } else if (hasAmountBeenSpecified(creditAmount)) { accountingLine.setDebitCreditCode(KFSConstants.GL_CREDIT_CODE); accountingLine.setAmount(creditAmount); } else { throw new ValidationException("AV accounting line did not specify a debit or credit amount"); } }</code><technical_language>suggesting moving this other validation exception messages properties</technical_language>

Target:
protected <A extends AccountingLine> void validateAndPopulateAccountingLineWithDebitCreditAmounts( A accountingLine, AccountingXmlDocumentAccountingLine xmlLine) { if (hasAmountBeenSpecified(xmlLine.getAmount())) { throw buildNewValidationException(CuFPKeyConstants.ERROR_CREATE_ACCOUNTING_DOCUMENT_AV_INVALID_AMOUNT_TYPE); } KualiDecimal debitAmount = xmlLine.getDebitAmount(); KualiDecimal creditAmount = xmlLine.getCreditAmount(); if (hasAmountBeenSpecified(debitAmount)) { if (hasAmountBeenSpecified(creditAmount)) { throw buildNewValidationException(CuFPKeyConstants.ERROR_CREATE_ACCOUNTING_DOCUMENT_AV_DEBIT_AND_CREDIT_AMOUNT); } accountingLine.setDebitCreditCode(KFSConstants.GL_DEBIT_CODE); accountingLine.setAmount(debitAmount); } else if (hasAmountBeenSpecified(creditAmount)) { accountingLine.setDebitCreditCode(KFSConstants.GL_CREDIT_CODE); accountingLine.setAmount(creditAmount); } else { throw buildNewValidationException(CuFPKeyConstants.ERROR_CREATE_ACCOUNTING_DOCUMENT_AV_AMOUNT_REQUIRED); } }
Source:
<code>protected ConstraintDescriptor readNonStandardConstraint( ConstraintRule rule, String errorMessage ) { if ( !rule.getConstraintDescriptor().type().enforcesPropertyExistence() ) { throw new IllegalStateException( "Unsupported constraint type: " + rule ); <START> } <END> return rule.getConstraintDescriptor(); }</code><technical_language>Do need check here? Surely enterprise edition supports constraints</technical_language>

Target:
protected ConstraintDescriptor readNonStandardConstraint( ConstraintRule rule, String errorMessage ) { if ( !rule.getConstraintDescriptor().enforcesPropertyExistence() ) { throw new IllegalStateException( "Unsupported constraint type: " + rule ); } return rule.getConstraintDescriptor(); }
Source:
<code>public void getAvailableContextAssistantTest(){ TextEditor javaTextEditor = TextEditorTest.openJavaFile(); assertFalse(javaTextEditor.getAvailableContentAssistants().isEmpty()); <START> AbstractWait.sleep(TimePeriod.SHORT); <END> }</code><technical_language>sleep</technical_language>

Target:
public void getAvailableContextAssistantTest() { TextEditor javaTextEditor = TextEditorTest.openJavaFile(); assertFalse(javaTextEditor.getAvailableContentAssistants().isEmpty()); }
Source:
<code>private LuceneQuery<PersonAttribute> getPersonAttributeLuceneQuery(String query, boolean includeVoided) { StringBuilder newQuery = new StringBuilder(); newQuery.append("value:\"").append(query).append("\""); LuceneQuery<PersonAttribute> luceneQuery = LuceneQuery .newQuery(PersonAttribute.class, sessionFactory.getCurrentSession(), newQuery.toString()); if(!includeVoided){ luceneQuery.include("voided", false); } <START> luceneQuery.skipSame("person.personId"); <END> return luceneQuery; }</code><technical_language>Is needed here? line 764 do it</technical_language>

Target:
private LuceneQuery<PersonAttribute> getPersonAttributeLuceneQuery(String query, boolean includeVoided) { StringBuilder newQuery = new StringBuilder(); newQuery.append("value:\"").append(query).append("\""); LuceneQuery<PersonAttribute> luceneQuery = LuceneQuery .newQuery(PersonAttribute.class, sessionFactory.getCurrentSession(), newQuery.toString()); if(!includeVoided){ luceneQuery.include("voided", false); luceneQuery.include("person.voided", false); } return luceneQuery; }
Source:
<code>public void testDeterminismReadOnlyNoWarning() throws Exception { HSQLInterface hsql = HSQLInterface.loadHsqldb(); VoltCompiler compiler = new VoltCompiler(false); VoltCompiler.DdlProceduresToLoad all_procs = DdlProceduresToLoad.NO_DDL_PROCEDURES; URL path = TestDeterminism.class.getResource("testplans-determinism-read-only.sql"); String pathStr = URLDecoder.decode(path.getPath(), "UTF-8"); compiler.loadSchema(hsql, all_procs, pathStr); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); compiler.summarizeSuccess(new PrintStream(outputStream), null, ""); System.out.println(outputStream.toString()); String msg = outputStream.toString(); <START> assert(!msg.contains("ND")); <END> assert(!msg.contains("WARN")); outputStream.close(); }</code><technical_language>Please assert related functions Junit instead. Also, verify some messages exists in output stream</technical_language>

Target:
public void testDeterminismReadOnlyNoWarning() throws Exception { HSQLInterface hsql = HSQLInterface.loadHsqldb(); VoltCompiler compiler = new VoltCompiler(false); VoltCompiler.DdlProceduresToLoad all_procs = DdlProceduresToLoad.NO_DDL_PROCEDURES; URL path = TestDeterminism.class.getResource("testplans-determinism-read-only.sql"); String pathStr = URLDecoder.decode(path.getPath(), "UTF-8"); compiler.loadSchema(hsql, all_procs, pathStr); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); compiler.summarizeSuccess(new PrintStream(outputStream), null, ""); System.out.println(outputStream.toString()); String msg = outputStream.toString(); assertFalse(stringContains(msg, "ND")); assertFalse(stringContains(msg, "WARN")); assertTrue(stringContains(msg, "Successfully created")); assertTrue(stringContains(msg, "Catalog contains")); outputStream.close(); }
Source:
<code>private void initPanel() { initGeneralForm(); initDisksTable(); initNicsTable(); initAppsTable(); <START> add(new ScrollPanel(generalForm), constants.generalLabel()); <END> add(new ScrollPanel(disksTable), constants.disksLabel()); add(new ScrollPanel(nicsTable), constants.nicsLabel()); add(new ScrollPanel(appsTable), constants.applicationsLabel()); vmSnapshotListModel.getSelectedItemChangedEvent().addListener(new IEventListener() { @SuppressWarnings("unchecked") @Override public void eventRaised(Event ev, Object sender, EventArgs args) { Snapshot snapshot = (Snapshot) vmSnapshotListModel.getSelectedItem(); } }); }</code><technical_language>is this support more snapshots viewable? i.e. is related selection issue</technical_language>

Target:
private void initPanel() { initGeneralForm(); initDisksTable(); initNicsTable(); initAppsTable(); add(new ScrollPanel(generalForm), constants.generalLabel()); add(new ScrollPanel(disksTable), constants.disksLabel()); add(new ScrollPanel(nicsTable), constants.nicsLabel()); add(new ScrollPanel(appsTable), constants.applicationsLabel()); }
Source:
<code>private Thread getStuckThread (Thread mainThread) { <START> if (threadGroup == null) <END> return null; Thread[] threadsInGroup = getThreadArray(threadGroup); if (threadsInGroup == null) return null; Thread stuckThread = null; long maxCpuTime = 0; for (Thread thread : threadsInGroup) { if (thread.getState() == Thread.State.RUNNABLE) { long threadCpuTime = cpuTime(thread); if (stuckThread == null || threadCpuTime > maxCpuTime) { stuckThread = thread; maxCpuTime = threadCpuTime; } } } return (stuckThread == mainThread) ? null : stuckThread; }</code><technical_language>Google Java style braces for if while statements</technical_language>

Target:
private Thread getStuckThread (Thread mainThread) { if (threadGroup == null){ return null; } Thread[] threadsInGroup = getThreadArray(threadGroup); if (threadsInGroup == null){ return null; } Thread stuckThread = null; long maxCpuTime = 0; for (Thread thread : threadsInGroup) { if (thread.getState() == Thread.State.RUNNABLE) { long threadCpuTime = cpuTime(thread); if (stuckThread == null || threadCpuTime > maxCpuTime) { stuckThread = thread; maxCpuTime = threadCpuTime; } } } return (stuckThread == mainThread) ? null : stuckThread; }
Source:
<code>protected final void validateTrade(final ISign sign, final int costIndex, final int amountIndex, final ItemStack item, final double scale, final IEssentials ess) throws SignException { final String line = sign.getLine(costIndex).trim(); if (line.isEmpty()) { return; } if (line.equalsIgnoreCase("$$")) { double price = ess.getWorth().getPrice(item) ; if (Double.isNaN(price)) { throw new SignException("no price set for item") ; } else { price = Math.round(price * scale * 100) / 100.0 ; int amount = getIntegerPositive(sign.getLine(amountIndex)); price *= amount ; <START> sign.setLine(costIndex, "<" + Util.shortCurrency(price, ess) + ">") ; <END> } } else { final Trade trade = getTrade(sign, costIndex, 0, ess); final Double money = trade.getMoney(); if (money != null) { sign.setLine(costIndex, Util.shortCurrency(money, ess)); } } }</code><technical_language>line length check here</technical_language>

Target:
protected final void validateTrade(final ISign sign, final int costIndex, final int amountIndex, final ItemStack item, final double scale, final IEssentials ess) throws SignException { final String line = sign.getLine(costIndex).trim(); if (line.isEmpty()) { return; } if (line.equalsIgnoreCase("$$")) { double price = ess.getWorth().getPrice(item) ; if (Double.isNaN(price)) { throw new SignException("no price set for item") ; } else { price = Math.round(price * scale * 100) / 100.0 ; int amount = getIntegerPositive(sign.getLine(amountIndex)); price *= amount ; String linestr = "<" + Util.shortCurrency(price, ess) + ">"; if (linestr.length() > 15) throw new SignException("price is too large to print on sign") ; sign.setLine(costIndex, linestr) ; } } else { final Trade trade = getTrade(sign, costIndex, 0, ess); final Double money = trade.getMoney(); if (money != null) { sign.setLine(costIndex, Util.shortCurrency(money, ess)); } } }
Source:
<code>public List<String> showAllLocks() { List<String> returnValue; <START> log.warn("All in memory locks will be shown"); <END> globalLock.lock(); try { returnValue = new ArrayList<String>(); for(Map.Entry<String, InternalLockView> entry : locks.entrySet()) { String lock = new StringBuilder("The object id is : ").append(entry.getKey()).append(' ').append(entry.getValue()).toString(); returnValue.add(lock); } } finally { globalLock.unlock(); } log.warn("All in memory locks were shown"); return returnValue; }</code><technical_language>please change this log message debug</technical_language>

Target:
public List<String> showAllLocks() { List<String> returnValue; log.debug("All in memory locks will be shown"); globalLock.lock(); try { returnValue = new ArrayList<String>(); for(Map.Entry<String, InternalLockView> entry : locks.entrySet()) { String lock = new StringBuilder("The object id is : ").append(entry.getKey()).append(' ').append(entry.getValue()).toString(); returnValue.add(lock); } } finally { globalLock.unlock(); } log.debug("All in memory locks were shown"); return returnValue; }
Source:
<code>private int getExclusiveBottomIndexEndOffset() { if (fViewer != null && fViewer.getTextWidget() != null && !fViewer.getTextWidget().isDisposed()) { int bottom= JFaceTextUtil.getPartialBottomIndex(fViewer); try { IDocument document= fViewer.getDocument(); <START> if (bottom >= document.getNumberOfLines()) bottom= document.getNumberOfLines() - 1; <END> return document.getLineOffset(bottom) + document.getLineLength(bottom); } catch (BadLocationException x) { } } return -1; }</code><technical_language>please block quotes for single-line statements in general new changed code</technical_language>

Target:
private int getExclusiveBottomIndexEndOffset() { if (fViewer != null && fViewer.getTextWidget() != null && !fViewer.getTextWidget().isDisposed()) { int bottom= JFaceTextUtil.getPartialBottomIndex(fViewer); try { IDocument document= fViewer.getDocument(); if (bottom >= document.getNumberOfLines()) { bottom= document.getNumberOfLines() - 1; } return document.getLineOffset(bottom) + document.getLineLength(bottom); } catch (BadLocationException x) { } } return -1; }
Source:
<code>private void verifyState(QueryPlan queryPlan) throws LockException { if(!isTxnOpen()) { throw new LockException("No transaction context for operation: " + queryPlan.getOperationName() + " for " + getQueryIdWaterMark(queryPlan)); } if(queryPlan.getOperation() == null) { <START> throw new IllegalStateException("Unkown HiveOperation(null) for " + getQueryIdWaterMark(queryPlan)); <END> } numStatements++; switch (queryPlan.getOperation()) { case START_TRANSACTION: markExplicitTransaction(queryPlan); break; case COMMIT: case ROLLBACK: if(!isTxnOpen()) { throw new LockException(null, ErrorMsg.OP_NOT_ALLOWED_WITHOUT_TXN, queryPlan.getOperationName()); } if(!isExplicitTransaction) { throw new LockException(null, ErrorMsg.OP_NOT_ALLOWED_IN_IMPLICIT_TXN, queryPlan.getOperationName()); } break; default: if(!queryPlan.getOperation().isAllowedInTransaction() && isExplicitTransaction) { if(allowOperationInATransaction(queryPlan)) { break; } throw new LockException(null, ErrorMsg.OP_NOT_ALLOWED_IN_TXN, queryPlan.getOperationName(), JavaUtils.txnIdToString(getCurrentTxnId()), queryPlan.getQueryId()); } } }</code><technical_language>Typo: Unkown -> Unknown</technical_language>

Target:
private void verifyState(QueryPlan queryPlan) throws LockException { if(!isTxnOpen()) { throw new LockException("No transaction context for operation: " + queryPlan.getOperationName() + " for " + getQueryIdWaterMark(queryPlan)); } if(queryPlan.getOperation() == null) { throw new IllegalStateException("Unknown HiveOperation(null) for " + getQueryIdWaterMark(queryPlan)); } numStatements++; switch (queryPlan.getOperation()) { case START_TRANSACTION: markExplicitTransaction(queryPlan); break; case COMMIT: case ROLLBACK: if(!isTxnOpen()) { throw new LockException(null, ErrorMsg.OP_NOT_ALLOWED_WITHOUT_TXN, queryPlan.getOperationName()); } if(!isExplicitTransaction) { throw new LockException(null, ErrorMsg.OP_NOT_ALLOWED_IN_IMPLICIT_TXN, queryPlan.getOperationName()); } break; default: if(!queryPlan.getOperation().isAllowedInTransaction() && isExplicitTransaction) { if(allowOperationInATransaction(queryPlan)) { break; } throw new LockException(null, ErrorMsg.OP_NOT_ALLOWED_IN_TXN, queryPlan.getOperationName(), JavaUtils.txnIdToString(getCurrentTxnId()), queryPlan.getQueryId()); } } }
Source:
<code>protected void setUpTaskList() { if (filter == null) return; String joinedTaskRabbitQuery = Join.left(Metadata.TABLE, Criterion.and(Metadata.KEY.eq(TaskRabbitMetadata.METADATA_KEY), Task.ID.eq(Metadata.TASK))) <START> + filter.getSqlQuery(); <END> sqlQueryTemplate.set(SortHelper.adjustQueryForFlagsAndSort( joinedTaskRabbitQuery, sortFlags, sortSort)); TodorooCursor<Task> currentCursor; try { currentCursor = taskService.fetchFiltered( sqlQueryTemplate.get(), null, taskProperties()); } catch (SQLiteException e) { StartupService.handleSQLiteColumnMissing(getActivity(), e); return; } taskAdapter = createTaskAdapter(currentCursor); setListAdapter(taskAdapter); getListView().setOnScrollListener(this); registerForContextMenu(getListView()); loadTaskListContent(true); }</code><technical_language>alias this join</technical_language>

Target:
protected void setUpTaskList() { if (filter == null) return; String joinedTaskRabbitQuery = Join.left(Metadata.TABLE.as(TR_METADATA_JOIN), Criterion.and(Field.field(TR_METADATA_JOIN + "." + Metadata.KEY.name).eq(TaskRabbitMetadata.METADATA_KEY), Task.ID.eq(Field.field(TR_METADATA_JOIN) + "." + Metadata.TASK.name))) + filter.getSqlQuery(); sqlQueryTemplate.set(SortHelper.adjustQueryForFlagsAndSort( joinedTaskRabbitQuery, sortFlags, sortSort)); TodorooCursor<Task> currentCursor; try { currentCursor = taskService.fetchFiltered( sqlQueryTemplate.get(), null, taskProperties()); } catch (SQLiteException e) { StartupService.handleSQLiteColumnMissing(getActivity(), e); return; } taskAdapter = createTaskAdapter(currentCursor); setListAdapter(taskAdapter); getListView().setOnScrollListener(this); registerForContextMenu(getListView()); loadTaskListContent(true); }