auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean conflictDetected(AbstractDiagramBorderNodeEditPart editPart, Point moveDelta) { BorderNodeCollapseManager borderNodeCollapseManager = new BorderNodeCollapseManager(); IBorderItemLocator locator = editPart.getBorderItemLocator(); IFigure figure = editPart.getFigure(); Rectangle bounds = figure.getBounds().getCopy(); bounds.translate(moveDelta); Rectangle newBounds = borderNodeCollapseManager.expandCollapsedNodeBounds(editPart, new PrecisionRectangle(bounds)); if (newBounds != null) { bounds.setBounds(newBounds); } Rectangle validLocation = <START> locator.getValidLocation(bounds, <END> figure); if (borderNodeCollapseManager.hasBeenExpanded()) { borderNodeCollapseManager.restoreCollapsedNode(editPart); } return !validLocation.equals(bounds); }</code><technical_language>this locator takes compound move account ? If borderNodes A end B moved edges moved, a common parent, this method dound a conflict A moves uppon previous location of B B moved conflicts</technical_language>

Target:
private boolean conflictDetected(AbstractDiagramBorderNodeEditPart editPart, Point moveDelta) { BorderNodeCollapseManager borderNodeCollapseManager = new BorderNodeCollapseManager(); IBorderItemLocator locator = editPart.getBorderItemLocator(); IFigure figure = editPart.getFigure(); Rectangle bounds = figure.getBounds().getCopy(); bounds.translate(moveDelta); Rectangle newBounds = borderNodeCollapseManager.expandCollapsedNodeBounds(editPart, new PrecisionRectangle(bounds)); if (newBounds != null) { bounds.setBounds(newBounds); } List<IFigure> figureToIgnore = Lists.newArrayList(); figureToIgnore.add(figure); for (ConnectionEditPart connectionEditPart : Iterables.filter(editPart.getViewer().getSelectedEditParts(), ConnectionEditPart.class)) { EditPart source = connectionEditPart.getSource(); EditPart target = connectionEditPart.getTarget(); if (source instanceof AbstractDiagramBorderNodeEditPart && source.getParent().equals(editPart.getParent())) { figureToIgnore.add(((AbstractDiagramBorderNodeEditPart) source).getFigure()); } if (target instanceof AbstractDiagramBorderNodeEditPart && target.getParent().equals(editPart.getParent())) { figureToIgnore.add(((AbstractDiagramBorderNodeEditPart) target).getFigure()); } } Rectangle validLocation = ((DBorderItemLocator) locator).getValidLocation(bounds, figure, figureToIgnore); if (borderNodeCollapseManager.hasBeenExpanded()) { borderNodeCollapseManager.restoreCollapsedNode(editPart); } return !validLocation.equals(bounds); }
Source:
<code>protected boolean verifyByCallback(long timeout, List<ClusterVerifyTrigger> triggers) { _countdown = new CountDownLatch(1); for (ClusterVerifyTrigger trigger : triggers) { subscribeTrigger(trigger); } boolean success = false; try { success = verifyState(); if (!success) { success = _countdown.await(timeout, TimeUnit.MILLISECONDS); if (!success) { success = verifyState(); if (!success) { LOG.error("verifyByCallback failed due to timeout, with stack trace {}", <START> Arrays.asList(Thread.currentThread().getStackTrace())); <END> } } } } catch (Exception e) { LOG.error("Exception in verifier {}", e); } _zkClient.unsubscribeAll(); _verifyTaskThreadPool.shutdownNow(); return success; }</code><technical_language>Stack trace debug log</technical_language>

Target:
protected boolean verifyByCallback(long timeout, List<ClusterVerifyTrigger> triggers) { _countdown = new CountDownLatch(1); for (ClusterVerifyTrigger trigger : triggers) { subscribeTrigger(trigger); } boolean success = false; try { success = verifyState(); if (!success) { success = _countdown.await(timeout, TimeUnit.MILLISECONDS); if (!success) { success = verifyState(); if (!success) { LOG.error("verifyByCallback failed due to timeout {}", timeout); } } } } catch (Exception e) { LOG.error("Exception in verifier", e); } _zkClient.unsubscribeAll(); _verifyTaskThreadPool.shutdownNow(); return success; }
Source:
<code>public static Properties loadAllKeys() { Properties keyProperties = new Properties(); try (InputStream fi = ComponentKeySource.class.getResourceAsStream(DEFAULT_KEY_FILE_NAME)) { keyProperties.load(fi); } catch (IOException e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); } String keyPath = System.getProperty(ENCRYPTION_KEY_FILE_SYS_PROP); if (keyPath != null) { File keyFile = new File(keyPath); if (keyFile.exists()) { try (InputStream fi = new FileInputStream(keyFile)) { keyProperties.load(fi); } catch (IOException e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); } } } System.getProperties().forEach((k, v) -> { <START> String key = String.valueOf(v); <END> if (key.startsWith(KEY_SYSTEM_PREFIX)) { keyProperties.put(key, v); } }); if (LOGGER.isLoggable(Level.FINER)) { keyProperties.stringPropertyNames().forEach((k) -> LOGGER.info(k)); } return keyProperties; }</code><technical_language>this String.valueOf(k) here</technical_language>

