auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public Optional<Error> validate(EventEnvelope envelope) { <END> checkNotNull(envelope); final Event event = envelope.getOuterObject(); Throwable result = null; final List<ConstraintViolation> violations = messageValidator.validate(event); if (!violations.isEmpty()) { final InvalidEventException invalidEvent = onConstraintViolations(event, violations); result = invalidArgumentWithCause(invalidEvent, invalidEvent.getError()); } if (result == null) { return Optional.absent(); } else { return Optional.of(toError(result)); } }</code><technical_language>Please check EventException descendants</technical_language>

Target:
public Optional<MessageInvalid> validate(EventEnvelope envelope) { checkNotNull(envelope); final Event event = envelope.getOuterObject(); MessageInvalid result = null; final List<ConstraintViolation> violations = messageValidator.validate(event); if (!violations.isEmpty()) { result = onConstraintViolations(event, violations); } return Optional.fromNullable(result); }
Source:
<code>public static void clearSelection(Grid grid, VControl vControl, EMFFormsDatabindingEMF dataBinding) { if (grid.getCellSelection().length == 0 || !vControl.isEnabled() || vControl.isReadonly()) { return; } for (final Point itemCoord : grid.getCellSelection()) { final int column = itemCoord.x; final int row = itemCoord.y; <START> final VDomainModelReference dmr = (VDomainModelReference) grid.getColumn(column) .getData(AbstractTableViewerComposite.DMR); <END> if (vControl instanceof VTableControl && org.eclipse.emf.ecp.view.internal.table.swt.TableConfigurationHelper .isReadOnly((VTableControl) vControl, dmr)) { continue; } final EObject eObject = (EObject) grid.getItem(row).getData(); try { final Setting setting = dataBinding.getSetting(dmr, eObject); setting.unset(); } catch (final DatabindingFailedException ex) { } } }</code><technical_language>is case this is legitimately null</technical_language>

Target:
public static void clearSelection(Grid grid, VControl vControl, EMFFormsDatabindingEMF dataBinding) { if (grid.getCellSelection().length == 0 || !vControl.isEnabled() || vControl.isReadonly()) { return; } for (final Point itemCoord : grid.getCellSelection()) { final int column = itemCoord.x; final int row = itemCoord.y; final VDomainModelReference dmr = (VDomainModelReference) grid.getColumn(column) .getData(AbstractTableViewerComposite.DMR); if (dmr == null || vControl instanceof VTableControl && org.eclipse.emf.ecp.view.internal.table.swt.TableConfigurationHelper .isReadOnly((VTableControl) vControl, dmr)) { continue; } final EObject eObject = (EObject) grid.getItem(row).getData(); try { final Setting setting = dataBinding.getSetting(dmr, eObject); setting.unset(); } catch (final DatabindingFailedException ex) { } } }
Source:
<code><START> private void setCloudEndabled(boolean isCloudEnabled) { <END> _isCloudEnabled = isCloudEnabled; }</code><technical_language>nit, if is private, need set methods..</technical_language>

Target:
public void setCloudEndabled(boolean isCloudEnabled) { _isCloudEnabled = isCloudEnabled; }
Source:
<code>private void logEndpoint(RntbdEndpoint endpoint) { int executorPoolSize = endpoint.executorTaskQueueMetrics(); if (this.logger.isDebugEnabled()) { logger.debug("RntbdEndpoint Identifier {}, Stat {}", getPoolId(endpoint), getPoolStat(endpoint)); } <START> if (executorPoolSize > 5_000 || <END> endpoint.requestQueueLength() > 5_000 || endpoint.gettingEstablishedConnectionsMetrics() > 0 || endpoint.channelsMetrics() > endpoint.maxChannels()) { if (this.logger.isWarnEnabled()) { logger.warn("RntbdEndpoint Identifier {}, Stat {}", getPoolId(endpoint), getPoolStat(endpoint)); } } }</code><technical_language>else if</technical_language>

Target:
private void logEndpoint(RntbdEndpoint endpoint) { if (this.logger.isWarnEnabled() && (endpoint.executorTaskQueueMetrics() > MAX_TASK_LIMIT || endpoint.requestQueueLength() > MAX_TASK_LIMIT || endpoint.gettingEstablishedConnectionsMetrics() > 0 || endpoint.channelsMetrics() > endpoint.maxChannels())) { logger.warn("RntbdEndpoint Identifier {}, Stat {}", getPoolId(endpoint), getPoolStat(endpoint)); } else if (this.logger.isDebugEnabled()) { logger.debug("RntbdEndpoint Identifier {}, Stat {}", getPoolId(endpoint), getPoolStat(endpoint)); } }
Source:
<code>public String verifiedSources(@ApiParam(value = "Workflow id", required = true) @PathParam("workflowId") Long workflowId) { Workflow workflow = workflowDAO.findById(workflowId); Helper.checkEntry(workflow); Set<String> verifiedSourcesArray = new HashSet<>(); <START> for (WorkflowVersion workflowVersion : workflow.getWorkflowVersions()) { <END> if (workflowVersion.isVerified()) { verifiedSourcesArray.add(workflowVersion.getVerifiedSource()); } } JSONArray jsonArray = new JSONArray(); try { jsonArray = new JSONArray(verifiedSourcesArray.toArray()); } catch (JSONException ex) { ex.printStackTrace(); } return jsonArray.toString(); }</code><technical_language>(lambda, exception)</technical_language>

Target:
public String verifiedSources(@ApiParam(value = "Workflow id", required = true) @PathParam("workflowId") Long workflowId) { Workflow workflow = workflowDAO.findById(workflowId); Helper.checkEntry(workflow); Set<String> verifiedSourcesArray = new HashSet<>(); workflow.getWorkflowVersions() .stream() .filter((WorkflowVersion u) -> u.isVerified()) .forEach((WorkflowVersion v) -> verifiedSourcesArray.add(v.getVerifiedSource())); JSONArray jsonArray; try { jsonArray = new JSONArray(verifiedSourcesArray.toArray()); } catch (JSONException ex) { throw new CustomWebApplicationException("There was an error converting the array of verified sources to a JSON array.", HttpStatus.SC_INTERNAL_SERVER_ERROR); } return jsonArray.toString(); }
Source:
<code>public static KerberosHadoopAuthentication createKerberosHadoopAuthentication(KerberosAuthentication kerberosAuthentication, HdfsConfigurationUpdater updater) { Configuration configuration = getInitialConfiguration(); updater.updateConfiguration(configuration); configuration.set("hadoop.security.authentication", "kerberos"); try { <START> HadoopKerberosName.setConfiguration(configuration); <END> } catch (IOException exception) { throw new UncheckedIOException(exception); } UserGroupInformation.setConfiguration(configuration); return new KerberosHadoopAuthentication(kerberosAuthentication); }</code><technical_language>is calles UserGroupInformation.setConfiguration. Please remove that. <LINK_0></technical_language>

