auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testMissingValueReplacement() { String regex = "(a\\w*)"; ExtractionFn extractionFn = new RegexDimExtractionFn(regex, true, "foobar", false); Set<String> extracted = Sets.newHashSet(); for (String testString : testStrings) { extracted.add(extractionFn.apply(testString)); } Assert.assertEquals(4, extracted.size()); Assert.assertTrue(extracted.contains("apple")); Assert.assertTrue(extracted.contains("awesome")); Assert.assertTrue(extracted.contains("asylum")); Assert.assertTrue(extracted.contains("foobar")); byte[] cacheKey = extractionFn.getCacheKey(); Assert.assertEquals(17, cacheKey.length); ExtractionFn nullExtractionFn = new RegexDimExtractionFn(regex, true, null, false); Set<String> extracted2 = Sets.newHashSet(); for (String testString : testStrings) { extracted2.add(nullExtractionFn.apply(testString)); } Assert.assertEquals(4, extracted2.size()); Assert.assertTrue(extracted2.contains("apple")); Assert.assertTrue(extracted2.contains("awesome")); Assert.assertTrue(extracted2.contains("asylum")); Assert.assertTrue(extracted2.contains(null)); cacheKey = nullExtractionFn.getCacheKey(); Assert.assertEquals(11, cacheKey.length); }

Target:
public void testMissingValueReplacement() { String regex = "(a\\w*)"; ExtractionFn extractionFn = new RegexDimExtractionFn(regex, true, "foobar"); Set<String> extracted = Sets.newLinkedHashSet(); for (String testString : testStrings) { extracted.add(extractionFn.apply(testString)); } Set<String> expected = Sets.newLinkedHashSet(ImmutableList.of("apple", "awesome", "asylum", "foobar")); Assert.assertEquals(expected, extracted); byte[] cacheKey = extractionFn.getCacheKey(); byte[] expectedCacheKey = new byte[]{ 0x01, 0x28, 0x61, 0x5C, 0x77, 0x2A, 0x29, (byte) 0xFF, 0x66, 0x6F, 0x6F, 0x62, 0x61, 0x72, (byte) 0xFF, 0x01 }; Assert.assertArrayEquals(expectedCacheKey, cacheKey); ExtractionFn nullExtractionFn = new RegexDimExtractionFn(regex, true, null); Set<String> extracted2 = Sets.newLinkedHashSet(); for (String testString : testStrings) { extracted2.add(nullExtractionFn.apply(testString)); } Set<String> expected2 = Sets.newLinkedHashSet(ImmutableList.of("apple", "awesome", "asylum")); expected2.add(null); Assert.assertEquals(expected2, extracted2); cacheKey = nullExtractionFn.getCacheKey(); expectedCacheKey = new byte[]{0x01, 0x28, 0x61, 0x5C, 0x77, 0x2A, 0x29, (byte) 0xFF, (byte) 0xFF, 0x01}; Assert.assertArrayEquals(expectedCacheKey, cacheKey); }
Source:
public boolean next() { try { final JSONArray resultsArray = _resultJSONObject.getJSONArray("results"); if (resultsArray.length() > 0) { final JSONObject results = resultsArray.getJSONObject(0); final JSONArray data = results.getJSONArray("data"); if (_currentRowIndex < data.length()) { final JSONObject row = data.getJSONObject(_currentRowIndex); final JSONArray jsonValues = row.getJSONArray("row"); final Object[] objectValues = new Object[jsonValues.length()]; for (int i = 0; i < jsonValues.length(); i++) { objectValues[i] = jsonValues.get(i); } _row = new DefaultRow(new SimpleDataSetHeader(getSelectItems()), objectValues); _currentRowIndex++; return true; } } else { final JSONArray errorArray = _resultJSONObject.getJSONArray("errors"); final JSONObject error = errorArray.getJSONObject(0); throw new IllegalStateException(error.toString()); } } catch (final JSONException e) { throw new IllegalStateException(e); } return false; }

Target:
public boolean next() { try { final JSONArray resultsArray = _resultJSONObject.getJSONArray(NEO4J_KEY_RESPONSE_RESULTS); if (resultsArray.length() > 0) { final JSONObject results = resultsArray.getJSONObject(0); final JSONArray data = results.getJSONArray(NEO4J_KEY_DATA); if (_currentRowIndex < data.length()) { final JSONObject row = data.getJSONObject(_currentRowIndex); final JSONArray jsonValues = row.getJSONArray(NEO4J_KEY_RESPONSE_ROW); final Object[] objectValues = new Object[jsonValues.length()]; for (int i = 0; i < jsonValues.length(); i++) { final Object value = jsonValues.get(i); if (value instanceof JSONArray) { objectValues[i] = convertJSONArrayToList((JSONArray) value); } else { objectValues[i] = value; } } _row = new DefaultRow(new SimpleDataSetHeader(getSelectItems()), objectValues); _currentRowIndex++; return true; } } else { final JSONArray errorArray = _resultJSONObject.getJSONArray("errors"); final JSONObject error = errorArray.getJSONObject(0); throw new IllegalStateException(error.toString()); } } catch (final JSONException e) { throw new IllegalStateException(e); } return false; }
Source:
public ResponseEntity publish(@RepositoryMapping Repository repository, @PathVariable(name = "name") String name, HttpServletRequest request) throws Exception { if (nameContainsRevision(name)) { return ResponseEntity.status(HttpStatus.OK) .body(""); } final String storageId = repository.getStorage().getId(); final String repositoryId = repository.getId(); logger.info("npm publish request for {}/{}/{}", storageId, repositoryId, name); Pair<PackageVersion, Path> packageEntry; try { packageEntry = extractPackage(name, request.getInputStream()); } catch (IllegalArgumentException e) { logger.error("Failed to extract npm package data", e); return ResponseEntity.badRequest().build(); } PackageVersion packageJson = packageEntry.getValue0(); Path packageTgz = packageEntry.getValue1(); NpmArtifactCoordinates coordinates = NpmArtifactCoordinates.of(name, packageJson.getVersion()); storeNpmPackage(repository, coordinates, packageJson, packageTgz); return ResponseEntity.ok(""); }

