auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, @NonNull Preference preference) { super.onPreferenceTreeClick(preferenceScreen, preference); if (preference instanceof PreferenceScreen) { Dialog prefDialog = ((PreferenceScreen) preference).getDialog(); if (prefDialog != null) { String title = String.valueOf(preference.getTitle()); WPActivityUtils.addToolbarToDialog(this, prefDialog, title); } AnalyticsTracker.track(AnalyticsTracker.Stat.NOTIFICATION_SETTINGS_STREAMS_OPENED); } else { AnalyticsTracker.track(AnalyticsTracker.Stat.NOTIFICATION_SETTINGS_DETAILS_OPENED); } <START> if (preference instanceof SwitchPreference&& preference.getKey().equalsIgnoreCase(getString(R.string.wp_pref_notification_receive))) { <END> if (((SwitchPreference) preference).isChecked()) { AnalyticsTracker.track(AnalyticsTracker.Stat.NOTIFICATION_SETTINGS_APP_NOTIFICATIONS_ENABLED); } else { AnalyticsTracker.track(AnalyticsTracker.Stat.NOTIFICATION_SETTINGS_APP_NOTIFICATIONS_DISABLED); } } return false; }</code><technical_language>Minor nit: need a space && here</technical_language>

Target:
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, @NonNull Preference preference) { super.onPreferenceTreeClick(preferenceScreen, preference); if (preference instanceof PreferenceScreen) { Dialog prefDialog = ((PreferenceScreen) preference).getDialog(); if (prefDialog != null) { String title = String.valueOf(preference.getTitle()); WPActivityUtils.addToolbarToDialog(this, prefDialog, title); } AnalyticsTracker.track(AnalyticsTracker.Stat.NOTIFICATION_SETTINGS_STREAMS_OPENED); } else { AnalyticsTracker.track(AnalyticsTracker.Stat.NOTIFICATION_SETTINGS_DETAILS_OPENED); } return false; }
Source:
<code>private static String parseAnnotationFieldTypeName(final Supplier<Class<?>> theTypeSupplier, final String errorMessage) { try { theTypeSupplier.get(); <START> throw new RuntimeException(errorMessage); <END> } catch (MirroredTypeException mte) { return mte.getTypeMirror().toString(); } }</code><technical_language>I code, this is necessary wrong, throw new RuntimeException() in end of method. do prefer</technical_language>

Target:
private static String parseAnnotationFieldTypeName(final Supplier<Class<?>> theTypeSupplier, final String errorMessage) { try { theTypeSupplier.get(); } catch (MirroredTypeException mte) { return mte.getTypeMirror().toString(); } throw new RuntimeException(errorMessage); }
Source:
<code>private void validateConfiguration(MaintenanceConfiguration configuration) { Stream.of(configuration.archiveWorkflows, configuration.deleteArchivedWorkflows, configuration.deleteWorkflows) .filter(Objects::nonNull) .flatMap(configItem -> configItem.workflowTypes.stream()) <START> .forEach(workflowType -> { <END> if (workflowDefinitionService.getWorkflowDefinition(workflowType) == null) { throw new IllegalArgumentException("Workflow type " + workflowType + " is not valid"); } }); }</code><technical_language>do more stream/optional stuff following, if nicer java .filter(workflowType -> workflowDefinitionService.getWorkflowDefinition(workflowType) == null) .findAny() .ifPresent(workflowType -> { throw new IllegalArgumentException("Workflow type " + workflowType + " is valid"); });</technical_language>

Target:
private void validateConfiguration(MaintenanceConfiguration configuration) { Stream.of(configuration.archiveWorkflows, configuration.deleteArchivedWorkflows, configuration.deleteWorkflows) .filter(Objects::nonNull) .flatMap(configItem -> configItem.workflowTypes.stream()) .filter(workflowType -> workflowDefinitionService.getWorkflowDefinition(workflowType) == null) .findAny() .ifPresent(workflowType -> { throw new IllegalArgumentException("Workflow type " + workflowType + " is not valid"); }); }
Source:
<code>private void onExecute() { if (getProgress() != null) { return; } startProgress(); for (DiskModel item : getDisks()) { DiskImage disk = (DiskImage) item.getDisk(); if (item.getQuota().getSelectedItem() != null) { disk.setQuotaId(item.getQuota().getSelectedItem().getId()); } List<VdcActionParametersBase> parameters = new ArrayList<>(); RegisterDiskParameters registerDiskParams = new RegisterDiskParameters(disk, disk.getStorageIds().get(0)); registerDiskParams.setRefreshFromStorage(true); parameters.add(registerDiskParams); <START> Frontend.getInstance().runMultipleAction(VdcActionType.RegisterDisk, parameters); <END> } stopProgress(); getCancelCommand().execute(); }</code><technical_language>please Arrays.asList(...) Collections.singletonList()</technical_language>

Target:
private void onExecute() { if (getProgress() != null) { return; } startProgress(); for (DiskModel item : getDisks()) { DiskImage disk = (DiskImage) item.getDisk(); if (item.getQuota().getSelectedItem() != null) { disk.setQuotaId(item.getQuota().getSelectedItem().getId()); } RegisterDiskParameters registerDiskParams = new RegisterDiskParameters(disk, disk.getStorageIds().get(0)); registerDiskParams.setRefreshFromStorage(true); Frontend.getInstance().runMultipleAction(VdcActionType.RegisterDisk, Arrays.asList(registerDiskParams)); } stopProgress(); getCancelCommand().execute(); }
Source:
<code>public IArtifactType getArtifactType(IAtsWorkItem workItem) { <START> return ((ArtifactReadable) workItem.getStoreObject()).getArtifactType(); <END> }</code><technical_language>Consider adding null check</technical_language>

Target:
public IArtifactType getArtifactType(IAtsWorkItem workItem) { Assert.isNotNull(workItem, "Work Item can not be null"); return ((ArtifactReadable) workItem.getStoreObject()).getArtifactType(); }
Source:
<code>public DnsException(DnsResponseCode code) { <START> super(String.format(ERROR_MESSAGE_TEMPLATE, code)); <END> Objects.requireNonNull(code, "code"); this.code = code; }</code><technical_language>string concat instead of format</technical_language>

