auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected Control createPageControls(Composite parent) { getShell().setText(Messages.Reviews_AddCommentDialog_Title); setTitle(Messages.Reviews_AddCommentDialog_Title); <START> setMessage(NLS.bind(Messages.Reviews_AddCommentDialog_Message, location.getIndex())); <END> Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(1, false)); commentEditor = createRichTextEditor(composite, ""); GridDataFactory.fillDefaults().grab(true, true).applyTo(commentEditor.getControl()); return composite; }</code><technical_language>I if include file name in title</technical_language>

Target:
protected Control createPageControls(Composite parent) { getShell().setText(Messages.Reviews_AddCommentDialog_Title); setTitle(Messages.Reviews_AddCommentDialog_Title); setMessage(NLS.bind(Messages.Reviews_AddCommentDialog_Message, new Path(item.getName()).lastSegment(), location.getIndex())); Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(1, false)); commentEditor = createRichTextEditor(composite, ""); GridDataFactory.fillDefaults().grab(true, true).applyTo(commentEditor.getControl()); return composite; }
Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event); try { FeatureFinishOperation operation = new FeatureFinishOperation(gfRepo); JobUtil.scheduleUserWorkspaceJob(operation, UIText.FeatureFinishHandler_finishingFeature, JobFamilies.GITFLOW_FAMILY); IJobManager jobMan = Job.getJobManager(); jobMan.join(JobFamilies.GITFLOW_FAMILY, null); MergeStatus mergeResult = operation.getMergeResult(); if (MergeStatus.CONFLICTING.equals(mergeResult)) { MessageDialog.openWarning(null, UIText.FeatureFinishHandler_Conflicts, <START> UIText.FeatureFinishHandler_featureFinishConflicts); <END> } } catch (WrongGitFlowStateException | CoreException | IOException | OperationCanceledException | InterruptedException e) { return error(e.getMessage(), e); } return null; }</code><technical_language>I display involved branches/commits user merge (in do for a plain merge operation failing due merge conflicts)</technical_language>

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event); try { FeatureFinishOperation operation = new FeatureFinishOperation(gfRepo); String featureBranch = gfRepo.getRepository().getBranch(); String develop = gfRepo.getConfig().getDevelop(); JobUtil.scheduleUserWorkspaceJob(operation, UIText.FeatureFinishHandler_finishingFeature, JobFamilies.GITFLOW_FAMILY); IJobManager jobMan = Job.getJobManager(); jobMan.join(JobFamilies.GITFLOW_FAMILY, null); MergeResult mergeResult = operation.getMergeResult(); MergeStatus mergeStatus = mergeResult.getMergeStatus(); if (MergeStatus.CONFLICTING.equals(mergeStatus)) { MultiStatus warning = createConflictWarning(develop, featureBranch, mergeResult); ErrorDialog.openError(null, UIText.FeatureFinishHandler_Conflicts, null, warning); } } catch (WrongGitFlowStateException | CoreException | IOException | OperationCanceledException | InterruptedException e) { return error(e.getMessage(), e); } return null; }
Source:
<code>NumaValidator(VdsNumaNodeDao vdsNumaNodeDao) { Objects.requireNonNull(vdsNumaNodeDao); <START> this.vdsNumaNodeDao = vdsNumaNodeDao; <END> }</code><technical_language>this.vdsNumaNodeDao = Objects.requireNonNull(vdsNumaNodeDao)</technical_language>

Target:
NumaValidator(VdsNumaNodeDao vdsNumaNodeDao) { this.vdsNumaNodeDao = Objects.requireNonNull(vdsNumaNodeDao); }
Source:
<code>public void testAddRetrieveRules() { RuleEngine ruleEngine = createRuleEngine(); Rule rule0 = ruleEngine.initRuleId(new Rule()); ruleEngine.addRule(rule0, true); <START> Collection<RuntimeRule> rules = ruleEngine.rules.values(); <END> Assert.assertNotNull("null returned instead of rules list", rules); Assert.assertEquals("empty rules list is returned", 1, rules.size()); Assert.assertEquals("Returned rule with wrong UID", "rule_1", rules.iterator().next().getUID()); Rule rule1 = createRule(); ruleEngine.addRule(rule1, true); Assert.assertEquals("rules list should contain 2 rules", 2, rules.size()); RuntimeRule rule1Get = ruleEngine.getRuntimeRule("rule1"); Assert.assertEquals("Returned rule with wrong UID", "rule1", rule1Get.getUID()); Rule rule2 = createRule(); ruleEngine.addRule(rule2, true); Assert.assertEquals("rules list should contain 2 rules", 2, rules.size()); Assert.assertEquals("rules list should contain 2 rules", rule1Get, ruleEngine.getRuntimeRule("rule1")); }</code><technical_language>rules.values. private field. Do a method getRuntimeRules() return unmodifiable collection of rules</technical_language>

Target:
public void testAddRetrieveRules() { RuleEngine ruleEngine = createRuleEngine(); Rule rule0 = new Rule(ruleEngine.getUniqueId()); ruleEngine.addRule(rule0, true); Collection<RuntimeRule> rules = ruleEngine.getRuntimeRules(); Assert.assertNotNull("null returned instead of rules list", rules); Assert.assertEquals("empty rules list is returned", 1, rules.size()); Assert.assertEquals("Returned rule with wrong UID", "rule_1", rules.iterator().next().getUID()); Rule rule1 = createRule(); ruleEngine.addRule(rule1, true); rules = ruleEngine.getRuntimeRules(); Assert.assertEquals("rules list should contain 2 rules", 2, rules.size()); RuntimeRule rule1Get = ruleEngine.getRuntimeRule("rule1"); Assert.assertEquals("Returned rule with wrong UID", "rule1", rule1Get.getUID()); Rule rule2 = createRule(); ruleEngine.addRule(rule2, true); rules = ruleEngine.getRuntimeRules(); Assert.assertEquals("rules list should contain 2 rules", 2, rules.size()); Assert.assertEquals("rules list should contain 2 rules", rule1Get, ruleEngine.getRuntimeRule("rule1")); }
Source:
<code>boolean needsToBeStubbed() { <START> return globalSets == 0 && localSets > 0 && localSetsWithNoCollapse <= 0; <END> }</code><technical_language>I <code>@nocollapse</code> effect declaration site of a name, random assignment name</technical_language>