Target:
public ResponseEntity publish(@RepositoryMapping Repository repository, @PathVariable(name = "name") String name, HttpServletRequest request) throws Exception { if (nameContainsRevision(name)) { return ResponseEntity.status(HttpStatus.OK).build(); } final String storageId = repository.getStorage().getId(); final String repositoryId = repository.getId(); logger.info("npm publish request for {}/{}/{}", storageId, repositoryId, name); Pair<PackageVersion, Path> packageEntry; try { packageEntry = extractPackage(name, request.getInputStream()); } catch (IllegalArgumentException e) { logger.error("Failed to extract npm package data", e); return ResponseEntity.badRequest().build(); } PackageVersion packageJson = packageEntry.getValue0(); Path packageTgz = packageEntry.getValue1(); NpmArtifactCoordinates coordinates = NpmArtifactCoordinates.of(name, packageJson.getVersion()); storeNpmPackage(repository, coordinates, packageJson, packageTgz); return ResponseEntity.ok(""); }
Source:
public synchronized List<Datastream> getAllDatastreams(boolean flushCache) { if (flushCache || _datastreams.isEmpty()) { _datastreamNames = fetchAllDatastreamNamesFromZk(); } return _datastreamNames.stream().map(x -> this.getDatastream(x, flushCache)).collect(Collectors.toList()); }

Target:
public synchronized List<Datastream> getAllDatastreams(boolean flushCache) { if (flushCache) { _datastreamNames = fetchAllDatastreamNamesFromZk(); } return _datastreamNames.stream() .map(x -> this.getDatastream(x, flushCache)) .filter(Objects::nonNull) .collect(Collectors.toList()); }
Source:
private ByteArrayInputStream uploadPackV2(String... inputLines) throws Exception { ByteArrayOutputStream send = new ByteArrayOutputStream(); PacketLineOut pckOut = new PacketLineOut(send); for (String line : inputLines) { if (line == PacketLineIn.END) { pckOut.end(); } else if (line == PacketLineIn.DELIM) { pckOut.writeDelim(); } else { pckOut.writeString(line); } } UploadPack up = new UploadPack(server); up.setUseProtocolV2(true); ByteArrayOutputStream recv = new ByteArrayOutputStream(); up.upload(new ByteArrayInputStream(send.toByteArray()), recv, null); ByteArrayInputStream recvStream = new ByteArrayInputStream(recv.toByteArray()); PacketLineIn pckIn = new PacketLineIn(recvStream); assertThat(pckIn.readString(), is("version 2")); assertThat(pckIn.readString(), is("ls-refs")); assertThat(pckIn.readString(), is("fetch")); assertTrue(pckIn.readString() == PacketLineIn.END); return recvStream; }

Target:
private ByteArrayInputStream uploadPackV2(String... inputLines) throws Exception { ByteArrayOutputStream send = new ByteArrayOutputStream(); PacketLineOut pckOut = new PacketLineOut(send); for (String line : inputLines) { if (line == PacketLineIn.END) { pckOut.end(); } else if (line == PacketLineIn.DELIM) { pckOut.writeDelim(); } else { pckOut.writeString(line); } } UploadPack up = new UploadPack(server); up.setUseProtocolV2(true); ByteArrayOutputStream recv = new ByteArrayOutputStream(); up.upload(new ByteArrayInputStream(send.toByteArray()), recv, null); ByteArrayInputStream recvStream = new ByteArrayInputStream(recv.toByteArray()); PacketLineIn pckIn = new PacketLineIn(recvStream); assertThat(pckIn.readString(), is("version 2")); assertThat( Arrays.asList(pckIn.readString(), pckIn.readString()), hasItems("ls-refs", "fetch")); assertTrue(pckIn.readString() == PacketLineIn.END); return recvStream; }
Source:
public void testGetConnectableFileStorageConnectionsByStorageType() { List<StorageServerConnections> conns = dao.getConnectableStorageConnectionsByStorageType(FixturesTool.STORAGE_POOL_NFS_2, StorageType.NFS); assertNotNull(conns); assertEquals(1, conns.size()); for (StorageServerConnections conn : conns) { assertTrue(conn.getstorage_type() == StorageType.NFS); } }

Target:
public void testGetConnectableFileStorageConnectionsByStorageType() { List<StorageServerConnections> conns = dao.getConnectableStorageConnectionsByStorageType(FixturesTool.STORAGE_POOL_NFS_2, StorageType.NFS); assertNotNull(conns); assertEquals(1, conns.size()); for (StorageServerConnections conn : conns) { assertEquals(StorageType.NFS, conn.getstorage_type()); } }
Source:
protected void applyUnchangeableFeature() { getVElement().setEnabled(false); }

Target:
protected void applyUnchangeableFeature() { getVElement().setReadonly(true); }
Source:
public boolean isProxyCommand() { String commandName = message.split(" ",2)[0].substring( 1 ); boolean checkDisabled = getSender() instanceof ProxiedPlayer; return ProxyServer.getInstance().getPluginManager().isRunnableCommand( commandName, checkDisabled ); }

Target:
public boolean isProxyCommand() { if ( !isCommand() ) { return false; } int index = message.indexOf( " " ); String commandName; if ( index == -1 ) { commandName = message.substring( 1 ); } else { commandName = message.substring( 1, index ); } CommandSender sender; if (getSender() instanceof CommandSender) { sender = (CommandSender) getSender(); } else { sender = null; } return ProxyServer.getInstance().getPluginManager().isRunnableCommand( commandName, sender ); }
Source:
public void define(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION_GET_BY_PROJECT) .setInternal(true) .setSince("6.1") .setDescription("Get the quality gate of a project.") .setResponseExample(getClass().getResource("get_by_project-example.json")) .setHandler(this) .setChangelog( new Change("6.6", "The parameter 'projectId' has been removed"), new Change("6.6", "The parameter 'projectKey' has been renamed to 'project'"), new Change("6.6", "This webservice is now part of the public API") ); action.createParam(PARAM_PROJECT) .setDescription("Project key") .setExampleValue(KEY_PROJECT_EXAMPLE_001) .setRequired(true); }

