Skip to content

Commit 09f0d06

Browse files
committed
[refactor] Implement suggestions of Codacy
1 parent 8b18011 commit 09f0d06

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

extensions/indexes/range/src/main/java/org/exist/indexing/range/RangeIndexConfigElement.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.apache.lucene.util.NumericUtils;
2929
import org.exist.dom.QName;
3030
import org.exist.indexing.lucene.LuceneIndexConfig;
31+
import org.exist.indexing.range.conversion.TypeConverter;
3132
import org.exist.storage.NodePath;
3233
import org.exist.util.DatabaseConfigurationException;
3334
import org.exist.util.XMLString;
@@ -58,7 +59,7 @@ public class RangeIndexConfigElement {
5859
protected boolean caseSensitive = true;
5960
protected boolean usesCollation = false;
6061
protected int wsTreatment = XMLString.SUPPRESS_NONE;
61-
private org.exist.indexing.range.conversion.TypeConverter typeConverter = null;
62+
private TypeConverter typeConverter = null;
6263

6364
public RangeIndexConfigElement(Element node, Map<String, String> namespaces) throws DatabaseConfigurationException {
6465
String match = node.getAttribute(MATCH_ATTR);
@@ -113,7 +114,7 @@ public RangeIndexConfigElement(Element node, Map<String, String> namespaces) thr
113114
if (!custom.isEmpty()) {
114115
try {
115116
final Class<?> customClass = Class.forName(custom);
116-
typeConverter = (org.exist.indexing.range.conversion.TypeConverter) customClass.getDeclaredConstructor().newInstance();
117+
typeConverter = (TypeConverter) customClass.getDeclaredConstructor().newInstance();
117118
} catch (ClassNotFoundException e) {
118119
RangeIndex.LOG.warn("Class for custom-type not found: {}", custom);
119120
} catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
@@ -136,7 +137,7 @@ private void parseChildren(final Node root) throws DatabaseConfigurationExceptio
136137

137138
public Field convertToField(String fieldName, String content) throws IOException {
138139
// check if a converter is defined for this index to handle on-the-fly conversions
139-
final org.exist.indexing.range.conversion.TypeConverter custom = getTypeConverter(fieldName);
140+
final TypeConverter custom = getTypeConverter(fieldName);
140141
if (custom != null) {
141142
return custom.toField(fieldName, content);
142143
}
@@ -309,7 +310,7 @@ public int getType() {
309310
return type;
310311
}
311312

312-
public org.exist.indexing.range.conversion.TypeConverter getTypeConverter(String fieldName) {
313+
public TypeConverter getTypeConverter(String fieldName) {
313314
return typeConverter;
314315
}
315316

extensions/indexes/range/src/main/java/org/exist/indexing/range/RangeIndexConfigField.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
*/
2222
package org.exist.indexing.range;
2323

24+
import org.exist.indexing.range.conversion.TypeConverter;
2425
import org.exist.storage.NodePath;
2526
import org.exist.util.DatabaseConfigurationException;
2627
import org.exist.util.XMLString;
@@ -45,7 +46,7 @@ public class RangeIndexConfigField {
4546
private NodePath path = null;
4647
private NodePath relPath = null;
4748
private int type = Type.STRING;
48-
private org.exist.indexing.range.conversion.TypeConverter typeConverter = null;
49+
private TypeConverter typeConverter = null;
4950
protected boolean includeNested = false;
5051
protected int wsTreatment = XMLString.SUPPRESS_NONE;
5152
protected boolean caseSensitive = true;
@@ -82,7 +83,7 @@ public RangeIndexConfigField(NodePath parentPath, Element elem, Map<String, Stri
8283
if (!custom.isEmpty()) {
8384
try {
8485
final Class<?> customClass = Class.forName(custom);
85-
typeConverter = (org.exist.indexing.range.conversion.TypeConverter) customClass.getDeclaredConstructor().newInstance();
86+
typeConverter = (TypeConverter) customClass.getDeclaredConstructor().newInstance();
8687
} catch (ClassNotFoundException e) {
8788
RangeIndex.LOG.warn("Class for custom-type not found: {}", custom);
8889
} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
@@ -121,7 +122,7 @@ public int getType() {
121122
return type;
122123
}
123124

124-
public org.exist.indexing.range.conversion.TypeConverter getTypeConverter() {
125+
public TypeConverter getTypeConverter() {
125126
return typeConverter;
126127
}
127128

0 commit comments

Comments
 (0)