diff options
author | Robert Varga <nite@hq.sk> | 2016-01-31 12:25:45 +0100 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2016-02-01 03:00:39 +0000 |
commit | 004da76d2b83276a1fccf1876494ba0038816c68 (patch) | |
tree | 3d172effcdf0fb1cc9e722a0e8d5049a0460d268 /vpp-japi/japi/org/openvpp/vppjapi/vppInterfaceDetails.java | |
parent | 52a3a4de071cae9fe8cad4227ab44627721ae175 (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/vppInterfaceDetails.java')
-rw-r--r-- | vpp-japi/japi/org/openvpp/vppjapi/vppInterfaceDetails.java | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/vpp-japi/japi/org/openvpp/vppjapi/vppInterfaceDetails.java b/vpp-japi/japi/org/openvpp/vppjapi/vppInterfaceDetails.java index 8bc94d20bbf..b2edae043f7 100644 --- a/vpp-japi/japi/org/openvpp/vppjapi/vppInterfaceDetails.java +++ b/vpp-japi/japi/org/openvpp/vppjapi/vppInterfaceDetails.java @@ -15,28 +15,29 @@ package org.openvpp.vppjapi; -public class vppInterfaceDetails { - public int ifIndex; - public String interfaceName; - public int supIfIndex; - public byte[] physAddr; - public byte adminUp; - public byte linkUp; - public byte linkDuplex; - public byte linkSpeed; - public int subId; - public byte subDot1ad; - public byte subNumberOfTags; - public int subOuterVlanId; - public int subInnerVlanId; - public byte subExactMatch; - public byte subDefault; - public byte subOuterVlanIdAny; - public byte subInnerVlanIdAny; - public int vtrOp; - public int vtrPushDot1q; - public int vtrTag1; - public int vtrTag2; +public final class vppInterfaceDetails { + public final int ifIndex; + public final String interfaceName; + public final int supIfIndex; + // FIXME: this is dangerous + public final byte[] physAddr; + public final byte adminUp; + public final byte linkUp; + public final byte linkDuplex; + public final byte linkSpeed; + public final int subId; + public final byte subDot1ad; + public final byte subNumberOfTags; + public final int subOuterVlanId; + public final int subInnerVlanId; + public final byte subExactMatch; + public final byte subDefault; + public final byte subOuterVlanIdAny; + public final byte subInnerVlanIdAny; + public final int vtrOp; + public final int vtrPushDot1q; + public final int vtrTag1; + public final int vtrTag2; public vppInterfaceDetails(int ifIndex, String interfaceName, int supIfIndex, byte[] physAddr, byte adminUp, byte linkUp, byte linkDuplex, byte linkSpeed, int subId, byte subDot1ad, byte subNumberOfTags, |