You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2015/08/25 16:53:58 UTC
svn commit: r1697689 - in
/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile:
AccessFlags.java Attribute.java Constant.java ConstantCP.java
ElementValue.java FieldOrMethod.java
Author: sebb
Date: Tue Aug 25 14:53:58 2015
New Revision: 1697689
URL: http://svn.apache.org/r1697689
Log:
Add deprecated markers to non-private mutable fields so usage is detected
Add getters/setters as necessary to give access
Modified:
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/AccessFlags.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Attribute.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Constant.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantCP.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ElementValue.java
commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/AccessFlags.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/AccessFlags.java?rev=1697689&r1=1697688&r2=1697689&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/AccessFlags.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/AccessFlags.java Tue Aug 25 14:53:58 2015
@@ -27,7 +27,11 @@ import org.apache.commons.bcel6.Constant
*/
public abstract class AccessFlags {
- protected int access_flags;
+ /**
+ * @deprecated will be made private; do not access directly, use getter/setter
+ */
+ @java.lang.Deprecated
+ protected int access_flags; // TODO not used externally at present
public AccessFlags() {
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Attribute.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Attribute.java?rev=1697689&r1=1697688&r2=1697689&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Attribute.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Attribute.java Tue Aug 25 14:53:58 2015
@@ -49,12 +49,28 @@ import org.apache.commons.bcel6.Constant
*/
public abstract class Attribute implements Cloneable, Node {
+ /**
+ * @deprecated will be made private; do not access directly, use getter/setter
+ */
+ @java.lang.Deprecated
protected int name_index; // Points to attribute name in constant pool TODO make private (has getter & setter)
+ /**
+ * @deprecated will be made private; do not access directly, use getter/setter
+ */
+ @java.lang.Deprecated
protected int length; // Content length of attribute field TODO make private (has getter & setter)
+ /**
+ * @deprecated will be made private; do not access directly, use getter/setter
+ */
+ @java.lang.Deprecated
protected byte tag; // Tag to distinguish subclasses TODO make private & final; supposed to be immutable
+ /**
+ * @deprecated will be made private; do not access directly, use getter/setter
+ */
+ @java.lang.Deprecated
protected ConstantPool constant_pool; // TODO make private (has getter & setter)
protected Attribute(byte tag, int name_index, int length, ConstantPool constant_pool)
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Constant.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Constant.java?rev=1697689&r1=1697688&r2=1697689&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Constant.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Constant.java Tue Aug 25 14:53:58 2015
@@ -57,6 +57,10 @@ public abstract class Constant implement
* need the tag as an index to select the corresponding class name from the
* `CONSTANT_NAMES' array.
*/
+ /**
+ * @deprecated will be made private; do not access directly, use getter/setter
+ */
+ @java.lang.Deprecated
protected byte tag; // TODO should be private & final
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantCP.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantCP.java?rev=1697689&r1=1697688&r2=1697689&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantCP.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ConstantCP.java Tue Aug 25 14:53:58 2015
@@ -39,8 +39,17 @@ public abstract class ConstantCP extends
*/
// Note that this field is used to store the
// bootstrap_method_attr_index of a ConstantInvokeDynamic.
+ /**
+ * @deprecated will be made private; do not access directly, use getter/setter
+ */
+ @java.lang.Deprecated
protected int class_index; // TODO make private (has getter & setter)
// This field has the same meaning for all subclasses.
+
+ /**
+ * @deprecated will be made private; do not access directly, use getter/setter
+ */
+ @java.lang.Deprecated
protected int name_and_type_index; // TODO make private (has getter & setter)
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ElementValue.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ElementValue.java?rev=1697689&r1=1697688&r2=1697689&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ElementValue.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/ElementValue.java Tue Aug 25 14:53:58 2015
@@ -27,8 +27,16 @@ import java.io.IOException;
*/
public abstract class ElementValue
{
+ /**
+ * @deprecated will be made private and final; do not access directly, use getter
+ */
+ @java.lang.Deprecated
protected int type; // TODO should be final
+ /**
+ * @deprecated will be made private and final; do not access directly, use getter
+ */
+ @java.lang.Deprecated
protected ConstantPool cpool; // TODO should be final
@Override
@@ -106,6 +114,16 @@ public abstract class ElementValue
}
}
+ /** @since 6.0 */
+ final ConstantPool getConstantPool() {
+ return cpool;
+ }
+
+ /** @since 6.0 */
+ final int getType() {
+ return type;
+ }
+
public String toShortString()
{
return stringifyValue();
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java?rev=1697689&r1=1697688&r2=1697689&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java Tue Aug 25 14:53:58 2015
@@ -30,12 +30,31 @@ import org.apache.commons.bcel6.Constant
*/
public abstract class FieldOrMethod extends AccessFlags implements Cloneable, Node {
- // TODO should be made private
+ /**
+ * @deprecated will be made private; do not access directly, use getter/setter
+ */
+ @java.lang.Deprecated
protected int name_index; // Points to field name in constant pool
+
+ /**
+ * @deprecated will be made private; do not access directly, use getter/setter
+ */
+ @java.lang.Deprecated
protected int signature_index; // Points to encoded signature
+
+ /**
+ * @deprecated will be made private; do not access directly, use getter/setter
+ */
+ @java.lang.Deprecated
protected Attribute[] attributes; // Collection of attributes
+
// @since 6.0
private AnnotationEntry[] annotationEntries; // annotations defined on the field or method
+
+ /**
+ * @deprecated will be made private; do not access directly, use getter/setter
+ */
+ @java.lang.Deprecated
protected ConstantPool constant_pool;
private String signatureAttributeString = null;