auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void testPreserveOldPacks() throws Exception { BranchBuilder bb = tr.branch("refs/heads/master"); bb.commit().message("P").add("P", "P").create(); gc.setExpireAgeMillis(0); gc.gc(); File oldPackfile = tr.getRepository().getObjectDatabase().getPacks() .iterator().next().getPackFile(); assertEquals(true, oldPackfile.exists()); fsTick(); bb.commit().message("B").add("B", "Q").create(); gc.setPackExpireAgeMillis(0); configureGc(gc, false).setPreserveOldPacks(true); gc.gc(); File oldPackDir = repo.getObjectDatabase().getPreservedDirectory(); String oldPackFileName = oldPackfile.getName(); String oldPackName = oldPackFileName.substring(0, oldPackFileName.lastIndexOf('.')) + ".old-pack"; File preservePackFile = new File(oldPackDir, oldPackName); <START> assertEquals(true, preservePackFile.exists()); <END> }</code><technical_language>similar above. I assertTrue(...)</technical_language>

Target:
private void testPreserveOldPacks() throws Exception { BranchBuilder bb = tr.branch("refs/heads/master"); bb.commit().message("P").add("P", "P").create(); gc.setExpireAgeMillis(0); gc.gc(); File oldPackfile = tr.getRepository().getObjectDatabase().getPacks() .iterator().next().getPackFile(); assertTrue(oldPackfile.exists()); fsTick(); bb.commit().message("B").add("B", "Q").create(); gc.setPackExpireAgeMillis(0); configureGc(gc, false).setPreserveOldPacks(true); gc.gc(); File oldPackDir = repo.getObjectDatabase().getPreservedDirectory(); String oldPackFileName = oldPackfile.getName(); String oldPackName = oldPackFileName.substring(0, oldPackFileName.lastIndexOf('.')) + ".old-pack"; File preservePackFile = new File(oldPackDir, oldPackName); assertTrue(preservePackFile.exists()); }
Source:
<code>public void testMediate() { final String EVENT_SOURCE_NAME = "testEventStore"; SynapseEnvironment synapseEnvironment = Mockito.mock(SynapseEnvironment.class); MessageContext messageContext = new TestMessageContext(); messageContext.setEnvironment(synapseEnvironment); SynapseConfiguration synapseConfiguration = new SynapseConfiguration(); SynapseEventSource synapseEventSource = Mockito.mock(SynapseEventSource.class); Mockito.doNothing().when(synapseEventSource).dispatchEvents(Mockito.any(MessageContext.class)); Map<String,SynapseEventSource> eventStoreMap = new HashMap<>(); <START> eventStoreMap.put(EVENT_SOURCE_NAME,synapseEventSource); <END> synapseConfiguration.setEventSources(eventStoreMap); messageContext.setConfiguration(synapseConfiguration); eventPublisherMediator.setEventSourceName(EVENT_SOURCE_NAME); Assert.assertTrue("mediation successful",eventPublisherMediator.mediate(messageContext)); }</code><technical_language>Code formating issue: need a space ,</technical_language>

Target:
public void testMediate() { final String EventSourceName = "testEventStore"; SynapseEnvironment synapseEnvironment = Mockito.mock(SynapseEnvironment.class); MessageContext messageContext = new TestMessageContext(); messageContext.setEnvironment(synapseEnvironment); SynapseConfiguration synapseConfiguration = new SynapseConfiguration(); SynapseEventSource synapseEventSource = Mockito.mock(SynapseEventSource.class); Mockito.doNothing().when(synapseEventSource).dispatchEvents(Mockito.any(MessageContext.class)); Map<String, SynapseEventSource> eventStoreMap = new HashMap<>(); eventStoreMap.put(EventSourceName, synapseEventSource); synapseConfiguration.setEventSources(eventStoreMap); messageContext.setConfiguration(synapseConfiguration); eventPublisherMediator.setEventSourceName(EventSourceName); Assert.assertTrue("mediation successful", eventPublisherMediator.mediate(messageContext)); }
Source:
<code><START> public Iterable<DataCenter> listLocations() { <END> logger.trace("<< fetching locations.."); Iterable<DataCenter> all = api.dataCenterApi().list(new DepthOptions().depth(4)); logger.trace(">> done fetching locations.."); return all; }</code><technical_language>Locations configured properties, this method invoked. this method throw Unsupported op exception</technical_language>

Target:
public Iterable<Location> listLocations() { throw new UnsupportedOperationException("Locations are configured in jclouds properties"); }
Source:
<code>public void testGetRefsByPrefixes() throws IOException { <START> List<Ref> refs = db.getRefDatabase().getRefsByPrefix(); <END> List<Ref> allRefs = db.getRefDatabase().getRefs(); assertEquals(allRefs.size(), refs.size()); refs = db.getRefDatabase().getRefsByPrefix("refs/heads/p", "refs/tags/A"); assertEquals(3, refs.size()); checkContainsRef(refs, db.exactRef("refs/heads/prefix/a")); checkContainsRef(refs, db.exactRef("refs/heads/pa")); checkContainsRef(refs, db.exactRef("refs/tags/A")); }</code><technical_language>Is this case needed</technical_language>

Target:
public void testGetRefsByPrefixes() throws IOException { List<Ref> refs = db.getRefDatabase().getRefsByPrefix("refs/heads/p", "refs/tags/A"); assertEquals(3, refs.size()); checkContainsRef(refs, db.exactRef("refs/heads/prefix/a")); checkContainsRef(refs, db.exactRef("refs/heads/pa")); checkContainsRef(refs, db.exactRef("refs/tags/A")); }
Source:
<code><START> Builder setCanonicalHeaders(Map<String, String> canonicalHeaders) { <END> this.canonicalHeaders = canonicalHeaders; return this; }</code><technical_language>This injects mutable internal state. A copy is needed</technical_language>

Target:
Builder setCanonicalHeaders(Map<String, String> canonicalHeaders) { this.canonicalHeaders = new HashMap<>(canonicalHeaders); return this; }
Source:
<code><START> public void putResource(String targetPath, InputStream sourceStream) throws InfrastructureException { <END> try { docker.putResource(PutResourceParams.create(container, targetPath, sourceStream)); } catch (IOException e) { throw new InfrastructureException(e.getMessage(), e); } }</code><technical_language>Consider making package private</technical_language>