Target:
boolean needsToBeStubbed() { return globalSets == 0 && localSets > 0 && localSetsWithNoCollapse == 0 && !isCollapsingExplicitlyDenied(); }
Source:
<code><START> public static void setRole(PerunSession sess, User user, PerunBean complementaryObject, String role) throws InternalErrorException, PrivilegeException, UserNotExistsException, AlreadyAdminException { <END> Utils.notNull(role, "role"); ((PerunBl) sess.getPerun()).getUsersManagerBl().checkUserExists(sess, user); if(!isAuthorizedToManageRole(sess, complementaryObject, role)) { throw new PrivilegeException("You are not privileged to use this method setRole."); } AuthzResolverBlImpl.setRole(sess, user,complementaryObject, role); }</code><technical_language>"perunadmin" "PERUNADMIN" now, for other methods</technical_language>

Target:
public static void setRole(PerunSession sess, User user, PerunBean complementaryObject, String role) throws InternalErrorException, PrivilegeException, UserNotExistsException, AlreadyAdminException { Utils.notNull(role, "role"); if (!roleExists(role)) { throw new InternalErrorException("Role: "+ role +" does not exists."); } ((PerunBl) sess.getPerun()).getUsersManagerBl().checkUserExists(sess, user); if(!isAuthorizedToManageRole(sess, complementaryObject, role)) { throw new PrivilegeException("You are not privileged to use this method setRole."); } AuthzResolverBlImpl.setRole(sess, user,complementaryObject, role); }
Source:
<code>public static ArrayList<Guid> getGuidListFromString(String str) { <START> if (StringHelper.isNullOrEmpty(str)) { <END> return new ArrayList<Guid>(); } return getGuidListFromStringArray(Arrays.asList(str.split(SEPARATOR))); }</code><technical_language>kill entire compat package - please add new dependencies it. common-lang's StringUtils.isEmpty(str)</technical_language>

Target:
public static ArrayList<Guid> getGuidListFromString(String str) { if (StringUtils.isEmpty(str)) { return new ArrayList<Guid>(); } return getGuidListFromStringArray(Arrays.asList(str.split(SEPARATOR))); }
Source:
<code>protected void executeQueryCommand() { final List<Volume> allVolumes = getVolumeProviderProxy().getVolumes(); final List<Disk> registeredDisks = <START> getDbFacade().getDiskDao().getAllWithQuery(String.format("SELECT * FROM all_disks where disk_storage_type = '%d'", <END> DiskStorageType.CINDER.getValue())); List<Volume> unregisteredVolumes = LinqUtils.filter(allVolumes, new Predicate<Volume>() { @Override public boolean eval(Volume volume) { for (Disk registeredDisk : registeredDisks) { if (volume.getId().equals(registeredDisk.getId().toString())) { return false; } } return true; } }); Guid storageDomainId = getParameters().getId(); List<CinderDisk> unregisteredDisks = CinderBroker.volumesToCinderDisks(unregisteredVolumes, storageDomainId); getQueryReturnValue().setReturnValue(unregisteredDisks); }</code><technical_language>This is do filtering form DB, add a new stored procedure for</technical_language>

Target:
protected void executeQueryCommand() { final List<Volume> allVolumes = getVolumeProviderProxy().getVolumes(); final List<Disk> registeredDisks = getDbFacade().getDiskDao().getAllFromDisksByDiskStorageType(DiskStorageType.CINDER, getUserID(), getParameters().isFiltered()); List<Volume> unregisteredVolumes = LinqUtils.filter(allVolumes, new Predicate<Volume>() { @Override public boolean eval(Volume volume) { for (Disk registeredDisk : registeredDisks) { if (volume.getId().equals(registeredDisk.getId().toString())) { return false; } } return true; } }); Guid storageDomainId = getParameters().getId(); List<CinderDisk> unregisteredDisks = CinderBroker.volumesToCinderDisks(unregisteredVolumes, storageDomainId); getQueryReturnValue().setReturnValue(unregisteredDisks); }
Source:
<code>public void testCreatePullRequest() { PullRequestView view = openLoginScreen() .login(NET_ID, PASSWORD) .toCoursesView() .listMyProjects() .get(0).click() .listBranches() <START> .get(1).click() <END> .openCreatePullRequestView(); }</code><technical_language>implemented in latest push</technical_language>

Target:
public void testCreatePullRequest() throws InterruptedException { Branch newBranch = openLoginScreen() .login(NET_ID, PASSWORD) .toCoursesView() .listMyProjects() .get(0).click() .listBranches() .get(1); assertEquals(BRANCH_NAME, newBranch.getName()); PullRequestOverViewView pullRequestOverViewView = newBranch.click().openCreatePullRequestView(); waitForCondition(3, x -> pullRequestOverViewView.isOpen()); PullRequest pullRequest = getPullRequest(BRANCH_NAME); assertEquals(pullRequest.isOpen(), pullRequestOverViewView.isOpen()); String author = pullRequest.getDestination().getAuthor(); assertEquals(author, pullRequestOverViewView.getAuthorHeader()); assertEquals(COMMIT_MESSAGE, pullRequestOverViewView.getMessageHeader()); }
Source:
<code>public static ObjectId findObject(AnyObjectId tree, String path, ObjectReader or) throws MissingObjectException, CorruptObjectException, IOException { TreeWalk tw = new TreeWalk(or); tw.addTree(tree); PathTokenizer tokenizer = tw.new PathTokenizer( path.getBytes(Constants.CHARSET)); <START> if (!tokenizer.findNextToken()) { <END> return null; } while (true) { if (!tw.next()) { return null; } if (tokenizer.compareCurrentToken()) { if (!tokenizer.findNextToken()) { return tw.getObjectId(0); } else { try { tw.enterSubtree(); } catch (IncorrectObjectTypeException e) { return null; } } } } }</code><technical_language>style-nit: avoid braces for simple constructs</technical_language>