Target:
public void define(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION_GET_BY_PROJECT) .setInternal(false) .setSince("6.1") .setDescription("Get the quality gate of a project.<br />" + "Requires one of the following permissions:" + "<ul>" + "<li>'Administer System'</li>" + "<li>'Administer' rights on the specified project</li>" + "<li>'Browse' on the specified project</li>" + "</ul>") .setResponseExample(getClass().getResource("get_by_project-example.json")) .setHandler(this) .setChangelog( new Change("6.6", "The parameter 'projectId' has been removed"), new Change("6.6", "The parameter 'projectKey' has been renamed to 'project'"), new Change("6.6", "This webservice is now part of the public API") ); action.createParam(PARAM_PROJECT) .setDescription("Project key") .setExampleValue(KEY_PROJECT_EXAMPLE_001) .setRequired(true); }
Source:
protected void updateDetailsAvailability() { super.updateDetailsAvailability(); Cluster cluster = getSelectedItem(); getClusterVmListModel().setIsAvailable(cluster != null && cluster.supportsVirtService()); getClusterServiceModel().setIsAvailable(cluster != null && cluster.supportsGlusterService()); getClusterGlusterHookListModel().setIsAvailable(cluster != null && cluster.supportsGlusterService()); getAffinityGroupListModel().setIsAvailable(cluster != null && cluster.supportsVirtService()); getCpuProfileListModel().setIsAvailable(cluster != null && cluster.supportsVirtService()); getAffinityLabelListModel().setIsAvailable(cluster != null && cluster.supportsVirtService()); }

Target:
protected void updateDetailsAvailability() { super.updateDetailsAvailability(); Cluster cluster = getSelectedItem(); boolean clusterSupportsVirtService = cluster != null && cluster.supportsVirtService(); getClusterVmListModel().setIsAvailable(clusterSupportsVirtService); getClusterServiceModel().setIsAvailable(clusterSupportsVirtService); getClusterGlusterHookListModel().setIsAvailable(clusterSupportsVirtService); getAffinityGroupListModel().setIsAvailable(clusterSupportsVirtService); getCpuProfileListModel().setIsAvailable(clusterSupportsVirtService); getAffinityLabelListModel().setIsAvailable(clusterSupportsVirtService); }
Source:
public boolean canMoveToMaintenance(VDS vds) { if (!Config.<Boolean>getValue(ConfigValues.MaintenanceVdsIgnoreExternalVms)) { return vds.getVmCount() == 0 && !isAnyVmRunOnVdsInDb(vds.getId()); } List<VM> vms = vmDao.getAllRunningForVds(vds.getId()) .stream() .filter(vm -> !vm.isExternalVm()) .collect(Collectors.toList()); return vms.isEmpty() && !isAnyVmRunOnVdsInDb(vds.getId()); }

Target:
public boolean canMoveToMaintenance(VDS vds) { if (!Config.<Boolean>getValue(ConfigValues.MaintenanceVdsIgnoreExternalVms)) { return vds.getVmCount() == 0 && !isAnyVmRunOnVdsInDb(vds.getId()); } Optional<VM> runningVm = vmDao.getAllRunningForVds(vds.getId()) .stream() .filter(vm -> !vm.isExternalVm()) .findFirst(); return !runningVm.isPresent() && !isAnyVmRunOnVdsInDb(vds.getId()); }
Source:
public void checkQueryIntegrity(Identity identity, String query) { requireNonNull(identity, "extraCredentials is null"); requireNonNull(query, "query is null"); authenticationCheck(() -> systemAccessControl.get().checkQueryIntegrity(identity, query)); }

Target:
public void checkQueryIntegrity(Identity identity, String query) { requireNonNull(identity, "identity is null"); requireNonNull(query, "query is null"); authenticationCheck(() -> systemAccessControl.get().checkQueryIntegrity(identity, query)); }
Source:
public void close() { records.clear(); if (countingInputStream != null) countingInputStream.close(); }

Target:
public void close() { records.clear(); try { if (countingInputStream != null) { countingInputStream.close(); } } catch (final RuntimeIOException e) { } }
Source:
public void showFindInPage() { final PageActivity pageActivity = (PageActivity) getActivity(); final FindInPageActionProvider findInPageActionProvider = new FindInPageActionProvider(pageActivity); pageActivity.startSupportActionMode(new ActionMode.Callback() { @Override public boolean onCreateActionMode(ActionMode mode, Menu menu) { findInPageActionMode = mode; MenuItem menuItem = menu.add(R.string.find_in_page); MenuItemCompat.setActionProvider(menuItem, findInPageActionProvider); return true; } @Override public boolean onPrepareActionMode(ActionMode mode, Menu menu) { return false; } @Override public boolean onActionItemClicked(ActionMode mode, MenuItem item) { return false; } @Override public void onDestroyActionMode(ActionMode mode) { webView.clearMatches(); findInPageActionMode = null; } }); }

Target:
public void showFindInPage() { final PageActivity pageActivity = (PageActivity) getActivity(); final FindInPageActionProvider findInPageActionProvider = new FindInPageActionProvider(pageActivity); pageActivity.startSupportActionMode(new ActionMode.Callback() { @Override public boolean onCreateActionMode(ActionMode mode, Menu menu) { findInPageActionMode = mode; MenuItem menuItem = menu.add(R.string.find_in_page); MenuItemCompat.setActionProvider(menuItem, findInPageActionProvider); return true; } @Override public boolean onPrepareActionMode(ActionMode mode, Menu menu) { return false; } @Override public boolean onActionItemClicked(ActionMode mode, MenuItem item) { return false; } @Override public void onDestroyActionMode(ActionMode mode) { findInPageActionMode = null; webView.clearMatches(); if (!pageActivity.getSupportActionBar().isShowing()) { pageActivity.getSupportActionBar().show(); } Utils.hideSoftKeyboard(pageActivity); } }); }
Source:
public String choose(VolumeChooserEnvironment env, String[] options) throws VolumeChooserException { WeightedRandomCollection<String> weightedOptions = new WeightedRandomCollection<>(); if (options.length < 1) { throw new IllegalStateException("Options was empty! No valid volumes to choose from."); } if (options.length == 1) { return options[0]; } VolumeManager manager = env.getServerContext().getVolumeManager(); for (String option : options) { FileSystem pathFs = manager.getVolumeByPath(new Path(option)).getFileSystem(); try { FsStatus optionStatus = pathFs.getStatus(); double percentFree = ((double) optionStatus.getRemaining() / optionStatus.getCapacity()); weightedOptions.add(percentFree, option); } catch (IOException e) { log.error("Unable to get file system status", e); } } if (weightedOptions.map.size() < 1) { throw new IllegalStateException( "Weighted options was empty!" + " Could indicate an issue getting file system status"); } return weightedOptions.next(); }