Target:
public void putResource(String targetPath, InputStream sourceStream) throws InfrastructureException { try { docker.putResource(PutResourceParams.create(container, targetPath, sourceStream)); } catch (IOException e) { throw new InternalInfrastructureException(e.getMessage(), e); } }
Source:
<code>public void run() { Class c = null; try { <START> c = Class.forName("org.apache.harmony.jpda.tests.jdwp.ObjectReference.InvokeMethodDefaultDebuggee$TestClass"); <END> } catch (ClassNotFoundException e) { e.printStackTrace(); } synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_READY); logWriter.println("InvokeMethodDefaultDebuggee"); synchronizer.receiveMessageWithoutException("org.apache.harmony.jpda.tests.jdwp.ObjectReference.InvokeMethodDefaultDebuggee(#1)"); execMethod(); synchronizer.receiveMessageWithoutException("org.apache.harmony.jpda.tests.jdwp.ObjectReference.InvokeMethodDefaultDebuggee(#2)"); }</code><technical_language>Long line</technical_language>

Target:
public void run() { Class c = null; String packageName = "org.apache.harmony.jpda.tests.jdwp."; try { c = Class.forName( packageName + "ObjectReference.InvokeMethodDefaultDebuggee$TestClass"); } catch (ClassNotFoundException e) { e.printStackTrace(); } synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_READY); logWriter.println("InvokeMethodDefaultDebuggee"); synchronizer.receiveMessageWithoutException( packageName + "ObjectReference.InvokeMethodDefaultDebuggee(#1)"); execMethod(); synchronizer.receiveMessageWithoutException( packageName + "ObjectReference.InvokeMethodDefaultDebuggee(#2)"); }
Source:
<code>private Map<String, String> getStructureViewerAliases() { if (fStructureViewerAliases == null) { <START> fStructureViewerAliases= new Hashtable<String, String>(10); <END> String aliases= getPreferenceStore().getString(STRUCTUREVIEWER_ALIASES_PREFERENCE_NAME); if (aliases != null && aliases.length() > 0) { StringTokenizer st= new StringTokenizer(aliases, " "); while (st.hasMoreTokens()) { String pair= st.nextToken(); int pos= pair.indexOf('.'); if (pos > 0) { String key= pair.substring(0, pos); String alias= pair.substring(pos+1); fStructureViewerAliases.put(key, alias); } } } } return fStructureViewerAliases; }</code><technical_language>new Hashtable<></technical_language>

Target:
private Map<String, String> getStructureViewerAliases() { if (fStructureViewerAliases == null) { fStructureViewerAliases= new Hashtable<>(10); String aliases= getPreferenceStore().getString(STRUCTUREVIEWER_ALIASES_PREFERENCE_NAME); if (aliases != null && aliases.length() > 0) { StringTokenizer st= new StringTokenizer(aliases, " "); while (st.hasMoreTokens()) { String pair= st.nextToken(); int pos= pair.indexOf('.'); if (pos > 0) { String key= pair.substring(0, pos); String alias= pair.substring(pos+1); fStructureViewerAliases.put(key, alias); } } } } return fStructureViewerAliases; }
Source:
<code>void archiveEntityViaMigration() { ProjectId id = createId(42); TestProjection projection = createEntity(id); repository().store(projection); repository().applyMigration(id, new MarkProjectionArchived<>()); Optional<TestProjection> found = repository().find(id); <START> Truth8.assertThat(found).isPresent(); <END> assertThat(found.get().isArchived()).isTrue(); }</code><technical_language>Please static imports</technical_language>

Target:
void archiveEntityViaMigration() { ProjectId id = createId(42); TestProjection projection = createEntity(id); repository().store(projection); repository().applyMigration(id, new MarkProjectionArchived<>()); Optional<TestProjection> found = repository().find(id); assertThat(found).isPresent(); assertThat(found.get() .isArchived()).isTrue(); }
Source:
<code>public void updateMoveAndCopyCommandAvailability(List<DiskImage> disks, UICommand moveCommand, UICommand copyCommand) { boolean isCopyAllowed = true; boolean isMoveAllowed = true; if ( moveCommand == null || copyCommand == null ) { return; } if (disks == null || disks.isEmpty() || disks.get(0).getDiskStorageType() != DiskStorageType.IMAGE) { disableMoveAndCopyCommands(copyCommand, moveCommand); return; } Guid dataCenterId = disks.get(0).getStoragePoolId(); boolean foundTemplateDisk = false; boolean foundVmDisk = false; boolean foundUnattachedDisk = false; for (DiskImage disk : disks) { <START> if ((!isCopyAllowed && !isMoveAllowed) || disk.getDiskStorageType() != DiskStorageType.IMAGE) { disableMoveAndCopyCommands(moveCommand, copyCommand); return; } if (disk.getImageStatus() != ImageStatus.OK || !dataCenterId.equals(disk.getStoragePoolId()) || disk.isOvfStore()) { disableMoveAndCopyCommands(moveCommand, copyCommand); return; } <END> VmEntityType vmEntityType = disk.getVmEntityType(); if (vmEntityType == null) { foundUnattachedDisk = true; } else if (vmEntityType.isTemplateType()) { foundTemplateDisk = true; } else if (vmEntityType.isVmType()) { foundVmDisk = true; } if (foundTemplateDisk && (foundUnattachedDisk || foundVmDisk)) { isCopyAllowed = false; } if (vmEntityType != null && vmEntityType.isTemplateType()) { isMoveAllowed = false; } } copyCommand.setIsExecutionAllowed(isCopyAllowed); moveCommand.setIsExecutionAllowed(isMoveAllowed); }</code><technical_language>consider consolidate a single if block do same, is a reason</technical_language>

