myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1677947 - in /myfaces/tobago/branches/tobago-3.0.x: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/ tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/ tobago-core/src/main/java/org/apache/myfaces/tobago/rende...
Date Wed, 06 May 2015 08:24:24 GMT
Author: lofwyr
Date: Wed May  6 08:24:24 2015
New Revision: 1677947

URL: http://svn.apache.org/r1677947
Log:
checkstyle

Modified:
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/MimeTypeUtils.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/SelectManyRendererBase.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/CssItem.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/util/MimeTypeUtilsUnitTest.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriterUnitTest.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ButtonRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CommandRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/HeaderRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/NavRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ProgressRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/util/JQueryUtils.java

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/MimeTypeUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/MimeTypeUtils.java?rev=1677947&r1=1677946&r2=1677947&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/MimeTypeUtils.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/MimeTypeUtils.java
Wed May  6 08:24:24 2015
@@ -26,7 +26,7 @@ import java.util.Map;
 
 public final class MimeTypeUtils {
 
-  private static Map<String, String> ADDITIONAL_MIME_TYPES = null;
+  private static Map<String, String> additionalMimeTypes = null;
 
   private MimeTypeUtils() {
     // utils class
@@ -82,16 +82,16 @@ public final class MimeTypeUtils {
     final int index = file.lastIndexOf('.');
     if (index > -1) {
       String extension = file.substring(index + 1);
-      return ADDITIONAL_MIME_TYPES.get(extension);
+      return additionalMimeTypes.get(extension);
     }
 
     return null;
   }
 
   public static void init(ServletContext servletContext) {
-    if (ADDITIONAL_MIME_TYPES == null) {
+    if (additionalMimeTypes == null) {
       final TobagoConfig tobagoConfig = TobagoConfig.getInstance(servletContext);
-      ADDITIONAL_MIME_TYPES = tobagoConfig.getMimeTypes();
+      additionalMimeTypes = tobagoConfig.getMimeTypes();
     } else {
       throw new IllegalStateException(MimeTypeUtils.class.getSimpleName() + " is already
initialized!");
     }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/SelectManyRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/SelectManyRendererBase.java?rev=1677947&r1=1677946&r2=1677947&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/SelectManyRendererBase.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/SelectManyRendererBase.java
Wed May  6 08:24:24 2015
@@ -28,7 +28,6 @@ import javax.el.ValueExpression;
 import javax.faces.FacesException;
 import javax.faces.application.ProjectStage;
 import javax.faces.component.UIComponent;
-import javax.faces.component.UIInput;
 import javax.faces.component.UISelectItem;
 import javax.faces.component.UISelectItems;
 import javax.faces.component.UISelectMany;
@@ -64,7 +63,7 @@ public class SelectManyRendererBase exte
     if (component instanceof UISelectMany) {
       final UISelectMany uiSelectMany = (UISelectMany) component;
 
-      String[] newValues = (String[])
+      String[] newValues =
           facesContext.getExternalContext().getRequestParameterValuesMap().get(uiSelectMany.getClientId(facesContext));
       if (LOG.isDebugEnabled()) {
         LOG.debug("decode: key='" + component.getClientId(facesContext)

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/CssItem.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/CssItem.java?rev=1677947&r1=1677946&r2=1677947&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/CssItem.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/CssItem.java
Wed May  6 08:24:24 2015
@@ -24,5 +24,5 @@ package org.apache.myfaces.tobago.render
  */
 public interface CssItem {
 
-  public String getName();
+  String getName();
 }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/util/MimeTypeUtilsUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/util/MimeTypeUtilsUnitTest.java?rev=1677947&r1=1677946&r2=1677947&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/util/MimeTypeUtilsUnitTest.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/util/MimeTypeUtilsUnitTest.java
Wed May  6 08:24:24 2015
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.apache.myfaces.tobago.internal.util;
 
 import org.apache.myfaces.tobago.internal.config.AbstractTobagoTestBase;
@@ -6,8 +25,6 @@ import org.junit.Test;
 
 public class MimeTypeUtilsUnitTest extends AbstractTobagoTestBase {
 
-  public static final int INT = 100000000;
-
   public static final String GIF = "http:///localhost:8080/demo/demo.gif";
   public static final String PNG = "http:///localhost:8080/demo/demo.png";
   public static final String JPG = "http:///localhost:8080/demo/demo.jpg";
@@ -63,23 +80,4 @@ public class MimeTypeUtilsUnitTest exten
     Assert.assertEquals("application/vnd.oasis.opendocument.text", MimeTypeUtils.getMimeTypeForFile(ODT));
   }
 
-//  @Test
-  public void testPerformance() {
-    final long start = System.currentTimeMillis();
-    for (int i = 0; i < INT; i++) {
-      MimeTypeUtils.getMimeTypeForFile(GIF);
-      MimeTypeUtils.getMimeTypeForFile(PNG);
-      MimeTypeUtils.getMimeTypeForFile(JPG);
-      MimeTypeUtils.getMimeTypeForFile(JS);
-      MimeTypeUtils.getMimeTypeForFile(CSS);
-      MimeTypeUtils.getMimeTypeForFile(ICO);
-      MimeTypeUtils.getMimeTypeForFile(HTML);
-      MimeTypeUtils.getMimeTypeForFile(HTM);
-      MimeTypeUtils.getMimeTypeForFile(MAP);
-      MimeTypeUtils.getMimeTypeForFile(WOFF);
-      MimeTypeUtils.getMimeTypeForFile(UNKNOWN0);
-    }
-    System.out.println("-----------------------> " + (System.currentTimeMillis() - start)
+ " ms");
-  }
-
-}
\ No newline at end of file
+}

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriterUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriterUnitTest.java?rev=1677947&r1=1677946&r2=1677947&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriterUnitTest.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriterUnitTest.java
Wed May  6 08:24:24 2015
@@ -78,8 +78,10 @@ public class TobagoResponseWriterUnitTes
     writer.startElement(HtmlElements.A, null);
     writer.writeURIAttribute(HtmlAttributes.HREF, "http://example.org/web?text=äöüß",
null);
     writer.endElement(HtmlElements.A);
-    Assert.assertEquals("uri attr tag", "<a href='http:&#x2F;&#x2F;example.org&#x2F;web?text=%C3%A4%C3%B6%C3%BC%C3%9F'\n></a>",
-            stringWriter.toString());
+    Assert.assertEquals(
+        "uri attr tag",
+        "<a href='http:&#x2F;&#x2F;example.org&#x2F;web?text=%C3%A4%C3%B6%C3%BC%C3%9F'\n></a>",
+        stringWriter.toString());
   }
 
   @Test

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ButtonRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ButtonRenderer.java?rev=1677947&r1=1677946&r2=1677947&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ButtonRenderer.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ButtonRenderer.java
Wed May  6 08:24:24 2015
@@ -66,7 +66,8 @@ public class ButtonRenderer extends Comm
         css.getCurrentCss().add("btn-default");
       }
 
-      // TODO this might be too expensive: please put a flag in the ToolBar-handler and Button-handler
(facelets-handler)
+      // TODO this might be too expensive:
+      // TODO please put a flag in the ToolBar-handler and Button-handler (facelets-handler)
       if (ComponentUtils.findAncestor(component, AbstractUIToolBar.class) != null) {
         css.getCurrentCss().add("navbar-btn");
       }
@@ -105,7 +106,7 @@ public class ButtonRenderer extends Comm
       }
 
       if (button instanceof UIButton) {
-        final Integer tabIndex = ((UIButton)button).getTabIndex();
+        final Integer tabIndex = ((UIButton) button).getTabIndex();
         if (tabIndex != null) {
           writer.writeAttribute(HtmlAttributes.TABINDEX, tabIndex);
         }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CommandRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CommandRenderer.java?rev=1677947&r1=1677946&r2=1677947&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CommandRenderer.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CommandRenderer.java
Wed May  6 08:24:24 2015
@@ -164,7 +164,8 @@ public class CommandRenderer extends Com
           if (child instanceof AbstractUICommand) {
             AbstractUICommand command = (AbstractUICommand) child;
             if (command.isParentOfCommands()) {
-              writer.writeClassAttribute("dropdown-submenu");  // fixme: this name comes
not from bootstrap, using prefix?
+              // fixme: this name comes not from bootstrap, using prefix? tobago-command-dropdown-submenu
+              writer.writeClassAttribute("dropdown-submenu");
             }
           }
           child.encodeAll(facesContext);

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/HeaderRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/HeaderRenderer.java?rev=1677947&r1=1677946&r2=1677947&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/HeaderRenderer.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/HeaderRenderer.java
Wed May  6 08:24:24 2015
@@ -37,7 +37,7 @@ public class HeaderRenderer extends Rend
     writer.startElement(HtmlElements.HEADER, component);
     writer.writeIdAttribute(component.getClientId(facesContext));
     writer.writeClassAttribute(BootstrapClass.NAVBAR, BootstrapClass.NAVBAR_INVERSE, BootstrapClass.NAVBAR_FIXED_TOP);
-// XXX    writer.writeClassAttribute(BootstrapClass.NAVBAR, BootstrapClass.NAVBAR_DEFAULT,
BootstrapClass.NAVBAR_FIXED_TOP);
+//XXX writer.writeClassAttribute(BootstrapClass.NAVBAR, BootstrapClass.NAVBAR_DEFAULT, BootstrapClass.NAVBAR_FIXED_TOP);
   }
 
   @Override

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/NavRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/NavRenderer.java?rev=1677947&r1=1677946&r2=1677947&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/NavRenderer.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/NavRenderer.java
Wed May  6 08:24:24 2015
@@ -56,7 +56,7 @@ public class NavRenderer extends Rendere
     writer.startElement(HtmlElements.DIV, null);
     writer.writeIdAttribute(navbarId);
     writer.writeClassAttribute(BootstrapClass.COLLAPSE, BootstrapClass.NAVBAR_COLLAPSE);
-// XXX   writer.writeClassAttribute(BootstrapClass.COLLAPSE, BootstrapClass.NAVBAR_COLLAPSE,
BootstrapClass.NAVBAR_TEXT);
+// XXX writer.writeClassAttribute(BootstrapClass.COLLAPSE, BootstrapClass.NAVBAR_COLLAPSE,
BootstrapClass.NAVBAR_TEXT);
 
     writer.startElement(HtmlElements.UL, null);
     writer.writeClassAttribute(BootstrapClass.NAV, BootstrapClass.NAVBAR_NAV);

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ProgressRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ProgressRenderer.java?rev=1677947&r1=1677946&r2=1677947&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ProgressRenderer.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ProgressRenderer.java
Wed May  6 08:24:24 2015
@@ -57,7 +57,7 @@ public class ProgressRenderer extends La
     Object title = progress.getAttributes().get(Attributes.TIP);
     final double percent = 100.0 * model.getValue() / diff;
     if (title == null && diff > 0) {
-      title = Integer.toString((int)percent) + " %";
+      title = Integer.toString((int) percent) + " %";
     }
 
     final Style style = new Style(facesContext, progress);

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/util/JQueryUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/util/JQueryUtils.java?rev=1677947&r1=1677946&r2=1677947&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/util/JQueryUtils.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/util/JQueryUtils.java
Wed May  6 08:24:24 2015
@@ -22,11 +22,11 @@ package org.apache.myfaces.tobago.render
 public class JQueryUtils {
 
   public static String escapeIdForHtml(String id) {
-    return "#" + id.replaceAll("([\\:\\.\\[\\]\\,])", "\\\\$1" );
+    return "#" + id.replaceAll("([:\\.\\[\\],])", "\\\\$1");
   }
 
   public static String escapeIdForJavaScript(String id) {
-    return "#" + id.replaceAll("([\\:\\.\\[\\]\\,])", "\\\\\\\\$1" );
+    return "#" + id.replaceAll("([:\\.\\[\\],])", "\\\\\\\\$1");
   }
 
 }



Mime
View raw message