Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMField.java')
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMField.java26
1 files changed, 13 insertions, 13 deletions
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMField.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMField.java
index b1ec8d31..257993c9 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMField.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMField.java
@@ -1,10 +1,10 @@
/*******************************************************************************
* Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
+ * 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
- * http://www.eclipse.org/legal/cpl-v10.html
- *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -16,7 +16,7 @@ import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.core.jdom.*;
-import org.eclipse.jdt.internal.compiler.util.Util;
+import org.eclipse.jdt.internal.core.util.Messages;
import org.eclipse.jdt.internal.core.util.CharArrayBuffer;
/**
* DOMField provides an implementation of IDOMField.
@@ -237,7 +237,7 @@ protected void becomeDetailed() throws DOMException {
DOMBuilder builder = new DOMBuilder();
IDOMField[] details= builder.createFields(source.toCharArray());
if (details.length == 0) {
- throw new DOMException(Util.bind("dom.cannotDetail")); //$NON-NLS-1$
+ throw new DOMException(Messages.dom_cannotDetail);
} else {
node= this;
for (int i= 0; i < details.length; i++) {
@@ -311,7 +311,7 @@ public String getInitializer() {
if (fInitializer != null) {
return fInitializer;
} else {
- return new String(CharOperation.subarray(fDocument, fInitializerRange[0], fInitializerRange[1] + 1));
+ return new String(fDocument, fInitializerRange[0], fInitializerRange[1] + 1 - fInitializerRange[0]);
}
} else {
return null;
@@ -324,7 +324,7 @@ public IJavaElement getJavaElement(IJavaElement parent) throws IllegalArgumentEx
if (parent.getElementType() == IJavaElement.TYPE) {
return ((IType)parent).getField(getName());
} else {
- throw new IllegalArgumentException(Util.bind("element.illegalParent")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Messages.element_illegalParent);
}
}
/**
@@ -381,16 +381,16 @@ protected char[] getSingleVariableDeclaratorContents() {
.append('=')
.append(fInitializer)
.append(';')
- .append(Util.LINE_SEPARATOR);
+ .append(org.eclipse.jdt.internal.compiler.util.Util.LINE_SEPARATOR);
} else {
buffer
.append(fDocument, fNameRange[1] + 1, fInitializerRange[0] - fNameRange[1] - 1)
.append(getInitializer())
.append(';')
- .append(Util.LINE_SEPARATOR);
+ .append(org.eclipse.jdt.internal.compiler.util.Util.LINE_SEPARATOR);
}
} else {
- buffer.append(';').append(Util.LINE_SEPARATOR);
+ buffer.append(';').append(org.eclipse.jdt.internal.compiler.util.Util.LINE_SEPARATOR);
}
return buffer.getContents();
}
@@ -574,7 +574,7 @@ protected void setIsVariableDeclarator(boolean isVariableDeclarator) {
*/
public void setName(String name) throws IllegalArgumentException {
if (name == null) {
- throw new IllegalArgumentException(Util.bind("element.nullName")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Messages.element_nullName);
} else {
super.setName(name);
setTypeAltered(true);
@@ -585,7 +585,7 @@ public void setName(String name) throws IllegalArgumentException {
*/
public void setType(String typeName) throws IllegalArgumentException {
if (typeName == null) {
- throw new IllegalArgumentException(Util.bind("element.nullType")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Messages.element_nullType);
}
becomeDetailed();
expand();

Back to the top