Target:
public void updateMoveAndCopyCommandAvailability(List<DiskImage> disks, UICommand moveCommand, UICommand copyCommand) { boolean isCopyAllowed = true; boolean isMoveAllowed = true; if ( moveCommand == null || copyCommand == null ) { return; } if (disks == null || disks.isEmpty() || disks.get(0).getDiskStorageType() != DiskStorageType.IMAGE) { disableMoveAndCopyCommands(copyCommand, moveCommand); return; } Guid dataCenterId = disks.get(0).getStoragePoolId(); boolean foundTemplateDisk = false; boolean foundVmDisk = false; boolean foundUnattachedDisk = false; for (DiskImage disk : disks) { if ( (!isCopyAllowed && !isMoveAllowed) || (disk.getDiskStorageType() != DiskStorageType.IMAGE) || (disk.getImageStatus() != ImageStatus.OK ) || (!dataCenterId.equals(disk.getStoragePoolId())) || (disk.isOvfStore())) { disableMoveAndCopyCommands(moveCommand, copyCommand); return; } VmEntityType vmEntityType = disk.getVmEntityType(); if (vmEntityType == null) { foundUnattachedDisk = true; } else if (vmEntityType.isTemplateType()) { foundTemplateDisk = true; } else if (vmEntityType.isVmType()) { foundVmDisk = true; } if (foundTemplateDisk && (foundUnattachedDisk || foundVmDisk)) { isCopyAllowed = false; } if (vmEntityType != null && vmEntityType.isTemplateType()) { isMoveAllowed = false; } } copyCommand.setIsExecutionAllowed(isCopyAllowed); moveCommand.setIsExecutionAllowed(isMoveAllowed); }
Source:
<code>public void testSimpleSchemaMerge() throws Exception { String jsonSample = "{\"id\": 1}\n{\"id\": 2}"; Schema schema = Schema.createRecord("Test", null, null, false); schema.setFields(ImmutableList.of( new Schema.Field("id", Schema.create(Schema.Type.INT), null, null) )); <START> <END> Assert.assertEquals("Should match expected schema", schema, mergeSchemas(jsonSample)); }</code><technical_language>SchemaBuilder this shorter more readable</technical_language>

Target:
public void testSimpleSchemaMerge() throws Exception { String jsonSample = "{\"id\": 1}\n{\"id\": 2}"; Schema schema = SchemaBuilder.record("Test").fields() .requiredInt("id") .endRecord(); Assert.assertEquals("Should match expected schema", schema, mergeSchemas(jsonSample)); }
Source:
<code>public String run( ReportInfo ri ) { String ret = ""; int tot_cnt = 0; try { for (Map.Entry<String, Integer> name_count : Core.getCommunities()) { <START> ret += String.format("Collection [%s]: %d\n", <END> name_count.getKey(), name_count.getValue()); tot_cnt += name_count.getValue(); } } catch (SQLException e) { error(e); } try { ret += "\nCollection sizes:\n"; ret += Core.getCollectionSizesInfo(); } catch (SQLException e) { error(e); } ret += String.format( "\nPublished items (archived, not withdrawn): %d\n", tot_cnt); try { ret += String.format( "Withdrawn items: %d\n", Core.getWithdrawnItemsCount()); ret += String.format( "Not published items (in workspace or workflow mode): %d\n", Core.getNotArchivedItemsCount()); for (TableRow row : Core.getWorkspaceItemsRows()) { ret += String.format("\tIn Stage %s: %s\n", row.getIntColumn("stage_reached"), row.getLongColumn("cnt")); } ret += String.format( "\tWaiting for approval (workflow items): %d\n", Core.getWorkflowItemsCount()); } catch (SQLException e) { error(e); } try { ret += Core.getObjectSizesInfo(); } catch (SQLException e) { error(e); } return ret; }</code><technical_language>"Community [%s]: %d\n"</technical_language>

Target:
public String run( ReportInfo ri ) { String ret = ""; int tot_cnt = 0; Context context = new Context(); try { for (Map.Entry<String, Integer> name_count : getCommunities(context)) { ret += String.format("Community [%s]: %d\n", name_count.getKey(), name_count.getValue()); tot_cnt += name_count.getValue(); } } catch (SQLException e) { error(e); } try { ret += "\nCollection sizes:\n"; ret += getCollectionSizesInfo(context); } catch (SQLException e) { error(e); } ret += String.format( "\nPublished items (archived, not withdrawn): %d\n", tot_cnt); try { ret += String.format( "Withdrawn items: %d\n", itemService.countWithdrawnItems(context)); ret += String.format( "Not published items (in workspace or workflow mode): %d\n", itemService.getNotArchivedItemsCount(context)); for (Map.Entry<Integer, Long> row : workspaceItemService.getStageReachedCounts(context)) { ret += String.format("\tIn Stage %s: %s\n", row.getKey(), row.getValue() ); } ret += String.format( "\tWaiting for approval (workflow items): %d\n", basicWorkflowItemService.countTotal(context)); } catch (SQLException e) { error(e); } try { ret += getObjectSizesInfo(context); context.complete(); } catch (SQLException e) { error(e); } return ret; }
Source:
<code>public void shouldUseIgnoreAbove(){ elasticsearchTemplate.createIndex(IgnoreAboveEntity.class); elasticsearchTemplate.putMapping(IgnoreAboveEntity.class); Map mapping = elasticsearchTemplate.getMapping(IgnoreAboveEntity.class); Map properties = (Map) mapping.get("properties"); Map message = (Map) properties.get("message"); <START> java.lang.reflect.Field field = ReflectionUtils.findField(IgnoreAboveEntity.class, "message"); <END> assertThat(field).isNotNull(); Field fieldAnnotation = AnnotationUtils.getAnnotation(field, Field.class); assertThat(fieldAnnotation).isNotNull(); assertThat(message.get("ignore_above")).isEqualTo(fieldAnnotation.ignoreAbove()); }</code><technical_language>need test if testclass, is defined 10 lines later, this annotation need assert attribute of annotation. This test is MappingBuilder, I store mapping in index, retrieve map parse it. This integration testing. I know, a lot of tests in this class do this, question answer is _does MappingBuilder create correct mapping_? For this need store mapping in index. a shouldBuildMappingsForGeoPoint() does: Test JSON string returned MappingBuilder contains correct mapping</technical_language>

Target:
public void shouldUseIgnoreAbove() throws IOException, JSONException { String expected = "{\"ignore-above-type\":{\"properties\":{\"message\":{\"store\":false,\"type\":\"keyword\",\"ignore_above\":10}}}}"; String mapping = getMappingBuilder().buildPropertyMapping(IgnoreAboveEntity.class); assertEquals(expected, mapping, false); }
Source:
<code>public void worked(final int work) { Display.getDefault().syncExec(new Runnable() { @Override public void run() { if (progressBar.getSelection() >= 100) { progressBar.setSelection(0); System.out.println("reset"); } else { progressBar.setSelection(progressBar.getSelection() + work); <START> System.out.println("sel=" + progressBar.getSelection() + work); <END> } } }); }</code><technical_language>print out in Eclipse</technical_language>

