auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>void execute(WorkflowExecutor workflowExecutor) throws IOException; enum WorkflowName { LOAD_SEQUENCER { @Override public Workflow createWorkflow() { return new LoadSequencerWorkflow(); } }; <START> public Workflow createWorklow(Progress progress) { <END> Workflow workflow = createWorkflow(); workflow.setProgress(progress); return workflow; } protected abstract Workflow createWorkflow(); }</code><technical_language>typo in method name</technical_language>

Target:
void execute(WorkflowExecutor workflowExecutor) throws IOException; enum WorkflowName { LOAD_SEQUENCER { @Override public Workflow createWorkflow() { return new LoadSequencerWorkflow(); } }; public Workflow createWorkflow(Progress progress) { Workflow workflow = createWorkflow(); workflow.setProgress(progress); return workflow; } protected abstract Workflow createWorkflow(); }
Source:
<code>public void validate(BulkCommand command) throws IllegalArgumentException { for (String param : command.getParams().keySet()) { <START> if (!PARAM_DISABLE_AUDIT.equals(param) && !PARAM_VERSIONING_OPTION.equals(param)) { <END> Field field = Framework.getService(SchemaManager.class).getField(param); if (field == null) { throw new IllegalArgumentException(unknownValueMessage("xpath " + param, command)); } } } Serializable disableAudit = command.getParam(PARAM_DISABLE_AUDIT); if (disableAudit != null && !Boolean.TRUE.equals(disableAudit) && !Boolean.FALSE.equals(disableAudit)) { throw new IllegalArgumentException(invalidParameterMessage(PARAM_DISABLE_AUDIT, command)); } Serializable versioningOption = command.getParam(PARAM_VERSIONING_OPTION); if (versioningOption != null && (!(versioningOption instanceof String) || Stream.of(VersioningOption.values()).noneMatch(op -> versioningOption.equals(op.name())))) { throw new IllegalArgumentException(invalidParameterMessage(PARAM_VERSIONING_OPTION, command)); } }</code><technical_language>interesting put checks this remove, avoid this condition here, wdyt</technical_language>

Target:
public void validate(BulkCommand command) throws IllegalArgumentException { Set<String> params = new HashSet<>(command.getParams().keySet()); params.removeAll(getParametersToValidate()); for (String param : params) { validateXpath(null, param, command); } validateCommand(command); }
Source:
<code>public boolean equals(Object obj) { <START> if (obj instanceof CachedMethodInfo) { <END> if (!((CachedMethodInfo) obj).getMethodName().equals(this._methodName)) return false; Class<?>[] targetParamTypes = ((CachedMethodInfo) obj).getParamTypes(); int len = _paramTypes != null ? _paramTypes.length : 0; int len2 = targetParamTypes != null ? targetParamTypes.length : 0; if (len != len2) return false; for (int j = 0; j < len; ++j) { if (!Objects.equals(_paramTypes[j], targetParamTypes[j])) return false; } return true; } return false; }</code><technical_language>refactor</technical_language>

Target:
public boolean equals(Object obj) { if (!(obj instanceof CachedMethodInfo)) return false; if (!((CachedMethodInfo) obj).getMethodName().equals(this._methodName)) return false; Class<?>[] targetParamTypes = ((CachedMethodInfo) obj).getParamTypes(); int len = _paramTypes != null ? _paramTypes.length : 0; int len2 = targetParamTypes != null ? targetParamTypes.length : 0; if (len != len2) return false; for (int j = 0; j < len; ++j) { if (!Objects.equals(_paramTypes[j], targetParamTypes[j])) return false; } return true; }
Source:
<code>public Embedding deserialize(JsonNode rootNode, Configuration configuration) { String data = rootNode.get("data").asText(); String mimeType = findMimeType(rootNode); String name = null; <START> if (rootNode.has("name")) { <END> name = rootNode.get("name").asText(); } Embedding embedding = new Embedding(mimeType, data, name); storeEmbedding(embedding, configuration.getEmbeddingDirectory()); return embedding; }</code><technical_language>move name static variable</technical_language>

Target:
public Embedding deserialize(JsonNode rootNode, Configuration configuration) { String data = rootNode.get("data").asText(); String mimeType = findMimeType(rootNode); Embedding embedding; String nameField = "name"; if (rootNode.has(nameField)) { String name = rootNode.get(nameField).asText(); embedding = new Embedding(mimeType, data, name); } else { embedding = new Embedding(mimeType, data); } storeEmbedding(embedding, configuration.getEmbeddingDirectory()); return embedding; }
Source:
<code>public void promptLogin() { if (serverProperties.isInactive()) { SwingComponents.showDialogWithLinks( DialogWithLinksParams.builder() .title("Lobby Not Available") .dialogText( String.format( <START> "Your version of TripleA is too old, please download the latest: <a>%s</a>", <END> UrlConstants.DOWNLOAD_WEBSITE)) .dialogType(DialogWithLinksTypes.ERROR) .build()); return; } loginToServer() .ifPresent( lobbyClient -> { final LobbyFrame lobbyFrame = new LobbyFrame(lobbyClient, serverProperties); GameRunner.hideMainFrame(); lobbyFrame.setVisible(true); if (lobbyClient.isPasswordChangeRequired()) { try { final boolean passwordChanged = ChangePasswordPanel.doPasswordChange( lobbyFrame, lobbyClient.getHttpLobbyClient(), ChangePasswordPanel.AllowCancelMode.DO_NOT_SHOW_CANCEL_BUTTON); if (passwordChanged) { DialogBuilder.builder() .parent(lobbyFrame) .title("Success") .infoMessage("Password successfully updated!") .showDialog(); } else { notifyTempPasswordInvalid(lobbyFrame, null); } } catch (final HttpInteractionException e) { notifyTempPasswordInvalid(lobbyFrame, e); } } }); }</code><technical_language>I recall exact details link listener works, I would've expected listener href attribute instead of innerHTML</technical_language>

