You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sk...@apache.org on 2008/07/03 22:55:06 UTC

svn commit: r673798 - in /myfaces/myfaces-build-tools/trunk/maven2-plugins: myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/ myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/build...

Author: skitching
Date: Thu Jul  3 13:55:05 2008
New Revision: 673798

URL: http://svn.apache.org/viewvc?rev=673798&view=rev
Log:
Tabs to spaces only

Modified:
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/BuildMetaDataMojo.java
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/MakeComponentsMojo.java
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/qdox/QdoxModelBuilder.java
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/unpack/ArtifactItem.java
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/test/java/org/apache/myfaces/buildtools/maven2/plugin/builder/MakeComponentsMojoTest.java
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/AbstractFacesMojo.java
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/util/SourceTemplate.java

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/BuildMetaDataMojo.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/BuildMetaDataMojo.java?rev=673798&r1=673797&r2=673798&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/BuildMetaDataMojo.java (original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/BuildMetaDataMojo.java Thu Jul  3 13:55:05 2008
@@ -395,71 +395,71 @@
      */
     private void validateComponents(Model model) throws MojoExecutionException
     {
-    	for(Iterator i = model.components(); i.hasNext(); )
-    	{
-    		ComponentMeta component = (ComponentMeta) i.next();
-    		validateComponent(model, component);
-    	}
+        for(Iterator i = model.components(); i.hasNext(); )
+        {
+            ComponentMeta component = (ComponentMeta) i.next();
+            validateComponent(model, component);
+        }
     }
     
     private void validateComponent(Model model, ComponentMeta component)
     throws MojoExecutionException
     {
-    	if (component.getName() != null)
-    	{
+        if (component.getName() != null)
+        {
             if (component.getDescription() == null)
             {
-            	throw new MojoExecutionException(
-                		"Missing mandatory property on component " + component.getClassName()
-                		+ " [sourceClass=" + component.getSourceClassName() + "]: description");
+                throw new MojoExecutionException(
+                        "Missing mandatory property on component " + component.getClassName()
+                        + " [sourceClass=" + component.getSourceClassName() + "]: description");
             }
 
             if (component.getType() == null)
             {
-            	throw new MojoExecutionException(
-                		"Missing mandatory property on component " + component.getClassName()
-                		+ " [sourceClass=" + component.getSourceClassName() + "]: type");
+                throw new MojoExecutionException(
+                        "Missing mandatory property on component " + component.getClassName()
+                        + " [sourceClass=" + component.getSourceClassName() + "]: type");
             }
             
-    		// this is a concrete component, so it must have a family property
-    		validateComponentFamily(model, component);
-    	}
+            // this is a concrete component, so it must have a family property
+            validateComponentFamily(model, component);
+        }
     }
     
     private void validateComponentFamily(Model model, ComponentMeta component)
     throws MojoExecutionException
     {
-    	// TODO: clean this code up, it is pretty ugly
+        // TODO: clean this code up, it is pretty ugly
         boolean familyDefined = false;
         ComponentMeta curr = component;
         while ((curr != null) && !familyDefined)
         {
-        	if (curr.getFamily() != null)
-        	{
-        		familyDefined = true;
-        	}
-        	else
-        	{
-	        	String parentName = curr.getParentClassName();
-	        	if (parentName == null)
-	        		curr = null;
-	        	else
-	        	{
-	        		curr = model.findComponentByClassName(parentName);
-	        		if (curr == null)
-	        		{
-	                	throw new MojoExecutionException(
-	                    		"Parent class not found for component " + component.getClassName()
-	                    		+ " [sourceClass=" + component.getSourceClassName() + "]");
-	        		}
-	        	}
-        	}
+            if (curr.getFamily() != null)
+            {
+                familyDefined = true;
+            }
+            else
+            {
+                String parentName = curr.getParentClassName();
+                if (parentName == null)
+                    curr = null;
+                else
+                {
+                    curr = model.findComponentByClassName(parentName);
+                    if (curr == null)
+                    {
+                        throw new MojoExecutionException(
+                                "Parent class not found for component " + component.getClassName()
+                                + " [sourceClass=" + component.getSourceClassName() + "]");
+                    }
+                }
+            }
         }
         if (!familyDefined)
         {
-        	throw new MojoExecutionException(
-        		"Missing mandatory property on component " + component.getClassName()
-        		+ " [sourceClass=" + component.getSourceClassName() + "]: family");
+            throw new MojoExecutionException(
+                "Missing mandatory property on component " + component.getClassName()
+                + " [sourceClass=" + component.getSourceClassName() + "]: family");
         }
     }
 }

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/MakeComponentsMojo.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/MakeComponentsMojo.java?rev=673798&r1=673797&r2=673798&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/MakeComponentsMojo.java (original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/MakeComponentsMojo.java Thu Jul  3 13:55:05 2008
@@ -511,48 +511,48 @@
      */
     static String cleanInitializationExpression(String expr)
     {
-    	expr = StringUtils.trim(expr);
-    	if (StringUtils.isEmpty(expr))
-    	{
-    		return null;
-    	}
-    	
-    	// split on linefeeds
-    	// trim each separately
-    	// remove any comment chars
-    	
-    	if (expr.contains("\n"))
-    	{
-    		StringBuffer buf = new StringBuffer(100);
-    		String[] lines = StringUtils.split(expr, "\n");
-    		for(int i=0; i<lines.length; ++i)
-    		{
-    			String line = lines[i];
-    			line = StringUtils.trim(line);
-    			if (!line.startsWith("//") && !StringUtils.isEmpty(line))
-    			{
-    				if (buf.length()> 0)
-    				{
-    					buf.append(" ");
-    				}
-    				buf.append(line);
-    			}
-    		}
-    		
-    		expr = buf.toString();
-    	}
-    	
-    	if (expr.startsWith("//"))
-		{
-    		return null;
-		}
+        expr = StringUtils.trim(expr);
+        if (StringUtils.isEmpty(expr))
+        {
+            return null;
+        }
+        
+        // split on linefeeds
+        // trim each separately
+        // remove any comment chars
+        
+        if (expr.contains("\n"))
+        {
+            StringBuffer buf = new StringBuffer(100);
+            String[] lines = StringUtils.split(expr, "\n");
+            for(int i=0; i<lines.length; ++i)
+            {
+                String line = lines[i];
+                line = StringUtils.trim(line);
+                if (!line.startsWith("//") && !StringUtils.isEmpty(line))
+                {
+                    if (buf.length()> 0)
+                    {
+                        buf.append(" ");
+                    }
+                    buf.append(line);
+                }
+            }
+            
+            expr = buf.toString();
+        }
+        
+        if (expr.startsWith("//"))
+        {
+            return null;
+        }
 
-    	if (StringUtils.isEmpty(expr))
-    	{
-    		return null;
-    	}
+        if (StringUtils.isEmpty(expr))
+        {
+            return null;
+        }
 
-    	return expr;
+        return expr;
     }
 
     /**

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/qdox/QdoxModelBuilder.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/qdox/QdoxModelBuilder.java?rev=673798&r1=673797&r2=673798&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/qdox/QdoxModelBuilder.java (original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/qdox/QdoxModelBuilder.java Thu Jul  3 13:55:05 2008
@@ -160,9 +160,9 @@
 
             // Check if the tag class java file exists in the source dirs
             if (isTagClassMissing(component.getTagClass(), sourceDirs))
-    		{
+            {
                 component.setGeneratedTagClass(Boolean.TRUE);
-    		}
+            }
         }
 
         // post-process the list of converters
@@ -178,9 +178,9 @@
             
             // Check if the tag class java file exists in the source dirs
             if (isTagClassMissing(converter.getTagClass(), sourceDirs))
-    		{
-            	converter.setGeneratedTagClass(Boolean.TRUE);
-    		}
+            {
+                converter.setGeneratedTagClass(Boolean.TRUE);
+            }
         }
 
         // post-process the list of validators
@@ -201,9 +201,9 @@
 
             // Check if the tag class java file exists in the source dirs
             if (isTagClassMissing(validator.getTagClass(), sourceDirs))
-    		{
-            	validator.setGeneratedTagClass(Boolean.TRUE);
-    		}
+            {
+                validator.setGeneratedTagClass(Boolean.TRUE);
+            }
         }
 
         // post-process the list of tags
@@ -220,11 +220,11 @@
      */
     private boolean isTagClassMissing(String tagClassName, List sourceDirs)
     {
-    	if (tagClassName == null)
-    	{
-    		return false;
-    	}
-    	String tagClassFile = StringUtils.replace(tagClassName,".","/")+".java";
+        if (tagClassName == null)
+        {
+            return false;
+        }
+        String tagClassFile = StringUtils.replace(tagClassName,".","/")+".java";
         return !IOUtils.existsSourceFile(tagClassFile, sourceDirs);
     }
 
@@ -480,28 +480,28 @@
      * initComponentAncestry for further details.
      */
     private void initClassMeta(Model model, JavaClass clazz,
-    		ClassMeta modelItem, String classNameOverride)
+            ClassMeta modelItem, String classNameOverride)
     {
         modelItem.setModelId(model.getModelId());
         modelItem.setSourceClassName(clazz.getFullyQualifiedName());
         JavaClass realParentClass = clazz.getSuperJavaClass();
         if (realParentClass != null)
         {
-        	String fqn = realParentClass.getFullyQualifiedName();
-        	if ((fqn != null) && !fqn.startsWith("java.lang"))
-        	{
-        		modelItem.setSourceClassParentClassName(fqn);
-        	}
+            String fqn = realParentClass.getFullyQualifiedName();
+            if ((fqn != null) && !fqn.startsWith("java.lang"))
+            {
+                modelItem.setSourceClassParentClassName(fqn);
+            }
         }
 
         // JSF Entity class.
         if (StringUtils.isEmpty(classNameOverride))
-    	{
-        	modelItem.setClassName(clazz.getFullyQualifiedName());
-    	}
+        {
+            modelItem.setClassName(clazz.getFullyQualifiedName());
+        }
         else
         {
-        	modelItem.setClassName(classNameOverride);
+            modelItem.setClassName(classNameOverride);
         }
 
         // interfaces metadata is inherited from
@@ -857,7 +857,7 @@
         {
             JavaClass iface = interfaces[i];
             if (iface.getFullyQualifiedName().equals(
-            		"javax.faces.component.NamingContainer"))
+                    "javax.faces.component.NamingContainer"))
             {
                 component.setNamingContainer(Boolean.TRUE);
                 break;

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/unpack/ArtifactItem.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/unpack/ArtifactItem.java?rev=673798&r1=673797&r2=673798&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/unpack/ArtifactItem.java (original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/unpack/ArtifactItem.java Thu Jul  3 13:55:05 2008
@@ -333,8 +333,8 @@
     
     /**
      * @param excludes 
-     * 			A comma seperated list of items to exclude 
-     * 			i.e.  **\/*.xml, **\/*.properties
+     *             A comma seperated list of items to exclude 
+     *             i.e.  **\/*.xml, **\/*.properties
      */
     public void setExcludes ( String excludes )
     {
@@ -346,13 +346,13 @@
      */
     public String getIncludes()
     {
-    	return this.includes;
+        return this.includes;
     }
 
     /**
      * @param includes
-     * 			A comma seperated list of items to inmclude 
-     * 			i.e.  **\/*.xml, **\/*.properties
+     *             A comma seperated list of items to inmclude 
+     *             i.e.  **\/*.xml, **\/*.properties
      */
     public void setIncludes ( String includes )
     {

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/test/java/org/apache/myfaces/buildtools/maven2/plugin/builder/MakeComponentsMojoTest.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/test/java/org/apache/myfaces/buildtools/maven2/plugin/builder/MakeComponentsMojoTest.java?rev=673798&r1=673797&r2=673798&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/test/java/org/apache/myfaces/buildtools/maven2/plugin/builder/MakeComponentsMojoTest.java (original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/test/java/org/apache/myfaces/buildtools/maven2/plugin/builder/MakeComponentsMojoTest.java Thu Jul  3 13:55:05 2008
@@ -27,16 +27,16 @@
 {
     public void testCleanInitializerExpression() throws Exception
     {
-    	String badExpr =
-    		"  // some stuff\n" +
-    		"\n"
-    		+ "  true";
+        String badExpr =
+            "  // some stuff\n" +
+            "\n"
+            + "  true";
 
-    	String cleaned = MakeComponentsMojo.cleanInitializationExpression(badExpr);
-    	String good = "true";
-    	assertEquals(good, cleaned);
-    	
-    	assertEquals(null, MakeComponentsMojo.cleanInitializationExpression("  "));
-    	assertEquals(null, MakeComponentsMojo.cleanInitializationExpression("  // blah"));
+        String cleaned = MakeComponentsMojo.cleanInitializationExpression(badExpr);
+        String good = "true";
+        assertEquals(good, cleaned);
+        
+        assertEquals(null, MakeComponentsMojo.cleanInitializationExpression("  "));
+        assertEquals(null, MakeComponentsMojo.cleanInitializationExpression("  // blah"));
     }
 }

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/AbstractFacesMojo.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/AbstractFacesMojo.java?rev=673798&r1=673797&r2=673798&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/AbstractFacesMojo.java (original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/AbstractFacesMojo.java Thu Jul  3 13:55:05 2008
@@ -56,7 +56,7 @@
       List urls = new ArrayList();
       while (e.hasMoreElements())
       {
-		URL url = (URL)e.nextElement();
+        URL url = (URL)e.nextElement();
         urls.add(url);
       }
       return Collections.unmodifiableList(urls);

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java?rev=673798&r1=673797&r2=673798&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java (original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java Thu Jul  3 13:55:05 2008
@@ -807,8 +807,8 @@
       out.indent();
       out.println("bean.setProperty(" + componentClass + "." + propKey + ",");
       if (isList)
-	    out.println("                 TagUtils.getColorList(" + propVar + "));");
-	  else
+        out.println("                 TagUtils.getColorList(" + propVar + "));");
+      else
         out.println("                 TagUtils.getColor(" + propVar + "));");
       out.unindent();
       out.println("}");

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/util/SourceTemplate.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/util/SourceTemplate.java?rev=673798&r1=673797&r2=673798&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/util/SourceTemplate.java (original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/util/SourceTemplate.java Thu Jul  3 13:55:05 2008
@@ -94,14 +94,14 @@
         throw new EOFException("File " + _file + " ended prematurely");
 
       if (line.trim().startsWith(_IGNORE_PREFIX)){
-		  if (line.trim().startsWith(_IGNORE_PREFIX2)){
-			  String method = line.trim().substring(_IGNORE_PREFIX2.length()).trim();
-			  if (method.length() > 0 ){
-				  _ignoreMethods.add(method);
-			  }
-		  }
-		  continue;
-	  }
+          if (line.trim().startsWith(_IGNORE_PREFIX2)){
+              String method = line.trim().substring(_IGNORE_PREFIX2.length()).trim();
+              if (method.length() > 0 ){
+                  _ignoreMethods.add(method);
+              }
+          }
+          continue;
+      }
 
       if (line.equals("}"))
         break;
@@ -146,11 +146,11 @@
     return buffer.toString();
   }
 
-	public Collection getIgnoreMethods() {
-		return _ignoreMethods;
-	}
+    public Collection getIgnoreMethods() {
+        return _ignoreMethods;
+    }
 
-	private File           _file;
+    private File           _file;
   private BufferedReader _reader;
   private Set            _imports = new HashSet();
   private Map            _fqcnMap = new HashMap();