Skip to content

Commit 36a59a2

Browse files
committed
cleanup
1 parent b70c0a7 commit 36a59a2

2 files changed

Lines changed: 53 additions & 63 deletions

File tree

src/main/java/org/htmlunit/xpath/compiler/FunctionTable.java

Lines changed: 28 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -163,41 +163,34 @@ public class FunctionTable {
163163
}
164164

165165
static {
166-
m_functionID.put(Keywords.FUNC_CURRENT_STRING, Integer.valueOf(FunctionTable.FUNC_CURRENT));
167-
m_functionID.put(Keywords.FUNC_LAST_STRING, Integer.valueOf(FunctionTable.FUNC_LAST));
168-
m_functionID.put(Keywords.FUNC_POSITION_STRING, Integer.valueOf(FunctionTable.FUNC_POSITION));
169-
m_functionID.put(Keywords.FUNC_COUNT_STRING, Integer.valueOf(FunctionTable.FUNC_COUNT));
170-
m_functionID.put(Keywords.FUNC_ID_STRING, Integer.valueOf(FunctionTable.FUNC_ID));
171-
m_functionID.put(
172-
Keywords.FUNC_LOCAL_PART_STRING, Integer.valueOf(FunctionTable.FUNC_LOCAL_PART));
173-
m_functionID.put(Keywords.FUNC_NAMESPACE_STRING, Integer.valueOf(FunctionTable.FUNC_NAMESPACE));
174-
m_functionID.put(Keywords.FUNC_NAME_STRING, Integer.valueOf(FunctionTable.FUNC_QNAME));
175-
m_functionID.put(Keywords.FUNC_NOT_STRING, Integer.valueOf(FunctionTable.FUNC_NOT));
176-
m_functionID.put(Keywords.FUNC_TRUE_STRING, Integer.valueOf(FunctionTable.FUNC_TRUE));
177-
m_functionID.put(Keywords.FUNC_FALSE_STRING, Integer.valueOf(FunctionTable.FUNC_FALSE));
178-
m_functionID.put(Keywords.FUNC_BOOLEAN_STRING, Integer.valueOf(FunctionTable.FUNC_BOOLEAN));
179-
m_functionID.put(Keywords.FUNC_LANG_STRING, Integer.valueOf(FunctionTable.FUNC_LANG));
180-
m_functionID.put(Keywords.FUNC_NUMBER_STRING, Integer.valueOf(FunctionTable.FUNC_NUMBER));
181-
m_functionID.put(Keywords.FUNC_FLOOR_STRING, Integer.valueOf(FunctionTable.FUNC_FLOOR));
182-
m_functionID.put(Keywords.FUNC_CEILING_STRING, Integer.valueOf(FunctionTable.FUNC_CEILING));
183-
m_functionID.put(Keywords.FUNC_ROUND_STRING, Integer.valueOf(FunctionTable.FUNC_ROUND));
184-
m_functionID.put(Keywords.FUNC_SUM_STRING, Integer.valueOf(FunctionTable.FUNC_SUM));
185-
m_functionID.put(Keywords.FUNC_STRING_STRING, Integer.valueOf(FunctionTable.FUNC_STRING));
186-
m_functionID.put(
187-
Keywords.FUNC_STARTS_WITH_STRING, Integer.valueOf(FunctionTable.FUNC_STARTS_WITH));
188-
m_functionID.put(Keywords.FUNC_CONTAINS_STRING, Integer.valueOf(FunctionTable.FUNC_CONTAINS));
189-
m_functionID.put(
190-
Keywords.FUNC_SUBSTRING_BEFORE_STRING,
191-
Integer.valueOf(FunctionTable.FUNC_SUBSTRING_BEFORE));
192-
m_functionID.put(
193-
Keywords.FUNC_SUBSTRING_AFTER_STRING, Integer.valueOf(FunctionTable.FUNC_SUBSTRING_AFTER));
194-
m_functionID.put(
195-
Keywords.FUNC_NORMALIZE_SPACE_STRING, Integer.valueOf(FunctionTable.FUNC_NORMALIZE_SPACE));
196-
m_functionID.put(Keywords.FUNC_TRANSLATE_STRING, Integer.valueOf(FunctionTable.FUNC_TRANSLATE));
197-
m_functionID.put(Keywords.FUNC_CONCAT_STRING, Integer.valueOf(FunctionTable.FUNC_CONCAT));
198-
m_functionID.put(Keywords.FUNC_SUBSTRING_STRING, Integer.valueOf(FunctionTable.FUNC_SUBSTRING));
199-
m_functionID.put(
200-
Keywords.FUNC_STRING_LENGTH_STRING, Integer.valueOf(FunctionTable.FUNC_STRING_LENGTH));
166+
m_functionID.put(Keywords.FUNC_CURRENT_STRING, FunctionTable.FUNC_CURRENT);
167+
m_functionID.put(Keywords.FUNC_LAST_STRING, FunctionTable.FUNC_LAST);
168+
m_functionID.put(Keywords.FUNC_POSITION_STRING, FunctionTable.FUNC_POSITION);
169+
m_functionID.put(Keywords.FUNC_COUNT_STRING, FunctionTable.FUNC_COUNT);
170+
m_functionID.put(Keywords.FUNC_ID_STRING, FunctionTable.FUNC_ID);
171+
m_functionID.put(Keywords.FUNC_LOCAL_PART_STRING, FunctionTable.FUNC_LOCAL_PART);
172+
m_functionID.put(Keywords.FUNC_NAMESPACE_STRING, FunctionTable.FUNC_NAMESPACE);
173+
m_functionID.put(Keywords.FUNC_NAME_STRING, FunctionTable.FUNC_QNAME);
174+
m_functionID.put(Keywords.FUNC_NOT_STRING, FunctionTable.FUNC_NOT);
175+
m_functionID.put(Keywords.FUNC_TRUE_STRING, FunctionTable.FUNC_TRUE);
176+
m_functionID.put(Keywords.FUNC_FALSE_STRING, FunctionTable.FUNC_FALSE);
177+
m_functionID.put(Keywords.FUNC_BOOLEAN_STRING, FunctionTable.FUNC_BOOLEAN);
178+
m_functionID.put(Keywords.FUNC_LANG_STRING, FunctionTable.FUNC_LANG);
179+
m_functionID.put(Keywords.FUNC_NUMBER_STRING, FunctionTable.FUNC_NUMBER);
180+
m_functionID.put(Keywords.FUNC_FLOOR_STRING, FunctionTable.FUNC_FLOOR);
181+
m_functionID.put(Keywords.FUNC_CEILING_STRING, FunctionTable.FUNC_CEILING);
182+
m_functionID.put(Keywords.FUNC_ROUND_STRING, FunctionTable.FUNC_ROUND);
183+
m_functionID.put(Keywords.FUNC_SUM_STRING, FunctionTable.FUNC_SUM);
184+
m_functionID.put(Keywords.FUNC_STRING_STRING, FunctionTable.FUNC_STRING);
185+
m_functionID.put(Keywords.FUNC_STARTS_WITH_STRING, FunctionTable.FUNC_STARTS_WITH);
186+
m_functionID.put(Keywords.FUNC_CONTAINS_STRING, FunctionTable.FUNC_CONTAINS);
187+
m_functionID.put(Keywords.FUNC_SUBSTRING_BEFORE_STRING, FunctionTable.FUNC_SUBSTRING_BEFORE);
188+
m_functionID.put(Keywords.FUNC_SUBSTRING_AFTER_STRING, FunctionTable.FUNC_SUBSTRING_AFTER);
189+
m_functionID.put(Keywords.FUNC_NORMALIZE_SPACE_STRING, FunctionTable.FUNC_NORMALIZE_SPACE);
190+
m_functionID.put(Keywords.FUNC_TRANSLATE_STRING, FunctionTable.FUNC_TRANSLATE);
191+
m_functionID.put(Keywords.FUNC_CONCAT_STRING, FunctionTable.FUNC_CONCAT);
192+
m_functionID.put(Keywords.FUNC_SUBSTRING_STRING, FunctionTable.FUNC_SUBSTRING);
193+
m_functionID.put(Keywords.FUNC_STRING_LENGTH_STRING, FunctionTable.FUNC_STRING_LENGTH);
201194
}
202195