Target:
public static KerberosHadoopAuthentication createKerberosHadoopAuthentication(KerberosAuthentication kerberosAuthentication, HdfsConfigurationUpdater updater) { Configuration configuration = getInitialConfiguration(); updater.updateConfiguration(configuration); configuration.set("hadoop.security.authentication", "kerberos"); UserGroupInformation.setConfiguration(configuration); return new KerberosHadoopAuthentication(kerberosAuthentication); }
Source:
<code>private void reportMetrics(final EventTypeMetrics eventTypeMetrics, final EventPublishResult result, final String eventsAsString, final int eventCount) { if (result.getStatus() == EventPublishingStatus.SUBMITTED) { eventTypeMetrics.reportSizing(eventCount, eventsAsString.getBytes(StandardCharsets.UTF_8).length - 2); } else if (result.getStatus() == EventPublishingStatus.FAILED && eventCount != 0) { final int successfulEvents= result.getResponses() .stream() .filter(r -> r.getPublishingStatus() == EventPublishingStatus.SUBMITTED) .collect(Collectors.toList()) .size(); <START> final double avgEventSize = eventsAsString.getBytes(StandardCharsets.UTF_8).length / eventCount; <END> eventTypeMetrics.reportSizing(successfulEvents,(int)Math.round(avgEventSize * successfulEvents)); } }</code><technical_language>I help. divide int int result int converted double. if length is 10 eventCount is 3, avgEventSize 3.0</technical_language>

Target:
private void reportMetrics(final EventTypeMetrics eventTypeMetrics, final EventPublishResult result, final String eventsAsString, final int eventCount) { if (result.getStatus() == EventPublishingStatus.SUBMITTED) { eventTypeMetrics.reportSizing(eventCount, eventsAsString.getBytes(StandardCharsets.UTF_8).length - eventCount - 1); } else if (result.getStatus() == EventPublishingStatus.FAILED && eventCount != 0) { final int successfulEvents= result.getResponses() .stream() .filter(r -> r.getPublishingStatus() == EventPublishingStatus.SUBMITTED) .collect(Collectors.toList()) .size(); final double avgEventSize = eventsAsString.getBytes(StandardCharsets.UTF_8).length / (double)eventCount; eventTypeMetrics.reportSizing(successfulEvents, (int)Math.round(avgEventSize * successfulEvents)); } }
Source:
<code>private void setLoginToSponsoredUser(PerunSession sess, User sponsoredUser, String loginAttributeName, String login) throws InternalErrorException { try { Attribute a = getPerunBl().getAttributesManagerBl().getAttribute(sess, sponsoredUser, loginAttributeName); a.setValue(login); getPerunBl().getAttributesManagerBl().setAttribute(sess,sponsoredUser,a); } catch (WrongAttributeAssignmentException | AttributeNotExistsException e) { log.error("attribute not defined",loginAttributeName); } catch (WrongAttributeValueException | WrongReferenceAttributeValueException e) { <START> log.error("cannot set attribute for sponsored user {}",loginAttributeName,sponsoredUser.getId()); <END> } }</code><technical_language>Consider raising exception, InternalErrorException. call abort rollback. user think, well, is true. problem is more places this pull request work attributes</technical_language>

Target:
private void setLoginToSponsoredUser(PerunSession sess, User sponsoredUser, String loginAttributeName, String login) throws InternalErrorException { try { Attribute a = getPerunBl().getAttributesManagerBl().getAttribute(sess, sponsoredUser, loginAttributeName); a.setValue(login); getPerunBl().getAttributesManagerBl().setAttribute(sess,sponsoredUser,a); } catch (WrongAttributeAssignmentException | AttributeNotExistsException |WrongAttributeValueException | WrongReferenceAttributeValueException e) { throw new InternalErrorException("cannot set attribute "+loginAttributeName+" for user "+sponsoredUser.getId(),e); } }
Source:
<code>protected Supplier<URI> provideStorageUrl(RegionIdToURISupplier.Factory factory, @ApiVersion String apiVersion, @Named(LocationConstants.PROPERTY_REGION) String region) { Supplier<Map<String, Supplier<URI>>> endpointsSupplier = factory.createForApiTypeAndVersion(ServiceType.OBJECT_STORE, null); if (region.isEmpty()) { return getLastValueInMap(endpointsSupplier); } else { return getValueInMapOrNull(endpointsSupplier, region); } <START> } <END></code><technical_language>Duplicate of code above? factor this out? this return null (from getValueInMapOrNull call)? If so, mark return @Nullable</technical_language>

Target:
protected Supplier<URI> provideStorageUrl(RegionIdToURISupplier.Factory factory, @ApiVersion String apiVersion, @Named(LocationConstants.PROPERTY_REGION) String region) { return getUriSupplier(ServiceType.OBJECT_STORE, null, factory, region); }
Source:
<code>private boolean isField(Tree tree) { <START> return tree.is(Kind.VARIABLE) && !((VariableTree) tree).modifiers().modifiers().containsAll(Lists.newArrayList(Modifier.FINAL, Modifier.STATIC)); <END> }</code><technical_language>a static member ? class A extends B { public static String staticMember; }</technical_language>

Target:
private boolean isField(Tree tree) { return tree.is(Kind.VARIABLE) && !((VariableTree) tree).modifiers().modifiers().contains(Modifier.STATIC); }
Source:
<code>public static void setLanguage(Context ctx, OsmandSettings settings) throws IOException { String lang = getPreferredLanguage(settings).getLanguage(); m = new HashMap<String,String>(); InputStream is = null; BufferedReader br = null; try{ try { is = ctx.getAssets().open("specialphrases/specialphrases_"+lang+".txt"); } catch (IOException ex) { is = ctx.getAssets().open("specialphrases/specialphrases_en.txt"); } br = new BufferedReader(new InputStreamReader(is)); String readLine = null; while ((readLine = br.readLine()) != null) { String[] arr = readLine.split(","); if (arr != null && arr.length == 2) { m.put(arr[0], arr[1]); } } <START> is.close(); <END> br.close(); } finally { Algoritms.closeStream(is); Algoritms.closeStream(br); } }</code><technical_language>need call is.close() br.close(), is in finally block</technical_language>