Target:
public void promptLogin() { if (serverProperties.isInactive()) { SwingComponents.showDialogWithLinks( DialogWithLinksParams.builder() .title("Lobby Not Available") .dialogText( String.format( "Your version of TripleA is too old, please download the latest:" + "<br><a href=\"%s\">%s</a>", UrlConstants.DOWNLOAD_WEBSITE, UrlConstants.DOWNLOAD_WEBSITE)) .dialogType(DialogWithLinksTypes.ERROR) .build()); return; } loginToServer() .ifPresent( lobbyClient -> { final LobbyFrame lobbyFrame = new LobbyFrame(lobbyClient, serverProperties); GameRunner.hideMainFrame(); lobbyFrame.setVisible(true); if (lobbyClient.isPasswordChangeRequired()) { try { final boolean passwordChanged = ChangePasswordPanel.doPasswordChange( lobbyFrame, lobbyClient.getHttpLobbyClient(), ChangePasswordPanel.AllowCancelMode.DO_NOT_SHOW_CANCEL_BUTTON); if (passwordChanged) { DialogBuilder.builder() .parent(lobbyFrame) .title("Success") .infoMessage("Password successfully updated!") .showDialog(); } else { notifyTempPasswordInvalid(lobbyFrame, null); } } catch (final HttpInteractionException e) { notifyTempPasswordInvalid(lobbyFrame, e); } } }); }
Source:
<code>public void testOrphanTasksDeletion() { DocumentModel route = session.createDocumentModel("/default-domain/workspaces", "dummyRoute", DOCUMENT_ROUTE_DOCUMENT_TYPE); route.setPropertyValue(TITLE_PROPERTY_NAME, "dummyRoute"); route = session.createDocument(route); DocumentModel taskDocument = session.createDocumentModel("/default-domain/workspaces", "dummyTask", TASK_TYPE_NAME); taskDocument.setPropertyValue(TASK_PROCESS_ID_PROPERTY_NAME, route.getId()); taskDocument = session.createDocument(taskDocument); <START> session.save(); <END> session.removeDocument(route.getRef()); if (session.exists(taskDocument.getRef())) { fail(); } }</code><technical_language>newline</technical_language>

Target:
public void testOrphanTasksDeletion() { DocumentModel route = session.createDocumentModel("/default-domain/workspaces", "dummyRoute", DOCUMENT_ROUTE_DOCUMENT_TYPE); route = session.createDocument(route); DocumentModel task = session.createDocumentModel("/default-domain/workspaces", "dummyTask", TASK_TYPE_NAME); task.setPropertyValue(TASK_PROCESS_ID_PROPERTY_NAME, route.getId()); task = session.createDocument(task); session.removeDocument(route.getRef()); txFeature.nextTransaction(); assertFalse(session.exists(task.getRef())); }
Source:
<code>public void stop() { LOG.info("Stopping the container process manager"); containerAllocator.stop(); <START> containerPlacementHandler.stop(); <END> try { allocatorThread.join(); LOG.info("Stopped container allocator"); } catch (InterruptedException ie) { LOG.error("Allocator thread join threw an interrupted exception", ie); Thread.currentThread().interrupt(); } if (diagnosticsManager.isDefined()) { try { diagnosticsManager.get().stop(); } catch (InterruptedException e) { LOG.error("InterruptedException while stopping diagnosticsManager", e); } } try { if (metricsReporters != null) { metricsReporters.values().forEach(reporter -> reporter.stop()); } if (jvmMetrics != null) { jvmMetrics.stop(); } LOG.info("Stopped containerProcessManagerMetrics reporters"); } catch (Throwable e) { LOG.error("Exception while stopping containerProcessManagerMetrics", e); } try { clusterResourceManager.stop(state.status); LOG.info("Stopped the cluster resource manager"); } catch (Throwable e) { LOG.error("Exception while stopping cluster resource manager", e); } LOG.info("Stopped the container process manager"); }</code><technical_language>need similar thread join pattern for container placement handler thread , similar container allocator thread</technical_language>

Target:
public void stop() { LOG.info("Stopping the container process manager"); containerAllocator.stop(); try { allocatorThread.join(); LOG.info("Stopped container allocator"); } catch (InterruptedException ie) { LOG.error("Allocator thread join threw an interrupted exception", ie); Thread.currentThread().interrupt(); } if (diagnosticsManager.isDefined()) { try { diagnosticsManager.get().stop(); } catch (InterruptedException e) { LOG.error("InterruptedException while stopping diagnosticsManager", e); } } try { if (metricsReporters != null) { metricsReporters.values().forEach(reporter -> reporter.stop()); } if (jvmMetrics != null) { jvmMetrics.stop(); } LOG.info("Stopped containerProcessManagerMetrics reporters"); } catch (Throwable e) { LOG.error("Exception while stopping containerProcessManagerMetrics", e); } try { clusterResourceManager.stop(state.status); LOG.info("Stopped the cluster resource manager"); } catch (Throwable e) { LOG.error("Exception while stopping cluster resource manager", e); } LOG.info("Stopped the container process manager"); }
Source:
<code>private void init(PName name, PName familyName, PDataType dataType, Integer maxLength, Integer scale, boolean nullable, int position) { this.dataType = dataType; if (familyName == null) { <START> Preconditions.checkArgument(!nullable || !dataType.isFixedWidth() || name.getString().equals(SALTING_COLUMN_NAME), <END> "PK columns may not be both fixed width and nullable: " + name.getString()); } this.name = name; this.familyName = familyName == null ? null : familyName; this.maxLength = maxLength; this.scale = scale; this.nullable = nullable; this.position = position; }</code><technical_language>salting byte fixed length nullable, right? is this special case necessary</technical_language>

Target:
private void init(PName name, PName familyName, PDataType dataType, Integer maxLength, Integer scale, boolean nullable, int position) { this.dataType = dataType; if (familyName == null) { Preconditions.checkArgument(!nullable || !dataType.isFixedWidth(), "PK columns may not be both fixed width and nullable: " + name.getString()); } this.name = name; this.familyName = familyName == null ? null : familyName; this.maxLength = maxLength; this.scale = scale; this.nullable = nullable; this.position = position; }
Source:
<code>protected org.ovirt.engine.core.common.businessentities.VmPool getEntity(int index) { <START> return setUpEntityExpectations(control.createMock(org.ovirt.engine.core.common.businessentities.VmPool.class), index); <END> }</code><technical_language>1) I excessive mocking here, simply create a VmPool object set values in it. 2) In case, need pass mocked entity a parameter, initialized body of setUpGetEntityExpectations()</technical_language>

