Skip to content

Commit 15a17bd

Browse files
committed
Some more cleanups
1 parent c4a5666 commit 15a17bd

27 files changed

+8
-2173
lines changed

bundles/org.eclipse.e4.emf.xpath/src/org/apache/commons/jxpath/BasicNodeSet.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,6 @@ public void add(final NodeSet nodeSet) {
5050
}
5151
}
5252

53-
/**
54-
* Remove a pointer from this NodeSet.
55-
* @param pointer to remove
56-
*/
57-
public void remove(final Pointer pointer) {
58-
if (pointers.remove(pointer)) {
59-
clearCacheLists();
60-
}
61-
}
62-
6353
@Override
6454
public synchronized List getPointers() {
6555
if (readOnlyPointers == null) {

bundles/org.eclipse.e4.emf.xpath/src/org/apache/commons/jxpath/JXPathContext.java

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@
1717
package org.apache.commons.jxpath;
1818

1919
import java.text.DecimalFormatSymbols;
20-
import java.util.ArrayList;
2120
import java.util.HashMap;
2221
import java.util.Iterator;
23-
import java.util.List;
2422
import java.util.Locale;
2523

2624
import org.apache.commons.jxpath.util.KeyManagerUtils;
@@ -597,23 +595,6 @@ public synchronized Locale getLocale() {
597595
return locale;
598596
}
599597

600-
/**
601-
* Sets {@link DecimalFormatSymbols} for a given name. The DecimalFormatSymbols
602-
* can be referenced as the third, optional argument in the invocation of
603-
* {@code format-number (number,format,decimal-format-name)} function.
604-
* By default, JXPath uses the symbols for the current locale.
605-
*
606-
* @param name the format name or null for default format.
607-
* @param symbols DecimalFormatSymbols
608-
*/
609-
public synchronized void setDecimalFormatSymbols(final String name,
610-
final DecimalFormatSymbols symbols) {
611-
if (decimalFormats == null) {
612-
decimalFormats = new HashMap<>();
613-
}
614-
decimalFormats.put(name, symbols);
615-
}
616-
617598
/**
618599
* Gets the named DecimalFormatSymbols.
619600
* @param name key
@@ -654,22 +635,6 @@ public synchronized boolean isLenient() {
654635
return lenient;
655636
}
656637

657-
/**
658-
* Compiles the supplied XPath and returns an internal representation
659-
* of the path that can then be evaluated. Use CompiledExpressions
660-
* when you need to evaluate the same expression multiple times
661-
* and there is a convenient place to cache CompiledExpression
662-
* between invocations.
663-
* @param xpath to compile
664-
* @return CompiledExpression
665-
*/
666-
public static CompiledExpression compile(final String xpath) {
667-
if (compilationContext == null) {
668-
compilationContext = newContext(null);
669-
}
670-
return compilationContext.compilePath(xpath);
671-
}
672-
673638
/**
674639
* Overridden by each concrete implementation of JXPathContext
675640
* to perform compilation. Is called by {@code compile()}.
@@ -678,37 +643,6 @@ public static CompiledExpression compile(final String xpath) {
678643
*/
679644
protected abstract CompiledExpression compilePath(String xpath);
680645

681-
/**
682-
* Finds the first object that matches the specified XPath. It is equivalent
683-
* to {@code getPointer(xpath).getNode()}. Note that this method
684-
* produces the same result as {@code getValue()} on object models
685-
* like JavaBeans, but a different result for DOM/JDOM etc., because it
686-
* returns the Node itself, rather than its textual contents.
687-
*
688-
* @param xpath the xpath to be evaluated
689-
* @return the found object
690-
*/
691-
public Object selectSingleNode(final String xpath) {
692-
final Pointer pointer = getPointer(xpath);
693-
return pointer == null ? null : pointer.getNode();
694-
}
695-
696-
/**
697-
* Finds all nodes that match the specified XPath.
698-
*
699-
* @param xpath the xpath to be evaluated
700-
* @return a list of found objects
701-
*/
702-
public List selectNodes(final String xpath) {
703-
final ArrayList list = new ArrayList();
704-
final Iterator<Pointer> iterator = iteratePointers(xpath);
705-
while (iterator.hasNext()) {
706-
final Pointer pointer = iterator.next();
707-
list.add(pointer.getNode());
708-
}
709-
return list;
710-
}
711-
712646
/**
713647
* Evaluates the xpath and returns the resulting object. Primitive
714648
* types are wrapped into objects.
@@ -879,22 +813,6 @@ public KeyManager getKeyManager() {
879813
return keyManager;
880814
}
881815

882-
/**
883-
* Locates a Node by a key value.
884-
* @param key string
885-
* @param value string
886-
* @return Pointer found
887-
*/
888-
public Pointer getPointerByKey(final String key, final String value) {
889-
final KeyManager manager = getKeyManager();
890-
if (manager != null) {
891-
return manager.getPointerByKey(this, key, value);
892-
}
893-
throw new JXPathException(
894-
"Cannot find an element by key - "
895-
+ "no KeyManager has been specified");
896-
}
897-
898816
/**
899817
* Locates a NodeSet by key/value.
900818
* @param key string

bundles/org.eclipse.e4.emf.xpath/src/org/apache/commons/jxpath/JXPathContextFactoryConfigurationError.java

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,6 @@ public JXPathContextFactoryConfigurationError() {
3636
this.exception = null;
3737
}
3838

39-
/**
40-
* Create a new {@code JXPathContextFactoryConfigurationError} with
41-
* the {@code String } specified as an error message.
42-
*
43-
* @param msg The error message for the exception.
44-
*/
45-
public JXPathContextFactoryConfigurationError(final String msg) {
46-
super(msg);
47-
this.exception = null;
48-
}
49-
5039
/**
5140
* Create a new {@code JXPathContextFactoryConfigurationError} with a
5241
* given {@code Exception} base cause of the error.
@@ -59,19 +48,6 @@ public JXPathContextFactoryConfigurationError(final Exception e) {
5948
this.exception = e;
6049
}
6150

62-
/**
63-
* Create a new {@code JXPathContextFactoryConfigurationError} with the
64-
* given {@code Exception} base cause and detail message.
65-
*
66-
* @param e The exception to be encapsulated in a
67-
* JXPathContextFactoryConfigurationError
68-
* @param msg The detail message.
69-
*/
70-
public JXPathContextFactoryConfigurationError(final Exception e, final String msg) {
71-
super(msg);
72-
this.exception = e;
73-
}
74-
7551
/**
7652
* Gets the message (if any) for this error . If there is no
7753
* message for the exception and there is an encapsulated

bundles/org.eclipse.e4.emf.xpath/src/org/apache/commons/jxpath/JXPathException.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,6 @@ public JXPathException(final String msg) {
4646
this.exception = null;
4747
}
4848

49-
/**
50-
* Create a new {@code JXPathException} with a
51-
* given {@code Throwable} base cause of the error.
52-
*
53-
* @param e The exception to be encapsulated in a
54-
* JXPathException.
55-
*/
56-
public JXPathException(final Throwable e) {
57-
super(e.toString());
58-
this.exception = e;
59-
}
60-
6149
/**
6250
* Create a new {@code JXPathException} with the
6351
* given {@code Exception} base cause and detail message.

bundles/org.eclipse.e4.emf.xpath/src/org/apache/commons/jxpath/ri/JXPathCompiledExpression.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,6 @@ public JXPathCompiledExpression(final String xpath, final Expression expression)
4141
this.expression = expression;
4242
}
4343

44-
/**
45-
* Gets the source expression.
46-
* @return String
47-
*/
48-
protected String getXPath() {
49-
return xpath;
50-
}
51-
52-
/**
53-
* Gets the compiled expression.
54-
* @return Expression
55-
*/
56-
protected Expression getExpression() {
57-
return expression;
58-
}
59-
6044
@Override
6145
public String toString() {
6246
return xpath;

bundles/org.eclipse.e4.emf.xpath/src/org/apache/commons/jxpath/ri/JXPathContextReferenceImpl.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -121,21 +121,6 @@ public static void addNodePointerFactory(final NodePointerFactory factory) {
121121
}
122122
}
123123

124-
/**
125-
* Removes support for additional types of objects.
126-
*
127-
* @param factory NodePointerFactory to remove
128-
* @return true if this implementation contained the specified element
129-
* @since 1.4.0
130-
*/
131-
public static boolean removeNodePointerFactory(final NodePointerFactory factory) {
132-
synchronized (nodeFactories) {
133-
final boolean remove = nodeFactories.remove(factory);
134-
nodeFactoryArray = null;
135-
return remove;
136-
}
137-
}
138-
139124
/**
140125
* Gets the registered NodePointerFactories.
141126
* @return NodePointerFactory[]
@@ -150,16 +135,6 @@ public static NodePointerFactory[] getNodePointerFactories() {
150135
private Pointer rootPointer;
151136
private Pointer contextPointer;
152137

153-
/**
154-
* Create a new JXPathContextReferenceImpl.
155-
* @param parentContext parent context
156-
* @param contextBean Object
157-
*/
158-
protected JXPathContextReferenceImpl(final JXPathContext parentContext,
159-
final Object contextBean) {
160-
this(parentContext, contextBean, null);
161-
}
162-
163138
/**
164139
* Create a new JXPathContextReferenceImpl.
165140
* @param parentContext parent context

bundles/org.eclipse.e4.emf.xpath/src/org/apache/commons/jxpath/ri/axes/RootContext.java

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public class RootContext extends EvalContext {
3232
private final NodePointer pointer;
3333
private Object[] registers;
3434
private int availableRegister = 0;
35-
public static final Object UNKNOWN_VALUE = new Object();
3635
private static final int MAX_REGISTER = 4;
3736

3837
/**
@@ -145,37 +144,6 @@ public Function getFunction(final QName functionName, final Object[] parameters)
145144
return jxpathContext.getFunction(functionName, parameters);
146145
}
147146

148-
/**
149-
* Gets a registered value.
150-
* @param id int
151-
* @return Object
152-
*/
153-
public Object getRegisteredValue(final int id) {
154-
if (registers == null || id >= MAX_REGISTER || id == -1) {
155-
return UNKNOWN_VALUE;
156-
}
157-
return registers[id];
158-
}
159-
160-
/**
161-
* Sets the next registered value.
162-
* @param value Object
163-
* @return the id that can reclaim value.
164-
*/
165-
public int setRegisteredValue(final Object value) {
166-
if (registers == null) {
167-
registers = new Object[MAX_REGISTER];
168-
for (int i = 0; i < MAX_REGISTER; i++) {
169-
registers[i] = UNKNOWN_VALUE;
170-
}
171-
}
172-
if (availableRegister >= MAX_REGISTER) {
173-
return -1;
174-
}
175-
registers[availableRegister] = value;
176-
availableRegister++;
177-
return availableRegister - 1;
178-
}
179147

180148
@Override
181149
public String toString() {

bundles/org.eclipse.e4.emf.xpath/src/org/apache/commons/jxpath/ri/compiler/Expression.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,6 @@
3636
*/
3737
public abstract class Expression {
3838

39-
/** Zero */
40-
protected static final Double ZERO = Double.valueOf(0);
41-
42-
/** One */
43-
protected static final Double ONE = Double.valueOf(1);
44-
45-
/** NaN */
46-
protected static final Double NOT_A_NUMBER = Double.valueOf(Double.NaN);
47-
4839
private boolean contextDependencyKnown = false;
4940
private boolean contextDependent;
5041

bundles/org.eclipse.e4.emf.xpath/src/org/apache/commons/jxpath/ri/model/NodePointer.java

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import org.apache.commons.jxpath.JXPathContext;
2525
import org.apache.commons.jxpath.JXPathException;
2626
import org.apache.commons.jxpath.JXPathNotFoundException;
27-
import org.apache.commons.jxpath.NodeSet;
2827
import org.apache.commons.jxpath.Pointer;
2928
import org.apache.commons.jxpath.ri.Compiler;
3029
import org.apache.commons.jxpath.ri.JXPathContextReferenceImpl;
@@ -648,31 +647,6 @@ public Pointer getPointerByID(final JXPathContext context, final String id) {
648647
return context.getPointerByID(id);
649648
}
650649

651-
/**
652-
* Locates a node by key and value.
653-
* @param context owning JXPathContext
654-
* @param key key to search for
655-
* @param value value to match
656-
* @return Pointer found
657-
*/
658-
public Pointer getPointerByKey(
659-
final JXPathContext context,
660-
final String key,
661-
final String value) {
662-
return context.getPointerByKey(key, value);
663-
}
664-
665-
/**
666-
* Find a NodeSet by key/value.
667-
* @param context owning JXPathContext
668-
* @param key key to search for
669-
* @param value value to match
670-
* @return NodeSet found
671-
*/
672-
public NodeSet getNodeSetByKey(final JXPathContext context, final String key, final Object value) {
673-
return context.getNodeSetByKey(key, value);
674-
}
675-
676650
/**
677651
* Returns an XPath that maps to this Pointer.
678652
* @return String xpath expression
@@ -800,13 +774,6 @@ private int compareNodePointers(
800774
return r == 0 ? p1.parent.compareChildNodePointers(p1, p2) : r;
801775
}
802776

803-
/**
804-
* Print internal structure of a pointer for debugging
805-
*/
806-
public void printPointerChain() {
807-
printDeep(this, "");
808-
}
809-
810777
/**
811778
* Sets the exceptionHandler of this NodePointer.
812779
* @param exceptionHandler the ExceptionHandler to set

bundles/org.eclipse.e4.emf.xpath/src/org/apache/commons/jxpath/ri/model/dom/DOMNodePointer.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,6 @@ public class DOMNodePointer extends NodePointer {
6666
public static final String XMLNS_NAMESPACE_URI =
6767
"http://www.w3.org/2000/xmlns/";
6868

69-
/**
70-
* Create a new DOMNodePointer.
71-
* @param node pointed at
72-
* @param locale Locale
73-
*/
74-
public DOMNodePointer(final Node node, final Locale locale) {
75-
super(null, locale);
76-
this.node = node;
77-
}
78-
7969
/**
8070
* Create a new DOMNodePointer.
8171
* @param node pointed at

0 commit comments

Comments
 (0)