Target:
public static ObjectId findObject(AnyObjectId tree, String path, ObjectReader or) throws MissingObjectException, CorruptObjectException, IOException { TreeWalk tw = new TreeWalk(or); tw.addTree(tree); PathTokenizer tokenizer = tw.new PathTokenizer( path.getBytes(Constants.CHARSET)); if (!tokenizer.findNextToken()) return null; for (;;) { if (!tw.next()) return null; if (tokenizer.compareCurrentToken()) { if (!tokenizer.findNextToken()) { return tw.getObjectId(0); } else { try { tw.enterSubtree(); } catch (IncorrectObjectTypeException e) { return null; } } } } }
Source:
<code>public void playSound(Location location, Sound sound, float volume, float pitch) { if (location == null || sound == null) return; <START> final double radiusSquared = Math.pow(volume > 1 ? volume * 16 : 16, 2); <END> for (Player player : getRawPlayers()) { if (player.getLocation().distanceSquared(location) <= radiusSquared) { player.playSound(location, sound, volume, pitch); } } }</code><technical_language>This is incorrect though. A sound played 0.5f volume heard 8 blocks of source, 16</technical_language>

Target:
public void playSound(Location location, Sound sound, float volume, float pitch) { if (location == null || sound == null) return; final double radiusSquared = Math.pow(volume * 16, 2); for (Player player : getRawPlayers()) { if (player.getLocation().distanceSquared(location) <= radiusSquared) { player.playSound(location, sound, volume, pitch); } } }
Source:
<code>public DatePickerFieldDefinition getDefaultField() { DatePickerFieldDefinition result = new DatePickerFieldDefinition(); <START> result.setStandaloneClassName(Date.class.getName()); <END> return result; }</code><technical_language>Wondering if sense setStandaloneClassName constructor a "fixed" class</technical_language>

Target:
public DatePickerFieldDefinition getDefaultField() { return new DatePickerFieldDefinition(); }
Source:
<code>public final Object accessField(Field field, Object object) { try { <START> if (field.isAccessible()) { <END> return field.get(object); } else { Optional<Method> getter = TypeExtractionUtils.getGetter(field); if (!getter.isPresent()) { throw new IllegalStateException("This should not happen. The field should either be accessible or" + " we should have a getter. Field: " + field + " obj: " + object); } return getter.get().invoke(object); } } catch (NullPointerException npex) { throw new NullKeyFieldException("Unable to access field "+field+" on object "+object); } catch (IllegalAccessException iaex) { throw new RuntimeException("This should not happen since we call setAccessible(true) in PojoTypeInfo." + " fields: " + field + " obj: " + object); } catch (InvocationTargetException e) { throw new WrappingRuntimeException(e); } }</code><technical_language>easier (and more performant) simply field accessible in constructor of comparator? methods for field access is beautiful</technical_language>

Target:
public final Object accessField(Field field, Object object) { try { object = field.get(object); } catch (NullPointerException npex) { throw new NullKeyFieldException("Unable to access field "+field+" on object "+object); } catch (IllegalAccessException iaex) { throw new RuntimeException("This should not happen since we call setAccesssible(true) in the ctor." + " fields: " + field + " obj: " + object); } return object; }
Source:
<code>default Map<String,Object> executeCdpCommand(String command, @Nullable Map<String, Object> params) { Map<String, Object> data = new HashMap<>(); data.put("cmd",checkNotNull(command)); <START> if(params != null){ <END> data.put("params",params); }else{ params = new HashMap<>(); data.put("params",params); } Response response = execute(EXECUTE_CDP_COMMAND, data); Map<String, Object> value = (Map<String, Object>) response.getValue(); return value; }</code><technical_language>Please auto format files, spaces set properly</technical_language>

Target:
default Map<String, Object> executeCdpCommand(String command, @Nullable Map<String, Object> params) { Map<String, Object> data = new HashMap<>(); data.put("cmd", checkNotNull(command)); data.put("params", params == null ? Collections.emptyMap() : params); Response response = execute(EXECUTE_GOOGLE_CDP_COMMAND, data); return ImmutableMap.copyOf((Map<String, Object>) response.getValue()); }
Source:
<code>public void materialize() { this.queryableName = storeName; if (tableProcessorNode != null) { <START> tableProcessorNode.setStoreNeeded(true); <END> } }</code><technical_language>I need this, if delay adding store writeToTopology()</technical_language>

Target:
public void materialize() { this.queryableName = storeName; }
Source:
<code>public void testTrimTrippleByteChar() throws SQLException { char unicodeChar = 0xffff; <START> String resultString = "ABC"; <END> byte[] resultBytes = resultString.getBytes(); while(unicodeChar > 0x07ff) { String dataString = unicodeChar+resultString+unicodeChar; byte[] dataBytes = dataString.getBytes(); byte[] trimBytes = Character.toString(unicodeChar).getBytes(); testTrimb(dataBytes, trimBytes, PBinary.INSTANCE, resultBytes); testTrimb(dataBytes, trimBytes, PVarbinary.INSTANCE, resultBytes); unicodeChar--; } }</code><technical_language>test method this resultString var = "ABC", a global variable</technical_language>

Target:
public void testTrimTrippleByteChar() throws SQLException { char unicodeChar = HIGHEST_UNICODE_3BYTE_CHAR; byte[] resultBytes = ABC.getBytes(); while(unicodeChar > HIGHEST_UNICODE_2BYTE_CHAR) { String dataString = unicodeChar+ABC+unicodeChar; byte[] dataBytes = dataString.getBytes(); byte[] trimBytes = Character.toString(unicodeChar).getBytes(); testTrimb(dataBytes, trimBytes, PBinary.INSTANCE, resultBytes); testTrimb(dataBytes, trimBytes, PVarbinary.INSTANCE, resultBytes); unicodeChar--; } }
Source:
<code>public ListBoxModel doFillReleaseDefinitionNameItems(@QueryParameter String collectionUrl, @QueryParameter String credentialsId, @QueryParameter String projectName) { StandardListBoxModel listBoxModel = new StandardListBoxModel(); listBoxModel.withEmptySelection(); if (StringUtils.isBlank(collectionUrl) || StringUtils.isBlank(credentialsId) || StringUtils.isBlank(projectName)) { return listBoxModel; } String username = TeamCollectionConfiguration.findCredentialsById(credentialsId).getUsername(); Secret password = TeamCollectionConfiguration.findCredentialsById(credentialsId).getPassword(); ReleaseManagementHttpClient releaseManagementHttpClient = new ReleaseManagementHttpClient( collectionUrl.toLowerCase().replaceFirst(".visualstudio.com", ".vsrm.visualstudio.com"), username, password); try { List<ReleaseDefinition> releaseDefinitions = releaseManagementHttpClient.GetReleaseDefinitions(projectName); for (ReleaseDefinition releaseDefinition : releaseDefinitions) { listBoxModel.add(releaseDefinition.getName()); } <START> } catch (ReleaseManagementException ignore) { <END> } return listBoxModel; }</code><technical_language>please log</technical_language>

