Fix Klocwork issues (#7)
* Fix issue 6: empty catch block
* Fix issue 6: empty catch block
* Fix issue 7: check data name size to avoid runtime exceptions
* Fix issue 10: Avoid catching nullPointerException
* Bump version
Also fixes a minor checkstyle issue (line too long)
diff --git a/src/main/java/com/intel/jndn/management/Nfdc.java b/src/main/java/com/intel/jndn/management/Nfdc.java
index f8a780d..2be7755 100644
--- a/src/main/java/com/intel/jndn/management/Nfdc.java
+++ b/src/main/java/com/intel/jndn/management/Nfdc.java
@@ -569,12 +569,16 @@
*/
private static ControlResponse sendCommand(final Face face, final Name name) throws IOException, EncodingException,
ManagementException {
+ if (face == null) {
+ throw new IllegalArgumentException("Face parameter is null.");
+ }
+
Interest interest = new Interest(name);
// forwarder must have command signing info set
try {
face.makeCommandInterest(interest);
- } catch (NullPointerException | SecurityException e) {
+ } catch (SecurityException e) {
throw new IllegalArgumentException("Failed to make command interest; ensure command signing info is set on the " +
"face.", e);
}