Target:
protected org.ovirt.engine.core.common.businessentities.VmPool getEntity(int index) { org.ovirt.engine.core.common.businessentities.VmPool entity = control.createMock(org.ovirt.engine.core.common.businessentities.VmPool.class); expect(entity.getVmPoolId()).andReturn(GUIDS[index]).anyTimes(); expect(entity.getName()).andReturn(NAMES[index]).anyTimes(); expect(entity.getVmPoolDescription()).andReturn(DESCRIPTIONS[index]).anyTimes(); expect(entity.getVmPoolType()).andReturn(VmPoolType.Automatic).anyTimes(); expect(entity.getVdsGroupId()).andReturn(GUIDS[2]).anyTimes(); return entity; }
Source:
<code>protected void dispose() { <START> for (Iterator< RuntimeRule>it = rules.values().iterator(); it.hasNext();) { <END> RuntimeRule r = it.next(); removeRuleEntry(r); it.remove(); } if (compositeFactory != null) { compositeFactory.dispose(); compositeFactory = null; } for (Future f : scheduleTasks.values()) { f.cancel(true); } if (scheduleTasks.isEmpty()) { if (executor != null) { executor.shutdown(); executor = null; } } scheduleTasks = null; if (contextMap != null) { contextMap.clear(); contextMap = null; } statusInfoCallback = null; }</code><technical_language>Missing: isDisposed = true;</technical_language>

Target:
public synchronized void dispose() { if (!isDisposed) { isDisposed = true; for (Iterator< RuntimeRule>it = rules.values().iterator(); it.hasNext();) { RuntimeRule r = it.next(); removeRuleEntry(r); it.remove(); } if (compositeFactory != null) { compositeFactory.dispose(); compositeFactory = null; } } for (Future f : scheduleTasks.values()) { f.cancel(true); } if (scheduleTasks.isEmpty()) { if (executor != null) { executor.shutdown(); executor = null; } } scheduleTasks = null; if (contextMap != null) { contextMap.clear(); contextMap = null; } statusInfoCallback = null; }
Source:
<code>public String getTrustStorePath() { String path = getString(ConfVars.ZEPPELIN_SSL_TRUSTSTORE_PATH); if (path == null) { <START> path = getKeyStorePassword(); <END> } if (path != null && path.startsWith("/") || isWindowsPath(path)) { return path; } else { return getRelativeDir( String.format("%s/%s", getConfDir(), getString(path))); } }</code><technical_language>this getKeyStorePath()? if keystore is truststore getTrustStorePassword() need logic</technical_language>

Target:
public String getTrustStorePath() { String path = getString(ConfVars.ZEPPELIN_SSL_TRUSTSTORE_PATH); if (path == null) { path = getKeyStorePath(); } if (path != null && path.startsWith("/") || isWindowsPath(path)) { return path; } else { return getRelativeDir( String.format("%s/%s", getConfDir(), path)); } }
Source:
<code>public ViewerDescriptor[] findStructureViewerDescriptor(Viewer oldViewer, ICompareInput input, CompareConfiguration configuration) { if (input == null) return null; if (input == null || input.getLeft() == null || input.getRight() == null) return null; <START> Set<ViewerDescriptor> result = new LinkedHashSet<ViewerDescriptor>(); <END> IContentType ctype= getCommonType(input); if (ctype != null) { initializeRegistries(); List<ViewerDescriptor> list = fStructureMergeViewers.searchAll(ctype); if (list != null) result.addAll(list); } String[] types= getTypes(input); String type= null; if (isHomogenous(types)) { type= normalizeCase(types[0]); initializeRegistries(); List<ViewerDescriptor> list = fStructureMergeViewers.searchAll(type); if (list != null) result.addAll(list); String alias= getStructureViewerAlias(type); if (alias != null) { list = fStructureMergeViewers.searchAll(alias); if (list != null) result.addAll(list); } } return result.size() > 0 ? result.toArray(new ViewerDescriptor[0]) : null; }</code><technical_language>new LiskedHashSet<></technical_language>

Target:
public ViewerDescriptor[] findStructureViewerDescriptor(Viewer oldViewer, ICompareInput input, CompareConfiguration configuration) { if (input == null) return null; if (input == null || input.getLeft() == null || input.getRight() == null) return null; Set<ViewerDescriptor> result = new LinkedHashSet<>(); IContentType ctype= getCommonType(input); if (ctype != null) { initializeRegistries(); List<ViewerDescriptor> list = fStructureMergeViewers.searchAll(ctype); if (list != null) result.addAll(list); } String[] types= getTypes(input); String type= null; if (isHomogenous(types)) { type= normalizeCase(types[0]); initializeRegistries(); List<ViewerDescriptor> list = fStructureMergeViewers.searchAll(type); if (list != null) result.addAll(list); String alias= getStructureViewerAlias(type); if (alias != null) { list = fStructureMergeViewers.searchAll(alias); if (list != null) result.addAll(list); } } return result.size() > 0 ? result.toArray(new ViewerDescriptor[0]) : null; }
Source:
<code>private void commitRemoveBricks() { if (getSelectedItems() == null || getSelectedItems().isEmpty()) { return; } if (getConfirmWindow() != null) { return; } ConfirmationModel model = new ConfirmationModel(); setConfirmWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().commitRemoveBricksTitle()); model.setMessage(ConstantsManager.getInstance().getConstants().commitRemoveBricksMessage()); model.setHashName("volume_remove_bricks_commit"); GlusterVolumeEntity volumeEntity = (GlusterVolumeEntity) getEntity(); ArrayList<String> list = new ArrayList<String>(); for (GlusterBrickEntity brick : volumeEntity.getBricks()) { if (brick.getAsyncTask() != null && brick.getAsyncTask().getStatus() == JobExecutionStatus.STARTED) { <START> list.add(brick.getQualifiedName()); <END> } } model.setItems(list); UICommand okCommand = new UICommand("OnCommitRemoveBricks", this); okCommand.setTitle(ConstantsManager.getInstance().getConstants().ok()); okCommand.setIsDefault(true); model.getCommands().add(okCommand); UICommand cancelCommand = new UICommand("CancelConfirmation", this); cancelCommand.setTitle(ConstantsManager.getInstance().getConstants().close()); cancelCommand.setIsCancel(true); model.getCommands().add(cancelCommand); }</code><technical_language>[*]</technical_language>