Target:
public static void setLanguage(Context ctx, OsmandSettings settings) throws IOException { String lang = getPreferredLanguage(settings).getLanguage(); m = new HashMap<String,String>(); InputStream is = null; BufferedReader br = null; try{ try { is = ctx.getAssets().open("specialphrases/specialphrases_"+lang+".txt"); } catch (IOException ex) { is = ctx.getAssets().open("specialphrases/specialphrases_en.txt"); } br = new BufferedReader(new InputStreamReader(is)); String readLine = null; while ((readLine = br.readLine()) != null) { String[] arr = readLine.split(","); if (arr != null && arr.length == 2) { m.put(arr[0], arr[1]); } } } finally { Algoritms.closeStream(is); Algoritms.closeStream(br); } }
Source:
<code>private static Object createGetter(Class<?> pojoClass, String getterExpr, String exprObjectPlaceholder, Class<?> exprClass, Class<?> getterClass) { logger.debug("{} {}", pojoClass, getterExpr, exprClass, getterClass); JavaExpressionParser javaExpressionParser = new JavaExpressionParser(); <START> javaExpressionParser.setInputObjectPlaceholder("$", PojoUtils.OBJECT); <END> String code = javaExpressionParser.convertToCompilableExpression(getterExpr, pojoClass, exprClass); return compileExpression(code, getterClass, new String[] {PojoUtils.OBJECT}); }</code><technical_language>variable for $</technical_language>

Target:
private static Object createGetter(Class<?> pojoClass, String getterExpr, String exprObjectPlaceholder, Class<?> exprClass, Class<?> getterClass) { logger.debug("{} {}", pojoClass, getterExpr, exprClass, getterClass); JavaExpressionParser javaExpressionParser = new JavaExpressionParser(); javaExpressionParser.setInputObjectPlaceholder(PojoUtils.DEFAULT_EXPRESSION_OBJ_PLACEHOLDER, PojoUtils.OBJECT); String code = javaExpressionParser.convertToCompilableExpression(getterExpr, pojoClass, exprClass); return compileExpression(code, getterClass, new String[] {PojoUtils.OBJECT}); }
Source:
<code>public void fromData(DataInput in, DeserializationContext context) throws IOException, ClassNotFoundException { <START> this.satisfiedRedundancyRegions = DataSerializer.readHashMap(in); <END> this.underRedundancyRegions = DataSerializer.readHashMap(in); this.zeroRedundancyRegions = DataSerializer.readHashMap(in); this.totalPrimaryTransfersCompleted = in.readInt(); this.totalPrimaryTransferTime = DataSerializer.readObject(in); this.success = DataSerializer.readBoolean(in); this.statusMessage = DataSerializer.readString(in); }</code><technical_language>remove of unnecessary this. qualifiers? show unnecessary in IDE</technical_language>

Target:
public void fromData(DataInput in, DeserializationContext context) throws IOException, ClassNotFoundException { satisfiedRedundancyRegions = DataSerializer.readHashMap(in); underRedundancyRegions = DataSerializer.readHashMap(in); zeroRedundancyRegions = DataSerializer.readHashMap(in); totalPrimaryTransfersCompleted = in.readInt(); totalPrimaryTransferTime = DataSerializer.readObject(in); success = DataSerializer.readBoolean(in); statusMessage = DataSerializer.readString(in); }
Source:
<code>public String get() { if (SystemInfo.isWindows()) { return System.getProperty("user.home") + "\\AppData\\Local\\che\\ext-conf"; } else { final String localConfDir = System.getenv(CheBootstrap.CHE_LOCAL_CONF_DIR); <START> return localConfDir == null ? "" : localConfDir + File.separator + "ext" + ":" + EXT_CHE_LOCAL_CONF_DIR + ":ro"; <END> } }</code><technical_language>Combine "ext" + ":"</technical_language>

Target:
public String get() { if (SystemInfo.isWindows()) { return System.getProperty("user.home") + "\\AppData\\Local\\che\\ext-conf"; } else { final String localConfDir = System.getenv(CheBootstrap.CHE_LOCAL_CONF_DIR); return localConfDir == null ? "" : localConfDir + File.separator + "ext:" + EXT_CHE_LOCAL_CONF_DIR + ":ro"; } }
Source:
<code>public List<ProgramState> setConstraint(ProgramState programState, BooleanConstraint booleanConstraint) { ObjectConstraint optionalConstraint = (ObjectConstraint) programState.getConstraint(optionalSV); if (optionalConstraint == null) { return ImmutableList.of(); } <START> boolean isknownAsNotPresent = optionalConstraint.hasStatus(Status.NOT_PRESENT); <END> boolean isKnownAsPresent = optionalConstraint.hasStatus(Status.PRESENT); if (isknownAsNotPresent || isKnownAsPresent) { if (isImpossibleState(booleanConstraint, isknownAsNotPresent, isKnownAsPresent)) { return ImmutableList.of(); } return ImmutableList.of(programState); } ObjectConstraint newConstraint = booleanConstraint.isTrue() ? optionalConstraint.withStatus(Status.PRESENT) : optionalConstraint.withStatus(Status.NOT_PRESENT); return ImmutableList.of(programState.addConstraint(optionalSV, newConstraint)); }</code><technical_language>status tested</technical_language>

Target:
public List<ProgramState> setConstraint(ProgramState programState, BooleanConstraint booleanConstraint) { ObjectConstraint optionalConstraint = (ObjectConstraint) programState.getConstraint(optionalSV); if (optionalConstraint == null || isImpossibleState(booleanConstraint, optionalConstraint)) { return ImmutableList.of(); } if (optionalConstraint.hasStatus(Status.NOT_PRESENT) || optionalConstraint.hasStatus(Status.PRESENT)) { return ImmutableList.of(programState); } ObjectConstraint newConstraint = booleanConstraint.isTrue() ? optionalConstraint.withStatus(Status.PRESENT) : optionalConstraint.withStatus(Status.NOT_PRESENT); return ImmutableList.of(programState.addConstraint(optionalSV, newConstraint)); }
Source:
<code>private String addFolderPath(String param) { if (param == null) return null; <START> String[] keys = param.split(";"); <END> StringBuilder stringBuilder = new StringBuilder(param.length() + PGP_FOLDER.length() * keys.length); for(int i = 0; i < keys.length; i++) { stringBuilder .append(PGP_FOLDER) .append(keys[i]) .append(i != keys.length - 1 ? ";" : ""); } return stringBuilder.toString(); }</code><technical_language>a tokenizer, trims results, a iterator iterate :)</technical_language>