203196
public FunctionTable() {

src/main/java/org/htmlunit/xpath/compiler/Keywords.java

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -176,34 +176,31 @@ public class Keywords {
176176
public static final String FUNC_STRING_LENGTH_STRING = "string-length";
177177

178178
static {
179-
m_axisnames.put(FROM_ANCESTORS_STRING, Integer.valueOf(OpCodes.FROM_ANCESTORS));
180-
m_axisnames.put(FROM_ANCESTORS_OR_SELF_STRING, Integer.valueOf(OpCodes.FROM_ANCESTORS_OR_SELF));
181-
m_axisnames.put(FROM_ATTRIBUTES_STRING, Integer.valueOf(OpCodes.FROM_ATTRIBUTES));
182-
m_axisnames.put(FROM_CHILDREN_STRING, Integer.valueOf(OpCodes.FROM_CHILDREN));
183-
m_axisnames.put(FROM_DESCENDANTS_STRING, Integer.valueOf(OpCodes.FROM_DESCENDANTS));
184-
m_axisnames.put(
185-
FROM_DESCENDANTS_OR_SELF_STRING, Integer.valueOf(OpCodes.FROM_DESCENDANTS_OR_SELF));
186-
m_axisnames.put(FROM_FOLLOWING_STRING, Integer.valueOf(OpCodes.FROM_FOLLOWING));
187-
m_axisnames.put(
188-
FROM_FOLLOWING_SIBLINGS_STRING, Integer.valueOf(OpCodes.FROM_FOLLOWING_SIBLINGS));
189-
m_axisnames.put(FROM_PARENT_STRING, Integer.valueOf(OpCodes.FROM_PARENT));
190-
m_axisnames.put(FROM_PRECEDING_STRING, Integer.valueOf(OpCodes.FROM_PRECEDING));
191-
m_axisnames.put(
192-
FROM_PRECEDING_SIBLINGS_STRING, Integer.valueOf(OpCodes.FROM_PRECEDING_SIBLINGS));
193-
m_axisnames.put(FROM_SELF_STRING, Integer.valueOf(OpCodes.FROM_SELF));
194-
m_axisnames.put(FROM_NAMESPACE_STRING, Integer.valueOf(OpCodes.FROM_NAMESPACE));
195-
m_nodetypes.put(NODETYPE_COMMENT_STRING, Integer.valueOf(OpCodes.NODETYPE_COMMENT));
196-
m_nodetypes.put(NODETYPE_TEXT_STRING, Integer.valueOf(OpCodes.NODETYPE_TEXT));
197-
m_nodetypes.put(NODETYPE_PI_STRING, Integer.valueOf(OpCodes.NODETYPE_PI));
198-
m_nodetypes.put(NODETYPE_NODE_STRING, Integer.valueOf(OpCodes.NODETYPE_NODE));
199-
m_nodetypes.put(NODETYPE_ANYELEMENT_STRING, Integer.valueOf(OpCodes.NODETYPE_ANYELEMENT));
200-
m_keywords.put(FROM_SELF_ABBREVIATED_STRING, Integer.valueOf(OpCodes.FROM_SELF));
201-
m_keywords.put(FUNC_ID_STRING, Integer.valueOf(FunctionTable.FUNC_ID));
202-
203-
m_nodetests.put(NODETYPE_COMMENT_STRING, Integer.valueOf(OpCodes.NODETYPE_COMMENT));
204-
m_nodetests.put(NODETYPE_TEXT_STRING, Integer.valueOf(OpCodes.NODETYPE_TEXT));
205-
m_nodetests.put(NODETYPE_PI_STRING, Integer.valueOf(OpCodes.NODETYPE_PI));
206-
m_nodetests.put(NODETYPE_NODE_STRING, Integer.valueOf(OpCodes.NODETYPE_NODE));
179+
m_axisnames.put(FROM_ANCESTORS_STRING, OpCodes.FROM_ANCESTORS);
180+
m_axisnames.put(FROM_ANCESTORS_OR_SELF_STRING, OpCodes.FROM_ANCESTORS_OR_SELF);
181+
m_axisnames.put(FROM_ATTRIBUTES_STRING, OpCodes.FROM_ATTRIBUTES);
182+
m_axisnames.put(FROM_CHILDREN_STRING, OpCodes.FROM_CHILDREN);
183+
m_axisnames.put(FROM_DESCENDANTS_STRING, OpCodes.FROM_DESCENDANTS);
184+
m_axisnames.put(FROM_DESCENDANTS_OR_SELF_STRING, OpCodes.FROM_DESCENDANTS_OR_SELF);
185+
m_axisnames.put(FROM_FOLLOWING_STRING, OpCodes.FROM_FOLLOWING);
186+
m_axisnames.put(FROM_FOLLOWING_SIBLINGS_STRING, OpCodes.FROM_FOLLOWING_SIBLINGS);
187+
m_axisnames.put(FROM_PARENT_STRING, OpCodes.FROM_PARENT);
188+
m_axisnames.put(FROM_PRECEDING_STRING, OpCodes.FROM_PRECEDING);
189+
m_axisnames.put(FROM_PRECEDING_SIBLINGS_STRING, OpCodes.FROM_PRECEDING_SIBLINGS);
190+
m_axisnames.put(FROM_SELF_STRING, OpCodes.FROM_SELF);
191+
m_axisnames.put(FROM_NAMESPACE_STRING, OpCodes.FROM_NAMESPACE);
192+
m_nodetypes.put(NODETYPE_COMMENT_STRING, OpCodes.NODETYPE_COMMENT);
193+
m_nodetypes.put(NODETYPE_TEXT_STRING, OpCodes.NODETYPE_TEXT);
194+
m_nodetypes.put(NODETYPE_PI_STRING, OpCodes.NODETYPE_PI);
195+
m_nodetypes.put(NODETYPE_NODE_STRING, OpCodes.NODETYPE_NODE);
196+
m_nodetypes.put(NODETYPE_ANYELEMENT_STRING, OpCodes.NODETYPE_ANYELEMENT);
197+
m_keywords.put(FROM_SELF_ABBREVIATED_STRING, OpCodes.FROM_SELF);
198+
m_keywords.put(FUNC_ID_STRING, FunctionTable.FUNC_ID);
199+
200+
m_nodetests.put(NODETYPE_COMMENT_STRING, OpCodes.NODETYPE_COMMENT);
201+
m_nodetests.put(NODETYPE_TEXT_STRING, OpCodes.NODETYPE_TEXT);
202+
m_nodetests.put(NODETYPE_PI_STRING, OpCodes.NODETYPE_PI);
203+
m_nodetests.put(NODETYPE_NODE_STRING, OpCodes.NODETYPE_NODE);
207204
}
208205

209206
static Object getAxisName(final String key) {

0 commit comments

Comments
 (0)