Target:
public void worked(final int work) { Display.getDefault().syncExec(new Runnable() { @Override public void run() { if (progressBar.getSelection() >= 100) { progressBar.setSelection(0); } else { progressBar.setSelection(progressBar.getSelection() + work); } } }); }
Source:
<code>public void checkGoToSymbolFeature() { <START> menu.runCommand(ASSISTANT, FIND_DEFINITION); <END> try { assistantFindPanel.waitActionNodeContainsText("Main(string[] args)"); } catch (TimeoutException ex) { fail("Known permanent failure: <LINK_0>", ex); } }</code><technical_language>menu.runCommand(ASSISTANT, FIND_DEFINITION); -> menu.runCommand(ASSISTANT, GO_TO_SYMBOL);</technical_language>

Target:
public void checkGoToSymbolFeature() { menu.runCommand(ASSISTANT, GO_TO_SYMBOL); try { assistantFindPanel.waitActionNodeContainsText("Main(string[] args)"); } catch (TimeoutException ex) { fail("Known permanent failure: <LINK_0>", ex); } }
Source:
<code>private void writeController(VmDevice device) { writer.writeStartElement("controller"); writer.writeAttributeString("type", device.getDevice()); Object model = device.getSpecParams().get(VdsProperties.Model); if (model != null) { writer.writeAttributeString("model", model.toString()); } Object index = device.getSpecParams().get(VdsProperties.Index); if (index != null) { writer.writeAttributeString("index", index.toString()); } Object ports = device.getSpecParams().get("ports"); if (ports != null) { writer.writeAttributeString("ports", ports.toString()); } if (device.getSpecParams().containsKey(VdsProperties.ioThreadId)) { writer.writeStartElement("driver"); writer.writeAttributeString("iothread", device.getSpecParams().get(VdsProperties.ioThreadId).toString()); writer.writeEndElement(); } <START> if (!VmDeviceType.USB.getName().equals(device.getDevice())) { <END> writeAlias(device); } writeAddress(device); writer.writeEndElement(); }</code><technical_language>please add a reference <LINK_0> obvious exception</technical_language>

Target:
private void writeController(VmDevice device) { writer.writeStartElement("controller"); writer.writeAttributeString("type", device.getDevice()); Object model = device.getSpecParams().get(VdsProperties.Model); if (model != null) { writer.writeAttributeString("model", model.toString()); } Object index = device.getSpecParams().get(VdsProperties.Index); if (index != null) { writer.writeAttributeString("index", index.toString()); } Object ports = device.getSpecParams().get("ports"); if (ports != null) { writer.writeAttributeString("ports", ports.toString()); } Object ioThreadId = device.getSpecParams().get(VdsProperties.ioThreadId); if (ioThreadId != null) { writer.writeStartElement("driver"); writer.writeAttributeString("iothread", ioThreadId.toString()); writer.writeEndElement(); } if (!VmDeviceType.USB.getName().equals(device.getDevice())) { writeAlias(device); } writeAddress(device); writer.writeEndElement(); }
Source:
<code>private void fillNextCycle(int numUpdates, boolean expect) { for (int ii = 0; ii < numUpdates; ii++) { <START> Random m_random = new Random(); <END> int maxStreamSuffix = m_expectedValues.lastKey() + 1; int targetSuffix; do { targetSuffix = m_random.nextInt(maxStreamSuffix); } while (!m_expectedValues.containsKey(targetSuffix)); changeCursor(targetSuffix, getRandomPartitionId(), Math.abs(m_random.nextLong()), expect); } }</code><technical_language>is this creating a new random instance for iteration in loop? m_ prefix</technical_language>

Target:
private void fillNextCycle(int numUpdates, boolean expect) { for (int ii = 0; ii < numUpdates; ii++) { int maxStreamSuffix = m_expectedValues.lastKey() + 1; int targetSuffix; do { targetSuffix = m_random.nextInt(maxStreamSuffix); } while (!m_expectedValues.containsKey(targetSuffix)); changeCursor(targetSuffix, getRandomPartitionId(), Math.abs(m_random.nextLong()), expect); } }
Source:
<code>protected final void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { CurrentUser user = currentUser.get(); if (user instanceof IdentifiedUser) { Account.Id userId = ((IdentifiedUser) user).getAccountId(); String token = <START> ")]}'\n{token:\"" + verifier.encode(userId, getReqUrl(req)) + "\"}"; <END> res.setContentType(JSON_TYPE); res.setCharacterEncoding("UTF-8"); send(req, res, token.getBytes("UTF-8")); } else { res.sendError(HttpServletResponse.SC_UNAUTHORIZED); } }</code><technical_language>JSON_MAGIC constant in RestApiServlet. Format token JSON body Gson ensure escaped correctly, if necessary. need escaped I prefer paranoid</technical_language>

Target:
protected final void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { CurrentUser user = currentUser.get(); if (user instanceof IdentifiedUser) { Account.Id userId = ((IdentifiedUser) user).getAccountId(); TokenInfo info = new TokenInfo(); info._authKey = verifier.sign(userId, getReqUrl(req)); ByteArrayOutputStream buf = new ByteArrayOutputStream(); buf.write(JSON_MAGIC); buf.write(new Gson().toJson(info).getBytes("UTF-8")); res.setContentType(JSON_TYPE); res.setCharacterEncoding("UTF-8"); send(req, res, buf.toByteArray()); } else { res.sendError(HttpServletResponse.SC_UNAUTHORIZED); } }
Source:
<code>List<String> fetchGradeFromDatabase(int grade) { <START> if (!database.containsKey(grade)) { <END> database.put(grade, new LinkedList<>()); } Collections.sort(database.get(grade)); return database.get(grade); }</code><technical_language>I this method private</technical_language>

Target:
private List<String> fetchGradeFromDatabase(int grade) { if (!database.containsKey(grade)) { database.put(grade, new LinkedList<>()); } Collections.sort(database.get(grade)); return database.get(grade); }
Source:
<code>LegacyProtocolResourceDefinition(String name, String targetName, JGroupsModel deprecation, Consumer<ResourceDescriptor> descriptorConfigurator, ResourceServiceBuilderFactory<ChannelFactory> parentBuilderFactory) { <START> super(pathElement(name), descriptorConfigurator.andThen(descriptor -> descriptor.setAddOperationTransformation(new OperationTransformation(targetName)).setOperationTransformation(new OperationTransformation(targetName))), null, parentBuilderFactory); <END> this.setDeprecated(deprecation.getVersion()); }</code><technical_language>lambda</technical_language>