Target:
public ListBoxModel doFillReleaseDefinitionNameItems(@QueryParameter String collectionUrl, @QueryParameter String credentialsId, @QueryParameter String projectName) { StandardListBoxModel listBoxModel = new StandardListBoxModel(); listBoxModel.withEmptySelection(); if (StringUtils.isBlank(collectionUrl) || StringUtils.isBlank(credentialsId) || StringUtils.isBlank(projectName)) { return listBoxModel; } StandardUsernamePasswordCredentials credential = TeamCollectionConfiguration.findCredentialsById(credentialsId); if (credential == null) { return listBoxModel; } String username = credential.getUsername(); Secret password = credential.getPassword(); try { ReleaseManagementHttpClient releaseManagementHttpClient = new ReleaseManagementHttpClient( collectionUrl.toLowerCase().replaceFirst(".visualstudio.com", ".vsrm.visualstudio.com"), username, password); List<ReleaseDefinition> releaseDefinitions = releaseManagementHttpClient.GetReleaseDefinitions(projectName); for (ReleaseDefinition releaseDefinition : releaseDefinitions) { listBoxModel.add(releaseDefinition.getName()); } } catch (ReleaseManagementException ex) { logger.log(Level.WARNING, String.format("Get release definition for project: %s failed.", projectName), ex); } return listBoxModel; }
Source:
<code>private boolean validatePrincipalLogin() { <START> InstancedConfiguration conf = InstancedConfiguration.defaults(); <END> String principal = conf.get(mPrincipalProperty); Matcher matchPrincipal = PRINCIPAL_PATTERN.matcher(principal); if (!matchPrincipal.matches()) { System.err.format("Principal %s is not in the right format.%n", principal); return false; } String primary = matchPrincipal.group("primary"); String instance = matchPrincipal.group("instance"); String realm = matchPrincipal.group("realm"); String keytab = conf.get(mKeytabProperty); CommandReturn cr; String[] command = new String[] {"kinit", "-kt", keytab, principal}; try { cr = ShellUtils.execCommandWithOutput(command); if (cr.getExitCode() != 0) { System.err.format("Kerberos login failed for %s with keytab %s with exit value %d.%n", principal, keytab, cr.getExitCode()); System.err.format("Primary is %s, instance is %s and realm is %s.%n", primary, instance, realm); return false; } } catch (IOException e) { System.err.format("Failed to execute %s with exception: %s%n", Arrays.toString(command), e); } return true; }</code><technical_language>pass in conf object</technical_language>

Target:
private boolean validatePrincipalLogin() { String principal = mConf.get(mPrincipalProperty); Matcher matchPrincipal = PRINCIPAL_PATTERN.matcher(principal); if (!matchPrincipal.matches()) { System.err.format("Principal %s is not in the right format.%n", principal); return false; } String primary = matchPrincipal.group("primary"); String instance = matchPrincipal.group("instance"); String realm = matchPrincipal.group("realm"); String keytab = mConf.get(mKeytabProperty); CommandReturn cr; String[] command = new String[] {"kinit", "-kt", keytab, principal}; try { cr = ShellUtils.execCommandWithOutput(command); if (cr.getExitCode() != 0) { System.err.format("Kerberos login failed for %s with keytab %s with exit value %d.%n", principal, keytab, cr.getExitCode()); System.err.format("Primary is %s, instance is %s and realm is %s.%n", primary, instance, realm); return false; } } catch (IOException e) { System.err.format("Failed to execute %s with exception: %s%n", Arrays.toString(command), e); } return true; }
Source:
<code>public void start(Collection<? extends Location> locations) { if (!getChildren().isEmpty()) { throw new RuntimeException(String.format("The entity [%s] cannot have child entities", getClass().getName())); } ServiceStateLogic.setExpectedState(this, Lifecycle.STARTING); final String url = getConfig(TARGET_URL); final Map assertions = getConfig(ASSERTIONS); final Duration timeout = getConfig(TIMEOUT); try { checkAssertions(url, ImmutableMap.of("timeout", timeout), assertions); sensors().set(SERVICE_UP, true); ServiceStateLogic.setExpectedState(this, Lifecycle.RUNNING); } catch (Throwable t) { <START> LOG.debug("Url test failed", url); <END> sensors().set(SERVICE_UP, false); ServiceStateLogic.setExpectedState(this, Lifecycle.ON_FIRE); throw Exceptions.propagate(t); } }</code><technical_language>include this in log message for running scale</technical_language>

Target:
public void start(Collection<? extends Location> locations) { if (!getChildren().isEmpty()) { throw new RuntimeException(String.format("The entity [%s] cannot have child entities", getClass().getName())); } ServiceStateLogic.setExpectedState(this, Lifecycle.STARTING); final String url = getConfig(TARGET_URL); final List<Map<String, Object>> assertions = getConfig(ASSERTIONS); final Duration timeout = getConfig(TIMEOUT); final HttpAssertionTarget httpAssertionTarget = getConfig(ASSERTION_TARGET); try { TestFrameworkAssertions.checkAssertions(buildDataSupplier(httpAssertionTarget, url), ImmutableMap.of("timeout", timeout), assertions); sensors().set(SERVICE_UP, true); ServiceStateLogic.setExpectedState(this, Lifecycle.RUNNING); } catch (Throwable t) { LOG.info("{} Url test failed", this, url); sensors().set(SERVICE_UP, false); ServiceStateLogic.setExpectedState(this, Lifecycle.ON_FIRE); throw Exceptions.propagate(t); } }
Source:
<code>public static boolean delete(File file, final boolean recursive) throws IOException { Assert.notNull(file, "File to delete must not be null."); boolean result = false; if (recursive) { try { java.nio.file.Files.walkFileTree(file.toPath(), new DeleteVisitor()); result = true; } catch(NoSuchFileException e) { result = true; } catch (IOException e) { <START> throw new IOException("Failed to delete recursive '" + file + "'"); <END> } } else { if ((file.listFiles() != null) && (file.listFiles().length != 0)) { throw new RuntimeException("directory not empty"); } if (OperatingSystemUtils.isWindows()) { System.gc(); } result = file.delete(); } return result; }</code><technical_language>original exception is propagated</technical_language>