Target:
public String choose(VolumeChooserEnvironment env, String[] options) throws VolumeChooserException { options = getPreferredVolumes(env, options); try { return getCache(env).get(Arrays.asList(options)).next(); } catch (ExecutionException e) { throw new IllegalStateException("Execution exception when attempting to cache choice", e); } }
Source:
public Object visitClearCommand(InvocationContext ctx, ClearCommand command) throws Throwable { VisitableCommand cmd = commandsFactory.buildLockControlCommand(ERRORS_KEY_SUFFIX, null, null); invoker.invoke(ctx, cmd); SerializationContext serializationContext = protobufMetadataManager.getSerializationContext(); for (String fileName : serializationContext.getFileDescriptors().keySet()) { serializationContext.unregisterProtoFile(fileName); } return invokeNextInterceptor(ctx, command); }

Target:
public Object visitClearCommand(InvocationContext ctx, ClearCommand command) throws Throwable { VisitableCommand cmd = commandsFactory.buildLockControlCommand(ERRORS_KEY_SUFFIX, null, null); invoker.invoke(ctx, cmd); for (String fileName : serializationContext.getFileDescriptors().keySet()) { serializationContext.unregisterProtoFile(fileName); } return invokeNextInterceptor(ctx, command); }
Source:
public static String getGeometryInvalidReason(org.locationtech.jts.geom.Geometry geometry) { IsValidOp validOp = new IsValidOp(geometry); IsSimpleOp simpleOp = new IsSimpleOp(geometry); try { TopologyValidationError err = validOp.getValidationError(); if (err != null) { return err.getMessage(); } if (!simpleOp.isSimple()) { String errorDescription; String geometryType = geometry.getGeometryType(); switch (GeometryType.getForJtsGeometryType(geometryType)) { case POINT: errorDescription = "Invalid point"; break; case MULTI_POINT: errorDescription = "Repeated point"; break; case LINE_STRING: case MULTI_LINE_STRING: errorDescription = "Self-intersection at or near"; break; default: throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format("Unknown geometry type: %s", geometryType)); } org.locationtech.jts.geom.Coordinate nonSimpleLocation = simpleOp.getNonSimpleLocation(); return format("[%s] %s: (%s %s)", geometryType, errorDescription, nonSimpleLocation.getX(), nonSimpleLocation.getY()); } return null; } catch (UnsupportedOperationException e) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Geometry type not valid", e); } }

