Skip to content

Commit 1bd9c89

Browse files
committed
[refactor] Address Codacy Static Analysis issues
1 parent 6f29c0c commit 1bd9c89

File tree

3 files changed

+33
-33
lines changed

3 files changed

+33
-33
lines changed

exist-core/src/main/java/org/exist/storage/serializers/EXistOutputKeys.java

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,73 +26,73 @@ public class EXistOutputKeys {
2626
/**
2727
* Parameter "item-separator" from the XQuery serialization spec 3.1
2828
*/
29-
public final static String ITEM_SEPARATOR = "item-separator";
29+
public static final String ITEM_SEPARATOR = "item-separator";
3030

31-
public final static String OUTPUT_DOCTYPE = "output-doctype";
31+
public static final String OUTPUT_DOCTYPE = "output-doctype";
3232

33-
public final static String EXPAND_XINCLUDES = "expand-xincludes";
33+
public static final String EXPAND_XINCLUDES = "expand-xincludes";
3434

35-
public final static String PROCESS_XSL_PI = "process-xsl-pi";
35+
public static final String PROCESS_XSL_PI = "process-xsl-pi";
3636

37-
public final static String HIGHLIGHT_MATCHES = "highlight-matches";
37+
public static final String HIGHLIGHT_MATCHES = "highlight-matches";
3838

39-
public final static String INDENT_SPACES = "indent-spaces";
39+
public static final String INDENT_SPACES = "indent-spaces";
4040

41-
public final static String STYLESHEET = "stylesheet";
41+
public static final String STYLESHEET = "stylesheet";
4242

43-
public final static String STYLESHEET_PARAM = "stylesheet-param";
43+
public static final String STYLESHEET_PARAM = "stylesheet-param";
4444

45-
public final static String COMPRESS_OUTPUT = "compress-output";
45+
public static final String COMPRESS_OUTPUT = "compress-output";
4646

47-
public final static String ADD_EXIST_ID = "add-exist-id";
47+
public static final String ADD_EXIST_ID = "add-exist-id";
4848

49-
public final static String XINCLUDE_PATH = "xinclude-path";
49+
public static final String XINCLUDE_PATH = "xinclude-path";
5050

5151
/**
5252
* Enforce XHTML namespace on elements with no namespace
5353
*/
54-
public final static String ENFORCE_XHTML = "enforce-xhtml";
54+
public static final String ENFORCE_XHTML = "enforce-xhtml";
5555

5656
/**
5757
* Applies to JSON serialization only: preserve namespace prefixes in JSON properties
5858
* by replacing ":" with "_", so element foo:bar becomes "foo_bar".
5959
*/
60-
public final static String JSON_OUTPUT_NS_PREFIX = "preserve-prefix";
60+
public static final String JSON_OUTPUT_NS_PREFIX = "preserve-prefix";
6161

6262
/**
6363
* Applies to JSON serialization only: sets the jsonp callback function
6464
*/
65-
public final static String JSONP = "jsonp";
65+
public static final String JSONP = "jsonp";
6666

6767
/**
6868
* JSON serialization: prefix XML attributes with a '@' when serializing
6969
* them as JSON properties
7070
*/
71-
public final static String JSON_PREFIX_ATTRIBUTES = "prefix-attributes";
71+
public static final String JSON_PREFIX_ATTRIBUTES = "prefix-attributes";
7272

7373
/**
7474
* JSON serialization: if text nodes are encountered which consist solely of whitespace then they
7575
* will be ignored by the serializer
7676
*/
77-
public final static String JSON_IGNORE_WHITESPACE_TEXT_NODES = "json-ignore-whitespace-text-nodes";
77+
public static final String JSON_IGNORE_WHITESPACE_TEXT_NODES = "json-ignore-whitespace-text-nodes";
7878

7979
/**
8080
* Defines the output method to be used for serializing nodes within json output.
8181
*/
82-
public final static String JSON_NODE_OUTPUT_METHOD = "json-node-output-method";
82+
public static final String JSON_NODE_OUTPUT_METHOD = "json-node-output-method";
8383

8484
/**
8585
* Defines the output for JSON serializing to array even if only one item.
8686
*/
87-
public final static String JSON_ARRAY_OUTPUT = "json-array-output";
87+
public static final String JSON_ARRAY_OUTPUT = "json-array-output";
8888

8989
/**
9090
* Determines whether the presence of multiple keys in a map item with the same string value
9191
* will or will not raise serialization error err:SERE0022.
9292
*/
93-
public final static String ALLOW_DUPLICATE_NAMES = "allow-duplicate-names";
93+
public static final String ALLOW_DUPLICATE_NAMES = "allow-duplicate-names";
9494

95-
public final static String HTML_VERSION = "html-version";
95+
public static final String HTML_VERSION = "html-version";
9696

9797
/**
9898
* When serializing an XDM this should be used
@@ -103,7 +103,7 @@ public class EXistOutputKeys {
103103
*
104104
* Set to "yes" to enable xdm-serialization rules, false otherwise.
105105
*/
106-
public final static String XDM_SERIALIZATION = "xdm-serialization";
106+
public static final String XDM_SERIALIZATION = "xdm-serialization";
107107

108108
/**
109109
* Enforce newline at the end of JSON and XML documents.
@@ -113,7 +113,7 @@ public class EXistOutputKeys {
113113
* exist-db and will lead to less meaningless changes in git and tools
114114
* like diff will be able to provide more meaningful information as well.
115115
*/
116-
public final static String INSERT_FINAL_NEWLINE = "insert-final-newline";
116+
public static final String INSERT_FINAL_NEWLINE = "insert-final-newline";
117117

118-
public final static String USE_CHARACTER_MAPS = "use-character-maps";
118+
public static final String USE_CHARACTER_MAPS = "use-character-maps";
119119
}