Target:
public DnsException(DnsResponseCode code) { super(ERROR_MESSAGE_PREFIX + code); Objects.requireNonNull(code, "code"); this.code = code; }
Source:
<code>public void show(String indent, LogLevel logLevel) { final String[] eschelonNames = { "Element", "Squad", "(2)", "Lance", "Company", "Battalion", "Regiment", "Brigade", "Division", "Corps", "Army" }; final String[] airEschelonNames = { "Element", "(1)", "(2)", "Flight", "Squadron", "Group", "Wing", "Regiment" }; MegaMek.getLogger().log(logLevel, indent + weightClass + " " + unitType + " " <START> + ((unitType == UnitType.AERO || unitType == UnitType.CONV_FIGHTER)?airEschelonNames[eschelon]:eschelonNames[eschelon]), null); <END> for (ForceDescriptor sub : subforces) { sub.show(indent + " ", logLevel); } for (ForceDescriptor sub : attached) { sub.show(indent + " +", logLevel); } }</code><technical_language>suggestion + (((unitType == UnitType.AERO) || (unitType == UnitType.CONV_FIGHTER)) ? airEschelonNames[eschelon] : eschelonNames[eschelon]), null);</technical_language>

Target:
public void show(String indent, LogLevel logLevel) { final String[] eschelonNames = { "Element", "Squad", "(2)", "Lance", "Company", "Battalion", "Regiment", "Brigade", "Division", "Corps", "Army" }; final String[] airEschelonNames = { "Element", "(1)", "(2)", "Flight", "Squadron", "Group", "Wing", "Regiment" }; MegaMek.getLogger().log(logLevel, indent + weightClass + " " + unitType + " " + (((unitType == UnitType.AERO) || (unitType == UnitType.CONV_FIGHTER)) ? airEschelonNames[eschelon] : eschelonNames[eschelon]), null); for (ForceDescriptor sub : subforces) { sub.show(indent + " ", logLevel); } for (ForceDescriptor sub : attached) { sub.show(indent + " +", logLevel); } }
Source:
<code>public void downloadBlob(HttpServletRequest request, HttpServletResponse response, String key, String reason) throws IOException { <START> TransientStore ts = Framework.getService(TransientStoreService.class).getStore(EVENT_NAME); <END> try { List<Blob> blobs = ts.getBlobs(key); if (blobs == null) { throw new IllegalArgumentException("no such blobs referenced with " + key); } if (blobs.size() > 1) { throw new IllegalArgumentException("multipart download not yet implemented"); } Blob blob = blobs.get(0); downloadBlob(request, response, null, null, blob, blob.getFilename(), reason); } finally { ts.remove(key); } }</code><technical_language>constant is event name, "download" here</technical_language>

Target:
public void downloadBlob(HttpServletRequest request, HttpServletResponse response, String key, String reason) throws IOException { TransientStore ts = Framework.getService(TransientStoreService.class).getStore("download"); try { List<Blob> blobs = ts.getBlobs(key); if (blobs == null) { throw new IllegalArgumentException("no such blobs referenced with " + key); } if (blobs.size() > 1) { throw new IllegalArgumentException("multipart download not yet implemented"); } Blob blob = blobs.get(0); downloadBlob(request, response, null, null, blob, blob.getFilename(), reason); } finally { ts.remove(key); } }
Source:
<code>protected String readDescription(final Module module) { final Path root = module.getRootPath(); final POM pom = module.getPom(); final org.uberfire.java.nio.file.Path nioRoot = Paths.convert(root); final org.uberfire.java.nio.file.Path nioDescription = nioRoot.resolve(PROJECT_DESCRIPTON); String description = "Example '" + module.getModuleName() + "' module"; if (ioService.exists(nioDescription)) { description = ioService.readAllString(nioDescription); } else if (pom != null && pom.getDescription() != null && !pom.getDescription().isEmpty()) { description = pom.getDescription(); } if (description != null) { <START> return description.replaceAll("[\\s]+", <END> " "); } return description; }</code><technical_language>Nitpick: square brackets in regex redundant. need character class for character. If intention is "squash" spaces, "\\s+" regex</technical_language>

Target:
protected String readDescription(final Module module) { final Path root = module.getRootPath(); final POM pom = module.getPom(); final org.uberfire.java.nio.file.Path nioRoot = Paths.convert(root); final org.uberfire.java.nio.file.Path nioDescription = nioRoot.resolve(PROJECT_DESCRIPTON); String description = "Example '" + module.getModuleName() + "' module"; if (ioService.exists(nioDescription)) { description = ioService.readAllString(nioDescription); } else if (pom != null && pom.getDescription() != null && !pom.getDescription().isEmpty()) { description = pom.getDescription(); } if (description != null) { return description.replaceAll("\\s+", " "); } return description; }
Source:
<code>public void request(long n) { if (!SubscriptionHelper.validate(n)) { return; } <START> while (true) { <END> long r = get(); if (r == limit) { return; } long r2 = r + n; final long more; if (r2 < 0) { r2 = limit; more = limit - r; } else { r2 = Math.min(limit, r2); more = r2 - r; } if (compareAndSet(r, r2)) { upstream.request(more); break; } } }</code><technical_language>limit() internals</technical_language>

Target:
public void request(long n) { if (SubscriptionHelper.validate(n)) { for (;;) { long r = get(); if (r == 0L) { break; } long toRequest; if (r <= n) { toRequest = r; } else { toRequest = n; } long u = r - toRequest; if (compareAndSet(r, u)) { upstream.request(toRequest); break; } } } }
Source:
<code>public void enterVolumeName(String name) { <START> seleniumWebDriverHelper.waitVisibility(newVolumeName).clear(); <END> seleniumWebDriverHelper.waitVisibility(newVolumeName).sendKeys(name); }</code><technical_language>This shorten command: seleniumWebDriverHelper.setValue(newVolumeName, path);</technical_language>

Target:
public void enterVolumeName(String name) { seleniumWebDriverHelper.setValue(newVolumeNameElement, name); }
Source:
<code>private ITmfStateValue getMappedValue(@Nullable ITmfEvent event, @Nullable TmfXmlScenarioInfo scenarioInfo, ITmfStateValue value) { try { <START> if (fContainer instanceof XmlPatternStateProvider) { <END> Set<TmfXmlMapEntry> group = ((XmlPatternStateProvider) fContainer).getMappingGroup(fMappingGroup); if (group != null) { for (TmfXmlMapEntry entry : group) { if (entry.getKey().getValue(event, scenarioInfo).equals(value)) { return entry.getValue().getValue(event, scenarioInfo); } } } } return value; } catch (AttributeNotFoundException e) { Activator.logError("Unable to map the state value"); return TmfStateValue.nullValue(); } }</code><technical_language>for XmlStateProvider well, is in XSD</technical_language>

