You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2007/11/26 20:57:53 UTC
svn commit: r598403 [2/2] - in /tapestry/tapestry5/trunk: ./
tapestry-core/src/main/java/org/apache/tapestry/
tapestry-core/src/main/java/org/apache/tapestry/beaneditor/
tapestry-core/src/main/java/org/apache/tapestry/corelib/base/
tapestry-core/src/ma...
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/LinkFactoryImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/LinkFactoryImpl.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/LinkFactoryImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/LinkFactoryImpl.java Mon Nov 26 11:57:50 2007
@@ -30,6 +30,7 @@
import org.apache.tapestry.services.Request;
import org.apache.tapestry.services.Response;
+import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -55,8 +56,7 @@
void handle(T result, List context);
}
- public LinkFactoryImpl(Request request, Response encoder,
- ComponentInvocationMap componentInvocationMap,
+ public LinkFactoryImpl(Request request, Response encoder, ComponentInvocationMap componentInvocationMap,
RequestPageCache pageCache, TypeCoercer typeCoercer)
{
_request = request;
@@ -82,8 +82,7 @@
@SuppressWarnings("unchecked")
public void handle(Object[] result, List context)
{
- for (Object o : result)
- context.add(o);
+ context.addAll(Arrays.asList(result));
}
});
@@ -104,8 +103,7 @@
_listeners.add(listener);
}
- public Link createActionLink(ComponentPageElement component, String action, boolean forForm,
- Object... context)
+ public Link createActionLink(ComponentPageElement component, String action, boolean forForm, Object... context)
{
notBlank(action, "action");
@@ -120,8 +118,7 @@
String[] activationContext = collectActivationContextForPage(containingPage);
- ComponentInvocation invocation = new ComponentInvocation(target, contextStrings,
- activationContext);
+ ComponentInvocation invocation = new ComponentInvocation(target, contextStrings, activationContext);
Link link = new LinkImpl(_response, _request.getContextPath(), invocation, forForm);
@@ -164,8 +161,8 @@
// When override is true, we use the activation context even if empty.
- String[] context = (override || activationContext.length != 0) ? toContextStrings(activationContext)
- : collectActivationContextForPage(page);
+ String[] context = (override || activationContext.length != 0) ? toContextStrings(
+ activationContext) : collectActivationContextForPage(page);
PageLinkTarget target = new PageLinkTarget(logicalPageName);
ComponentInvocation invocation = new ComponentInvocation(target, context, null);
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/LocationRenderer.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/LocationRenderer.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/LocationRenderer.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/LocationRenderer.java Mon Nov 26 11:57:50 2007
@@ -95,8 +95,6 @@
writer.write(Integer.toString(current));
writer.end();
- String css = "t-location-content";
-
Element td = writer.element("td", "class", "t-location-content");
if (line == current) td.addClassName("t-location-current");
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/MessagesSource.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/MessagesSource.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/MessagesSource.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/MessagesSource.java Mon Nov 26 11:57:50 2007
@@ -28,8 +28,8 @@
* merge with its parent's properties (with the subclass overriding the super class on any
* conflicts).
*
- * @param MessagesBundle defines the set of properties files to read, as well as a series of parent bundles
- * to extend and override
+ * @param bundle defines the set of properties files to read, as well as a series of parent bundles
+ * to extend and override
* @param locale
* @return the message catalog for the bundle, in the indicated locale
*/
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/MessagesSourceImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/MessagesSourceImpl.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/MessagesSourceImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/MessagesSourceImpl.java Mon Nov 26 11:57:50 2007
@@ -141,12 +141,10 @@
{
Map<String, String> rawProperties = getRawProperties(localization);
- Map<String, String> properties = extend(previous, rawProperties);
-
// Woould be nice to write into the _cookedProperties cache here,
// but we can't because we don't know the locale part of the MultiKey.
- previous = properties;
+ previous = extend(previous, rawProperties);
}
_cookedProperties.put(key, previous);
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/MetaDataLocatorImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/MetaDataLocatorImpl.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/MetaDataLocatorImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/MetaDataLocatorImpl.java Mon Nov 26 11:57:50 2007
@@ -99,13 +99,12 @@
private String locateInDefaults(String key, ComponentResources pageResources)
{
- String logicalName = pageResources.getPageName();
// We're going to peel this apart, slash by slash. Thus for
// "mylib/myfolder/mysubfolder/MyPage" we'll be checking: "mylib/myfolder/mysubfolder",
// then "mylib/myfolder", then "mylib", then "".
- String path = logicalName;
+ String path = pageResources.getPageName();
while (true)
{
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/OpaqueConstantTarget.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/OpaqueConstantTarget.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/OpaqueConstantTarget.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/OpaqueConstantTarget.java Mon Nov 26 11:57:50 2007
@@ -19,7 +19,7 @@
*/
public class OpaqueConstantTarget implements InvocationTarget
{
- private String _path;
+ private final String _path;
public OpaqueConstantTarget(String path)
{
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/PageLoaderProcessor.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/PageLoaderProcessor.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/PageLoaderProcessor.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/PageLoaderProcessor.java Mon Nov 26 11:57:50 2007
@@ -44,7 +44,7 @@
{
private static final String INHERIT_PREFIX = "inherit:";
- private static Runnable NO_OP = new Runnable()
+ private static final Runnable NO_OP = new Runnable()
{
public void run()
{
@@ -89,9 +89,8 @@
private final ComponentTemplateSource _templateSource;
- public PageLoaderProcessor(ComponentTemplateSource templateSource,
- PageElementFactory pageElementFactory, LinkFactory linkFactory,
- PersistentFieldManager persistentFieldManager)
+ public PageLoaderProcessor(ComponentTemplateSource templateSource, PageElementFactory pageElementFactory,
+ LinkFactory linkFactory, PersistentFieldManager persistentFieldManager)
{
_templateSource = templateSource;
_pageElementFactory = pageElementFactory;
@@ -112,18 +111,11 @@
// Meta default of literal for the template.
- String defaultBindingPrefix = determineDefaultBindingPrefix(
- component,
- name,
- TapestryConstants.LITERAL_BINDING_PREFIX);
-
- Binding binding = findBinding(
- _loadingElement,
- component,
- name,
- token.getValue(),
- defaultBindingPrefix,
- token.getLocation());
+ String defaultBindingPrefix = determineDefaultBindingPrefix(component, name,
+ TapestryConstants.LITERAL_BINDING_PREFIX);
+
+ Binding binding = findBinding(_loadingElement, component, name, token.getValue(), defaultBindingPrefix,
+ token.getLocation());
if (binding != null)
{
@@ -135,8 +127,7 @@
}
}
- private void addMixinsToComponent(ComponentPageElement component, EmbeddedComponentModel model,
- String mixins)
+ private void addMixinsToComponent(ComponentPageElement component, EmbeddedComponentModel model, String mixins)
{
if (model != null)
{
@@ -151,26 +142,18 @@
}
}
- private void bindParametersFromModel(EmbeddedComponentModel model,
- ComponentPageElement loadingComponent, ComponentPageElement component,
- Map<String, Binding> bindingMap)
+ private void bindParametersFromModel(EmbeddedComponentModel model, ComponentPageElement loadingComponent,
+ ComponentPageElement component, Map<String, Binding> bindingMap)
{
for (String name : model.getParameterNames())
{
String value = model.getParameterValue(name);
- String defaultBindingPrefix = determineDefaultBindingPrefix(
- component,
- name,
- TapestryConstants.PROP_BINDING_PREFIX);
-
- Binding binding = findBinding(
- loadingComponent,
- component,
- name,
- value,
- defaultBindingPrefix,
- component.getLocation());
+ String defaultBindingPrefix = determineDefaultBindingPrefix(component, name,
+ TapestryConstants.PROP_BINDING_PREFIX);
+
+ Binding binding = findBinding(loadingComponent, component, name, value, defaultBindingPrefix,
+ component.getLocation());
if (binding != null)
{
@@ -190,9 +173,8 @@
* @return the new binding, or an existing binding (if inherited), or null (if inherited, and
* the containing parameter is not bound)
*/
- private Binding findBinding(ComponentPageElement loadingComponent,
- ComponentPageElement component, String name, String value, String defaultBindingPrefix,
- Location location)
+ private Binding findBinding(ComponentPageElement loadingComponent, ComponentPageElement component, String name,
+ String value, String defaultBindingPrefix, Location location)
{
if (value.startsWith(INHERIT_PREFIX))
{
@@ -206,12 +188,9 @@
if (existing == null) return null;
- String description = String.format(
- "InheritedBinding[parameter %s %s(inherited from %s of %s)]",
- name,
- component.getCompleteId(),
- loadingParameterName,
- loadingComponent.getCompleteId());
+ String description = String.format("InheritedBinding[parameter %s %s(inherited from %s of %s)]", name,
+ component.getCompleteId(), loadingParameterName,
+ loadingComponent.getCompleteId());
// This helps with debugging, and re-orients any thrown exceptions
// to the location of the inherited binding, rather than the container component's
@@ -220,13 +199,8 @@
return new InheritedBinding(description, existing, location);
}
- return _pageElementFactory.newBinding(
- name,
- loadingComponent.getComponentResources(),
- component.getComponentResources(),
- defaultBindingPrefix,
- value,
- location);
+ return _pageElementFactory.newBinding(name, loadingComponent.getComponentResources(),
+ component.getComponentResources(), defaultBindingPrefix, value, location);
}
/**
@@ -237,8 +211,8 @@
* @param informalParameterBindingPrefix the default to use for informal parameters
* @return the binding prefix
*/
- private String determineDefaultBindingPrefix(ComponentPageElement component,
- String parameterName, String informalParameterBindingPrefix)
+ private String determineDefaultBindingPrefix(ComponentPageElement component, String parameterName,
+ String informalParameterBindingPrefix)
{
String defaultBindingPrefix = component.getDefaultBindingPrefix(parameterName);
@@ -274,7 +248,7 @@
addToBody(element);
}
- private void body(BodyToken token)
+ private void body()
{
addToBody(newRenderBodyElement());
@@ -304,7 +278,7 @@
_endElementCommandStack.push(command);
}
- private void endElement(EndElementToken token)
+ private void endElement()
{
// discard will be false if the matching start token was for a static element, and will be
// true otherwise (component, block, parameter).
@@ -377,9 +351,7 @@
private void loadRootComponent(String className)
{
- ComponentPageElement rootComponent = _pageElementFactory.newRootComponentElement(
- _page,
- className);
+ ComponentPageElement rootComponent = _pageElementFactory.newRootComponentElement(_page, className);
_page.setRootElement(rootComponent);
@@ -428,9 +400,7 @@
}
if (!embeddedIds.isEmpty())
- logger.error(ServicesMessages.embeddedComponentsNotInTemplate(
- embeddedIds.keySet(),
- componentClassName));
+ logger.error(ServicesMessages.embeddedComponentsNotInTemplate(embeddedIds.keySet(), componentClassName));
_addAttributesAsComponentBindings = false;
@@ -462,7 +432,7 @@
break;
case BODY:
- body((BodyToken) token);
+ body();
break;
case START_ELEMENT:
@@ -478,7 +448,7 @@
break;
case END_ELEMENT:
- endElement((EndElementToken) token);
+ endElement();
break;
case COMMENT:
@@ -585,27 +555,21 @@
embeddedComponentClassName = embeddedModel.getComponentClassName();
}
- if (isBlank(embeddedType) && isBlank(embeddedComponentClassName))
- throw new TapestryException(ServicesMessages.noTypeForEmbeddedComponent(
- embeddedId,
- _loadingComponentModel.getComponentClassName()), token, null);
-
- ComponentPageElement newComponent = _pageElementFactory.newComponentElement(
- _page,
- _loadingElement,
- embeddedId,
- embeddedType,
- embeddedComponentClassName,
- elementName,
- token.getLocation());
+ if (isBlank(embeddedType) && isBlank(embeddedComponentClassName)) throw new TapestryException(
+ ServicesMessages.noTypeForEmbeddedComponent(embeddedId, _loadingComponentModel.getComponentClassName()),
+ token, null);
+
+ ComponentPageElement newComponent = _pageElementFactory.newComponentElement(_page, _loadingElement, embeddedId,
+ embeddedType,
+ embeddedComponentClassName,
+ elementName, token.getLocation());
addMixinsToComponent(newComponent, embeddedModel, token.getMixins());
Map<String, Binding> bindingMap = newMap();
_componentIdToBindingMap.put(newComponent.getCompleteId(), bindingMap);
- if (embeddedModel != null)
- bindParametersFromModel(embeddedModel, _loadingElement, newComponent, bindingMap);
+ if (embeddedModel != null) bindParametersFromModel(embeddedModel, _loadingElement, newComponent, bindingMap);
addToBody(newComponent);
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/PersistentLocaleImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/PersistentLocaleImpl.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/PersistentLocaleImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/PersistentLocaleImpl.java Mon Nov 26 11:57:50 2007
@@ -26,7 +26,7 @@
*/
private static final String LOCALE_COOKIE_NAME = "org.apache.tapestry.locale";
- private Cookies _cookieSource;
+ private final Cookies _cookieSource;
public PersistentLocaleImpl(Cookies cookieSource)
{
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ServicesMessages.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ServicesMessages.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ServicesMessages.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ServicesMessages.java Mon Nov 26 11:57:50 2007
@@ -34,17 +34,12 @@
{
private static final Messages MESSAGES = MessagesImpl.forClass(ServicesMessages.class);
- static final String duplicateContribution(Object conflict, Class contributionType,
- Object existing)
+ static String duplicateContribution(Object conflict, Class contributionType, Object existing)
{
- return MESSAGES.format(
- "duplicate-contribution",
- conflict,
- contributionType.getName(),
- existing);
+ return MESSAGES.format("duplicate-contribution", conflict, contributionType.getName(), existing);
}
- static final String markupWriterNoCurrentElement()
+ static String markupWriterNoCurrentElement()
{
return MESSAGES.get("markup-writer-no-current-element");
}
@@ -64,11 +59,9 @@
return MESSAGES.format("error-adding-method", ctClass.getName(), methodName, cause);
}
- static String fieldAlreadyClaimed(String fieldName, CtClass ctClass, Object existingTag,
- Object newTag)
+ static String fieldAlreadyClaimed(String fieldName, CtClass ctClass, Object existingTag, Object newTag)
{
- return MESSAGES.format("field-already-claimed", new Object[]
- {fieldName, ctClass.getName(), existingTag, newTag});
+ return MESSAGES.format("field-already-claimed", fieldName, ctClass.getName(), existingTag, newTag);
}
static String noDeclaredMethod(CtClass ctClass, TransformMethodSignature methodSignature)
@@ -112,8 +105,7 @@
return MESSAGES.format("may-not-nest-elements-inside-body", elementName);
}
- static String methodCompileError(TransformMethodSignature signature, String methodBody,
- Throwable cause)
+ static String methodCompileError(TransformMethodSignature signature, String methodBody, Throwable cause)
{
return MESSAGES.format("method-compile-error", signature, methodBody, cause);
}
@@ -145,10 +137,8 @@
static String embeddedComponentsNotInTemplate(Collection<String> ids, String componentClassName)
{
- return MESSAGES.format(
- "embedded-components-not-in-template",
- InternalUtils.joinSorted(ids),
- componentClassName);
+ return MESSAGES.format("embedded-components-not-in-template", InternalUtils.joinSorted(ids),
+ componentClassName);
}
static String bindingSourceFailure(String expression, Throwable cause)
@@ -177,8 +167,7 @@
return MESSAGES.format("component-event-is-aborted", methodDescription);
}
- static String unknownPersistentFieldStrategy(String stategyName,
- Collection<String> strategyNames)
+ static String unknownPersistentFieldStrategy(String stategyName, Collection<String> strategyNames)
{
return MESSAGES.format("unknown-persistent-field-strategy", stategyName, InternalUtils
.joinSorted(strategyNames));
@@ -196,8 +185,7 @@
.joinSorted(pageNames));
}
- static String couldNotResolveComponentType(String componentType,
- Collection<String> componentTypes)
+ static String couldNotResolveComponentType(String componentType, Collection<String> componentTypes)
{
return MESSAGES.format("could-not-resolve-component-type", componentType, InternalUtils
.joinSorted(componentTypes));
@@ -219,8 +207,7 @@
return MESSAGES.format("page-is-dirty", page);
}
- static String componentInstanceIsNotAPage(String methodDescription, Component component,
- Component result)
+ static String componentInstanceIsNotAPage(String methodDescription, Component component, Component result)
{
return MESSAGES.format("component-instance-is-not-a-page", methodDescription, component
.getComponentResources().getCompleteId(), result.getComponentResources()
@@ -247,8 +234,7 @@
return MESSAGES.format("wrong-asset-digest", resource.getPath());
}
- static String componentNotAssignableToField(Component component, String fieldName,
- String fieldType)
+ static String componentNotAssignableToField(Component component, String fieldName, String fieldType)
{
return MESSAGES.format("component-not-assignable-to-field", component
.getComponentResources().getCompleteId(), fieldName, fieldType);
@@ -268,11 +254,8 @@
static String validatorSpecificationParseError(int cursor, String specification)
{
- return MESSAGES.format(
- "validator-specification-parse-error",
- specification.charAt(cursor),
- cursor + 1,
- specification);
+ return MESSAGES.format("validator-specification-parse-error", specification.charAt(cursor), cursor + 1,
+ specification);
}
static String mixinsInvalidWithoutIdOrType(String elementName)
@@ -292,8 +275,8 @@
}
- static String invalidComponentEventResult(Component component, Object result,
- String methodDescription, Collection<Class> configuredResultTypes)
+ static String invalidComponentEventResult(Component component, Object result, String methodDescription,
+ Collection<Class> configuredResultTypes)
{
List<String> classNames = CollectionFactory.newList();
@@ -305,14 +288,9 @@
.getClass()), InternalUtils.joinSorted(classNames));
}
- static String undefinedTapestryAttribute(String elementName, String attributeName,
- String allowedAttributeName)
+ static String undefinedTapestryAttribute(String elementName, String attributeName, String allowedAttributeName)
{
- return MESSAGES.format(
- "undefined-tapestry-attribute",
- elementName,
- attributeName,
- allowedAttributeName);
+ return MESSAGES.format("undefined-tapestry-attribute", elementName, attributeName, allowedAttributeName);
}
static String parameterElementNameRequired()
@@ -320,13 +298,10 @@
return MESSAGES.get("parameter-element-name-required");
}
- static String missingApplicationStatePersistenceStrategy(String name,
- Collection<String> availableNames)
+ static String missingApplicationStatePersistenceStrategy(String name, Collection<String> availableNames)
{
- return MESSAGES.format(
- "missing-application-state-persistence-strategy",
- name,
- InternalUtils.joinSorted(availableNames));
+ return MESSAGES.format("missing-application-state-persistence-strategy", name,
+ InternalUtils.joinSorted(availableNames));
}
static String methodIsVoid(String methodName, Class inClass, String propertyExpression)
@@ -336,31 +311,19 @@
static String methodNotFound(String methodName, Class inClass, String propertyExpression)
{
- return MESSAGES.format(
- "method-not-found",
- methodName,
- inClass.getName(),
- propertyExpression);
+ return MESSAGES.format("method-not-found", methodName, inClass.getName(), propertyExpression);
}
static String noSuchProperty(Class targetClass, String propertyName, String propertyExpression,
Collection<String> propertyNames)
{
- return MESSAGES.format(
- "no-such-property",
- targetClass.getName(),
- propertyName,
- propertyExpression,
- InternalUtils.joinSorted(propertyNames));
+ return MESSAGES.format("no-such-property", targetClass.getName(), propertyName, propertyExpression,
+ InternalUtils.joinSorted(propertyNames));
}
static String writeOnlyProperty(String propertyName, Class clazz, String propertyExpression)
{
- return MESSAGES.format(
- "write-only-property",
- propertyName,
- clazz.getName(),
- propertyExpression);
+ return MESSAGES.format("write-only-property", propertyName, clazz.getName(), propertyExpression);
}
static String requestException(Throwable cause)
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/TemplateParserImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/TemplateParserImpl.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/TemplateParserImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/TemplateParserImpl.java Mon Nov 26 11:57:50 2007
@@ -42,8 +42,7 @@
* Non-threadsafe implementation; the IOC service uses the perthread lifecycle.
*/
@Scope(PERTHREAD_SCOPE)
-public class TemplateParserImpl implements TemplateParser, LexicalHandler, ContentHandler,
- EntityResolver
+public class TemplateParserImpl implements TemplateParser, LexicalHandler, ContentHandler, EntityResolver
{
private static final String MIXINS_ATTRIBUTE_NAME = "mixins";
@@ -107,9 +106,7 @@
// expansions on the same text line into a single large
// but invalid expansion.
- private final Pattern EXPANSION_PATTERN = Pattern.compile(
- "\\$\\{\\s*(.*?)\\s*}",
- Pattern.MULTILINE);
+ private final Pattern EXPANSION_PATTERN = Pattern.compile("\\$\\{\\s*(.*?)\\s*}", Pattern.MULTILINE);
public TemplateParserImpl(Logger logger, Map<String, URL> configuration)
{
@@ -134,8 +131,7 @@
// Stack needs a clear();
- while (!_endTagHandlerStack.isEmpty())
- _endTagHandlerStack.pop();
+ while (!_endTagHandlerStack.isEmpty()) _endTagHandlerStack.pop();
}
public ComponentTemplate parseTemplate(Resource templateResource)
@@ -156,15 +152,13 @@
}
catch (Exception ex)
{
- throw new RuntimeException(ServicesMessages.newParserError(templateResource, ex),
- ex);
+ throw new RuntimeException(ServicesMessages.newParserError(templateResource, ex), ex);
}
}
URL resourceURL = templateResource.toURL();
- if (resourceURL == null)
- throw new RuntimeException(ServicesMessages.missingTemplateResource(templateResource));
+ if (resourceURL == null) throw new RuntimeException(ServicesMessages.missingTemplateResource(templateResource));
_templateResource = templateResource;
@@ -183,8 +177,8 @@
_reader = null;
- throw new TapestryException(ServicesMessages.templateParseError(templateResource, ex),
- getCurrentLocation(), ex);
+ throw new TapestryException(ServicesMessages.templateParseError(templateResource, ex), getCurrentLocation(),
+ ex);
}
finally
{
@@ -277,21 +271,19 @@
_tokens.add(new TextToken(text.substring(startx, text.length()), _textStartLocation));
}
- public void startElement(String uri, String localName, String qName, Attributes attributes)
- throws SAXException
+ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
{
_ignoreEvents = false;
- if (_insideBody)
- throw new IllegalStateException(ServicesMessages
- .mayNotNestElementsInsideBody(localName));
+ if (_insideBody) throw new IllegalStateException(ServicesMessages
+ .mayNotNestElementsInsideBody(localName));
// Add any accumulated text into a text token
processTextBuffer();
if (TAPESTRY_SCHEMA_5_0_0.equals(uri))
{
- startTapestryElement(qName, localName, attributes);
+ startTapestryElement(localName, attributes);
return;
}
@@ -322,7 +314,7 @@
return _insideBody;
}
- private void startTapestryElement(String qname, String localName, Attributes attributes)
+ private void startTapestryElement(String localName, Attributes attributes)
{
if (localName.equalsIgnoreCase("body"))
{
@@ -379,15 +371,13 @@
String parameterName = findSingleParameter("parameter", "name", attributes);
if (InternalUtils.isBlank(parameterName))
- throw new TapestryException(ServicesMessages.parameterElementNameRequired(),
- getCurrentLocation(), null);
+ throw new TapestryException(ServicesMessages.parameterElementNameRequired(), getCurrentLocation(), null);
_tokens.add(new ParameterToken(parameterName, getCurrentLocation()));
_endTagHandlerStack.push(_addEndElementToken);
}
- private String findSingleParameter(String elementName, String attributeName,
- Attributes attributes)
+ private String findSingleParameter(String elementName, String attributeName, Attributes attributes)
{
String result = null;
@@ -403,10 +393,8 @@
// Only the name attribute is allowed.
- throw new TapestryException(ServicesMessages.undefinedTapestryAttribute(
- elementName,
- name,
- attributeName), getCurrentLocation(), null);
+ throw new TapestryException(ServicesMessages.undefinedTapestryAttribute(elementName, name, attributeName),
+ getCurrentLocation(), null);
}
return result;
@@ -424,8 +412,7 @@
* @param identifiedType the type of the element, usually null, but may be the component type derived from
* the element name (for an element in the Tapestry namespace)
*/
- private void startPossibleComponent(Attributes attributes, String elementName,
- String identifiedType)
+ private void startPossibleComponent(Attributes attributes, String elementName, String identifiedType)
{
String id = null;
String type = identifiedType;
@@ -478,8 +465,7 @@
// If provided t:mixins but not t:id or t:type, then its not quite a component
if (mixins != null && !isComponent)
- throw new TapestryException(ServicesMessages.mixinsInvalidWithoutIdOrType(elementName),
- location, null);
+ throw new TapestryException(ServicesMessages.mixinsInvalidWithoutIdOrType(elementName), location, null);
if (isComponent)
{
@@ -639,8 +625,7 @@
{
}
- public InputSource resolveEntity(String publicId, String systemId) throws SAXException,
- IOException
+ public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
{
URL url = _configuration.get(publicId);
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ValidationMessagesSourceImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ValidationMessagesSourceImpl.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ValidationMessagesSourceImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ValidationMessagesSourceImpl.java Mon Nov 26 11:57:50 2007
@@ -63,8 +63,6 @@
}
- ;
-
/**
* Delegates to a {@link Messages} instance obtained from the {@link MessagesSource}. This
* ensures that changes to the underlying properties files will be reflected.
@@ -115,8 +113,7 @@
this(bundles, classpathRoot, new URLChangeTracker());
}
- ValidationMessagesSourceImpl(Collection<String> bundles, Resource classpathRoot,
- URLChangeTracker tracker)
+ ValidationMessagesSourceImpl(Collection<String> bundles, Resource classpathRoot, URLChangeTracker tracker)
{
_messagesSource = new MessagesSourceImpl(tracker);
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElementImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElementImpl.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElementImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElementImpl.java Mon Nov 26 11:57:50 2007
@@ -167,8 +167,6 @@
}
}
- ;
-
private final RenderCommand _afterRender = new RenderCommand()
{
public void render(final MarkupWriter writer, RenderQueue queue)
@@ -751,7 +749,7 @@
/**
* Delegates to the
- * {@link Page#createActionLink(Element, ComponentPageElement, String, boolean, Object[]) the containing page}.
+ * {@link Page#createActionLink(ComponentPageElement, String, boolean, Object[]) the containing page}.
* Why the extra layer? Trying to avoid some unwanted injection (of LinkFactory, into every
* component page element).
*/
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/test/TestableCookieSinkSource.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/test/TestableCookieSinkSource.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/test/TestableCookieSinkSource.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/test/TestableCookieSinkSource.java Mon Nov 26 11:57:50 2007
@@ -23,12 +23,7 @@
public class TestableCookieSinkSource implements CookieSource, CookieSink
{
- private Map<String, Cookie> _cookies;
-
- public TestableCookieSinkSource()
- {
- _cookies = CollectionFactory.newMap();
- }
+ private final Map<String, Cookie> _cookies = CollectionFactory.newMap();
public Cookie[] getCookies()
{
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/Base64OutputStream.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/Base64OutputStream.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/Base64OutputStream.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/Base64OutputStream.java Mon Nov 26 11:57:50 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 The Apache Software Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.internal.util;
import org.apache.commons.codec.binary.Base64;
@@ -30,10 +30,6 @@
byte[] base64 = Base64.encodeBase64(binary);
- String result = new String(base64);
-
- // System.out.printf("result = %d characters\n\n", result.length());
-
- return result;
+ return new String(base64);
}
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/IntegerRange.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/IntegerRange.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/IntegerRange.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/IntegerRange.java Mon Nov 26 11:57:50 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 The Apache Software Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.internal.util;
import java.util.Iterator;
@@ -118,8 +118,8 @@
if (getClass() != obj.getClass()) return false;
final IntegerRange other = (IntegerRange) obj;
if (_finish != other._finish) return false;
- if (_start != other._start) return false;
- return true;
+
+ return _start == other._start;
}
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/PrintOutCollector.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/PrintOutCollector.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/PrintOutCollector.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/PrintOutCollector.java Mon Nov 26 11:57:50 2007
@@ -22,7 +22,7 @@
*/
public class PrintOutCollector
{
- private StringWriter _stringWriter;
+ private final StringWriter _stringWriter;
private PrintWriter _printWriter;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/URLChangeTracker.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/URLChangeTracker.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/URLChangeTracker.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/URLChangeTracker.java Mon Nov 26 11:57:50 2007
@@ -35,7 +35,7 @@
private final Map<File, Long> _fileToTimestamp = newConcurrentMap();
- private boolean _granularitySeconds;
+ private final boolean _granularitySeconds;
/**
* Creates a new URL change tracker with millisecond-level granularity.
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONArray.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONArray.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONArray.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONArray.java Mon Nov 26 11:57:50 2007
@@ -90,7 +90,6 @@
* The arrayList where the JSONArray's properties are kept.
*/
private final List<Object> _list = CollectionFactory.newList();
- ;
/**
* Construct an empty JSONArray.
@@ -181,9 +180,7 @@
if (value instanceof Boolean)
{
- Boolean asBoolean = (Boolean) value;
-
- return asBoolean.booleanValue();
+ return (Boolean) value;
}
if (value instanceof String)
@@ -203,7 +200,7 @@
*
* @param index The index must be between 0 and length() - 1.
* @return The value.
- * @throws JSONException If the key is not found or if the value cannot be converted to a number.
+ * @throws IllegalArgumentException If the key is not found or if the value cannot be converted to a number.
*/
public double getDouble(int index)
{
@@ -217,7 +214,7 @@
}
catch (Exception e)
{
- throw new RuntimeException("JSONArray[" + index + "] is not a number.");
+ throw new IllegalArgumentException("JSONArray[" + index + "] is not a number.");
}
}
@@ -226,8 +223,8 @@
*
* @param index The index must be between 0 and length() - 1.
* @return The value.
- * @throws JSONException If the key is not found or if the value cannot be converted to a number. if the
- * value cannot be converted to a number.
+ * @throws IllegalArgumentException If the key is not found or if the value cannot be converted to a number. if the
+ * value cannot be converted to a number.
*/
public int getInt(int index)
{
@@ -276,7 +273,7 @@
*
* @param index The index must be between 0 and length() - 1.
* @return The value.
- * @throws JSONException If the key is not found or if the value cannot be converted to a number.
+ * @throws IllegalArgumentException If the key is not found or if the value cannot be converted to a number.
*/
public long getLong(int index)
{
@@ -386,8 +383,7 @@
}
else
{
- while (index != length())
- _list.add(JSONObject.NULL);
+ while (index != length()) _list.add(JSONObject.NULL);
_list.add(value);
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONObject.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONObject.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONObject.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONObject.java Mon Nov 26 11:57:50 2007
@@ -97,6 +97,7 @@
* @author JSON.org
* @version 2
*/
+@SuppressWarnings({"CloneDoesntCallSuperClone"})
public final class JSONObject
{
@@ -423,7 +424,7 @@
// This is a bit sloppy for the case where value is not a string.
- return Double.valueOf((String) value).doubleValue();
+ return Double.valueOf((String) value);
}
catch (Exception e)
{
@@ -696,11 +697,10 @@
buffer.append("\\r");
break;
default:
- if (c < ' ' || (c >= '\u0080' && c < '\u00a0')
- || (c >= '\u2000' && c < '\u2100'))
+ if (c < ' ' || (c >= '\u0080' && c < '\u00a0') || (c >= '\u2000' && c < '\u2100'))
{
t = "000" + Integer.toHexString(c);
- buffer.append("\\u" + t.substring(t.length() - 4));
+ buffer.append("\\u").append(t.substring(t.length() - 4));
}
else
{
@@ -723,8 +723,8 @@
return _properties.remove(key);
}
- private static final Class[] ALLOWED = new Class[]
- {String.class, Boolean.class, Number.class, JSONObject.class, JSONArray.class, Null.class};
+ private static final Class[] ALLOWED = new Class[]{String.class, Boolean.class, Number.class, JSONObject.class,
+ JSONArray.class, Null.class};
/**
* Throw an exception if the object is an NaN or infinite number, or not a type which may be
@@ -749,12 +749,10 @@
}
}
- if (!found)
- throw new RuntimeException(
- String
- .format(
- "JSONObject properties may be String, Boolean, Number, JSONObject or JSONArray. Type %s is not allowed.",
- actual.getName()));
+ if (!found) throw new RuntimeException(String
+ .format(
+ "JSONObject properties may be String, Boolean, Number, JSONObject or JSONArray. Type %s is not allowed.",
+ actual.getName()));
if (value instanceof Double)
{
@@ -762,8 +760,7 @@
if (asDouble.isInfinite() || asDouble.isNaN())
{
- throw new RuntimeException(
- "JSON does not allow non-finite numbers.");
+ throw new RuntimeException("JSON does not allow non-finite numbers.");
}
return;
@@ -775,11 +772,9 @@
if (asFloat.isInfinite() || asFloat.isNaN())
{
- throw new RuntimeException(
- "JSON does not allow non-finite numbers.");
+ throw new RuntimeException("JSON does not allow non-finite numbers.");
}
- return;
}
}
@@ -805,7 +800,7 @@
{
if (comma) buffer.append(',');
- buffer.append(quote(key.toString()));
+ buffer.append(quote(key));
buffer.append(':');
buffer.append(valueToString(_properties.get(key)));
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONTokener.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONTokener.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONTokener.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONTokener.java Mon Nov 26 11:57:50 2007
@@ -188,8 +188,7 @@
do
{
c = next();
- }
- while (c != '\n' && c != '\r' && c != 0);
+ } while (c != '\n' && c != '\r' && c != 0);
break;
case '*':
@@ -222,8 +221,7 @@
do
{
c = next();
- }
- while (c != '\n' && c != '\r' && c != 0);
+ } while (c != '\n' && c != '\r' && c != 0);
}
else if (c == 0 || c > ' ')
{
@@ -423,7 +421,7 @@
{
try
{
- return new Integer(Integer.parseInt(s.substring(2), 16));
+ return Integer.parseInt(s.substring(2), 16);
}
catch (Exception e)
{
@@ -434,7 +432,7 @@
{
try
{
- return new Integer(Integer.parseInt(s, 8));
+ return Integer.parseInt(s, 8);
}
catch (Exception e)
{
@@ -487,8 +485,7 @@
_index = index;
return c;
}
- }
- while (c != to);
+ } while (c != to);
back();
return c;
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/ComponentModel.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/ComponentModel.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/ComponentModel.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/ComponentModel.java Mon Nov 26 11:57:50 2007
@@ -61,7 +61,7 @@
*
* @param fieldName
* @return the corresponding strategy, or the empty string
- * @throw IllegalArgumentException if the named field is not marked as persistent
+ * @throws IllegalArgumentException if the named field is not marked as persistent
*/
String getFieldPersistenceStrategy(String fieldName);
@@ -104,9 +104,9 @@
List<String> getPersistentFieldNames();
/**
- * Returns true if the modeled component is a root class, a component class whose parent does
- * not have the {@link ComponentClass} annotation. This is often used to determine whether to
- * invoke the super-class implementation of certain methods.
+ * Returns true if the modeled component is a root class, a component class whose parent
+ * class is not a component class. We may in the future require that components only extend
+ * from Object.
*
* @return true if a root class, false if a subclass
*/
@@ -124,7 +124,7 @@
/**
* Returns the component model for this component's super-class, if it exists. Remember that
- * only classes with the {@link ComponentClass} annotation, and in the correct packages, are
+ * only classes in the correct packages, are
* considered component classes.
*
* @return the parent class model, or null if this component's super class is not itself a
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/runtime/Component.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/runtime/Component.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/runtime/Component.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/runtime/Component.java Mon Nov 26 11:57:50 2007
@@ -71,7 +71,7 @@
/**
* Generally used to write the close tag matching any open tag written by
- * {@link #beginRender(MarkupWriter, LifecycleEvent)}.
+ * {@link #beginRender(org.apache.tapestry.MarkupWriter, Event)}.
*/
void afterRender(MarkupWriter writer, Event event);
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ClassTransformation.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ClassTransformation.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ClassTransformation.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ClassTransformation.java Mon Nov 26 11:57:50 2007
@@ -228,8 +228,8 @@
* {@link #addMethod(TransformMethodSignature, String)} when it is necessary to control when the
* super-class method is invoked.
*
- * @param signature the signature of the method to extend
- * @param methodBody the body of code
+ * @param methodSignature the signature of the method to extend
+ * @param methodBody the body of code
* @throws IllegalArgumentException if the provided Javassist method body can not be compiled
*/
void extendMethod(TransformMethodSignature methodSignature, String methodBody);
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ComponentLayer.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ComponentLayer.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ComponentLayer.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ComponentLayer.java Mon Nov 26 11:57:50 2007
@@ -26,7 +26,7 @@
/**
* Used to identify a service from the component layer that conflicts, in terms of service
* interface, with a service from elsewhere. In particular, this is used to disambiguate
- * {@link ComponentClassFactory} which has one implementation (marked with {@link Builtin} and
+ * {@link org.apache.tapestry.ioc.services.ClassFactory} which has one implementation (marked with {@link Builtin} and
* another with this annotation.
*/
@Target(
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/InjectionProvider.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/InjectionProvider.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/InjectionProvider.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/InjectionProvider.java Mon Nov 26 11:57:50 2007
@@ -19,7 +19,7 @@
/**
* Provides some form of injection when the value for an
- * {@link org.apache.tapestry.annotations.Inject} annotation is present. In this case, the provider
+ * {@link org.apache.tapestry.ioc.annotations.Inject} annotation is present. In this case, the provider
* is responsible for determining the value to be injected from the field name and field type.
* <p/>
* This interface will be used as part of a
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/PersistentFieldStrategy.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/PersistentFieldStrategy.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/PersistentFieldStrategy.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/PersistentFieldStrategy.java Mon Nov 26 11:57:50 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 The Apache Software Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.services;
import java.util.Collection;
@@ -24,7 +24,6 @@
* @param pageName the name of the page containing the component
* @param componentId the nested id path of the component (or null for the page's root component)
* @param fieldName the name of the field whose persistent value has changed
- * @param strategy the name of the stategy used to persist the property value
* @param newValue the new value for the field, possibly null
*/
void postChange(String pageName, String componentId, String fieldName, Object newValue);
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/Request.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/Request.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/Request.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/Request.java Mon Nov 26 11:57:50 2007
@@ -52,8 +52,6 @@
/**
* Returns the parameter values for the given name. Returns null if no such parameter is in the
* request.
- * <p/>
- * TODO: Shouldn't this move to {@link FormParameterLookup}?
*/
String[] getParameters(String name);
@@ -85,7 +83,7 @@
* header can't be converted to a date, the method throws an
* <code>IllegalArgumentException</code>.
*
- * @param nme a <code>String</code> specifying the name of the header
+ * @param name a <code>String</code> specifying the name of the header
* @return a <code>long</code> value representing the date specified in the header expressed
* as the number of milliseconds since January 1, 1970 GMT, or -1 if the named header
* was not included with the reqest
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java Mon Nov 26 11:57:50 2007
@@ -14,7 +14,6 @@
package org.apache.tapestry.services;
-import org.apache.commons.logging.Log;
import org.apache.tapestry.*;
import org.apache.tapestry.annotations.*;
import org.apache.tapestry.beaneditor.Validate;
@@ -178,7 +177,7 @@
}
/**
- * A companion service to {@linkplain #build(Log, AliasManager, Collection) the Alias service}
+ * A companion service to {@linkplain #build(org.slf4j.Logger, String, AliasManager, java.util.Collection)} the Alias service}
* whose configuration contribution define spot overrides to specific services.
*/
public static AliasManager buildAliasOverrides(Logger logger, Collection<AliasContribution> configuration)
@@ -271,14 +270,8 @@
RequestPageCache requestPageCache,
- AssetSource assetSource,
-
- SymbolSource symbolSource,
-
BindingSource bindingsource,
- MasterObjectProvider masterObjectProvider,
-
ApplicationStateManager applicationStateManager)
{
// TODO: Proper scheduling of all of this. Since a given field or method should
@@ -337,7 +330,7 @@
}
/**
- * Adds the {@link #buildDefaultDataTypeAnalyzer(Map) DefaultDatatTypeAnalyzer} to the
+ * Adds the {@link #build(java.util.List)} DefaultDatatTypeAnalyzer} to the
* configuration, ordered explicitly last.
*/
public static void contributeDataTypeAnalyzer(OrderedConfiguration<DataTypeAnalyzer> configuration,
@@ -505,8 +498,6 @@
final RequestExceptionHandler exceptionHandler,
- RequestGlobals requestGlobals,
-
// @Inject not needed because its a long, not a String
@Symbol("tapestry.file-check-interval")
long checkInterval,
@@ -881,7 +872,7 @@
}
/**
- * A chain of command for providing values for {@link org.apache.tapestry.annotations.Inject}-ed
+ * A chain of command for providing values for {@link Inject}-ed
* fields in component classes. The service's configuration can be extended to allow for
* different automatic injections (based on some combination of field type and field name).
*/
@@ -1004,7 +995,7 @@
return service;
}
- public ObjectRenderer build(StrategyBuilder strategyBuilder, Map<Class, ObjectRenderer> configuration)
+ public ObjectRenderer build(Map<Class, ObjectRenderer> configuration)
{
StrategyRegistry<ObjectRenderer> registry = StrategyRegistry.newInstance(ObjectRenderer.class, configuration);
@@ -1240,8 +1231,6 @@
* </dl>
*/
public void contributePageRenderInitializer(OrderedConfiguration<MarkupRendererFilter> configuration,
-
- ThreadLocale threadLocale,
@Path("org/apache/tapestry/default.css")
final Asset stylesheetAsset,
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TransformConstants.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TransformConstants.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TransformConstants.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TransformConstants.java Mon Nov 26 11:57:50 2007
@@ -28,17 +28,20 @@
{
// Shared parameters of a whole bunch of lifecycle methods, representing the different
// component render states.
- private static final String[] RENDER_PHASE_METHOD_PARAMETERS =
- {MarkupWriter.class.getName(), Event.class.getName()};
+ private static final String[] RENDER_PHASE_METHOD_PARAMETERS = {MarkupWriter.class.getName(),
+ Event.class.getName()};
/**
- * Signature for {@link org.apache.tapestry.runtime.Component#handleEvent(Event event)
+ * Signature for {@link org.apache.tapestry.runtime.Component#handleComponentEvent(org.apache.tapestry.runtime.ComponentEvent)}.
*
* @see org.apache.tapestry.annotations.OnEvent
*/
- public static final TransformMethodSignature HANDLE_COMPONENT_EVENT = new TransformMethodSignature(
- Modifier.PUBLIC, "boolean", "handleComponentEvent", new String[]
- {ComponentEvent.class.getName()}, null);
+ public static final TransformMethodSignature HANDLE_COMPONENT_EVENT = new TransformMethodSignature(Modifier.PUBLIC,
+ "boolean",
+ "handleComponentEvent",
+ new String[]{
+ ComponentEvent.class.getName()},
+ null);
/**
* Signature for
@@ -87,7 +90,7 @@
*
* @see org.apache.tapestry.annotations.BeforeRenderTemplate
*/
- public static TransformMethodSignature BEFORE_RENDER_TEMPLATE_SIGNATURE = renderPhaseSignature(
+ public static final TransformMethodSignature BEFORE_RENDER_TEMPLATE_SIGNATURE = renderPhaseSignature(
"beforeRenderTemplate");
/**
@@ -96,7 +99,7 @@
*
* @see org.apache.tapestry.annotations.BeforeRenderTemplate
*/
- public static TransformMethodSignature AFTER_RENDER_TEMPLATE_SIGNATURE = renderPhaseSignature(
+ public static final TransformMethodSignature AFTER_RENDER_TEMPLATE_SIGNATURE = renderPhaseSignature(
"afterRenderTemplate");
/**
@@ -137,7 +140,6 @@
private static TransformMethodSignature renderPhaseSignature(String name)
{
- return new TransformMethodSignature(Modifier.PUBLIC, "void", name, RENDER_PHASE_METHOD_PARAMETERS,
- null);
+ return new TransformMethodSignature(Modifier.PUBLIC, "void", name, RENDER_PHASE_METHOD_PARAMETERS, null);
}
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/test/PageTester.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/test/PageTester.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/test/PageTester.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/test/PageTester.java Mon Nov 26 11:57:50 2007
@@ -54,15 +54,13 @@
public static final String DEFAULT_CONTEXT_PATH = "src/main/webapp";
- private final String _contextPath;
-
private static final String DEFAULT_SUBMIT_VALUE_ATTRIBUTE = "Submit Query";
/**
* Initializes a PageTester without overriding any services and assuming that the context root
* is in src/main/webapp.
*
- * @see #PageTester(String, String, String, Map)
+ * @see #PageTester(String, String, String, Class[])
*/
public PageTester(String appPackage, String appName)
{
@@ -73,25 +71,22 @@
* Initializes a PageTester that acts as a browser and a servlet container to test drive your
* Tapestry pages.
*
- * @param appPackage The same value you would specify using the tapestry.app-package context parameter.
- * As this testing environment is not run in a servlet container, you need to specify
- * it.
- * @param appName The same value you would specify as the filter name. It is used to form the name
- * of the module builder for your app. If you don't have one, pass an empty string.
- * @param contextPath The path to the context root so that Tapestry can find the templates (if they're
- * put there).
- * @param modulesClasses Classes of additional modules to load
+ * @param appPackage The same value you would specify using the tapestry.app-package context parameter.
+ * As this testing environment is not run in a servlet container, you need to specify
+ * it.
+ * @param appName The same value you would specify as the filter name. It is used to form the name
+ * of the module builder for your app. If you don't have one, pass an empty string.
+ * @param contextPath The path to the context root so that Tapestry can find the templates (if they're
+ * put there).
+ * @param moduleClasses Classes of additional modules to load
*/
public PageTester(String appPackage, String appName, String contextPath, Class... moduleClasses)
{
_preferedLanguage = Locale.ENGLISH;
- _contextPath = contextPath;
- SymbolProvider provider = new SingleKeySymbolProvider(
- InternalConstants.TAPESTRY_APP_PACKAGE_PARAM, appPackage);
+ SymbolProvider provider = new SingleKeySymbolProvider(InternalConstants.TAPESTRY_APP_PACKAGE_PARAM, appPackage);
- TapestryAppInitializer initializer = new TapestryAppInitializer(provider, appName,
- PageTesterModule.TEST_MODE);
+ TapestryAppInitializer initializer = new TapestryAppInitializer(provider, appName, PageTesterModule.TEST_MODE);
initializer.addModules(PageTesterModule.class);
initializer.addModules(moduleClasses);
@@ -106,7 +101,7 @@
ApplicationGlobals globals = _registry.getObject(ApplicationGlobals.class, null);
- globals.store(new PageTesterContext(_contextPath));
+ globals.store(new PageTesterContext(contextPath));
Map<Class, ComponentInvoker> map = newMap();
map.put(PageLinkTarget.class, new PageLinkInvoker(_registry));
@@ -154,8 +149,7 @@
ComponentInvocation invocation = _invocationMap.get(element);
if (invocation == null)
- throw new IllegalArgumentException(
- "No component invocation object is associated with the Element.");
+ throw new IllegalArgumentException("No component invocation object is associated with the Element.");
return invocation;
}
@@ -241,8 +235,7 @@
{
while (true)
{
- if (element == null)
- throw new IllegalArgumentException("The given element is not contained by a form.");
+ if (element == null) throw new IllegalArgumentException("The given element is not contained by a form.");
if (element.getName().equalsIgnoreCase("form")) return element;
@@ -266,8 +259,7 @@
private boolean isHiddenFormField(Element element)
{
- return element.getName().equalsIgnoreCase("input")
- && "hidden".equalsIgnoreCase(element.getAttribute("type"));
+ return element.getName().equalsIgnoreCase("input") && "hidden".equalsIgnoreCase(element.getAttribute("type"));
}
public void setPreferedLanguage(Locale preferedLanguage)
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/util/DefaultPrimaryKeyEncoder.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/util/DefaultPrimaryKeyEncoder.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/util/DefaultPrimaryKeyEncoder.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/util/DefaultPrimaryKeyEncoder.java Mon Nov 26 11:57:50 2007
@@ -55,8 +55,7 @@
Defense.notNull(value, "value");
V existing = _keyToValue.get(key);
- if (existing != null)
- throw new IllegalArgumentException(UtilMessages.duplicateKey(key, value, existing));
+ if (existing != null) throw new IllegalArgumentException(UtilMessages.duplicateKey(key, value, existing));
_keyToValue.put(key, value);
@@ -85,16 +84,14 @@
*/
protected final List<V> valuesNotInKeySet(Set<K> keySet)
{
- if (keySet == null || keySet.isEmpty())
- return getAllValues();
+ if (keySet == null || keySet.isEmpty()) return getAllValues();
List<V> result = newList();
for (Map.Entry<K, V> entry : _keyToValue.entrySet())
{
- if (keySet.contains(entry.getKey()))
- continue;
+ if (keySet.contains(entry.getKey())) continue;
result.add(entry.getValue());
}
@@ -124,9 +121,8 @@
_currentKey = _valueToKey.get(value);
- if (_currentKey == null)
- throw new IllegalArgumentException(UtilMessages.missingValue(value, _valueToKey
- .keySet()));
+ if (_currentKey == null) throw new IllegalArgumentException(UtilMessages.missingValue(value, _valueToKey
+ .keySet()));
return _currentKey;
}
@@ -184,7 +180,7 @@
*/
protected final boolean inKeySet(Set<K> keySet)
{
- return keySet != null ? keySet.contains(_currentKey) : false;
+ return keySet != null && keySet.contains(_currentKey);
}
/**
@@ -207,16 +203,13 @@
{
if (keySet == null)
{
- if (!value)
- return null;
+ if (!value) return null;
keySet = newSet();
}
- if (value)
- keySet.add(_currentKey);
- else
- keySet.remove(_currentKey);
+ if (value) keySet.add(_currentKey);
+ else keySet.remove(_currentKey);
return keySet;
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/util/EnumSelectModel.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/util/EnumSelectModel.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/util/EnumSelectModel.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/util/EnumSelectModel.java Mon Nov 26 11:57:50 2007
@@ -40,7 +40,6 @@
private static final long serialVersionUID = -3590412082766899684L;
private final List<OptionModel> _options = newList();
- ;
public <T extends Enum> EnumSelectModel(Class<T> enumClass, Messages messages)
{
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/SubmitTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/SubmitTest.java?rev=598403&r1=598402&r2=598403&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/SubmitTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/SubmitTest.java Mon Nov 26 11:57:50 2007
@@ -28,7 +28,6 @@
@Test
public void not_trigger_of_submission()
{
- FormSupport support = mockFormSupport();
Request request = mockRequest();
String elementName = "myname";
@@ -39,7 +38,7 @@
Submit submit = new Submit(request);
- submit.processSubmission(support, elementName);
+ submit.processSubmission(elementName);
verify();
}
@@ -61,7 +60,7 @@
submit.setup(resources, support, null);
- submit.processSubmission(support, elementName);
+ submit.processSubmission(elementName);
verify();
@@ -95,7 +94,7 @@
submit.setup(resources, support, heartbeat);
submit.setDefer(false);
- submit.processSubmission(support, elementName);
+ submit.processSubmission(elementName);
verify();