Target:
public static boolean delete(File file, final boolean recursive) throws IOException { Assert.notNull(file, "File to delete must not be null."); boolean result = false; if (recursive) { try { java.nio.file.Files.walkFileTree(file.toPath(), new DeleteVisitor()); result = true; } catch(NoSuchFileException e) { result = true; } catch (IOException e) { throw new IOException("Failed to delete recursive '" + file + "' Cause: " + e.getMessage()); } } else { if ((file.listFiles() != null) && (file.listFiles().length != 0)) { throw new RuntimeException("directory not empty"); } if (OperatingSystemUtils.isWindows()) { System.gc(); } result = file.delete(); } return result; }
Source:
<code>public void setupRoutes() { path(controllerBasePath(), () -> { before("", mimeType, this::setContentType); before("/*", mimeType, this::setContentType); before("", mimeType, this.apiAuthenticationHelper::checkUserAnd403); before(InternalPipelineStructure.WITH_SUGGESTIONS, mimeType, this.apiAuthenticationHelper::checkUserAnd403); <START> <END> get("", mimeType, this::index); get(InternalPipelineStructure.WITH_SUGGESTIONS, mimeType, this::indexWithSuggestions); }); }</code><technical_language>verifyContentType</technical_language>

Target:
public void setupRoutes() { path(controllerBasePath(), () -> { before("", mimeType, this::setContentType); before("/*", mimeType, this::setContentType); before("", mimeType, this::verifyContentType); before("/*", mimeType, this::verifyContentType); before("", mimeType, this.apiAuthenticationHelper::checkUserAnd403); before(InternalPipelineStructure.WITH_SUGGESTIONS, mimeType, this.apiAuthenticationHelper::checkUserAnd403); get("", mimeType, this::index); get(InternalPipelineStructure.WITH_SUGGESTIONS, mimeType, this::indexWithSuggestions); }); }
Source:
<code>public Node[] createContent() { final Button backButton = createButton("BACK", 5, 24); String soundtrToggle = INIT_TOGGLE; if (State.isSoundtrackEnabled()) { soundtrToggle = "ON"; } final Button soundtrButton = createButton("Soundtrack: " + soundtrToggle, 5, 14); soundtrButton.setFont(Style.getFont(TOGGLE_TEXT_SIZE)); soundtrButton.setPrefWidth(TOGGLE_WIDTH); String soundEfToggle = INIT_TOGGLE; if (State.isSoundEffectsEnabled()) { soundEfToggle = "ON"; } final Button soundEfButton = createButton("Sound effects: " <START> + soundEfToggle, 5, 17); <END> soundEfButton.setFont(Style.getFont(TOGGLE_TEXT_SIZE)); soundEfButton.setPrefWidth(TOGGLE_WIDTH); setButtonFunction(backButton, BType.SETTINGS_BACK); setButtonFunction(soundtrButton, BType.SETTING_SOUNDTRACK); setButtonFunction(soundEfButton, BType.SETTING_SOUNDEFFECTS); soundtrButton.setTooltip(new Tooltip("Enable/disable soundtrack")); soundEfButton.setTooltip(new Tooltip("Enable/disable sound effects")); backButton.setTooltip(new Tooltip("Back to main menu")); return new Node[]{backButton, soundtrButton, soundEfButton}; }</code><technical_language>This file a Ctrl-A Ctrl-I well. Lines 52, 60 88 incorrect indentation. <review, layout</technical_language>

Target:
public Node[] createContent() { final Button backButton = createButton("BACK", 5, 24); String soundtrToggle = INIT_TOGGLE; if (State.isSoundtrackEnabled()) { soundtrToggle = ACTIVE_TOGGLE; } final Button soundtrButton = createButton("Soundtrack: " + soundtrToggle, 5, 14); soundtrButton.setFont(Style.getFont(TOGGLE_TEXT_SIZE)); soundtrButton.setPrefWidth(TOGGLE_WIDTH); String soundEfToggle = INIT_TOGGLE; if (State.isSoundEffectsEnabled()) { soundEfToggle = ACTIVE_TOGGLE; } final Button soundEfButton = createButton("Sound effects: " + soundEfToggle, 5, 17); soundEfButton.setFont(Style.getFont(TOGGLE_TEXT_SIZE)); soundEfButton.setPrefWidth(TOGGLE_WIDTH); setButtonFunction(backButton, BType.SETTINGS_BACK); setButtonFunction(soundtrButton, BType.SETTING_SOUNDTRACK); setButtonFunction(soundEfButton, BType.SETTING_SOUNDEFFECTS); soundtrButton.setTooltip(new Tooltip("Enable/disable soundtrack")); soundEfButton.setTooltip(new Tooltip("Enable/disable sound effects")); backButton.setTooltip(new Tooltip("Back to main menu")); return new Node[]{backButton, soundtrButton, soundEfButton}; }
Source:
<code>private void postRequest(Map<String, Object> request, Runnable completeHandler) { try { <START> logger.debug("Write JSON: " + writeJson(request)); END> ListenableFuture<Response> future = client.preparePost(uri).setBody(writeJson(request)) .setHeader("content-type", "application/json").setHeader("accept", "application/json") .execute(new AsyncCompletionHandler<Response>() { @Override public Response onCompleted(Response response) throws Exception { logger.debug("Read JSON: " + response.getResponseBody()); Map<String, Object> json = readJson(response.getResponseBody()); if (json.containsKey("error")) { throw new RpcException(json.get("error").toString()); } processResponse(json); return response; } @Override public void onThrowable(Throwable t) { logger.error("Error handling POST response from XBMC", t); } }); if (completeHandler != null) { future.addListener(completeHandler, client.getConfig().executorService()); } } catch (Exception e) { logger.error("Failed sending POST request to XBMC", e); } }</code><technical_language>While this works, a confusing writeJson debug is active. Consider this instead: java String result = writeJson(request); logger.debug("Write JSON: {}", result);</technical_language>