Target:
private String addFolderPath(String param) { if (param == null) return null; StringTokenizer keys = new StringTokenizer(param, ";"); StringBuilder stringBuilder = new StringBuilder(); while (keys.hasMoreTokens()) { String key = keys.nextToken(); stringBuilder .append(PGP_FOLDER) .append(key) .append(keys.hasMoreElements() ? ";" : ""); } return stringBuilder.toString(); }
Source:
<code>public String get(String key) { <START> Map<String, String> Map = inheritableThreadLocal.get(); <END> if ((Map != null) && (key != null)) { return Map.get(key); } else { return null; } }</code><technical_language>I this pre-existing, variable is capitalized Map, map</technical_language>

Target:
public String get(String key) { Map<String, String> map = inheritableThreadLocal.get(); if ((map != null) && (key != null)) { return map.get(key); } else { return null; } }
Source:
<code>public int hashCode() { <START> int result = key != null ? key.hashCode() : 0; <END> result = 31 * result + (enabled != null ? enabled.hashCode() : 0); result = 31 * result + (triggerPackages != null ? triggerPackages.hashCode() : 0); result = 31 * result + (pollInterval != null ? pollInterval.hashCode() : 0); return result; }</code><technical_language>please do this: return Objects.hash(enabled, triggerPackages, pollInterval) instead</technical_language>

Target:
public int hashCode() { return Objects.hash(key, enabled, pollInterval, triggerPackages); }
Source:
<code>public boolean isBonus() { <START> return ((RaidAccessor) this.raid).accessor$hasBonusWave(); <END> }</code><technical_language>isBonus is if this Wave is bonus, if Raid a bonus</technical_language>

Target:
public boolean isBonus() { if (this.isFinal() || this.waveId < ((RaidAccessor) this.raid).accessor$getNumGroups()) { return false; } return true; }
Source:
<code>private void updateWatchlistBox() { final LinearLayout layout = ButterKnife.findById(view, R.id.watchlist_box); final boolean supportsWatchList = cache.supportsWatchList(); layout.setVisibility(supportsWatchList ? View.VISIBLE : View.GONE); if (!supportsWatchList) { return; } final Button buttonAdd = ButterKnife.findById(view, R.id.add_to_watchlist); final Button buttonRemove = ButterKnife.findById(view, R.id.remove_from_watchlist); final TextView text = ButterKnife.findById(view, R.id.watchlist_text); final int watchListCount = cache.getWatchlistCount(); String watchListCountString = ""; if (watchListCount != -1) <START> { <END> watchListCountString = " (" + watchListCount + ' ' + getString(R.string.cache_watchlist_in_total) + ')'; } if (cache.isOnWatchlist() || cache.isOwner()) { buttonAdd.setVisibility(View.GONE); buttonRemove.setVisibility(View.VISIBLE); text.setText(res.getString(R.string.cache_watchlist_on) + watchListCountString); } else { buttonAdd.setVisibility(View.VISIBLE); buttonRemove.setVisibility(View.GONE); text.setText(res.getString(R.string.cache_watchlist_not_on) + watchListCountString); } if (cache.isOwner()) { buttonAdd.setEnabled(false); buttonAdd.setVisibility(View.GONE); buttonRemove.setEnabled(false); buttonRemove.setVisibility(View.GONE); } }</code><technical_language>Opening brace lilne if</technical_language>

Target:
private void updateWatchlistBox() { final LinearLayout layout = ButterKnife.findById(view, R.id.watchlist_box); final boolean supportsWatchList = cache.supportsWatchList(); layout.setVisibility(supportsWatchList ? View.VISIBLE : View.GONE); if (!supportsWatchList) { return; } final Button buttonAdd = ButterKnife.findById(view, R.id.add_to_watchlist); final Button buttonRemove = ButterKnife.findById(view, R.id.remove_from_watchlist); final TextView text = ButterKnife.findById(view, R.id.watchlist_text); final int watchListCount = cache.getWatchlistCount(); final String watchListCountString = watchListCount != -1 ? '(' + getString(R.string.cache_watchlist_count, watchListCount) + ')' : ""; if (cache.isOnWatchlist() || cache.isOwner()) { buttonAdd.setVisibility(View.GONE); buttonRemove.setVisibility(View.VISIBLE); text.setText(res.getString(R.string.cache_watchlist_on, watchListCountString)); } else { buttonAdd.setVisibility(View.VISIBLE); buttonRemove.setVisibility(View.GONE); text.setText(res.getString(R.string.cache_watchlist_not_on, watchListCountString)); } if (cache.isOwner()) { buttonAdd.setEnabled(false); buttonAdd.setVisibility(View.GONE); buttonRemove.setEnabled(false); buttonRemove.setVisibility(View.GONE); } }
Source:
<code>public void testBareCloneRepositoryMirror() throws Exception { File directory = createTempDirectory( <START> "testCloneRepositoryWithBranch_bare"); <END> CloneCommand command = Git.cloneRepository(); command.setBranch("refs/heads/master"); command.setMirror(true); command.setDirectory(directory); command.setURI(fileUri()); Git git2 = command.call(); addRepoToClose(git2.getRepository()); assertNotNull(git2); assertNotNull(git2.getRepository().resolve("tag-for-blob")); assertNotNull(git2.getRepository().resolve("tag-initial")); assertEquals(git2.getRepository().getFullBranch(), "refs/heads/master"); assertEquals("refs/heads/master, refs/heads/test", allRefNames( git2.branchList().setListMode(ListMode.ALL).call())); assertNotNull(git2.getRepository().exactRef("refs/meta/foo/bar")); RemoteConfig cfg = new RemoteConfig(git2.getRepository().getConfig(), Constants.DEFAULT_REMOTE_NAME); List<RefSpec> specs = cfg.getFetchRefSpecs(); assertEquals(1, specs.size()); assertEquals(new RefSpec("+refs/*:refs/*"), specs.get(0)); }</code><technical_language>mirror</technical_language>