Target:
private ITmfStateValue getMappedValue(@Nullable ITmfEvent event, @Nullable TmfXmlScenarioInfo scenarioInfo, ITmfStateValue value) { try { Set<TmfXmlMapEntry> group = null; if (fContainer instanceof XmlPatternStateProvider) { group = ((XmlPatternStateProvider) fContainer).getMappingGroup(fMappingGroup); } else if (fContainer instanceof XmlStateProvider) { group = ((XmlStateProvider) fContainer).getMappingGroup(fMappingGroup); } if (group != null) { for (TmfXmlMapEntry entry : group) { if (entry.getKey().getValue(event, scenarioInfo).equals(value)) { return entry.getValue().getValue(event, scenarioInfo); } } } return value; } catch (AttributeNotFoundException e) { Activator.logError("Unable to map the state value"); return TmfStateValue.nullValue(); } }
Source:
<code>String getLastToken() { long value = sequence.get(); <START> return prefix + format("%010x", value - 1); <END> }</code><technical_language>some duplication here, move a method</technical_language>

Target:
String getLastToken() { long value = sequence.get(); return createToken(value - 1); }
Source:
<code>public long skip(long n) { if (n > 0) { long skip = bytes.length - pos; if (skip > n) skip = n; pos += skip; return skip; } else { int idx = Math.min(bytes.length, pos); long skip = idx + n; <START> pos = (int) skip; <END> return skip; } }</code><technical_language>max() offset skip avoid pos previous offset</technical_language>

Target:
public long skip(long n) { if (n > 0) { long skip = bytes.length - pos; if (skip > n) skip = n; pos += skip; return skip; } else { int idx = Math.min(bytes.length, pos); long skip = idx + n; pos = (int) Math.max(skip, offset); return skip; } }
Source:
<code>public String[] decorateListing( final Transfer transfer, final String[] listing, EventMetadata metadata ) throws IOException { final Location loc = transfer.getLocation(); final boolean allowsSnapshots = loc.allowsSnapshots(); final boolean allowsReleases = loc.allowsReleases(); if ( loc instanceof HttpLocation && ( !allowsSnapshots || !allowsReleases ) ) { final String[] pathElements = transfer.getPath().split( "/" ); final List<String> result = new ArrayList<>( listing.length ); if ( pathElements.length >= 3 ) { final String artifactId = pathElements[ pathElements.length - 2 ]; final String version = pathElements[ pathElements.length - 1 ]; final boolean snapshotVersion = SnapshotUtils.isSnapshotVersion( version ); if ( (allowsSnapshots && snapshotVersion) || (allowsReleases && !snapshotVersion) ) { for ( final String element : listing ) { if ( !isArtifact( element, artifactId, version ) ) { result.add( element ); } } } } else <START> { <END> if ( !allowsSnapshots ) { for ( final String element : listing ) { String version = element; if ( element.endsWith( "/" ) ) { version = element.substring( 0, version.length() - 1 ); } if ( !SnapshotUtils.isSnapshotVersion( version ) ) { result.add( element ); } } return result.toArray( new String[ result.size() ] ); } } } return listing; }</code><technical_language>This sense filer. if path "org/apache" snapshot (you version folder yet), "else" branch in this condition</technical_language>

Target:
public String[] decorateListing( final Transfer transfer, final String[] listing, EventMetadata metadata ) throws IOException { final Location loc = transfer.getLocation(); final boolean allowsSnapshots = loc.allowsSnapshots(); final boolean allowsReleases = loc.allowsReleases(); if ( loc instanceof HttpLocation && ( !allowsSnapshots || !allowsReleases ) ) { final String[] pathElements = transfer.getPath().split( "/" ); if ( pathElements.length >= 3 ) { final String artifactId = pathElements[ pathElements.length - 2 ]; final String version = pathElements[ pathElements.length - 1 ]; final boolean snapshotVersion = SnapshotUtils.isSnapshotVersion( version ); if ( (allowsSnapshots && snapshotVersion) || (allowsReleases && !snapshotVersion) ) { return listing; } return new String[0]; } else { if ( !allowsSnapshots ) { final List<String> result = new ArrayList<>( listing.length ); for ( final String element : listing ) { String version = element; if ( element.endsWith( "/" ) ) { version = element.substring( 0, version.length() - 1 ); } if ( !SnapshotUtils.isSnapshotVersion( version ) ) { result.add( element ); } } return result.toArray( new String[0] ); } } } return listing; }
Source:
<code>public void participate(List<AmbryHealthReport> ambryHealthReports) throws IOException { logger.info("Initiating the participation"); StateMachineEngine stateMachineEngine = manager.getStateMachineEngine(); stateMachineEngine.registerStateModelFactory(LeaderStandbySMD.name, new AmbryStateModelFactory()); registerHealthReportTasks(stateMachineEngine, ambryHealthReports); try { helixAdmin.close(); manager.connect(); <START> helixAdmin = manager.getClusterManagmentTool(); <END> } catch (Exception e) { throw new IOException("Exception while connecting to the Helix manager", e); } for (AmbryHealthReport ambryHealthReport : ambryHealthReports) { manager.getHealthReportCollector().addHealthReportProvider((HealthReportProvider) ambryHealthReport); } }</code><technical_language>noting reason helixAdmin initialized in constructor connecting announcing (participating) is caller do administrative operations in Helix participating</technical_language>

Target:
public void participate(List<AmbryHealthReport> ambryHealthReports) throws IOException { logger.info("Initiating the participation"); StateMachineEngine stateMachineEngine = manager.getStateMachineEngine(); stateMachineEngine.registerStateModelFactory(LeaderStandbySMD.name, new AmbryStateModelFactory()); registerHealthReportTasks(stateMachineEngine, ambryHealthReports); try { synchronized (helixAdministrationLock) { helixAdmin.close(); manager.connect(); helixAdmin = manager.getClusterManagmentTool(); } } catch (Exception e) { throw new IOException("Exception while connecting to the Helix manager", e); } for (AmbryHealthReport ambryHealthReport : ambryHealthReports) { manager.getHealthReportCollector().addHealthReportProvider((HealthReportProvider) ambryHealthReport); } }
Source:
<code>private void updateRepoRemoveList(Menu remove) { remove.getItems().clear(); Set<String> currentlyUsedRepos = ui.getCurrentlyUsedRepos() .stream().map(String::toLowerCase).collect(Collectors.toSet()); Set<String> removableRepos = ui.logic.getStoredRepos() .stream().filter(repoId -> !currentlyUsedRepos.contains(repoId.toLowerCase())) <START> .collect(Collectors.toSet()); <END> for (String repoId : removableRepos) { MenuItem removeItem = new MenuItem(repoId); removeItem.setOnAction(e1 -> onRepoRemove(repoId)); remove.getItems().add(removeItem); } remove.getItems().add(new SeparatorMenuItem()); for (String usedRepoId : ui.getCurrentlyUsedRepos()) { MenuItem disabledRemoveItem = new MenuItem(usedRepoId + " [in use, not removable]"); disabledRemoveItem.setDisable(true); remove.getItems().add(disabledRemoveItem); } }</code><technical_language>If getCurrentlyUsedRepos provides some guarantees, extra toLowerCase necessary</technical_language>