Target:
public static Properties loadAllKeys() { Properties keyProperties = new Properties(); try (InputStream fi = ComponentKeySource.class.getResourceAsStream(DEFAULT_KEY_FILE_NAME)) { keyProperties.load(fi); } catch (IOException e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); } String keyPath = System.getProperty(ENCRYPTION_KEY_FILE_SYS_PROP); if (keyPath != null) { File keyFile = new File(keyPath); if (keyFile.exists()) { Properties tempProperties = new Properties(); try (InputStream fi = new FileInputStream(keyFile)) { tempProperties.load(fi); } catch (IOException e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); } tempProperties.forEach((k, v) -> { String key = String.valueOf(k); if (key.startsWith(KEY_SYSTEM_PREFIX)) { keyProperties.put(key, v); } }); } } System.getProperties().forEach((k, v) -> { String key = String.valueOf(k); if (key.startsWith(KEY_SYSTEM_PREFIX)) { keyProperties.put(key, v); } }); if (LOGGER.isLoggable(Level.FINER)) { keyProperties.stringPropertyNames().forEach((k) -> LOGGER.log(Level.FINER, k)); } return keyProperties; }
Source:
<code>protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo, ScmFileSet fileSet, Date startDate, Date endDate, ScmBranch branch, String datePattern, ScmVersion startVersion, ScmVersion endVersion ) throws ScmException { Git git = null; <START> boolean isARangeChangeLog = startVersion != null || endVersion != null; <END> try { git = JGitUtils.openRepo( fileSet.getBasedir() ); String startRev = startVersion != null ? startVersion.getName() : ( isARangeChangeLog ? "HEAD" : null); String endRev = endVersion != null ? endVersion.getName() : ( isARangeChangeLog ? "HEAD" : null); List<ChangeEntry> gitChanges = this.whatchanged( git.getRepository(), null, startRev, endRev, startDate, endDate, -1 ); List<ChangeSet> modifications = new ArrayList<ChangeSet>( gitChanges.size() ); for ( ChangeEntry change : gitChanges ) { ChangeSet scmChange = new ChangeSet(); scmChange.setAuthor( change.getAuthorName() ); scmChange.setComment( change.getBody() ); scmChange.setDate( change.getAuthorDate() ); scmChange.setRevision( change.getCommitHash() ); modifications.add( scmChange ); } ChangeLogSet changeLogSet = new ChangeLogSet( modifications, startDate, endDate ); changeLogSet.setStartVersion( startVersion ); changeLogSet.setEndVersion( endVersion ); return new ChangeLogScmResult( "JGit changelog", changeLogSet ); } catch ( Exception e ) { throw new ScmException( "JGit changelog failure!", e ); } finally { JGitUtils.closeRepo( git ); } }</code><technical_language>this name inconsistent gitexe provider</technical_language>

Target:
protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo, ScmFileSet fileSet, Date startDate, Date endDate, ScmBranch branch, String datePattern, ScmVersion startVersion, ScmVersion endVersion ) throws ScmException { return executeChangeLogCommand( repo, fileSet, startDate, endDate, branch, datePattern, startVersion, endVersion, null ); }
Source:
<code>public PushResponse push(PushRequest request) throws GitException, UnauthorizedException { String remoteName = request.getRemote(); String remoteUri = getRepository().getConfig().getString(ConfigConstants.CONFIG_REMOTE_SECTION, remoteName, ConfigConstants.CONFIG_KEY_URL); try { PushCommand pushCommand = getGit().push(); if (request.getRemote() != null) { pushCommand.setRemote(remoteName); } List<String> refSpec = request.getRefSpec(); if (!refSpec.isEmpty()) { List<RefSpec> refSpecInst = new ArrayList<>(refSpec.size()); refSpecInst.addAll(refSpec.stream().map(RefSpec::new).collect(Collectors.toList())); pushCommand.setRefSpecs(refSpecInst); } pushCommand.setForce(request.isForce()); int timeout = request.getTimeout(); if (timeout > 0) { pushCommand.setTimeout(timeout); } @SuppressWarnings("unchecked") <START> Iterable<PushResult> list = (Iterable<PushResult>)executeRemoteCommand(remoteUri, pushCommand); <END> PushResult pushResult = list.iterator().next(); String currentBranch = getCurrentBranch(); return generatePushResponse(request, pushResult, currentBranch); } catch (GitAPIException exception) { return newDto(PushResponse.class).withCommandOutput(exception.getMessage()); } }</code><technical_language>Please rename this variable list pushResults for example</technical_language>

Target:
public PushResponse push(PushRequest request) throws GitException, UnauthorizedException { String remoteName = request.getRemote(); String remoteUri = getRepository().getConfig().getString(ConfigConstants.CONFIG_REMOTE_SECTION, remoteName, ConfigConstants.CONFIG_KEY_URL); PushResponse pushResponseDto = newDto(PushResponse.class); try { PushCommand pushCommand = getGit().push(); if (request.getRemote() != null) { pushCommand.setRemote(remoteName); } List<String> refSpec = request.getRefSpec(); if (!refSpec.isEmpty()) { List<RefSpec> refSpecInst = new ArrayList<>(refSpec.size()); refSpecInst.addAll(refSpec.stream().map(RefSpec::new).collect(Collectors.toList())); pushCommand.setRefSpecs(refSpecInst); } pushCommand.setForce(request.isForce()); int timeout = request.getTimeout(); if (timeout > 0) { pushCommand.setTimeout(timeout); } @SuppressWarnings("unchecked") Iterable<PushResult> pushResults = (Iterable<PushResult>)executeRemoteCommand(remoteUri, pushCommand); PushResult pushResult = pushResults.iterator().next(); return addCommandOutputUpdates(pushResponseDto, request, pushResult); } catch (GitAPIException exception) { if ("origin: not found.".equals(exception.getMessage())) { throw new GitException(ERROR_NO_REMOTE_REPOSITORY, exception); } else { throw new GitException(exception.getMessage(), exception); } } }
Source:
<code>public List<ChangeMessage> byChange(ReviewDb db, ChangeNotes notes) throws OrmException { List<ChangeMessage> <START> changeMessages; <END> if (!migration.readChangeMessages()) { ImmutableListMultimap.Builder<PatchSet.Id, ChangeMessage> result = ImmutableListMultimap.builder(); for (ChangeMessage cm : db.changeMessages().byChange(notes.getChangeId())) { result.put(cm.getPatchSetId(), cm); } changeMessages = sortChangeMessages(result.build().values()); } else { changeMessages = sortChangeMessages(notes.load().getChangeMessages().values()); } return changeMessages; }</code><technical_language>Unneeded, return direct if else branches</technical_language>

