You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2006/10/10 08:51:26 UTC

svn commit: r454641 - in /myfaces/tobago/trunk: example/facelets/src/main/java/org/apache/myfaces/tobago/example/facelets/ example/security/src/main/java/javax/annotation/security/ example/security/src/main/java/org/apache/myfaces/tobago/example/securi...

Author: bommel
Date: Mon Oct  9 23:51:25 2006
New Revision: 454641

URL: http://svn.apache.org/viewvc?view=rev&rev=454641
Log:
fixed checkstyle errors

Modified:
    myfaces/tobago/trunk/example/facelets/src/main/java/org/apache/myfaces/tobago/example/facelets/MessageBackingBean.java
    myfaces/tobago/trunk/example/security/src/main/java/javax/annotation/security/DenyAll.java
    myfaces/tobago/trunk/example/security/src/main/java/javax/annotation/security/PermitAll.java
    myfaces/tobago/trunk/example/security/src/main/java/javax/annotation/security/RolesAllowed.java
    myfaces/tobago/trunk/example/security/src/main/java/org/apache/myfaces/tobago/example/security/CheckAuthorisationMethodBinding.java
    myfaces/tobago/trunk/example/security/src/main/java/org/apache/myfaces/tobago/example/security/Controller.java
    myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/SolarServlet.java
    myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/TestBean.java
    myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/pom.xml

