[Laszlo-checkins] r9022 - openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/js2doc

dda@openlaszlo.org dda at openlaszlo.org
Tue May 6 11:07:29 PDT 2008


Author: dda
Date: 2008-05-06 11:07:24 -0700 (Tue, 06 May 2008)
New Revision: 9022

Modified:
   openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/js2doc/JS2DocUtils.java
Log:
Change 20080506-dda-c by dda at lester.local on 2008-05-06 13:58:48 EDT
    in /Users/dda/laszlo/src/svn/openlaszlo/trunk-doc3
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Mark features available in all but one runtime as '(except RUNTIME)': Addendum

New Features:

Bugs Fixed: LPP-5905

Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: liorio (pending)

Documentation:

Release Notes:

Details:
    Changed implementation details per Tucker's suggestion after review.
    If the list of exceptions is shorter than the original list,
    then it is shown.  So you might have (except swf7 swf8).
    With the current list of four runtimes, (swf7 swf8 swf9
    dhtml) this won't happen, but if/when
    we have a longer runtime list, this is a helpful generalization
    
Tests:
    Verified by rebuilding, looking at specific pages,
    and comparing files in doc/reference with previous run, since no changes expected.



Modified: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/js2doc/JS2DocUtils.java
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/js2doc/JS2DocUtils.java	2008-05-06 18:07:10 UTC (rev 9021)
+++ openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/js2doc/JS2DocUtils.java	2008-05-06 18:07:24 UTC (rev 9022)
@@ -158,25 +158,6 @@
             node.setAttribute(attr, oldvalue + " " + value.trim());
     }
 
-    /**
-     * If the set has all elements from the complete set
-     * except one, return the single missing element.
-     */
-    static String findStateException(Set set, Set complete) {
-        Set notseen = new HashSet();
-
-        notseen.addAll(complete);
-        for (Iterator iter = set.iterator(); iter.hasNext();) {
-            notseen.remove((String)iter.next());
-        }
-        if (notseen.size() == 1) {
-            return (String)notseen.iterator().next();
-        }
-        else {
-            return null;
-        }
-    }
-
     static void describeConditionalState(ConditionalState state, org.w3c.dom.Element docNode) {
         if (state.inferredValue == ConditionalState.indeterminateValue) {
             Set includeSet = new HashSet();
@@ -185,9 +166,12 @@
             state.describeExclusiveConditions(includeSet);
             
             if (includeSet.isEmpty() == false) {
-                String except = findStateException(includeSet, Main.runtimeOptions);
-                if (except != null) {
-                    docNode.setAttribute("runtimes", "except " + except);
+                // Show the complement (e.g. 'except foo bar')
+                // if that list is shorter than the original list.
+                Set complement = new HashSet(Main.runtimeOptions);
+                complement.removeAll(includeSet);
+                if (complement.size() > 0 && complement.size() < includeSet.size()) {
+                    docNode.setAttribute("runtimes", "except " + optionsToString(complement));
                 } else {
                     docNode.setAttribute("runtimes", optionsToString(includeSet));
                 }



More information about the Laszlo-checkins mailing list