svn commit: r12919 - trunk/src_new/org/argouml: cognitive uml/cognitive/critics

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: linus
Date: 2007-06-28 15:10:19-0700
New Revision: 12919

Modified:
   trunk/src_new/org/argouml/cognitive/Critic.java
   trunk/src_new/org/argouml/uml/cognitive/critics/AbstractCrTooMany.java

Log:
Deprecated the arg handling in the critics.

Modified: trunk/src_new/org/argouml/cognitive/Critic.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/Critic.java?view=diff&rev=12919&p1=trunk/src_new/org/argouml/cognitive/Critic.java&p2=trunk/src_new/org/argouml/cognitive/Critic.java&r1=12918&r2=12919
==============================================================================
--- trunk/src_new/org/argouml/cognitive/Critic.java	(original)
+++ trunk/src_new/org/argouml/cognitive/Critic.java	2007-06-28 15:10:19-0700
@@ -191,6 +191,10 @@
     /**
      * Arguments used to configure the critic.
      * TODO: Could this be removed from the main critics class?
+     * @deprecated for 0.25.4 by Linus Tolke.
+     *             This way of storing information encourages
+     *             violation of type safety.
+     *             Create member attributes instead. 
      */
     private Hashtable args = new Hashtable();
 
@@ -955,6 +959,10 @@
     /**
      * @param name  the key
      * @param value the value
+     * @deprecated for 0.25.4 by Linus Tolke.
+     *             This way of storing information encourages
+     *             violation of type safety.
+     *             Create member attributes instead. 
      */
     protected void setArg(String name, Object value) {
 	args.put(name, value);
@@ -963,6 +971,10 @@
     /**
      * @param name the key
      * @return     the value
+     * @deprecated for 0.25.4 by Linus Tolke.
+     *             This way of storing information encourages
+     *             violation of type safety.
+     *             Create member attributes instead. 
      */
     protected Object getArg(String name) {
 	return args.get(name);
@@ -970,11 +982,19 @@
 
     /**
      * @return the (key, value) pairs
+     * @deprecated for 0.25.4 by Linus Tolke.
+     *             This way of storing information encourages
+     *             violation of type safety.
+     *             Create member attributes instead. 
      */
     public Hashtable  getArgs() { return args; }
 
     /**
      * @param h the new table of (key, value) pairs
+     * @deprecated for 0.25.4 by Linus Tolke.
+     *             This way of storing information encourages
+     *             violation of type safety.
+     *             Create member attributes instead. 
      */
     public void setArgs(Hashtable h) { args = h; }
 

Modified: trunk/src_new/org/argouml/uml/cognitive/critics/AbstractCrTooMany.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/AbstractCrTooMany.java?view=diff&rev=12919&p1=trunk/src_new/org/argouml/uml/cognitive/critics/AbstractCrTooMany.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/AbstractCrTooMany.java&r1=12918&r2=12919
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/AbstractCrTooMany.java	(original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/AbstractCrTooMany.java	2007-06-28 15:10:19-0700
@@ -35,8 +35,8 @@
  * @author mkl
  */
 public abstract class AbstractCrTooMany extends CrUML {
-
-    private static final String THRESHOLD = "Threshold";
+    
+    private int criticThreshold;
 
     /**
      * Set the threshold.
@@ -46,7 +46,7 @@
      * @param threshold The threshold to compare to.
      */
     public void setThreshold(int threshold) {
-        setArg(THRESHOLD, new Integer(threshold));
+        criticThreshold = threshold;
     }
 
     /**
@@ -57,13 +57,13 @@
      * @return The current threshold.
      */
     public int getThreshold() {
-        return ((Integer) getArg(THRESHOLD)).intValue();
+        return criticThreshold;
     }
 
     /**
      * Provide a default wizard to adjust the threshold.
      *
-     * @see org.argouml.cognitive.Critic#getWizardClass(org.argouml.cognitive.ToDoItem)
+     * {@inheritDoc}
      */
     public Class getWizardClass(ToDoItem item) {
         return WizTooMany.class;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.