auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void updateCommitStatus(@Nonnull AbstractBuild<?, ?> build, @Nonnull BuildListener listener) throws InterruptedException, IOException { BuildData buildData = build.getAction(BuildData.class); if (buildData == null) { throw new IOException(Messages.GitHubCommitNotifier_NoBuildDataError()); } final Revision lastBuildRevision = buildData.getLastBuiltRevision(); final ObjectId sha1 = lastBuildRevision != null ? lastBuildRevision.getSha1() : null; if (sha1 == null) { throw new IOException(Messages.GitHubCommitNotifier_NoLastRevisionError()); } for (GitHubRepositoryName name : GitHubRepositoryNameContributor.parseAssociatedNames(build.getProject())) { for (GHRepository repository : name.resolve()) { GHCommitState state; String msg; final String duration = Util.getTimeSpanString(System.currentTimeMillis() - build.getTimeInMillis()); Result result = build.getResult(); if (result.isBetterOrEqualTo(SUCCESS)) { state = GHCommitState.SUCCESS; msg = Messages.CommitNotifier_Success(build.getDisplayName(), duration); } else if (result.isBetterOrEqualTo(UNSTABLE)) { state = GHCommitState.FAILURE; msg = Messages.CommitNotifier_Unstable(build.getDisplayName(), duration); } else { state = GHCommitState.ERROR; msg = Messages.CommitNotifier_Failed(build.getDisplayName(), duration); } listener.getLogger().println(Messages.GitHubCommitNotifier_SettingCommitStatus(repository.getUrl() + "/commit/" + sha1)); <START> repository.createCommitStatus(ObjectId.toString(sha1), state, build.getAbsoluteUrl(), msg, "jenkins"); <END> } } }</code><technical_language>I context configurable defaulted Appname. current master branch provides configuration jelly in <code>GitHubCommitNotifier</code></technical_language>