Target:
public void testBareCloneRepositoryMirror() throws Exception { File directory = createTempDirectory( "testCloneRepositoryWithBranch_mirror"); CloneCommand command = Git.cloneRepository(); command.setBranch("refs/heads/master"); command.setMirror(true); command.setDirectory(directory); command.setURI(fileUri()); Git git2 = command.call(); addRepoToClose(git2.getRepository()); assertNotNull(git2); assertNotNull(git2.getRepository().resolve("tag-for-blob")); assertNotNull(git2.getRepository().resolve("tag-initial")); assertEquals(git2.getRepository().getFullBranch(), "refs/heads/master"); assertEquals("refs/heads/master, refs/heads/test", allRefNames( git2.branchList().setListMode(ListMode.ALL).call())); assertNotNull(git2.getRepository().exactRef("refs/meta/foo/bar")); RemoteConfig cfg = new RemoteConfig(git2.getRepository().getConfig(), Constants.DEFAULT_REMOTE_NAME); List<RefSpec> specs = cfg.getFetchRefSpecs(); assertEquals(1, specs.size()); assertEquals(new RefSpec("+refs/*:refs/*"), specs.get(0)); }
Source:
<code>public WebTarget setupAuthentication(WebTarget target) { if (username != null && password != null) { <START> logger.trace("[setupAuthentication] {}@{}", username, password); <END> target.register(HttpAuthenticationFeature.basic(username, password)); return target; } else { throw new ServerErrorException("Unable to setup authentication", Response.Status.INTERNAL_SERVER_ERROR); } }</code><technical_language>I change @ : here</technical_language>

Target:
public WebTarget setupAuthentication(WebTarget target) { if (username != null && password != null) { logger.trace("[setupAuthentication] {}", username); target.register(HttpAuthenticationFeature.basic(username, password)); return target; } else { throw new ServerErrorException("Unable to setup authentication", Response.Status.INTERNAL_SERVER_ERROR); } }
Source:
<code>public void handleChildCommands() { if (getCallback() != null) { List<Guid> childCommands = CommandCoordinatorUtil.getChildCommandIds(getCommandId()); List<VdcActionParametersBase> parameters = new LinkedList<>(); for (Guid id : childCommands) { CommandBase<?> command = <START> CommandCoordinatorUtil.retrieveCommand(id); if (command.getParameters().getEndProcedure() == EndProcedure.BY_PARENT || <END> command.getParameters().getEndProcedure() == EndProcedure.PARENT_MANAGED) { command.getParameters().setEndProcedure(EndProcedure.PARENT_MANAGED); command.getParameters().setCommandType(command.getActionType()); parameters.add(command.getParameters()); } } getParameters().setImagesParameters(parameters); } }</code><technical_language>please move head of next line</technical_language>

Target:
public void handleChildCommands() { if (getCallback() != null) { List<Guid> childCommands = CommandCoordinatorUtil.getChildCommandIds(getCommandId()); List<VdcActionParametersBase> parameters = new LinkedList<>(); for (Guid id : childCommands) { CommandBase<?> command = CommandCoordinatorUtil.retrieveCommand(id); if (command.getParameters().getEndProcedure() == EndProcedure.PARENT_MANAGED || command.getParameters().getEndProcedure() == EndProcedure.FLOW_MANAGED) { command.getParameters().setEndProcedure(EndProcedure.FLOW_MANAGED); command.getParameters().setCommandType(command.getActionType()); parameters.add(command.getParameters()); } } getParameters().setImagesParameters(parameters); } }
Source:
<code>public void setZeroValue() { <START> percentageBarB.setVisible(false); <END> percentageBarA.setVisible(true); percentageBarA.setTitle(title); percentageBarA.setStyleName(style.empty()); percentageBarA.setWidth(FULL_WIDTH + "%"); percentageLabelA.setText(ZERO); percentageLabelA.setStyleName(style.percentageLabelBlack()); }</code><technical_language>nicer set width 0, method suggests</technical_language>

Target:
public void setZeroValue() { percentageBarB.setVisible(false); percentageBarB.setWidth("0px"); percentageBarA.setVisible(true); percentageBarA.setTitle(title); percentageBarA.setStyleName(style.empty()); percentageBarA.setWidth(FULL_WIDTH + "%"); percentageLabelA.setText(ZERO); percentageLabelA.setStyleName(style.percentageLabelBlack()); }
Source:
<code>private List<Device> getDetailedDevices() { List<Device> deviceList = new LinkedList<Device>(); JsonObject result = connMan.getDigitalSTROMAPI().query2(connMan.getSessionToken(), GET_DETAILD_DEVICES); if (result != null && result.isJsonObject()) { <START> if (result.getAsJsonObject().get("zone0").isJsonObject()) { <END> result = result.getAsJsonObject().get("zone0").getAsJsonObject(); for (Entry<String, JsonElement> entry : result.entrySet()) { if (!(entry.getKey().equals(JSONApiResponseKeysEnum.ZONE_ID.getKey()) && entry.getKey().equals(JSONApiResponseKeysEnum.NAME.getKey())) && entry.getValue().isJsonObject()) { deviceList.add(new DeviceImpl(entry.getValue().getAsJsonObject())); } } } } return deviceList; }</code><technical_language>Is zone0? extract this magic string..</technical_language>

Target:
private List<Device> getDetailedDevices() { List<Device> deviceList = new LinkedList<Device>(); JsonObject result = connMan.getDigitalSTROMAPI().query2(connMan.getSessionToken(), GET_DETAILD_DEVICES); if (result != null && result.isJsonObject()) { if (result.getAsJsonObject().get(GeneralLibConstance.QUERY_BROADCAST_ZONE_STRING).isJsonObject()) { result = result.getAsJsonObject().get(GeneralLibConstance.QUERY_BROADCAST_ZONE_STRING) .getAsJsonObject(); for (Entry<String, JsonElement> entry : result.entrySet()) { if (!(entry.getKey().equals(JSONApiResponseKeysEnum.ZONE_ID.getKey()) && entry.getKey().equals(JSONApiResponseKeysEnum.NAME.getKey())) && entry.getValue().isJsonObject()) { deviceList.add(new DeviceImpl(entry.getValue().getAsJsonObject())); } } } } return deviceList; }
Source:
<code>private List<String> getRepoTags() { if (projectPreferences != null) { String tagPref = projectPreferences.get(CreaterepoPreferenceConstants.PREF_REPO_TAG, ICreaterepoConstants.EMPTY_STRING); if (!tagPref.isEmpty()) { return Arrays.asList(tagPref.split(ICreaterepoConstants.DELIMITER)); } } <START> return ICreaterepoConstants.EMPTY_LIST; <END> }</code><technical_language>Do need this constant all? Collections.emptyList() sufficient</technical_language>