Target:
private void postRequest(Map<String, Object> request, Runnable completeHandler) { try { String resultWrite = writeJson(request); logger.debug("Write JSON: {}", resultWrite ); ListenableFuture<Response> future = client.preparePost(uri).setBody(resultWrite) .setHeader("content-type", "application/json").setHeader("accept", "application/json") .execute(new AsyncCompletionHandler<Response>() { @Override public Response onCompleted(Response response) throws Exception { logger.debug("Read JSON: {}", response.getResponseBody()); Map<String, Object> json = readJson(response.getResponseBody()); if (json.containsKey("error")) { throw new RpcException(json.get("error").toString()); } processResponse(json); return response; } @Override public void onThrowable(Throwable t) { logger.error("Error handling POST response from XBMC", t); } }); if (completeHandler != null) { future.addListener(completeHandler, client.getConfig().executorService()); } } catch (Exception e) { logger.error("Failed sending POST request to XBMC", e); } }
Source:
<code>private Boolean doAbandonChange(final String message, final Change change, final PatchSet.Id psid, final ChangeMessage cm, final ReviewDb db, <START> final Transaction txn) throws OrmException { <END> if (change.getStatus() == Change.Status.NEW && change.currentPatchSetId().equals(psid)) { change.setStatus(Change.Status.ABANDONED); db.changeMessages().insert(Collections.singleton(cm), txn); db.changes().update(Collections.singleton(change), txn); return Boolean.TRUE; } return Boolean.FALSE; }</code><technical_language>yup, right</technical_language>

Target:
private Boolean doAbandonChange(final String message, final Change change, final PatchSet.Id psid, final ChangeMessage cm, final ReviewDb db, final Transaction txn) throws OrmException { if (change.getStatus() == Change.Status.NEW && change.currentPatchSetId().equals(psid)) { change.setStatus(Change.Status.ABANDONED); ChangeUtil.updated(change); final ReviewDb schema = Common.getSchemaFactory().open(); final List<ChangeApproval> approvals = schema.changeApprovals().byChange(change.getId()).toList(); for (ChangeApproval a : approvals) { a.cache(change); } schema.changeApprovals().update(approvals, txn); db.changeMessages().insert(Collections.singleton(cm), txn); db.changes().update(Collections.singleton(change), txn); return Boolean.TRUE; } return Boolean.FALSE; }
Source:
<code>private synchronized void handleFileRequest( final String streamId, final String relativePath, final int startOffset, final int endOffset ) { log.info( <START> "Server is requesting file (range: [{}, {}, streamId: {})", <END> relativePath, startOffset, endOffset, streamId ); if (!this.started.get()) { log.warn("Ignoring file request, service shutting down"); return; } final Path absolutePath = this.jobDirectoryPath.resolve(relativePath); if (!Files.exists(absolutePath)) { log.warn("Ignoring request for a file that does not exist: {}", absolutePath); return; } final boolean permitAcquired = this.concurrentTransfersSemaphore.tryAcquire(); System.out.println("<<< " + this.concurrentTransfersSemaphore.availablePermits()); if (!permitAcquired) { log.warn("Ignoring file request, too many transfers already in progress"); return; } final FileTransfer fileTransfer = new FileTransfer(this, streamId, absolutePath, startOffset, endOffset); this.activeFileTransfers.add(fileTransfer); fileTransfer.start(); }</code><technical_language>I log message is missing a ] end offset</technical_language>

Target:
private synchronized void handleFileRequest( final String streamId, final String relativePath, final int startOffset, final int endOffset ) { log.info( "Server is requesting file (range: [{}, {}), streamId: {})", relativePath, startOffset, endOffset, streamId ); if (!this.started.get()) { log.warn("Ignoring file request, service shutting down"); return; } final Path absolutePath = this.jobDirectoryPath.resolve(relativePath); if (!Files.exists(absolutePath)) { log.warn("Ignoring request for a file that does not exist: {}", absolutePath); return; } final boolean permitAcquired = this.concurrentTransfersSemaphore.tryAcquire(); if (!permitAcquired) { log.warn("Ignoring file request, too many transfers already in progress"); return; } final FileTransfer fileTransfer = new FileTransfer(this, streamId, absolutePath, startOffset, endOffset); this.activeFileTransfers.add(fileTransfer); fileTransfer.start(); }
Source:
<code>private Collection<MultifactorAuthenticationProvider> getSatisfiedAuthenticationProviders(final Authentication authentication, final Collection<MultifactorAuthenticationProvider> providers) { final Collection<Object> contexts = CollectionUtils.toCollection(authentication.getAttributes().get(this.authenticationContextAttribute)); if (contexts == null || contexts.isEmpty()) { LOGGER.debug("No authentication context could be determined based on authentication attribute [{}]", this.authenticationContextAttribute); return null; } return providers.stream() .filter(p -> contexts.contains(p.getId())) <START> .collect(Collectors.toCollection(HashSet::new)); <END> }</code><technical_language>above. Try preserve order</technical_language>

Target:
private Collection<MultifactorAuthenticationProvider> getSatisfiedAuthenticationProviders(final Authentication authentication, final Collection<MultifactorAuthenticationProvider> providers) { final Collection<Object> contexts = CollectionUtils.toCollection(authentication.getAttributes().get(this.authenticationContextAttribute)); if (contexts == null || contexts.isEmpty()) { LOGGER.debug("No authentication context could be determined based on authentication attribute [{}]", this.authenticationContextAttribute); return null; } return providers.stream() .filter(p -> contexts.contains(p.getId())) .collect(Collectors.toCollection(LinkedHashSet::new)); }
Source:
<code>void downloadParcels(Set<ClouderaManagerProduct> products, ParcelResourceApi parcelResourceApi, Stack stack, ApiClient apiClient) throws ApiException, CloudbreakException { for (ClouderaManagerProduct product : products) { LOGGER.info("Downloading parcel.", product.getName()); ApiCommand apiCommand = parcelResourceApi.startDownloadCommand(stack.getName(), product.getName(), product.getVersion()); PollingResult pollingResult = clouderaManagerPollingServiceProvider.startPollingCdpRuntimeParcelDownload( stack, apiClient, apiCommand.getId(), new ParcelResource(stack.getName(), product.getName(), product.getVersion())); <START> if (isExited(pollingResult)) { throw new CancellationException("Cluster was terminated while waiting for CDP Runtime Parcel to be downloaded"); } else if (isTimeout(pollingResult)) { throw new CloudbreakException("Timeout during the updated CDP Runtime Parcel download."); } <END> } }</code><technical_language>this part is duplicated a times, message a bit, a parameter</technical_language>

