aboutsummaryrefslogtreecommitdiffstats
path: root/vpp-japi/japi/org/openvpp/vppjapi/vppL2Fib.java
diff options
context:
space:
mode:
authorRobert Varga <nite@hq.sk>2016-01-31 12:25:45 +0100
committerDave Wallace <dwallacelf@gmail.com>2016-02-01 03:00:39 +0000
commit004da76d2b83276a1fccf1876494ba0038816c68 (patch)
tree3d172effcdf0fb1cc9e722a0e8d5049a0460d268 /vpp-japi/japi/org/openvpp/vppjapi/vppL2Fib.java
parent52a3a4de071cae9fe8cad4227ab44627721ae175 (diff)
Make public fields final where possible
Class fields initialized via the constructor should be final. Also mark leaking byte[] instances with a FIXME. API users consider them immutable, but they are vulnerable to System.arrayCopy(). Also fixes constructor arguments so they do not use underscores, which is prohibited by Java 9. Change-Id: I393d55ed7234149cb3604bc92b2cb1d1207c55dc Signed-off-by: Robert Varga <nite@hq.sk>
Diffstat (limited to 'vpp-japi/japi/org/openvpp/vppjapi/vppL2Fib.java')
-rw-r--r--vpp-japi/japi/org/openvpp/vppjapi/vppL2Fib.java29
1 files changed, 15 insertions, 14 deletions
diff --git a/vpp-japi/japi/org/openvpp/vppjapi/vppL2Fib.java b/vpp-japi/japi/org/openvpp/vppjapi/vppL2Fib.java
index 9f43449d63a..b38d801e9e0 100644
--- a/vpp-japi/japi/org/openvpp/vppjapi/vppL2Fib.java
+++ b/vpp-japi/japi/org/openvpp/vppjapi/vppL2Fib.java
@@ -15,20 +15,21 @@
package org.openvpp.vppjapi;
-public class vppL2Fib {
- public byte[] physAddress;
- public boolean staticConfig;
- public String outgoingInterface;
- public boolean filter;
- public boolean bridgedVirtualInterface;
+public final class vppL2Fib {
+ // FIXME: this is dangerous
+ public final byte[] physAddress;
+ public final boolean staticConfig;
+ public final String outgoingInterface;
+ public final boolean filter;
+ public final boolean bridgedVirtualInterface;
- public vppL2Fib(byte[] _physAddress, boolean _staticConfig,
- String _outgoingInterface, boolean _filter,
- boolean _bridgedVirtualInterface) {
- physAddress = _physAddress;
- staticConfig = _staticConfig;
- outgoingInterface = _outgoingInterface;
- filter = _filter;
- bridgedVirtualInterface = _bridgedVirtualInterface;
+ public vppL2Fib(byte[] physAddress, boolean staticConfig,
+ String outgoingInterface, boolean filter,
+ boolean bridgedVirtualInterface) {
+ this.physAddress = physAddress;
+ this.staticConfig = staticConfig;
+ this.outgoingInterface = outgoingInterface;
+ this.filter = filter;
+ this.bridgedVirtualInterface = bridgedVirtualInterface;
}
}