Target:
private void updateRepoRemoveList(Menu remove) { remove.getItems().clear(); Set<String> currentlyUsedRepos = Utility.convertSetToLowerCase(ui.getCurrentlyUsedRepos()); Set<String> removableRepos = ui.logic.getStoredRepos() .stream().filter(repoId -> !currentlyUsedRepos.contains(repoId.toLowerCase())) .collect(Collectors.toSet()); for (String repoId : removableRepos) { MenuItem removeItem = new MenuItem(repoId); removeItem.setOnAction(e1 -> onRepoRemove(repoId)); remove.getItems().add(removeItem); } remove.getItems().add(new SeparatorMenuItem()); for (String usedRepoId : ui.getCurrentlyUsedRepos()) { MenuItem disabledRemoveItem = new MenuItem(usedRepoId + " [in use, not removable]"); disabledRemoveItem.setDisable(true); remove.getItems().add(disabledRemoveItem); } }
Source:
<code>public AMQPMessage setAddress(SimpleString address) { if (address != null) { return setAddress(address.toString()); } else { <START> return null; <END> } }</code><technical_language>this be: return setAddress(null); ???</technical_language>

Target:
public AMQPMessage setAddress(SimpleString address) { if (address != null) { return setAddress(address.toString()); } else { return setAddress((String) null); } }
Source:
<code>public void handleEvent(ITmfEvent event) { if (fScenarioInfo.getActiveState().equals(fFsm.getInitialStateId()) && fCurrEvent == null) { fHistoryBuilder.updatePatternNbScenarios(event, fContainer); <START> fHistoryBuilder.updatePatternDiscoveryStartTime(event, fContainer, fScenarioInfo); <END> } fCurrEvent = event; Pair<String, String[]> out = fFsm.next(event, fPatternHandler.getTransitionInputMap(), fScenarioInfo); final String[] actions = out.getSecond(); for (int i = 0; i < actions.length; i++) { ISingleAction action = fPatternHandler.getActionMap().get(actions[i]); if (action != null) { action.execute(event, fScenarioInfo); } } if (fScenarioInfo.getActiveState().equals(fFsm.getInitialStateId()) && !out.getFirst().equals(fFsm.getInitialStateId())) { fFsm.decrementPendingScenariosCount(); fScenarioInfo.setStatus(ScenarioStatusType.IN_PROGRESS); fHistoryBuilder.updatePatternDiscoveryStartTime(event, fContainer, fScenarioInfo); } else if (out.getFirst().equals(fFsm.getAbandonStateId())) { fScenarioInfo.setStatus(ScenarioStatusType.ABANDONED); fHistoryBuilder.updatePatternDiscoveryEndTime(event, fContainer, fScenarioInfo); } else if (out.getFirst().equals(fFsm.getFinalStateId())) { fScenarioInfo.setStatus(ScenarioStatusType.MATCHED); fHistoryBuilder.updatePatternDiscoveryEndTime(fCurrEvent, fContainer, fScenarioInfo); fHistoryBuilder.updatePatternMatchedCount(event, fContainer, fFsm.getId()); } fNextStateAutomatic = (fScenarioInfo.getActiveState() != out.getFirst() && !fScenarioInfo.getActiveState().equals(fFsm.getFinalStateId())) ? true : false; fScenarioInfo.setActiveState(out.getFirst()); if (NonNullUtils.checkNotNull(fFsm.getStatesMap().get(fScenarioInfo.getActiveState())).isAutomatic() && fNextStateAutomatic) { fNextStateAutomatic = false; handleEvent(event); } }</code><technical_language>Remove? "pending" state is interesting state point of view of analysis, out of state system</technical_language>

Target:
public void handleEvent(ITmfEvent event) { Pair<String, List<String>> out = fFsm.next(event, fPatternHandler.getTestMap(), fScenarioInfo); if (out == null) { return; } final List<String> actions = out.getSecond(); for (String actionId : actions) { ITmfXmlAction action = fPatternHandler.getActionMap().get(actionId); if (action != null) { action.execute(event, fScenarioInfo); } else { throw new IllegalStateException("Action " + actionId + " cannot be found."); } } final @NonNull String nextState = NonNullUtils.checkNotNull(out.getFirst()); if (fScenarioInfo.getStatus().equals(ScenarioStatusType.PENDING)) { fScenarioInfo.setStatus(ScenarioStatusType.IN_PROGRESS); fHistoryBuilder.updateStartTime(fContainer, fScenarioInfo, event); } else if (nextState.equals(fFsm.getAbandonStateId())) { fScenarioInfo.setStatus(ScenarioStatusType.ABANDONED); fHistoryBuilder.updateEndTime(fContainer, fScenarioInfo, event); } else if (nextState.equals(fFsm.getFinalStateId())) { fScenarioInfo.setStatus(ScenarioStatusType.MATCHED); fHistoryBuilder.updateEndTime(fContainer, fScenarioInfo, event); fHistoryBuilder.updateMatchedScenariosCount(fContainer, fFsm.getId(), event); } fScenarioInfo.setActiveState(nextState); }
Source:
<code>protected void serviceStart() throws Exception { super.serviceStart(); Configuration conf = getConfig(); YarnRPC rpc = YarnRPC.create(conf); this.server = rpc.getServer( ResourceTracker.class, this, resourceTrackerAddress, conf, null, conf.getInt(YarnConfiguration.RM_RESOURCE_TRACKER_CLIENT_THREAD_COUNT, YarnConfiguration.DEFAULT_RM_RESOURCE_TRACKER_CLIENT_THREAD_COUNT)); if (conf.getBoolean( CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION, false)) { InputStream inputStream = this.rmContext.getConfigurationProvider() .getConfigurationInputStream(conf, YarnConfiguration.HADOOP_POLICY_CONFIGURATION_FILE); if (inputStream != null) { conf.addResource(inputStream); } refreshServiceAcls(conf, RMPolicyProvider.getInstance()); } this.server.start(); conf.updateConnectAddr(YarnConfiguration.RM_BIND_HOST, YarnConfiguration.RM_RESOURCE_TRACKER_ADDRESS, YarnConfiguration.DEFAULT_RM_RESOURCE_TRACKER_ADDRESS, server.getListenerAddress()); <START> clusterId = conf.get(YarnConfiguration.RM_CLUSTER_ID, "default-cluster"); <END> }</code><technical_language>"default-cluster" a constant somewhere. "_DEFAULT"</technical_language>