Target:
public List<ChangeMessage> byChange(ReviewDb db, ChangeNotes notes) throws OrmException { if (!migration.readChangeMessages()) { ImmutableListMultimap.Builder<PatchSet.Id, ChangeMessage> result = ImmutableListMultimap.builder(); for (ChangeMessage cm : db.changeMessages().byChange(notes.getChangeId())) { result.put(cm.getPatchSetId(), cm); } return sortChangeMessages(result.build().values()); } else { return sortChangeMessages(notes.load().getChangeMessages().values()); } }
Source:
<code>public static SampleDto asMinimalDto(Sample from) { DetailedSampleDto dto = new DetailedSampleDto(); if (isDetailedSample(from)) { dto.setSampleClassId(((DetailedSample) from).getSampleClass().getId()); } dto.setId(from.getId()); dto.setName(from.getName()); dto.setDescription(from.getDescription()); dto.setUpdatedById(from.getLastModifier().getUserId()); if (!isStringEmptyOrNull(from.getIdentificationBarcode())) { <START> dto.setIdentificationBarcode(from.getIdentificationBarcode()); <END> } dto.setLocationLabel(BoxUtils.makeLocationLabel(from)); dto.setBoxId(from.getBox() == null ? null : from.getBox().getId()); dto.setSampleType(from.getSampleType()); if (from.getReceivedDate() != null) { dto.setReceivedDate(dateTimeFormatter.print(from.getReceivedDate().getTime())); } if (from.getQcPassed() != null) { dto.setQcPassed(from.getQcPassed()); } if (!isStringEmptyOrNull(from.getAlias())) { dto.setAlias(from.getAlias()); } dto.setProjectId(from.getProject().getProjectId()); dto.setScientificName(from.getScientificName()); if (!isStringEmptyOrNull(from.getTaxonIdentifier())) { dto.setTaxonIdentifier(from.getTaxonIdentifier()); } dto.setVolume(from.getVolume()); dto.setDiscarded(from.isDiscarded()); dto.setLastModified(getDateAsString(from.getLastModified())); return dto; }</code><technical_language>put plain sample setters a separate method call method asDto(Sample) avoid duplication</technical_language>

Target:
public static SampleDto asMinimalDto(Sample from) { DetailedSampleDto dto = new DetailedSampleDto(); copySampleFields(from, dto); if (isDetailedSample(from)) { dto.setSampleClassId(((DetailedSample) from).getSampleClass().getId()); } return dto; }
Source:
<code>public boolean shouldWarn(SolGame game) { hero = game.getHero(); if (hero.isTranscendent()) { return false; } Vector2 position = hero.getPosition(); Vector2 velocity = hero.getVelocity(); float acc = hero.getAcceleration(); float speed = velocity.len(); <START> float speedAngle = SolMath.angle(velocity); <END> if (acc <= 0 || speed < 2 * acc) { return false; } float breakWay = speed * speed / acc / 2; breakWay += 2 * speed; Vector2 finalPos = SolMath.getVec(0, 0); SolMath.fromAl(finalPos, speedAngle, breakWay); finalPos.add(position); warnCallback.show = false; game.getObjectManager().getWorld().rayCast(warnCallback, position, finalPos); SolMath.free(finalPos); return warnCallback.show; }</code><technical_language>velocityAngle</technical_language>

Target:
public boolean shouldWarn(SolGame game) { hero = game.getHero(); if (hero.isTranscendent()) { return false; } Vector2 position = hero.getPosition(); Vector2 velocity = hero.getVelocity(); float acc = hero.getAcceleration(); float speed = velocity.len(); float velocityAngle = SolMath.angle(velocity); if (acc <= 0 || speed < 2 * acc) { return false; } float breakWay = speed * speed / acc / 2; breakWay += 2 * speed; Vector2 finalPos = SolMath.getVec(0, 0); SolMath.fromAl(finalPos, velocityAngle, breakWay); finalPos.add(position); warnCallback.show = false; game.getObjectManager().getWorld().rayCast(warnCallback, position, finalPos); SolMath.free(finalPos); return warnCallback.show; }
Source:
<code>public void displaying_a_custom_build_description() throws Exception { givenThat(dave).wasAbleTo( Navigate.to(jenkins.url()), HaveAProjectCreated.called("Example Github Project").andConfiguredTo( ExecuteAShellScript.that(outputsGithubProjectLog()), <START> SetBuildDescription.to("Revision: \\1").basedOnLogLineMatching("Checking out Revision ([^\\w]{6})") <END> ), ScheduleABuild.of("Example Github Project") ); when(dave).attemptsTo(HaveABuildMonitorViewCreated.showingAllTheProjects()); then(dave).should(seeThat(ProjectWidget.of("Example Github Project").details(), is("Revision: 67f4b3"))); }</code><technical_language>\\s is a space, [^\\s] is _but_ space. [^\\s]{6} means "6 characters a space". [^\\w]{6})" means "6 characters a 'word character'", [A-Za-z0-9_], meant</technical_language>

Target:
public void displaying_a_custom_build_description() throws Exception { givenThat(dave).wasAbleTo( Navigate.to(jenkins.url()), HaveAProjectCreated.called("Example Github Project").andConfiguredTo( ExecuteAShellScript.that(outputsGithubProjectLog()), SetBuildDescription.to("Revision: \\1").basedOnLogLineMatching("Checking out Revision ([\\w]{6})") ), ScheduleABuild.of("Example Github Project") ); when(dave).attemptsTo(HaveABuildMonitorViewCreated.showingAllTheProjects()); then(dave).should(seeThat(ProjectWidget.of("Example Github Project").details(), is("Revision: 67f4b3"))); }
Source:
<code>public MethodOutcome createFHIRPractitioner(@ResourceParam Practitioner practitioner) { practitioner = practitionerResource.createFHIRPractitioner(practitioner); MethodOutcome retVal = new MethodOutcome(); retVal.setId(new IdDt(FHIRConstants.PERSON, practitioner.getId())); OperationOutcome outcome = new OperationOutcome(); CodeableConcept concept = new CodeableConcept(); Coding coding = concept.addCoding(); <START> coding.setDisplay("Practitioner is successfully created"); <END> outcome.addIssue().setDetails(concept); retVal.setOperationOutcome(outcome); return retVal; }</code><technical_language>move messages constants</technical_language>

