Code Review
/
netconf.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Bump upstrems
[netconf.git]
/
netconf
/
netconf-api
/
src
/
main
/
java
/
org
/
opendaylight
/
netconf
/
api
/
DocumentedException.java
diff --git
a/netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/DocumentedException.java
b/netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/DocumentedException.java
index 4007d0aa9f91a52d6643770bb908dd6d16cac0a3..b8224def1000887f311b1adf5fb633e3c30a4834 100644
(file)
--- a/
netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/DocumentedException.java
+++ b/
netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/DocumentedException.java
@@
-10,7
+10,6
@@
package org.opendaylight.netconf.api;
import static org.opendaylight.netconf.api.xml.XmlNetconfConstants.RPC_REPLY_KEY;
import static org.opendaylight.netconf.api.xml.XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0;
import static org.opendaylight.netconf.api.xml.XmlNetconfConstants.RPC_REPLY_KEY;
import static org.opendaylight.netconf.api.xml.XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
@@
-41,10
+40,6
@@
public class DocumentedException extends Exception {
public static final String ERROR_MESSAGE = "error-message";
public static final String ERROR_INFO = "error-info";
public static final String ERROR_MESSAGE = "error-message";
public static final String ERROR_INFO = "error-info";
- // FIXME: This is an RFC6241 definition, remove it once we have yangtools-7.0.5
- @Deprecated(forRemoval = true)
- public static final ErrorTag MALFORMED_MESSAGE = new ErrorTag("malformed-message");
-
private static final long serialVersionUID = 1L;
private static final Logger LOG = LoggerFactory.getLogger(DocumentedException.class);
private static final DocumentBuilderFactory BUILDER_FACTORY;
private static final long serialVersionUID = 1L;
private static final Logger LOG = LoggerFactory.getLogger(DocumentedException.class);
private static final DocumentBuilderFactory BUILDER_FACTORY;
@@
-67,7
+62,6
@@
public class DocumentedException extends Exception {
}
private final ErrorType errorType;
}
private final ErrorType errorType;
- @SuppressFBWarnings(value = "SE_BAD_FIELD", justification = "FIXME: should not be necessary with yangtools-7.0.5")
private final ErrorTag errorTag;
private final ErrorSeverity errorSeverity;
private final Map<String, String> errorInfo;
private final ErrorTag errorTag;
private final ErrorSeverity errorSeverity;
private final Map<String, String> errorInfo;
@@
-124,7
+118,7
@@
public class DocumentedException extends Exception {
ErrorSeverity errorSeverity = ErrorSeverity.ERROR;
Map<String, String> errorInfo = null;
String errorMessage = "";
ErrorSeverity errorSeverity = ErrorSeverity.ERROR;
Map<String, String> errorInfo = null;
String errorMessage = "";
- String
allErrorMessages = ""
;
+ String
Builder allErrorMessages = new StringBuilder()
;
Node rpcReply = fromDoc.getDocumentElement();
Node rpcReply = fromDoc.getDocumentElement();
@@
-156,7
+150,7
@@
public class DocumentedException extends Exception {
errorSeverity = sev != null ? sev : ErrorSeverity.ERROR;
} else if (ERROR_MESSAGE.equals(rpcErrorChild.getLocalName())) {
errorMessage = rpcErrorChild.getTextContent();
errorSeverity = sev != null ? sev : ErrorSeverity.ERROR;
} else if (ERROR_MESSAGE.equals(rpcErrorChild.getLocalName())) {
errorMessage = rpcErrorChild.getTextContent();
- allErrorMessages
= allErrorMessages + errorMessage
;
+ allErrorMessages
.append(errorMessage)
;
} else if (ERROR_INFO.equals(rpcErrorChild.getLocalName())) {
errorInfo = parseErrorInfo(rpcErrorChild);
}
} else if (ERROR_INFO.equals(rpcErrorChild.getLocalName())) {
errorInfo = parseErrorInfo(rpcErrorChild);
}
@@
-168,7
+162,7
@@
public class DocumentedException extends Exception {
if (errorInfo == null) {
errorInfo = new HashMap<>();
}
if (errorInfo == null) {
errorInfo = new HashMap<>();
}
- errorInfo.put("Multiple Errors Found", allErrorMessages);
+ errorInfo.put("Multiple Errors Found", allErrorMessages
.toString()
);
}
return new DocumentedException(errorMessage, errorType, errorTag, errorSeverity, errorInfo);
}
return new DocumentedException(errorMessage, errorType, errorTag, errorSeverity, errorInfo);