Target:
protected void serviceStart() throws Exception { super.serviceStart(); Configuration conf = getConfig(); YarnRPC rpc = YarnRPC.create(conf); this.server = rpc.getServer( ResourceTracker.class, this, resourceTrackerAddress, conf, null, conf.getInt(YarnConfiguration.RM_RESOURCE_TRACKER_CLIENT_THREAD_COUNT, YarnConfiguration.DEFAULT_RM_RESOURCE_TRACKER_CLIENT_THREAD_COUNT)); if (conf.getBoolean( CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION, false)) { InputStream inputStream = this.rmContext.getConfigurationProvider() .getConfigurationInputStream(conf, YarnConfiguration.HADOOP_POLICY_CONFIGURATION_FILE); if (inputStream != null) { conf.addResource(inputStream); } refreshServiceAcls(conf, RMPolicyProvider.getInstance()); } this.server.start(); conf.updateConnectAddr(YarnConfiguration.RM_BIND_HOST, YarnConfiguration.RM_RESOURCE_TRACKER_ADDRESS, YarnConfiguration.DEFAULT_RM_RESOURCE_TRACKER_ADDRESS, server.getListenerAddress()); clusterId = conf.get(YarnConfiguration.RM_CLUSTER_ID, YarnConfiguration.DEFAULT_RM_CLUSTER_ID); }
Source:
<code>public void testCreateSchema() throws Exception { long ts = nextTimestamp(); Properties props = new Properties(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts)); Connection conn = DriverManager.getConnection(getUrl(), props); <START> HBaseAdmin admin = driver.getConnectionQueryServices(getUrl(), TestUtil.TEST_PROPERTIES).getAdmin(); <END> String ddl = "CREATE SCHEMA TEST_SCHEMA"; conn.createStatement().execute(ddl); assertNotEquals(null, admin.getNamespaceDescriptor("TEST_SCHEMA")); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 10)); conn = DriverManager.getConnection(getUrl(), props); try { conn.createStatement().execute(ddl); fail(); } catch (SchemaAlreadyExistsException e) { } props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts - 20)); conn = DriverManager.getConnection(getUrl(), props); try { conn.createStatement().execute(ddl); fail(); } catch (NewerSchemaAlreadyExistsException e) { } admin.close(); conn.close(); }</code><technical_language>alternatively PhoenixConnection get hold of admin. this: conn.unwrap(PhoenixConnection.class).getQueryServices().getAdmin(). Minor nit: this is test only, is close connections HBaseAdmin a try-with-resources construct. Edit: I closing admin below. Call in a finally block try-with-resources. PS: connection closing is one. recommendation</technical_language>

Target:
public void testCreateSchema() throws Exception { long ts = nextTimestamp(); Properties props = new Properties(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts)); props.setProperty(QueryServices.IS_NAMESPACE_MAPPING_ENABLED, Boolean.toString(true)); String ddl = "CREATE SCHEMA TEST_SCHEMA"; try (Connection conn = DriverManager.getConnection(getUrl(), props); HBaseAdmin admin = conn.unwrap(PhoenixConnection.class).getQueryServices().getAdmin();) { conn.createStatement().execute(ddl); assertNotNull(admin.getNamespaceDescriptor("TEST_SCHEMA")); } props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 10)); try (Connection conn = DriverManager.getConnection(getUrl(), props);) { conn.createStatement().execute(ddl); fail(); } catch (SchemaAlreadyExistsException e) { } props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts - 20)); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { conn.createStatement().execute(ddl); fail(); } catch (NewerSchemaAlreadyExistsException e) { } props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 100)); Connection conn = DriverManager.getConnection(getUrl(), props); try { conn.createStatement().execute("CREATE SCHEMA " + SchemaUtil.SCHEMA_FOR_DEFAULT_NAMESPACE); fail(); } catch (SQLException e) { assertEquals(SQLExceptionCode.SCHEMA_NOT_ALLOWED.getErrorCode(), e.getErrorCode()); } try { conn.createStatement().execute("CREATE SCHEMA " + SchemaUtil.HBASE_NAMESPACE); fail(); } catch (SQLException e) { assertEquals(SQLExceptionCode.SCHEMA_NOT_ALLOWED.getErrorCode(), e.getErrorCode()); } conn.close(); }
Source:
<code>private static Ds3ApiSpec toSpec(final RawSpec contract) { <START> Ds3ApiSpec ds3ApiSpec = new Ds3ApiSpec(contract.getContract().getDs3Requests(), null); <END> return ds3ApiSpec; }</code><technical_language>Missing final</technical_language>

Target:
private static Ds3ApiSpec toSpec(final RawSpec contract) { final Ds3ApiSpec ds3ApiSpec = new Ds3ApiSpec(contract.getContract().getDs3Requests(), null); return ds3ApiSpec; }
Source:
<code>protected void fit(DataSet dataSet) { try { if (replicatedModel instanceof MultiLayerNetwork) { if (lastEtlTime == null) <START> lastEtlTime = new AtomicLong(0); <END> ((MultiLayerNetwork) replicatedModel).setLastEtlTime(lastEtlTime.get()); ((MultiLayerNetwork) replicatedModel).fit(dataSet); } else if (replicatedModel instanceof ComputationGraph) { ((ComputationGraph) replicatedModel).setLastEtlTime(lastEtlTime.get()); ((ComputationGraph) replicatedModel).fit(dataSet); } } catch (Exception e) { e.printStackTrace(); } }</code><technical_language>handling for lastEtlTime == null for ComputationGraph MultiLayerNetwork</technical_language>