Target:
private void commitRemoveBricks() { if (getSelectedItems() == null || getSelectedItems().isEmpty()) { return; } if (getConfirmWindow() != null) { return; } ConfirmationModel model = new ConfirmationModel(); setConfirmWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().commitRemoveBricksTitle()); model.setMessage(ConstantsManager.getInstance().getConstants().commitRemoveBricksMessage()); model.setHashName("volume_remove_bricks_commit"); GlusterVolumeEntity volumeEntity = (GlusterVolumeEntity) getEntity(); GlusterAsyncTask volumeTask = volumeEntity.getAsyncTask(); ArrayList<String> list = new ArrayList<String>(); for (GlusterBrickEntity brick : volumeEntity.getBricks()) { if (brick.getAsyncTask() != null && brick.getAsyncTask().getTaskId() != null && volumeTask != null && volumeTask.getStatus() == JobExecutionStatus.FINISHED) { list.add(brick.getQualifiedName()); } } model.setItems(list); UICommand okCommand = new UICommand("OnCommitRemoveBricks", this); okCommand.setTitle(ConstantsManager.getInstance().getConstants().ok()); okCommand.setIsDefault(true); model.getCommands().add(okCommand); UICommand cancelCommand = new UICommand("CancelConfirmation", this); cancelCommand.setTitle(ConstantsManager.getInstance().getConstants().close()); cancelCommand.setIsCancel(true); model.getCommands().add(cancelCommand); }
Source:
<code>public static File createTempDeployment(final String configFile) throws IOException { final String current = System.getProperty("user.dir"); File tempDeploy = Files.createTempDirectory("tempdeploy").toFile(); String tempDeployPath = tempDeploy.getAbsolutePath(); <START> System.out.println("generating temp deployment at " + tempDeployPath); <END> Files.createSymbolicLink(Paths.get(tempDeployPath, "libs"), Paths.get(current, "libs")); Files.createSymbolicLink(Paths.get(tempDeployPath, "conf"), Paths.get(current, "conf")); Files.createSymbolicLink(Paths.get(tempDeployPath, "sqlite4java-392"), Paths.get(current, "sqlite4java-392")); Files.createSymbolicLink(Paths.get(tempDeployPath, MyriaConstants.DEPLOYMENT_CONF_FILE), Paths.get(current, configFile)); return tempDeploy; }</code><technical_language>Delete this line change proper logging</technical_language>

Target:
public static File createTempDeployment(final String configFile) throws IOException { final String current = System.getProperty("user.dir"); File tempDeploy = Files.createTempDirectory("tempdeploy").toFile(); String tempDeployPath = tempDeploy.getAbsolutePath(); LOGGER.debug("generating temp deployment at " + tempDeployPath); Files.createSymbolicLink(Paths.get(tempDeployPath, "libs"), Paths.get(current, "libs")); Files.createSymbolicLink(Paths.get(tempDeployPath, "conf"), Paths.get(current, "conf")); Files.createSymbolicLink(Paths.get(tempDeployPath, "sqlite4java-392"), Paths.get(current, "sqlite4java-392")); Files.createSymbolicLink(Paths.get(tempDeployPath, MyriaConstants.DEPLOYMENT_CONF_FILE), Paths.get(current, configFile)); return tempDeploy; }
Source:
<code>if (executor != null) { executor.scheduleAtFixedRate(new Runnable() { @Override public void run() { <START> cache.trim(); <END> } }, DEFAULT_CACHE_TRIM_RATE, DEFAULT_CACHE_TRIM_RATE, TimeUnit.MILLISECONDS); }</code><technical_language>try catch Exception avoid suppressing subsequent executions</technical_language>

Target:
if (executor != null) { executor.scheduleAtFixedRate(trimTask, DEFAULT_CACHE_TRIM_INTERVAL_MILLIS, DEFAULT_CACHE_TRIM_INTERVAL_MILLIS, TimeUnit.MILLISECONDS); }
Source:
<code>public int compareTo(Prerelease that) { int size = Math.min(this.identifiers.size(), that.identifiers.size()); for (int i = 0; i < size; i += 1) { int cmp = identifiers.get(i).compareTo(that.identifiers.get(i)); if (cmp != 0) { return cmp; } } <START> return this.identifiers.size() - that.identifiers.size(); <END> }</code><technical_language>for compare()</technical_language>

Target:
public int compareTo(Prerelease that) { int size = Math.min(this.identifiers.size(), that.identifiers.size()); for (int i = 0; i < size; i += 1) { int cmp = identifiers.get(i).compareTo(that.identifiers.get(i)); if (cmp != 0) { return cmp; } } return compareIntegers(this.identifiers.size(), that.identifiers.size()); }
Source:
<code>void clean() throws IOException { Project rootProject = getProject(); Path rootProjectPath = rootProject.getProjectDir().toPath(); File okbuckState = rootProject.file(OkBuckGradlePlugin.OKBUCK_STATE); Set<String> lastProjectPaths; if (okbuckState.exists()) { lastProjectPaths = Files.lines(okbuckState.toPath()) .map(String::trim) .filter(s -> s != null && s.length() > 0) .collect(Collectors.toSet()); } else { lastProjectPaths = new HashSet<>(); okbuckState.getParentFile().mkdirs(); okbuckState.createNewFile(); } Set<String> currentProjectPaths = projects.stream() .map(project -> rootProjectPath .relativize(project.getProjectDir().toPath()).toString() ) .collect(Collectors.toSet()); Sets.difference(lastProjectPaths, currentProjectPaths) .stream() <START> .map(p -> rootProjectPath.resolve(p).resolve("BUCK")) <END> .collect(Collectors.toSet()) .forEach(OkBuckCleanTask::deleteQuietly); Files.write( okbuckState.toPath(), currentProjectPaths .stream() .sorted() .collect(Collectors.toList()) ); }</code><technical_language>BUCK a constant</technical_language>

Target:
void clean() throws IOException { Project rootProject = getProject(); Path rootProjectPath = rootProject.getProjectDir().toPath(); File okbuckState = rootProject.file(OkBuckGradlePlugin.OKBUCK_STATE); Set<String> lastProjectPaths; if (okbuckState.exists()) { lastProjectPaths = Files.lines(okbuckState.toPath()) .map(String::trim) .filter(s -> s != null && s.length() > 0) .collect(Collectors.toSet()); } else { lastProjectPaths = new HashSet<>(); okbuckState.getParentFile().mkdirs(); okbuckState.createNewFile(); } Set<String> currentProjectPaths = projects.stream() .map(project -> rootProjectPath .relativize(project.getProjectDir().toPath()).toString() ) .collect(Collectors.toSet()); Sets.difference(lastProjectPaths, currentProjectPaths) .stream() .map(p -> rootProjectPath.resolve(p).resolve(OkBuckGradlePlugin.BUCK)) .forEach(OkBuckCleanTask::deleteQuietly); Files.write( okbuckState.toPath(), currentProjectPaths .stream() .sorted() .collect(Collectors.toList()) ); }
Source:
<code>public User(@NonNull String username, @NonNull String password) { this(username, password, <START> new HashMap<String, Integer>(), null); <END> }</code><technical_language>I recommend Collections.emptyMap() instead</technical_language>

