Skip to content

Commit f1d6e02

Browse files
committed
[bugfix] Sonar issues
1 parent 242af0f commit f1d6e02

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

exist-core/src/main/java/org/exist/xmlrpc/RpcConnection.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,11 @@
131131
*/
132132
public class RpcConnection implements RpcAPI {
133133

134-
private final static Logger LOG = LogManager.getLogger(RpcConnection.class);
134+
private static final Logger LOG = LogManager.getLogger(RpcConnection.class);
135135

136-
public final static int MAX_DOWNLOAD_CHUNK_SIZE = 1024 * 1024; // 1 MB
137-
private final static Charset DEFAULT_ENCODING = StandardCharsets.UTF_8;
136+
public static final int MAX_DOWNLOAD_CHUNK_SIZE = 1024 * 1024; // 1 MB
137+
private static final Charset DEFAULT_ENCODING = StandardCharsets.UTF_8;
138+
private static final String EXIST_RESULT_XMLNS_EXIST = "<exist:result xmlns:exist=\"";
138139

139140
private final XmldbRequestProcessorFactory factory;
140141
private final ContentFilePool filePool;
@@ -1608,7 +1609,7 @@ protected String printAll(final DBBroker broker, final Sequence resultSet, int h
16081609
if (opt == null || opt.equalsIgnoreCase("no")) {
16091610
buf.append("<?xml version=\"1.0\"?>\n");
16101611
}
1611-
buf.append("<exist:result xmlns:exist=\"").append(Namespaces.EXIST_NS).append("\" ");
1612+
buf.append(EXIST_RESULT_XMLNS_EXIST).append(Namespaces.EXIST_NS).append("\" ");
16121613
buf.append("hitCount=\"0\"/>");
16131614
return buf.toString();
16141615
}
@@ -1621,7 +1622,7 @@ protected String printAll(final DBBroker broker, final Sequence resultSet, int h
16211622
}
16221623

16231624
final StringWriter writer = new StringWriter();
1624-
writer.write("<exist:result xmlns:exist=\"");
1625+
writer.write(EXIST_RESULT_XMLNS_EXIST);
16251626
writer.write(Namespaces.EXIST_NS);
16261627
writer.write("\" hits=\"");
16271628
writer.write(Integer.toString(resultSet.getItemCount()));
@@ -1684,7 +1685,7 @@ public String query(final String xpath, final int howmany, final int start,
16841685
final QueryResult qr = this.<QueryResult>compileQuery(broker, transaction, source, parameters).apply(compiled -> doQuery(broker, compiled, null, parameters));
16851686
if (qr == null) {
16861687
return "<?xml version=\"1.0\"?>\n"
1687-
+ "<exist:result xmlns:exist=\"" + Namespaces.EXIST_NS + "\" "
1688+
+ EXIST_RESULT_XMLNS_EXIST + Namespaces.EXIST_NS + "\" "
16881689
+ "hitCount=\"0\"/>";
16891690
}
16901691
try {
@@ -1730,6 +1731,7 @@ public Map<String, Object> queryP(final String xpath, final String documentPath,
17301731
* @throws EXistException if an internal error occurs
17311732
* @throws PermissionDeniedException If the current user is not allowed to perform this action
17321733
*/
1734+
@Deprecated
17331735
private Map<String, Object> queryP(final String xpath, final XmldbURI docUri,
17341736
final String s_id, final Map<String, Object> parameters) throws EXistException, PermissionDeniedException {
17351737

0 commit comments

Comments
 (0)