Target:
protected void fit(DataSet dataSet) { if (replicatedModel instanceof MultiLayerNetwork) { if (lastEtlTime == null) lastEtlTime = new AtomicLong(0); ((MultiLayerNetwork) replicatedModel).setLastEtlTime(lastEtlTime.get()); ((MultiLayerNetwork) replicatedModel).fit(dataSet); } else if (replicatedModel instanceof ComputationGraph) { if (lastEtlTime == null) lastEtlTime = new AtomicLong(0); ((ComputationGraph) replicatedModel).setLastEtlTime(lastEtlTime.get()); ((ComputationGraph) replicatedModel).fit(dataSet); } }
Source:
<code>public void test_andorra() { Network network = new SupersonicOsmNetworkReader.Builder() .setCoordinateTransformation(coordinateTransformation) .build() .read(Paths.get(utils.getPackageInputDirectory()).resolve("andorra-latest.osm.pbf")); <START> NetworkUtils.writeNetwork(network, "expected.xml.gz"); <END> Network expectedResult = NetworkUtils.readNetwork(Paths.get(utils.getInputDirectory()).resolve("expected-result.xml.gz").toString()); log.info("expected result contains: " + expectedResult.getLinks().size() + " links and " + expectedResult.getNodes().size() + " nodes"); log.info("result contains: " + network.getLinks().size() + " links and " + network.getNodes().size() + " nodes"); Utils.assertEquals(expectedResult, network); }</code><technical_language>This removed merging</technical_language>

Target:
public void test_andorra() { Network network = new SupersonicOsmNetworkReader.Builder() .setCoordinateTransformation(coordinateTransformation) .setFreeSpeedFactor(LinkProperties.DEFAULT_FREESPEED_FACTOR) .build() .read(Paths.get(utils.getPackageInputDirectory()).resolve("andorra-latest.osm.pbf")); Network expectedResult = NetworkUtils.readNetwork(Paths.get(utils.getInputDirectory()).resolve("expected-result.xml.gz").toString()); log.info("expected result contains: " + expectedResult.getLinks().size() + " links and " + expectedResult.getNodes().size() + " nodes"); log.info("result contains: " + network.getLinks().size() + " links and " + network.getNodes().size() + " nodes"); Utils.assertEquals(expectedResult, network); Network alternative = new SupersonicOsmNetworkReader.Builder() .setCoordinateTransformation(coordinateTransformation) .setFreeSpeedFactor(1.0) .setAfterLinkCreated(SupersonicOsmNetworkReader.adjustFreespeed(LinkProperties.DEFAULT_FREESPEED_FACTOR)) .build() .read(Paths.get(utils.getPackageInputDirectory()).resolve("andorra-latest.osm.pbf")); Utils.assertEquals(alternative, network); }
Source:
<code>public void setWireframe(boolean val) { if(chart.isSetWireframe()) chart.getWireframe().setVal(val); else chart.addNewWireframe().setVal(val); <START> } <END></code><technical_language>methods follow project's formatting style</technical_language>

Target:
public void setWireframe(boolean val) { if (chart.isSetWireframe()) { chart.getWireframe().setVal(val); } else { chart.addNewWireframe().setVal(val); } }
Source:
<code>public T newInstanceFromHash(RMap<String, Object> map, String[] fields) throws GoraException, IOException { fields = getFieldsToQuery(fields); T persistent = newPersistent(); <START> for (String f : fields) { <END> Schema.Field field = fieldMap.get(f); Object val = map.get(mapping.getFields().get(field.name())); if (val == null) { continue; } Object fieldValue = handler.deserializeFieldValue(field, field.schema(), val, persistent); persistent.put(field.pos(), fieldValue); persistent.setDirty(field.pos()); } return persistent; }</code><technical_language>more descriptive variable names</technical_language>

Target:
public T newInstanceFromHash(RMap<String, Object> map, String[] fields) throws GoraException, IOException { fields = getFieldsToQuery(fields); T persistent = newPersistent(); for (String fieldName : fields) { Schema.Field field = fieldMap.get(fieldName); Object fValue = map.get(mapping.getFields().get(field.name())); if (fValue == null) { continue; } Object fieldValue = handler.deserializeFieldValue(field, field.schema(), fValue, persistent); persistent.put(field.pos(), fieldValue); persistent.setDirty(field.pos()); } return persistent; }
Source:
<code>public void createMavenArchetypeStartProjectByWizard() throws Exception { Stream<String> expectedItems = Stream.of( NAME_OF_ARTIFACT + "/src/main/java/" + NAME_OF_ARTIFACT + "/App.java", NAME_OF_ARTIFACT + "/src/test/java/" + NAME_OF_ARTIFACT + "/AppTest.java", NAME_OF_ARTIFACT + "/pom.xml"); ide.open(workspace); menu.runCommand( TestMenuCommandsConstants.Workspace.WORKSPACE, TestMenuCommandsConstants.Workspace.CREATE_PROJECT); projectWizard.selectTypeProject(Wizard.TypeProject.MAVEN); projectWizard.typeProjectNameOnWizard(NAME_OF_ARTIFACT); projectWizard.clickNextButton(); projectWizard.waitOpenProjectConfigForm(); projectWizard.selectArcheTypeFromList(Wizard.Archetypes.QUICK_START); projectWizard.checkArtifactIdOnWizardContainsText(NAME_OF_ARTIFACT); projectWizard.checkGroupIdOnWizardContainsText(NAME_OF_ARTIFACT); projectWizard.checkVersionOnWizardContainsText("1.0-SNAPSHOT"); projectWizard.clickCreateButton(); projectExplorer.waitItem(NAME_OF_ARTIFACT); console.waitExpectedTextIntoConsole(TestBuildConstants.BUILD_SUCCESS); projectExplorer.quickExpandWithJavaScript(); expectedItems.forEach(projectExplorer::waitItem); projectExplorer.openItemByPath(NAME_OF_ARTIFACT + "/pom.xml"); File file = new File( CheckGeneratingMavenArchetypeTest.class .getResource("pom-quick-start-archetype-context") .getFile()); <START> editor.waitTextIntoEditor(FileUtils.readFileToString(file)); <END> }</code><technical_language>org.eclipse.che.commons.lang.IoUtil</technical_language>