Target:
public MethodOutcome createFHIRPractitioner(@ResourceParam Practitioner practitioner) { practitioner = practitionerResource.createFHIRPractitioner(practitioner); MethodOutcome retVal = new MethodOutcome(); retVal.setId(new IdType(FHIRConstants.PERSON, practitioner.getId())); OperationOutcome outcome = new OperationOutcome(); CodeableConcept concept = new CodeableConcept(); Coding coding = concept.addCoding(); coding.setDisplay("Practitioner is successfully created with id " + practitioner.getId()); outcome.addIssue().setDetails(concept); retVal.setOperationOutcome(outcome); return retVal; }
Source:
<code>public void cancelFlow(ExecutableFlow exFlow, String userId) throws ExecutorManagerException { synchronized (exFlow) { if (runningFlows.containsKey(exFlow.getExecutionId())) { Pair<ExecutionReference, ExecutableFlow> pair = runningFlows.get(exFlow.getExecutionId()); callExecutorServer(pair.getFirst(), ConnectorParams.CANCEL_ACTION, userId); <START> } else if (queuedFlowMap.containsKey(exFlow.getExecutionId())) { <END> Pair<ExecutionReference, ExecutableFlow> pair = queuedFlowMap.get(exFlow.getExecutionId()); synchronized (pair) { dequeueFlow(exFlow.getExecutionId()); finalizeFlows(exFlow); } } else { throw new ExecutorManagerException("Execution " + exFlow.getExecutionId() + " of flow " + exFlow.getFlowId() + " isn't running."); } } }</code><technical_language>thinking, do check in queuedFlowMap first, check in runningFlows? is slim chance of check is performed RunningFlows, out of queue, check queue, is in RunningFlows</technical_language>

Target:
public void cancelFlow(ExecutableFlow exFlow, String userId) throws ExecutorManagerException { synchronized (exFlow) { if (runningFlows.containsKey(exFlow.getExecutionId())) { Pair<ExecutionReference, ExecutableFlow> pair = runningFlows.get(exFlow.getExecutionId()); callExecutorServer(pair.getFirst(), ConnectorParams.CANCEL_ACTION, userId); } else if (queuedFlows.hasExecution(exFlow.getExecutionId())) { queuedFlows.dequeue(exFlow.getExecutionId()); finalizeFlows(exFlow); } else { throw new ExecutorManagerException("Execution " + exFlow.getExecutionId() + " of flow " + exFlow.getFlowId() + " isn't running."); } } }
Source:
<code>public MaxwellContext(MaxwellConfig config) { this.config = config; this.replicationConnectionPool = new ConnectionPool("ReplicationConnectionPool", 10, 0, 10, config.replicationMysql.getConnectionURI(), config.replicationMysql.user, config.replicationMysql.password); <START> this.rawMaxwellConnectionPool = new ConnectionPool("RawMaxwellConenectionPool", 1, 2, 100, <END> config.maxwellMysql.getConnectionURI(false), config.maxwellMysql.user, config.maxwellMysql.password); this.maxwellConnectionPool = new ConnectionPool("MaxwellConnectionPool", 10, 0, 10, config.maxwellMysql.getConnectionURI(), config.maxwellMysql.user, config.maxwellMysql.password); this.maxwellConnectionPool.setCaching(false); if ( this.config.initPosition != null ) this.initialPosition = this.config.initPosition; }</code><technical_language>typo Conenection</technical_language>

Target:
public MaxwellContext(MaxwellConfig config) { this.config = config; this.replicationConnectionPool = new ConnectionPool("ReplicationConnectionPool", 10, 0, 10, config.replicationMysql.getConnectionURI(false), config.replicationMysql.user, config.replicationMysql.password); this.rawMaxwellConnectionPool = new ConnectionPool("RawMaxwellConnectionPool", 1, 2, 100, config.maxwellMysql.getConnectionURI(false), config.maxwellMysql.user, config.maxwellMysql.password); this.maxwellConnectionPool = new ConnectionPool("MaxwellConnectionPool", 10, 0, 10, config.maxwellMysql.getConnectionURI(), config.maxwellMysql.user, config.maxwellMysql.password); this.maxwellConnectionPool.setCaching(false); if ( this.config.initPosition != null ) this.initialPosition = this.config.initPosition; }
Source:
<code>public boolean accepts(final JSONObject event) { final EventValidator validator = qualifiedValidators.stream().filter(it -> it.getQualifier().getMatch().equals( event.getString(it.getQualifier().getField()))) .map(EventValidator.class::cast).findFirst().orElse( <START> defaultSchemaValidator); <END> return validator.accepts(event); }</code><technical_language>sold soul Jalopy :-P</technical_language>