Target:
public static String getGeometryInvalidReason(org.locationtech.jts.geom.Geometry geometry) { IsValidOp validOp = new IsValidOp(geometry); IsSimpleOp simpleOp = new IsSimpleOp(geometry); try { TopologyValidationError err = validOp.getValidationError(); if (err != null) { return err.getMessage(); } } catch (UnsupportedOperationException e) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Geometry type not valid", e); } if (!simpleOp.isSimple()) { String errorDescription; String geometryType = geometry.getGeometryType(); switch (GeometryType.getForJtsGeometryType(geometryType)) { case POINT: errorDescription = "Invalid point"; break; case MULTI_POINT: errorDescription = "Repeated point"; break; case LINE_STRING: case MULTI_LINE_STRING: errorDescription = "Self-intersection at or near"; break; case POLYGON: case MULTI_POLYGON: case GEOMETRY_COLLECTION: errorDescription = "Topology exception at or near"; break; default: throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format("Unknown geometry type: %s", geometryType)); } org.locationtech.jts.geom.Coordinate nonSimpleLocation = simpleOp.getNonSimpleLocation(); return format("[%s] %s: (%s %s)", geometryType, errorDescription, nonSimpleLocation.getX(), nonSimpleLocation.getY()); } return null; }
Source:
private Collection <IJaxrsElement> searchJaxrsElements(final IJavaElement element) throws JavaModelException { if (element == null) { return Collections.emptyList(); } try { readWriteLock.readLock().lock(); final List<IJaxrsElement> result = new ArrayList<IJaxrsElement>(); final Term javaElementTerm = new Term(FIELD_JAVA_ELEMENT, Boolean.TRUE.toString()); switch (element.getElementType()) { case IJavaElement.PACKAGE_FRAGMENT_ROOT: final Term packageFragmentRootIdentifier = new Term(FIELD_PACKAGE_FRAGMENT_ROOT_IDENTIFIER, element.getHandleIdentifier()); result.addAll(searchJaxrsElements(IJaxrsElement.class, javaElementTerm, packageFragmentRootIdentifier)); break; case IJavaElement.COMPILATION_UNIT: final Term compilationUnitTerm = new Term(FIELD_COMPILATION_UNIT_IDENTIFIER, element.getHandleIdentifier()); result.addAll(searchJaxrsElements(IJaxrsElement.class, javaElementTerm, compilationUnitTerm)); break; case IJavaElement.TYPE: case IJavaElement.FIELD: case IJavaElement.METHOD: final IJaxrsElement foundElement = this.elements.get(element.getHandleIdentifier()); if (foundElement != null) { result.add(foundElement); } break; } return result; } finally { readWriteLock.readLock().unlock(); } }

Target:
private List<IJaxrsElement> searchJaxrsElements(final IJavaElement element) throws JavaModelException { if (element == null) { return Collections.emptyList(); } try { readWriteLock.readLock().lock(); final List<IJaxrsElement> result = new ArrayList<IJaxrsElement>(); final Term javaElementTerm = new Term(FIELD_JAVA_ELEMENT, Boolean.TRUE.toString()); switch (element.getElementType()) { case IJavaElement.PACKAGE_FRAGMENT_ROOT: final Term packageFragmentRootIdentifier = new Term(FIELD_PACKAGE_FRAGMENT_ROOT_IDENTIFIER, element.getHandleIdentifier()); result.addAll(searchJaxrsElements(javaElementTerm, packageFragmentRootIdentifier)); break; case IJavaElement.COMPILATION_UNIT: final Term compilationUnitTerm = new Term(FIELD_COMPILATION_UNIT_IDENTIFIER, element.getHandleIdentifier()); result.addAll(searchJaxrsElements(javaElementTerm, compilationUnitTerm)); break; case IJavaElement.TYPE: case IJavaElement.FIELD: case IJavaElement.METHOD: final IJaxrsElement foundElement = this.elements.get(element.getHandleIdentifier()); if (foundElement != null) { result.add(foundElement); } break; } return result; } finally { readWriteLock.readLock().unlock(); } }
Source:
public JoinToCorrelateRule(RelBuilderFactory relBuilderFactory) { this(LogicalJoin.class, relBuilderFactory, null, Join::getJoinType); }

Target:
public JoinToCorrelateRule(RelBuilderFactory relBuilderFactory) { this(LogicalJoin.class, relBuilderFactory, null); }
Source:
void reset() { serverEnvironment.reset(); Environment.instance() .register(new Local()); Environment.instance() .setTo(new Local()); Local.enable(); }

Target:
void reset() { serverEnvironment.reset(); Environment.instance() .setTo(Local.class); Local.enable(); }
Source:
void validateMergeHash(@NonNull GHRepository repo) throws IOException { if (!isMerge()) { throw new AbortException("Invalid merge hash for pull request " + ((PullRequestSCMHead)this.getHead()).getNumber() + " : Not a merge head"); } else if (this.mergeHash == null) { throw new AbortException("Invalid merge hash for pull request " + ((PullRequestSCMHead)this.getHead()).getNumber() + " : Unknown merge state " + this.toString()); } else if (this.mergeHash == NOT_MERGEABLE_HASH) { throw new AbortException("Invalid merge hash for pull request " + ((PullRequestSCMHead)this.getHead()).getNumber() + " : Not mergeable " + this.toString()); } else { GHCommit commit = null; try { commit = repo.getCommit(this.mergeHash); } catch (FileNotFoundException e) { throw new AbortException("Invalid merge hash for pull request " + ((PullRequestSCMHead)this.getHead()).getNumber() + " : commit not found (" + this.mergeHash + "). Try close and reopen this PR to reset merge hash."); } catch (IOException e) { throw new AbortException("Invalid merge hash for pull request " + ((PullRequestSCMHead)this.getHead()).getNumber() + " : " + e.toString()); } assert(commit != null); List<String> parents = commit.getParentSHA1s(); if (parents.size() != 2 || !parents.contains(this.getBaseHash()) || !parents.contains(this.getPullHash())) { throw new AbortException("Invalid merge hash for pull request " + ((PullRequestSCMHead)this.getHead()).getNumber() + " : Head and base commits do match merge commit " + this.toString() ); } } }

Target:
void validateMergeHash(@NonNull GHRepository repo) throws IOException { if (!isMerge()) { throw new AbortException("Invalid merge hash for pull request " + ((PullRequestSCMHead)this.getHead()).getNumber() + " : Not a merge head"); } else if (this.mergeHash == null) { throw new AbortException("Invalid merge hash for pull request " + ((PullRequestSCMHead)this.getHead()).getNumber() + " : Unknown merge state " + this.toString()); } else if (this.mergeHash == NOT_MERGEABLE_HASH) { throw new AbortException("Invalid merge hash for pull request " + ((PullRequestSCMHead)this.getHead()).getNumber() + " : Not mergeable " + this.toString()); } else { GHCommit commit = null; try { commit = repo.getCommit(this.mergeHash); } catch (FileNotFoundException e) { throw new AbortException("Invalid merge hash for pull request " + ((PullRequestSCMHead)this.getHead()).getNumber() + " : commit not found (" + this.mergeHash + "). Close and reopen the PR to reset its merge hash."); } catch (IOException e) { throw new AbortException("Invalid merge hash for pull request " + ((PullRequestSCMHead)this.getHead()).getNumber() + " : " + e.toString()); } assert(commit != null); List<String> parents = commit.getParentSHA1s(); if (parents.size() != 2 || !parents.contains(this.getBaseHash()) || !parents.contains(this.getPullHash())) { throw new AbortException("Invalid merge hash for pull request " + ((PullRequestSCMHead)this.getHead()).getNumber() + " : Head and base commits do match merge commit " + this.toString() ); } } }
Source:
protected void doHead(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { final Matcher matcher = URL_PATTERN.matcher(request.getRequestURI()); if (matcher.matches()) { response.setHeader("X-Frame-Options", "ALLOWALL"); final String planKeyString = matcher.group(1); final String buildNumber = matcher.group(2); final String filePath = matcher.group(3); final PlanResultKey planResultKey = getPlanResultKey(planKeyString, parseInt(buildNumber)); ofNullable(resultsSummaryManager.getResultsSummary(planResultKey)).ifPresent(results -> { final AllureBuildResult uploadResult = fromCustomData(results.getCustomBuildData()); if (uploadResult.isSuccess()) { artifactsManager.getArtifactUrl(planKeyString, buildNumber, filePath).ifPresent(file -> { try (final InputStream input = new URL(file).openStream()) { response.setStatus(HttpServletResponse.SC_OK); } catch (IOException e) { response.setStatus(HttpServletResponse.SC_NOT_FOUND); LOGGER.error("Failed to send file of Allure Report ", file); } }); } else { uploadResultIsNotSuccess(response, uploadResult); } }); } else { LOGGER.info("Path does not match pattern", request.getRequestURI()); } }

Target:
protected void doHead(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { getArtifactUrl(request, response).ifPresent(file -> { try(InputStream inputStream = new URL(file).openStream()) { setResponseHeaders(response, file); } catch (IOException e) { response.setStatus(HttpServletResponse.SC_NOT_FOUND); LOGGER.error("Failed to send file of Allure Report ", file); } }); }
Source:
public void validateHashtags(Change change, Set<String> toAdd, Set<String> toRemove) throws ValidationException { try { if (toRemove != null && !toRemove.isEmpty()) { Set<String> intersection = Sets.intersection( hashtagsUtil.getHashtagsInCurrentPSCommitMessage(change), toRemove); if (!intersection.isEmpty()) { throw new ValidationException(String.format( "Need delete [ %s ] from commit message firstly", intersection.toArray())); } } } catch (OrmException | IOException e) { log.error("Can not remove hashtags in commit messages", e); throw new ValidationException( "Can not remove hashtags in commit message", e); } }

Target:
public void validateHashtags(Change change, Set<String> toAdd, Set<String> toRemove) throws HashtagsValidationException { if (change != null && toRemove != null && !toRemove.isEmpty()) { Set<String> cmHashtags = null; try { cmHashtags = hashtagsUtil.getHashtagsInCurrentPSCommitMessage(change); } catch (OrmException | IOException e) { throw new HashtagsValidationException(String.format( "Cannot get hashtags specified in the commit message of Change %s", change.getId().get()), e); } if (cmHashtags != null && !cmHashtags.isEmpty() && !Sets.intersection(cmHashtags, toRemove).isEmpty()) { throw new HashtagsValidationException( "Hashtags specified in the commit message cannot be removed"); } } }
Source:
public void update() throws Exception { Venue venue = new Venue(new VenueGroup("group"), new VenueType("type"), Lists.newArrayList(new VenueNameInformation("info", new Language("en")))); VenueDTO venueDTO = new VenueDTO("group", "type", Lists.newArrayList(new VenueNameInformationDTO("info","en"))); final AccessPoint ap = new AccessPoint(1, "ip", new MacAddress("aa:bb"), "sn", "model", venue); final AccessPointDTO dto = new AccessPointDTO(1, "ip", "aa:bb", "sn", "model", venueDTO); context.checking(new Expectations() {{ oneOf(repository).update(with(matching(ap))); }}); Request request = makeRequestThatContains(dto); Reply<?> reply = service.update(1, request); assertThat(reply, isOk()); }

Target:
public void update() throws Exception { Venue venue = new Venue(new VenueGroup("group"), new VenueType("type"), Lists.newArrayList(new VenueName("info", new Language("en")))); VenueDTO venueDTO = new VenueDTO("group", "type", Lists.newArrayList(new VenueNameDTO("info","en"))); final AccessPoint ap = new AccessPoint(1, "ip", new MacAddress("aa:bb"), "sn", "model", venue); final AccessPointDTO dto = new AccessPointDTO(1, "ip", "aa:bb", "sn", "model", venueDTO); context.checking(new Expectations() {{ oneOf(repository).update(with(matching(ap))); }}); Request request = makeRequestThatContains(dto); Reply<?> reply = service.update(1, request); assertThat(reply, isOk()); }
Source:
public int getPageNumber() { String number = driver.findElement(By.xpath(" return Integer.parseInt(number); }

Target:
public int getPageNumber() { String number = driver.findElement(By.xpath(PAGE_NUMBER)).getText(); return Integer.parseInt(number); }
Source:
public CompressedByteBufferObjectStrategy( ByteOrder order, CompressionStrategy compression, final int sizePer ) { super( order, new BufferConverter<ByteBuffer>() { @Override public ByteBuffer convert(ByteBuffer buf) { return buf; } @Override public int compare(ByteBuffer lhs, ByteBuffer rhs) { return Ordering.natural().nullsFirst().compare(lhs, rhs); } @Override public int sizeOf(int count) { return count; } @Override public ByteBuffer combine(ByteBuffer into, ByteBuffer from) { return into.put(from); } }, compression, sizePer ); }

Target:
public CompressedByteBufferObjectStrategy( ByteOrder order, CompressionStrategy compression, final int sizePer ) { super( order, new BufferConverter<ByteBuffer>() { @Override public ByteBuffer convert(ByteBuffer buf) { return buf; } @Override public int compare(ByteBuffer lhs, ByteBuffer rhs) { return ORDERING.compare(lhs, rhs); } @Override public int sizeOf(int count) { return count; } @Override public ByteBuffer combine(ByteBuffer into, ByteBuffer from) { return into.put(from); } }, compression, sizePer ); }
Source:
public void initialize() { super.initialize(); JavaFxUtil.fixScrollSpeed(scrollPane); modDetailController = uiService.loadFxml("theme/vault/mod/mod_detail.fxml"); Node modDetailRoot = modDetailController.getRoot(); vaultRoot.getChildren().add(modDetailRoot); AnchorPane.setTopAnchor(modDetailRoot, 0d); AnchorPane.setRightAnchor(modDetailRoot, 0d); AnchorPane.setBottomAnchor(modDetailRoot, 0d); AnchorPane.setLeftAnchor(modDetailRoot, 0d); modDetailRoot.setVisible(false); manageModButton = new Button(i18n.get("modVault.manageMods")); manageModButton.getStyleClass().add("button-raised"); manageModButton.setOnAction((event -> manageMods())); searchBox.getChildren().add(manageModButton); eventBus.register(this); searchController.setRootType(com.faforever.client.api.dto.Mod.class); searchController.setSearchableProperties(SearchablePropertyMappings.MOD_PROPERTY_MAPPING); searchController.setSortConfig(preferencesService.getPreferences().getVaultPrefs().modVaultConfigProperty()); searchController.setOnlyShowLastYearCheckBoxVisible(false, false); modShowRoomController = uiService.loadFxml("theme/vault/mod/mod_showroom.fxml"); showRoomGroup = modShowRoomController.getRoot(); showRoomGroup.managedProperty().bind(showRoomGroup.visibleProperty()); modShowRoomController.moreHighestRatedButton.setOnAction((event -> { searchType = SearchType.HIGHEST_RATED; onFirstPageOpened(null); })); modShowRoomController.moreHighestRatedUiButton.setOnAction((event -> { searchType = SearchType.HIGHEST_RATED_UI; onFirstPageOpened(null); })); modShowRoomController.moreNewestButton.setOnAction((event -> { searchType = SearchType.NEWEST; onFirstPageOpened(null); })); contentPane.getChildren().add(showRoomGroup); }

Target:
public void initialize() { super.initialize(); JavaFxUtil.fixScrollSpeed(scrollPane); eventBus.register(this); searchController.setRootType(com.faforever.client.api.dto.Mod.class); searchController.setSearchableProperties(SearchablePropertyMappings.MOD_PROPERTY_MAPPING); searchController.setSortConfig(preferencesService.getPreferences().getVaultPrefs().modVaultConfigProperty()); searchController.setOnlyShowLastYearCheckBoxVisible(false, false); manageModsButton.setVisible(true); manageModsButton.setOnAction(event -> manageMods()); }
Source:
public int isApplicable(VElement vElement, ViewModelContext viewModelContext) { if (!VControl.class.isInstance(vElement)) { return NOT_APPLICABLE; } final VControl control = (VControl) vElement; final IObservableValue observableValue = Activator.getDefault().getEMFFormsDatabinding() .getObservableValue(control.getDomainModelReference(), viewModelContext.getDomainModel()); final EStructuralFeature feature = (EStructuralFeature) observableValue.getValueType(); final EObject eObject = (EObject) ((IObserving) observableValue).getObserved(); if (VKeyAttributeDomainModelReference.class.isInstance(eObject) && VKeyattributedmrPackage.eINSTANCE.getKeyAttributeDomainModelReference_KeyValue() == feature) { return 6; } return NOT_APPLICABLE; }

Target:
public int isApplicable(VElement vElement, ViewModelContext viewModelContext) { if (!VControl.class.isInstance(vElement)) { return NOT_APPLICABLE; } final VControl control = (VControl) vElement; final IValueProperty valueProperty = Activator.getDefault().getEMFFormsDatabinding() .getValueProperty(control.getDomainModelReference()); final EStructuralFeature feature = (EStructuralFeature) valueProperty.getValueType(); if (VKeyattributedmrPackage.eINSTANCE.getKeyAttributeDomainModelReference_KeyValue() == feature) { return 6; } return NOT_APPLICABLE; }
Source:
public boolean createUser(UserLogin createUser) { System.out.println("inside the daoimpl createuser"); Session session = null; Transaction tx = null; boolean result = true; try { System.out.println("Username to insert"+createUser.getUserName()); System.out.println("sha1 value to insert"+createUser.getSha1()); System.out.println("salt value to insert"+createUser.getSalt()); session = this.sessionFactory.openSession(); tx = session.beginTransaction(); session.persist(createUser); System.out.println("after inserting the record"); LOG.info("create user record Inserted successfully from dao impl..."); tx.commit(); } catch (HibernateException e) { result = false; transactionRollback(tx); LOG.error("Exception during insertion caused by :" + e.getMessage(), e); } finally { closeSession(session, false); } return result; }

Target:
public boolean createUser(UserLogin createUser) { Session session = null; Transaction tx = null; boolean result = true; try { session = this.sessionFactory.openSession(); tx = session.beginTransaction(); session.persist(createUser); LOG.info("create user record Inserted successfully from dao impl..."); tx.commit(); } catch (HibernateException e) { result = false; transactionRollback(tx); LOG.error("Exception during insertion caused by :" + e.getMessage(), e); } finally { closeSession(session, false); } return result; }
Source:
public void loadLocalCache() { final long start = System.currentTimeMillis(); moveSegmentFiles(); List<DataSegment> cachedSegments = Lists.newArrayList(); List<File> segmentsToLoad = new ArrayList<>(); for (Path location : segmentManager.getSegmentLocations()) { try { Files.walk(location, Integer.MAX_VALUE) .filter(p -> p.toString().endsWith("info.json")) .map(Path::toFile) .collect(Collectors.toCollection(() -> segmentsToLoad)); } catch (Exception e) { log.makeAlert(e, "Failed to walk through files") .addData("location", location) .emit(); } } for (File file : segmentsToLoad) { log.info("Loading segment cache file [%d][%s].", segmentsToLoad.size(), file); try { final DataSegment segment = jsonMapper.readValue(file, DataSegment.class); if (segmentManager.isSegmentCached(segment)) { cachedSegments.add(segment); } else { log.warn("Unable to find cache file [%s] for %s. Deleting lookup entry", file, segment.getIdentifier()); if (!file.delete()) { log.warn("Unable to delete segmentInfoCacheFile[%s]", file); } } } catch (Exception e) { log.makeAlert(e, "Failed to load segment from segmentInfo file") .addData("file", file) .emit(); } } addSegments( cachedSegments, new DataSegmentChangeCallback() { @Override public void execute() { log.info("Cache load took %,d ms", System.currentTimeMillis() - start); } } ); }

Target:
public void loadLocalCache() { final long start = System.currentTimeMillis(); if (config.getInfoDir() != null) { moveSegmentFiles(); } List<File> segmentLocations = segmentManager.getSegmentLocations(); List<File> segmentsToLoad = Lists.newArrayList(); for (File location : segmentLocations) { try { segmentsToLoad.addAll( Files.walk(location.toPath()) .filter(p -> p.toFile().getName().equals(SEGMENT_CACHE_FILENAME)) .map(p -> p.toFile()) .collect(Collectors.toList()) ); } catch (IOException e) { log.error("Could not load storage location[%s] , skipping this storage location ... ", location); } } List<DataSegment> cachedSegments = Lists.newArrayList(); int ignored = 0; for (File file : segmentsToLoad) { log.info("Loading segment cache file [%d][%s].", segmentsToLoad.size(), file); try { final DataSegment segment = jsonMapper.readValue(file, DataSegment.class); if (!file.getName().equals(SEGMENT_CACHE_FILENAME)) { log.warn("Ignoring cache file[%s] for segment[%s].", file.getPath(), segment.getIdentifier()); ignored++; } else if (segmentManager.isSegmentCached(segment)) { cachedSegments.add(segment); } else { log.warn("Unable to find cache file for %s. Deleting lookup entry", segment.getIdentifier()); if (!file.delete()) { log.warn("Unable to delete segmentInfoCacheFile[%s]", file); } } } catch (Exception e) { log.makeAlert(e, "Failed to load segment from segmentInfo file") .addData("file", file) .emit(); } } if (ignored > 0) { log.makeAlert("Ignored misnamed segment cache files on startup.") .addData("numIgnored", ignored) .emit(); } addSegments( cachedSegments, new DataSegmentChangeCallback() { @Override public void execute() { log.info("Cache load took %,d ms", System.currentTimeMillis() - start); } } ); }
Source:
public ImmutableDruidServer toImmutableDruidServer() { return new ImmutableDruidServer( metadata, currSize, Collections.unmodifiableMap( Maps.transformValues( dataSources, new Function<DruidDataSource, ImmutableDruidDataSource>() { @Override public ImmutableDruidDataSource apply(DruidDataSource input) { return input.toImmutableDruidDataSource(); } } ) ), Collections.unmodifiableMap(segments) ); }

Target:
public ImmutableDruidServer toImmutableDruidServer() { return new ImmutableDruidServer( metadata, currSize, ImmutableMap.copyOf( Maps.transformValues( dataSources, new Function<DruidDataSource, ImmutableDruidDataSource>() { @Override public ImmutableDruidDataSource apply(DruidDataSource input) { return input.toImmutableDruidDataSource(); } } ) ), ImmutableMap.copyOf(segments) ); }
Source:
private static String getRefFromHgvs(String hgvs, Type type) { if (type.equals(Type.DELETION)){ String ref = getPattern("(?<=[a-z+>])[ATCG]*$", hgvs); if (ref.equals(null)) return ""; return ref; } if (type.equals(Type.SUBSTITUTION)) return getPattern("(?<=\\d+)[ATCG]+(?=>)", hgvs); String ans = ""; while (ans.length() < getPattern("(?<=[a-z+>])[ATCG]+$", hgvs).length()) ans += "X"; return ans; }

Target:
private static String getRefFromHgvs(String hgvs, Type type) { if (type.equals(Type.DELETION)) { String ref = getPattern("(?<=[a-z+>])[ATCG]*$", hgvs); if (ref.equals(null)) { return ""; } return ref; } else if (type.equals(Type.SUBSTITUTION)) { return getPattern("(?<=\\d+)[ATCG]+(?=>)", hgvs); } String ans = ""; while (ans.length() < getPattern("(?<=[a-z+>])[ATCG]+$", hgvs).length()) { ans += "X"; } return ans; }
Source:
public LogPosition position() { throw new UnsupportedOperationException( "Perhaps not required" ); }

Target:
public LogPosition position() { throw new UnsupportedOperationException( "Should not be called" ); }
Source:
@Test public void doubleEqualityDifferentTypes() { ASSERT.that(MathUtil.equals(1.3d, 1.3f, 0.00000000000001d)).isFalse(); }

Target:
@Test public void doubleEqualityDifferentTypes() { ASSERT.that(MathUtil.equals(1.3d, 1.3f, 0.00000000000001d)).isFalse(); ASSERT.that(MathUtil.equals(1.3f, 1.3d, 0.00000000000001f)).isFalse(); }
Source:
public MutableList<?> sorted(Object self, final Object key, Boolean reverse, final Location loc, final Environment env) throws EvalException, InterruptedException { ArrayList list = new ArrayList(EvalUtils.toCollection(self, loc, env)); if (key == Runtime.NONE) { try { Collections.sort(list, EvalUtils.SKYLARK_COMPARATOR); } catch (EvalUtils.ComparisonException e) { throw new EvalException(loc, e); } } else { checkValidKeyFunc(key, loc); final FuncallExpression ast = new FuncallExpression(Identifier.of(""), ImmutableList.of()); class KeyComparator implements Comparator<Object> { public Exception e; @Override public int compare(Object o1, Object o2) { try { return EvalUtils.SKYLARK_COMPARATOR.compare( evalKeyFunc(o1, key, loc, env, ast), evalKeyFunc(o2, key, loc, env, ast)); } catch (InterruptedException | EvalException e) { if (this.e == null) { this.e = (Exception) e; } return 0; } } } KeyComparator comp= new KeyComparator(); try { Collections.sort(list, comp); } catch (EvalUtils.ComparisonException e) { throw new EvalException(loc, e); } if (comp.e != null) { if (comp.e instanceof InterruptedException) { throw (InterruptedException) comp.e; } throw (EvalException) comp.e; } } if (reverse) { Collections.reverse(list); } return MutableList.wrapUnsafe(env, list); }

Target:
public MutableList<?> sorted(Object self, final Object key, Boolean reverse, final Location loc, final Environment env) throws EvalException, InterruptedException { ArrayList list = new ArrayList(EvalUtils.toCollection(self, loc, env)); if (key == Runtime.NONE) { try { Collections.sort(list, EvalUtils.SKYLARK_COMPARATOR); } catch (EvalUtils.ComparisonException e) { throw new EvalException(loc, e); } } else { checkValidKeyFunc(key, loc); final FuncallExpression ast = new FuncallExpression(Identifier.of(""), ImmutableList.of()); class KeyComparator implements Comparator<Object> { Exception e; @Override public int compare(Object x, Object y) { try { return EvalUtils.SKYLARK_COMPARATOR.compare( evalKeyFunc(x, key, loc, env, ast), evalKeyFunc(y, key, loc, env, ast)); } catch (InterruptedException | EvalException e) { if (this.e == null) { this.e = e; } return 0; } } } KeyComparator comp = new KeyComparator(); try { Collections.sort(list, comp); } catch (EvalUtils.ComparisonException e) { throw new EvalException(loc, e); } if (comp.e != null) { if (comp.e instanceof InterruptedException) { throw (InterruptedException) comp.e; } throw (EvalException) comp.e; } } if (reverse) { Collections.reverse(list); } return MutableList.wrapUnsafe(env, list); }
Source:
public void end(boolean interrupted) { LogKitten.d("MotorPositionControl interrupted"); }

Target:
public void end(boolean interrupted) { if (interrupted) { LogKitten.d("MotorPositionControl interrupted"); } }
Source:
protected void fillContextMenu(IMenuManager manager) { final ISelection selection = fViewer.getSelection(); ITmfFilterTreeNode filterTreeNode = null; if (selection instanceof StructuredSelection) { Object element = ((StructuredSelection) selection).getFirstElement(); if (element instanceof ITmfFilterTreeNode) { filterTreeNode = (ITmfFilterTreeNode) element; } } final ITmfFilterTreeNode selectedNode = filterTreeNode; if (selectedNode != null) { fillContextMenuForNode(selectedNode, manager); if (selectedNode.getValidChildren().size() > 0) { manager.add(new Separator()); } Action deleteAction = new Action() { @Override public void run() { selectedNode.remove(); fViewer.refresh(); } }; deleteAction.setText(Messages.FilterViewer_DeleteActionText); manager.add(deleteAction); manager.add(new Separator()); } if (fViewer.getInput() instanceof TmfFilterRootNode || selectedNode == null) { final ITmfFilterTreeNode root = (ITmfFilterTreeNode) fViewer.getInput(); fillContextMenuForNode(root, manager); } }

Target:
protected void fillContextMenu(IMenuManager manager) { final ISelection selection = fViewer.getSelection(); ITmfFilterTreeNode filterTreeNode = null; if (selection instanceof StructuredSelection) { Object element = ((StructuredSelection) selection).getFirstElement(); if (element instanceof ITmfFilterTreeNode) { filterTreeNode = (ITmfFilterTreeNode) element; } } if (filterTreeNode != null) { fillContextMenuForNode(filterTreeNode, manager); manager.add(new Separator("delete")); manager.add(new Separator("edit")); } if (fViewer.getInput() instanceof TmfFilterRootNode || filterTreeNode == null) { manager.add(new Separator()); ITmfFilterTreeNode root = (ITmfFilterTreeNode) fViewer.getInput(); fillContextMenuForNode(root, manager); } }