Remove unused code in *ProjectFragment.
Change-Id: Ie2453b0f7031b529e5b598a6854faec008c18594
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/BuiltinProjectFragment.java b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/BuiltinProjectFragment.java
index 02b175a..c54a755 100644
--- a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/BuiltinProjectFragment.java
+++ b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/BuiltinProjectFragment.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2016 IBM Corporation and others.
+ * Copyright (c) 2005, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -35,13 +35,8 @@
/**
* Project fragment for buildpath script folders and modules.
- *
- * @author haiodo
- *
*/
public class BuiltinProjectFragment extends ProjectFragment {
- public final static ArrayList EMPTY_LIST = new ArrayList();
-
static final Object INTERPRETER_CONTAINER = "org.eclipse.dltk.launching.INTERPRETER_CONTAINER"; //$NON-NLS-1$
protected final IPath fPath;
@@ -64,7 +59,8 @@
IBuildpathEntry[] entries = project.getRawBuildpath();
IPath containerPath = null;
for (int i = 0; i < entries.length; i++) {
- if (entries[i].getEntryKind() == IBuildpathEntry.BPE_CONTAINER) {
+ if (entries[i]
+ .getEntryKind() == IBuildpathEntry.BPE_CONTAINER) {
IPath path = entries[i].getPath();
if (path.segment(0).equals(INTERPRETER_CONTAINER)) {
containerPath = entries[i].getPath();
@@ -76,8 +72,8 @@
return null;
}
IBuildpathContainer buildpathContainer = ModelManager
- .getModelManager().getBuildpathContainer(containerPath,
- project);
+ .getModelManager()
+ .getBuildpathContainer(containerPath, project);
if (buildpathContainer != null
&& buildpathContainer instanceof IBuildpathContainerExtension) {
return ((IBuildpathContainerExtension) buildpathContainer)
@@ -102,13 +98,13 @@
@Override
protected boolean computeChildren(OpenableElementInfo info, Map newElements)
throws ModelException {
- ArrayList vChildren = new ArrayList(5);
- ArrayList vForeign = new ArrayList(5);
+ ArrayList<IModelElement> vChildren = new ArrayList<>(5);
char[][] inclusionPatterns = fullInclusionPatternChars();
char[][] exclusionPatterns = fullExclusionPatternChars();
- computeFolderChildren(this.fPath, !Util.isExcluded(this.fPath,
- inclusionPatterns, exclusionPatterns, true), vChildren,
- vForeign, newElements, inclusionPatterns, exclusionPatterns);
+ computeFolderChildren(this.fPath,
+ !Util.isExcluded(this.fPath, inclusionPatterns,
+ exclusionPatterns, true),
+ vChildren, newElements, inclusionPatterns, exclusionPatterns);
IModelElement[] children = new IModelElement[vChildren.size()];
vChildren.toArray(children);
info.setChildren(children);
@@ -118,18 +114,19 @@
/**
* Starting at this folder, create folders and add them to the collection of
* children.
- *
+ *
* @param newElements
- *
+ *
* @exception ModelException
* The resource associated with this project fragment does
* not exist
*/
protected void computeFolderChildren(IPath path, boolean isIncluded,
- ArrayList vChildren, ArrayList vForeign, Map newElements,
+ ArrayList<IModelElement> vChildren, Map newElements,
char[][] inclusionPatterns, char[][] exclusionPatterns)
throws ModelException {
- BuiltinScriptFolder fldr = (BuiltinScriptFolder) getScriptFolder(Path.EMPTY);
+ BuiltinScriptFolder fldr = (BuiltinScriptFolder) getScriptFolder(
+ Path.EMPTY);
vChildren.add(fldr);
if (this.builtinProvider == null) {
return;
@@ -157,8 +154,8 @@
for (int i = 0; i < children.length; ++i) {
IModelElement child = children[i];
if (child.getElementType() == SCRIPT_FOLDER
- && ((IScriptFolder) child).getElementName().equals(
- portablePath)) {
+ && ((IScriptFolder) child).getElementName()
+ .equals(portablePath)) {
return ((IScriptFolder) child);
}
}
@@ -327,12 +324,12 @@
// try to guest map from internal element.
if (rawEntry != null
&& rawEntry.getEntryKind() == IBuildpathEntry.BPE_CONTAINER) {
- IBuildpathContainer container = DLTKCore.getBuildpathContainer(
- rawEntry.getPath(), project);
+ IBuildpathContainer container = DLTKCore
+ .getBuildpathContainer(rawEntry.getPath(), project);
IBuildpathEntry entrys[] = container.getBuildpathEntries();
for (int i = 0; i < entrys.length; ++i) {
- if (entrys[i].getPath().equals(
- new Path(this.getPath().segment(0)))) {
+ if (entrys[i].getPath()
+ .equals(new Path(this.getPath().segment(0)))) {
return entrys[i];
}
}
diff --git a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/ProjectFragment.java b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/ProjectFragment.java
index 4e766cd..5435652 100644
--- a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/ProjectFragment.java
+++ b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/ProjectFragment.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2016 IBM Corporation and others.
+ * Copyright (c) 2005, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -91,7 +91,7 @@
/**
* Compares two objects for equality; for <code>ProjectFragments</code>s,
* equality is having the same parent, same resources, and occurrence count.
- *
+ *
*/
@Override
public boolean equals(Object o) {
@@ -169,7 +169,7 @@
/**
* Compute the project fragment children of this project fragment.
- *
+ *
* @exception ModelException
* The resource associated with this project fragment does
* not exist
@@ -186,18 +186,19 @@
IResource underlyingResource = this.getResource();
if (underlyingResource.getType() == IResource.FOLDER
|| underlyingResource.getType() == IResource.PROJECT) {
- ArrayList vChildren = new ArrayList(5);
+ ArrayList<IModelElement> vChildren = new ArrayList<>(5);
IContainer rootFolder = (IContainer) underlyingResource;
char[][] inclusionPatterns = this.fullInclusionPatternChars();
char[][] exclusionPatterns = this.fullExclusionPatternChars();
- this.computeFolderChildren(rootFolder, !Util.isExcluded(
- rootFolder, inclusionPatterns, exclusionPatterns),
+ this.computeFolderChildren(rootFolder,
+ !Util.isExcluded(rootFolder, inclusionPatterns,
+ exclusionPatterns),
Path.EMPTY, vChildren, inclusionPatterns,
exclusionPatterns);
// IModelElement[] children = new
// IModelElement[vChildren.size()];
// vChildren.toArray(children);
- List childrenSet = vChildren;
+ List<IModelElement> childrenSet = vChildren;
// Call for extra model providers
IDLTKLanguageToolkit toolkit = DLTKLanguageManager
.getLanguageToolkit(this);
@@ -210,7 +211,7 @@
}
}
}
- info.setChildren((IModelElement[]) childrenSet
+ info.setChildren(childrenSet
.toArray(new IModelElement[childrenSet.size()]));
}
} catch (ModelException e) {
@@ -224,14 +225,15 @@
/**
* Starting at this folder, create folders and add them to the collection of
* children.
- *
+ *
* @exception ModelException
* The resource associated with this project fragment does
* not exist
*/
protected void computeFolderChildren(IContainer folder, boolean isIncluded,
- IPath path, ArrayList vChildren, char[][] inclusionPatterns,
- char[][] exclusionPatterns) throws ModelException {
+ IPath path, ArrayList<IModelElement> vChildren,
+ char[][] inclusionPatterns, char[][] exclusionPatterns)
+ throws ModelException {
if (isIncluded) {
IScriptFolder pkg = this.getScriptFolder(path);
vChildren.add(pkg);
@@ -249,8 +251,8 @@
case IResource.FOLDER:
if (Util.isValidFolderNameForPackage(folder, memberName)) {
if (scriptProject.contains(member)) {
- IPath newPath = path.append(manager
- .intern(memberName));
+ IPath newPath = path
+ .append(manager.intern(memberName));
boolean isMemberIncluded = !Util.isExcluded(member,
inclusionPatterns, exclusionPatterns);
this.computeFolderChildren((IFolder) member,
@@ -263,8 +265,7 @@
// inclusion filter may only include files, in which
// case we still want to include the immediate parent
// package (lazily)
- if (!hasIncluded
- && Util.isValidSourceModule(this, member)
+ if (!hasIncluded && Util.isValidSourceModule(this, member)
&& !Util.isExcluded(member, inclusionPatterns,
exclusionPatterns)) {
hasIncluded = true;
@@ -295,8 +296,8 @@
if (providers != null) {
boolean provides = false;
for (int i = 0; i < providers.length; i++) {
- if (providers[i].isModelChangesProvidedFor(this, path
- .segment(0))) {
+ if (providers[i].isModelChangesProvidedFor(this,
+ path.segment(0))) {
provides = true;
break;
}
@@ -383,8 +384,8 @@
@Override
public void printNode(CorePrinter output) {
- output
- .formatPrint("ScriptProject fragment:" + this.getPath().toOSString()); //$NON-NLS-1$
+ output.formatPrint(
+ "ScriptProject fragment:" + this.getPath().toOSString()); //$NON-NLS-1$
output.indent();
try {
IModelElement modelElements[] = this.getChildren();
@@ -412,8 +413,8 @@
@Override
public Object[] getForeignResources() throws ModelException {
return ((ProjectFragmentInfo) this.getElementInfo())
- .getForeignResources(this.getScriptProject(), this
- .getResource(), this);
+ .getForeignResources(this.getScriptProject(),
+ this.getResource(), this);
}
/*
@@ -551,9 +552,8 @@
public void copy(IPath destination, int updateResourceFlags,
int updateModelFlags, IBuildpathEntry sibling,
IProgressMonitor monitor) throws ModelException {
- CopyProjectFragmentOperation op = new CopyProjectFragmentOperation(
- this, destination, updateResourceFlags, updateModelFlags,
- sibling);
+ CopyProjectFragmentOperation op = new CopyProjectFragmentOperation(this,
+ destination, updateResourceFlags, updateModelFlags, sibling);
op.runOperation(monitor);
}
@@ -561,9 +561,8 @@
public void move(IPath destination, int updateResourceFlags,
int updateModelFlags, IBuildpathEntry sibling,
IProgressMonitor monitor) throws ModelException {
- MoveProjectFragmentOperation op = new MoveProjectFragmentOperation(
- this, destination, updateResourceFlags, updateModelFlags,
- sibling);
+ MoveProjectFragmentOperation op = new MoveProjectFragmentOperation(this,
+ destination, updateResourceFlags, updateModelFlags, sibling);
op.runOperation(monitor);
}