Target:
public boolean accepts(final JSONObject event) { final Predicate<QualifiedJSONSchemaValidator> matchingQualifier = it -> it.getQualifier().getMatch().equals(event.getString(it.getQualifier().getField())); final EventValidator validator = qualifiedValidators.stream().filter(matchingQualifier) .map(EventValidator.class::cast).findFirst().orElse( defaultSchemaValidator); return validator.accepts(event); }
Source:
<code>public static void delayUntilTraceOpened(final ITmfProjectModelElement projectElement) throws TimeoutException { if (projectElement instanceof TmfTraceElement) { TmfTraceElement traceElement = (TmfTraceElement) projectElement; <START> int cnt = 0; <END> while ((traceElement.getTrace() == null) && (cnt++ < DELAY_COUNTER)) { delayThread(DEFAULT_DELAY); } if (traceElement.getTrace() == null) { throw new TimeoutException(); } } else { delayThread(DEFAULT_DELAY); } }</code><technical_language>final long deadline = system.nanotime() + DELAY_COUNTER+DEFAULT_DELAY*1000000; while( traceElement.getTrace() == null ){ delayThread(DEFAULT_DELAY); if( System.nanotime() > deadline) { throw new TimeoutException("Timeout while waiting for " + TmfTraceElement.toString()); }</technical_language>

Target:
public static void delayUntilTraceOpened(final ITmfProjectModelElement projectElement) throws TimeoutException { if (projectElement instanceof TmfTraceElement) { TmfTraceElement traceElement = (TmfTraceElement) projectElement; final long deadline = System.nanoTime() + (DELAY_COUNTER * DEFAULT_DELAY * 1000000); do { delayThread(DEFAULT_DELAY); if (traceElement.getTrace() != null) { return; } } while (System.nanoTime() < deadline); throw new TimeoutException("Timeout while waiting for " + traceElement); } delayThread(DEFAULT_DELAY); }
Source:
<code>private JClassType getBootstrapper() throws UnableToCompleteException { <START> String typeName = lookupTypeNameByProperty("gwtp.bootstrapper"); <END> if (typeName == null) { getTreeLogger() .log(TreeLogger.ERROR, "Error reading required configuration property 'gwtp.bootstrapper'!."); throw new UnableToCompleteException(); } return findAndVerifyType(typeName, Bootstrapper.class); }</code><technical_language>Static string constants</technical_language>

Target:
private JClassType getBootstrapper() throws UnableToCompleteException { String typeName = lookupTypeNameByProperty(PROPERTY_NAME_BOOTSTRAPPER); if (typeName == null) { getTreeLogger() .log(TreeLogger.ERROR, PROPERTY_BOOTSTRAPPER_EMPTY); throw new UnableToCompleteException(); } return findAndVerifyType(typeName, Bootstrapper.class); }
Source:
<code>public static Channel execRemote(String[] args, OutputStream out, OutputStream err, String user, String host, String password, int port, String[] envp) throws JSchException { JSch jsch = new JSch(); Session session = jsch.getSession(user, host, port); session.setPassword(password); <START> java.util.Properties config = new java.util.Properties(); <END> config.put("StrictHostKeyChecking", "no"); session.setConfig(config); session.connect(); StringBuilder command = new StringBuilder(); if (envp != null) { for (String var : envp) { command.append(String.format("export %s; ", var)); } } for (int i = 0; i < args.length; i++) { command.append(args[i] + ' '); } ChannelExec channel = (ChannelExec) session.openChannel("exec"); channel.setCommand(command.toString()); channel.setInputStream(null, true); channel.setOutputStream(out, true); channel.setExtOutputStream(err, true); channel.connect(); return channel; }</code><technical_language>Do need fully qualified here</technical_language>

Target:
public static Channel execRemote(String[] args, OutputStream out, OutputStream err, String user, String host, String password, int port, String[] envp) throws JSchException { JSch jsch = new JSch(); Session session = jsch.getSession(user, host, port); session.setPassword(password); Properties config = new Properties(); config.put("StrictHostKeyChecking", "no"); session.setConfig(config); session.connect(); StringBuilder command = new StringBuilder(); if (envp != null) { for (String var : envp) { command.append(String.format("export %s; ", var)); } } for (int i = 0; i < args.length; i++) { command.append(args[i] + ' '); } ChannelExec channel = (ChannelExec) session.openChannel("exec"); channel.setCommand(command.toString()); channel.setInputStream(null, true); channel.setOutputStream(out, true); channel.setExtOutputStream(err, true); channel.connect(); return channel; }
Source:
<code>public void emit(Event event) { if (event instanceof ServiceMetricEvent) { ServiceMetricEvent metricEvent = (ServiceMetricEvent) event; <START> String host = metricEvent.getHost(); <END> String service = metricEvent.getService(); String metric = metricEvent.getMetric(); Map<String, Object> userDims = metricEvent.getUserDims(); Number value = metricEvent.getValue(); ImmutableList.Builder<String> nameBuilder = new ImmutableList.Builder<>(); LinkedHashMap<String, String> dims = new LinkedHashMap<>(); final DropwizardMetricSpec metricSpec = converter.addFilteredUserDims(service, metric, userDims, dims); if (metricSpec != null) { if (config.isIncludeDimensionNames()) { if (config.getPrefix() != null) { nameBuilder.add(config.getPrefix()); } nameBuilder.add("metric=" + metric); nameBuilder.add("service=" + service); if (config.getIncludeHost()) { nameBuilder.add("hostname=" + host); } dims.forEach((key, value1) -> nameBuilder.add(key + "=" + value1)); } else { nameBuilder.add(metric); nameBuilder.add(service); if (config.getIncludeHost()) { nameBuilder.add(host); } nameBuilder.addAll(dims.values()); } String fullName = StringUtils.replaceChar(Joiner.on(",").join(nameBuilder.build()), '/', "."); updateMetric(fullName, value, metricSpec); } else { log.debug("Service=[%s], Metric=[%s] has no mapping", service, metric); } } else if (event instanceof AlertEvent) { for (Emitter emitter : alertEmitters) { emitter.emit(event); } } else { throw new ISE("unknown event type [%s]", event.getClass()); } }</code><technical_language>guarding this check for start set</technical_language>

Target:
public void emit(Event event) { synchronized (started) { if (!started.get()) { throw new RejectedExecutionException("Dropwizard emitter Service not started."); } } if (event instanceof ServiceMetricEvent) { ServiceMetricEvent metricEvent = (ServiceMetricEvent) event; String host = metricEvent.getHost(); String service = metricEvent.getService(); String metric = metricEvent.getMetric(); Map<String, Object> userDims = metricEvent.getUserDims(); Number value = metricEvent.getValue(); ImmutableList.Builder<String> nameBuilder = new ImmutableList.Builder<>(); LinkedHashMap<String, String> dims = new LinkedHashMap<>(); final DropwizardMetricSpec metricSpec = converter.addFilteredUserDims(service, metric, userDims, dims); if (metricSpec != null) { if (config.getPrefix() != null) { nameBuilder.add(config.getPrefix()); } nameBuilder.add(StringUtils.format("metric=%s", metric)); nameBuilder.add(StringUtils.format("service=%s", service)); if (config.getIncludeHost()) { nameBuilder.add(StringUtils.format("hostname=%s", host)); } dims.forEach((key, value1) -> nameBuilder.add(StringUtils.format("%s=%s", key, value1))); String fullName = StringUtils.replaceChar(Joiner.on(",").join(nameBuilder.build()), '/', "."); updateMetric(fullName, value, metricSpec); } else { log.debug("Service=[%s], Metric=[%s] has no mapping", service, metric); } } else if (event instanceof AlertEvent) { for (Emitter emitter : alertEmitters) { emitter.emit(event); } } else { throw new ISE("unknown event type [%s]", event.getClass()); } }
Source:
<code>public static boolean isSymLink(File file, final TaskListener listener) { <START> if (file == null) <END> return false; try { File canon; if (file.getParent() == null) { canon = file; } else { File canonDir = file.getParentFile().getCanonicalFile(); canon = new File(canonDir, file.getName()); } return !canon.getCanonicalFile().equals(canon.getAbsoluteFile()); } catch (IOException ex) { listener.getLogger().println("JENKINS-23234 isSymLink exception:" + ex); } return false; }</code><technical_language>Please add curly braces blocks conditions</technical_language>

Target:
public static boolean isSymLink(File file, final TaskListener listener) { if (file == null) { return false; } try { File canon; if (file.getParent() == null) { canon = file; } else { File canonDir = file.getParentFile().getCanonicalFile(); canon = new File(canonDir, file.getName()); } return !canon.getCanonicalFile().equals(canon.getAbsoluteFile()); } catch (IOException ex) { ex.printStackTrace(listener.error("Ignoring exception when checking for symlink. file:" + file + " exception:" + ex.getMessage())); } return false; }
Source:
<code><START> protected AnnotationDetailEditorPanel(String id, IModel<AnnotatorState> aModel) <END> { super(id, aModel); setOutputMarkupId(true); add(createAnnotationFeatureForm()); }</code><technical_language>leave public scope - not</technical_language>

Target:
public AnnotationDetailEditorPanel(String id, IModel<AnnotatorState> aModel) { super(id, aModel); setOutputMarkupId(true); add(createAnnotationFeatureForm()); }
Source:
<code>public Scheduler cleanupResponseUrlDataScheduler() throws SchedulerException { <START> return this.constructScheduler(AbstractSchedulingConfigBuilder.newBuilder() <END> .withJobClass(ResponseDataCleanupJob.class).withThreadCountKey(KEY_CLEANUP_JOB_THREAD_COUNT) .withCronExpressionKey(KEY_CLEANUP_JOB_CRON_EXPRESSION).withJobStoreDbUrl(this.getDatabaseUrl()) .withJobStoreDbUsername(this.databaseUsername).withJobStoreDbPassword(this.databasePassword) .withJobStoreDbDriver(this.databaseDriver).build()); }</code><technical_language>Variable please</technical_language>

Target:
public Scheduler cleanupResponseUrlDataScheduler() throws SchedulerException { AbstractSchedulingConfigBuilder abstractSchedulingConfig = AbstractSchedulingConfigBuilder.newBuilder() .withJobClass(ResponseDataCleanupJob.class).withThreadCountKey(KEY_CLEANUP_JOB_THREAD_COUNT) .withCronExpressionKey(KEY_CLEANUP_JOB_CRON_EXPRESSION).withJobStoreDbUrl(this.getDatabaseUrl()) .withJobStoreDbUsername(this.databaseUsername).withJobStoreDbPassword(this.databasePassword) .withJobStoreDbDriver(this.databaseDriver).build(); return this.constructScheduler(abstractSchedulingConfig); }
Source:
<code>protected Pattern getStartError() { <START> return Pattern.compile(".*\\[org\\.jboss\\.as\\].*stopped in.*"); <END> }</code><technical_language>@diegolovison , I message stopped but: Pattern.compile(".*\\[org\\.jboss\\.as\\].*started \\(with errors\\) in.*"); (at this is Gustavo's changes) great if fix too. I rebase PR I facing this issue too</technical_language>

Target:
protected Pattern getStartError() { return Pattern.compile(".*\\[org\\.jboss\\.as\\].*started \\(with errors\\) in.*"); }
Source:
<code>public ByteBuffer serialize(Long object) throws IOException { <START> LOG.info("serializing {}", object); <END> ByteBuffer byteBuffer = ByteBuffer.allocate(8); byteBuffer.putLong(object); byteBuffer.flip(); return byteBuffer; }</code><technical_language>need log here</technical_language>

Target:
public ByteBuffer serialize(Long object) throws IOException { ByteBuffer byteBuffer = ByteBuffer.allocate(8); byteBuffer.putLong(object); byteBuffer.flip(); return byteBuffer; }
Source:
<code><START> public void scan(Iterable<File> files) { <END> simpleScan(files); }</code><technical_language>code of method refactoring I guess this simpleScan away..</technical_language>

Target:
public void scan(Iterable<File> files) { ProgressReport progressReport = new ProgressReport("Report about progress of Java AST analyzer", TimeUnit.SECONDS.toMillis(10)); progressReport.start(Lists.newArrayList(files)); boolean successfullyCompleted = false; try { for (File file : files) { simpleScan(file); progressReport.nextFile(); } successfullyCompleted = true; } finally { if (successfullyCompleted) { progressReport.stop(); } else { progressReport.cancel(); } } }
Source:
<code>protected AsyncRequestResponseHandler(RequestResponseHandlerMetrics metrics, int workerCount, RestRequestService restRequestService) { this.metrics = metrics; metrics.trackAsyncRequestResponseHandler(this); <START> if (isRunning()) { <END> throw new IllegalStateException("Cannot modify scaling unit count after the service has started"); } else if (workerCount < 0) { throw new IllegalArgumentException("Request worker workerCount has to be >= 0"); } else if (workerCount > 0 && restRequestService == null) { throw new IllegalArgumentException("RestRequestService cannot be null"); } requestWorkersCount = workerCount; this.restRequestService = restRequestService; this.restRequestService.setupResponseHandler(this); logger.trace("Instantiated AsyncRequestResponseHandler"); }</code><technical_language>this condition occur this is logic is in constructor isRunning is a non-static member</technical_language>

Target:
protected AsyncRequestResponseHandler(RequestResponseHandlerMetrics metrics, int workerCount, RestRequestService restRequestService) { this.metrics = metrics; metrics.trackAsyncRequestResponseHandler(this); if (workerCount < 0) { throw new IllegalArgumentException("Request worker workerCount has to be >= 0"); } else if (workerCount > 0 && restRequestService == null) { throw new IllegalArgumentException("RestRequestService cannot be null"); } requestWorkersCount = workerCount; this.restRequestService = restRequestService; this.restRequestService.setupResponseHandler(this); logger.trace("Instantiated AsyncRequestResponseHandler"); }
Source:
<code>protected void recordCapabilitiesAndRequirements(final OperationContext context, final ModelNode operation, Resource resource) throws OperationFailedException { Set<RuntimeCapability> capabilitySet = capabilities.isEmpty() ? context.getResourceRegistration().getCapabilities() : capabilities; for (RuntimeCapability capability : capabilitySet) { if (capability.isDynamicallyNamed()) { context.registerCapability(capability.fromBaseCapability(context.getCurrentAddress())); } else { context.registerCapability(capability); } } ModelNode model = resource.getModel(); for (AttributeDefinition ad : attributes) { if (model.hasDefined(ad.getName()) || ad.hasCapabilityRequirements()) { ad.addCapabilityRequirements(context, resource, model.get(ad.getName())); } } ImmutableManagementResourceRegistration mrr = context.getResourceRegistration(); <START> if (mrr.getRequirements() != null) { <END> for (CapabilityReferenceRecorder recorder : mrr.getRequirements()) { recorder.addCapabilityRequirements(context, resource, null); } } }</code><technical_language>this check necessary. contract for getRequirements() return a set of CapabilityReferenceRecorder empty set if is none</technical_language>

Target:
protected void recordCapabilitiesAndRequirements(final OperationContext context, final ModelNode operation, Resource resource) throws OperationFailedException { Set<RuntimeCapability> capabilitySet = capabilities.isEmpty() ? context.getResourceRegistration().getCapabilities() : capabilities; for (RuntimeCapability capability : capabilitySet) { if (capability.isDynamicallyNamed()) { context.registerCapability(capability.fromBaseCapability(context.getCurrentAddress())); } else { context.registerCapability(capability); } } ModelNode model = resource.getModel(); for (AttributeDefinition ad : attributes) { if (model.hasDefined(ad.getName()) || ad.hasCapabilityRequirements()) { ad.addCapabilityRequirements(context, resource, model.get(ad.getName())); } } ImmutableManagementResourceRegistration mrr = context.getResourceRegistration(); assert mrr.getRequirements() != null; for (CapabilityReferenceRecorder recorder : mrr.getRequirements()) { recorder.addCapabilityRequirements(context, resource, null); } }
Source:
<code>protected void initUserList() { try { this.user.addAll(serviceManager.getUserService().getAllActiveUsersSortedByNameAndSurname()); } catch (RuntimeException rte) { <START> Helper.setErrorMessage("errorLoadingMany", new String[] {Helper.getTranslation("aktiveBenutzer") }); <END> logger.warn("RuntimeException caught. List of users could be empty!"); } }</code><technical_language>here. Please log error message / reason display user</technical_language>

Target:
protected void initUserList() { try { this.user.addAll(serviceManager.getUserService().getAllActiveUsersSortedByNameAndSurname()); } catch (RuntimeException rte) { logger.warn("RuntimeException caught. List of users could be empty!"); Helper.setErrorMessage("errorLoadingMany", new Object[] {Helper.getTranslation("aktiveBenutzer") }); } }
Source:
<code>public RowExpression toRowExpression(Subfield subfield, Type columnType) { List<Subfield.PathElement> path = subfield.getPath(); List<Type> types = new ArrayList<>(); types.add(columnType); for (int i = 0; i < path.size(); i++) { <START> Type type = types.get(i); <END> if (type instanceof RowType) { types.add(getFieldType((RowType) type, ((Subfield.NestedField) path.get(i)).getName())); } else if (type instanceof ArrayType) { types.add(((ArrayType) type).getElementType()); } else if (type instanceof MapType) { types.add(((MapType) type).getValueType()); } else { verify(false, "Unexpected type: " + type); } } return toRowExpression(subfield, types); }</code><technical_language>fragile this index list creating list (you're grabbing added element, easy for accidentally mess later). I instead explicitly set create types (or explicitly get element types list)</technical_language>

Target:
public RowExpression toRowExpression(Subfield subfield, Type columnType) { List<Subfield.PathElement> path = subfield.getPath(); ImmutableList.Builder<Type> types = ImmutableList.builder(); types.add(columnType); Type type = columnType; for (int i = 0; i < path.size(); i++) { if (type instanceof RowType) { type = getFieldType((RowType) type, ((Subfield.NestedField) path.get(i)).getName()); types.add(type); } else if (type instanceof ArrayType) { type = ((ArrayType) type).getElementType(); types.add(type); } else if (type instanceof MapType) { type = ((MapType) type).getValueType(); types.add(type); } else { verify(false, "Unexpected type: " + type); } } return toRowExpression(subfield, types.build()); }
Source:
<code>public String getHealthStatus() { <START> return healthStatus; <END> }</code><technical_language>add "this" qualifier</technical_language>

Target:
public String getHealthStatus() { return this.healthStatus; }
Source:
<code>public List<SurveyedLocale> listPublicLocalesByGeocell(List<String> geocells, int pageSize) { PersistenceManager pm = PersistenceFilter.getManager(); <START> String queryString = ":p1.contains(geocells) && pointType != 'Household'"; <END> javax.jdo.Query query = pm.newQuery(SurveyedLocale.class,queryString); prepareCursor(null, pageSize, query); List<SurveyedLocale> results = (List<SurveyedLocale>) query.execute(geocells); return results; }</code><technical_language>This expression fails javax.jdo.JDOFatalUserException: Unexpected expression type while parsing query. a field named pointType exists object? SurveyedLocale a pointType property. is localeType</technical_language>

Target:
public List<SurveyedLocale> listPublicLocalesByGeocell(List<String> geocells, int pageSize) { PersistenceManager pm = PersistenceFilter.getManager(); String queryString = ":p1.contains(geocells) && localeType != 'Household'"; javax.jdo.Query query = pm.newQuery(SurveyedLocale.class,queryString); prepareCursor(null, pageSize, query); List<SurveyedLocale> results = (List<SurveyedLocale>) query.execute(geocells); return results; }
Source:
<code>public Object findInjectableValue( Object valueId, DeserializationContext ctxt, BeanProperty forProperty, Object beanInstance ) { <START> if(Key.class.isAssignableFrom(valueId.getClass())){ <END> return injector.getInstance((Key) valueId); } if(String.class.isAssignableFrom(valueId.getClass())){ try { return injector.getInstance(getClass().getClassLoader().loadClass((String)valueId)); } catch (ClassNotFoundException e) { throw new IAE(e, "Cannot load class [%s]", valueId.toString()); } } throw new IAE("Unknown class type [%s]", valueId.getClass().getCanonicalName()); }</code><technical_language>also, instanceof Key / String enough here, no</technical_language>

Target:
public Object findInjectableValue( Object valueId, DeserializationContext ctxt, BeanProperty forProperty, Object beanInstance ) { if(valueId instanceof Key){ return injector.getInstance((Key) valueId); } throw new IAE("Unknown class type [%s] for valueId [%s]", valueId.getClass().getCanonicalName(), valueId.toString()); }
Source:
<code>public StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionDelete(String volumeName, String remoteHost, String remoteVolumeName) { try { <START> return new StatusOnlyReturnForXmlRpc(vdsServer.glusterVolumeGeoRepSessionDelete(volumeName, remoteVolumeName, remoteVolumeName)); <END> } catch (UndeclaredThrowableException ute) { throw new XmlRpcRunTimeException(ute); } }</code><technical_language>remoteVolumeName passed twice. I feel remoteHost passed arg</technical_language>

Target:
public StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionDelete(String volumeName, String remoteHost, String remoteVolumeName) { try { return new StatusOnlyReturnForXmlRpc(vdsServer.glusterVolumeGeoRepSessionDelete(volumeName, remoteHost, remoteVolumeName)); } catch (UndeclaredThrowableException ute) { throw new XmlRpcRunTimeException(ute); } }
Source:
<code>public String launch() throws Exception { <START> LOG.error("Launching app in python app"); <END> try { if (mode == LaunchMode.LOCAL) { appIdentifier = app.runLocal(); return "LocalMode"; } else { StramAppLauncher appLauncher = null; appLauncher = new StramAppLauncher(app.getName(), app.getConf()); appLauncher.loadDependencies(); PythonAppFactory appFactory = new PythonAppFactory(app.getName(), app); this.appIdentifier = appLauncher.launchApp(appFactory); return this.appIdentifier.toString(); } } catch (Exception e) { e.printStackTrace(); LOG.error("Failed TO Launch PYTHON Streaming Application"); LOG.error("Encountered Exception " + e.getMessage()); throw e; } }</code><technical_language>This is error. set info</technical_language>

Target:
public String launch() throws Exception { LOG.info("Launching app in python app"); try { if (mode == LaunchMode.LOCAL) { appIdentifier = app.runLocal(); return "LocalMode"; } else { StramAppLauncher appLauncher = null; appLauncher = new StramAppLauncher(app.getName(), app.getConf()); appLauncher.loadDependencies(); PythonAppFactory appFactory = new PythonAppFactory(app.getName(), app); this.appIdentifier = appLauncher.launchApp(appFactory); return this.appIdentifier.toString(); } } catch (Exception e) { e.printStackTrace(); LOG.error("Failed TO Launch PYTHON Streaming Application"); LOG.error("Encountered Exception " + e.getMessage()); throw e; } }
Source:
<code>public static AccessorNamingStrategy getAccessorNamingStrategy() { <START> AccessorNamingStrategy impl = get( AccessorNamingStrategy.class ); <END> if ( impl == null ) { impl = new DefaultAccessorNamingStrategy(); } return impl; }</code><technical_language>I cache implementation statically - access this strategy often... :wink:</technical_language>

Target:
public static AccessorNamingStrategy getAccessorNamingStrategy() { return ACCESSOR_NAMING_STRATEGY; }
Source:
<code>private void add(File f) { if (f.isDirectory()) { addFolder(f); } else if (f.getName().endsWith(".java")) { registerSource(f); } else if (options.translateClassfiles() && f.getName().endsWith(".class")) { String filepath = ARGC.getCanonicalPath(f); String source = doSaveClassDecompiled(f); if (source == null) return; filepath = filepath.substring(0, filepath.length() - 5) + "java"; System.out.println("discompiled: " + filepath); <START> System.out.println(source); <END> try { PrintStream out = new PrintStream(new FileOutputStream(filepath)); out.println(source); out.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } registerSource(new File(filepath)); } }</code><technical_language>Remove println statements, replace log messages</technical_language>

Target:
private void add(File f) { if (f.isDirectory()) { addFolder(f); } else if (f.getName().endsWith(".java")) { registerSource(f); } else if (options.translateClassfiles() && f.getName().endsWith(".class")) { String filepath = ARGC.getCanonicalPath(f); String source = doSaveClassDecompiled(f); if (source == null) return; filepath = filepath.substring(0, filepath.length() - 5) + "java"; try { PrintStream out = new PrintStream(new FileOutputStream(filepath)); out.println(source); out.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } registerSource(new File(filepath)); } else if (this.addSourceList) { File dir = options.fileUtil().getResourceDirectory(); if (dir != null) { String filename = ARGC.getCanonicalPath(f); if (filename.indexOf("/.") >= 0) { return; } filename = filename.substring(root.length()); File of = new File(dir.getAbsolutePath() + "/" + filename + "sss"); of.getParentFile().mkdirs(); try { BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(of)); BufferedInputStream in = new BufferedInputStream(new FileInputStream(f)); for (int c; (c = in.read()) >= 0; ) { out.write(c); } out.flush(); out.close(); in.close(); } catch (IOException e) { throw new RuntimeException(e); } } } }
Source:
<code>public String getEntities(String query) throws URISyntaxException, IOException { URI uri = new URIBuilder().setPath(config.getProxyControllerUrl() + "/entities/").setParameter("query", query).build(); final Executor executor = Executor.newInstance(getHttpClient(100, 5000, 1)); <START> return executor.execute(Request.Get(uri)).returnContent().asString(); <END> }</code><technical_language>is a lot of repeated code, executor execute done in a method (you getHttpClient a helper method anyway)</technical_language>

Target:
public String getEntities(String query) throws URISyntaxException, IOException { URI uri = new URIBuilder().setPath(config.getProxyControllerUrl() + "/entities/").setParameter("query", query).build(); return getExecutor().execute(Request.Get(uri)).returnContent().asString(); }
Source:
<code>protected Bitmap getBitmapFromUrl(String url) throws ImageStore.CantGetImageException { <START> ImageStore is = new ImageStore(context, "Push Notifications"); <END> return is.getImage(url); }</code><technical_language>s/"Push Notifications"/"MixpanelPushNotification"</technical_language>

Target:
protected Bitmap getBitmapFromUrl(String url) { ImageStore is = new ImageStore(context, "MixpanelPushNotification"); try { Bitmap bm = is.getImage(url); return bm; } catch (ImageStore.CantGetImageException e) { return null; } }
Source:
<code>public void Case5() { assertEquals(ImmutableList.of(0, 1, 1, 1), query().from(cat).orderBy(cat.id.asc()) .select(cat.mate.when(savedCats.get(0)).then(0).otherwise(1)).fetch()); List<Integer> rv = query().from(cat) .select(Expressions.cases() .when(cat.toes.in(2, 3)).then(cat.id.multiply(cat.toes)) .otherwise(4)).fetch(); <START> assertInstancesOf(Integer.class, rv); <END> }</code><technical_language>This duplicates Case3 right? [came there](<LINK_0> I move this assertion there, projection is there</technical_language>

Target:
public void Case5() { assertEquals(ImmutableList.of(0, 1, 1, 1), query().from(cat).orderBy(cat.id.asc()) .select(cat.mate.when(savedCats.get(0)).then(0).otherwise(1)).fetch()); }