Target:
LegacyProtocolResourceDefinition(String name, String targetName, JGroupsModel deprecation, Consumer<ResourceDescriptor> descriptorConfigurator, ResourceServiceBuilderFactory<ChannelFactory> parentBuilderFactory) { super(pathElement(name), descriptorConfigurator.andThen(new OperationTransformation(targetName)), null, parentBuilderFactory); this.setDeprecated(deprecation.getVersion()); }
Source:
<code>private void publishPost(final PostModel post) { if (!NetworkUtils.isNetworkAvailable(getActivity())) { ToastUtils.showToast(getActivity(), R.string.error_publish_no_network, ToastUtils.Duration.SHORT); return; } if (!PostUtils.isPublishable(post)) { ToastUtils.showToast(getActivity(), R.string.error_publish_empty_post, ToastUtils.Duration.SHORT); return; } PostUtils.updatePublishDateIfShouldBePublishedImmediately(post); post.setStatus(PostStatus.PUBLISHED.toString()); <START> UploadService.addPostToUpload(getActivity(), post); <END> PostUtils.trackSavePostAnalytics(post, mSite); }</code><technical_language>thanks for making startService call this other static method</technical_language>

Target:
private void publishPost(final PostModel post) { if (!NetworkUtils.isNetworkAvailable(getActivity())) { ToastUtils.showToast(getActivity(), R.string.error_publish_no_network, ToastUtils.Duration.SHORT); return; } if (!PostUtils.isPublishable(post)) { ToastUtils.showToast(getActivity(), R.string.error_publish_empty_post, ToastUtils.Duration.SHORT); return; } PostUtils.updatePublishDateIfShouldBePublishedImmediately(post); post.setStatus(PostStatus.PUBLISHED.toString()); mDispatcher.dispatch(PostActionBuilder.newUpdatePostAction(post)); UploadService.uploadPost(getActivity(), post); PostUtils.trackSavePostAnalytics(post, mSite); }
Source:
<code>public Annotation getFirstAnnotationForOffset(int offset) { for (CommentAnnotation annotation : Iterables.filter(annotations, CommentAnnotation.class)) { <START> if (annotation instanceof CommentAnnotation) { <END> if (annotation.getPosition().offset <= offset && (annotation.getPosition().length + annotation.getPosition().offset) >= offset) { return annotation; } } } return null; }</code><technical_language>needed</technical_language>

Target:
public Annotation getFirstAnnotationForOffset(int offset) { for (CommentAnnotation annotation : Iterables.filter(annotations, CommentAnnotation.class)) { if (annotation.getPosition().offset <= offset && (annotation.getPosition().length + annotation.getPosition().offset) >= offset) { return annotation; } } return null; }
Source:
<code>public AuthRequest authenticate(final AuthRequest who) throws AccountException { try { <START> DirContext ctx = null; <END> AuthType authType = authConfig.getAuthType(); String username = who.getLocalUser(); String password = who.getPassword(); if (this.username != null) { ctx = open(); if (authType == AuthType.LDAP) { ctx = authenticate(username, password); } } else if (authType == AuthType.LDAP) { ctx = authenticate(username, password); } else { ctx = open(); } try { final LdapQuery.Result m = findAccount(ctx, username); who.setDisplayName(apply(accountFullName, m)); who.setUserName(apply(accountSshUserName, m)); if (accountEmailAddress != null) { who.setEmailAddress(apply(accountEmailAddress, m)); } else if (emailExpander.canExpand(username)) { who.setEmailAddress(emailExpander.expand(username)); } membershipCache.put(username, queryForGroups(ctx, username, m)); return who; } finally { try { ctx.close(); } catch (NamingException e) { log.warn("Cannot close LDAP query handle", e); } } } catch (NamingException e) { log.error("Cannot query LDAP to autenticate user", e); throw new AccountException("Cannot query LDAP for account", e); } }</code><technical_language>initialize this null. Leave unset. need ensure null time reach try finally clause close it, assumes is null</technical_language>

Target:
public AuthRequest authenticate(final AuthRequest who) throws AccountException { try { DirContext ctx; AuthType authType = authConfig.getAuthType(); String username = who.getLocalUser(); String password = who.getPassword(); if (this.username != null) { if (authType == AuthType.LDAP) { authenticate(username, password).close(); } ctx = open(); } else if (authType == AuthType.LDAP) { ctx = authenticate(username, password); } else { ctx = open(); } try { final LdapQuery.Result m = findAccount(ctx, username); who.setDisplayName(apply(accountFullName, m)); who.setUserName(apply(accountSshUserName, m)); if (accountEmailAddress != null) { who.setEmailAddress(apply(accountEmailAddress, m)); } else if (emailExpander.canExpand(username)) { who.setEmailAddress(emailExpander.expand(username)); } membershipCache.put(username, queryForGroups(ctx, username, m)); return who; } finally { try { ctx.close(); } catch (NamingException e) { log.warn("Cannot close LDAP query handle", e); } } } catch (NamingException e) { log.error("Cannot query LDAP to autenticate user", e); throw new AccountException("Cannot query LDAP for account", e); } }
Source:
<code>protected Injector setupInjector() { return Initialization.makeInjectorWithModules( GuiceInjectors.makeStartupInjector(), ImmutableList.<Module>of( new Module() { @Override public void configure(Binder binder) { JsonConfigProvider.bindInstance( binder, Key.get(DruidNode.class, Self.class), new DruidNode("test", "localhost", null, null, new ServerConfig()) ); binder.bind(JettyServerInitializer.class).to(ProxyJettyServerInit.class).in(LazySingleton.class); <START> binder.bind(AuthorizationManager.class).toInstance(new AuthorizationManager() <END> { @Override public Access authorize( String identity, Resource resource, Action action ) { return new Access(true); } }); Jerseys.addResource(binder, SlowResource.class); Jerseys.addResource(binder, ExceptionResource.class); Jerseys.addResource(binder, DefaultResource.class); LifecycleModule.register(binder, Server.class); } } ) ); }</code><technical_language>This replaced NoopAuthorizationManager</technical_language>

