public class BufferChangedEvent extends EventObject {
/**
+ *
+ */
+ private static final long serialVersionUID = 5011809275535828189L;
+
+ /**
* The length of text that has been modified in the buffer.
*/
private int length;
import net.sourceforge.phpdt.core.compiler.CharOperation;
-import org.eclipse.core.runtime.IProgressMonitor;
+//import org.eclipse.core.runtime.IProgressMonitor;
/**
* Completion proposal.
/**
* Offset in original buffer where ICodeAssist.codeComplete() was requested.
*/
- private int completionLocation;
+ //private int completionLocation;
/**
* Start position (inclusive) of source range in original buffer containing
* the relevant token defaults to empty subrange at [0,0).
*/
- private int tokenStart = 0;
+ //private int tokenStart = 0;
/**
* End position (exclusive) of source range in original buffer containing
* the relevant token; defaults to empty subrange at [0,0).
*/
- private int tokenEnd = 0;
+ //private int tokenEnd = 0;
/**
* Completion string; defaults to empty string.
* Relevance rating; positive; higher means better; defaults to minimum
* rating.
*/
- private int relevance = 1;
+ //private int relevance = 1;
/**
* Signature of the relevant package or type declaration in the context, or
* Parameter names (for method completions), or <code>null</code> if none.
* Lazily computed. Defaults to <code>null</code>.
*/
- private char[][] parameterNames = null;
+ //private char[][] parameterNames = null;
/**
* Indicates whether parameter names have been computed.
*/
- private boolean parameterNamesComputed = false;
+ //private boolean parameterNamesComputed = false;
/**
* Creates a basic completion proposal. All instance field have plausible
throw new IllegalArgumentException();
}
this.completionKind = kind;
- this.completionLocation = completionLocation;
+ //this.completionLocation = completionLocation;
}
/**
* @return character index in source file buffer
* @see ICodeAssist#codeComplete(int,CompletionRequestor)
*/
- public int getCompletionLocation() {
- return this.completionLocation;
- }
+// public int getCompletionLocation() {
+// return this.completionLocation;
+// }
/**
* Returns the character index of the start of the subrange in the source
*
* @return character index of token start position (inclusive)
*/
- public int getTokenStart() {
- return this.tokenStart;
- }
+// public int getTokenStart() {
+// return this.tokenStart;
+// }
/**
* Returns the character index of the end (exclusive) of the subrange in the
*
* @return character index of token end position (exclusive)
*/
- public int getTokenEnd() {
- return this.tokenEnd;
- }
+// public int getTokenEnd() {
+// return this.tokenEnd;
+// }
/**
* Sets the character indices of the subrange in the source file buffer
* @param endIndex
* character index of token end position (exclusive)
*/
- public void setTokenRange(int startIndex, int endIndex) {
- if (startIndex < 0 || endIndex < startIndex) {
- throw new IllegalArgumentException();
- }
- this.tokenStart = startIndex;
- this.tokenEnd = endIndex;
- }
+// public void setTokenRange(int startIndex, int endIndex) {
+// if (startIndex < 0 || endIndex < startIndex) {
+// throw new IllegalArgumentException();
+// }
+// this.tokenStart = startIndex;
+// this.tokenEnd = endIndex;
+// }
/**
* Returns the proposed sequence of characters to insert into the source
* @param completion
* the completion string
*/
- public void setCompletion(char[] completion) {
- this.completion = completion;
- }
+// public void setCompletion(char[] completion) {
+// this.completion = completion;
+// }
/**
* Returns the character index of the start of the subrange in the source
* @param endIndex
* character index of replacement end position (exclusive)
*/
- public void setReplaceRange(int startIndex, int endIndex) {
- if (startIndex < 0 || endIndex < startIndex) {
- throw new IllegalArgumentException();
- }
- this.replaceStart = startIndex;
- this.replaceEnd = endIndex;
- }
+// public void setReplaceRange(int startIndex, int endIndex) {
+// if (startIndex < 0 || endIndex < startIndex) {
+// throw new IllegalArgumentException();
+// }
+// this.replaceStart = startIndex;
+// this.replaceEnd = endIndex;
+// }
/**
* Returns the relative relevance rating of this proposal.
* @return relevance rating of this proposal; ratings are positive; higher
* means better
*/
- public int getRelevance() {
- return this.relevance;
- }
+// public int getRelevance() {
+// return this.relevance;
+// }
/**
* Sets the relative relevance rating of this proposal.
* relevance rating of this proposal; ratings are positive;
* higher means better
*/
- public void setRelevance(int rating) {
- if (rating <= 0) {
- throw new IllegalArgumentException();
- }
- this.relevance = rating;
- }
+// public void setRelevance(int rating) {
+// if (rating <= 0) {
+// throw new IllegalArgumentException();
+// }
+// this.relevance = rating;
+// }
/**
* Returns the type or package signature of the relevant declaration in the
* @param signature
* the type or package signature, or <code>null</code> if none
*/
- public void setDeclarationSignature(char[] signature) {
- this.declarationSignature = signature;
- }
+// public void setDeclarationSignature(char[] signature) {
+// this.declarationSignature = signature;
+// }
/**
* Returns the simple name of the method, field, member, or variable
* @param signature
* the signature, or <code>null</code> if none
*/
- public void setSignature(char[] signature) {
- this.signature = signature;
- }
+// public void setSignature(char[] signature) {
+// this.signature = signature;
+// }
/**
* Returns the modifier flags relevant in the context, or
* @param flags
* the modifier flags, or <code>Flags.AccDefault</code> if none
*/
- public void setFlags(int flags) {
- this.flags = flags;
- }
+// public void setFlags(int flags) {
+// this.flags = flags;
+// }
/**
* Finds the method parameter names. This information is relevant to method
* @return the parameter names, or <code>null</code> if none or not
* available or not relevant
*/
- public char[][] findParameterNames(IProgressMonitor monitor) {
- if (!this.parameterNamesComputed) {
- this.parameterNamesComputed = true;
- // TODO (jerome) - Missing implementation
- }
- return this.parameterNames;
- }
+// public char[][] findParameterNames(IProgressMonitor monitor) {
+// if (!this.parameterNamesComputed) {
+// this.parameterNamesComputed = true;
+// // TODO (jerome) - Missing implementation
+// }
+// return this.parameterNames;
+// }
/**
* Sets the method parameter names. This information is relevant to method
* @param parameterNames
* the parameter names, or <code>null</code> if none
*/
- public void setParameterNames(char[][] parameterNames) {
- this.parameterNames = parameterNames;
- this.parameterNamesComputed = true;
- }
+// public void setParameterNames(char[][] parameterNames) {
+// this.parameterNames = parameterNames;
+// this.parameterNamesComputed = true;
+// }
}
public class ElementChangedEvent extends EventObject {
/**
+ *
+ */
+ private static final long serialVersionUID = 1222640386847724934L;
+
+ /**
* Event type constant (bit mask) indicating an after-the-fact report of
* creations, deletions, and modifications to one or more Java element(s)
* expressed as a hierarchical java element delta as returned by
*******************************************************************************/
package net.sourceforge.phpdt.core;
-import java.util.StringTokenizer;
+//import java.util.StringTokenizer;
-import net.sourceforge.phpdt.core.compiler.CharOperation;
+//import net.sourceforge.phpdt.core.compiler.CharOperation;
import net.sourceforge.phpdt.core.compiler.ITerminalSymbols;
import net.sourceforge.phpdt.core.compiler.InvalidInputException;
import net.sourceforge.phpdt.internal.compiler.parser.Scanner;
-import net.sourceforge.phpdt.internal.core.ClasspathEntry;
+//import net.sourceforge.phpdt.internal.core.ClasspathEntry;
import net.sourceforge.phpdt.internal.core.JavaModelStatus;
import net.sourceforge.phpdt.internal.core.util.Util;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
+//import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
+//import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
*/
public final class JavaConventions {
- private final static char DOT = '.';
+ //private final static char DOT = '.';
private final static Scanner SCANNER = new Scanner();
* overlap, false otherwise
* @deprecated Overlapping roots are allowed in 2.1
*/
- public static boolean isOverlappingRoots(IPath rootPath1, IPath rootPath2) {
- if (rootPath1 == null || rootPath2 == null) {
- return false;
- }
- // String extension1 = rootPath1.getFileExtension();
- // String extension2 = rootPath2.getFileExtension();
- // if (extension1 != null &&
- // (extension1.equalsIgnoreCase(SuffixConstants.EXTENSION_JAR) ||
- // extension1.equalsIgnoreCase(SuffixConstants.EXTENSION_ZIP))) {
- // return false;
- // }
- // if (extension2 != null &&
- // (extension2.equalsIgnoreCase(SuffixConstants.EXTENSION_JAR) ||
- // extension2.equalsIgnoreCase(SuffixConstants.EXTENSION_ZIP))) {
- // return false;
- // }
- return rootPath1.isPrefixOf(rootPath2)
- || rootPath2.isPrefixOf(rootPath1);
- }
+// public static boolean isOverlappingRoots(IPath rootPath1, IPath rootPath2) {
+// if (rootPath1 == null || rootPath2 == null) {
+// return false;
+// }
+// // String extension1 = rootPath1.getFileExtension();
+// // String extension2 = rootPath2.getFileExtension();
+// // if (extension1 != null &&
+// // (extension1.equalsIgnoreCase(SuffixConstants.EXTENSION_JAR) ||
+// // extension1.equalsIgnoreCase(SuffixConstants.EXTENSION_ZIP))) {
+// // return false;
+// // }
+// // if (extension2 != null &&
+// // (extension2.equalsIgnoreCase(SuffixConstants.EXTENSION_JAR) ||
+// // extension2.equalsIgnoreCase(SuffixConstants.EXTENSION_ZIP))) {
+// // return false;
+// // }
+// return rootPath1.isPrefixOf(rootPath2)
+// || rootPath2.isPrefixOf(rootPath1);
+// }
/*
* Returns the current identifier extracted by the scanner (without unicode
* name is valid as an import declaration, otherwise a status object
* indicating what is wrong with the name
*/
- public static IStatus validateImportDeclaration(String name) {
- if (name == null || name.length() == 0) {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util
- .bind("convention.import.nullImport"), null); //$NON-NLS-1$
- }
- if (name.charAt(name.length() - 1) == '*') {
- if (name.charAt(name.length() - 2) == '.') {
- return validatePackageName(name.substring(0, name.length() - 2));
- } else {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util
- .bind("convention.import.unqualifiedImport"), null); //$NON-NLS-1$
- }
- }
- return validatePackageName(name);
- }
+// public static IStatus validateImportDeclaration(String name) {
+// if (name == null || name.length() == 0) {
+// return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util
+// .bind("convention.import.nullImport"), null); //$NON-NLS-1$
+// }
+// if (name.charAt(name.length() - 1) == '*') {
+// if (name.charAt(name.length() - 2) == '.') {
+// return validatePackageName(name.substring(0, name.length() - 2));
+// } else {
+// return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util
+// .bind("convention.import.unqualifiedImport"), null); //$NON-NLS-1$
+// }
+// }
+// return validatePackageName(name);
+// }
/**
* Validate the given Java type name, either simple or qualified. For
* discouraged, otherwise a status object indicating what is wrong
* with the name
*/
- public static IStatus validateJavaTypeName(String name) {
- if (name == null) {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util
- .bind("convention.type.nullName"), null); //$NON-NLS-1$
- }
- String trimmed = name.trim();
- if (!name.equals(trimmed)) {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util
- .bind("convention.type.nameWithBlanks"), null); //$NON-NLS-1$
- }
- int index = name.lastIndexOf('.');
- char[] scannedID;
- if (index == -1) {
- // simple name
- scannedID = scannedIdentifier(name);
- } else {
- // qualified name
- String pkg = name.substring(0, index).trim();
- IStatus status = validatePackageName(pkg);
- if (!status.isOK()) {
- return status;
- }
- String type = name.substring(index + 1).trim();
- scannedID = scannedIdentifier(type);
- }
-
- if (scannedID != null) {
- IStatus status = ResourcesPlugin.getWorkspace().validateName(
- new String(scannedID), IResource.FILE);
- if (!status.isOK()) {
- return status;
- }
- if (CharOperation.contains('$', scannedID)) {
- return new Status(IStatus.WARNING, JavaCore.PLUGIN_ID, -1, Util
- .bind("convention.type.dollarName"), null); //$NON-NLS-1$
- }
- if ((scannedID.length > 0 && Character.isLowerCase(scannedID[0]))) {
- return new Status(IStatus.WARNING, JavaCore.PLUGIN_ID, -1, Util
- .bind("convention.type.lowercaseName"), null); //$NON-NLS-1$
- }
- return JavaModelStatus.VERIFIED_OK;
- } else {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind(
- "convention.type.invalidName", name), null); //$NON-NLS-1$
- }
- }
+// public static IStatus validateJavaTypeName(String name) {
+// if (name == null) {
+// return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util
+// .bind("convention.type.nullName"), null); //$NON-NLS-1$
+// }
+// String trimmed = name.trim();
+// if (!name.equals(trimmed)) {
+// return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util
+// .bind("convention.type.nameWithBlanks"), null); //$NON-NLS-1$
+// }
+// int index = name.lastIndexOf('.');
+// char[] scannedID;
+// if (index == -1) {
+// // simple name
+// scannedID = scannedIdentifier(name);
+// } else {
+// // qualified name
+// String pkg = name.substring(0, index).trim();
+// IStatus status = validatePackageName(pkg);
+// if (!status.isOK()) {
+// return status;
+// }
+// String type = name.substring(index + 1).trim();
+// scannedID = scannedIdentifier(type);
+// }
+//
+// if (scannedID != null) {
+// IStatus status = ResourcesPlugin.getWorkspace().validateName(
+// new String(scannedID), IResource.FILE);
+// if (!status.isOK()) {
+// return status;
+// }
+// if (CharOperation.contains('$', scannedID)) {
+// return new Status(IStatus.WARNING, JavaCore.PLUGIN_ID, -1, Util
+// .bind("convention.type.dollarName"), null); //$NON-NLS-1$
+// }
+// if ((scannedID.length > 0 && Character.isLowerCase(scannedID[0]))) {
+// return new Status(IStatus.WARNING, JavaCore.PLUGIN_ID, -1, Util
+// .bind("convention.type.lowercaseName"), null); //$NON-NLS-1$
+// }
+// return JavaModelStatus.VERIFIED_OK;
+// } else {
+// return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind(
+// "convention.type.invalidName", name), null); //$NON-NLS-1$
+// }
+// }
/**
* Validate the given method name. The special names "<init>" and
* name is valid as a method name, otherwise a status object
* indicating what is wrong with the name
*/
- public static IStatus validateMethodName(String name) {
-
- return validateIdentifier(name);
- }
+// public static IStatus validateMethodName(String name) {
+//
+// return validateIdentifier(name);
+// }
/**
* Validate the given package name.
* name is valid as a package name, otherwise a status object
* indicating what is wrong with the name
*/
- public static IStatus validatePackageName(String name) {
-
- if (name == null) {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util
- .bind("convention.package.nullName"), null); //$NON-NLS-1$
- }
- int length;
- if ((length = name.length()) == 0) {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util
- .bind("convention.package.emptyName"), null); //$NON-NLS-1$
- }
- if (name.charAt(0) == DOT || name.charAt(length - 1) == DOT) {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util
- .bind("convention.package.dotName"), null); //$NON-NLS-1$
- }
- if (CharOperation.isWhitespace(name.charAt(0))
- || CharOperation.isWhitespace(name.charAt(name.length() - 1))) {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util
- .bind("convention.package.nameWithBlanks"), null); //$NON-NLS-1$
- }
- int dot = 0;
- while (dot != -1 && dot < length - 1) {
- if ((dot = name.indexOf(DOT, dot + 1)) != -1 && dot < length - 1
- && name.charAt(dot + 1) == DOT) {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util
- .bind("convention.package.consecutiveDotsName"), null); //$NON-NLS-1$
- }
- }
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- StringTokenizer st = new StringTokenizer(name, new String(
- new char[] { DOT }));
- boolean firstToken = true;
- IStatus warningStatus = null;
- while (st.hasMoreTokens()) {
- String typeName = st.nextToken();
- typeName = typeName.trim(); // grammar allows spaces
- char[] scannedID = scannedIdentifier(typeName);
- if (scannedID == null) {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util
- .bind("convention.illegalIdentifier", typeName), null); //$NON-NLS-1$
- }
- IStatus status = workspace.validateName(new String(scannedID),
- IResource.FOLDER);
- if (!status.isOK()) {
- return status;
- }
- if (firstToken && scannedID.length > 0
- && Character.isUpperCase(scannedID[0])) {
- if (warningStatus == null) {
- warningStatus = new Status(IStatus.WARNING,
- JavaCore.PLUGIN_ID, -1,
- Util.bind("convention.package.uppercaseName"), null); //$NON-NLS-1$
- }
- }
- firstToken = false;
- }
- if (warningStatus != null) {
- return warningStatus;
- }
- return JavaModelStatus.VERIFIED_OK;
- }
+// public static IStatus validatePackageName(String name) {
+//
+// if (name == null) {
+// return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util
+// .bind("convention.package.nullName"), null); //$NON-NLS-1$
+// }
+// int length;
+// if ((length = name.length()) == 0) {
+// return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util
+// .bind("convention.package.emptyName"), null); //$NON-NLS-1$
+// }
+// if (name.charAt(0) == DOT || name.charAt(length - 1) == DOT) {
+// return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util
+// .bind("convention.package.dotName"), null); //$NON-NLS-1$
+// }
+// if (CharOperation.isWhitespace(name.charAt(0))
+// || CharOperation.isWhitespace(name.charAt(name.length() - 1))) {
+// return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util
+// .bind("convention.package.nameWithBlanks"), null); //$NON-NLS-1$
+// }
+// int dot = 0;
+// while (dot != -1 && dot < length - 1) {
+// if ((dot = name.indexOf(DOT, dot + 1)) != -1 && dot < length - 1
+// && name.charAt(dot + 1) == DOT) {
+// return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util
+// .bind("convention.package.consecutiveDotsName"), null); //$NON-NLS-1$
+// }
+// }
+// IWorkspace workspace = ResourcesPlugin.getWorkspace();
+// StringTokenizer st = new StringTokenizer(name, new String(
+// new char[] { DOT }));
+// boolean firstToken = true;
+// IStatus warningStatus = null;
+// while (st.hasMoreTokens()) {
+// String typeName = st.nextToken();
+// typeName = typeName.trim(); // grammar allows spaces
+// char[] scannedID = scannedIdentifier(typeName);
+// if (scannedID == null) {
+// return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util
+// .bind("convention.illegalIdentifier", typeName), null); //$NON-NLS-1$
+// }
+// IStatus status = workspace.validateName(new String(scannedID),
+// IResource.FOLDER);
+// if (!status.isOK()) {
+// return status;
+// }
+// if (firstToken && scannedID.length > 0
+// && Character.isUpperCase(scannedID[0])) {
+// if (warningStatus == null) {
+// warningStatus = new Status(IStatus.WARNING,
+// JavaCore.PLUGIN_ID, -1,
+// Util.bind("convention.package.uppercaseName"), null); //$NON-NLS-1$
+// }
+// }
+// firstToken = false;
+// }
+// if (warningStatus != null) {
+// return warningStatus;
+// }
+// return JavaModelStatus.VERIFIED_OK;
+// }
/**
* Validate a given classpath and output location for a project, using the
* location
* @since 2.0
*/
- public static IJavaModelStatus validateClasspath(IJavaProject javaProject,
- IClasspathEntry[] rawClasspath, IPath projectOutputLocation) {
-
- return ClasspathEntry.validateClasspath(javaProject, rawClasspath,
- projectOutputLocation);
- }
+// public static IJavaModelStatus validateClasspath(IJavaProject javaProject,
+// IClasspathEntry[] rawClasspath, IPath projectOutputLocation) {
+//
+// return ClasspathEntry.validateClasspath(javaProject, rawClasspath,
+// projectOutputLocation);
+// }
/**
* Returns a Java model status describing the problem related to this
* <code>IStatus.OK</code> if the entry is fine
* @since 2.0
*/
- public static IJavaModelStatus validateClasspathEntry(IJavaProject project,
- IClasspathEntry entry, boolean checkSourceAttachment) {
- return ClasspathEntry.validateClasspathEntry(project, entry,
- checkSourceAttachment, true/* recurse in container */);
- }
+// public static IJavaModelStatus validateClasspathEntry(IJavaProject project,
+// IClasspathEntry entry, boolean checkSourceAttachment) {
+// return ClasspathEntry.validateClasspathEntry(project, entry,
+// checkSourceAttachment, true/* recurse in container */);
+// }
}
import net.sourceforge.phpdt.internal.core.ClasspathEntry;
import net.sourceforge.phpdt.internal.core.JavaModel;
import net.sourceforge.phpdt.internal.core.JavaModelManager;
-import net.sourceforge.phpdt.internal.core.Region;
+//import net.sourceforge.phpdt.internal.core.Region;
import net.sourceforge.phpdt.internal.core.util.MementoTokenizer;
//incastrix
//import net.sourceforge.phpdt.internal.corext.Assert;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IMarkerDelta;
+//import org.eclipse.core.resources.IMarker;
+//import org.eclipse.core.resources.IMarkerDelta;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeListener;
+//import org.eclipse.core.resources.IResourceChangeListener;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
+//import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Plugin;
* @param element
* the Java element for which the marker needs to be configured
*/
- public static void addJavaElementMarkerAttributes(Map attributes,
- IJavaElement element) {
- // if (element instanceof IMember)
- // element = ((IMember) element).getClassFile();
- if (attributes != null && element != null)
- attributes.put(ATT_HANDLE_ID, element.getHandleIdentifier());
- }
+// public static void addJavaElementMarkerAttributes(Map attributes,
+// IJavaElement element) {
+// // if (element instanceof IMember)
+// // element = ((IMember) element).getClassFile();
+// if (attributes != null && element != null)
+// attributes.put(ATT_HANDLE_ID, element.getHandleIdentifier());
+// }
/**
* Adds the given listener for POST_CHANGE resource change events to the
* @see #removePreProcessingResourceChangedListener(IResourceChangeListener)
* @since 3.0
*/
- public static void addPreProcessingResourceChangedListener(
- IResourceChangeListener listener) {
- JavaModelManager.getJavaModelManager().deltaState
- .addPreResourceChangedListener(listener);
- }
+// public static void addPreProcessingResourceChangedListener(
+// IResourceChangeListener listener) {
+// JavaModelManager.getJavaModelManager().deltaState
+// .addPreResourceChangedListener(listener);
+// }
/**
* Configures the given marker for the given Java element. Used for markers,
* if the <code>IMarker.setAttribute</code> on the marker
* fails
*/
- public void configureJavaElementMarker(IMarker marker, IJavaElement element)
- throws CoreException {
- // if (element instanceof IMember)
- // element = ((IMember) element).getClassFile();
- if (marker != null && element != null)
- marker.setAttribute(ATT_HANDLE_ID, element.getHandleIdentifier());
- }
+// public void configureJavaElementMarker(IMarker marker, IJavaElement element)
+// throws CoreException {
+// // if (element instanceof IMember)
+// // element = ((IMember) element).getClassFile();
+// if (marker != null && element != null)
+// marker.setAttribute(ATT_HANDLE_ID, element.getHandleIdentifier());
+// }
/**
* Returns the Java model element corresponding to the given handle
* initializer or <code>null</code> if none was found.
* @since 2.1
*/
- public static ClasspathVariableInitializer getClasspathVariableInitializer(
- String variable) {
-
- Plugin jdtCorePlugin = JavaCore.getPlugin();
- if (jdtCorePlugin == null)
- return null;
-
- // IExtensionPoint extension =
- // jdtCorePlugin.getDescriptor().getExtensionPoint(JavaModelManager.CPVARIABLE_INITIALIZER_EXTPOINT_ID);
- // if (extension != null) {
- // IExtension[] extensions = extension.getExtensions();
- // for(int i = 0; i < extensions.length; i++){
- // IConfigurationElement [] configElements =
- // extensions[i].getConfigurationElements();
- // for(int j = 0; j < configElements.length; j++){
- // try {
- // String varAttribute = configElements[j].getAttribute("variable");
- // //$NON-NLS-1$
- // if (variable.equals(varAttribute)) {
- // if (JavaModelManager.CP_RESOLVE_VERBOSE) {
- // System.out.println("CPVariable INIT - found initializer: "+variable+"
- // --> " +
- // configElements[j].getAttribute("class"));//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- // }
- // Object execExt =
- // configElements[j].createExecutableExtension("class"); //$NON-NLS-1$
- // if (execExt instanceof ClasspathVariableInitializer){
- // return (ClasspathVariableInitializer)execExt;
- // }
- // }
- // } catch(CoreException e){
- // }
- // }
- // }
- // }
- return null;
- }
+// public static ClasspathVariableInitializer getClasspathVariableInitializer(
+// String variable) {
+//
+// Plugin jdtCorePlugin = JavaCore.getPlugin();
+// if (jdtCorePlugin == null)
+// return null;
+//
+// // IExtensionPoint extension =
+// // jdtCorePlugin.getDescriptor().getExtensionPoint(JavaModelManager.CPVARIABLE_INITIALIZER_EXTPOINT_ID);
+// // if (extension != null) {
+// // IExtension[] extensions = extension.getExtensions();
+// // for(int i = 0; i < extensions.length; i++){
+// // IConfigurationElement [] configElements =
+// // extensions[i].getConfigurationElements();
+// // for(int j = 0; j < configElements.length; j++){
+// // try {
+// // String varAttribute = configElements[j].getAttribute("variable");
+// // //$NON-NLS-1$
+// // if (variable.equals(varAttribute)) {
+// // if (JavaModelManager.CP_RESOLVE_VERBOSE) {
+// // System.out.println("CPVariable INIT - found initializer: "+variable+"
+// // --> " +
+// // configElements[j].getAttribute("class"));//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
+// // }
+// // Object execExt =
+// // configElements[j].createExecutableExtension("class"); //$NON-NLS-1$
+// // if (execExt instanceof ClasspathVariableInitializer){
+// // return (ClasspathVariableInitializer)execExt;
+// // }
+// // }
+// // } catch(CoreException e){
+// // }
+// // }
+// // }
+// // }
+// return null;
+// }
/**
* Returns the names of all known classpath variables.
*
* @return the single instance of the Java core plug-in runtime class
*/
- public static PHPeclipsePlugin getJavaCore() {
- return (PHPeclipsePlugin) getPlugin();
- }
+// public static PHPeclipsePlugin getJavaCore() {
+// return (PHPeclipsePlugin) getPlugin();
+// }
/**
* Helper method for returning one option value only. Equivalent to
* if the <code>IMarker.getAttribute</code> on the marker
* fails
*/
- public static boolean isReferencedBy(IJavaElement element, IMarker marker)
- throws CoreException {
-
- // only match units or classfiles
- if (element instanceof IMember) {
- IMember member = (IMember) element;
- if (member.isBinary()) {
- element = null; // member.getClassFile();
- } else {
- element = member.getCompilationUnit();
- }
- }
- if (element == null)
- return false;
- if (marker == null)
- return false;
-
- String markerHandleId = (String) marker.getAttribute(ATT_HANDLE_ID);
- if (markerHandleId == null)
- return false;
-
- IJavaElement markerElement = JavaCore.create(markerHandleId);
- // while (true){
- if (element.equals(markerElement))
- return true; // external elements may still be equal with
- // different
- // handleIDs.
-
- // cycle through enclosing types in case marker is associated with a
- // classfile (15568)
- // if (markerElement instanceof IClassFile){
- // IType enclosingType =
- // ((IClassFile)markerElement).getType().getDeclaringType();
- // if (enclosingType != null){
- // markerElement = enclosingType.getClassFile(); // retry with immediate
- // enclosing classfile
- // continue;
- // }
- // }
- // break;
- // }
- return false;
- }
+// public static boolean isReferencedBy(IJavaElement element, IMarker marker)
+// throws CoreException {
+//
+// // only match units or classfiles
+// if (element instanceof IMember) {
+// IMember member = (IMember) element;
+// if (member.isBinary()) {
+// element = null; // member.getClassFile();
+// } else {
+// element = member.getCompilationUnit();
+// }
+// }
+// if (element == null)
+// return false;
+// if (marker == null)
+// return false;
+//
+// String markerHandleId = (String) marker.getAttribute(ATT_HANDLE_ID);
+// if (markerHandleId == null)
+// return false;
+//
+// IJavaElement markerElement = JavaCore.create(markerHandleId);
+// // while (true){
+// if (element.equals(markerElement))
+// return true; // external elements may still be equal with
+// // different
+// // handleIDs.
+//
+// // cycle through enclosing types in case marker is associated with a
+// // classfile (15568)
+// // if (markerElement instanceof IClassFile){
+// // IType enclosingType =
+// // ((IClassFile)markerElement).getType().getDeclaringType();
+// // if (enclosingType != null){
+// // markerElement = enclosingType.getClassFile(); // retry with immediate
+// // enclosing classfile
+// // continue;
+// // }
+// // }
+// // break;
+// // }
+// return false;
+// }
/**
* Returns whether the given marker delta references the given Java element.
* if the <code>IMarkerDelta.getAttribute</code> on the
* marker delta fails
*/
- public static boolean isReferencedBy(IJavaElement element,
- IMarkerDelta markerDelta) throws CoreException {
-
- // only match units or classfiles
- if (element instanceof IMember) {
- IMember member = (IMember) element;
- if (member.isBinary()) {
- element = null; // member.getClassFile();
- } else {
- element = member.getCompilationUnit();
- }
- }
- if (element == null)
- return false;
- if (markerDelta == null)
- return false;
-
- String markerDeltarHandleId = (String) markerDelta
- .getAttribute(ATT_HANDLE_ID);
- if (markerDeltarHandleId == null)
- return false;
-
- IJavaElement markerElement = JavaCore.create(markerDeltarHandleId);
- // while (true){
- if (element.equals(markerElement))
- return true; // external elements may still be equal with
- // different
- // handleIDs.
-
- // cycle through enclosing types in case marker is associated with a
- // classfile (15568)
- // if (markerElement instanceof IClassFile){
- // IType enclosingType =
- // ((IClassFile)markerElement).getType().getDeclaringType();
- // if (enclosingType != null){
- // markerElement = enclosingType.getClassFile(); // retry with immediate
- // enclosing classfile
- // continue;
- // }
- // }
- // break;
- // }
- return false;
- }
+// public static boolean isReferencedBy(IJavaElement element,
+// IMarkerDelta markerDelta) throws CoreException {
+//
+// // only match units or classfiles
+// if (element instanceof IMember) {
+// IMember member = (IMember) element;
+// if (member.isBinary()) {
+// element = null; // member.getClassFile();
+// } else {
+// element = member.getCompilationUnit();
+// }
+// }
+// if (element == null)
+// return false;
+// if (markerDelta == null)
+// return false;
+//
+// String markerDeltarHandleId = (String) markerDelta
+// .getAttribute(ATT_HANDLE_ID);
+// if (markerDeltarHandleId == null)
+// return false;
+//
+// IJavaElement markerElement = JavaCore.create(markerDeltarHandleId);
+// // while (true){
+// if (element.equals(markerElement))
+// return true; // external elements may still be equal with
+// // different
+// // handleIDs.
+//
+// // cycle through enclosing types in case marker is associated with a
+// // classfile (15568)
+// // if (markerElement instanceof IClassFile){
+// // IType enclosingType =
+// // ((IClassFile)markerElement).getType().getDeclaringType();
+// // if (enclosingType != null){
+// // markerElement = enclosingType.getClassFile(); // retry with immediate
+// // enclosing classfile
+// // continue;
+// // }
+// // }
+// // break;
+// // }
+// return false;
+// }
/**
* Creates and returns a new classpath entry of kind
* @see JavaCore#newContainerEntry(IPath, boolean)
* @since 2.0
*/
- public static IClasspathEntry newContainerEntry(IPath containerPath) {
-
- return newContainerEntry(containerPath, false);
- }
+// public static IClasspathEntry newContainerEntry(IPath containerPath) {
+//
+// return newContainerEntry(containerPath, false);
+// }
/**
* Creates and returns a new classpath entry of kind
*
* @see JavaCore#newProjectEntry(IPath, boolean)
*/
- public static IClasspathEntry newProjectEntry(IPath path) {
- return newProjectEntry(path, false);
- }
+// public static IClasspathEntry newProjectEntry(IPath path) {
+// return newProjectEntry(path, false);
+// }
/**
* Creates and returns a new classpath entry of kind
*
* @return a new empty region
*/
- public static IRegion newRegion() {
- return new Region();
- }
+// public static IRegion newRegion() {
+// return new Region();
+// }
/**
* Creates and returns a new classpath entry of kind <code>CPE_SOURCE</code>
* @see #newSourceEntry(IPath, IPath[], IPath[], IPath)
* @since 2.1
*/
- public static IClasspathEntry newSourceEntry(IPath path,
- IPath[] exclusionPatterns) {
-
- return newSourceEntry(path, ClasspathEntry.INCLUDE_ALL,
- exclusionPatterns, null /* output location */);
- }
+// public static IClasspathEntry newSourceEntry(IPath path,
+// IPath[] exclusionPatterns) {
+//
+// return newSourceEntry(path, ClasspathEntry.INCLUDE_ALL,
+// exclusionPatterns, null /* output location */);
+// }
/**
* Creates and returns a new classpath entry of kind <code>CPE_SOURCE</code>
* (non-Javadoc) Method declared on IExecutableExtension. Record any
* necessary initialization data from the plugin.
*/
- public void setInitializationData(IConfigurationElement cfig,
- String propertyName, Object data) throws CoreException {
- }
+// public void setInitializationData(IConfigurationElement cfig,
+// String propertyName, Object data) throws CoreException {
+// }
/**
* Sets the current table of options. All and only the options explicitly
* @see IJavaModelStatusConstants
*/
public class JavaModelException extends CoreException {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -1142217552048425936L;
CoreException nestedCoreException;
/**
* @see JavaCore#setOptions(java.util.Hashtable)
* @see JavaCore#getDefaultOptions()
*/
- public static String removePrefixAndSuffixForArgumentName(
- IJavaProject javaProject, String argumentName) {
- return String.valueOf(removePrefixAndSuffixForArgumentName(javaProject,
- argumentName.toCharArray()));
- }
+// public static String removePrefixAndSuffixForArgumentName(
+// IJavaProject javaProject, String argumentName) {
+// return String.valueOf(removePrefixAndSuffixForArgumentName(javaProject,
+// argumentName.toCharArray()));
+// }
/**
* Remove prefix and suffix from a field name.
* @see JavaCore#setOptions(java.util.Hashtable)
* @see JavaCore#getDefaultOptions()
*/
- public static String removePrefixAndSuffixForFieldName(
- IJavaProject javaProject, String fieldName, int modifiers) {
- return String.valueOf(removePrefixAndSuffixForFieldName(javaProject,
- fieldName.toCharArray(), modifiers));
- }
+// public static String removePrefixAndSuffixForFieldName(
+// IJavaProject javaProject, String fieldName, int modifiers) {
+// return String.valueOf(removePrefixAndSuffixForFieldName(javaProject,
+// fieldName.toCharArray(), modifiers));
+// }
/**
* Remove prefix and suffix from a local variable name.
* @see JavaCore#setOptions(java.util.Hashtable)
* @see JavaCore#getDefaultOptions()
*/
- public static String removePrefixAndSuffixForLocalVariableName(
- IJavaProject javaProject, String localName) {
- return String.valueOf(removePrefixAndSuffixForLocalVariableName(
- javaProject, localName.toCharArray()));
- }
+// public static String removePrefixAndSuffixForLocalVariableName(
+// IJavaProject javaProject, String localName) {
+// return String.valueOf(removePrefixAndSuffixForLocalVariableName(
+// javaProject, localName.toCharArray()));
+// }
/**
* Suggest names for an argument. The name is computed from argument's type
* @see JavaCore#setOptions(java.util.Hashtable)
* @see JavaCore#getDefaultOptions()
*/
- public static String[] suggestArgumentNames(IJavaProject javaProject,
- String packageName, String qualifiedTypeName, int dim,
- String[] excludedNames) {
- return convertCharsToString(suggestArgumentNames(javaProject,
- packageName.toCharArray(), qualifiedTypeName.toCharArray(),
- dim, convertStringToChars(excludedNames)));
- }
+// public static String[] suggestArgumentNames(IJavaProject javaProject,
+// String packageName, String qualifiedTypeName, int dim,
+// String[] excludedNames) {
+// return convertCharsToString(suggestArgumentNames(javaProject,
+// packageName.toCharArray(), qualifiedTypeName.toCharArray(),
+// dim, convertStringToChars(excludedNames)));
+// }
/**
* Suggest names for a field. The name is computed from field's type and
* @see JavaCore#setOptions(java.util.Hashtable)
* @see JavaCore#getDefaultOptions()
*/
- public static String[] suggestFieldNames(IJavaProject javaProject,
- String packageName, String qualifiedTypeName, int dim,
- int modifiers, String[] excludedNames) {
- return convertCharsToString(suggestFieldNames(javaProject, packageName
- .toCharArray(), qualifiedTypeName.toCharArray(), dim,
- modifiers, convertStringToChars(excludedNames)));
- }
+// public static String[] suggestFieldNames(IJavaProject javaProject,
+// String packageName, String qualifiedTypeName, int dim,
+// int modifiers, String[] excludedNames) {
+// return convertCharsToString(suggestFieldNames(javaProject, packageName
+// .toCharArray(), qualifiedTypeName.toCharArray(), dim,
+// modifiers, convertStringToChars(excludedNames)));
+// }
/**
* Suggest names for a local variable. The name is computed from variable's
* @see JavaCore#setOptions(java.util.Hashtable)
* @see JavaCore#getDefaultOptions()
*/
- public static String[] suggestLocalVariableNames(IJavaProject javaProject,
- String packageName, String qualifiedTypeName, int dim,
- String[] excludedNames) {
- return convertCharsToString(suggestLocalVariableNames(javaProject,
- packageName.toCharArray(), qualifiedTypeName.toCharArray(),
- dim, convertStringToChars(excludedNames)));
- }
+// public static String[] suggestLocalVariableNames(IJavaProject javaProject,
+// String packageName, String qualifiedTypeName, int dim,
+// String[] excludedNames) {
+// return convertCharsToString(suggestLocalVariableNames(javaProject,
+// packageName.toCharArray(), qualifiedTypeName.toCharArray(),
+// dim, convertStringToChars(excludedNames)));
+// }
/**
* Suggest name for a getter method. The name is computed from field's name
return newName;
}
- private static String[] convertCharsToString(char[][] c) {
- int length = c == null ? 0 : c.length;
- String[] s = new String[length];
- for (int i = 0; i < length; i++) {
- s[i] = String.valueOf(c[i]);
- }
- return s;
- }
+// private static String[] convertCharsToString(char[][] c) {
+// int length = c == null ? 0 : c.length;
+// String[] s = new String[length];
+// for (int i = 0; i < length; i++) {
+// s[i] = String.valueOf(c[i]);
+// }
+// return s;
+// }
private static char[][] convertStringToChars(String[] s) {
int length = s == null ? 0 : s.length;
* @exception IllegalArgumentException
* if the signature is not syntactically correct
*/
- public static String getElementType(String typeSignature)
- throws IllegalArgumentException {
- return new String(getElementType(typeSignature.toCharArray()));
- }
+// public static String getElementType(String typeSignature)
+// throws IllegalArgumentException {
+// return new String(getElementType(typeSignature.toCharArray()));
+// }
/**
* Returns the number of parameter types in the given method signature.
* @exception IllegalArgumentException
* if the signature is not syntactically correct
*/
- public static int getParameterCount(String methodSignature)
- throws IllegalArgumentException {
- return getParameterCount(methodSignature.toCharArray());
- }
+// public static int getParameterCount(String methodSignature)
+// throws IllegalArgumentException {
+// return getParameterCount(methodSignature.toCharArray());
+// }
/**
* Extracts the parameter type signatures from the given method signature.
* if name is null
* @since 2.0
*/
- public static char[] getQualifier(char[] name) {
- int lastDot = CharOperation.lastIndexOf(C_DOT, name);
- if (lastDot == -1) {
- return CharOperation.NO_CHAR;
- }
- return CharOperation.subarray(name, 0, lastDot);
- }
+// public static char[] getQualifier(char[] name) {
+// int lastDot = CharOperation.lastIndexOf(C_DOT, name);
+// if (lastDot == -1) {
+// return CharOperation.NO_CHAR;
+// }
+// return CharOperation.subarray(name, 0, lastDot);
+// }
/**
* Returns a string containing all but the last segment of the given
* if name is null
* @since 2.0
*/
- public static char[] getSimpleName(char[] name) {
- int lastDot = CharOperation.lastIndexOf(C_DOT, name);
- if (lastDot == -1) {
- return name;
- }
- return CharOperation.subarray(name, lastDot + 1, name.length);
- }
+// public static char[] getSimpleName(char[] name) {
+// int lastDot = CharOperation.lastIndexOf(C_DOT, name);
+// if (lastDot == -1) {
+// return name;
+// }
+// return CharOperation.subarray(name, lastDot + 1, name.length);
+// }
/**
* Returns the last segment of the given dot-separated qualified name.
*
* @since 2.0
*/
- public static char[] toCharArray(char[] signature)
- throws IllegalArgumentException {
- try {
- int sigLength = signature.length;
-
- if (sigLength == 0 || signature[0] == C_PARAM_START) {
- return toCharArray(signature, CharOperation.NO_CHAR, null,
- true, true);
- }
-
- // compute result length
- int resultLength = 0;
- int index = -1;
- while (signature[++index] == C_ARRAY) {
- resultLength += 2; // []
- }
- switch (signature[index]) {
- case C_BOOLEAN:
- resultLength += BOOLEAN.length;
- break;
- case C_BYTE:
- resultLength += BYTE.length;
- break;
- case C_CHAR:
- resultLength += CHAR.length;
- break;
- case C_DOUBLE:
- resultLength += DOUBLE.length;
- break;
- case C_FLOAT:
- resultLength += FLOAT.length;
- break;
- case C_INT:
- resultLength += INT.length;
- break;
- case C_LONG:
- resultLength += LONG.length;
- break;
- case C_SHORT:
- resultLength += SHORT.length;
- break;
- case C_VOID:
- resultLength += VOID.length;
- break;
- case C_RESOLVED:
- case C_UNRESOLVED:
- int end = CharOperation.indexOf(C_SEMICOLON, signature, index);
- if (end == -1)
- throw new IllegalArgumentException();
- int start = index + 1;
- resultLength += end - start;
- break;
- default:
- throw new IllegalArgumentException();
- }
-
- char[] result = new char[resultLength];
- copyType(signature, 0, result, 0, true);
-
- /**
- * Converts '$' separated type signatures into '.' separated type
- * signature. NOTE: This assumes that the type signature is an inner
- * type signature. This is true in most cases, but someone can
- * define a non-inner type name containing a '$'. However to tell
- * the difference, we would have to resolve the signature, which
- * cannot be done at this point.
- */
- CharOperation.replace(result, C_DOLLAR, C_DOT);
-
- return result;
- } catch (ArrayIndexOutOfBoundsException e) {
- throw new IllegalArgumentException();
- }
- }
+// public static char[] toCharArray(char[] signature)
+// throws IllegalArgumentException {
+// try {
+// int sigLength = signature.length;
+//
+// if (sigLength == 0 || signature[0] == C_PARAM_START) {
+// return toCharArray(signature, CharOperation.NO_CHAR, null,
+// true, true);
+// }
+//
+// // compute result length
+// int resultLength = 0;
+// int index = -1;
+// while (signature[++index] == C_ARRAY) {
+// resultLength += 2; // []
+// }
+// switch (signature[index]) {
+// case C_BOOLEAN:
+// resultLength += BOOLEAN.length;
+// break;
+// case C_BYTE:
+// resultLength += BYTE.length;
+// break;
+// case C_CHAR:
+// resultLength += CHAR.length;
+// break;
+// case C_DOUBLE:
+// resultLength += DOUBLE.length;
+// break;
+// case C_FLOAT:
+// resultLength += FLOAT.length;
+// break;
+// case C_INT:
+// resultLength += INT.length;
+// break;
+// case C_LONG:
+// resultLength += LONG.length;
+// break;
+// case C_SHORT:
+// resultLength += SHORT.length;
+// break;
+// case C_VOID:
+// resultLength += VOID.length;
+// break;
+// case C_RESOLVED:
+// case C_UNRESOLVED:
+// int end = CharOperation.indexOf(C_SEMICOLON, signature, index);
+// if (end == -1)
+// throw new IllegalArgumentException();
+// int start = index + 1;
+// resultLength += end - start;
+// break;
+// default:
+// throw new IllegalArgumentException();
+// }
+//
+// char[] result = new char[resultLength];
+// copyType(signature, 0, result, 0, true);
+//
+// /**
+// * Converts '$' separated type signatures into '.' separated type
+// * signature. NOTE: This assumes that the type signature is an inner
+// * type signature. This is true in most cases, but someone can
+// * define a non-inner type name containing a '$'. However to tell
+// * the difference, we would have to resolve the signature, which
+// * cannot be done at this point.
+// */
+// CharOperation.replace(result, C_DOLLAR, C_DOT);
+//
+// return result;
+// } catch (ArrayIndexOutOfBoundsException e) {
+// throw new IllegalArgumentException();
+// }
+// }
/**
* Converts the given array of qualified name segments to a qualified name.
* the list of name segments, possibly empty
* @return the dot-separated qualified name, or the empty string
*/
- public static String toQualifiedName(String[] segments) {
- int length = segments.length;
- char[][] charArrays = new char[length][];
- for (int i = 0; i < length; i++) {
- charArrays[i] = segments[i].toCharArray();
- }
- return new String(toQualifiedName(charArrays));
- }
+// public static String toQualifiedName(String[] segments) {
+// int length = segments.length;
+// char[][] charArrays = new char[length][];
+// for (int i = 0; i < length; i++) {
+// charArrays[i] = segments[i].toCharArray();
+// }
+// return new String(toQualifiedName(charArrays));
+// }
/**
* Converts the given type signature to a readable string. The signature is
* @return the concatenation of the two arrays, or null if the two arrays
* are null.
*/
- public static final char[][] arrayConcat(char[][] first, char[][] second) {
- if (first == null)
- return second;
- if (second == null)
- return first;
-
- int length1 = first.length;
- int length2 = second.length;
- char[][] result = new char[length1 + length2][];
- System.arraycopy(first, 0, result, 0, length1);
- System.arraycopy(second, 0, result, length1, length2);
- return result;
- }
+// public static final char[][] arrayConcat(char[][] first, char[][] second) {
+// if (first == null)
+// return second;
+// if (second == null)
+// return first;
+//
+// int length1 = first.length;
+// int length2 = second.length;
+// char[][] result = new char[length1 + length2][];
+// System.arraycopy(first, 0, result, 0, length1);
+// System.arraycopy(second, 0, result, length1, length2);
+// return result;
+// }
/**
* Answers a new array adding the second array at the end of first array. It
* separator between each part and appending the given name at the
* end
*/
- public static final char[] concatWith(char[] name, char[][] array,
- char separator) {
- int nameLength = name == null ? 0 : name.length;
- if (nameLength == 0)
- return concatWith(array, separator);
-
- int length = array == null ? 0 : array.length;
- if (length == 0)
- return name;
-
- int size = nameLength;
- int index = length;
- while (--index >= 0)
- if (array[index].length > 0)
- size += array[index].length + 1;
- char[] result = new char[size];
- index = size;
- for (int i = length - 1; i >= 0; i--) {
- int subLength = array[i].length;
- if (subLength > 0) {
- index -= subLength;
- System.arraycopy(array[i], 0, result, index, subLength);
- result[--index] = separator;
- }
- }
- System.arraycopy(name, 0, result, 0, nameLength);
- return result;
- }
+// public static final char[] concatWith(char[] name, char[][] array,
+// char separator) {
+// int nameLength = name == null ? 0 : name.length;
+// if (nameLength == 0)
+// return concatWith(array, separator);
+//
+// int length = array == null ? 0 : array.length;
+// if (length == 0)
+// return name;
+//
+// int size = nameLength;
+// int index = length;
+// while (--index >= 0)
+// if (array[index].length > 0)
+// size += array[index].length + 1;
+// char[] result = new char[size];
+// index = size;
+// for (int i = length - 1; i >= 0; i--) {
+// int subLength = array[i].length;
+// if (subLength > 0) {
+// index -= subLength;
+// System.arraycopy(array[i], 0, result, index, subLength);
+// result[--index] = separator;
+// }
+// }
+// System.arraycopy(name, 0, result, 0, nameLength);
+// return result;
+// }
/**
* Answers the concatenation of the given array parts using the given
* @return true if the array contains an occurrence of character, false
* otherwise.
*/
- public static final boolean contains(char character, char[][] array) {
- for (int i = array.length; --i >= 0;) {
- char[] subarray = array[i];
- for (int j = subarray.length; --j >= 0;)
- if (subarray[j] == character)
- return true;
- }
- return false;
- }
+// public static final boolean contains(char character, char[][] array) {
+// for (int i = array.length; --i >= 0;) {
+// char[] subarray = array[i];
+// for (int j = subarray.length; --j >= 0;)
+// if (subarray[j] == character)
+// return true;
+// }
+// return false;
+// }
/**
* Answers true if the array contains an occurrence of character, false
* @return true if the two arrays are identical character by character
* according to the value of isCaseSensitive, otherwise false
*/
- public static final boolean equals(char[][] first, char[][] second,
- boolean isCaseSensitive) {
-
- if (isCaseSensitive) {
- return equals(first, second);
- }
- if (first == second)
- return true;
- if (first == null || second == null)
- return false;
- if (first.length != second.length)
- return false;
-
- for (int i = first.length; --i >= 0;)
- if (!equals(first[i], second[i], false))
- return false;
- return true;
- }
+// public static final boolean equals(char[][] first, char[][] second,
+// boolean isCaseSensitive) {
+//
+// if (isCaseSensitive) {
+// return equals(first, second);
+// }
+// if (first == second)
+// return true;
+// if (first == null || second == null)
+// return false;
+// if (first.length != second.length)
+// return false;
+//
+// for (int i = first.length; --i >= 0;)
+// if (!equals(first[i], second[i], false))
+// return false;
+// return true;
+// }
/**
* Answers true if the two arrays are identical character by character,
* @exception ArrayIndexOutOfBoundsException
* if start is lower than 0
*/
- public static final int occurencesOf(char toBeFound, char[] array, int start) {
- int count = 0;
- for (int i = start; i < array.length; i++)
- if (toBeFound == array[i])
- count++;
- return count;
- }
+// public static final int occurencesOf(char toBeFound, char[] array, int start) {
+// int count = 0;
+// for (int i = start; i < array.length; i++)
+// if (toBeFound == array[i])
+// count++;
+// return count;
+// }
/**
* Answers true if the given name starts with the given prefix, false
* @exception NullPointerException
* if the given name is null or if the given prefix is null
*/
- public static final boolean prefixEquals(char[] prefix, char[] name,
- boolean isCaseSensitive) {
-
- int max = prefix.length;
- if (name.length < max)
- return false;
- if (isCaseSensitive) {
- for (int i = max; --i >= 0;)
- // assumes the prefix is not larger than the name
- if (prefix[i] != name[i])
- return false;
- return true;
- }
-
- for (int i = max; --i >= 0;)
- // assumes the prefix is not larger than the name
- if (Character.toLowerCase(prefix[i]) != Character
- .toLowerCase(name[i]))
- return false;
- return true;
- }
+// public static final boolean prefixEquals(char[] prefix, char[] name,
+// boolean isCaseSensitive) {
+//
+// int max = prefix.length;
+// if (name.length < max)
+// return false;
+// if (isCaseSensitive) {
+// for (int i = max; --i >= 0;)
+// // assumes the prefix is not larger than the name
+// if (prefix[i] != name[i])
+// return false;
+// return true;
+// }
+//
+// for (int i = max; --i >= 0;)
+// // assumes the prefix is not larger than the name
+// if (Character.toLowerCase(prefix[i]) != Character
+// .toLowerCase(name[i]))
+// return false;
+// return true;
+// }
/**
* Replace all occurrence of the character to be replaced with the
public class InvalidInputException extends Exception {
/**
+ *
+ */
+ private static final long serialVersionUID = 6181636764452047619L;
+
+ /**
* InvalidInputException constructor comment.
*/
public InvalidInputException() {
*/
public class DOMException extends RuntimeException {
/**
+ *
+ */
+ private static final long serialVersionUID = 1030600968503019789L;
+
+ /**
* Creates a new exception with no detail message.
*/
public DOMException() {