exist-core/src/main/java/org/exist/util/serializer/AbstractSerializer.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@
3737
*/
3838
public abstract class AbstractSerializer {
3939

40-
protected final static int XML_WRITER = 0;
41-
protected final static int XHTML_WRITER = 1;
42-
protected final static int TEXT_WRITER = 2;
43-
protected final static int JSON_WRITER = 3;
44-
protected final static int XHTML5_WRITER = 4;
45-
protected final static int MICRO_XML_WRITER = 5;
46-
protected final static int HTML5_WRITER = 6;
40+
protected static final int XML_WRITER = 0;
41+
protected static final int XHTML_WRITER = 1;
42+
protected static final int TEXT_WRITER = 2;
43+
protected static final int JSON_WRITER = 3;
44+
protected static final int XHTML5_WRITER = 4;
45+
protected static final int MICRO_XML_WRITER = 5;
46+
protected static final int HTML5_WRITER = 6;
4747

48-
protected final static int CHARACTER_MAPPING_WRITER = 7;
48+
protected static final int CHARACTER_MAPPING_WRITER = 7;
4949

5050
protected SerializerWriter[] writers = {
5151
new IndentingXMLWriter(),
@@ -58,7 +58,7 @@ public abstract class AbstractSerializer {
5858
new CharacterMappingWriter()
5959
};
6060

61-
protected final static Properties defaultProperties = new Properties();
61+
protected static final Properties defaultProperties = new Properties();
6262

6363
static {
6464
defaultProperties.setProperty(OutputKeys.ENCODING, UTF_8.name());

exist-core/src/main/java/org/exist/xquery/util/SerializerUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ private static void setPropertyForMap(final Properties properties, final Paramet
568568
if (Cardinality._MANY.isSuperCardinalityOrEqualOf(parameterConvention.getCardinality())) {
569569
final SequenceIterator iterator = parameterValue.iterate();
570570
while (iterator.hasNext()) {
571-
final String existingValue = (String) properties.getProperty(localParameterName);
571+
final String existingValue = properties.getProperty(localParameterName);
572572
final String nextValue = ((QNameValue) iterator.nextItem()).getQName().toURIQualifiedName();
573573

574574
if (existingValue == null || existingValue.isEmpty()) {

0 commit comments

Comments
 (0)