Target:
private List<String> getRepoTags() { if (projectPreferences != null) { String tagPref = projectPreferences.get(CreaterepoPreferenceConstants.PREF_REPO_TAG, ICreaterepoConstants.EMPTY_STRING); if (!tagPref.isEmpty()) { return Arrays.asList(tagPref.split(ICreaterepoConstants.DELIMITER)); } } return Collections.EMPTY_LIST; }
Source:
<code>public Webhook(String componentUuid, @Nullable String ceTaskUuid, @Nullable String analysisUuid, String name, String url) { this.componentUuid = requireNonNull(componentUuid); this.ceTaskUuid = ceTaskUuid; <START> this.analysisUuid = requireNonNull(analysisUuid); <END> this.name = requireNonNull(name); this.url = requireNonNull(url); }</code><technical_language>warning: requireNonNull a nullable argument highlights a UT is missing (could testing Optional.empty() is returned argument is null)</technical_language>

Target:
public Webhook(String componentUuid, @Nullable String ceTaskUuid, @Nullable String analysisUuid, String name, String url) { this.componentUuid = requireNonNull(componentUuid); this.ceTaskUuid = ceTaskUuid; this.analysisUuid = analysisUuid; this.name = requireNonNull(name); this.url = requireNonNull(url); }
Source:
<code>public static boolean isValidEmail(String emailAddress) { <START> final String regex = "^[_A-Za-z0-9-+]+(\\.[_A-Za-z0-9-+]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(\\.[A-Za-z]{2,})$"; <END> return emailAddress.matches(regex); }</code><technical_language>this regex a private final static field... a pre-compiled Pattern</technical_language>

Target:
public static boolean isValidEmail(String emailAddress) { return emailAddress.matches(EMAIL_VALIDATION_REGEX); }
Source:
<code>public void syncData(String storageDomainId, String geoRepSessionId) { try { StorageDomain storageDomain = storageDomainDao.get(new Guid(storageDomainId)); if (storageDomain == null) { <START> log.error("No storage domain found"); <END> return; } GlusterGeoRepSession session = geoRepDao.getById(new Guid(geoRepSessionId)); if (session == null) { log.error("No geo-replication session found"); return; } backend.runInternalAction(VdcActionType.GlusterStorageSync, new GlusterStorageSyncCommandParameters(storageDomain.getId(), session.getId()), ExecutionHandler.createInternalJobContext()); } catch (Exception e) { log.error("Error running dr sync", e); } }</code><technical_language>add storageDomainId log</technical_language>

Target:
public void syncData(String storageDomainId, String geoRepSessionId) { try { StorageDomain storageDomain = storageDomainDao.get(new Guid(storageDomainId)); if (storageDomain == null) { log.error("No storage domain found for id '{}'", storageDomainId); return; } GlusterGeoRepSession session = geoRepDao.getById(new Guid(geoRepSessionId)); if (session == null) { log.error("No geo-replication session found for id '{}'", geoRepSessionId); return; } backend.runInternalAction(VdcActionType.GlusterStorageSync, new GlusterStorageSyncCommandParameters(storageDomain.getId(), session.getId()), ExecutionHandler.createInternalJobContext()); } catch (Exception e) { log.error("Error running dr sync", e); } }
Source:
<code>public void verifyUserLoggedIn(final String userName) { changeImplicitWait(0, TimeUnit.MILLISECONDS); try { if (driver.findElements(By.cssSelector("#PreviewFrame")).size() > 0) { driver.switchTo().frame("PreviewFrame"); } if (driver.findElements(MERCURY_SKIN).size() > 0) { wait.forElementClickable(MERCURY_NAV_ICON); driver.findElement(MERCURY_NAV_ICON).click(); wait.forElementVisible(By.cssSelector( LOGGED_IN_USER_SELECTOR_MERCURY.replace("%userName%", userName.replace(" ", "_")))); wait.forElementClickable(MERCURY_NAV_ICON); driver.findElement(MERCURY_NAV_ICON).click(); } else { <START> wait.forElementVisible(By.cssSelector(LOGGED_IN_USER_SELECTOR_OASIS)); <END> WebElement avatar = driver.findElement(By.cssSelector(LOGGED_IN_USER_SELECTOR_OASIS)); String loggedInUserName = avatar.getAttribute("alt"); if (!loggedInUserName.equals(userName)) { throw new IllegalArgumentException( "Invalid user, expected " + userName + ", but found: " + loggedInUserName); } } } finally { restoreDefaultImplicitWait(); driver.switchTo().defaultContent(); } PageObjectLogging.log("verifyUserLoggedIn", "user " + userName + " logged in", true); }</code><technical_language>wait.forElementVisible returns WebElement, assign avatar remove line completely</technical_language>

Target:
public void verifyUserLoggedIn(final String userName) { changeImplicitWait(0, TimeUnit.MILLISECONDS); try { if (driver.findElements(By.cssSelector("#PreviewFrame")).size() > 0) { driver.switchTo().frame("PreviewFrame"); } if (driver.findElements(MERCURY_SKIN).size() > 0) { wait.forElementClickable(MERCURY_NAV_ICON); driver.findElement(MERCURY_NAV_ICON).click(); wait.forElementVisible(By.cssSelector( LOGGED_IN_USER_SELECTOR_MERCURY.replace("%userName%", userName.replace(" ", "_")))); wait.forElementClickable(MERCURY_NAV_ICON); driver.findElement(MERCURY_NAV_ICON).click(); } else { WebElement avatar = wait.forElementVisible(By.cssSelector(LOGGED_IN_USER_SELECTOR_OASIS)); String loggedInUserName = avatar.getAttribute("alt"); if (!loggedInUserName.equals(userName)) { throw new IllegalArgumentException( "Invalid user, expected " + userName + ", but found: " + loggedInUserName); } } } finally { restoreDefaultImplicitWait(); driver.switchTo().defaultContent(); } PageObjectLogging.log("verifyUserLoggedIn", "user " + userName + " logged in", true); }
Source:
<code>public JettyConfig getJettyConfig() { <START> if(jettyConfig != null) <END> { return jettyConfig; } else { return new DefaultJettyConfig(); } }</code><technical_language>ternary operator here. Optional, Java8 now. Optional.ofNullable(jettyConfig).orElse(() -> new DefaultJettyConfig());</technical_language>

Target:
public JettyConfig getJettyConfig() { return jettyConfig != null ? jettyConfig : new DefaultJettyConfig(); }
Source:
<code>public void verifyAddMessages() { <START> List<String> messagesToAdd = new ArrayList(); <END> messagesToAdd.add(TEST_STRING_ONE); messagesToAdd.add(TEST_STRING_TWO); messagesToAdd.add(TEST_STRING_ONE); messagesToAdd.add(TEST_STRING_THREE); messagesToAdd.add(TEST_STRING_TWO); validationResult.addMessages(messagesToAdd); assertEquals("There should only be three lines", 3, validationResult.getMessages().size()); assertEquals("There should only be five lines", 5, messagesToAdd.size()); }</code><technical_language>Missing generics ArrayList construction</technical_language>