Target:
public void createMavenArchetypeStartProjectByWizard() throws Exception { Stream<String> expectedItems = Stream.of( NAME_OF_ARTIFACT + "/src/main/java/" + NAME_OF_ARTIFACT + "/App.java", NAME_OF_ARTIFACT + "/src/test/java/" + NAME_OF_ARTIFACT + "/AppTest.java", NAME_OF_ARTIFACT + "/pom.xml"); ide.open(workspace); menu.runCommand( TestMenuCommandsConstants.Workspace.WORKSPACE, TestMenuCommandsConstants.Workspace.CREATE_PROJECT); projectWizard.selectTypeProject(Wizard.TypeProject.MAVEN); projectWizard.typeProjectNameOnWizard(NAME_OF_ARTIFACT); projectWizard.clickNextButton(); projectWizard.waitOpenProjectConfigForm(); projectWizard.selectArcheTypeFromList(Wizard.Archetypes.QUICK_START); projectWizard.checkArtifactIdOnWizardContainsText(NAME_OF_ARTIFACT); projectWizard.checkGroupIdOnWizardContainsText(NAME_OF_ARTIFACT); projectWizard.checkVersionOnWizardContainsText("1.0-SNAPSHOT"); projectWizard.clickCreateButton(); projectExplorer.waitItem(NAME_OF_ARTIFACT); console.waitExpectedTextIntoConsole(TestBuildConstants.BUILD_SUCCESS); projectExplorer.quickExpandWithJavaScript(); expectedItems.forEach(projectExplorer::waitItem); projectExplorer.openItemByPath(NAME_OF_ARTIFACT + "/pom.xml"); String pathToExpectedContentOfPom = CheckGeneratingMavenArchetypeTest.class .getResource("pom-quick-start-archetype-context") .getFile(); editor.waitTextIntoEditor( IoUtil.readAndCloseQuietly(IoUtil.getResource(pathToExpectedContentOfPom))); }
Source:
<code>private boolean isUserSecurityAdmin(User user, SecurityTeam securityTeam) throws InternalErrorException { try { int number = jdbc.queryForInt("select 1 from authz " + " left outer join groups_members on groups_members.group_id=authz.authorized_group_id " + " left outer join members on members.id=groups_members.member_id " + <START> " where (user_id=? or members.user_id=?) and security_team_id=? limit 1", user.getId(), user.getId(), securityTeam.getId()); <END> if (number > 0) { return true; } return false; } catch(EmptyResultDataAccessException ex) { return false; } catch(RuntimeException e) { throw new InternalErrorException(e); } }</code><technical_language>Limit is correct for ORACLE DB</technical_language>