Target:
protected Injector setupInjector() { return Initialization.makeInjectorWithModules( GuiceInjectors.makeStartupInjector(), ImmutableList.<Module>of( new Module() { @Override public void configure(Binder binder) { JsonConfigProvider.bindInstance( binder, Key.get(DruidNode.class, Self.class), new DruidNode("test", "localhost", null, null, new ServerConfig()) ); binder.bind(JettyServerInitializer.class).to(ProxyJettyServerInit.class).in(LazySingleton.class); binder.bind(AuthorizerMapper.class).toInstance( new AuthorizerMapper(null) { @Override public Authorizer getAuthorizer(String name) { return new AllowAllAuthorizer(); } } ); Jerseys.addResource(binder, SlowResource.class); Jerseys.addResource(binder, ExceptionResource.class); Jerseys.addResource(binder, DefaultResource.class); LifecycleModule.register(binder, Server.class); } } ) ); }
Source:
<code>ByteBuffer decrypt(ByteBuffer toDecrypt, T key) throws GeneralSecurityException; default ByteBuf decrypt(ByteBuf toDecrypt, T key) throws GeneralSecurityException { <START> if (toDecrypt.nioBufferCount() == 1) { <END> return Unpooled.wrappedBuffer(decrypt(toDecrypt.nioBuffer(), key)); } else { ByteBuf temp = ByteBufAllocator.DEFAULT.heapBuffer(toDecrypt.readableBytes()); try { temp.writeBytes(toDecrypt); return Unpooled.wrappedBuffer(decrypt(temp.nioBuffer(), key)); } finally { temp.release(); } } }</code><technical_language>unit tests cover default methods</technical_language>

Target:
ByteBuffer decrypt(ByteBuffer toDecrypt, T key) throws GeneralSecurityException; default ByteBuf decrypt(ByteBuf toDecrypt, T key) throws GeneralSecurityException { return Utils.applyByteBufferFunctionToByteBuf(toDecrypt, (buffer) -> { return decrypt(buffer, key); }); }
Source:
<code>public synchronized void store(AuthorizationConfigDto configuration) throws IOException { Map<SystemRole, String> changed = getChangedRestrictedRoles(configuration); if (changed.size() > 0) { String message = String.join("; ", changed.values()); <START> throw new RuntimeException(message); <END> } super.store(configuration); }</code><technical_language>throw IOException</technical_language>

Target:
public synchronized void store(AuthorizationConfigDto configuration) throws IOException { Set<SystemRole> changed = getChangedRestrictedRoles(configuration); if (changed.size() > 0) { String changedNames = changed.stream() .map(SystemRole::toString) .collect(Collectors.joining(", ")); String message = String.format("System roles %s cannot be changed.", changedNames); throw new IOException(message); } super.store(configuration); }
Source:
<code>private void number(String type, StringBuilder b, int wholeDigits, int fractions) { int requestedwholeDigits = wholeDigits; while (wholeDigits > 0) { b.append(random.nextInt(10)); wholeDigits--; } if (fractions > 0) { b.append('.'); while (fractions > 0) { b.append(random.nextInt(10)); fractions--; } } if (type.equals("number") && requestedwholeDigits > 1 && (b.charAt(0)) == '0') { <START> b.replace(0, 1, "1"); <END> } }</code><technical_language>replacing leading 0s 1. a random non-zero digit instead</technical_language>

Target:
private void number(String type, StringBuilder b, int wholeDigits, int fractions) { int requestedwholeDigits = wholeDigits; while (wholeDigits > 0) { b.append(random.nextInt(10)); wholeDigits--; } if (fractions > 0) { b.append('.'); while (fractions > 0) { b.append(random.nextInt(10)); fractions--; } } if (type.equals("number") && requestedwholeDigits > 1 && (b.charAt(0)) == '0') { b.replace(0, 1, new Integer((random.nextInt(9) + 1)).toString()); } }
Source:
<code>private boolean switchSource() throws IOException { if (!source.isCurrent()) { source = source.getNewDataSource(); try { if (iter != null) { iter.close(); } } catch (Exception e) { <START> throw new IOException(e); <END> } iter = source.iterator(); return true; } return false; }</code><technical_language>This is a private method. Do need wrap exceptions here, handle in caller? converting IOExceptions here, converted RuntimeExceptions later</technical_language>

Target:
private boolean switchSource() throws IOException { if (!source.isCurrent()) { source = source.getNewDataSource(); iter = source.iterator(); return true; } return false; }
Source:
<code>public GlusterHookContentInfoReturnForXmlRpc(Map<String, Object> innerMap) { super(innerMap); Map<String, Object> content = (Map<String, Object>) innerMap.get(CONTENT); if (content != null) { hookContent = (String) content.get(0); <START> } <END> }</code><technical_language>I is in sync vdsm verb's output structure <LINK_0></technical_language>

Target:
public GlusterHookContentInfoReturnForXmlRpc(Map<String, Object> innerMap) { super(innerMap); String content = (String) innerMap.get(CONTENT); if (content != null) { hookContent = StringUtils.newStringUtf8(Base64.decodeBase64(content)); } }
Source:
<code>private int getCheckTimeoutInSeconds(ConfigurationGenerator cg) { int checkTimeout = DEFAULT_CHECK_TIMEOUT_IN_SECONDS; try { <START> checkTimeout = Integer.parseInt(cg.getUserConfig().getProperty(PARAM_MONGODB_CHECK_TIMEOUT, DEFAULT_CHECK_TIMEOUT_IN_SECONDS.toString())); <END> } catch (NumberFormatException e) { log.warn(String.format("Invalid format for %s parameter, using default value instead", PARAM_MONGODB_CHECK_TIMEOUT), e); } return checkTimeout; }</code><technical_language>DEFAULT_CHECK_TIMEOUT_IN_SECONDS.toString() -> String.valueOf(DEFAULT_CHECK_TIMEOUT_IN_SECONDS) int</technical_language>

Target:
private int getCheckTimeoutInSeconds(ConfigurationGenerator cg) { int checkTimeout = DEFAULT_CHECK_TIMEOUT_IN_SECONDS; try { checkTimeout = Integer.parseInt(cg.getUserConfig().getProperty(PARAM_MONGODB_CHECK_TIMEOUT, String.valueOf(DEFAULT_CHECK_TIMEOUT_IN_SECONDS))); } catch (NumberFormatException e) { log.warn(String.format("Invalid format for %s parameter, using default value instead", PARAM_MONGODB_CHECK_TIMEOUT), e); } return checkTimeout; }
Source:
<code>private boolean isAliasedClassOrInterface(TypedVar symbol, JSType type) { <START> return !((type.isConstructor() || type.isInterface()) <END> && symbol.getName().equals(type.getDisplayName())); }</code><technical_language>consider extracting local variables, this is hard read, early exit</technical_language>