Modified: myfaces/tobago/trunk/example/facelets/src/main/java/org/apache/myfaces/tobago/example/facelets/MessageBackingBean.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/facelets/src/main/java/org/apache/myfaces/tobago/example/facelets/MessageBackingBean.java?view=diff&rev=454641&r1=454640&r2=454641
==============================================================================
--- myfaces/tobago/trunk/example/facelets/src/main/java/org/apache/myfaces/tobago/example/facelets/MessageBackingBean.java (original)
+++ myfaces/tobago/trunk/example/facelets/src/main/java/org/apache/myfaces/tobago/example/facelets/MessageBackingBean.java Mon Oct  9 23:51:25 2006
@@ -32,7 +32,7 @@
   }
 
   public SelectItem [] getSelectionItems() {
-    SelectItem items [] = new SelectItem[2];
+    SelectItem [] items  = new SelectItem[2];
     items[0] = new SelectItem("One", "One");
     items[1] = new SelectItem("Two", "Two");
     return items;

Modified: myfaces/tobago/trunk/example/security/src/main/java/javax/annotation/security/DenyAll.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/security/src/main/java/javax/annotation/security/DenyAll.java?view=diff&rev=454641&r1=454640&r2=454641
==============================================================================
--- myfaces/tobago/trunk/example/security/src/main/java/javax/annotation/security/DenyAll.java (original)
+++ myfaces/tobago/trunk/example/security/src/main/java/javax/annotation/security/DenyAll.java Mon Oct  9 23:51:25 2006
@@ -1,12 +1,14 @@
+package javax.annotation.security;
+
 /*
- * Copyright 2006 The Apache Software Foundation.
- * 
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -14,8 +16,6 @@
  * limitations under the License.
  */
 
-
-package javax.annotation.security;
 
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;

Modified: myfaces/tobago/trunk/example/security/src/main/java/javax/annotation/security/PermitAll.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/security/src/main/java/javax/annotation/security/PermitAll.java?view=diff&rev=454641&r1=454640&r2=454641
==============================================================================
--- myfaces/tobago/trunk/example/security/src/main/java/javax/annotation/security/PermitAll.java (original)
+++ myfaces/tobago/trunk/example/security/src/main/java/javax/annotation/security/PermitAll.java Mon Oct  9 23:51:25 2006
@@ -1,12 +1,14 @@
+package javax.annotation.security;
+
 /*
- * Copyright 2006 The Apache Software Foundation.
- * 
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -14,8 +16,6 @@
  * limitations under the License.
  */
 
-
-package javax.annotation.security;
 
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;

Modified: myfaces/tobago/trunk/example/security/src/main/java/javax/annotation/security/RolesAllowed.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/security/src/main/java/javax/annotation/security/RolesAllowed.java?view=diff&rev=454641&r1=454640&r2=454641
==============================================================================
--- myfaces/tobago/trunk/example/security/src/main/java/javax/annotation/security/RolesAllowed.java (original)
+++ myfaces/tobago/trunk/example/security/src/main/java/javax/annotation/security/RolesAllowed.java Mon Oct  9 23:51:25 2006
@@ -1,12 +1,14 @@
+package javax.annotation.security;
+
 /*
- * Copyright 2006 The Apache Software Foundation.
- * 
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,8 +17,6 @@
  */
 
 
-package javax.annotation.security;
-
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
@@ -26,5 +26,5 @@
 @Retention(RetentionPolicy.RUNTIME)
 
 public @interface RolesAllowed {
-    public String[] value();
+    String[] value();
 }

Modified: myfaces/tobago/trunk/example/security/src/main/java/org/apache/myfaces/tobago/example/security/CheckAuthorisationMethodBinding.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/security/src/main/java/org/apache/myfaces/tobago/example/security/CheckAuthorisationMethodBinding.java?view=diff&rev=454641&r1=454640&r2=454641
==============================================================================
--- myfaces/tobago/trunk/example/security/src/main/java/org/apache/myfaces/tobago/example/security/CheckAuthorisationMethodBinding.java (original)
+++ myfaces/tobago/trunk/example/security/src/main/java/org/apache/myfaces/tobago/example/security/CheckAuthorisationMethodBinding.java Mon Oct  9 23:51:25 2006
@@ -45,7 +45,7 @@
  */
 public class CheckAuthorisationMethodBinding extends MethodBinding implements StateHolder {
   private static final Log LOG = LogFactory.getLog(CheckAuthorisationMethodBinding.class);
-  private static final Map<String,Annotation> authorisationCache = new HashMap<String,Annotation>();
+  private static final Map<String, Annotation> AUTHORISATION_CACHE = new HashMap<String, Annotation>();
 
   private MethodBinding methodBinding;
 
@@ -65,7 +65,7 @@
   }
 
   public Object invoke(FacesContext facesContext, Object[] objects)
-      throws EvaluationException, MethodNotFoundException {
+      throws EvaluationException {
     if (LOG.isDebugEnabled()) {
       LOG.debug("MethodBinding invoke " + getExpressionString());
     }
@@ -93,9 +93,9 @@
       return false;
     }
     if (securityAnnotation instanceof RolesAllowed) {
-      String [] roles = ((RolesAllowed)securityAnnotation).value();
+      String [] roles = ((RolesAllowed) securityAnnotation).value();
       if (LOG.isDebugEnabled()) {
-        LOG.debug("RolesAllowed " + Arrays.asList(((RolesAllowed)securityAnnotation).value()));
+        LOG.debug("RolesAllowed " + Arrays.asList(((RolesAllowed) securityAnnotation).value()));
       }
       for (String role : roles) {
         boolean authorised = facesContext.getExternalContext().isUserInRole(role);
@@ -115,8 +115,8 @@
   }
   private Annotation getSecurityAnnotation(FacesContext facesContext) {
     String expression = getExpressionString();
-    if (authorisationCache.containsKey(expression)) {
-      return authorisationCache.get(expression);
+    if (AUTHORISATION_CACHE.containsKey(expression)) {
+      return AUTHORISATION_CACHE.get(expression);
     } else {
       Annotation securityAnnotation = null;
       if (expression.startsWith("#{") && expression.endsWith("}")) {
@@ -126,7 +126,8 @@
           String methodExpression = expression.substring(index+1, expression.length());
           String beanExpression = expression.substring(0, index);
           // TODO find a better way
-          Object bean = facesContext.getApplication().getVariableResolver().resolveVariable(facesContext, beanExpression);
+          Object bean =
+              facesContext.getApplication().getVariableResolver().resolveVariable(facesContext, beanExpression);
           if (bean != null) {
             try {
               Method method = bean.getClass().getMethod(methodExpression);
@@ -140,7 +141,7 @@
           }
         }
       }
-      authorisationCache.put(expression, securityAnnotation);
+      AUTHORISATION_CACHE.put(expression, securityAnnotation);
       return securityAnnotation;
     }
   }
@@ -177,7 +178,7 @@
 
   public void setTransient(boolean bool) {
     if (methodBinding instanceof StateHolder) {
-      ((StateHolder)methodBinding).setTransient(bool);
+      ((StateHolder) methodBinding).setTransient(bool);
     }
   }
 }

Modified: myfaces/tobago/trunk/example/security/src/main/java/org/apache/myfaces/tobago/example/security/Controller.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/security/src/main/java/org/apache/myfaces/tobago/example/security/Controller.java?view=diff&rev=454641&r1=454640&r2=454641
==============================================================================
--- myfaces/tobago/trunk/example/security/src/main/java/org/apache/myfaces/tobago/example/security/Controller.java (original)
+++ myfaces/tobago/trunk/example/security/src/main/java/org/apache/myfaces/tobago/example/security/Controller.java Mon Oct  9 23:51:25 2006
@@ -1,10 +1,5 @@
 package org.apache.myfaces.tobago.example.security;
 
-import javax.faces.context.FacesContext;
-import javax.servlet.http.HttpSession;
-import javax.annotation.security.RolesAllowed;
-import javax.annotation.security.PermitAll;
-
 /*
  * Copyright 2004-2006 The Apache Software Foundation.
  *
@@ -20,6 +15,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
+import javax.faces.context.FacesContext;
+import javax.servlet.http.HttpSession;
+import javax.annotation.security.RolesAllowed;
+import javax.annotation.security.PermitAll;
+
+
 @PermitAll()
 public class Controller {
 

Modified: myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/SolarServlet.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/SolarServlet.java?view=diff&rev=454641&r1=454640&r2=454641
==============================================================================
--- myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/SolarServlet.java (original)
+++ myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/SolarServlet.java Mon Oct  9 23:51:25 2006
@@ -1,4 +1,5 @@
 package org.apache.myfaces.tobago.example.test;
+
 /*
  * Copyright 2002-2005 The Apache Software Foundation.
  *

Modified: myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/TestBean.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/TestBean.java?view=diff&rev=454641&r1=454640&r2=454641
==============================================================================
--- myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/TestBean.java (original)
+++ myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/TestBean.java Mon Oct  9 23:51:25 2006
@@ -3,7 +3,7 @@
 /*
  * Copyright 2001-2005 The Apache Software Foundation.
  *
- * Licensed under the Apache License, Version 2.0(the "License");
+ * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
@@ -54,7 +54,7 @@
 
     try {
       //Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
-      Class.forName("org.hsqldb.jdbcDriver" ).newInstance();
+      Class.forName("org.hsqldb.jdbcDriver").newInstance();
       LOG.info("Loaded the appropriate driver.");
 
       //Properties props = new Properties();

Modified: myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/pom.xml?view=diff&rev=454641&r1=454640&r2=454641
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/pom.xml (original)
+++ myfaces/tobago/trunk/tobago-tool/maven-apt-plugin/pom.xml Mon Oct  9 23:51:25 2006
@@ -52,25 +52,4 @@
       <version>1.2</version>
     </dependency>
   </dependencies>
-  <profiles>  
-    <profile>
-      <id>generate-site</id>
-      <build>
-        <plugins>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-checkstyle-plugin</artifactId>
-            <executions>
-              <execution>
-                <id>check</id>
-                <goals>
-                  <goal>check</goal>
-                </goals>
-              </execution>
-            </executions>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-  </profiles>
-</project>
\ No newline at end of file
+  </project>
\ No newline at end of file