Target:
private boolean isUserSecurityAdmin(User user, SecurityTeam securityTeam) throws InternalErrorException { try { int number = jdbc.queryForInt("select count(1) from authz " + " left outer join groups_members on groups_members.group_id=authz.authorized_group_id " + " left outer join members on members.id=groups_members.member_id " + " where (user_id=? or members.user_id=?) and security_team_id=? ", user.getId(), user.getId(), securityTeam.getId()); if (number > 0) { return true; } return false; } catch(EmptyResultDataAccessException ex) { return false; } catch(RuntimeException e) { throw new InternalErrorException(e); } }
Source:
<code>private List<BakedQuad> getQuadsForFrequency( final short frequency, final boolean active ) { final AEColor[] colors = Platform.p2p().toColors( frequency ); final CubeBuilder cb = new CubeBuilder( this.format ); cb.setTexture( this.texture ); cb.useStandardUV(); cb.setRenderFullBright( active ); for( int i = 0; i < 4; ++i ) { final int[] offs = QUAD_OFFSETS[i]; for( int j = 0; j < 4; ++j ) { final AEColor c = colors[j]; if( active ) { cb.setColorRGB( c.dye.getColorValue() ); } else { <START> final float cv[] = c.dye.getColorComponentValues(); <END> cb.setColorRGB( cv[0] * 0.5f, cv[1] * 0.5f, cv[2] * 0.5f ); } final int startx = j % 2; final int starty = j / 2; cb.addCube( offs[0] + startx, offs[1] + starty, offs[2], offs[0] + startx + 1, offs[1] + starty + 1, offs[2] + 1 ); } } return cb.getOutput(); }</code><technical_language>![MINOR](<LINK_1> 'Severity: MINOR') Move array designator variable type. [![rule](<LINK_0>](<LINK_2></technical_language>

Target:
private List<BakedQuad> getQuadsForFrequency( final short frequency, final boolean active ) { final AEColor[] colors = Platform.p2p().toColors( frequency ); final CubeBuilder cb = new CubeBuilder( this.format ); cb.setTexture( this.texture ); cb.useStandardUV(); cb.setRenderFullBright( active ); for( int i = 0; i < 4; ++i ) { final int[] offs = QUAD_OFFSETS[i]; for( int j = 0; j < 4; ++j ) { final AEColor c = colors[j]; if( active ) { cb.setColorRGB( c.dye.getColorValue() ); } else { final float cv[] = c.dye.getColorComponentValues(); cb.setColorRGB( cv[0] * 0.5f, cv[1] * 0.5f, cv[2] * 0.5f ); } final int startx = j % 2; final int starty = 1 - j / 2; cb.addCube( offs[0] + startx, offs[1] + starty, offs[2], offs[0] + startx + 1, offs[1] + starty + 1, offs[2] + 1 ); } } return cb.getOutput(); }
Source:
<code>public String getPluginPublisherAndName(String pluginId) throws DevfileException { try { ExtendedPluginFQN meta = fqnParser.parsePluginFQN(pluginId); if (!isNullOrEmpty(meta.getReference())) { <START> return meta.getReference(); <END> } return meta.getPublisherAndName(); } catch (InfrastructureException e) { throw new DevfileException(e.getMessage(), e); } }</code><technical_language>Reference is supposed URL, I understand reference instead of Publisher Name is returned here. elaborate more</technical_language>

Target:
public String getPluginPublisherAndName(String pluginId) throws DevfileException { try { ExtendedPluginFQN meta = fqnParser.parsePluginFQN(pluginId); return meta.getPublisherAndName(); } catch (InfrastructureException e) { throw new DevfileException(e.getMessage(), e); } }
Source:
<code>public BlockBreakHandler getItemHandler() { return new BlockBreakHandler() { @Override public boolean isPrivate() { return false; } @Override public boolean onBlockBreak(BlockBreakEvent e, ItemStack item, int fortune, List<ItemStack> drops) { if (isItem(item)) { Player p = e.getPlayer(); if (Slimefun.hasUnlocked(p, ExplosiveTool.this, true)) { Block b = e.getBlock(); b.getWorld().createExplosion(b.getLocation(), 0.0F); b.getWorld().playSound(b.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0.2F, 1F); List<Block> blocks = findBlocks(b); if (callExplosionEvent.getValue().booleanValue()) { BlockExplodeEvent blockExplodeEvent = new BlockExplodeEvent(b, blocks, 0); Bukkit.getServer().getPluginManager().callEvent(blockExplodeEvent); if (!blockExplodeEvent.isCancelled()) { <START> blockExplodeEvent.blockList().forEach(block -> breakBlock(p, item, block, fortune, drops)); <END> } } else { for (Block block : blocks) { breakBlock(p, item, block, fortune, drops); } } } return true; } else { return false; } } }; }</code><technical_language>Please a standard for loop here</technical_language>

Target:
public BlockBreakHandler getItemHandler() { return new BlockBreakHandler() { @Override public boolean isPrivate() { return false; } @Override public boolean onBlockBreak(BlockBreakEvent e, ItemStack item, int fortune, List<ItemStack> drops) { if (isItem(item)) { Player p = e.getPlayer(); if (Slimefun.hasUnlocked(p, ExplosiveTool.this, true)) { Block b = e.getBlock(); b.getWorld().createExplosion(b.getLocation(), 0.0F); b.getWorld().playSound(b.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0.2F, 1F); List<Block> blocks = findBlocks(b); if (callExplosionEvent.getValue().booleanValue()) { BlockExplodeEvent blockExplodeEvent = new BlockExplodeEvent(b, blocks, 0); Bukkit.getServer().getPluginManager().callEvent(blockExplodeEvent); if (!blockExplodeEvent.isCancelled()) { for (Block block : blockExplodeEvent.blockList()) { breakBlock(p, item, block, fortune, drops); } } } else { for (Block block : blocks) { breakBlock(p, item, block, fortune, drops); } } } return true; } else { return false; } } }; }
Source:
<code>private void downloadFormList() { if (!connectivityProvider.isDeviceOnline()) { ToastUtils.showShortToast(R.string.no_connection); if (viewModel.isDownloadOnlyMode()) { setReturnResult(false, getString(R.string.no_connection), viewModel.getFormResults()); finish(); } } else { viewModel.clearFormDetailsByFormId(); refreshFormListDialogFragment = new RefreshFormListDialogFragment(); <START> refreshFormListDialogFragment.show(getSupportFragmentManager(), ProgressDialogFragment.COLLECT_PROGRESS_DIALOG_TAG); <END> if (downloadFormListTask != null && downloadFormListTask.getStatus() != AsyncTask.Status.FINISHED) { return; } else if (downloadFormListTask != null) { downloadFormListTask.setDownloaderListener(null); downloadFormListTask.cancel(true); downloadFormListTask = null; } downloadFormListTask = new DownloadFormListTask(formListDownloader); downloadFormListTask.setDownloaderListener(this); if (viewModel.isDownloadOnlyMode()) { downloadFormListTask.setAlternateCredentials(viewModel.getUrl(), viewModel.getUsername(), viewModel.getPassword()); } downloadFormListTask.execute(); } }</code><technical_language>dismissing DialogUtils.showIfNotShowing. I pointed out leading ProgressDialogFragment path</technical_language>

Target:
private void downloadFormList() { if (!connectivityProvider.isDeviceOnline()) { ToastUtils.showShortToast(R.string.no_connection); if (viewModel.isDownloadOnlyMode()) { setReturnResult(false, getString(R.string.no_connection), viewModel.getFormResults()); finish(); } } else { viewModel.clearFormDetailsByFormId(); DialogUtils.showIfNotShowing(RefreshFormListDialogFragment.class, getSupportFragmentManager()); if (downloadFormListTask != null && downloadFormListTask.getStatus() != AsyncTask.Status.FINISHED) { return; } else if (downloadFormListTask != null) { downloadFormListTask.setDownloaderListener(null); downloadFormListTask.cancel(true); downloadFormListTask = null; } downloadFormListTask = new DownloadFormListTask(formListDownloader); downloadFormListTask.setDownloaderListener(this); if (viewModel.isDownloadOnlyMode()) { downloadFormListTask.setAlternateCredentials(viewModel.getUrl(), viewModel.getUsername(), viewModel.getPassword()); } downloadFormListTask.execute(); } }
Source:
<code>protected IStatus run(IProgressMonitor monitor) { try { <START> this.isRootANewProject = projectAlreadyExistsInWorkspace(this.rootDirectory) != null; <END> this.rootProject = toExistingOrNewProject( this.rootDirectory, monitor); if (this.recursiveConfigure) { IWorkspace workspace = ResourcesPlugin.getWorkspace(); IWorkspaceDescription description = workspace.getDescription(); boolean isAutoBuilding = workspace.isAutoBuilding(); if (isAutoBuilding) { description.setAutoBuilding(false); workspace.setDescription(description); } importProjectAndChildrenRecursively(this.rootProject, true, monitor); if (isAutoBuilding) { description.setAutoBuilding(true); workspace.setDescription(description); } if (this.isRootANewProject && (this.report.get(this.rootProject).isEmpty() || (this.report.get(this.rootProject).size() == 1 && this.report.get(this.rootProject).get(0) instanceof EclipseProjectConfigurator))) { if (MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.discardRootProject_title, Messages.discardRootProject_description)) { this.rootProject.delete(true, monitor); this.report.remove(this.rootProject); } } } } catch (Exception ex) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, ex.getMessage(), ex); } return Status.OK_STATUS; }</code><technical_language>This conditin right. == null</technical_language>

Target:
protected IStatus run(IProgressMonitor monitor) { try { this.isRootANewProject = projectAlreadyExistsInWorkspace(this.rootDirectory) == null; this.rootProject = toExistingOrNewProject( this.rootDirectory, monitor); if (this.recursiveConfigure) { IWorkspace workspace = ResourcesPlugin.getWorkspace(); IWorkspaceDescription description = workspace.getDescription(); boolean isAutoBuilding = workspace.isAutoBuilding(); if (isAutoBuilding) { description.setAutoBuilding(false); workspace.setDescription(description); } importProjectAndChildrenRecursively(this.rootProject, true, monitor); if (isAutoBuilding) { description.setAutoBuilding(true); workspace.setDescription(description); } if (this.isRootANewProject && this.report.size() > 1 && (this.report.get(this.rootProject).isEmpty() || (this.report.get(this.rootProject).size() == 1 && this.report.get(this.rootProject).get(0) instanceof EclipseProjectConfigurator))) { Display.getDefault().syncExec(new Runnable() { @Override public void run() { discardRootProject = MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.discardRootProject_title, Messages.discardRootProject_description); } }); if (this.discardRootProject) { this.rootProject.delete(false, true, monitor); this.report.remove(this.rootProject); } } } } catch (Exception ex) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, ex.getMessage(), ex); } return Status.OK_STATUS; }