Target:
private boolean isAliasedClassOrInterface(TypedVar symbol, JSType type) { if (!type.isConstructor() && !type.isInterface()) return false; return !symbol.getName().equals(type.getDisplayName()); }
Source:
<code>public TraceCompletionInformation processOneToOne(String tenantId, Trace item) throws RetryAttemptException { if (!item.getNodes().isEmpty()) { Node n = item.getNodes().get(0); if (n.getClass() != Consumer.class || n.getCorrelationIds().isEmpty()) { TraceCompletionInformation ci = new TraceCompletionInformation(); CompletionTime ct = new CompletionTime(); ct.setId(item.getId()); ct.setUri(n.getUri()); ct.setOperation(n.getOperation()); if (n.getClass() == Consumer.class) { ct.setEndpointType(((Consumer) n).getEndpointType()); } ct.setBusinessTransaction(item.getBusinessTransaction()); ct.setDuration(item.calculateDuration()); ct.setPrincipal(item.getPrincipal()); ct.setFault(n.getFault()); ct.setProperties(item.allProperties()); ct.setTimestamp(item.getStartTime()); ci.setCompletionTime(ct); <START> TraceCompletionInformationUtil.initialiseLinks(ci, item.getNodes().get(0).getBaseTime(), <END> 0, n); if (log.isLoggable(Level.FINEST)) { log.finest("Creating initial completion time information = " + ci); } return ci; } } if (log.isLoggable(Level.FINEST)) { log.finest("No completion information initiated for trace fragment = " + item); } return null; }</code><technical_language>written as: TraceCompletionInformationUtil.initialiseLinks(ci, n.getBaseTime(), 0, n) I signature of TraceCompletionInformationUtil.initialiseLinks refactored TraceCompletionInformation ci, long baseDuration, Node n)</technical_language>

Target:
public TraceCompletionInformation processOneToOne(String tenantId, Trace item) throws RetryAttemptException { if (!item.getNodes().isEmpty()) { Node n = item.getNodes().get(0); if (n.getClass() != Consumer.class || n.getCorrelationIds().isEmpty()) { TraceCompletionInformation ci = new TraceCompletionInformation(); CompletionTime ct = new CompletionTime(); ct.setId(item.getId()); ct.setUri(n.getUri()); ct.setOperation(n.getOperation()); if (n.getClass() == Consumer.class) { ct.setEndpointType(((Consumer) n).getEndpointType()); } ct.setBusinessTransaction(item.getBusinessTransaction()); ct.setDuration(item.calculateDuration()); ct.setPrincipal(item.getPrincipal()); ct.setFault(n.getFault()); ct.setProperties(item.allProperties()); ct.setTimestamp(item.getStartTime()); ci.setCompletionTime(ct); TraceCompletionInformationUtil.initialiseLinks(ci, n.getBaseTime(), n); if (log.isLoggable(Level.FINEST)) { log.finest("Creating initial completion time information = " + ci); } return ci; } } if (log.isLoggable(Level.FINEST)) { log.finest("No completion information initiated for trace fragment = " + item); } return null; }
Source:
<code>void appendApproval(ApprovalCategory category, short value, Account user) { <START> sb.append(category.getName()); <END> sb.append(value < 0 ? "-" : "+").append(value).append(": "); appendUserData(user); sb.append("\n"); }</code><technical_language>Replace spaces '-': sb.append(category.getName().replace(' ', '-')); I need finish git-store branch get work rebased top. added a getLabel() method ApprovalCategory supplies replacement, making code just: sb.append(category.getLabel());</technical_language>

Target:
void appendApproval(ApprovalCategory category, short value, Account user) { sb.append(category.getName().replace(' ', '-')); sb.append(value < 0 ? "-" : "+").append(Math.abs(value)).append(": "); appendUserData(user); sb.append("\n"); }
Source:
<code>private boolean networkIpAddressUsedByBrickChanged(VdsNetworkInterface iface, Network network) { if (iface.getBootProtocol() == NetworkBootProtocol.STATIC_IP) { List<GlusterBrickEntity> bricks = getDbFacade().getGlusterBrickDao() .getAllByClusterAndNetworkId(vds.getVdsGroupId(), network.getId()); if (bricks.isEmpty()) { return false; } VdsNetworkInterface existingIface = getExistingIfaceByNetwork(iface.getNetworkName()); if (existingIface != null) { String oldAddress = existingIface.getAddress(); <START> return !StringUtils.isEmpty(oldAddress) && !StringUtils.equals(oldAddress, iface.getAddress()); <END> } } return false; }</code><technical_language>please StringUtils.isNotEmpty</technical_language>

Target:
private boolean networkIpAddressUsedByBrickChanged(VdsNetworkInterface iface, Network network) { if (iface.getBootProtocol() == NetworkBootProtocol.STATIC_IP) { List<GlusterBrickEntity> bricks = getDbFacade().getGlusterBrickDao() .getAllByClusterAndNetworkId(vds.getVdsGroupId(), network.getId()); if (bricks.isEmpty()) { return false; } VdsNetworkInterface existingIface = getExistingIfaceByNetwork(iface.getNetworkName()); if (existingIface != null) { String oldAddress = existingIface.getAddress(); return StringUtils.isNotEmpty(oldAddress) && !StringUtils.equals(oldAddress, iface.getAddress()); } } return false; }
Source:
<code>public Long findModelIdByName(String modelName, int numFields) { SharedPreferences modelsDb = mContext.getSharedPreferences(MODEL_REF_DB, Context.MODE_PRIVATE); long prefsModelId = modelsDb.getLong(modelName, -1L); Map<Long, String> modelList = getModelList(numFields); long bestModelIdSoFar = -1L; for (Map.Entry<Long, String> entry : modelList.entrySet()) { if (entry.getValue().equals(modelName)) { long id = entry.getKey(); if (id == prefsModelId) { <START> return id; END> } if (bestModelIdSoFar == -1L) { bestModelIdSoFar = id; } } } if (bestModelIdSoFar != -1L) { return bestModelIdSoFar; } if (prefsModelId != -1L && getModelName(prefsModelId) != null && getFieldList(prefsModelId).length >= numFields) { return prefsModelId; } return null; }</code><technical_language>This is broken. check number of fields reduced numFields</technical_language>

