You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by pl...@apache.org on 2015/12/07 04:33:50 UTC
[20/26] directory-kerby git commit: ASN1. Avoiding the clone of field
info array
ASN1. Avoiding the clone of field info array
Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/0a7853dc
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/0a7853dc
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/0a7853dc
Branch: refs/heads/pkinit-support
Commit: 0a7853dc9158ace1b00b9a6d876e11ca630ac5a6
Parents: e1a4c3a
Author: Kai Zheng <ka...@intel.com>
Authored: Fri Dec 4 18:43:49 2015 +0800
Committer: Kai Zheng <ka...@intel.com>
Committed: Fri Dec 4 18:43:49 2015 +0800
----------------------------------------------------------------------
.../org/apache/kerby/asn1/type/Asn1CollectionType.java | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/0a7853dc/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1CollectionType.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1CollectionType.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1CollectionType.java
index 63092a3..a295a59 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1CollectionType.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1CollectionType.java
@@ -30,15 +30,17 @@ import java.nio.ByteBuffer;
/**
* For collection type that may consist of tagged fields
*/
-public abstract class Asn1CollectionType extends AbstractAsn1Type<Asn1CollectionType> {
- private Asn1FieldInfo[] fieldInfos;
- private Asn1Type[] fields;
+public abstract class Asn1CollectionType
+ extends AbstractAsn1Type<Asn1CollectionType> {
+ private final Asn1FieldInfo[] fieldInfos;
+ private final Asn1Type[] fields;
- public Asn1CollectionType(UniversalTag universalTag, Asn1FieldInfo[] fieldInfos) {
+ public Asn1CollectionType(UniversalTag universalTag,
+ final Asn1FieldInfo[] fieldInfos) {
super(universalTag);
setValue(this);
- this.fieldInfos = fieldInfos.clone();
+ this.fieldInfos = fieldInfos;
this.fields = new Asn1Type[fieldInfos.length];
usePrimitive(false);
}