Target:
void downloadParcels(Set<ClouderaManagerProduct> products, ParcelResourceApi parcelResourceApi, Stack stack, ApiClient apiClient) throws ApiException, CloudbreakException { for (ClouderaManagerProduct product : products) { LOGGER.info("Downloading parcel.", product.getName()); ApiCommand apiCommand = parcelResourceApi.startDownloadCommand(stack.getName(), product.getName(), product.getVersion()); PollingResult pollingResult = clouderaManagerPollingServiceProvider.startPollingCdpRuntimeParcelDownload( stack, apiClient, apiCommand.getId(), new ParcelResource(stack.getName(), product.getName(), product.getVersion())); handlePollingResult(pollingResult, "Cluster was terminated while waiting for CDP Runtime Parcel to be downloaded", "Timeout during the updated CDP Runtime Parcel download."); } }
Source:
<code>public void onScrolledToBottom() { if(currentPage < totalPages) { Toast.makeText(getActivity(), "get more data", Toast.LENGTH_SHORT).show(); ReportBackListTask task = new ReportBackListTask(position, <START> StringUtils.join(sampleIdsSubset, ","), <END> currentPage + 1); TaskQueue.loadQueueDefault(getActivity()).execute(task); } }</code><technical_language>task in place, skip local variable? if for readibility string a variable</technical_language>

Target:
public void onScrolledToBottom() { if(currentPage < totalPages) { if(BuildConfig.DEBUG) { Toast.makeText(getActivity(), "get more data", Toast.LENGTH_SHORT).show(); } ReportBackListTask task = new ReportBackListTask(position, StringUtils.join(sampleIdsSubset, ","), currentPage + 1); TaskQueue.loadQueueDefault(getActivity()).execute(task); } }
Source:
<code>public Iterable<Fork> iterate(final String sort) { return new MkIterable<Fork>( this.storage, String.format("%s/fork", this.xpath()), new MkIterable.Mapping<Fork>() { @Override public Fork map(final XML xml) { <START> return MkForks.this.get("Test"); <END> } } ); }</code><technical_language>iterate forks hadrcoded Please, reference approach in MkIssues</technical_language>

Target:
public Iterable<Fork> iterate(final String sort) { return new MkIterable<Fork>( this.storage, String.format("%s/fork", this.xpath()), new MkIterable.Mapping<Fork>() { @Override public Fork map(final XML xml) { return MkForks.this.get( Integer.parseInt(xml.xpath("id/text()").get(0)) ); } } ); }
Source:
<code>private void verifyResultsInReplica(List<String> selectStmtList, List<String[]> expectedValues) throws Throwable { <START> for (int idx = 0; idx > selectStmtList.size(); idx++) { <END> replica.run("use " + replicatedDbName) .run(selectStmtList.get(idx)) .verifyResults(expectedValues.get(idx)); } }</code><technical_language>This loop execute condition is ></technical_language>

Target:
private void verifyResultsInReplica(List<String> selectStmtList, List<String[]> expectedValues) throws Throwable { for (int idx = 0; idx < selectStmtList.size(); idx++) { replica.run("use " + replicatedDbName) .run(selectStmtList.get(idx)) .verifyResults(expectedValues.get(idx)); } }
Source:
<code><START> public List<PaymentWorksVendorUpdatesDTO> getPendingCompanyVendorUpdatesFromPaymentWorks() { <END> PaymentWorksVendorUpdatesRootDTO updateVendorsRoot = null; List<PaymentWorksVendorUpdatesDTO> vendorUpdates = new ArrayList<PaymentWorksVendorUpdatesDTO>(); boolean moreRecords = true; Client client = buildClient(); ClientResponse response = client.handle(buildClientRequest(buildPendingCompanyVendorUpdatesFromPaymentWorksURL())); while (moreRecords) { updateVendorsRoot = response.getEntity(PaymentWorksVendorUpdatesRootDTO.class); LOG.debug("getPendingCompanyVendorUpdatesFromPaymentWorks, Status: " + response.getStatus()); if (response.getStatus() == 200) { if (ObjectUtils.isNotNull(updateVendorsRoot)) { LOG.info("getPendingCompanyVendorUpdatesFromPaymentWorks Vendor Updates retrieved: " + updateVendorsRoot.getCount()); } if (updateVendorsRoot.getCount() > 0) { vendorUpdates.addAll(updateVendorsRoot.getVendorUpdates().getNewVendorList()); } if (StringUtils.isNotEmpty(updateVendorsRoot.getNext())) { response = client.handle(buildClientRequest(updateVendorsRoot.getNext())); } else { moreRecords = false; } } else { LOG.error("getPendingCompanyVendorUpdatesFromPaymentWorks, Failed to retrieve Pending Vendor Updates: " + response.getEntity(String.class)); moreRecords = false; } } return vendorUpdates; }</code><technical_language>a lot of logic in this method similar prior, if refactored out more generic, if confuse</technical_language>

Target:
public List<PaymentWorksVendorUpdatesDTO> getPendingCompanyVendorUpdatesFromPaymentWorks() { PaymentWorksVendorUpdatesRootDTO updateVendorsRoot = null; List<PaymentWorksVendorUpdatesDTO> vendorUpdates = new ArrayList<PaymentWorksVendorUpdatesDTO>(); processVendorUpdates(vendorUpdates, buildPendingCompanyVendorUpdatesFromPaymentWorksURL()); return vendorUpdates; }
Source:
<code>public void doFilter( ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) servletRequest; <START> logger.debug("CORSFilter HTTP Request: ", request.getMethod()); <END> ((HttpServletResponse) servletResponse).addHeader("Access-Control-Allow-Origin", "*"); ((HttpServletResponse) servletResponse) .addHeader("Access-Control-Allow-Methods", "GET, OPTIONS, HEAD, PUT, POST"); HttpServletResponse resp = (HttpServletResponse) servletResponse; if (request.getMethod().equals("OPTIONS")) { resp.setStatus(HttpServletResponse.SC_ACCEPTED); return; } filterChain.doFilter(request, servletResponse); }</code><technical_language>slf4j, logger.debug("CORSFilter HTTP Request: {}", request.getMethod());. Note {}</technical_language>