Target:
public void verifyAddMessages() { List<String> messagesToAdd = new ArrayList<String>(); messagesToAdd.add(TEST_STRING_ONE); messagesToAdd.add(TEST_STRING_TWO); messagesToAdd.add(TEST_STRING_ONE); messagesToAdd.add(TEST_STRING_THREE); messagesToAdd.add(TEST_STRING_THREE_UPPER_CASE); validationResult.addMessages(messagesToAdd); assertEquals("There should only be three lines", 3, validationResult.getMessages().size()); assertEquals("There should only be five lines", 5, messagesToAdd.size()); }
Source:
<code>public void updateGapHeader(M gapHeader) throws IOException { synchronized (PersistentBinaryDeque.this) { <START> if (m_closed) throw new IOException("GapWriter is closed"); <END> m_gapHeader = gapHeader; if (m_activeSegment != null) { finishWrite(m_activeSegment); m_activeSegment = null; } } }</code><technical_language>Identification of PBD hitting error useful for troubleshooting</technical_language>

Target:
public void updateGapHeader(M gapHeader) throws IOException { synchronized (PersistentBinaryDeque.this) { if (m_closed) throw new IOException("updateGapHeader call on closed PBD " + m_nonce); m_gapHeader = gapHeader; if (m_activeSegment!= null) { finishActiveSegmentWrite(); } } }
Source:
<code>private void initList() { presenter.initList(entityId); if (!NetworkUtils.isInternetConnectionEstablished(getContext())) { handleNoInternet(); <START> } else presenter.initList(entityId); <END> }</code><technical_language>Wrap in braces</technical_language>

Target:
private void initList() { presenter.initList(entityId); if (!NetworkUtils.isInternetConnectionEstablished(getContext())) { handleNoInternet(); } else { presenter.initList(entityId); } }
Source:
<code>protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fui_activity_invisible); <START> mProgressBar = new ProgressBar(new ContextThemeWrapper(this, getFlowParams().themeId)); <END> mProgressBar.setIndeterminate(true); mProgressBar.setVisibility(View.INVISIBLE); FrameLayout.LayoutParams params = new FrameLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); params.gravity = Gravity.CENTER; FrameLayout container = findViewById(R.id.invisible_frame); container.addView(mProgressBar, params); }</code><technical_language>material library version get sexiness pre-L? (And consistent behavior in general.)</technical_language>

Target:
protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fui_activity_invisible); mProgressBar = new MaterialProgressBar(new ContextThemeWrapper(this, getFlowParams().themeId)); mProgressBar.setIndeterminate(true); mProgressBar.setVisibility(View.GONE); FrameLayout.LayoutParams params = new FrameLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); params.gravity = Gravity.CENTER; FrameLayout container = findViewById(R.id.invisible_frame); container.addView(mProgressBar, params); }
Source:
<code><START> private void addSizedFiles(Collection<File> files) <END> { if (files == null || files.isEmpty()) { return; } long size = 0l; for (File file : files) { size += file.length(); } this.files.addAll(files); this.size += size; }</code><technical_language>is this private, addFiles is public</technical_language>

Target:
protected void addSizedFiles(Collection<File> files) { if (files == null || files.isEmpty()) { return; } long size = 0l; for (File file : files) { size += file.length(); } this.files.addAll(files); this.size += size; }
Source:
<code>private Path toDatabaseDirectory( String databaseName ) { <START> return Config.fromFile( configDir.resolve( "neo4j.conf" ) ) <END> .withHome( homeDir ) .withConnectorsDisabled() .withSetting( DatabaseManagementSystemSettings.active_database, databaseName ) .build().get( database_path ).toPath(); }</code><technical_language>please defined constant for default config file name</technical_language>

Target:
private Path toDatabaseDirectory( String databaseName ) { return Config.fromFile( configDir.resolve( Config.DEFAULT_CONFIG_FILE_NAME ) ) .withHome( homeDir ) .withConnectorsDisabled() .withSetting( DatabaseManagementSystemSettings.active_database, databaseName ) .build().get( database_path ).toPath(); }
Source:
<code>protected void recomputeDocumentTypes() { Map<String, DocumentTypeDescriptor> dtds = new LinkedHashMap<>(); for (DocumentTypeDescriptor dtd : allDocumentTypes) { String name = dtd.name; DocumentTypeDescriptor newDtd = dtd; if (dtd.append && dtds.containsKey(dtd.name)) { newDtd = mergeDocumentTypeDescriptors(dtd, dtds.get(name)); } dtds.put(name, newDtd); } documentTypes.clear(); documentTypesExtending.clear(); registerDocumentType(new DocumentTypeImpl(TypeConstants.DOCUMENT)); for (String name : dtds.keySet()) { LinkedHashSet<String> stack = new LinkedHashSet<>(); recomputeDocumentType(name, stack, dtds); } documentTypesForFacet.clear(); for (DocumentType docType : documentTypes.values()) { for (String facet : docType.getFacets()) { documentTypesForFacet.computeIfAbsent(facet, k -> new HashSet<>()).add(docType.getName()); } } specialDocumentTypes.clear(); Set<String> specials = allDocumentTypes.stream() <START> .filter(d -> Boolean.TRUE.equals(d.excludeFromCopy)) <END> .map(d -> d.name) .collect(Collectors.toSet()); specialDocumentTypes = documentTypes.values().stream().filter(d -> specials.contains(d.getName())).collect(Collectors.toMap(DocumentType::getName, d -> d)); }</code><technical_language>Code introduce is indented</technical_language>