Target:
public Long findModelIdByName(String modelName, int numFields) { SharedPreferences modelsDb = mContext.getSharedPreferences(MODEL_REF_DB, Context.MODE_PRIVATE); long prefsModelId = modelsDb.getLong(modelName, -1L); if (prefsModelId != -1L && getModelName(prefsModelId) != null && getFieldList(prefsModelId).length >= numFields) { return prefsModelId; } Map<Long, String> modelList = getModelList(numFields); for (Map.Entry<Long, String> entry : modelList.entrySet()) { if (entry.getValue().equals(modelName)) { return entry.getKey(); } } return null; }
Source:
<code>static void ensureHasTypes(Biome biome) { if (!hasAnyType(biome)) { <START> FMLLog.warning("No types have been added to Biome %s, types will be assigned on a best-effort guess."); <END> makeBestGuess(biome); } }</code><technical_language>Alright done test this show a screenshot in-game haha. This line crashes</technical_language>

Target:
static void ensureHasTypes(Biome biome) { if (!hasAnyType(biome)) { FMLLog.warning("No types have been added to Biome %s, types will be assigned on a best-effort guess.", biome.getRegistryName()); makeBestGuess(biome); } }
Source:
<code>public void compact(Integer key, String value, byte[] data, int offset, int len) { Assert.assertEquals(4 + value.length(), len); copyIntToArray(key, data, offset); byte[] src = value.getBytes(); Assert.assertEquals(value.length(), src.length); <START> System.arraycopy(src, 0, data, offset + 4, src.length); <END> }</code><technical_language>is more assertion in this sub-test. Is arraycopy needed</technical_language>

Target:
public void compact(Integer key, String value, byte[] data, int offset, int len) { Assert.assertEquals(4 + value.length(), len); copyIntToArray(key, data, offset); byte[] src = value.getBytes(); Assert.assertEquals(value.length(), src.length); }
Source:
<code>protected List<String> transformM2toM1( final String path, final List<String> extraFolders ) { final Gav gav = getM2GavCalculator().pathToGav( path ); if ( gav == null ) { return null; } final ArrayList<String> exts = new ArrayList<String>(); exts.add( gav.getExtension() + "s" ); if ( extraFolders != null && !extraFolders.isEmpty() ) { exts.addAll( extraFolders ); } <START> final ArrayList<String> result = new ArrayList<String>( exts.size() ); <END> for ( String ext : exts ) { StringBuilder sb = new StringBuilder( RepositoryItemUid.PATH_ROOT ); sb.append( gav.getGroupId() ); sb.append( RepositoryItemUid.PATH_SEPARATOR ); sb.append( ext ); sb.append( RepositoryItemUid.PATH_SEPARATOR ); sb.append( gav.getName() ); result.add( sb.toString() ); } return result; }</code><technical_language>minor: reason ArrayList is specifically here? related guava Lists.\* helpers used? is direction rest of codebase is heading, this is different</technical_language>

Target:
protected List<String> transformM2toM1( final String path, final List<String> extraFolders ) { final Gav gav = getM2GavCalculator().pathToGav( path ); if ( gav == null ) { return null; } final List<String> exts = Lists.newArrayList(); exts.add( gav.getExtension() + "s" ); if ( extraFolders != null && !extraFolders.isEmpty() ) { exts.addAll( extraFolders ); } final List<String> result = Lists.newArrayListWithCapacity( exts.size() ); for ( String ext : exts ) { StringBuilder sb = new StringBuilder( RepositoryItemUid.PATH_ROOT ); sb.append( gav.getGroupId() ); sb.append( RepositoryItemUid.PATH_SEPARATOR ); sb.append( ext ); sb.append( RepositoryItemUid.PATH_SEPARATOR ); sb.append( gav.getName() ); result.add( sb.toString() ); } return result; }
Source:
<code>public IStatus validateDrop(Object target, int operation, TransferData transferType) { if (operation != DND.DROP_MOVE) { return Status.CANCEL_STATUS; } IWorkingSet targetWorkingSet = null; if (target instanceof IAdaptable) { targetWorkingSet = (IWorkingSet) ((IAdaptable)target).getAdapter(IWorkingSet.class); } if (targetWorkingSet == null) { return Status.CANCEL_STATUS; } <START> Set<IProject> toMove = new HashSet<IProject>(); <END> if (LocalSelectionTransfer.getTransfer().isSupportedType(transferType)) { ISelection sel = LocalSelectionTransfer.getTransfer().getSelection(); if (!sel.isEmpty() && sel instanceof IStructuredSelection) { for (Object item : ((IStructuredSelection)sel).toArray()) { if (item instanceof IAdaptable) { IProject project = null; if (item instanceof IAdaptable) { project = (IProject) ((IAdaptable)item).getAdapter(IProject.class); } if (project != null && !workingSetContains(targetWorkingSet, project)) { toMove.add(project); } } } } } if (toMove.isEmpty()) { return Status.CANCEL_STATUS; } return Status.OK_STATUS; }</code><technical_language>want a yes/no, point accumulating objects</technical_language>

Target:
public IStatus validateDrop(Object target, int operation, TransferData transferType) { if (operation != DND.DROP_MOVE) { return Status.CANCEL_STATUS; } IWorkingSet targetWorkingSet = null; if (target instanceof IAdaptable) { targetWorkingSet = ((IAdaptable) target).getAdapter(IWorkingSet.class); } if (targetWorkingSet == null) { return Status.CANCEL_STATUS; } if (!LocalSelectionTransfer.getTransfer().isSupportedType(transferType)) { return Status.CANCEL_STATUS; } ISelection sel = LocalSelectionTransfer.getTransfer().getSelection(); if (!sel.isEmpty() && sel instanceof IStructuredSelection) { for (Object item : ((IStructuredSelection) sel).toArray()) { if (item instanceof IAdaptable) { IProject project = ((IAdaptable) item).getAdapter(IProject.class); if (project != null && !workingSetContains(targetWorkingSet, project)) { return Status.OK_STATUS; } } } } return Status.CANCEL_STATUS; }