]> source.dussan.org Git - poi.git/commitdiff
bug 58636: make ClientAnchor enum constructor private, make byId Internal
authorJaven O'Neal <onealj@apache.org>
Sun, 29 Nov 2015 02:18:45 +0000 (02:18 +0000)
committerJaven O'Neal <onealj@apache.org>
Sun, 29 Nov 2015 02:18:45 +0000 (02:18 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1717024 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/ss/usermodel/ClientAnchor.java

index b781e04b91932f0315c3b2a7a13fdc61f569958f..672c1e23028ac62071072c7ffb5ce72ccfc83f19 100644 (file)
@@ -16,6 +16,8 @@
 ==================================================================== */
 package org.apache.poi.ss.usermodel;
 
+import org.apache.poi.util.Internal;
+
 /**
  * A client anchor is attached to an excel worksheet.  It anchors against a
  * top-left and bottom-right cell.
@@ -120,10 +122,19 @@ public interface ClientAnchor {
         DONT_MOVE_AND_RESIZE(3);
         
         public final short value;
-        AnchorType(int value) {
+
+        // disallow non-sequential enum instance creation
+        private AnchorType(int value) {
             this.value = (short) value;
         }
         
+        /**
+         * return the AnchorType corresponding to the code
+         *
+         * @param value the anchor type code
+         * @return the anchor type enum
+         */
+        @Internal
         public static AnchorType byId(int value) {
             return values()[value];
         }