Target:
protected void recomputeDocumentTypes() { Map<String, DocumentTypeDescriptor> dtds = new LinkedHashMap<>(); for (DocumentTypeDescriptor dtd : allDocumentTypes) { String name = dtd.name; DocumentTypeDescriptor newDtd = dtd; if (dtd.append && dtds.containsKey(dtd.name)) { newDtd = mergeDocumentTypeDescriptors(dtd, dtds.get(name)); } dtds.put(name, newDtd); } documentTypes.clear(); documentTypesExtending.clear(); registerDocumentType(new DocumentTypeImpl(TypeConstants.DOCUMENT)); for (String name : dtds.keySet()) { LinkedHashSet<String> stack = new LinkedHashSet<>(); recomputeDocumentType(name, stack, dtds); } documentTypesForFacet.clear(); for (DocumentType docType : documentTypes.values()) { for (String facet : docType.getFacets()) { documentTypesForFacet.computeIfAbsent(facet, k -> new HashSet<>()).add(docType.getName()); } } specialDocumentTypes = dtds.values().stream() .filter(d -> Boolean.TRUE.equals(d.special)) .map(d -> d.name) .collect(Collectors.toSet()); }
Source:
<code>public static Expression convertToRoundExpressionIfNeeded(PDataType fromDataType, PDataType targetDataType, List<Expression> expressions) throws SQLException { Expression firstChildExpr = expressions.get(0); if(fromDataType == PDataType.DECIMAL && targetDataType.isCoercibleTo(PDataType.LONG)) { return new RoundDecimalExpression(expressions); } else if(fromDataType == PDataType.TIMESTAMP && targetDataType.isCoercibleTo(PDataType.DATE)) { <START> Expression millisLiteral = LiteralExpression.newConstant(TimeUnit.MILLISECOND.name(), PDataType.VARCHAR); <END> return new RoundTimestampExpression(Lists.newArrayList(expressions.get(0), millisLiteral)); } else if(!fromDataType.isCoercibleTo(targetDataType)) { throw new TypeMismatchException(fromDataType, targetDataType, firstChildExpr.toString()); } return firstChildExpr; }</code><technical_language>Create static constant for this</technical_language>

Target:
public static Expression convertToRoundExpressionIfNeeded(PDataType fromDataType, PDataType targetDataType, List<Expression> expressions) throws SQLException { Expression firstChildExpr = expressions.get(0); if(fromDataType == targetDataType) { return firstChildExpr; } else if(fromDataType == PDataType.DECIMAL && targetDataType.isCoercibleTo(PDataType.LONG)) { return new RoundDecimalExpression(expressions); } else if(fromDataType == PDataType.TIMESTAMP && targetDataType.isCoercibleTo(PDataType.DATE)) { return RoundTimestampExpression.create(expressions.get(0)); } else if(!fromDataType.isCoercibleTo(targetDataType)) { throw new TypeMismatchException(fromDataType, targetDataType, firstChildExpr.toString()); } return firstChildExpr; }
Source:
<code>public void setup() throws IOException { <START> InputStream input = getClass().getResourceAsStream("/fixtures/contributors.json"); <END> try { byte[] data = toByteArray(input); mockClient = new MockClient(); github = Feign.builder().decoder(new AssertionDecoder(new GsonDecoder())) .client(mockClient.ok(HttpMethod.GET, "/repos/netflix/feign/contributors", data) .ok(HttpMethod.GET, "/repos/netflix/feign/contributors?client_id=55") .ok(HttpMethod.GET, "/repos/netflix/feign/contributors?client_id=7 7", new ByteArrayInputStream(data)) .ok(HttpMethod.POST, "/repos/netflix/feign/contributors", "{\"login\":\"velo\",\"contributions\":0}") .noContent(HttpMethod.PATCH, "/repos/velo/feign-mock/contributors") .add(HttpMethod.GET, "/repos/netflix/feign/contributors?client_id=1234567890", HttpsURLConnection.HTTP_NOT_FOUND) .add(HttpMethod.GET, "/repos/netflix/feign/contributors?client_id=123456789", HttpsURLConnection.HTTP_INTERNAL_ERROR, new ByteArrayInputStream(data)) .add(HttpMethod.GET, "/repos/netflix/feign/contributors?client_id=123456789", HttpsURLConnection.HTTP_INTERNAL_ERROR, "") .add(HttpMethod.GET, "/repos/netflix/feign/contributors?client_id=123456789", HttpsURLConnection.HTTP_INTERNAL_ERROR, data)) .target(new MockTarget<GitHub>(GitHub.class)); } finally { input.close(); } }</code><technical_language>need undo it</technical_language>

Target:
public void setup() throws IOException { try (InputStream input = getClass().getResourceAsStream("/fixtures/contributors.json")) { byte[] data = toByteArray(input); mockClient = new MockClient(); github = Feign.builder().decoder(new AssertionDecoder(new GsonDecoder())) .client(mockClient.ok(HttpMethod.GET, "/repos/netflix/feign/contributors", data) .ok(HttpMethod.GET, "/repos/netflix/feign/contributors?client_id=55") .ok(HttpMethod.GET, "/repos/netflix/feign/contributors?client_id=7 7", new ByteArrayInputStream(data)) .ok(HttpMethod.POST, "/repos/netflix/feign/contributors", "{\"login\":\"velo\",\"contributions\":0}") .noContent(HttpMethod.PATCH, "/repos/velo/feign-mock/contributors") .add(HttpMethod.GET, "/repos/netflix/feign/contributors?client_id=1234567890", HttpsURLConnection.HTTP_NOT_FOUND) .add(HttpMethod.GET, "/repos/netflix/feign/contributors?client_id=123456789", HttpsURLConnection.HTTP_INTERNAL_ERROR, new ByteArrayInputStream(data)) .add(HttpMethod.GET, "/repos/netflix/feign/contributors?client_id=123456789", HttpsURLConnection.HTTP_INTERNAL_ERROR, "") .add(HttpMethod.GET, "/repos/netflix/feign/contributors?client_id=123456789", HttpsURLConnection.HTTP_INTERNAL_ERROR, data)) .target(new MockTarget<>(GitHub.class)); } }
Source:
<code>private void loadPlugIns() { <START> Collection<File> plugInJars = Collections.emptyList(); <END> try { plugInJars = getPluginFiles(); } catch (IOException e) { log.error("Cannot scan Gerrit plugins directory looking for jar files", e); return; } for (File jarFile : plugInJars) { Plugin plugIn; try { plugIn = loadPlugin(jarFile); pluginCache.put(plugIn.name, plugIn); } catch (IOException e) { log.warn("Cannot access PlugIn jar " + jarFile, e); } catch (ClassNotFoundException e) { log.warn("Cannot load PlugIn class module from " + jarFile, e); } } }</code><technical_language>This is a no-op, catch return this is consumed assign a value</technical_language>

Target:
private void loadPlugIns() { Collection<File> plugInJars; try { plugInJars = getPluginFiles(); } catch (IOException e) { log.error("Cannot scan Gerrit plugins directory looking for jar files", e); return; } for (File jarFile : plugInJars) { Plugin plugIn; try { plugIn = loadPlugin(jarFile); pluginCache.put(plugIn.name, plugIn); } catch (IOException e) { log.warn("Cannot access PlugIn jar " + jarFile, e); } catch (ClassNotFoundException e) { log.warn("Cannot load PlugIn class module from " + jarFile, e); } } }