Target:
public void doFilter( ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) servletRequest; logger.debug("CORSFilter HTTP Request: {}", request.getMethod()); ((HttpServletResponse) servletResponse).addHeader("Access-Control-Allow-Origin", "*"); ((HttpServletResponse) servletResponse) .addHeader("Access-Control-Allow-Methods", "GET, OPTIONS, HEAD, PUT, POST"); HttpServletResponse resp = (HttpServletResponse) servletResponse; if (request.getMethod().equals("OPTIONS")) { resp.setStatus(HttpServletResponse.SC_ACCEPTED); return; } filterChain.doFilter(request, servletResponse); }
Source:
<code>public DocumentFile(Resource path) throws JDOMException, IOException { if (!Resources.exists(path)) { throw new IllegalArgumentException("Unable to locate the file path: \'" + path + "\'"); } this.path = path; InputStream in = path.in(); try { this.body = IOUtils.toString(in); } finally { in.close(); <START> } <END> }</code><technical_language>@NielsCharlier try-with-resources</technical_language>

Target:
public DocumentFile(Resource path) throws JDOMException, IOException { if (!Resources.exists(path)) { throw new IllegalArgumentException("Unable to locate the file path: \'" + path + "\'"); } this.path = path; try (InputStream in = path.in()) { this.body = IOUtils.toString(in); } }
Source:
<code>private Matcher getHostnameComponents() { String canonicalHostName = currentHostnameSupplier.get(); log.info("Using hostname.", SafeArg.of("hostname", canonicalHostName)); Matcher matcher = POD_HOSTNAME_TEMPLATE_REGEX.matcher(canonicalHostName); Preconditions.checkState(matcher.matches(), "Not running in a k8s stateful set."); <START> log.info("Hostname matcher results.", SafeArg.of("matcher", matcher)); <END> return matcher; }</code><technical_language>nit: if wrong, logging matcher yield helpful output. essential - fix this on</technical_language>

Target:
private Matcher getHostnameComponents() { String canonicalHostName = currentHostnameSupplier.get(); log.info("Using hostname.", SafeArg.of("hostname", canonicalHostName)); Matcher matcher = POD_HOSTNAME_TEMPLATE_REGEX.matcher(canonicalHostName); Preconditions.checkState(matcher.matches(), "Not running in a k8s stateful set."); return matcher; }
Source:
<code>public void setEnrolment(WrittenEvaluation writtenEvaluation) { DateTime beginDateTime = writtenEvaluation.getEnrolmentPeriodStart(); DateTime endDateTime = writtenEvaluation.getEnrolmentPeriodEnd(); this.enrolmentPast = endDateTime == null ? false : endDateTime.isBeforeNow(); <START> this.enrolmentElapsing = new Interval(beginDateTime, endDateTime).containsNow(); <END> if (writtenEvaluation.getEnrollmentBeginDayDateYearMonthDay() != null && writtenEvaluation.getEnrollmentEndDayDateYearMonthDay() != null) { this.enrolment = writtenEvaluation.getEnrollmentBeginDayDateYearMonthDay().toString() + " " + BundleUtil.getString(Bundle.STUDENT, "message.out.until") + " " + writtenEvaluation.getEnrollmentEndDayDateYearMonthDay().toString(); } else { this.enrolment = "-"; this.register = "-"; } }</code><technical_language>Interval constructor throw a NPE if arguments null</technical_language>

Target:
public void setEnrolment(WrittenEvaluation writtenEvaluation) { DateTime beginDateTime = writtenEvaluation.getEnrolmentPeriodStart(); DateTime endDateTime = writtenEvaluation.getEnrolmentPeriodEnd(); this.enrolmentPast = endDateTime == null ? false : endDateTime.isBeforeNow(); this.enrolmentElapsing = false; if (writtenEvaluation.getEnrollmentBeginDayDateYearMonthDay() != null && writtenEvaluation.getEnrollmentEndDayDateYearMonthDay() != null) { this.enrolmentElapsing = new Interval(beginDateTime, endDateTime).containsNow(); this.enrolment = writtenEvaluation.getEnrollmentBeginDayDateYearMonthDay().toString() + " " + BundleUtil.getString(Bundle.STUDENT, "message.out.until") + " " + writtenEvaluation.getEnrollmentEndDayDateYearMonthDay().toString(); } else { this.enrolment = "-"; this.register = "-"; } }
Source:
<code>private AnalyzerResultReducer<AnalyzerResult> initializeReducer( final Class<? extends AnalyzerResultReducer<?>> resultReducerClass) { final DataCleanerConfiguration configuration = _sparkJobContext.getConfiguration(); final InjectionManager injectionManager = configuration.getEnvironment().getInjectionManagerFactory() .getInjectionManager(configuration, _sparkJobContext.getAnalysisJob()); <START> final LifeCycleHelper lifeCycleHelper = new LifeCycleHelper(injectionManager, true); <END> final ComponentDescriptor<? extends AnalyzerResultReducer<?>> reducerDescriptor = Descriptors .ofComponent(resultReducerClass); @SuppressWarnings("unchecked") AnalyzerResultReducer<AnalyzerResult> reducer = (AnalyzerResultReducer<AnalyzerResult>) reducerDescriptor.newInstance(); lifeCycleHelper.assignProvidedProperties(reducerDescriptor, reducer); lifeCycleHelper.initialize(reducerDescriptor, reducer); return reducer; }</code><technical_language>true false - please check name of parameter :D</technical_language>

Target:
private AnalyzerResultReducer<AnalyzerResult> initializeReducer( final Class<? extends AnalyzerResultReducer<?>> resultReducerClass) { final DataCleanerConfiguration configuration = _sparkJobContext.getConfiguration(); final InjectionManager injectionManager = configuration.getEnvironment().getInjectionManagerFactory() .getInjectionManager(configuration, _sparkJobContext.getAnalysisJob()); final LifeCycleHelper lifeCycleHelper = new LifeCycleHelper(injectionManager, false); final ComponentDescriptor<? extends AnalyzerResultReducer<?>> reducerDescriptor = Descriptors .ofComponent(resultReducerClass); @SuppressWarnings("unchecked") AnalyzerResultReducer<AnalyzerResult> reducer = (AnalyzerResultReducer<AnalyzerResult>) reducerDescriptor.newInstance(); lifeCycleHelper.assignProvidedProperties(reducerDescriptor, reducer); lifeCycleHelper.initialize(reducerDescriptor, reducer); return reducer; }