Target:
public User(@NonNull String username, @NonNull String password) { this(username, password, null, null); }
Source:
<code>private void handleUnmanagedCommands() { List<AsyncTask> asyncTasks = asyncTaskDao.getAll(); Set<Guid> asyncTaskManagerManagedCommands = asyncTasks.stream().filter(x -> x.getVdsmTaskId() != null) .map(x -> x.getRootCommandId()).collect(Collectors.toSet()); asyncTaskManagerManagedCommands.addAll(asyncTasks.stream().filter(x -> x.getVdsmTaskId() != null) .map(x -> x.getCommandId()).collect(Collectors.toSet())); ENDED_WITH_FAILURE. getCommands(false).stream() .filter(x -> !x.isCallbackEnabled()) .filter(x -> x.getCommandStatus() == CommandStatus.ACTIVE) .filter(x -> !asyncTaskManagerManagedCommands.contains(x.getId())) .forEach(x -> commandsCache.updateCommandStatus(x.getId(), CommandStatus.ENDED_WITH_FAILURE)); getCommands(false).stream() .filter(x -> x.isCallbackEnabled()) .filter(x -> !x.isCallbackNotified()) .filter(x -> x.getCommandStatus().isDuringExecution()) .filter(x -> !asyncTaskManagerManagedCommands.contains(x.getId())) .forEach(x -> { CommandBase<?> cmd = retrieveCommand(x.getId()); if (cmd != null) { cmd.reacquireLocks(); } <START> }); <END> }</code><technical_language>change - .map(x -> retrieveCommand(x.getId())) .filter(Objects::nonNull) .forEach(CommandBase::reacquireLocks);</technical_language>

Target:
private void handleUnmanagedCommands() { List<AsyncTask> asyncTasks = asyncTaskDao.getAll(); Set<Guid> asyncTaskManagerManagedCommands = asyncTasks.stream().filter(x -> x.getVdsmTaskId() != null) .map(x -> x.getRootCommandId()).collect(Collectors.toSet()); asyncTaskManagerManagedCommands.addAll(asyncTasks.stream().filter(x -> x.getVdsmTaskId() != null) .map(x -> x.getCommandId()).collect(Collectors.toSet())); ENDED_WITH_FAILURE. getCommands(false).stream() .filter(x -> !x.isCallbackEnabled()) .filter(x -> x.getCommandStatus() == CommandStatus.ACTIVE) .filter(x -> !asyncTaskManagerManagedCommands.contains(x.getId())) .forEach(x -> commandsCache.updateCommandStatus(x.getId(), CommandStatus.ENDED_WITH_FAILURE)); getCommands(false).stream() .filter(x -> x.isCallbackEnabled()) .filter(x -> !x.isCallbackNotified()) .filter(x -> x.getCommandStatus().isDuringExecution()) .filter(x -> !asyncTaskManagerManagedCommands.contains(x.getId())) .map(x -> retrieveCommand(x.getId())) .filter(Objects::nonNull) .forEach(CommandBase::reacquireLocks); }
Source:
<code>public int hashCode() { <START> return Objects.hash(super.hashCode()); <END> }</code><technical_language>override method instead of hashing hash</technical_language>

Target:
public int hashCode() { return Objects.hash(id, name, reference); }
Source:
<code>private void startFailed(StartException e, ServiceName serviceName, StartContextImpl context) { ServiceLogger.FAIL.startFailed(e, serviceName); synchronized (context.lock) { final ContextState oldState = context.state; if (oldState != ContextState.SYNC && oldState != ContextState.ASYNC) { ServiceLogger.FAIL.exceptionAfterComplete(e, serviceName); return; } context.state = ContextState.FAILED; } synchronized (ServiceControllerImpl.this) { startException = e; failCount++; } final ArrayList<Runnable> tasks; <START> synchronized (ServiceControllerImpl.this) { <END> final boolean leavingRestState = isStableRestState(); decrementAsyncTasks(); transition(tasks = new ArrayList<Runnable>()); addAsyncTasks(tasks.size()); updateStabilityState(leavingRestState); } doExecute(tasks); }</code><technical_language>This change is wrong. However, creating synchronization blocks generally guarantee lock is yielded in them. JIT merge run time. If needs happen in locks, some other kind of mechanism wait for it. change is wrong, right either. :)</technical_language>

Target:
private boolean startFailed(StartException e, ServiceName serviceName, StartContextImpl context) { ServiceLogger.FAIL.startFailed(e, serviceName); synchronized (context.lock) { final ContextState oldState = context.state; if (oldState != ContextState.SYNC && oldState != ContextState.ASYNC) { ServiceLogger.FAIL.exceptionAfterComplete(e, serviceName); return false; } context.state = ContextState.FAILED; } synchronized (ServiceControllerImpl.this) { startException = e; failCount++; } return true; }
Source:
<code>public void reset() { if (pidSource == PIDSourceType.kDisplacement) { truePosition = encoder.getPosition(); <START> } else { <END> trueVelocity = encoder.getVelocity(); } }</code><technical_language>else if</technical_language>

Target:
public void reset() { truePosition = encoder.getPosition(); trueVelocity = encoder.getVelocity(); }
Source:
<code>public FileSystemStorage(ZeppelinConfiguration zConf, String path) throws IOException { this.zConf = zConf; this.hadoopConf = new Configuration(); this.hadoopConf.set("fs.file.impl", RawLocalFileSystem.class.getName()); this.isSecurityEnabled = UserGroupInformation.isSecurityEnabled(); if (isSecurityEnabled) { String keytab = zConf.getString( ZeppelinConfiguration.ConfVars.ZEPPELIN_SERVER_KERBEROS_KEYTAB); String principal = zConf.getString( ZeppelinConfiguration.ConfVars.ZEPPELIN_SERVER_KERBEROS_PRINCIPAL); if (StringUtils.isBlank(keytab) || StringUtils.isBlank(principal)) { throw new IOException("keytab and principal can not be empty, keytab: " + keytab + ", principal: " + principal); } UserGroupInformation.loginUserFromKeytab(principal, keytab); <START> this.ugi = UserGroupInformation.getLoginUser(); <END> } try { this.fs = FileSystem.get(new URI(path), this.hadoopConf); } catch (URISyntaxException e) { throw new IOException(e); } }</code><technical_language>is getCurrentUser() getLoginUser()</technical_language>

