From 004da76d2b83276a1fccf1876494ba0038816c68 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Sun, 31 Jan 2016 12:25:45 +0100 Subject: 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 --- vpp-japi/japi/org/openvpp/vppjapi/vppIPv6Address.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'vpp-japi/japi/org/openvpp/vppjapi/vppIPv6Address.java') diff --git a/vpp-japi/japi/org/openvpp/vppjapi/vppIPv6Address.java b/vpp-japi/japi/org/openvpp/vppjapi/vppIPv6Address.java index efaa89c2ad5..7bf10f23402 100644 --- a/vpp-japi/japi/org/openvpp/vppjapi/vppIPv6Address.java +++ b/vpp-japi/japi/org/openvpp/vppjapi/vppIPv6Address.java @@ -16,8 +16,9 @@ package org.openvpp.vppjapi; public class vppIPv6Address { - public byte[] ip; - public byte prefixLength; + // FIXME: this is dangerous + public final byte[] ip; + public final byte prefixLength; public vppIPv6Address(byte[] _ip, byte _prefixLength) { ip = _ip; -- cgit 1.2.3-korg