Target:
private void updateCommitStatus(@Nonnull AbstractBuild<?, ?> build, @Nonnull BuildListener listener) throws InterruptedException, IOException { final String sha1 = ObjectId.toString(BuildDataHelper.getCommitSHA1(build)); for (GitHubRepositoryName name : GitHubRepositoryNameContributor.parseAssociatedNames(build.getProject())) { for (GHRepository repository : name.resolve()) { GHCommitState state; String msg; final String duration = Util.getTimeSpanString(System.currentTimeMillis() - build.getTimeInMillis()); Result result = build.getResult(); if (result == null) { state = GHCommitState.PENDING; msg = Messages.CommitNotifier_Pending(build.getDisplayName()); } else if (result.isBetterOrEqualTo(SUCCESS)) { state = GHCommitState.SUCCESS; msg = Messages.CommitNotifier_Success(build.getDisplayName(), duration); } else if (result.isBetterOrEqualTo(UNSTABLE)) { state = GHCommitState.FAILURE; msg = Messages.CommitNotifier_Unstable(build.getDisplayName(), duration); } else { state = GHCommitState.ERROR; msg = Messages.CommitNotifier_Failed(build.getDisplayName(), duration); } listener.getLogger().println(Messages.GitHubCommitNotifier_SettingCommitStatus(repository.getUrl() + "/commit/" + sha1)); repository.createCommitStatus(sha1, state, build.getAbsoluteUrl(), msg, build.getFullDisplayName()); } } }
Source:
<code>public void lockSettingsCodeSnippet() { ConfigurationClient configurationClient = createSyncConfigurationClient(); ConfigurationSetting result = configurationClient.setReadOnly("prodDBConnection", "westUS"); System.out.printf("Key: %s, Value: %s", result.getKey(), result.getValue()); END: com.azure.data.applicationconfig.configurationclient.setReadOnly#string-string ConfigurationSetting resultSetting = configurationClient .setReadOnly(new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS")); System.out.printf("Key: %s, Value: %s", resultSetting.getKey(), resultSetting.getValue()); END: com.azure.data.applicationconfig.configurationclient.setReadOnly#ConfigurationSetting Response<ConfigurationSetting> responseSetting = configurationClient .setSettingWithResponse(new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS"), new Context(key2, value2)); System.out <START> .printf("Key: %s, Value: %s", responseSetting.getValue().getKey(), responseSetting.getValue().getValue()); <END> END: com.azure.data.applicationconfig.configurationclient.setReadOnlyWithResponse#ConfigurationSetting-Context }</code><technical_language>This line break is weird. break format string</technical_language>

Target:
public void lockSettingsCodeSnippet() { ConfigurationClient configurationClient = createSyncConfigurationClient(); ConfigurationSetting result = configurationClient.setReadOnly("prodDBConnection", "westUS"); System.out.printf("Key: %s, Value: %s", result.getKey(), result.getValue()); END: com.azure.data.applicationconfig.configurationclient.setReadOnly#string-string ConfigurationSetting resultSetting = configurationClient.setReadOnlyWithResponse( new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS"), Context.NONE).getValue(); System.out.printf("Key: %s, Value: %s", resultSetting.getKey(), resultSetting.getValue()); END: com.azure.data.applicationconfig.configurationclient.setReadOnly#ConfigurationSetting Response<ConfigurationSetting> responseSetting = configurationClient .setSettingWithResponse(new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS"), false, new Context(key2, value2)); System.out.printf("Key: %s, Value: %s", responseSetting.getValue().getKey(), responseSetting.getValue().getValue()); END: com.azure.data.applicationconfig.configurationclient.setReadOnlyWithResponse#ConfigurationSetting-Context }
Source:
<code>public List<String> getNames() { final List<String> steps = new ArrayList<>(); if (this.order == FirstStrikeStepOrder.NOT_APPLICABLE) { <START> return steps; <END> } steps.add(battleState.getDefender().getName() + FIRST_STRIKE_UNITS_FIRE); steps.add(battleState.getAttacker().getName() + SELECT_FIRST_STRIKE_CASUALTIES); return steps; }</code><technical_language>considered Lombok @AllArgsConstructor replace this constructor? annotation do thing</technical_language>

Target:
public List<String> getNames() { final List<String> steps = new ArrayList<>(); if (this.state == State.NOT_APPLICABLE) { return steps; } steps.add(battleState.getDefender().getName() + FIRST_STRIKE_UNITS_FIRE); steps.add(battleState.getAttacker().getName() + SELECT_FIRST_STRIKE_CASUALTIES); return steps; }
Source:
<code>void initByteBufferDexPath(ByteBuffer[] dexFiles) { if (dexFiles == null) { throw new NullPointerException("dexFiles == null"); } if (Arrays.stream(dexFiles).anyMatch(v -> v == null)) { throw new NullPointerException("dexFiles contains a null Buffer!"); } if (dexElements != null || dexElementsSuppressedExceptions != null) { throw new IllegalStateException("Should only be called once"); } final List<IOException> suppressedExceptions = new ArrayList<IOException>(); try { Element[] null_elements = null; DexFile dex = new DexFile(dexFiles); dexElements = new Element[] { new Element(dex) }; <START> dex.verifyInBackground(definingContext); <END> } catch (IOException suppressed) { System.logE("Unable to load dex files", suppressed); suppressedExceptions.add(suppressed); dexElements = new Element[0]; } if (suppressedExceptions.size() > 0) { dexElementsSuppressedExceptions = suppressedExceptions.toArray( new IOException[suppressedExceptions.size()]); } }</code><technical_language>this called in consturctor instead, agnostic name. VMRuntime.registerInMemoryDexFiles()</technical_language>

Target:
void initByteBufferDexPath(ByteBuffer[] dexFiles) { if (dexFiles == null) { throw new NullPointerException("dexFiles == null"); } if (Arrays.stream(dexFiles).anyMatch(v -> v == null)) { throw new NullPointerException("dexFiles contains a null Buffer!"); } if (dexElements != null || dexElementsSuppressedExceptions != null) { throw new IllegalStateException("Should only be called once"); } final List<IOException> suppressedExceptions = new ArrayList<IOException>(); try { Element[] null_elements = null; DexFile dex = new DexFile(dexFiles, definingContext, null_elements); String classLoaderContext = dex.isBackedByOatFile() ? null : DexFile.getClassLoaderContext(definingContext, null_elements); dexElements = new Element[] { new Element(dex) }; if (classLoaderContext != null) { dex.verifyInBackground(definingContext, classLoaderContext); } } catch (IOException suppressed) { System.logE("Unable to load dex files", suppressed); suppressedExceptions.add(suppressed); dexElements = new Element[0]; } if (suppressedExceptions.size() > 0) { dexElementsSuppressedExceptions = suppressedExceptions.toArray( new IOException[suppressedExceptions.size()]); } }
Source:
<code>void setupProject(final ProjectVersion pv) throws ProjectManagerException, IOException { final int projectId = pv.getProjectId(); final int version = pv.getVersion(); final String projectDir = String.valueOf(projectId) + "." + String.valueOf(version); if (pv.getInstalledDir() == null) { pv.setInstalledDir(new File(this.projectsDir, projectDir)); } if (pv.getInstalledDir().exists()) { log.info("Project already cached. Skipping download. " + pv); touchIfExists( <START> new File(Paths.get(pv.getInstalledDir().getPath(), Constants.PROJECT_DIR_SIZE_FILE_NAME) <END> .toString())); return; } log.info("Preparing Project: " + pv); final File tempDir = new File(this.projectsDir, "_temp." + projectDir + "." + System.currentTimeMillis()); tempDir.mkdirs(); ProjectFileHandler projectFileHandler = null; try { projectFileHandler = requireNonNull(this.storageManager.getProjectFile(projectId, version)); checkState("zip".equals(projectFileHandler.getFileType())); log.info("Downloading zip file."); final File zipFile = requireNonNull(projectFileHandler.getLocalFile()); final ZipFile zip = new ZipFile(zipFile); Utils.unzip(zip, tempDir); updateDirSize(tempDir, pv); Files.move(tempDir.toPath(), pv.getInstalledDir().toPath(), StandardCopyOption.ATOMIC_MOVE); log.warn(String.format("Project preparation completes. [%s]", pv)); } finally { if (projectFileHandler != null) { projectFileHandler.deleteLocalFile(); } FileUtils.deleteDirectory(tempDir); } }</code><technical_language>Path argument touchIfExists? File is a legacy class. Path is preferred if I remember correctly</technical_language>

Target:
void setupProject(final ProjectVersion pv) throws ProjectManagerException, IOException { final int projectId = pv.getProjectId(); final int version = pv.getVersion(); final String projectDir = String.valueOf(projectId) + "." + String.valueOf(version); if (pv.getInstalledDir() == null) { pv.setInstalledDir(new File(this.projectsDir, projectDir)); } if (pv.getInstalledDir().exists()) { log.info("Project already cached. Skipping download. " + pv); touchIfExists( Paths.get(pv.getInstalledDir().getPath(), PROJECT_DIR_SIZE_FILE_NAME)); return; } log.info("Preparing Project: " + pv); final File tempDir = new File(this.projectsDir, "_temp." + projectDir + "." + System.currentTimeMillis()); tempDir.mkdirs(); ProjectFileHandler projectFileHandler = null; try { projectFileHandler = requireNonNull(this.storageManager.getProjectFile(projectId, version)); checkState("zip".equals(projectFileHandler.getFileType())); log.info("Downloading zip file."); final File zipFile = requireNonNull(projectFileHandler.getLocalFile()); final ZipFile zip = new ZipFile(zipFile); Utils.unzip(zip, tempDir); updateDirSize(tempDir, pv); Files.move(tempDir.toPath(), pv.getInstalledDir().toPath(), StandardCopyOption.ATOMIC_MOVE); log.warn(String.format("Project preparation completes. [%s]", pv)); } finally { if (projectFileHandler != null) { projectFileHandler.deleteLocalFile(); } FileUtils.deleteDirectory(tempDir); } }
Source:
<code>private boolean isSearchedVariable(ExpressionTree variable) { <START> return variable.is(Tree.Kind.IDENTIFIER) && usages.contains((IdentifierTree) variable); <END> }</code><technical_language>@m-g-sonar (IdentifierTree) cast needed</technical_language>

Target:
private boolean isSearchedVariable(ExpressionTree variable) { return variable.is(Tree.Kind.IDENTIFIER) && usages.contains(variable); }
Source:
<code>public void preProcessModule(Module module) { DeploymentMetadata md = module.getDeploymentMetadata(); Properties properties = new Properties(); properties.setProperty("xd.stream.name", md.getGroup()); properties.setProperty("xd.module.index", String.valueOf(md.getIndex())); module.addProperties(properties); module.addListener(new ApplicationListener<ApplicationPreparedEvent>() { @Override public void onApplicationEvent(ApplicationPreparedEvent event) { MessageBusAwareRouterBeanPostProcessor bpp = new MessageBusAwareRouterBeanPostProcessor(messageBus); bpp.setBeanFactory(event.getApplicationContext()); <START> event.getApplicationContext().getBeanFactory().registerSingleton( <END> "messageBusAwareRouterBeanPostProcessor", bpp); } }); }</code><technical_language>This provide awareness of named channels in MessageBus _any_ router a Spring XD Module. Before, provided selectively (to "router" sink module). In case, router end of stream, router return a named channel, mid-Stream mid-flow-within-a-Module. raising this issue for want "feature"</technical_language>

Target:
public void preProcessModule(Module module) { DeploymentMetadata md = module.getDeploymentMetadata(); Properties properties = new Properties(); properties.setProperty("xd.stream.name", md.getGroup()); properties.setProperty("xd.module.index", String.valueOf(md.getIndex())); module.addProperties(properties); if (module.getType() == ModuleType.sink) { module.addListener(new ApplicationListener<ApplicationPreparedEvent>() { @Override public void onApplicationEvent(ApplicationPreparedEvent event) { MessageBusAwareRouterBeanPostProcessor bpp = new MessageBusAwareRouterBeanPostProcessor(messageBus); bpp.setBeanFactory(event.getApplicationContext()); event.getApplicationContext().getBeanFactory().registerSingleton( "messageBusAwareRouterBeanPostProcessor", bpp); } }); } }
Source:
<code>public boolean accept(Path path) { if (!super.accept(path)) { return false; } String filename = path.getName(); Matcher m = HdfsSinkConnectorConstants.COMMITTED_FILENAME_PATTERN.matcher(filename); if (!m.matches()) { throw new AssertionError("match expected because of CommittedFileFilter"); } <START> String topic = m.group(1); <END> int partition = Integer.parseInt(m.group(2)); return topic.equals(tp.topic()) && partition == tp.partition(); }</code><technical_language>a couple more constants named</technical_language>

Target:
public boolean accept(Path path) { if (!super.accept(path)) { return false; } String filename = path.getName(); Matcher m = HdfsSinkConnectorConstants.COMMITTED_FILENAME_PATTERN.matcher(filename); if (!m.matches()) { throw new AssertionError("match expected because of CommittedFileFilter"); } String topic = m.group(HdfsSinkConnectorConstants.PATTERN_TOPIC_GROUP); int partition = Integer.parseInt(m.group(HdfsSinkConnectorConstants.PATTERN_PARTITION_GROUP)); return topic.equals(tp.topic()) && partition == tp.partition(); }
Source:
<code>public void init() throws DBException { Properties props = getProperties(); String configfile = props.getProperty(CONFIG_FILE_PROPERTY); if (configfile == null) { configfile = CONFIG_FILE_DEFAULT; } String id = props.getProperty(ID_PROPERTY); if (id == null) { id = ID_DEFAULT; } String pool = props.getProperty(POOL_PROPERTY); if (pool == null) { pool = POOL_DEFAULT; } <START> rados = new Rados(id); <END> try { rados.confReadFile(new File(configfile)); rados.connect(); ioctx = rados.ioCtxCreate(pool); } catch (RadosException e) { throw new DBException(e.getMessage() + ": " + e.getReturnValue()); } }</code><technical_language>This needs protected a lock, sine rados is static instantiate a client for thread. Presuming rados ioctx objects threadsafe, synchronize a threadcount decide safe do shutdown in cleanup method</technical_language>

Target:
public void init() throws DBException { Properties props = getProperties(); String configfile = props.getProperty(CONFIG_FILE_PROPERTY); if (configfile == null) { configfile = CONFIG_FILE_DEFAULT; } String id = props.getProperty(ID_PROPERTY); if (id == null) { id = ID_DEFAULT; } String pool = props.getProperty(POOL_PROPERTY); if (pool == null) { pool = POOL_DEFAULT; } rados = new Rados(id); try { rados.confReadFile(new File(configfile)); rados.connect(); ioctx = rados.ioCtxCreate(pool); } catch (RadosException e) { throw new DBException(e.getMessage() + ": " + e.getReturnValue()); } isInited = true; }
Source:
<code>public static byte[] stripZeroes(byte[] in) { if (in != null) { if (in.length == 1) return in; int firstValue = 0; while (firstValue < in.length && in[firstValue] == 0) { firstValue++; } <START> byte[] out = new byte[in.length - firstValue]; <END> for (int i = 0; i < out.length; i++) { out[i] = in[firstValue + i]; } if (out.length == 0) { byte[] res = new byte[1]; res[0] = (byte) 0x00; out = res.clone(); } return out; } else { LOGGER.severe(OSExceptionHandler.BYTE_ARRAY_NULL); throw new IllegalArgumentException(OSExceptionHandler.BYTE_ARRAY_NULL); } }</code><technical_language>for arrays more 1 byte, zero, bytes removed result is new byte[0]? Ok, I ... check for length == 0 create unnecessary new byte[0]</technical_language>

Target:
public static byte[] stripZeroes(byte[] in) { if (in != null) { if (in.length == 0) { return EMPTY; } if (in.length == 1) return in; int firstValue = 0; while (firstValue < in.length && in[firstValue] == 0) { firstValue++; } int newLength = in.length - firstValue; if (newLength == 0) { return ONE_ZERO; } byte[] out = new byte[newLength]; System.arraycopy(in, firstValue, out, 0, out.length); return out; } else { LOGGER.error(Error.BYTE_ARRAY_NULL); throw new NullPointerException(Error.BYTE_ARRAY_NULL); } }
Source:
<code>public void onEventMainThread(PrefsEvents.MyProfileDataLoadSaveError event) { if (!isFinishing()) { if (event != null && event.mVolleyError != null && event.mVolleyError.networkResponse != null <START> && event.mVolleyError.networkResponse.statusCode == 401) { <END> ToastUtils.showToast(this, R.string.error_refresh_unauthorized_profile, ToastUtils.Duration.LONG); } else { ToastUtils.showToast(this, R.string.error_refresh_profile_not_loaded, ToastUtils.Duration.LONG); } } }</code><technical_language>simplify this [VolleyUtils.statusCodeFromVolleyError()](<LINK_0></technical_language>

Target:
public void onEventMainThread(PrefsEvents.MyProfileDataLoadSaveError event) { if (!isFinishing()) { ToastUtils.showToast(this, R.string.error_refresh_profile_not_accessible, ToastUtils.Duration.LONG); } }
Source:
<code>GetBlobInfoOperation(RouterConfig routerConfig, ClusterMap clusterMap, ResponseHandler responseHandler, String blobIdStr, FutureResult<BlobInfo> futureResult, Callback<BlobInfo> callback, Time time) throws RouterException { super(routerConfig, clusterMap, responseHandler, blobIdStr, futureResult, callback, time); <START> operationTracker = new SimpleOperationTracker(routerConfig.routerDatacenterName, blobId.getPartition(), true, <END> routerConfig.routerGetSuccessTarget, routerConfig.routerGetRequestParallelism); }</code><technical_language>do this in super? this similar for get operations</technical_language>

Target:
GetBlobInfoOperation(RouterConfig routerConfig, ClusterMap clusterMap, ResponseHandler responseHandler, String blobIdStr, FutureResult<BlobInfo> futureResult, Callback<BlobInfo> callback, Time time) throws RouterException { super(routerConfig, clusterMap, responseHandler, blobIdStr, futureResult, callback, time); operationTracker = new SimpleOperationTracker(routerConfig.routerDatacenterName, blobId.getPartition(), routerConfig.routerGetCrossDcEnabled, routerConfig.routerGetSuccessTarget, routerConfig.routerGetRequestParallelism); }
Source:
<code>private TreeItem getDiskNode(ArrayList<Disk> disks) { if (disks.isEmpty()) { return null; } VerticalPanel vPanel = new VerticalPanel(); vPanel.setWidth("100%"); for (Disk disk : disks) { HorizontalPanel panel = new HorizontalPanel(); <START> ImageResource image = resources.diskImage(); <END> String name = disk.getDiskAlias(); addItemToPanel(panel, new Image(image), "25px"); addTextBoxToPanel(panel, new TextBoxLabel(), name, ""); addTextBoxToPanel(panel, new TextBoxLabel(), "", "80px"); addTextBoxToPanel(panel, new TextBoxLabel(), "", "160px"); Double actualSize = disk.getDiskStorageType() == DiskStorageType.IMAGE ? ((DiskImage) disk).getActualDiskWithSnapshotsSize() : (long) (((LunDisk) disk).getLun().getDeviceSize() * Math.pow(1024, 3)); Long virtualSize = disk.getDiskStorageType() == DiskStorageType.IMAGE ? ((DiskImage) disk).getsize() : (long) (((LunDisk) disk).getLun().getDeviceSize() * Math.pow(1024, 3)); addValueLabelToPanel(panel, new DiskSizeLabel<Long>(DiskSizeUnit.BYTE), virtualSize, "110px"); addValueLabelToPanel(panel, new DiskSizeLabel<Double>(DiskSizeUnit.BYTE), actualSize, "110px"); addValueLabelToPanel(panel, new FullDateTimeLabel(), disk.getDiskStorageType() == DiskStorageType.IMAGE ? ((DiskImage) disk).getcreation_date() : null, "140px"); panel.setSpacing(1); panel.setWidth("100%"); vPanel.add(panel); } TreeItem treeItem = new TreeItem(vPanel); treeItem.setUserObject(disks.get(0).getId()); return treeItem; }</code><technical_language>assuming this is image (graphics) display? Is for diskImage LUN</technical_language>

Target:
private TreeItem getDiskNode(ArrayList<Disk> disks) { if (disks.isEmpty()) { return null; } VerticalPanel vPanel = new VerticalPanel(); vPanel.setWidth("100%"); for (Disk disk : disks) { HorizontalPanel panel = new HorizontalPanel(); ImageResource image = resources.diskImage(); String name = disk.getDiskAlias(); addItemToPanel(panel, new Image(image), "25px"); addTextBoxToPanel(panel, new TextBoxLabel(), name, ""); addTextBoxToPanel(panel, new TextBoxLabel(), "", "80px"); addTextBoxToPanel(panel, new TextBoxLabel(), "", "160px"); boolean isDiskImage = disk.getDiskStorageType() == DiskStorageType.IMAGE; Double actualSize = isDiskImage ? ((DiskImage) disk).getActualDiskWithSnapshotsSize() : (long) (((LunDisk) disk).getLun().getDeviceSize() * Math.pow(1024, 3)); Long virtualSize = isDiskImage ? ((DiskImage) disk).getsize() : (long) (((LunDisk) disk).getLun().getDeviceSize() * Math.pow(1024, 3)); addValueLabelToPanel(panel, new DiskSizeLabel<Long>(DiskSizeUnit.BYTE), virtualSize, "110px"); addValueLabelToPanel(panel, new DiskSizeLabel<Double>(DiskSizeUnit.BYTE), actualSize, "110px"); addValueLabelToPanel(panel, new FullDateTimeLabel(), disk.getDiskStorageType() == DiskStorageType.IMAGE ? ((DiskImage) disk).getcreation_date() : null, "140px"); panel.setSpacing(1); panel.setWidth("100%"); vPanel.add(panel); } TreeItem treeItem = new TreeItem(vPanel); treeItem.setUserObject(disks.get(0).getId()); return treeItem; }
Source:
<code>private void execute() { synchronized (syncObj) { if (fStarted) { return; } fStarted = true; } <START> fJob = new Job(String.format("Running analysis %s", getName())) { END> @Override protected IStatus run(final IProgressMonitor monitor) { monitor.beginTask("", IProgressMonitor.UNKNOWN); try { fAnalysisCancelled = !executeAnalysis(monitor); } catch (TmfAnalysisException e) { Activator.logError("Error executing analysis with trace " + getTrace().getName(), e); } finally { synchronized (syncObj) { monitor.done(); fStarted = false; fJob = null; fFinishedLatch.countDown(); } } if (!fAnalysisCancelled) { broadcast(new TmfAnalysisCompletedSignal(TmfAbstractAnalysisModule.this, TmfAbstractAnalysisModule.this)); return Status.OK_STATUS; } return Status.CANCEL_STATUS; } @Override protected void canceling() { TmfAbstractAnalysisModule.this.canceling(); fStarted = false; } }; fJob.schedule(); }</code><technical_language>works, new Job("Running analysis " + getName())</technical_language>

Target:
private void execute() { synchronized (syncObj) { if (fStarted) { return; } fStarted = true; } fJob = new Job(String.format(Messages.TmfAbstractAnalysisModule_RunningAnalysis, getName())) { @Override protected IStatus run(final IProgressMonitor monitor) { try { monitor.beginTask("", IProgressMonitor.UNKNOWN); broadcast(new TmfStartAnalysisSignal(TmfAbstractAnalysisModule.this, TmfAbstractAnalysisModule.this)); fAnalysisCancelled = !executeAnalysis(monitor); } catch (TmfAnalysisException e) { Activator.logError("Error executing analysis with trace " + getTrace().getName(), e); } finally { synchronized (syncObj) { monitor.done(); setAnalysisCompleted(); } } if (!fAnalysisCancelled) { return Status.OK_STATUS; } return Status.CANCEL_STATUS; } @Override protected void canceling() { TmfAbstractAnalysisModule.this.canceling(); } }; fJob.schedule(); }
Source:
<code>private synchronized Map<String, String> getFlowMetadata(final FlowRunner flowRunner) { final ExecutableFlow flow = flowRunner.getExecutableFlow(); final Props props = ServiceProvider.SERVICE_PROVIDER.getInstance(Props.class); final Map<String, String> metaData = new HashMap<>(); metaData.put("flowName", flow.getId()); metaData.put("azkabanHost", props.getString(AZKABAN_SERVER_HOST_NAME, "unknown")); metaData.put("projectName", flow.getProjectName()); metaData.put("submitUser", flow.getSubmitUser()); metaData.put("executionId", String.valueOf(flow.getExecutionId())); metaData.put("startTime", String.valueOf(flow.getStartTime())); metaData.put("submitTime", String.valueOf(flow.getSubmitTime())); if (FlowLoaderUtils.isAzkabanFlowVersion20(flow.getAzkabanFlowVersion())) { propagateMetadataFromProps(metaData, flow.getInputProps(), "flow", flow.getId(), logger); } else { Props combinedProps = null; <START> for (Props sharedProp : flowRunner.sharedProps.values()) { <END> combinedProps = new Props(combinedProps, sharedProp); } combinedProps = new Props(combinedProps, flow.getInputProps()); propagateMetadataFromProps(metaData, combinedProps, "flow", flow.getId(), logger); } return metaData; }</code><technical_language>Props is meant hierarchical, a parent Props, current props a Map. sharedProps is a Map values Props, order these, hierarchical otherwise. is a hierarchical graph of Props created? creating props level sense? Props duplicate properties? If so, is precedence, if any</technical_language>

Target:
private synchronized Map<String, String> getFlowMetadata(final FlowRunner flowRunner) { final ExecutableFlow flow = flowRunner.getExecutableFlow(); final Props props = ServiceProvider.SERVICE_PROVIDER.getInstance(Props.class); final Map<String, String> metaData = new HashMap<>(); metaData.put("flowName", flow.getId()); metaData.put("azkabanHost", props.getString(AZKABAN_SERVER_HOST_NAME, "unknown")); metaData.put("projectName", flow.getProjectName()); metaData.put("submitUser", flow.getSubmitUser()); metaData.put("executionId", String.valueOf(flow.getExecutionId())); metaData.put("startTime", String.valueOf(flow.getStartTime())); metaData.put("submitTime", String.valueOf(flow.getSubmitTime())); if (FlowLoaderUtils.isAzkabanFlowVersion20(flow.getAzkabanFlowVersion())) { propagateMetadataFromProps(metaData, flow.getInputProps(), "flow", flow.getId(), logger); } else { Props combinedProps = new Props(); for (Props sharedProp : flowRunner.sharedProps.values()) { combinedProps.putAll(sharedProp.getFlattened()); } combinedProps = new Props(combinedProps, flow.getInputProps()); propagateMetadataFromProps(metaData, combinedProps, "flow", flow.getId(), logger); } return metaData; }
Source:
<code>public ResteasyProviderFactory(ResteasyProviderFactory parent, boolean local) { if (local) { this.parent = null; <START> initialize(parent); <END> } else { this.parent = parent; providerClasses = new CopyOnWriteArraySet<>(); providerInstances = new CopyOnWriteArraySet<>(); properties = new ConcurrentHashMap<>(); properties.putAll(parent.getProperties()); enabledFeatures = new CopyOnWriteArraySet<>(); reactiveClasses = new ConcurrentHashMap<>(); resourceBuilder = new ResourceBuilder(); } }</code><technical_language>@NicoNes, I parent set null initialization. ClientConfiguration calls >new LocalResteasyProviderFactory(factory);</technical_language>

Target:
public ResteasyProviderFactory(ResteasyProviderFactory parent, boolean local) { if (local || parent == null) { this.parent = null; initialize(parent); } else { this.parent = parent; providerClasses = new CopyOnWriteArraySet<>(); providerInstances = new CopyOnWriteArraySet<>(); properties = new ConcurrentHashMap<>(); properties.putAll(parent.getProperties()); enabledFeatures = new CopyOnWriteArraySet<>(); reactiveClasses = new ConcurrentHashMap<>(); resourceBuilder = new ResourceBuilder(); } }
Source:
<code>public static List<JTestSuite> jTestSuites() { JTestDescription description = JTestDescription.builder() .withComment("My comment") .withId("popa") .withEndpointsProvider(new ExampleEndpointsProvider()) .withQueryProvider(new ExampleQueriesProvider()) .withInvoker(new ExamplePageVisitorInvoker()) .build(); JLoad load = JLoadRps.builder() .withMaxLoadThreads(50) .withRequestPerSecond(100) .withWarmUpTimeInSeconds(24) .build(); JLoad load2 = JLoadRps.builder() .withMaxLoadThreads(500) .withRequestPerSecond(500) .withWarmUpTimeInSeconds(42) .build(); JTermination termination = JTerminationIterations.builder() .withIterationsCount(100) .withMaxDurationInSeconds(500) .build(); JTermination termination2 = JTerminationIterations.builder() .withIterationsCount(100) .withMaxDurationInSeconds(100) .build(); JTest test1 = JTest.builder() .withJTestDescription(description) .withLoad(load) .withTermination(termination) .withId("popa2") .build(); JTest test2 = JTest.builder() .withJTestDescription(description) .withLoad(load2) .withTermination(termination2) .withId("popa3") .build(); JTestGroup testGroup = JTestGroup.builder() <START> .withId("anti popa") <END> .withTests(Arrays.asList(test1, test2)) .build(); JTestSuite configuration = JTestSuite.builder("my_first_test") .withTestGroups(Collections.singletonList(testGroup)) .build(); return Collections.singletonList(configuration); }</code><technical_language>change ids popa</technical_language>

Target:
public static List<JTestSuite> jTestSuites() { JTestDescription description = JTestDescription.builder() .withId("my_first_jagger_test_description") .withComment("no_comments") .withEndpointsProvider(new ExampleEndpointsProvider()) .withQueryProvider(new ExampleQueriesProvider()) .withInvoker(new ExamplePageVisitorInvoker()) .build(); JLoad load = JLoadRps.builder() .withMaxLoadThreads(50) .withRequestPerSecond(100) .withWarmUpTimeInSeconds(24) .build(); JLoad load2 = JLoadRps.builder() .withMaxLoadThreads(500) .withRequestPerSecond(500) .withWarmUpTimeInSeconds(42) .build(); JTermination termination = JTerminationIterations.builder() .withIterationsCount(100) .withMaxDurationInSeconds(500) .build(); JTermination termination2 = JTerminationIterations.builder() .withIterationsCount(100) .withMaxDurationInSeconds(100) .build(); JTest test1 = JTest.builder() .withJTestDescription(description) .withLoad(load) .withTermination(termination) .withId("my_first_test") .build(); JTest test2 = JTest.builder() .withId("yet_another_test") .withJTestDescription(description) .withLoad(load2) .withTermination(termination2) .build(); JTestGroup testGroup = JTestGroup.builder() .withId("my_first_test_group") .withTests(Arrays.asList(test1, test2)) .build(); JTestSuite jTestSuite = JTestSuite.builder() .withId("my_first_test_suite") .withTestGroups(Collections.singletonList(testGroup)) .build(); return Collections.singletonList(jTestSuite); }
Source:
<code>public TagOperation(Repository repo, TagBuilder tag, boolean shouldMoveTag) { <START> this.tag = tag; this.repo = repo; this.shouldMoveTag = shouldMoveTag; this.annotated = true; <END> }</code><technical_language>while pattern in egit sources, code duplication for me. a big fan of implemented constructor constructor chaining. Call other constructor this please</technical_language>

Target:
public TagOperation(Repository repo, TagBuilder tag, boolean shouldMoveTag) { this(repo, tag, shouldMoveTag, true); }
Source:
<code>public void testExecuteQueryGetUnregisteredVm() throws OvfReaderException { setUpVm(); setUpQueryEntities(); getQuery().executeQueryCommand(); @SuppressWarnings("unchecked") VM result = getQuery().getQueryReturnValue().getReturnValue(); assertEquals(VmReturnForOvf, result, "Wrong VM entity <START> in result"); <END> }</code><technical_language>in result</technical_language>

Target:
public void testExecuteQueryGetUnregisteredVm() throws OvfReaderException { setUpVm(); setUpQueryEntities(); getQuery().executeQueryCommand(); @SuppressWarnings("unchecked") VM result = getQuery().getQueryReturnValue().getReturnValue(); assertEquals(VmReturnForOvf, result, "Wrong VM entity"); }
Source:
<code>public void readFrom(ObjectInput input) throws IOException, ClassNotFoundException { timeoutMillis = input.readLong(); <START> chunk = MarshallUtil.unmarshallArray(input, XSiteState::array); <END> }</code><technical_language>too, I 0-length arrays rare (except in tests data in segment)</technical_language>

Target:
public void readFrom(ObjectInput input) throws IOException, ClassNotFoundException { timeoutMillis = input.readLong(); chunk = MarshallUtil.unmarshallArray(input, XSiteState[]::new); }
Source:
<code>private Map<String, Object> mapIPv4(VmInitNetwork vmInitNetwork) { <START> if (!vmInitNetwork.getBootProtocol().equals(Ipv4BootProtocol.NONE)) { <END> Map<String, Object> networkIPv4 = new HashMap<>(); networkIPv4.put("id", vmInitNetwork.getName()); networkIPv4.put("link", vmInitNetwork.getName()); if (vmInitNetwork.getBootProtocol().equals(Ipv4BootProtocol.DHCP)) { networkIPv4.put("type", "dhcp4"); } else if (vmInitNetwork.getBootProtocol().equals(Ipv4BootProtocol.STATIC_IP)) { networkIPv4.put("type", "ipv4"); if (StringUtils.isNotEmpty(vmInitNetwork.getIp())) { networkIPv4.put("ip_address", vmInitNetwork.getIp()); } else { throw new IllegalArgumentException("IP address must be supplied for a static IPv4 configuration"); } if (StringUtils.isNotEmpty(vmInitNetwork.getNetmask())) { networkIPv4.put("netmask", vmInitNetwork.getNetmask()); } if (StringUtils.isNotEmpty(vmInitNetwork.getGateway())) { networkIPv4.put("gateway", vmInitNetwork.getGateway()); } } return networkIPv4; } return null; }</code><technical_language>please compare "!="</technical_language>

Target:
private Map<String, Object> mapIPv4(VmInitNetwork vmInitNetwork) { if (vmInitNetwork.getBootProtocol() == Ipv4BootProtocol.NONE) { return null; } Map<String, Object> networkIPv4 = new HashMap<>(); networkIPv4.put("id", vmInitNetwork.getName()); networkIPv4.put("link", vmInitNetwork.getName()); if (vmInitNetwork.getBootProtocol() == Ipv4BootProtocol.DHCP) { networkIPv4.put("type", "dhcp4"); } else if (vmInitNetwork.getBootProtocol() == Ipv4BootProtocol.STATIC_IP) { networkIPv4.put("type", "ipv4"); if (StringUtils.isNotEmpty(vmInitNetwork.getIp())) { networkIPv4.put("ip_address", vmInitNetwork.getIp()); } else { throw new IllegalArgumentException("IP address must be supplied for a static IPv4 configuration"); } if (StringUtils.isNotEmpty(vmInitNetwork.getNetmask())) { networkIPv4.put("netmask", vmInitNetwork.getNetmask()); } if (StringUtils.isNotEmpty(vmInitNetwork.getGateway())) { networkIPv4.put("gateway", vmInitNetwork.getGateway()); } } return networkIPv4; }
Source:
<code>public ParametersParser(InputStream resource, String prefix) { this.properties = loadProperties(resource); this.prefix = prefix; parseProperties(); <START> } <END></code><technical_language>please call other constructor</technical_language>

Target:
public ParametersParser(InputStream resource, String prefix) { this(loadProperties(resource), prefix); }
Source:
<code>public void validateFormInputs() { if (!hasOneSelection(noSingleProjectComposite)) { setErrorMessageAndPageComplete("Please answer all yes/no questions!"); } else if (inputFieldDoesNotHaveMinimumSensibleInput(projectNameInput) && projectNameInput.getEnabled()) { setErrorMessageAndPageComplete("You must enter a project name longer than 2 chars."); } else if (!hasOneSelection(useJunit) || !hasOneSelection(otherTestingFrameworks) || !hasOneSelection(otherTestingForms)) { setErrorMessageAndPageComplete("Please answer all yes/no/don't know questions!"); } else { setErrorMessageAndPageComplete(null); } <START> setTitle(TITLE + " (" + currentPageNumber + "/" <END> + ((RegistrationWizard) getWizard()).getTotalPageNumber() + ")"); if (shouldSkipProjectSliderPage()) { setTitle(TITLE + " (" + currentPageNumber + "/" + (((RegistrationWizard) getWizard()).getTotalPageNumber() - 1) + ")"); } getWizard().getContainer().updateButtons(); }</code><technical_language>pulling this calculation of page number base class, avoid a lot cloned difficult read code</technical_language>

Target:
public void validateFormInputs() { if (!hasOneSelection(noSingleProjectComposite)) { setErrorMessageAndPageComplete("Please answer all yes/no questions!"); } else if (inputFieldDoesNotHaveMinimumSensibleInput(projectNameInput) && projectNameInput.getEnabled()) { setErrorMessageAndPageComplete("You must enter a project name longer than 2 chars."); } else if (!hasOneSelection(useJunit) || !hasOneSelection(otherTestingFrameworks) || !hasOneSelection(otherTestingForms)) { setErrorMessageAndPageComplete("Please answer all yes/no/don't know questions!"); } else { setErrorMessageAndPageComplete(null); } setTitle(TITLE + " (" + currentPageNumber + "/" + ((RegistrationWizardBase) getWizard()).getTotalPages() + ")"); if (shouldSkipProjectSliderPage()) { setTitle(TITLE + " (" + currentPageNumber + "/" + (((RegistrationWizardBase) getWizard()).getTotalPages() - 1) + ")"); } getWizard().getContainer().updateButtons(); }
Source:
<code>protected ReactiveOAuth2TokenIntrospectionClient getIntrospectionClient() { if (this.introspectionClient != null) { return this.introspectionClient; } <START> if (this.introspectionUri != null || this.webClient != null) { <END> return new NimbusReactiveOAuth2TokenIntrospectionClient(this.introspectionUri, this.webClient); } return getBean(ReactiveOAuth2TokenIntrospectionClient.class); }</code><technical_language>operator &&</technical_language>

Target:
protected ReactiveOAuth2TokenIntrospectionClient getIntrospectionClient() { if (this.introspectionClient != null) { return this.introspectionClient.get(); } return getBean(ReactiveOAuth2TokenIntrospectionClient.class); }
Source:
<code>private void handleDummyTransactionTaskMessage(DummyTransactionTaskMessage message) { DummyTransactionTaskMessage msg = message; long uniqueId, newSpHandle; if (m_isLeader) { TxnEgo ego = advanceTxnEgo(); newSpHandle = ego.getTxnId(); <START> uniqueId = m_uniqueIdGenerator.getNextUniqueId(); <END> msg = new DummyTransactionTaskMessage(m_mailbox.getHSId(), m_mailbox.getHSId(), newSpHandle, uniqueId); msg.setSpHandle(newSpHandle); if (m_sendToHSIds.length > 0) { m_mailbox.send(m_sendToHSIds, msg); DuplicateCounter counter = new DuplicateCounter( HostMessenger.VALHALLA, msg.getTxnId(), m_replicaHSIds, msg); safeAddToDuplicateCounterMap(new DuplicateCounterKey(msg.getTxnId(), newSpHandle), counter); } } else { setMaxSeenTxnId(msg.getSpHandle()); } Iv2Trace.logDummyTransactionTaskMessage(msg, m_mailbox.getHSId()); DummyTransactionTask task = new DummyTransactionTask(m_mailbox, new SpTransactionState(msg), m_pendingTasks); m_pendingTasks.offer(task); }</code><technical_language>need a unique ID for this message</technical_language>

Target:
private void handleDummyTransactionTaskMessage(DummyTransactionTaskMessage message) { DummyTransactionTaskMessage msg = message; if (m_isLeader) { TxnEgo ego = advanceTxnEgo(); long newSpHandle = ego.getTxnId(); updateMaxScheduledTransactionSpHandle(newSpHandle); long uniqueId = m_uniqueIdGenerator.getNextUniqueId(); msg = new DummyTransactionTaskMessage(m_mailbox.getHSId(), newSpHandle, uniqueId); if (m_sendToHSIds.length > 0) { m_mailbox.send(m_sendToHSIds, msg); DuplicateCounter counter = new DuplicateCounter( HostMessenger.VALHALLA, msg.getTxnId(), m_replicaHSIds, msg); safeAddToDuplicateCounterMap(new DuplicateCounterKey(msg.getTxnId(), newSpHandle), counter); } } else { setMaxSeenTxnId(msg.getSpHandle()); } Iv2Trace.logDummyTransactionTaskMessage(msg, m_mailbox.getHSId()); DummyTransactionTask task = new DummyTransactionTask(m_mailbox, new SpTransactionState(msg), m_pendingTasks); ListenableFuture<Object> durabilityBackpressureFuture = m_cl.log(null, msg.getSpHandle(), null, m_durabilityListener, task); if (m_cl.canOfferTask()) { assert durabilityBackpressureFuture != null; m_pendingTasks.offer(task.setDurabilityBackpressureFuture(durabilityBackpressureFuture)); } }
Source:
<code>private List<BrickProfileDetails> prepareBrickProfileDetails(GlusterVolumeEntity volume, Object[] brickProfileDetails) { List<BrickProfileDetails> brickProfileDetailsList = new ArrayList<BrickProfileDetails>(); for (Object brickProfileObj : brickProfileDetails) { BrickProfileDetails brickProfileDetail = new BrickProfileDetails(); Map<String, Object> brickProfile = (Map<String, Object>) brickProfileObj; brickProfileDetail.setBrickId(GlusterCoreUtil.getBrickByQualifiedName(volume.getBricks(), <START> (String) brickProfile.get(BRICK)).getId()); <END> List<StatsInfo> statsInfo = new ArrayList<StatsInfo>(); statsInfo.add(getStatInfo((Map<String, Object>) brickProfile.get(CUMULATIVE_STATS), CUMULATIVE_STATS)); statsInfo.add(getStatInfo((Map<String, Object>) brickProfile.get(INTERVAL_STATS), INTERVAL_STATS)); brickProfileDetail.setStatsInfo(statsInfo); brickProfileDetailsList.add(brickProfileDetail); } return brickProfileDetailsList; }</code><technical_language>This throw NullPointerException if GlusterCoreUtil.getBrickByQualifiedName() returns null</technical_language>

Target:
private List<BrickProfileDetails> prepareBrickProfileDetails(GlusterVolumeEntity volume, Object[] brickProfileDetails) { List<BrickProfileDetails> brickProfileDetailsList = new ArrayList<BrickProfileDetails>(); for (Object brickProfileObj : brickProfileDetails) { BrickProfileDetails brickProfileDetail = new BrickProfileDetails(); Map<String, Object> brickProfile = (Map<String, Object>) brickProfileObj; Guid brickId = GlusterCoreUtil.getBrickByQualifiedName(volume.getBricks(), (String) brickProfile.get(BRICK)) .getId(); if (brickId != null) { brickProfileDetail.setBrickId(brickId); } List<StatsInfo> statsInfo = new ArrayList<StatsInfo>(); statsInfo.add(getStatInfo((Map<String, Object>) brickProfile.get(CUMULATIVE_STATS), CUMULATIVE_STATS)); statsInfo.add(getStatInfo((Map<String, Object>) brickProfile.get(INTERVAL_STATS), INTERVAL_STATS)); brickProfileDetail.setStatsInfo(statsInfo); brickProfileDetailsList.add(brickProfileDetail); } return brickProfileDetailsList; }
Source:
<code>private String getTeamCityUrl() { String url = System.getProperty("teamcity.serverUrl"); String build_type = System.getProperty("teamcity.buildType.id"); String build_number = System.getProperty("build.number"); <START> String result = url + "/repository/download/" + build_type + "/" + build_number + ":id/"; <END> if (isEmpty(build_type) || isEmpty(build_number) || isEmpty(result)) { return null; } else { LOG.config("Using teamcity artifacts: " + result); return result; } }</code><technical_language>Paths.get(url, "repository", "download", build_type, ...).toString() instead of summ operation. In this case case platform's folders/url dividers. avoid / symbol duplication</technical_language>

Target:
private String getTeamCityUrl() { String url = System.getProperty("teamcity.serverUrl"); String build_type = System.getProperty("teamcity.buildType.id"); String build_number = System.getProperty("build.number"); if (isEmpty(build_type) || isEmpty(build_number) || isEmpty(url)) { return null; } return resolveUrlSource("%s/repository/download/%s/%s:id/", url, build_type, build_number); }
Source:
<code>public void basicUsageTest() throws Exception{ EmbeddedCacheManager cacheManager = cacheManagers.iterator().next(); Cache cache = cacheManager.getCache(); AtomicObjectFactory factory = new AtomicObjectFactory(cache); SortedMap<Integer,Integer> map = factory.getInstanceOf(ShardedTreeMap.class,"test",false,null,false,3); for(int i=0; i<NCALLS; i++) { map.put(i,i); map.get(i); } factory.disposeInstanceOf(ShardedTreeMap.class,"test",true); map = factory.getInstanceOf(ShardedTreeMap.class,"test",false,null,false,3); int a = map.size(); log.debug(a); <START> assert map.size() == NCALLS; <END> assert map.subMap(0,NCALLS/2).size()==NCALLS/2; SortedMap<Integer,Integer> map2 = factory.getInstanceOf(ShardedTreeMap.class,"test2",false,null,false,3); Map<Integer,Integer> toAdd = new HashMap<Integer, Integer>(); for(int i=0; i<NCALLS; i++) { toAdd.put(i, i); toAdd.get(i); } map2.putAll(toAdd); assert map2.size() == NCALLS; assert map2.lastKey() == NCALLS-1; }</code><technical_language>prefer of AssertJUnit static assert methods, provide messages</technical_language>

Target:
public void basicUsageTest() throws Exception{ EmbeddedCacheManager cacheManager = cacheManagers.iterator().next(); Cache cache = cacheManager.getCache(); AtomicObjectFactory factory = new AtomicObjectFactory(cache); SortedMap<Integer,Integer> map = factory.getInstanceOf(ShardedTreeMap.class,"test",false,null,false,3); for(int i=0; i<NCALLS; i++) { map.put(i,i); map.get(i); } factory.disposeInstanceOf(ShardedTreeMap.class,"test",true); map = factory.getInstanceOf(ShardedTreeMap.class,"test",false,null,false,3); int a = map.size(); log.debug(a); assertEquals(NCALLS,map.size()); assertEquals(NCALLS/2,map.subMap(0,NCALLS/2).size()); SortedMap<Integer,Integer> map2 = factory.getInstanceOf(ShardedTreeMap.class,"test2",false,null,false,3); Map<Integer,Integer> toAdd = new HashMap<Integer, Integer>(); for(int i=0; i<NCALLS; i++) { toAdd.put(i, i); toAdd.get(i); } map2.putAll(toAdd); assertEquals(NCALLS,map2.size()); assertEquals(map2.lastKey(),Integer.valueOf(NCALLS-1)); }
Source:
<code>public void process(IProgressMonitor monitor) throws CoreException { if (monitor == null) <START> monitor = new NullProgressMonitor(); <END> SubMonitor subMonitor = SubMonitor.convert(monitor, "Searching unused members", this.units.length); for (ICompilationUnit unit : this.units) { doSearchCU(unit, subMonitor.newChild(1)); } }</code><technical_language>This removed. SubMonitor handle null</technical_language>

Target:
public void process(IProgressMonitor monitor) throws CoreException { SubMonitor subMonitor = SubMonitor.convert(monitor, "Searching unused members", this.units.length); for (ICompilationUnit unit : this.units) { doSearchCU(unit, subMonitor.split(1)); } }
Source:
<code>public void schedule(ClientContext context) throws InsertException { cb.onBlockSetFinished(this, context); storage.start(); SplitFileInserterSender s; synchronized(this) { s = sender; } if(!ctx.getCHKOnly) { s.clearWakeupTime(context); <START> s.schedule(context); <END> } }</code><technical_language>functions thread-safe? clear reading are. Is for other threads do - is double-scheduling a problem for instance? more correct if lock held for calls instead</technical_language>

Target:
public void schedule(ClientContext context) throws InsertException { cb.onBlockSetFinished(this, context); storage.start(); if(!ctx.getCHKOnly) { sender.clearWakeupTime(context); sender.schedule(context); } }