Target:
public FileSystemStorage(ZeppelinConfiguration zConf, String path) throws IOException { this.zConf = zConf; this.hadoopConf = new Configuration(); this.hadoopConf.set("fs.file.impl", RawLocalFileSystem.class.getName()); this.isSecurityEnabled = UserGroupInformation.isSecurityEnabled(); if (isSecurityEnabled) { String keytab = zConf.getString( ZeppelinConfiguration.ConfVars.ZEPPELIN_SERVER_KERBEROS_KEYTAB); String principal = zConf.getString( ZeppelinConfiguration.ConfVars.ZEPPELIN_SERVER_KERBEROS_PRINCIPAL); if (StringUtils.isBlank(keytab) || StringUtils.isBlank(principal)) { throw new IOException("keytab and principal can not be empty, keytab: " + keytab + ", principal: " + principal); } UserGroupInformation.loginUserFromKeytab(principal, keytab); } try { this.fs = FileSystem.get(new URI(path), this.hadoopConf); } catch (URISyntaxException e) { throw new IOException(e); } }
Source:
<code>public Folder findFolderByPath(final String path, final Host host, final User user, final boolean respectFrontEndPermissions) throws DotStateException, DotDataException, DotSecurityException { final Folder folder = folderFactory.findFolderByPath(path, host); if (folder != null && InodeUtils.isSet(folder.getInode()) && !permissionAPI.doesUserHavePermission(folder, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) { <START> if(FolderAPI.SYSTEM_FOLDER.equals(folder.getInode())) { <END> if(!Host.SYSTEM_HOST.equals(host.getIdentifier())){ if(!permissionAPI.doesUserHavePermission(host, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) { throw new DotSecurityException("User " + user.getUserId() != null?user.getUserId():"" + " does not have permission to read folder " + folder.getPath()); } } } } return folder; }</code><technical_language>chain this if &&</technical_language>

Target:
public Folder findFolderByPath(final String path, final Host host, final User user, final boolean respectFrontEndPermissions) throws DotStateException, DotDataException, DotSecurityException { final Folder folder = folderFactory.findFolderByPath(path, host); if (folder != null && InodeUtils.isSet(folder.getInode()) && !doesUserHavePermissions(folder, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) { if(FolderAPI.SYSTEM_FOLDER.equals(folder.getInode()) && !Host.SYSTEM_HOST.equals(host.getIdentifier()) && !permissionAPI.doesUserHavePermission(host, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) { throw new DotSecurityException("User " + user.getUserId() != null?user.getUserId():"" + " does not have permission to read folder " + folder.getPath()); } } return folder; }
Source:
<code>public void shouldReturnAMapOfAllTemplateNamesToPipelinesForAnAdminUser() { BasicCruiseConfig cruiseConfig = GoConfigMother.defaultCruiseConfig(); CaseInsensitiveString adminUser = new CaseInsensitiveString("admin"); ServerConfig serverConfig = new ServerConfig(new SecurityConfig(null, null, false, new AdminsConfig(new AdminUser(adminUser))), null); cruiseConfig.setServerConfig(serverConfig); GoConfigMother.enableSecurityWithPasswordFile(cruiseConfig); new GoConfigMother().addPipelineWithTemplate(cruiseConfig, "p1", "t1", "s1", "j1"); new GoConfigMother().addPipelineWithTemplate(cruiseConfig, "p2", "t2", "s2", "j2"); HashMap<CaseInsensitiveString, List<CaseInsensitiveString>> map = new HashMap<>(); <START> ArrayList<CaseInsensitiveString> template1Pipelines = new ArrayList<>(); <END> ArrayList<CaseInsensitiveString> template2Pipelines = new ArrayList<>(); template1Pipelines.add(new CaseInsensitiveString("p1")); template2Pipelines.add(new CaseInsensitiveString("p2")); map.put(new CaseInsensitiveString("t1"), template1Pipelines); map.put(new CaseInsensitiveString("t2"), template2Pipelines); assertThat(cruiseConfig.templatesWithPipelinesForUser(adminUser.toString(), null), is(map)); }</code><technical_language>Arrays.asList</technical_language>

Target:
public void shouldReturnAMapOfAllTemplateNamesToPipelinesForAnAdminUser() { BasicCruiseConfig cruiseConfig = getCruiseConfigWithSecurityEnabled(); new GoConfigMother().addPipelineWithTemplate(cruiseConfig, "p1", "t1", "s1", "j1"); new GoConfigMother().addPipelineWithTemplate(cruiseConfig, "p2", "t2", "s2", "j2"); HashMap<CaseInsensitiveString, List<CaseInsensitiveString>> map = new HashMap<>(); List<CaseInsensitiveString> template1Pipelines = Arrays.asList(new CaseInsensitiveString("p1")); List<CaseInsensitiveString> template2Pipelines = Arrays.asList(new CaseInsensitiveString("p2")); map.put(new CaseInsensitiveString("t1"), template1Pipelines); map.put(new CaseInsensitiveString("t2"), template2Pipelines); assertThat(cruiseConfig.templatesWithPipelinesForUser("admin", null), is(map)); }
Source:
<code>private boolean needsToRePrepare(Throwable throwable) { Throwable cause = throwable; <START> while (cause != null) { <END> if (cause instanceof RetryPrepareException) { return true; } cause = cause.getCause(); } return false; }</code><technical_language>Remote exception handling changed a bit, I this more specific: if (throwable instance of RemoteException && throwable.getCause() instanceof RetryPrepareException)</technical_language>

Target:
private boolean needsToRePrepare(Throwable throwable) { return throwable instanceof RemoteException && throwable.getCause() instanceof RetryPrepareException; }
Source:
<code>public ColorPalette(RGB background, String registryKey, RGB defaultRGB) { RGB registry = JFaceResources.getColorRegistry().getRGB(registryKey); if (registry != null) { selected = registry; } else { selected = defaultRGB; } normal = interpolate(selected, background, 0.6); <START> fill = interpolate(selected, background, 0.97); <END> textFill = interpolate(selected, background, 0.85); }</code><technical_language>slightly decrease of scale parameter for fill it? background colour is barely noticeable. textFill benefit some slight tweaking well</technical_language>

Target:
public ColorPalette(RGB background, String registryKey, RGB defaultRGB) { RGB registry = JFaceResources.getColorRegistry().getRGB(registryKey); if (registry != null) { selected = registry; } else { selected = defaultRGB; } normal = interpolate(selected, background, 0.6); fill = interpolate(selected, background, 0.9); textFill = interpolate(selected, background, 0.8); }
Source:
<code>@Override public Converter<?> get(Type type) { <START> JsonMapper<?> mapper = LoganSquare.mapperFor((Class<?>) type); <END> return new LoganSquareConverter<>(mapper); }</code><technical_language>This needs check if type is a Class throw exception a meaningful message. implicit ClassCastException thrown is unsatisfactory. Also, this I LoganSquare a List of objects? strange..</technical_language>

Target:
@Override public Converter<?> get(Type type) { if (type instanceof Class) { return new LoganSquareObjectConverter<>(mapperFor(type)); } else if (type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; Type[] typeArguments = parameterizedType.getActualTypeArguments(); Type firstType = typeArguments[0]; if (parameterizedType.getRawType() == Map.class) { Type secondType = typeArguments[1]; if (firstType != String.class) throw new RuntimeException("LoganSquareConverter can't convert Map keys of type '" + firstType + '\''); if (!(secondType instanceof Class)) throw new RuntimeException("LoganSquareConverter can't convert Map values of type '" + secondType + '\''); return new LoganSquareMapConverter<>(mapperFor(secondType)); } else { if (!(firstType instanceof Class)) throw new RuntimeException("LoganSquareConverter can't convert List items of type '" + firstType + '\''); return new LoganSquareListConverter<>(mapperFor(firstType)); } } throw new RuntimeException("LoganSquareConverter encountered non-convertable type '" + type + '\''); }
Source:
<code>public RestRequestInfo addListener(RestRequestInfoEventListener restRequestInfoEventListener) { if (restRequestInfoEventListener != null) { if (operationComplete.get()) { logger.debug("Firing onHandlingComplete() for late listener"); <START> restRequestInfoEventListener.onHandlingComplete(this, handlingException); <END> } else { synchronized (listeners) { if (operationComplete.get()) { logger.debug("Firing onHandlingComplete() for late listener"); restRequestInfoEventListener.onHandlingComplete(this, handlingException); } else { listeners.add(restRequestInfoEventListener); } } } } return this; }</code><technical_language>i onComplete completion of requestinfo</technical_language>

Target:
public RestRequestInfo addListener(RestRequestInfoEventListener restRequestInfoEventListener) { if (restRequestInfoEventListener != null) { if (operationComplete.get()) { logger.trace("Firing onComplete() for late listener"); restRequestInfoEventListener.onHandlingComplete(this, exception); } else { synchronized (listeners) { if (operationComplete.get()) { logger.trace("Firing onComplete() for late listener"); restRequestInfoEventListener.onHandlingComplete(this, exception); } else { listeners.add(restRequestInfoEventListener); } } } } return this; }
Source:
<code>public JsonElement serialize(IncomingTransferReject src, Type typeOfSrc, JsonSerializationContext context) { JsonObject object = new JsonObject(); if (src.error != null) { object.addProperty(MEMBER_ERROR, src.error.code); } else { <START> object.addProperty(MEMBER_STATUS, src.status.code); <END> } return object; }</code><technical_language>Status is known</technical_language>

Target:
public JsonElement serialize(IncomingTransferReject src, Type typeOfSrc, JsonSerializationContext context) { JsonObject object = new JsonObject(); object.addProperty(MEMBER_STATUS, src.status.code); if (src.error != null) { object.addProperty(MEMBER_ERROR, src.error.code); } return object; }
Source:
<code>public AbstractContainerRequestValueFactory<?> createValueFactory(Parameter parameter) { <START> final boolean isOptionalPrincipal = parameter.getRawType().equals(Optional.class) <END> && ParameterizedType.class.isAssignableFrom(parameter.getType().getClass()) && principalClass.equals(((ParameterizedType) parameter.getType()).getActualTypeArguments()[0]); if (!parameter.isAnnotationPresent(Auth.class) || !(principalClass.equals(parameter.getRawType()) || isOptionalPrincipal)) { return null; } else if (isOptionalPrincipal) { return new OptionalPrincipalContainerRequestValueFactory(); } else { return new PrincipalContainerRequestValueFactory(); } }</code><technical_language>I guess more concise as: java if (!parameter.isAnnotationPresent(Auth.class)) { return null; } else if (principalClass == parameter.getRawType()) { return new PrincipalContainerRequestValueFactory(); } else { final boolean isOptionalPrincipal = parameter.getRawType() == Optional.class && ParameterizedType.class.isAssignableFrom(parameter.getType().getClass()) && principalClass == ((ParameterizedType) parameter.getType()).getActualTypeArguments()[0]; return isOptionalPrincipal ? new OptionalPrincipalContainerRequestValueFactory() : null; }</technical_language>

Target:
public AbstractContainerRequestValueFactory<?> createValueFactory(Parameter parameter) { if (!parameter.isAnnotationPresent(Auth.class)) { return null; } else if (principalClass.equals(parameter.getRawType())) { return new PrincipalContainerRequestValueFactory(); } else { final boolean isOptionalPrincipal = parameter.getRawType() == Optional.class && ParameterizedType.class.isAssignableFrom(parameter.getType().getClass()) && principalClass == ((ParameterizedType) parameter.getType()).getActualTypeArguments()[0]; return isOptionalPrincipal ? new OptionalPrincipalContainerRequestValueFactory() : null; } }
Source:
<code>public Iterable<VApp> listNodesByIds(final Iterable<String> ids) { return Iterables.filter(listNodes(), new Predicate<VApp>() { @Override public boolean apply(VApp vm) { <START> return Iterables.contains(ids, vm.getHref().toASCIIString()); <END> } }); }</code><technical_language>..and _again_... ;-)</technical_language>

Target:
public Iterable<VApp> listNodesByIds(final Iterable<String> ids) { return filter(listNodes(), new Predicate<VApp>() { @Override public boolean apply(VApp vm) { return contains(ids, vm.getHref().toASCIIString()); } }); }
Source:
<code>public void awaitFlushCompletion() throws InterruptedException { try { for (ProducerBatch batch : this.incomplete.copyAll()) { batch.produceFuture.await(); <START> waitForPossibleSplittedBatches(batch); <END> batch.clearChildrenProducerBatch(); } } finally { this.flushesInProgress.decrementAndGet(); } }</code><technical_language>cleaner if move waitForPossibleSplittedBatches logic a ProducerBatch.await method performs await produceFuture child batches</technical_language>

Target:
public void awaitFlushCompletion() throws InterruptedException { try { for (ProducerBatch batch : this.incomplete.copyAll()) { batch.await(); } } finally { this.flushesInProgress.decrementAndGet(); } }
Source:
<code>public void addEvents(Collection<IEventDeclaration> events) throws CTFReaderException { if (fEvents != Collections.EMPTY_LIST) { if (fEventUnsetId) { throw new CTFReaderException("Cannot add to a stream with an unidentified event"); } for (IEventDeclaration event : events) { if (event != null) { int index = event.getId().intValue(); <START> while (fEvents.size() >= index) { <END> fEvents.add(null); } if (fEvents.get(index) != null) { throw new CTFReaderException("Both lists have an event defined at position " + index); } fEvents.set(index, event); } } } else { fEvents = new ArrayList<>(events); } }</code><technical_language><=</technical_language>

Target:
public void addEvents(Collection<IEventDeclaration> events) throws CTFReaderException { if (fEvents != Collections.EMPTY_LIST) { if (fEventUnsetId) { throw new CTFReaderException("Cannot add to a stream with an unidentified event"); } for (IEventDeclaration event : events) { if (event != null) { int index = event.getId().intValue(); ensureSize(index); if (fEvents.get(index) != null) { throw new CTFReaderException("Both lists have an event defined at position " + index); } fEvents.set(index, event); } } } else { fEvents = new ArrayList<>(events); } }
Source:
<code>public void exceptionWhenStartingNewTransactionOnShutdownInstance() throws Throwable { KernelTransactions kernelTransactions = newKernelTransactions(); SecurityContext securityContext = mock( SecurityContext.class ); availabilityGuard.shutdown(); t2.execute( (OtherThreadExecutor.WorkerCommand<Void,Void>) state -> { stopKernelTransactions( kernelTransactions ); return null; } ); expectedException.expect( DatabaseShutdownException.class ); <START> kernelTransactions.newInstance( KernelTransaction.Type.explicit, securityContext, 0L ); <END> }</code><technical_language>this exception racing worker thread started above, removed get future</technical_language>

Target:
public void exceptionWhenStartingNewTransactionOnShutdownInstance() throws Throwable { KernelTransactions kernelTransactions = newKernelTransactions(); SecurityContext securityContext = mock( SecurityContext.class ); availabilityGuard.shutdown(); expectedException.expect( DatabaseShutdownException.class ); kernelTransactions.newInstance( KernelTransaction.Type.explicit, securityContext, 0L ); }
Source:
<code>public OrcAggregatedMemoryContext newOrcAggregatedMemoryContext() { <START> return null; <END> }</code><technical_language>Nah, return null. return another no-op memory context</technical_language>

Target:
public OrcAggregatedMemoryContext newOrcAggregatedMemoryContext() { return NOOP_ORC_AGGREGATED_MEMORY_CONTEXT; }
Source:
<code>protected Response patch(String uri, String path, Entity entity) { Invocation.Builder builder = builder(uri, path); <START> builder.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); <END> return builder.method("PATCH", entity); }</code><technical_language>static import</technical_language>

Target:
protected Response patch(String uri, String path, Entity entity) { Invocation.Builder builder = builder(uri, path); builder.property(SET_METHOD_WORKAROUND, true); return builder.method("PATCH", entity); }
Source:
<code>CreateReviewNotes(@GerritPersonIdent final PersonIdent gerritIdent, final AccountCache accountCache, final @AnonymousCowardName String anonymousCowardName, final ProjectCache projectCache, final LabelNormalizer labelNormalizer, final NotesBranchUtil.Factory notesBranchUtilFactory, final @Nullable @CanonicalWebUrl String canonicalWebUrl, final @Assisted ReviewDb reviewDb, final @Assisted Project.NameKey project, final @Assisted Repository git) { this.gerritServerIdent = gerritIdent; this.accountCache = accountCache; this.anonymousCowardName = anonymousCowardName; ProjectState projectState = projectCache.get(project); if (projectState == null) { <START> this.labelTypes = new LabelTypes(Collections.<LabelType> emptyList()); <END> } else { this.labelTypes = projectState.getLabelTypes(); } this.labelNormalizer = labelNormalizer; this.notesBranchUtilFactory = notesBranchUtilFactory; this.canonicalWebUrl = canonicalWebUrl; this.reviewDb = reviewDb; this.project = project; this.git = git; }</code><technical_language>I if this more of error. For Repository exist ProjectState bad</technical_language>

Target:
CreateReviewNotes(@GerritPersonIdent final PersonIdent gerritIdent, final AccountCache accountCache, final @AnonymousCowardName String anonymousCowardName, final ProjectCache projectCache, final LabelNormalizer labelNormalizer, final NotesBranchUtil.Factory notesBranchUtilFactory, final @Nullable @CanonicalWebUrl String canonicalWebUrl, final @Assisted ReviewDb reviewDb, final @Assisted Project.NameKey project, final @Assisted Repository git) { this.gerritServerIdent = gerritIdent; this.accountCache = accountCache; this.anonymousCowardName = anonymousCowardName; ProjectState projectState = projectCache.get(project); if (projectState == null) { log.error("Could not obtain available labels for project " + project.get() + ". Expect missing labels its review notes."); this.labelTypes = new LabelTypes(Collections.<LabelType> emptyList()); } else { this.labelTypes = projectState.getLabelTypes(); } this.labelNormalizer = labelNormalizer; this.notesBranchUtilFactory = notesBranchUtilFactory; this.canonicalWebUrl = canonicalWebUrl; this.reviewDb = reviewDb; this.project = project; this.git = git; }