You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2013/11/15 18:11:10 UTC
svn commit: r1542331 [14/28] - in /myfaces/tobago/trunk:
tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/
tobago-core/src/main/java/org/apache/myfaces/tobago/application/
tobago-core/src/main/java/org/apache/myfaces/tobago/compat/ tobago-core/...
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/mock/servlet/MockPageContext.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/mock/servlet/MockPageContext.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/mock/servlet/MockPageContext.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/mock/servlet/MockPageContext.java Fri Nov 15 17:10:58 2013
@@ -49,22 +49,22 @@ public class MockPageContext extends Pag
request = new MockHttpServletRequest();
}
- public MockPageContext(ServletRequest servletRequest) {
+ public MockPageContext(final ServletRequest servletRequest) {
this.request = servletRequest;
}
- public Object findAttribute(String s) {
+ public Object findAttribute(final String s) {
return null;
}
- public void forward(String s) throws ServletException, IOException {
+ public void forward(final String s) throws ServletException, IOException {
}
- public Object getAttribute(String s) {
+ public Object getAttribute(final String s) {
return attributes.get(s);
}
- public Object getAttribute(String name, int scope) {
+ public Object getAttribute(final String name, final int scope) {
switch (scope) {
case PageContext.REQUEST_SCOPE:
return getRequest().getAttribute(name);
@@ -74,11 +74,11 @@ public class MockPageContext extends Pag
}
}
- public Enumeration getAttributeNamesInScope(int i) {
+ public Enumeration getAttributeNamesInScope(final int i) {
return null;
}
- public int getAttributesScope(String s) {
+ public int getAttributesScope(final String s) {
return 0;
}
@@ -114,34 +114,36 @@ public class MockPageContext extends Pag
return null;
}
- public void handlePageException(Exception e) throws ServletException, IOException {
+ public void handlePageException(final Exception e) throws ServletException, IOException {
}
- public void handlePageException(Throwable e) {
+ public void handlePageException(final Throwable e) {
}
- public void include(String s) throws ServletException, IOException {
+ public void include(final String s) throws ServletException, IOException {
}
- public void initialize(Servlet servlet, ServletRequest request, ServletResponse response, String s, boolean b, int i,
- boolean b1) throws IOException, IllegalStateException, IllegalArgumentException {
+ public void initialize(
+ final Servlet servlet, final ServletRequest request, final ServletResponse response, final String s,
+ final boolean b, final int i,
+ final boolean b1) throws IOException, IllegalStateException, IllegalArgumentException {
}
public void release() {
}
- public void removeAttribute(String s) {
+ public void removeAttribute(final String s) {
attributes.remove(s);
}
- public void removeAttribute(String s, int i) {
+ public void removeAttribute(final String s, final int i) {
}
- public void setAttribute(String s, Object o) {
+ public void setAttribute(final String s, final Object o) {
attributes.put(s, o);
}
- public void setAttribute(String s, Object o, int i) {
+ public void setAttribute(final String s, final Object o, final int i) {
switch (i) {
case PageContext.REQUEST_SCOPE:
getRequest().setAttribute(s, o);
@@ -151,7 +153,7 @@ public class MockPageContext extends Pag
}
}
- public void include(String reference, boolean b) throws ServletException, IOException {
+ public void include(final String reference, final boolean b) throws ServletException, IOException {
}
public ExpressionEvaluator getExpressionEvaluator() {
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/mock/servlet/MockServletContext.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/mock/servlet/MockServletContext.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/mock/servlet/MockServletContext.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/mock/servlet/MockServletContext.java Fri Nov 15 17:10:58 2013
@@ -34,11 +34,11 @@ import java.util.Set;
public class MockServletContext implements ServletContext {
private Map attributes = new HashMap();
- public Set getResourcePaths(String reference) {
+ public Set getResourcePaths(final String reference) {
return null;
}
- public Object getAttribute(String s) {
+ public Object getAttribute(final String s) {
return attributes.get(s);
}
@@ -50,11 +50,11 @@ public class MockServletContext implemen
return "";
}
- public ServletContext getContext(String s) {
+ public ServletContext getContext(final String s) {
return null;
}
- public String getInitParameter(String s) {
+ public String getInitParameter(final String s) {
return null;
}
@@ -66,7 +66,7 @@ public class MockServletContext implemen
return 0;
}
- public String getMimeType(String s) {
+ public String getMimeType(final String s) {
return null;
}
@@ -74,23 +74,23 @@ public class MockServletContext implemen
return 0;
}
- public RequestDispatcher getNamedDispatcher(String s) {
+ public RequestDispatcher getNamedDispatcher(final String s) {
return null;
}
- public String getRealPath(String s) {
+ public String getRealPath(final String s) {
return null;
}
- public RequestDispatcher getRequestDispatcher(String s) {
+ public RequestDispatcher getRequestDispatcher(final String s) {
return null;
}
- public URL getResource(String s) throws MalformedURLException {
+ public URL getResource(final String s) throws MalformedURLException {
return null;
}
- public InputStream getResourceAsStream(String s) {
+ public InputStream getResourceAsStream(final String s) {
return null;
}
@@ -102,7 +102,7 @@ public class MockServletContext implemen
return null;
}
- public Servlet getServlet(String s) throws ServletException {
+ public Servlet getServlet(final String s) throws ServletException {
return null;
}
@@ -118,19 +118,19 @@ public class MockServletContext implemen
return null;
}
- public void log(Exception e, String s) {
+ public void log(final Exception e, final String s) {
}
- public void log(String s) {
+ public void log(final String s) {
}
- public void log(String s, Throwable throwable) {
+ public void log(final String s, final Throwable throwable) {
}
- public void removeAttribute(String s) {
+ public void removeAttribute(final String s) {
}
- public void setAttribute(String s, Object o) {
+ public void setAttribute(final String s, final Object o) {
attributes.put(s, o);
}
}
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/mock/servlet/MockServletInputStream.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/mock/servlet/MockServletInputStream.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/mock/servlet/MockServletInputStream.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/mock/servlet/MockServletInputStream.java Fri Nov 15 17:10:58 2013
@@ -28,7 +28,7 @@ public class MockServletInputStream exte
private int next;
- public MockServletInputStream(byte[] body) {
+ public MockServletInputStream(final byte[] body) {
this.body = body;
}
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/taglib/component/DummyBean.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/taglib/component/DummyBean.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/taglib/component/DummyBean.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/taglib/component/DummyBean.java Fri Nov 15 17:10:58 2013
@@ -30,7 +30,7 @@ public class DummyBean {
// --------------------------------------------------------------- constructors
- public DummyBean(boolean male, int size, String name) {
+ public DummyBean(final boolean male, final int size, final String name) {
this.male = male;
this.size = size;
this.name = name;
@@ -42,7 +42,7 @@ public class DummyBean {
return name;
}
- public void setName(String name) {
+ public void setName(final String name) {
this.name = name;
}
@@ -50,7 +50,7 @@ public class DummyBean {
return size;
}
- public void setSize(int size) {
+ public void setSize(final int size) {
this.size = size;
}
@@ -58,7 +58,7 @@ public class DummyBean {
return male;
}
- public void setMale(boolean male) {
+ public void setMale(final boolean male) {
this.male = male;
}
}
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/taglib/component/GenericComponentTagUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/taglib/component/GenericComponentTagUnitTest.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/taglib/component/GenericComponentTagUnitTest.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/taglib/component/GenericComponentTagUnitTest.java Fri Nov 15 17:10:58 2013
@@ -41,7 +41,7 @@ public class GenericComponentTagUnitTest
@Before
public void setUp() throws Exception {
- String[] tldPaths = new String[1];
+ final String[] tldPaths = new String[1];
tldPaths[0] = "META-INF/org/apache/myfaces/tobago/internal/taglib/component/tobago.tld";
setTldPaths(tldPaths);
super.setUp();
@@ -65,9 +65,9 @@ public class GenericComponentTagUnitTest
}*/
}
- private void testComponent(Tag tag) throws JspException {
+ private void testComponent(final Tag tag) throws JspException {
if (tag instanceof TobagoTag) {
- TobagoTag tobagoTag = (TobagoTag) tag;
+ final TobagoTag tobagoTag = (TobagoTag) tag;
//MockViewTag root = new MockViewTag();
//root.setPageContext(pageContext);
//root.setRendered("false");
@@ -78,16 +78,16 @@ public class GenericComponentTagUnitTest
//tobagoTag.setDisabled("#{peter.male}");
//tobagoTag.setHeight("#{marry.size}");
tobagoTag.doStartTag();
- UIComponent component = tobagoTag.getComponentInstance();
- UICommand command = (UICommand) component;
- Object disabled = component.getAttributes().get(Attributes.DISABLED);
+ final UIComponent component = tobagoTag.getComponentInstance();
+ final UICommand command = (UICommand) component;
+ final Object disabled = component.getAttributes().get(Attributes.DISABLED);
LOG.debug("disabled = '" + disabled + "'");
- Map attributes = component.getAttributes();
- for (Iterator i = attributes.keySet().iterator(); i.hasNext();) {
- Object value = i.next();
+ final Map attributes = component.getAttributes();
+ for (final Iterator i = attributes.keySet().iterator(); i.hasNext();) {
+ final Object value = i.next();
LOG.debug("value = " + value);
}
- Object height = attributes.get(Attributes.HEIGHT);
+ final Object height = attributes.get(Attributes.HEIGHT);
LOG.debug("height = '" + height + "'");
Assert.assertTrue(ComponentUtils.getBooleanAttribute(command, Attributes.DISABLED));
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/taglib/component/GenericTagUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/taglib/component/GenericTagUnitTest.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/taglib/component/GenericTagUnitTest.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/taglib/component/GenericTagUnitTest.java Fri Nov 15 17:10:58 2013
@@ -25,7 +25,7 @@ public class GenericTagUnitTest extends
@Before
public void setUp() throws Exception {
- String[] tldPaths = new String[]{
+ final String[] tldPaths = new String[]{
"META-INF/org/apache/myfaces/tobago/internal/taglib/component/tobago.tld",
"META-INF/org/apache/myfaces/tobago/internal/taglib/extension/tobago-extension.tld"
};
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/taglib/component/GenericTestBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/taglib/component/GenericTestBase.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/taglib/component/GenericTestBase.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/taglib/component/GenericTestBase.java Fri Nov 15 17:10:58 2013
@@ -56,7 +56,7 @@ public abstract class GenericTestBase ex
super.setUp();
tlds = new Tld[tldPaths.length];
for (int i = 0; i < tldPaths.length; i++) {
- InputStream stream = getClass().getClassLoader().getResourceAsStream(tldPaths[i]);
+ final InputStream stream = getClass().getClassLoader().getResourceAsStream(tldPaths[i]);
tlds[i] = getTld(tldPaths[i], stream);
stream.close();
}
@@ -66,9 +66,9 @@ public abstract class GenericTestBase ex
public void testRelease() throws IllegalAccessException,
NoSuchMethodException, InvocationTargetException, IOException,
SAXException, ClassNotFoundException, InstantiationException {
- for (Tld tld : tlds) {
- for (net.sf.maventaglib.checker.Tag tag : tld.getTags()) {
- Tag tagInstance = getTagInstance(tag);
+ for (final Tld tld : tlds) {
+ for (final net.sf.maventaglib.checker.Tag tag : tld.getTags()) {
+ final Tag tagInstance = getTagInstance(tag);
checkRelease(tagInstance);
}
}
@@ -79,65 +79,65 @@ public abstract class GenericTestBase ex
IllegalAccessException, InvocationTargetException, IOException,
SAXException, ClassNotFoundException, InstantiationException {
- for (Tld tld : tlds) {
- for (net.sf.maventaglib.checker.Tag tag : tld.getTags()) {
- Tag tagInstance = getTagInstance(tag);
- TagAttribute[] attributes = tag.getAttributes();
- for (TagAttribute attribute : attributes) {
- String name = attribute.getAttributeName();
+ for (final Tld tld : tlds) {
+ for (final net.sf.maventaglib.checker.Tag tag : tld.getTags()) {
+ final Tag tagInstance = getTagInstance(tag);
+ final TagAttribute[] attributes = tag.getAttributes();
+ for (final TagAttribute attribute : attributes) {
+ final String name = attribute.getAttributeName();
checkSetter(tagInstance, name);
}
}
}
}
- protected Tag getTagInstance(net.sf.maventaglib.checker.Tag tag)
+ protected Tag getTagInstance(final net.sf.maventaglib.checker.Tag tag)
throws ClassNotFoundException, InstantiationException, IllegalAccessException {
- String className = tag.getTagClass();
- Class tagClass = Class.forName(className);
+ final String className = tag.getTagClass();
+ final Class tagClass = Class.forName(className);
return (Tag) tagClass.newInstance();
}
- private void checkSetter(javax.servlet.jsp.tagext.Tag tagObject, String name)
+ private void checkSetter(final javax.servlet.jsp.tagext.Tag tagObject, final String name)
throws IllegalAccessException, InstantiationException,
NoSuchMethodException, InvocationTargetException, ClassNotFoundException {
- PropertyDescriptor propertyDescriptor
+ final PropertyDescriptor propertyDescriptor
= PropertyUtils.getPropertyDescriptor(tagObject, name);
Assert.assertNotNull("setter '" + name + "' of class " + tagObject.getClass().getName() + " has "
+ "property descriptor.", propertyDescriptor);
}
- public void setTlds(Tld[] tlds) {
+ public void setTlds(final Tld[] tlds) {
this.tlds = tlds;
}
- public void setTldPaths(String[] tldPaths) {
+ public void setTldPaths(final String[] tldPaths) {
this.tldPaths = tldPaths;
}
- private void checkRelease(javax.servlet.jsp.tagext.Tag tag) throws NoSuchMethodException,
+ private void checkRelease(final javax.servlet.jsp.tagext.Tag tag) throws NoSuchMethodException,
IllegalAccessException, InvocationTargetException, IOException,
SAXException {
tag.setPageContext(new MockPageContext());
- HashMap<String, Object> initialValues = new HashMap<String, Object>();
- PropertyDescriptor[] descriptors =
+ final HashMap<String, Object> initialValues = new HashMap<String, Object>();
+ final PropertyDescriptor[] descriptors =
PropertyUtils.getPropertyDescriptors(tag);
// store initial values
- for (PropertyDescriptor descriptor : descriptors) {
+ for (final PropertyDescriptor descriptor : descriptors) {
if (isTagProperty(descriptor)) {
- String name = descriptor.getName();
- Object value = PropertyUtils.getSimpleProperty(tag, name);
+ final String name = descriptor.getName();
+ final Object value = PropertyUtils.getSimpleProperty(tag, name);
initialValues.put(name, value);
}
}
// set new values
- for (PropertyDescriptor descriptor : descriptors) {
+ for (final PropertyDescriptor descriptor : descriptors) {
if (isTagProperty(descriptor)) {
- String name = descriptor.getName();
- Class propertyType = descriptor.getPropertyType();
+ final String name = descriptor.getName();
+ final Class propertyType = descriptor.getPropertyType();
Object value = null;
if (propertyType == String.class) {
value = new String("bla");
@@ -156,29 +156,29 @@ public abstract class GenericTestBase ex
tag.release();
// check released values
- for (PropertyDescriptor descriptor : descriptors) {
+ for (final PropertyDescriptor descriptor : descriptors) {
if (isTagProperty(descriptor)) {
- String name = descriptor.getName();
+ final String name = descriptor.getName();
// XXX: who releases id?
if (name.equals("id")) {
continue;
}
try {
- Object newValue = PropertyUtils.getSimpleProperty(tag, name);
- Object oldValue = initialValues.get(name);
- String msg = "release of property '" + name + "' for tag '"
+ final Object newValue = PropertyUtils.getSimpleProperty(tag, name);
+ final Object oldValue = initialValues.get(name);
+ final String msg = "release of property '" + name + "' for tag '"
+ tag.getClass().getName() + "' failed.";
Assert.assertEquals(msg, oldValue, newValue);
// XXX: first error stops loop
// if (newValue != null && !newValue.equals(oldValue)) {
- } catch (NoSuchMethodException e1) {
+ } catch (final NoSuchMethodException e1) {
LOG.error("", e1);
}
}
}
}
- private boolean isTagProperty(PropertyDescriptor descriptor) {
+ private boolean isTagProperty(final PropertyDescriptor descriptor) {
if ("parent".equals(descriptor.getName())) {
return false;
} else {
@@ -187,17 +187,17 @@ public abstract class GenericTestBase ex
}
}
- private Tld getTld(String name, InputStream stream) throws Exception {
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- DocumentBuilder db = dbf.newDocumentBuilder();
+ private Tld getTld(final String name, final InputStream stream) throws Exception {
+ final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ final DocumentBuilder db = dbf.newDocumentBuilder();
db.setEntityResolver(new Resolver());
- Document doc = db.parse(stream);
+ final Document doc = db.parse(stream);
return TldParser.parse(doc, name);
}
private static class Resolver implements EntityResolver {
- public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
- InputSource inputSource =
+ public InputSource resolveEntity(final String publicId, final String systemId) throws SAXException, IOException {
+ final InputSource inputSource =
new InputSource(GenericTestBase.class.getResourceAsStream("/web-jsptaglibrary_1_2.dtd"));
inputSource.setSystemId(systemId);
return inputSource;
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/layout/IntervalListUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/layout/IntervalListUnitTest.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/layout/IntervalListUnitTest.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/layout/IntervalListUnitTest.java Fri Nov 15 17:10:58 2013
@@ -33,7 +33,7 @@ public class IntervalListUnitTest extend
*/
@Test
public void test0() {
- IntervalList list = new IntervalList();
+ final IntervalList list = new IntervalList();
list.evaluate();
Assert.assertEquals(Measure.ZERO, list.getCurrent());
Assert.assertEquals(Measure.ZERO, list.getMinimum());
@@ -44,7 +44,7 @@ public class IntervalListUnitTest extend
*/
@Test
public void test1Fixed() {
- IntervalList list = new IntervalList();
+ final IntervalList list = new IntervalList();
list.add(new Interval(null, null, null, px(100)));
list.evaluate();
Assert.assertEquals(px(100), list.getCurrent());
@@ -58,7 +58,7 @@ public class IntervalListUnitTest extend
*/
@Test
public void test3Fixed() {
- IntervalList list = new IntervalList();
+ final IntervalList list = new IntervalList();
list.add(new Interval(null, null, null, px(100)));
list.add(new Interval(null, null, null, px(200)));
list.add(new Interval(null, null, null, px(300)));
@@ -72,7 +72,7 @@ public class IntervalListUnitTest extend
*/
@Test
public void test1MinPrefMax() {
- IntervalList list = new IntervalList();
+ final IntervalList list = new IntervalList();
list.add(new Interval(px(10), px(100), px(1000), null));
list.evaluate();
Assert.assertEquals(px(100), list.getCurrent());
@@ -86,7 +86,7 @@ public class IntervalListUnitTest extend
*/
@Test
public void test3MinPrefMax() {
- IntervalList list = new IntervalList();
+ final IntervalList list = new IntervalList();
list.add(new Interval(px(10), px(100), px(1000), null));
list.add(new Interval(px(20), px(200), px(2000), null));
list.add(new Interval(px(30), px(300), px(3000), null));
@@ -101,7 +101,7 @@ public class IntervalListUnitTest extend
*/
@Test
public void test2MinPrefMax() {
- IntervalList list = new IntervalList();
+ final IntervalList list = new IntervalList();
list.add(new Interval(px(10), px(100), px(1000), null));
list.add(new Interval(px(1000), px(10000), px(100000), null));
list.evaluate();
@@ -115,7 +115,7 @@ public class IntervalListUnitTest extend
*/
@Test
public void test4MinPrefMax() {
- IntervalList list = new IntervalList();
+ final IntervalList list = new IntervalList();
list.add(new Interval(px(10), px(100), px(1000), null));
list.add(new Interval(px(2000), px(20000), px(200000), null));
list.evaluate();
@@ -130,7 +130,7 @@ public class IntervalListUnitTest extend
*/
@Test
public void test3MinPrefMaxWithGaps() {
- IntervalList list = new IntervalList();
+ final IntervalList list = new IntervalList();
list.add(new Interval(px(10), null, null, null));
list.add(new Interval(null, px(200), null, null));
list.add(new Interval(null, null, px(3000), null));
@@ -149,7 +149,7 @@ public class IntervalListUnitTest extend
*/
@Test
public void test6Mixed() {
- IntervalList list = new IntervalList();
+ final IntervalList list = new IntervalList();
list.add(new Interval(null, null, null, px(100)));
list.add(new Interval(null, null, null, px(200)));
list.add(new Interval(null, null, null, px(300)));
@@ -171,7 +171,7 @@ public class IntervalListUnitTest extend
*/
@Test
public void test6Squeeze() {
- IntervalList list = new IntervalList();
+ final IntervalList list = new IntervalList();
list.add(new Interval(null, null, null, px(100)));
list.add(new Interval(null, null, null, px(200)));
list.add(new Interval(null, null, null, px(300)));
@@ -192,7 +192,7 @@ public class IntervalListUnitTest extend
*/
@Test
public void test5Squeeze() {
- IntervalList list = new IntervalList();
+ final IntervalList list = new IntervalList();
list.add(new Interval(null, null, null, px(100)));
list.add(new Interval(null, null, null, px(300)));
list.add(new Interval(px(10), px(111), px(210), null));
@@ -203,7 +203,7 @@ public class IntervalListUnitTest extend
Assert.assertEquals(px(300), list.getMinimum());
}
- private Measure px(int pixel) {
+ private Measure px(final int pixel) {
return Measure.valueOf(pixel);
}
}
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/layout/MeasureUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/layout/MeasureUnitTest.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/layout/MeasureUnitTest.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/layout/MeasureUnitTest.java Fri Nov 15 17:10:58 2013
@@ -26,7 +26,7 @@ import java.util.Arrays;
public class MeasureUnitTest {
- private static Measure px(int pixel) {
+ private static Measure px(final int pixel) {
return Measure.valueOf(pixel);
}
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/layout/grid/GridUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/layout/grid/GridUnitTest.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/layout/grid/GridUnitTest.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/layout/grid/GridUnitTest.java Fri Nov 15 17:10:58 2013
@@ -31,7 +31,7 @@ public class GridUnitTest {
@Test
public void test1x1() {
- Grid grid = new Grid(LayoutTokens.parse("*"), LayoutTokens.parse("*"));
+ final Grid grid = new Grid(LayoutTokens.parse("*"), LayoutTokens.parse("*"));
Assert.assertEquals(1, grid.getBankHeads(Orientation.HORIZONTAL).length);
Assert.assertEquals(1, grid.getBankHeads(Orientation.VERTICAL).length);
Assert.assertEquals(""
@@ -92,7 +92,7 @@ public class GridUnitTest {
@Test
public void test2x1() {
- Grid grid = new Grid(LayoutTokens.parse("*;*"), LayoutTokens.parse("*"));
+ final Grid grid = new Grid(LayoutTokens.parse("*;*"), LayoutTokens.parse("*"));
Assert.assertEquals(2, grid.getBankHeads(Orientation.HORIZONTAL).length);
Assert.assertEquals(1, grid.getBankHeads(Orientation.VERTICAL).length);
Assert.assertEquals(""
@@ -187,7 +187,7 @@ public class GridUnitTest {
@Test
public void test5x5() {
- Grid grid = new Grid(LayoutTokens.parse("*;*;*;*;*"), LayoutTokens.parse("*;*;*;*;*"));
+ final Grid grid = new Grid(LayoutTokens.parse("*;*;*;*;*"), LayoutTokens.parse("*;*;*;*;*"));
Assert.assertEquals(5, grid.getBankHeads(Orientation.HORIZONTAL).length);
Assert.assertEquals(5, grid.getBankHeads(Orientation.VERTICAL).length);
Assert.assertEquals(""
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/model/ExpandedStateUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/model/ExpandedStateUnitTest.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/model/ExpandedStateUnitTest.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/model/ExpandedStateUnitTest.java Fri Nov 15 17:10:58 2013
@@ -90,7 +90,7 @@ public class ExpandedStateUnitTest {
@Test
public void test() {
- ExpandedState state = new ExpandedState(2);
+ final ExpandedState state = new ExpandedState(2);
final TreePath root = new TreePath(ROOT);
final TreePath a = new TreePath(A);
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/model/MixedTreeModelUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/model/MixedTreeModelUnitTest.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/model/MixedTreeModelUnitTest.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/model/MixedTreeModelUnitTest.java Fri Nov 15 17:10:58 2013
@@ -34,7 +34,7 @@ public class MixedTreeModelUnitTest {
@Test
public void testLifecycleSmall() {
- MixedTreeModel model = new MixedTreeModel();
+ final MixedTreeModel model = new MixedTreeModel();
model.beginBuildNode();
model.endBuildNode();
@@ -46,7 +46,7 @@ public class MixedTreeModelUnitTest {
@Test
public void testLifecycleStatic() {
- MixedTreeModel model = new MixedTreeModel();
+ final MixedTreeModel model = new MixedTreeModel();
model.beginBuildNode();
model.beginBuildNode();
@@ -63,12 +63,12 @@ public class MixedTreeModelUnitTest {
@Test
public void testLifecycleFromModel() {
- MixedTreeModel model = new MixedTreeModel();
- DefaultMutableTreeNode tree = new DefaultMutableTreeNode("D_0");
+ final MixedTreeModel model = new MixedTreeModel();
+ final DefaultMutableTreeNode tree = new DefaultMutableTreeNode("D_0");
tree.add(new DefaultMutableTreeNode("D_0_0"));
tree.add(new DefaultMutableTreeNode("D_0_1"));
- UITreeData data = new UITreeData();
+ final UITreeData data = new UITreeData();
data.setValue(tree);
model.beginBuildNode();
@@ -102,7 +102,7 @@ public class MixedTreeModelUnitTest {
@Test
public void testLifecycleMixed() {
- MixedTreeModel model = new MixedTreeModel();
+ final MixedTreeModel model = new MixedTreeModel();
model.beginBuildNode();
model.beginBuildNode();
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/model/TreePathUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/model/TreePathUnitTest.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/model/TreePathUnitTest.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/model/TreePathUnitTest.java Fri Nov 15 17:10:58 2013
@@ -103,28 +103,28 @@ public class TreePathUnitTest {
@Test
public void testGetPath() {
- TreePath treePath = new TreePath(0, 1, 2);
+ final TreePath treePath = new TreePath(0, 1, 2);
Assert.assertTrue(Arrays.equals(new int[]{0, 1, 2}, treePath.getPath()));
- TreePath treePath2 = new TreePath(treePath, 3);
+ final TreePath treePath2 = new TreePath(treePath, 3);
Assert.assertTrue(Arrays.equals(new int[]{0, 1, 2, 3}, treePath2.getPath()));
}
@Test
public void testGetPathString() {
- TreePath treePath = new TreePath(0, 1, 2);
+ final TreePath treePath = new TreePath(0, 1, 2);
Assert.assertEquals("_0_1_2", treePath.getPathString());
- TreePath treePath2 = new TreePath(treePath, 3);
+ final TreePath treePath2 = new TreePath(treePath, 3);
Assert.assertEquals("_0_1_2_3", treePath2.getPathString());
}
@Test
public void testGetNode() {
- DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
- DefaultMutableTreeNode node1 = new DefaultMutableTreeNode("node1");
+ final DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
+ final DefaultMutableTreeNode node1 = new DefaultMutableTreeNode("node1");
root.add(node1);
- DefaultMutableTreeNode node2 = new DefaultMutableTreeNode("node2");
- DefaultMutableTreeNode node3 = new DefaultMutableTreeNode("node3");
+ final DefaultMutableTreeNode node2 = new DefaultMutableTreeNode("node2");
+ final DefaultMutableTreeNode node3 = new DefaultMutableTreeNode("node3");
node2.add(node3);
root.add(node2);
@@ -137,14 +137,14 @@ public class TreePathUnitTest {
@Test
public void testGetNode2() {
- DefaultMutableTreeNode tree = new DefaultMutableTreeNode("Category");
+ final DefaultMutableTreeNode tree = new DefaultMutableTreeNode("Category");
tree.add(new DefaultMutableTreeNode("Sports"));
tree.add(new DefaultMutableTreeNode("Movies"));
- DefaultMutableTreeNode science = new DefaultMutableTreeNode("Science");
+ final DefaultMutableTreeNode science = new DefaultMutableTreeNode("Science");
tree.add(science);
science.add(new DefaultMutableTreeNode("Geography"));
science.add(new DefaultMutableTreeNode("Mathematics"));
- DefaultMutableTreeNode astronomy = new DefaultMutableTreeNode("Astronomy");
+ final DefaultMutableTreeNode astronomy = new DefaultMutableTreeNode("Astronomy");
astronomy.add(new DefaultMutableTreeNode("Education"));
astronomy.add(new DefaultMutableTreeNode("Pictures"));
science.add(astronomy);
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/LabelWithAccessKeyUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/LabelWithAccessKeyUnitTest.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/LabelWithAccessKeyUnitTest.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/LabelWithAccessKeyUnitTest.java Fri Nov 15 17:10:58 2013
@@ -29,9 +29,9 @@ public class LabelWithAccessKeyUnitTest
@Test
public void testSimple() {
- UIComponent component = new UIOutput();
+ final UIComponent component = new UIOutput();
component.getAttributes().put("label", "Save");
- LabelWithAccessKey label = new LabelWithAccessKey(component);
+ final LabelWithAccessKey label = new LabelWithAccessKey(component);
Assert.assertEquals("Save", label.getText());
Assert.assertEquals(-1, label.getPos());
Assert.assertEquals(null, label.getAccessKey());
@@ -39,19 +39,19 @@ public class LabelWithAccessKeyUnitTest
@Test
public void testWithKeyFirstLetter() {
- UIComponent component = new UIOutput();
+ final UIComponent component = new UIOutput();
component.getAttributes().put("label", "Save_");
- LabelWithAccessKey label = new LabelWithAccessKey(component);
+ final LabelWithAccessKey label = new LabelWithAccessKey(component);
Assert.assertEquals("Save", label.getText());
Assert.assertNull(label.getAccessKey());
}
@Test
public void testWithKeyLastLetter() {
- String result = "A_n_aly_ze";
- UIComponent component = new UIOutput();
+ final String result = "A_n_aly_ze";
+ final UIComponent component = new UIOutput();
component.getAttributes().put("label", "A__n__a_ly__ze");
- LabelWithAccessKey label = new LabelWithAccessKey(component);
+ final LabelWithAccessKey label = new LabelWithAccessKey(component);
Assert.assertEquals(result, label.getText());
Assert.assertEquals(5, label.getPos());
Assert.assertEquals(new Character('l'), label.getAccessKey());
@@ -59,9 +59,9 @@ public class LabelWithAccessKeyUnitTest
@Test
public void testAmpersand() {
- UIComponent component = new UIOutput();
+ final UIComponent component = new UIOutput();
component.getAttributes().put("label", "_Save");
- LabelWithAccessKey label = new LabelWithAccessKey(component);
+ final LabelWithAccessKey label = new LabelWithAccessKey(component);
Assert.assertEquals("Save", label.getText());
Assert.assertEquals(0, label.getPos());
Assert.assertEquals(new Character('S'), label.getAccessKey());
@@ -69,9 +69,9 @@ public class LabelWithAccessKeyUnitTest
@Test
public void testAmpersandAtEnd() {
- UIComponent component = new UIOutput();
+ final UIComponent component = new UIOutput();
component.getAttributes().put("label", "Save_");
- LabelWithAccessKey label = new LabelWithAccessKey(component);
+ final LabelWithAccessKey label = new LabelWithAccessKey(component);
Assert.assertEquals("Save", label.getText());
Assert.assertEquals(-1, label.getPos());
Assert.assertEquals(null, label.getAccessKey());
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/css/ClassesUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/css/ClassesUnitTest.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/css/ClassesUnitTest.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/css/ClassesUnitTest.java Fri Nov 15 17:10:58 2013
@@ -116,8 +116,8 @@ public class ClassesUnitTest extends Abs
Classes.create(in, "sub").getStringValue());
}
- private void updateCurrentMarkup(UIComponent component) {
- SupportsMarkup m = (SupportsMarkup) component;
+ private void updateCurrentMarkup(final UIComponent component) {
+ final SupportsMarkup m = (SupportsMarkup) component;
m.setCurrentMarkup(ComponentUtils.updateMarkup(component, m.getMarkup()));
}
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/html/DataAttributesUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/html/DataAttributesUnitTest.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/html/DataAttributesUnitTest.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/html/DataAttributesUnitTest.java Fri Nov 15 17:10:58 2013
@@ -28,17 +28,17 @@ public class DataAttributesUnitTest {
@Test
public void testAttributeNames() throws IllegalAccessException {
- for (Field field : DataAttributes.class.getFields()) {
+ for (final Field field : DataAttributes.class.getFields()) {
if (field.getAnnotation(Deprecated.class) != null) {
// ignore the check for deprecated fields
continue;
}
- String value = (String) field.get(null);
+ final String value = (String) field.get(null);
Assert.assertTrue("Regexp check: value='" + value + "'", value.matches("data-tobago(-[a-z]+)*-[a-z]+"));
- String extension = value.substring("data-tobago-".length());
- String name = field.getName();
+ final String extension = value.substring("data-tobago-".length());
+ final String name = field.getName();
Assert.assertEquals(name, extension.toUpperCase().replaceAll("-", "_"));
}
}
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/util/FacetUtilsUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/util/FacetUtilsUnitTest.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/util/FacetUtilsUnitTest.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/util/FacetUtilsUnitTest.java Fri Nov 15 17:10:58 2013
@@ -28,18 +28,18 @@ public class FacetUtilsUnitTest {
@Test
public void testContextMenu() {
- UIPanel panel = new UIPanel();
+ final UIPanel panel = new UIPanel();
Assert.assertNull(FacetUtils.getContextMenu(panel));
- UIMenu menu = new UIMenu();
+ final UIMenu menu = new UIMenu();
FacetUtils.setContextMenu(panel, menu);
Assert.assertEquals(menu, FacetUtils.getContextMenu(panel));
}
@Test
public void testDropDownMenu() {
- UIPanel panel = new UIPanel();
+ final UIPanel panel = new UIPanel();
Assert.assertNull(FacetUtils.getContextMenu(panel));
- UIMenu menu = new UIMenu();
+ final UIMenu menu = new UIMenu();
FacetUtils.setDropDownMenu(panel, menu);
Assert.assertEquals(menu, FacetUtils.getDropDownMenu(panel));
}
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/util/HtmlWriterUtilsUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/util/HtmlWriterUtilsUnitTest.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/util/HtmlWriterUtilsUnitTest.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/util/HtmlWriterUtilsUnitTest.java Fri Nov 15 17:10:58 2013
@@ -31,8 +31,8 @@ public class HtmlWriterUtilsUnitTest {
// some chars must escaped in attribute values other than in text
// put them at beginning of raw texts and in both escaped texts
- // HTML 4.0, section B.7.1: ampersands followed by
- // an open brace don't get escaped
+ // HTML 4.0, section B.7.1: ampersands followed by
+ // an open brace don't get escaped
public static final String[] RAW_TEXTS = {
"oeffnende spitze klammern werden in attributen doch escaped <tagname >",
"& followed by an { -> &{ don't get escaped in attributes",
@@ -70,8 +70,8 @@ public class HtmlWriterUtilsUnitTest {
@Test
public void test() {
- CharArrayWriter writer = new CharArrayWriter();
- HtmlWriterUtils helper = new HtmlWriterUtils(writer, "");
+ final CharArrayWriter writer = new CharArrayWriter();
+ final HtmlWriterUtils helper = new HtmlWriterUtils(writer, "");
for (int i = 0; i < ESCAPED_TEXTS.length; i++) {
testText(helper, writer, RAW_TEXTS[i], ESCAPED_TEXTS[i]);
@@ -81,26 +81,28 @@ public class HtmlWriterUtilsUnitTest {
}
}
- private void testText(HtmlWriterUtils writerUtil, CharArrayWriter writer, String text, String escaped) {
+ private void testText(
+ final HtmlWriterUtils writerUtil, final CharArrayWriter writer, final String text, final String escaped) {
try {
writer.reset();
writerUtil.writeText(text);
- String result = String.valueOf(writer.toCharArray());
+ final String result = String.valueOf(writer.toCharArray());
Assert.assertEquals(result, escaped);
- } catch (IOException e) {
+ } catch (final IOException e) {
// could not occur with CharArrayWriter
}
}
- private void testAttributeValue(HtmlWriterUtils writerUtil, CharArrayWriter writer, String text, String escaped) {
+ private void testAttributeValue(
+ final HtmlWriterUtils writerUtil, final CharArrayWriter writer, final String text, final String escaped) {
try {
writer.reset();
writerUtil.writeAttributeValue(text);
- String result = String.valueOf(writer.toCharArray());
+ final String result = String.valueOf(writer.toCharArray());
Assert.assertEquals(result, escaped);
- } catch (IOException e) {
+ } catch (final IOException e) {
// could not occur with CharArrayWriter
}
}
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/util/JavascriptWriterUtilsTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/util/JavascriptWriterUtilsTest.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/util/JavascriptWriterUtilsTest.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/util/JavascriptWriterUtilsTest.java Fri Nov 15 17:10:58 2013
@@ -32,8 +32,8 @@ public class JavascriptWriterUtilsTest {
@Test
public void test() {
- CharArrayWriter writer = new CharArrayWriter();
- JavascriptWriterUtils helper = new JavascriptWriterUtils(writer, "");
+ final CharArrayWriter writer = new CharArrayWriter();
+ final JavascriptWriterUtils helper = new JavascriptWriterUtils(writer, "");
String text = "\"";
String result = "\\\"";
@@ -43,14 +43,15 @@ public class JavascriptWriterUtilsTest {
testText(helper, writer, text, result);
}
- private void testText(WriterUtils writerUtil, CharArrayWriter writer, String text, String escaped) {
+ private void testText(
+ final WriterUtils writerUtil, final CharArrayWriter writer, final String text, final String escaped) {
try {
writer.reset();
writerUtil.writeText(text);
- String result = String.valueOf(writer.toCharArray());
+ final String result = String.valueOf(writer.toCharArray());
Assert.assertEquals(escaped, result);
- } catch (IOException e) {
+ } catch (final IOException e) {
// could not occur with CharArrayWriter
}
}
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/util/LayoutInfoUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/util/LayoutInfoUnitTest.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/util/LayoutInfoUnitTest.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/util/LayoutInfoUnitTest.java Fri Nov 15 17:10:58 2013
@@ -26,7 +26,7 @@ public class LayoutInfoUnitTest {
@Test
public void test() {
- LayoutInfo info = new LayoutInfo(5, 83, LayoutTokens.parse("284px;1*;180px;1*;75px"), "unittest");
+ final LayoutInfo info = new LayoutInfo(5, 83, LayoutTokens.parse("284px;1*;180px;1*;75px"), "unittest");
info.getLayoutTokens();
info.parseColumnLayout(83);
}
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/util/Parameterized.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/util/Parameterized.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/util/Parameterized.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/util/Parameterized.java Fri Nov 15 17:10:58 2013
@@ -48,25 +48,25 @@ public class Parameterized extends Suite
public static @interface Parameters {
}
- public Parameterized(Class<?> clazz) throws Exception {
+ public Parameterized(final Class<?> clazz) throws Exception {
super(clazz, new ArrayList<Runner>());
- FrameworkMethod method = findMethod(getTestClass());
+ final FrameworkMethod method = findMethod(getTestClass());
List<Object[]> parametersList = null;
try {
parametersList = (List<Object[]>) method.invokeExplosively(null);
- } catch (Throwable throwable) {
+ } catch (final Throwable throwable) {
throw new Exception(throwable);
}
- for (Object[] aParametersList : parametersList) {
+ for (final Object[] aParametersList : parametersList) {
getChildren().add(new ClassRunnerForParameters(getTestClass().getJavaClass(), aParametersList));
}
}
- private FrameworkMethod findMethod(TestClass clazz) throws Exception {
- List<FrameworkMethod> methods = clazz.getAnnotatedMethods(Parameters.class);
- for (FrameworkMethod method : methods) {
- int modifiers = method.getMethod().getModifiers();
+ private FrameworkMethod findMethod(final TestClass clazz) throws Exception {
+ final List<FrameworkMethod> methods = clazz.getAnnotatedMethods(Parameters.class);
+ for (final FrameworkMethod method : methods) {
+ final int modifiers = method.getMethod().getModifiers();
if (Modifier.isStatic(modifiers) && Modifier.isPublic(modifiers)) {
return method;
}
@@ -79,7 +79,7 @@ public class Parameterized extends Suite
private Object[] parameters;
- ClassRunnerForParameters(Class<?> clazz, Object[] parameters) throws InitializationError {
+ ClassRunnerForParameters(final Class<?> clazz, final Object[] parameters) throws InitializationError {
super(clazz);
this.parameters = parameters;
}
@@ -95,17 +95,17 @@ public class Parameterized extends Suite
}
@Override
- protected String testName(FrameworkMethod method) {
+ protected String testName(final FrameworkMethod method) {
return method.getName() + getName();
}
@Override
- protected Statement classBlock(RunNotifier notifier) {
+ protected Statement classBlock(final RunNotifier notifier) {
return childrenInvoker(notifier);
}
@Override
- protected void validateZeroArgConstructor(List<Throwable> errors) {
+ protected void validateZeroArgConstructor(final List<Throwable> errors) {
// In this case there should be a constructor with arguments.
}
}
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/util/RangeParserUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/util/RangeParserUnitTest.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/util/RangeParserUnitTest.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/util/RangeParserUnitTest.java Fri Nov 15 17:10:58 2013
@@ -51,7 +51,7 @@ public class RangeParserUnitTest {
checkEquals(ints, StringUtils.getIndices(s));
}
- private void checkEquals(int[] ints, int[] indices) {
+ private void checkEquals(final int[] ints, final int[] indices) {
Assert.assertTrue(ints.length == indices.length);
for (int i = 0; i < ints.length; i++) {
Assert.assertTrue(ints[i] == indices[i]);
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/webapp/TobagoMultipartFormdataRequestUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/webapp/TobagoMultipartFormdataRequestUnitTest.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/webapp/TobagoMultipartFormdataRequestUnitTest.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/webapp/TobagoMultipartFormdataRequestUnitTest.java Fri Nov 15 17:10:58 2013
@@ -44,7 +44,7 @@ public class TobagoMultipartFormdataRequ
private TobagoMultipartFormdataRequest request;
public TobagoMultipartFormdataRequestUnitTest() throws UnsupportedEncodingException {
- String body
+ final String body
= SNIP + BOUNDARY + NEWLINE
+ parameter("color", "red")
+ parameter("city", "Amsterdam")
@@ -57,21 +57,21 @@ public class TobagoMultipartFormdataRequ
+ parameter("country", "Trinidad & Tobago")
+ SNIP + BOUNDARY + SNIP + NEWLINE;
- MockHttpServletRequest mockRequest
+ final MockHttpServletRequest mockRequest
= new MockHttpServletRequest(body.getBytes("UTF-8"));
mockRequest.setMethod("post");
request = new TobagoMultipartFormdataRequest(mockRequest, System.getProperty("java.io.tmpdir"), 1024 * 1024);
}
- private String parameter(String key, String value) {
+ private String parameter(final String key, final String value) {
return SNIP + BOUNDARY + NEWLINE
+ "Content-Disposition: form-data; name=\"" + key + "\"" + NEWLINE
+ NEWLINE
+ value + NEWLINE;
}
- private String fileItem(String key, String filename, String value) {
+ private String fileItem(final String key, final String filename, final String value) {
return SNIP + BOUNDARY + NEWLINE
+ "Content-Disposition: form-data; name=\""
+ key + "\"; filename=\"" + filename + "\"" + NEWLINE
@@ -83,7 +83,7 @@ public class TobagoMultipartFormdataRequ
@Test
public void testGetFileItem() {
- FileItem item = request.getFileItem("file");
+ final FileItem item = request.getFileItem("file");
Assert.assertNotNull(item);
Assert.assertEquals("filename", "hello.txt", item.getName());
Assert.assertEquals("content", "Hello World!", item.getString());
@@ -127,13 +127,13 @@ public class TobagoMultipartFormdataRequ
@Test
public void testGetParameterNames() {
- Set<Object> actual = new HashSet<Object>();
- Enumeration e = request.getParameterNames();
+ final Set<Object> actual = new HashSet<Object>();
+ final Enumeration e = request.getParameterNames();
while (e.hasMoreElements()) {
actual.add(e.nextElement());
}
- Set<String> expected = new HashSet<String>(
+ final Set<String> expected = new HashSet<String>(
Arrays.asList("color", "city", "country"));
Assert.assertEquals(expected, actual);
@@ -142,23 +142,23 @@ public class TobagoMultipartFormdataRequ
@Test
public void testGetParameterMap() {
- Map actual = request.getParameterMap();
+ final Map actual = request.getParameterMap();
- Map<String, String[]> expected = new HashMap<String, String[]>();
+ final Map<String, String[]> expected = new HashMap<String, String[]>();
expected.put("color", new String[]{"red", "green", "blue", "yellow"});
expected.put("city", new String[]{"Amsterdam", "Bonn", "Pisa"});
expected.put("country", new String[]{"Trinidad & Tobago"});
Assert.assertEquals(expected.keySet(), actual.keySet());
- Set keys = actual.keySet();
- for (Object key1 : keys) {
- String key = (String) key1;
- String[] expectedStrings = expected.get(key);
- String[] actualStrings = (String[]) actual.get(key);
+ final Set keys = actual.keySet();
+ for (final Object key1 : keys) {
+ final String key = (String) key1;
+ final String[] expectedStrings = expected.get(key);
+ final String[] actualStrings = (String[]) actual.get(key);
Assert.assertEquals(expectedStrings.length, actualStrings.length);
- Set<String> expectedSet = new HashSet<String>(Arrays.asList(expectedStrings));
- Set<String> actualSet = new HashSet<String>(Arrays.asList(actualStrings));
+ final Set<String> expectedSet = new HashSet<String>(Arrays.asList(expectedStrings));
+ final Set<String> actualSet = new HashSet<String>(Arrays.asList(actualStrings));
Assert.assertEquals(expectedSet, actualSet);
}
}
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriterUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriterUnitTest.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriterUnitTest.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriterUnitTest.java Fri Nov 15 17:10:58 2013
@@ -107,7 +107,7 @@ public class TobagoResponseWriterUnitTes
@Test
public void testManyChars() throws IOException {
writer.startElement(HtmlElements.SELECT, null);
- StringBuffer buffer = new StringBuffer();
+ final StringBuffer buffer = new StringBuffer();
for (char c = 0x20; c < 0x7F; c++) {
buffer.append(c);
}
@@ -129,7 +129,7 @@ public class TobagoResponseWriterUnitTes
@Test
public void testNonUtf8() throws IOException {
- TobagoResponseWriter writer1 = new HtmlResponseWriter(stringWriter, "", "ISO-8859-1");
+ final TobagoResponseWriter writer1 = new HtmlResponseWriter(stringWriter, "", "ISO-8859-1");
writer1.startElement(HtmlElements.INPUT, null);
writer1.writeAttribute(HtmlAttributes.VALUE, "Gutschein über 100 â¬.", null);
writer1.writeAttribute(HtmlAttributes.READONLY, true);
@@ -141,7 +141,7 @@ public class TobagoResponseWriterUnitTes
@Test
public void testCharArray() throws IOException {
- TobagoResponseWriter writer = new XmlResponseWriter(stringWriter, "text/xml", "ISO-8859-1");
+ final TobagoResponseWriter writer = new XmlResponseWriter(stringWriter, "text/xml", "ISO-8859-1");
writer.writeText("123".toCharArray(), 0, 3);
Assert.assertEquals("123", stringWriter.toString());
}
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Address.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Address.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Address.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Address.java Fri Nov 15 17:10:58 2013
@@ -84,7 +84,7 @@ public class Address implements Serializ
LOG.debug("Creating new Address");
}
- public void fill(Address fromAddress) {
+ public void fill(final Address fromAddress) {
id = fromAddress.getId();
firstName = fromAddress.getFirstName();
lastName = fromAddress.getLastName();
@@ -139,7 +139,7 @@ public class Address implements Serializ
return id;
}
- public void setId(Integer id) {
+ public void setId(final Integer id) {
this.id = id;
}
@@ -147,7 +147,7 @@ public class Address implements Serializ
return firstName;
}
- public void setFirstName(String firstName) {
+ public void setFirstName(final String firstName) {
this.firstName = firstName;
}
@@ -155,7 +155,7 @@ public class Address implements Serializ
return lastName;
}
- public void setLastName(String lastName) {
+ public void setLastName(final String lastName) {
this.lastName = lastName;
}
@@ -163,7 +163,7 @@ public class Address implements Serializ
return street;
}
- public void setStreet(String street) {
+ public void setStreet(final String street) {
this.street = street;
}
@@ -171,7 +171,7 @@ public class Address implements Serializ
return houseNumber;
}
- public void setHouseNumber(String houseNumber) {
+ public void setHouseNumber(final String houseNumber) {
this.houseNumber = houseNumber;
}
@@ -179,7 +179,7 @@ public class Address implements Serializ
return city;
}
- public void setCity(String city) {
+ public void setCity(final String city) {
this.city = city;
}
@@ -187,7 +187,7 @@ public class Address implements Serializ
return zipCode;
}
- public void setZipCode(String zipCode) {
+ public void setZipCode(final String zipCode) {
this.zipCode = zipCode;
}
@@ -195,7 +195,7 @@ public class Address implements Serializ
return country;
}
- public void setCountry(Locale country) {
+ public void setCountry(final Locale country) {
this.country = country;
}
@@ -203,7 +203,7 @@ public class Address implements Serializ
return phone;
}
- public void setPhone(String phone) {
+ public void setPhone(final String phone) {
this.phone = phone;
}
@@ -211,7 +211,7 @@ public class Address implements Serializ
return mobile;
}
- public void setMobile(String mobile) {
+ public void setMobile(final String mobile) {
this.mobile = mobile;
}
@@ -219,7 +219,7 @@ public class Address implements Serializ
return fax;
}
- public void setFax(String fax) {
+ public void setFax(final String fax) {
this.fax = fax;
}
@@ -227,7 +227,7 @@ public class Address implements Serializ
return email;
}
- public void setEmail(EmailAddress email) {
+ public void setEmail(final EmailAddress email) {
if (email != null) {
emailStr = email.getEmail();
}
@@ -238,7 +238,7 @@ public class Address implements Serializ
return icq;
}
- public void setIcq(String icq) {
+ public void setIcq(final String icq) {
this.icq = icq;
}
@@ -246,7 +246,7 @@ public class Address implements Serializ
return homePage;
}
- public void setHomePage(String homePage) {
+ public void setHomePage(final String homePage) {
this.homePage = homePage;
}
@@ -254,7 +254,7 @@ public class Address implements Serializ
return dayOfBirth;
}
- public void setDayOfBirth(Date dayOfBirth) {
+ public void setDayOfBirth(final Date dayOfBirth) {
this.dayOfBirth = dayOfBirth;
}
@@ -262,7 +262,7 @@ public class Address implements Serializ
return note;
}
- public void setNote(String note) {
+ public void setNote(final String note) {
this.note = note;
}
@@ -270,7 +270,7 @@ public class Address implements Serializ
return company;
}
- public void setCompany(String company) {
+ public void setCompany(final String company) {
this.company = company;
}
@@ -278,7 +278,7 @@ public class Address implements Serializ
return jobTitle;
}
- public void setJobTitle(String jobTitle) {
+ public void setJobTitle(final String jobTitle) {
this.jobTitle = jobTitle;
}
@@ -286,7 +286,7 @@ public class Address implements Serializ
return jobPhone;
}
- public void setJobPhone(String jobPhone) {
+ public void setJobPhone(final String jobPhone) {
this.jobPhone = jobPhone;
}
@@ -294,7 +294,7 @@ public class Address implements Serializ
return jobEmail;
}
- public void setJobEmail(EmailAddress jobEmail) {
+ public void setJobEmail(final EmailAddress jobEmail) {
if (jobEmail != null) {
jobEmailStr = jobEmail.getEmail();
}
@@ -305,7 +305,7 @@ public class Address implements Serializ
return jobHomePage;
}
- public void setJobHomePage(String jobHomePage) {
+ public void setJobHomePage(final String jobHomePage) {
this.jobHomePage = jobHomePage;
}
@@ -317,7 +317,7 @@ public class Address implements Serializ
return picture;
}
- public void setPicture(Picture picture) {
+ public void setPicture(final Picture picture) {
this.picture = picture;
}
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/DerbyShutdownServletContextListener.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/DerbyShutdownServletContextListener.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/DerbyShutdownServletContextListener.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/DerbyShutdownServletContextListener.java Fri Nov 15 17:10:58 2013
@@ -32,16 +32,16 @@ public class DerbyShutdownServletContext
private static final Logger LOG = LoggerFactory.getLogger(DerbyShutdownServletContextListener.class);
- public void contextInitialized(ServletContextEvent servletContextEvent) {
+ public void contextInitialized(final ServletContextEvent servletContextEvent) {
}
// todo: should not be shut down in case of the "InMemoryAddressDao" alternative
- public void contextDestroyed(ServletContextEvent servletContextEvent) {
+ public void contextDestroyed(final ServletContextEvent servletContextEvent) {
try {
DriverManager.getConnection("jdbc:derby:target/addressDB;shutdown=true");
- } catch (Exception e) {
+ } catch (final Exception e) {
LOG.error("", e);
}
}
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/EmailAddress.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/EmailAddress.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/EmailAddress.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/EmailAddress.java Fri Nov 15 17:10:58 2013
@@ -24,7 +24,7 @@ public class EmailAddress {
private String email;
- public EmailAddress(String email) {
+ public EmailAddress(final String email) {
this.email = email;
}
@@ -32,21 +32,21 @@ public class EmailAddress {
return email;
}
- public void setEmail(String email) {
+ public void setEmail(final String email) {
this.email = email;
}
public String getLocalPart() {
- String[] parts = email.split("@");
+ final String[] parts = email.split("@");
return parts[0];
}
public String getDomain() {
- String[] parts = email.split("@");
+ final String[] parts = email.split("@");
return parts[1];
}
- public boolean equals(Object o) {
+ public boolean equals(final Object o) {
if (this == o) {
return true;
}
@@ -54,7 +54,7 @@ public class EmailAddress {
return false;
}
- EmailAddress that = (EmailAddress) o;
+ final EmailAddress that = (EmailAddress) o;
if (email != null ? !email.equals(that.email) : that.email != null) {
return false;
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/InMemoryAddressDao.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/InMemoryAddressDao.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/InMemoryAddressDao.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/InMemoryAddressDao.java Fri Nov 15 17:10:58 2013
@@ -42,9 +42,9 @@ public class InMemoryAddressDao implemen
addresses = new ArrayList<Address>();
}
- public synchronized Address updateAddress(Address address) {
+ public synchronized Address updateAddress(final Address address) {
LOG.debug("Trying address: "+address);
- Address storedAddress = getAddress(address.getId());
+ final Address storedAddress = getAddress(address.getId());
if (storedAddress == null) {
address.setId(addresses.size()+1);
LOG.debug("Creating address: "+address);
@@ -57,17 +57,17 @@ public class InMemoryAddressDao implemen
return address;
}
- public List<Address> findAddresses(String filter, String column, boolean order) {
+ public List<Address> findAddresses(final String filter, final String column, final boolean order) {
return findAddresses(filter);
}
- public synchronized List<Address> findAddresses(String filter) {
+ public synchronized List<Address> findAddresses(final String filter) {
LOG.debug("Find addresses: "+addresses);
return Collections.unmodifiableList(addresses);
}
- public synchronized void removeAddress(Address address) {
- Iterator<Address> it = addresses.iterator();
+ public synchronized void removeAddress(final Address address) {
+ final Iterator<Address> it = addresses.iterator();
while (it.hasNext()) {
if (it.next().getId().equals(address.getId())) {
it.remove();
@@ -75,8 +75,8 @@ public class InMemoryAddressDao implemen
}
}
- public Address getAddress(Integer id) {
- for (Address address : addresses) {
+ public Address getAddress(final Integer id) {
+ for (final Address address : addresses) {
if (address.getId().equals(id)) {
return address;
}
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/JpaAddressDao.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/JpaAddressDao.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/JpaAddressDao.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/JpaAddressDao.java Fri Nov 15 17:10:58 2013
@@ -45,11 +45,11 @@ public class JpaAddressDao implements Ad
@PersistenceContext(unitName = "addressBook")
private EntityManager entityManager;
- public Address updateAddress(Address address) {
+ public Address updateAddress(final Address address) {
if (address.getId() == null) {
entityManager.persist(address);
} else {
- Picture picture = address.getPicture();
+ final Picture picture = address.getPicture();
if (picture != null && picture.getId() == null) {
entityManager.persist(picture);
}
@@ -58,14 +58,14 @@ public class JpaAddressDao implements Ad
return address;
}
// @Transactional(readOnly = true)
- public List<Address> findAddresses(String filter) {
+ public List<Address> findAddresses(final String filter) {
return findAddresses(filter, null, true);
}
// @Transactional(readOnly = true)
@SuppressWarnings("unchecked")
- public List<Address> findAddresses(String filter, String column, boolean order) {
- StringBuilder builder = new StringBuilder();
+ public List<Address> findAddresses(String filter, final String column, final boolean order) {
+ final StringBuilder builder = new StringBuilder();
builder.append("select a from Address a");
if (filter != null) {
if (filter.indexOf('_') == -1 && filter.indexOf('%') == -1) {
@@ -82,7 +82,7 @@ public class JpaAddressDao implements Ad
builder.append(column);
builder.append(order ? " desc" : " asc");
}
- Query query = entityManager.createQuery(builder.toString());
+ final Query query = entityManager.createQuery(builder.toString());
return query.getResultList();
}
@@ -91,7 +91,7 @@ public class JpaAddressDao implements Ad
entityManager.remove(address);
}
// @Transactional(readOnly = true)
- public Address getAddress(Integer id) {
+ public Address getAddress(final Integer id) {
return entityManager.find(Address.class, id);
}
}
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/KillSession.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/KillSession.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/KillSession.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/KillSession.java Fri Nov 15 17:10:58 2013
@@ -36,7 +36,7 @@ public class KillSession extends HttpSer
private static final Logger LOG = LoggerFactory.getLogger(KillSession.class);
@Override
- protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ protected void doGet(final HttpServletRequest request, final HttpServletResponse response)
throws ServletException, IOException {
final HttpSession session = request.getSession(false);
if (session != null) {
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Picture.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Picture.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Picture.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Picture.java Fri Nov 15 17:10:58 2013
@@ -43,7 +43,7 @@ public class Picture implements Serializ
public Picture() {
}
- public Picture(String contentType, byte[] content) {
+ public Picture(final String contentType, final byte[] content) {
this.contentType = contentType;
this.content = content;
}
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/AdminController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/AdminController.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/AdminController.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/AdminController.java Fri Nov 15 17:10:58 2013
@@ -46,11 +46,11 @@ public class AdminController implements
@PostConstruct
public void update() {
- MemoryMXBean memoryBean = ManagementFactory.getMemoryMXBean();
- MemoryUsage memory = memoryBean.getHeapMemoryUsage();
+ final MemoryMXBean memoryBean = ManagementFactory.getMemoryMXBean();
+ final MemoryUsage memory = memoryBean.getHeapMemoryUsage();
memoryUsage = new DefaultBoundedRangeModel(Long.valueOf(memory.getUsed() / 1024).intValue(),
0, 0, Long.valueOf(memory.getMax() / 1024).intValue());
- int percentValue = memoryUsage.getValue() / (memoryUsage.getMaximum() * 100);
+ final int percentValue = memoryUsage.getValue() / (memoryUsage.getMaximum() * 100);
if (percentValue <= 80) {
state = "ok";
} else if (percentValue > 95) {
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Controller.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Controller.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Controller.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Controller.java Fri Nov 15 17:10:58 2013
@@ -106,36 +106,36 @@ public class Controller implements Seria
@PostConstruct
public void init() {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- Application application = facesContext.getApplication();
+ final FacesContext facesContext = FacesContext.getCurrentInstance();
+ final Application application = facesContext.getApplication();
language = application.getDefaultLocale();
countries.init(language);
facesContext.getExternalContext().getSession(true);
initLanguages();
- TobagoConfig tobagoConfig = TobagoConfig.getInstance(facesContext);
- List<Theme> themes = new ArrayList<Theme>(tobagoConfig.getSupportedThemes());
+ final TobagoConfig tobagoConfig = TobagoConfig.getInstance(facesContext);
+ final List<Theme> themes = new ArrayList<Theme>(tobagoConfig.getSupportedThemes());
themes.add(0, tobagoConfig.getDefaultTheme());
themeItems = new ArrayList<SelectItem>();
- for (Theme theme : themes) {
+ for (final Theme theme : themes) {
themeItems.add(new SelectItem(theme, theme.getDisplayName()));
}
- ClientProperties client = VariableResolverUtils.resolveClientProperties(facesContext);
+ final ClientProperties client = VariableResolverUtils.resolveClientProperties(facesContext);
theme = client.getTheme();
currentAddressList = addressDao.findAddresses(searchCriterion);
}
- public void setAddressDao(AddressDao addressDao) {
+ public void setAddressDao(final AddressDao addressDao) {
this.addressDao = addressDao;
}
- public void sheetSorter(ActionEvent event) {
+ public void sheetSorter(final ActionEvent event) {
if (event instanceof SortActionEvent) {
- SortActionEvent sortEvent = (SortActionEvent) event;
- UIColumn column = (UIColumn) sortEvent.getColumn();
+ final SortActionEvent sortEvent = (SortActionEvent) event;
+ final UIColumn column = (UIColumn) sortEvent.getColumn();
- SheetState sheetState = ((UISheet) sortEvent.getSheet()).getSheetState(FacesContext.getCurrentInstance());
+ final SheetState sheetState = ((UISheet) sortEvent.getSheet()).getSheetState(FacesContext.getCurrentInstance());
currentAddressList = addressDao.findAddresses(searchCriterion, column.getId(), sheetState.isAscending());
}
}
@@ -148,7 +148,7 @@ public class Controller implements Seria
public String createAddress() {
LOG.debug("action: createAddress");
currentAddress = new Address();
- FacesContext facesContext = FacesContext.getCurrentInstance();
+ final FacesContext facesContext = FacesContext.getCurrentInstance();
Locale locale = facesContext.getViewRoot().getLocale();
// XXX use better datatype for countries than Locale
if (Locale.GERMAN.equals(locale)) {
@@ -168,9 +168,10 @@ public class Controller implements Seria
public String editAddress() {
LOG.debug("action: editAddress");
- List<Integer> selection = selectedAddresses.getSelectedRows();
+ final List<Integer> selection = selectedAddresses.getSelectedRows();
if (selection.size() != 1) {
- FacesMessage error = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Please select exactly one address!", null);
+ final FacesMessage error
+ = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Please select exactly one address!", null);
FacesContext.getCurrentInstance().addMessage(null, error);
return null;
}
@@ -179,15 +180,15 @@ public class Controller implements Seria
}
public String deleteAddresses() {
- List<Integer> selection = selectedAddresses.getSelectedRows();
+ final List<Integer> selection = selectedAddresses.getSelectedRows();
if (selection.size() < 1) {
- FacesMessage error = new FacesMessage("Please select at least one address.");
+ final FacesMessage error = new FacesMessage("Please select at least one address.");
FacesContext.getCurrentInstance().addMessage(null, error);
return null;
}
Collections.sort(selection); // why?
for (int i = selection.size() - 1; i >= 0; i--) {
- Address address = currentAddressList.get(selection.get(i));
+ final Address address = currentAddressList.get(selection.get(i));
addressDao.removeAddress(address);
}
selectedAddresses.resetSelected();
@@ -214,8 +215,8 @@ public class Controller implements Seria
}
public String themeChanged() {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- ClientProperties client = VariableResolverUtils.resolveClientProperties(facesContext);
+ final FacesContext facesContext = FacesContext.getCurrentInstance();
+ final ClientProperties client = VariableResolverUtils.resolveClientProperties(facesContext);
client.setTheme(theme);
return null;
}
@@ -228,8 +229,8 @@ public class Controller implements Seria
}
public void validatePhoneNumber(
- FacesContext context, UIComponent component, Object value) {
- String phoneNumber = (String) value;
+ final FacesContext context, final UIComponent component, final Object value) {
+ final String phoneNumber = (String) value;
if (phoneNumber == null || phoneNumber.length() == 0) {
return;
}
@@ -251,7 +252,7 @@ public class Controller implements Seria
return selectedAddresses;
}
- public void setSelectedAddresses(SheetState selectedAddresses) {
+ public void setSelectedAddresses(final SheetState selectedAddresses) {
this.selectedAddresses = selectedAddresses;
}
@@ -259,7 +260,7 @@ public class Controller implements Seria
return renderFileUploadPopup;
}
- public void setRenderFileUploadPopup(boolean renderFileUploadPopup) {
+ public void setRenderFileUploadPopup(final boolean renderFileUploadPopup) {
LOG.debug(">>> " + renderFileUploadPopup);
this.renderFileUploadPopup = renderFileUploadPopup;
}
@@ -269,7 +270,7 @@ public class Controller implements Seria
return null;
}
- public void setRenderPopup(boolean renderPopup) {
+ public void setRenderPopup(final boolean renderPopup) {
this.renderPopup = renderPopup;
}
@@ -284,7 +285,7 @@ public class Controller implements Seria
public String okFileUpload() {
setRenderFileUploadPopup(false);
- Picture picture = new Picture(uploadedFile.getContentType(), uploadedFile.get());
+ final Picture picture = new Picture(uploadedFile.getContentType(), uploadedFile.get());
currentAddress.setPicture(picture);
return null;
}
@@ -300,8 +301,8 @@ public class Controller implements Seria
}
public String logout() {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- HttpSession session = (HttpSession) facesContext.getExternalContext().getSession(false);
+ final FacesContext facesContext = FacesContext.getCurrentInstance();
+ final HttpSession session = (HttpSession) facesContext.getExternalContext().getSession(false);
if (session != null) {
session.invalidate();
}
@@ -320,7 +321,7 @@ public class Controller implements Seria
return language.getDisplayName(language);
}
- public void setLanguage(Locale language) {
+ public void setLanguage(final Locale language) {
this.language = language;
}
@@ -328,7 +329,7 @@ public class Controller implements Seria
return languages;
}
- public void setLanguages(List<SelectItem> languages) {
+ public void setLanguages(final List<SelectItem> languages) {
this.languages = languages;
}
@@ -344,7 +345,7 @@ public class Controller implements Seria
return theme;
}
- public void setTheme(Theme theme) {
+ public void setTheme(final Theme theme) {
this.theme = theme;
}
@@ -352,7 +353,7 @@ public class Controller implements Seria
return simple;
}
- public void setSimple(boolean simple) {
+ public void setSimple(final boolean simple) {
this.simple = simple;
}
@@ -360,7 +361,7 @@ public class Controller implements Seria
return renderFirstName;
}
- public void setRenderFirstName(boolean renderFirstName) {
+ public void setRenderFirstName(final boolean renderFirstName) {
this.renderFirstName = renderFirstName;
}
@@ -368,7 +369,7 @@ public class Controller implements Seria
return renderLastName;
}
- public void setRenderLastName(boolean renderLastName) {
+ public void setRenderLastName(final boolean renderLastName) {
this.renderLastName = renderLastName;
}
@@ -376,7 +377,7 @@ public class Controller implements Seria
return renderDayOfBirth;
}
- public void setRenderDayOfBirth(boolean renderDayOfBirth) {
+ public void setRenderDayOfBirth(final boolean renderDayOfBirth) {
this.renderDayOfBirth = renderDayOfBirth;
}
@@ -384,7 +385,7 @@ public class Controller implements Seria
return uploadedFile;
}
- public void setUploadedFile(FileItem uploadedFile) {
+ public void setUploadedFile(final FileItem uploadedFile) {
this.uploadedFile = uploadedFile;
}
@@ -392,7 +393,7 @@ public class Controller implements Seria
return searchCriterion;
}
- public void setSearchCriterion(String searchCriterion) {
+ public void setSearchCriterion(final String searchCriterion) {
this.searchCriterion = searchCriterion;
}
@@ -420,12 +421,12 @@ public class Controller implements Seria
private void initLanguages() {
languages.clear();
- FacesContext facesContext = FacesContext.getCurrentInstance();
- Application application = facesContext.getApplication();
- Iterator supportedLocales = application.getSupportedLocales();
+ final FacesContext facesContext = FacesContext.getCurrentInstance();
+ final Application application = facesContext.getApplication();
+ final Iterator supportedLocales = application.getSupportedLocales();
while (supportedLocales.hasNext()) {
- Locale locale = (Locale) supportedLocales.next();
- SelectItem item = new SelectItem(locale, locale.getDisplayName(language), null, FLAGS.get(locale));
+ final Locale locale = (Locale) supportedLocales.next();
+ final SelectItem item = new SelectItem(locale, locale.getDisplayName(language), null, FLAGS.get(locale));
languages.add(item);
}
Collections.sort(languages, new SelectItemComparator());