Coder Social home page Coder Social logo

spring-projects / spring-framework Goto Github PK

View Code? Open in Web Editor NEW
55.1K 3.4K 37.5K 202.92 MB

Spring Framework

Home Page: https://spring.io/projects/spring-framework

License: Apache License 2.0

Groovy 0.01% Java 98.02% HTML 0.01% AspectJ 0.07% Ruby 0.01% Smarty 0.01% CSS 0.01% JavaScript 0.01% XSLT 0.01% Python 0.01% FreeMarker 0.06% Kotlin 1.81% PLpgSQL 0.01% Shell 0.01% Dockerfile 0.01%
framework spring spring-framework

spring-framework's Introduction

Spring Framework Build Status Revved up by Develocity

This is the home of the Spring Framework: the foundation for all Spring projects. Collectively the Spring Framework and the family of Spring projects are often referred to simply as "Spring".

Spring provides everything required beyond the Java programming language for creating enterprise applications for a wide range of scenarios and architectures. Please read the Overview section of the reference documentation for a more complete introduction.

Code of Conduct

This project is governed by the Spring Code of Conduct. By participating, you are expected to uphold this code of conduct. Please report unacceptable behavior to [email protected].

Access to Binaries

For access to artifacts or a distribution zip, see the Spring Framework Artifacts wiki page.

Documentation

The Spring Framework maintains reference documentation (published and source), GitHub wiki pages, and an API reference. There are also guides and tutorials across Spring projects.

Micro-Benchmarks

See the Micro-Benchmarks wiki page.

Build from Source

See the Build from Source wiki page and the CONTRIBUTING.md file.

Continuous Integration Builds

Information regarding CI builds can be found in the Spring Framework Concourse pipeline documentation.

Stay in Touch

Follow @SpringCentral, @SpringFramework, and its team members on ๐•. In-depth articles can be found at The Spring Blog, and releases are announced via our releases feed.

License

The Spring Framework is released under version 2.0 of the Apache License.

spring-framework's People

Contributors

aclement avatar bclozel avatar cbeams avatar chenqimiao avatar dsyer avatar hrybs avatar igor-suhorukov avatar izeye avatar jhoeller avatar markfisher avatar markpollack avatar marschall avatar nebhale avatar nkjackzhang avatar odrotbohm avatar philwebb avatar poutsma avatar quaff avatar ramnivas avatar rstoyanchev avatar rwinch avatar sbrannen avatar scothis avatar sdeleuze avatar simonbasle avatar snicoll avatar spring-builds avatar stsypanov avatar violetagg avatar wilkinsona avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-framework's Issues

LocalSessionFactoryBean executeSchemaUpdateMethod does not support HSQLDB [SPR-10]

John Atwood opened SPR-10 and commented

The HSQLDB database driver does not support batch updates, which are used in the executeSchemaUpdate method of the LocalSessionFactoryBean class. Perhaps a better implementation of this method would look like this.

protected void executeSchemaUpdate(final Configuration config) throws HibernateException {

SchemaUpdate update = new Update(config);
update.execute(true);

}

This would allow Hibernate to figure out whether or not to use batch statements.


Affects: 1.0 M3

config.addJar() in LocalSessionFactoryBean refers to the deprecated Hibernate Method [SPR-44]

Shishir K Singh opened SPR-44 and commented

org.springframework.orm.hibernate.LocalSessionFactoryBean - In the method afterPropertiesSet(), the config.addJar(resourcePath) accepts String as argument. This method has been deprecated in Hibernate due to the bugginess of this method (E.g.: in case there are spaces in the resource path,% are included in the file path resulting in the files ultimately not getting located). Instead, the method addJar(File jarFile) should be used.

Instead of doing

config.addJar(resourcePath);

// Maybe something like this may be done :

String jarFile = null;
try {
jarFile = URLDecoder.decode(Thread.currentThread).getContextClassLoader().getResource(resourcePath).getFile(),"UTF-8");

} catch (UnsupportedEncodingException us) {
jarFile = resourcePath;
}
File jarfile = new File(jarFile);
logger.debug("Jar File : " + jarfile.getAbsoluteFile());
config.addJar(jarfile);

// Or Simply
File jarfile = new File(resourcePath);
config.addJar(jarfile);

This error is evident when running test cases.


Affects: 1.0 RC2

PreferencesPlaceholderConfigurer [SPR-24]

Peter den Haan opened SPR-24 and commented

PropertyResourceConfigurers are conceived for "custom config files targetted at system administrators that override bean properties". The Preferences API (1.4+) offers a good way to access configuration information stored in the place most appropriate to the platform -- the registry for Windows, text files in $HOME (user preferences) or (/usr)/etc (system preferences) for Unix. To a Windows administrator, the registry would be a more familiar place to tweak configuration information than a Java properties file.

A PreferencesPlaceholderConfigurer would allow Spring applications to plug preferences from the platform-specific preference registry into the configuration file.

A further advantage is that the Preferences API supports data types other than Strings.


Affects: 1.0 M4

Oracle CallableStatment.setNull(...) requires to set TypeName [SPR-50]

Kenneth Chung opened SPR-50 and commented

In the CallableStatementCreatorImpl Oracle CallableStatment.setNull(....) is required to set the TypeName as well otherwise SQLException will be thrown. This will happen when the SqlType is
Array.

java.sql.SQLException: Invalid column type: sqlType=2003
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.driver.OraclePreparedStatement.setNull(OraclePreparedStatement.java:1308)

I have only tried on Oracle database. Not sure other database will have the same behavior as Oracle.


Affects: 1.0 RC1

JMS support [SPR-46]

Juergen Hoeller opened SPR-46 and commented

Add full-fledged JMS support via JmsTemplate and co. Build on the JmsTemplate that came with the original com.interface21 version of the framework.


Affects: 1.2 RC1

7 votes, 5 watchers

Extend MaxValncrementer to PostgreSQL [SPR-43]

Tomislav Urban opened SPR-43 and commented

Would like to extend dB support to PostgreSQL in general. I have taken the OracleMaxValIncrementer class and implemented a PostgreSQLSequenceMaxValueIncrementer class. It works fine for me, though I have no idea if it is generally applicable.

Here is the code (could not find way to attach):

package org.springframework.jdbc.core.support;

import javax.sql.DataSource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.object.SqlFunction;

/**

  • Class to retrieve the next value of a given PostgreSQL SEQUENCE

  • If the cacheSize is set then we will retrive that number of values from sequence and

  • then serve the intermediate values without querying the database
    */
    public class PostgreSQLSequenceMaxValueIncrementer
    extends AbstractDataFieldMaxValueIncrementer {

    protected final Log logger = LogFactory.getLog(getClass());

    private long[] valueCache = null;

    private NextMaxValueProvider nextMaxValueProvider;

    //-----------------------------------------------------------------
    // Constructors
    //-----------------------------------------------------------------
    /**

    • Default constructor
      **/
      public PostgreSQLSequenceMaxValueIncrementer() {
      this.nextMaxValueProvider = new NextMaxValueProvider();
      }

    /**

    • Constructor
    • @param ds the datasource to use
    • @param incrementerName the name of the sequence/table to use
      */
      public PostgreSQLSequenceMaxValueIncrementer(DataSource ds, String incrementerName) {
      super(ds, incrementerName);
      this.nextMaxValueProvider = new NextMaxValueProvider();
      }

    /**

    • Constructor
    • @param ds the datasource to use
    • @param incrementerName the name of the sequence/table to use
    • @param cacheSize the number of buffered keys
      **/
      public PostgreSQLSequenceMaxValueIncrementer(DataSource ds, String incrementerName, int cacheSize) {
      super(ds, incrementerName, cacheSize);
      this.nextMaxValueProvider = new NextMaxValueProvider();
      }

    /**

    • Constructor
    • @param ds the datasource to be used
    • @param incrementerName the name of the sequence/table to use
    • @param prefixWithZero in case of a String return value, should the string be prefixed with zeroes
    • @param padding the length to which the string return value should be padded with zeroes
      */
      public PostgreSQLSequenceMaxValueIncrementer(DataSource ds, String incrementerName, boolean prefixWithZero, int padding) {
      super(ds, incrementerName);
      this.nextMaxValueProvider = new NextMaxValueProvider();
      this.nextMaxValueProvider.setPrefixWithZero(prefixWithZero, padding);
      }

    /**

    • Constructor
    • @param ds the datasource to be used
    • @param incrementerName the name of the sequence/table to use
    • @param prefixWithZero in case of a String return value, should the string be prefixed with zeroes
    • @param padding the length to which the string return value should be padded with zeroes
    • @param cacheSize the number of buffered keys
      */
      public PostgreSQLSequenceMaxValueIncrementer(DataSource ds, String incrementerName, boolean prefixWithZero, int padding, int cacheSize) {
      super(ds, incrementerName, cacheSize);
      this.nextMaxValueProvider = new NextMaxValueProvider();
      this.nextMaxValueProvider.setPrefixWithZero(prefixWithZero, padding);
      }

    /**

    • Sets the prefixWithZero.
    • @param prefixWithZero The prefixWithZero to set
      */
      public void setPrefixWithZero(boolean prefixWithZero, int length) {
      this.nextMaxValueProvider.setPrefixWithZero(prefixWithZero, length);
      }

    /**

    • @see org.springframework.jdbc.core.support.AbstractDataFieldMaxValueIncrementer#incrementIntValue()
      */
      protected int incrementIntValue() {
      return nextMaxValueProvider.getNextIntValue();
      }

    /**

    • @see org.springframework.jdbc.core.support.AbstractDataFieldMaxValueIncrementer#incrementLongValue()
      */
      protected long incrementLongValue() {
      return nextMaxValueProvider.getNextLongValue();
      }

    /**

    • @see org.springframework.jdbc.core.support.AbstractDataFieldMaxValueIncrementer#incrementDoubleValue()
      */
      protected double incrementDoubleValue() {
      return nextMaxValueProvider.getNextDoubleValue();
      }

    /**

    • @see org.springframework.jdbc.core.support.AbstractDataFieldMaxValueIncrementer#incrementStringValue()
      */
      protected String incrementStringValue() {
      return nextMaxValueProvider.getNextStringValue();
      }

    // Private class that does the actual
    // job of getting the sequence.nextVal value
    private class NextMaxValueProvider extends AbstractNextMaxValueProvider {

    /** The next id to serve */
    private int nextValueIx = -1;
    
    protected long getNextKey(int type) throws DataAccessException {
    	if (isDirty()) { initPrepare(); }
    	if(nextValueIx < 0 || nextValueIx >= getCacheSize()) {
    		SqlFunction sqlf = new SqlFunction(getDataSource(), "SELECT nextval('" + getIncrementerName() + "')", type);
    		sqlf.compile();
    		valueCache = new long[getCacheSize()];
    		nextValueIx = 0;
    		for (int i = 0; i < getCacheSize(); i++) {
    			valueCache[i] = getLongValue(sqlf, type);
    		}
    	}
    	if (logger.isInfoEnabled())
    		logger.info("Next sequence value is : " + valueCache[nextValueIx]);
    	return valueCache[nextValueIx++];
    }
    
    private void initPrepare() throws InvalidMaxValueIncrementerApiUsageException {
    	afterPropertiesSet();
    	if (getIncrementerName() == null)
    		throw new InvalidMaxValueIncrementerApiUsageException("IncrementerName property must be set on " + getClass().getDeclaringClass().getName());
    	nextValueIx = -1;
    	setDirty(false);
    }
    

    }

}


Attachments:

OracleLobHandler has invalid constant [SPR-19]

Mike Rudolph opened SPR-19 and commented

In OracleLobHandler, it assumes the constant

DURATION_SESSION=10

In the classes12.zip that I have (from Oracle 9i) dated
4/26/2002, the constant is actually

BLOB.DURATION_SESSION=1

If you pass '10' into BLOB.createTemporary, it will cause
an exception (reporting invalid argument).

It looks like you will unfortunately need to use reflection
and access the value of this field to be compatible...

Like clazz.getField( "DURATION_SESSION" ) where clazz
is Oracle's BLOB class.

Also, wouldn't it be better to be dynamically loading
using Thread.currentThread().getContextClassLoader()
instead of Class.forName()??


No further details from SPR-19

JMX support [SPR-47]

Juergen Hoeller opened SPR-47* and commented

Allow a Spring-managed bean to be exposed for management via JMX.

JMX Integration Overview

The primary goal here is to allow any bean instantiated by the Spring BeanFactory the option of also being registered in a JMX MBeanServer for management purposes. We'll be providing source-level markup capability for describing which bean properties and methods should be made manageable as JMX attributes and operations. Basicially, you describe what you want manageable, and any optional metadata information, and Spring does the rest (register the bean in an MBeanServer, hook in any JSR 160 connectors, publish JMX notifications via AOP, etc.)

We'll be providing this capability in a clean, non-invasive way (in true Spring fashion), without your POJOs becoming tied to the JMX-specific APIs.

Subsequent features will provide JMX support classes to simplify working with the technology, including the JSR160 remoting technology. We also want to look at JMX as a way to manage bean configuration information (the BeanFactory) and to enable hot-swappable/reloadable/updateable-at-runtime bean configurations.


Affects: 1.0 RC1

13 votes, 8 watchers

How to use Spring with Swing client [SPR-11]

Randy Johnson opened SPR-11 and commented

I am reviewing the Spring Framework, and would like to know if it is possible/reasonable to use the framework with a Swing client. I really like the concept of the controller, along with the 'Command' and 'Validator' structure outlined in the Pet Clinic demo, but I would like that interface to work with a more interactive client that would be provided by some of the Swing tools now available (i.e. Thinlet, Asperon AppProjector).

Any feedback would be greatly appreciated.


Affects: 1.0 M3

Introducing Expression Language Support [SPR-4]

Alef Arendsen opened SPR-4 and commented

Mike's been talking about introducing OGNL support. Seems like a nice idea to me, though not really feasible for the 1.0 release I think. But hey, let's put it in here so we won't forget...

Mike's mail (December 2nd):


Or an even better idea... how about supporting OGNL within the Spring config files? (like Xwork does)

This would be awesome and I just found a second use case for it (the very minute Rob's email came in).

My use case - Maps.

The Map syntax is nice, but not very useful in practicality I'm finding as the key and value of the map are usually related, for instance I often want to put a list of referenced beans into a map, with ref.getName() (or some
method) called for the key.

At the moment I have to add a setBeans(List) method to my class, and then in that setter iterate and add to a map - smelly!

If we allowed OGNL expressions, it would be very simple to do this in the config file itself:

<property value="myMapProp">
<map>
<entry>
<key>$referencedBean.name</key>
<value><ref bean="referencedBean" /></value>
</entry>
... More entries
</map>
</property>

I'm sure there are a million other places where OGNL would be useful too, but AFAIK the above can't be done without it?

Or have I just been at this desk far too long?

M


Affects: 1.0 M4

Attachments:

Issue Links:

  • #5713 Introduce OGNL and OgnlExpressionFactoryBean ("is duplicated by")

Referenced from: commits spring-projects/spring-integration@e571034

8 votes, 6 watchers

Add support to the remoting.rmi system to allow for custom socket factories [SPR-36]

Cameron Braid opened SPR-36 and commented

I have made some modifications to the RmiServiceExporter to allow specification of custom RMIServerSocketFactory(s) and RMIClientSocketFactory(s)

I have also created a spring support class for defining RMIClientSocketFactory(s) and RMIServerSocketFactory(s)

They are attached as a patch.

I think these (after your review and probably modifications) would make a valuable addition to this fine framework.


Affects: 1.0 M4

Attachments:

special characters in url [SPR-6]

Bram Smeets opened SPR-6 and commented

I'm using special characters in my path. An error occurs while getting the handler for this path as soon as the uri contains special charaters. After a lot of tracing it seemed to result from the WebUtils.getLookupPathForRequest.

The method HttpServletRequest.getServletPath returns a decoded path, while all other returned paths are NOT decoded (according to J2EE spec). After I've added the decoding of the context path and request uri, it worked. This seems to be a bug in the framework. No tests broke because of the change.

The FIX:
In org.springframework.web.utils.WebUtils:
replace line 176 with:

try {
uri = URLDecoder.decode(request.getRequestURI(), "UTF-8");
} catch(UnsupportedEncodingException e) {
log.error("unable to decode the request uri", e);
}

and line 191 with:

try {
contextPath = URLDecoder.decode(request.getContextPath(), "UTF-8");
} catch(UnsupportedEncodingException e) {
log.error("unable to decode the context path", e);
}

It might be neccessary to make even more changes, but this seems to work at least for me. I would suggest adding some tests to the org.springframework.web.servlet.handler.PathMatchingUrlHandlerMappingTestSuite to include some paths like:

/test%26test/pathmatching.html
/test%26test/path%26matching.html
/test%26t%20est/path%20%26matching.html


Affects: 1.0 M4

constructor-arg for map entry does not work [SPR-15]

Ricky Nuyens opened SPR-15 and commented

when executing the following code

XmlBeanFactory xbf = new XmlBeanFactory(new FileInputStream(file));
Object bean = (IEvent)xbf.getBean("testSpring01");

where file points to the following xml file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans SYSTEM "../dtd/spring-beans.dtd" >
<beans >
<bean id="testInteger01" class="java.lang.Integer" singleton="false">
<constructor-arg><value>5</value></constructor-arg>
</bean>
<bean id="testSpring01" class="com.ricky.TestSpring" singleton="false" >
<property name="attributes">
<map>
<entry key="value01"><value>value01</value></entry>
<entry key="nullValue"><value/></entry>
<entry key="integerAttribute01">
<ref bean="testInteger01"/>
</entry>
<entry key="integerAttribute02">
<bean id="nestedInteger" class="java.lang.Integer" singleton="false">
<constructor-arg><value>5</value></constructor-arg>
</bean>
</entry>
</map>
</property>
</bean>
</beans>

the following exception is printed on my console
0 [main] INFO xml.XmlBeanDefinitionReader - Loading XmlBeanFactory from resource [(no description]
org.springframework.beans.factory.BeanDefinitionStoreException: 1 constructor arguments specified but no matching constructor found in bean 'testSpring01'
at org.springframework.beans.factory.support.AbstractBeanFactory.autowireConstructor(AbstractBeanFactory.java:631)
at org.springframework.beans.factory.support.AbstractBeanFactory.createBean(AbstractBeanFactory.java:532)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
at com.ricky.TestSpringApp.main(TestSpringApp.java:47)
Exception in thread "main"

Some debugging showed that the constructor context is not propagated down the chain. That is, the constructor is still the com.ricky.TestSpring rather than the java.lang.Integer one.


Affects: 1.0 M4

NoSuchMethodError in Caucho Burlap invocation [SPR-28]

Dario Louzado opened SPR-28 and commented

During JPetstore startup, the following error occurs (with respective stack trace):

[15:00:18.537] java.lang.NoSuchMethodError: com.caucho.burlap.server.BurlapSkele
ton.<init>(Ljava/lang/Object;)V
[15:00:18.537] at org.springframework.remoting.caucho.BurlapServiceExporter.aft
erPropertiesSet(BurlapServiceExporter.java:36)
[15:00:18.537] at org.springframework.beans.factory.support.AbstractBeanFactory
.callLifecycleMethodsIfNecessary(AbstractBeanFactory.java:1026)
[15:00:18.537] at org.springframework.beans.factory.support.AbstractBeanFactory
.createBean(AbstractBeanFactory.java:548)
[15:00:18.537] at org.springframework.beans.factory.support.AbstractBeanFactory
.getBean(AbstractBeanFactory.java:188)
[15:00:18.537] at org.springframework.beans.factory.support.DefaultListableBean
Factory.preInstantiateSingletons(DefaultListableBeanFactory.java:211)
[15:00:18.537] at org.springframework.context.support.AbstractApplicationContex
t.refresh(AbstractApplicationContext.java:280)
[15:00:18.537] at org.springframework.web.context.support.XmlWebApplicationCont
ext.refresh(XmlWebApplicationContext.java:107)
[15:00:18.537] at org.springframework.web.servlet.FrameworkServlet.createWebApp
licationContext(FrameworkServlet.java:268)
[15:00:18.537] at org.springframework.web.servlet.FrameworkServlet.initWebAppli
cationContext(FrameworkServlet.java:230)
[15:00:18.537] at org.springframework.web.servlet.FrameworkServlet.initServletB
ean(FrameworkServlet.java:202)
[15:00:18.537] at org.springframework.web.servlet.HttpServletBean.init(HttpServ
letBean.java:78)
[15:00:18.537] at javax.servlet.GenericServlet.init(GenericServlet.java:82)
[15:00:18.537] at com.caucho.server.dispatch.ServletConfigImpl.createServlet(Se
rvletConfigImpl.java:527)
[15:00:18.537] at com.caucho.server.dispatch.ServletManager.init(ServletManager
.java:153)
[15:00:18.537] at com.caucho.server.webapp.Application.start(Application.java:1
328)
[15:00:18.537] at com.caucho.server.webapp.WebAppEntry.createApplicationInt(Web
AppEntry.java:659)
[15:00:18.537] at com.caucho.server.webapp.WebAppEntry.createApplication(WebApp
Entry.java:463)
[15:00:18.537] at com.caucho.server.webapp.ApplicationContainer.start(Applicati
onContainer.java:541)
[15:00:18.537] at com.caucho.server.host.Host.start(Host.java:433)
[15:00:18.537] at com.caucho.server.host.HostEntry.createHostInt(HostEntry.java
:520)
[15:00:18.537] at com.caucho.server.host.HostEntry.createHost(HostEntry.java:29
8)
[15:00:18.537] at com.caucho.server.host.HostContainer.start(HostContainer.java
:508)
[15:00:18.537] at com.caucho.server.resin.ServletServer.start(ServletServer.jav
a:672)
[15:00:18.537] at com.caucho.server.resin.ResinServer.start(ResinServer.java:37
2)
[15:00:18.537] at com.caucho.server.resin.Resin.init(Resin.java:288)
[15:00:18.537] at com.caucho.server.resin.Resin.main(Resin.java:494)
[15:00:18.627] javax.servlet.ServletException: java.lang.NoSuchMethodError: com.
caucho.burlap.server.BurlapSkeleton.<init>(Ljava/lang/Object;)V
[15:00:18.627] at com.caucho.server.dispatch.ServletConfigImpl.createServlet(Se
rvletConfigImpl.java:554)
[15:00:18.627] at com.caucho.server.dispatch.ServletManager.init(ServletManager
.java:153)
[15:00:18.627] at com.caucho.server.webapp.Application.start(Application.java:1
328)
[15:00:18.627] at com.caucho.server.webapp.WebAppEntry.createApplicationInt(Web
AppEntry.java:659)
[15:00:18.627] at com.caucho.server.webapp.WebAppEntry.createApplication(WebApp
Entry.java:463)
[15:00:18.627] at com.caucho.server.webapp.ApplicationContainer.start(Applicati
onContainer.java:541)
[15:00:18.627] at com.caucho.server.host.Host.start(Host.java:433)
[15:00:18.627] at com.caucho.server.host.HostEntry.createHostInt(HostEntry.java
:520)
[15:00:18.627] at com.caucho.server.host.HostEntry.createHost(HostEntry.java:29
8)
[15:00:18.627] at com.caucho.server.host.HostContainer.start(HostContainer.java
:508)
[15:00:18.627] at com.caucho.server.resin.ServletServer.start(ServletServer.jav
a:672)
[15:00:18.627] at com.caucho.server.resin.ResinServer.start(ResinServer.java:37
2)
[15:00:18.627] at com.caucho.server.resin.Resin.init(Resin.java:288)
[15:00:18.627] at com.caucho.server.resin.Resin.main(Resin.java:494)
[15:00:18.627] Caused by: java.lang.NoSuchMethodError: com.caucho.burlap.server.
BurlapSkeleton.<init>(Ljava/lang/Object;)V
[15:00:18.627] at org.springframework.remoting.caucho.BurlapServiceExporter.aft
erPropertiesSet(BurlapServiceExporter.java:36)
[15:00:18.627] at org.springframework.beans.factory.support.AbstractBeanFactory
.callLifecycleMethodsIfNecessary(AbstractBeanFactory.java:1026)
[15:00:18.627] at org.springframework.beans.factory.support.AbstractBeanFactory
.createBean(AbstractBeanFactory.java:548)
[15:00:18.627] at org.springframework.beans.factory.support.AbstractBeanFactory
.getBean(AbstractBeanFactory.java:188)
[15:00:18.627] at org.springframework.beans.factory.support.DefaultListableBean
Factory.preInstantiateSingletons(DefaultListableBeanFactory.java:211)
[15:00:18.627] at org.springframework.context.support.AbstractApplicationContex
t.refresh(AbstractApplicationContext.java:280)
[15:00:18.627] at org.springframework.web.context.support.XmlWebApplicationCont
ext.refresh(XmlWebApplicationContext.java:107)
[15:00:18.627] at org.springframework.web.servlet.FrameworkServlet.createWebApp
licationContext(FrameworkServlet.java:268)
[15:00:18.627] at org.springframework.web.servlet.FrameworkServlet.initWebAppli
cationContext(FrameworkServlet.java:230)
[15:00:18.627] at org.springframework.web.servlet.FrameworkServlet.initServletB
ean(FrameworkServlet.java:202)
[15:00:18.627] at org.springframework.web.servlet.HttpServletBean.init(HttpServ
letBean.java:78)
[15:00:18.627] at javax.servlet.GenericServlet.init(GenericServlet.java:82)
[15:00:18.627] at com.caucho.server.dispatch.ServletConfigImpl.createServlet(Se
rvletConfigImpl.java:527)


Affects: 1.0 M4

Log4jConfigurer prevents reload of war [SPR-17]

Peter Reinhardt opened SPR-17 and commented

A web application using the Log4jConfigServlet cannot be reloaded. The Log4jConfigurer uses the class WebUtils to set the WebappRoot (as a system property). If this property is already set, an IllegalStateException is thrown.

This condition is true if the same web app is loaded twice (i.e. if a servlet class changes or a jsp file). This functionality is core to any app server.


Affects: 1.0 M4

BeanWrapperImpl new instance returns old nested property values [SPR-32]

Peter den Haan opened SPR-32 and commented

BeanWrapperImpl returns old values for nested properties after a new bean has been set using setWrappedInstance(). The following test will demonstrate this:

public void testNewWrappedInstanceNestedPropertyValuesGet() {
	BeanWrapper bw = new BeanWrapperImpl();
	
	TestBean t = new TestBean("Tony", 50);
	t.setSpouse(new TestBean("Sue", 40));
	bw.setWrappedInstance(t);
	assertEquals("Bean wrapper returns wrong nested property value", new Integer(t.getSpouse().getAge()), bw.getPropertyValue("spouse.age"));
	
	TestBean u = new TestBean("Udo", 30);
	u.setSpouse(new TestBean("Vera", 20));
	bw.setWrappedInstance(u);
	assertEquals("Bean wrapper returns cached nested property value", new Integer(u.getSpouse().getAge()), bw.getPropertyValue("spouse.age"));
}

The second assertEquals will fail. The reason is that the wrapper doesn't do anything about the nested bean wrappers that may be cached in this.nestedBeanWrappers. The simplest solution is to simply set the latter to null in the setWrappedInstance method. I will attach a patch created using Eclipse 3.0M6.

A more sophisticated approach would be to go through all nested wrappers and replace the beans they wrap. This might improve performance, at the cost of increasing the amount of code.


Affects: 1.0 M4

bean property name problem [SPR-30]

Ignacio Galmarino opened SPR-30 and commented

i have this bean definition in applicationContext.xml

<bean id="ReporteDAO" class="cr.go.ice.saf.dao.ReporteMQueueDAO">
<property name="mQQuery">
<ref bean="MQQuery" />
</property>
</bean>

and in ReporteMQueueDAO.java

private MQQuery mQQuery = null;

public void setMQQuery(MQQuery query) {
mQQuery = query;
}

when i try to run de application i get this error

nested exception is: org.springframework.beans.NotWritablePropertyException: Property 'mQuery' is not writable in bean class [cr.go.ice.saf.dao.ReporteMQueueDAO]

but if i change the property name to mqQuery:

<bean id="ReporteDAO" class="cr.go.ice.saf.dao.ReporteMQueueDAO">
<property name="mqQuery">
<ref bean="MQQuery" />
</property>
</bean>

and in ReporteMQueueDAO.java

private MQQuery mqQuery = null;

public void setMqQuery(MQQuery query) {
mqQuery = query;
}

everything works ok

doing some test i found the if the second letter of the property name in uppercase it doesnt work !

Ignacio


Affects: 1.0 M4

cannot handle the charset other than iso-8995-1 [SPR-14]

simon xi opened SPR-14 and commented

cannot handle the charset other than iso-8995-1, I want to use utf-8 to encoding the web, so I add one filter to do the encoding, request.setCharacterEncoding("utf-8"); and in the jsp page i set the contentType to "text/html;charset=utf-8", but it cannot display the Chinese characters correctly when i input the Chinese in the HTML form.


Affects: 1.0 M4

better debug information for org.springframework.transaction.interceptor.TransactionInterceptor [SPR-26]

Francisco Hernandez opened SPR-26 and commented

can you guys add the class name to the debug logging in org.springframework.transaction.interceptor.TransactionInterceptor

so it looks like this, currently it just logs the method name.

logger.debug("Getting transaction for method '" + invocation.getMethod().getDeclaringClass().getName() + "." + invocation.getMethod().getName() + "'");

theres a few instances in this class where it would be good to add the class name.


Affects: 1.0 M4

Developer-supplied XSLT params in AbstractXsltView (patch) [SPR-40]

Aaron Hamid opened SPR-40 and commented

I originally posted this issue on the SourceForge forums (http://sourceforge.net/forum/forum.php?thread_id=1024298&forum_id=250339).

It would be nice to be able to set XSLT parameters in XSLT view. Also, AbstractXsltView for some reason will bomb if no model is supplied in the ModelAndView, even though createDomNode can supply a valid node. This patch includes some of my commentary - remove at will.

--- AbstractXsltViewOriginal.java 2004-02-17 12:39:18.142750000 -0500
+++ AbstractXsltView.java 2004-02-17 12:47:01.674000000 -0500
@@ -8,6 +8,7 @@
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.util.Map;
+import java.util.Iterator;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -168,7 +169,7 @@
}

if (model == null)
  throw new ServletException("Cannot do XSLT transform on null model");
  throw new ServletException("Cannot do XSLT transform on null model"); // XXX: why not? just use createDomNode

Node dom = null;
String docRoot = null;
@@ -181,6 +182,10 @@
singleModel = model.get(docRoot);
}

  • // XXX: not sure what this business is about, but if I have an empty/null model in my ModelAndView

  • // I consistently get the error: "Cannot domify multiple non-Node objects without a root element name in XSLT view"

  • // even though I can supply a perfectly fine Dom node from createDomNode

  • // handle special case when we have a single node
    if (singleModel != null && (singleModel instanceof Node)) {
    // Don't domify if the model is already an XML node
    @@ -199,7 +204,9 @@
    dom = createDomNode(model, (docRoot == null) ? this.root : docRoot, request, response);
    }

  • doTransform(response, dom);
  • Map params = getParameters(model, (docRoot == null) ? this.root : docRoot, request, response);
  • doTransform(response, dom, params);
    }

/**
@@ -219,14 +226,42 @@
HttpServletResponse response) throws Exception;

/**

    • Return parameters to set in the XSLT transform.
    • Subclasses must implement this method.
    • NOTE: might be better to merge createDomNode and getParameters, returning a combined object,
    • instead of two seperate calls
    • @param model the model Map
    • @param root name for root element
    • @param request HTTP request. Subclasses won't normally use this, as
    • request processing should have been complete. However, we might to
    • create a RequestContext to expose as part of the model.
    • @param response HTTP response. Subclasses won't normally use this,
    • however there may sometimes be a need to set cookies.
    • @throws Exception we let this method throw any exception; the
    • AbstractXlstView superclass will catch exceptions
  • */
  • protected Map getParameters(Map model, String root, HttpServletRequest request, HttpServletResponse response) {
  • return null;
  • }
  • /**
    • Use TrAX to perform the transform.
      */
  • protected void doTransform(HttpServletResponse response, Node dom) throws ServletException, IOException {
  • protected void doTransform(HttpServletResponse response, Node dom, Map parameters) throws ServletException, IOException {
    try {
    Transformer trans = (this.templates != null) ?
    this.templates.newTransformer() : // we have a stylesheet
    this.transformerFactory.newTransformer(); // just a copy

  // set our developer-supplied parameters if any
  if (parameters != null) {
  Iterator it = parameters.entrySet().iterator();
  while (it.hasNext()) {
  Map.Entry entry = (Map.Entry) it.next();
  trans.setParameter(entry.getKey().toString(), entry.getValue());
  }
  }
  trans.setOutputProperty(OutputKeys.INDENT, "yes");
  // Xalan-specific, but won't do any harm in other XSLT engines
  trans.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");

No further details from SPR-40

java.util.ConcurrentModificationException in PropertyPlaceholderConfigurer::parseGenericArgumentValues [SPR-41]

Nick Minutello opened SPR-41 and commented

I am getting a Concurrent modification Exception out of

class PropertyPlaceholderConfigurer:
protected void parseGenericArgumentValues(Properties props, Set gas)

The reason is that we are remove/adding from/to the collection rather than the iterator.

for (Iterator it = gas.iterator(); it.hasNext();) {
<snip>

if (!newStrVal.equals(strVal)) {
gas.remove(val);
gas.add(newStrVal);
}
}


Affects: 1.0 RC1

Exception when using Log4jConfigListener with hotdeployment [SPR-33]

Kent Rasmussen opened SPR-33 and commented

I am using Spring 1.0M4 on OC4J902.
My application uses Log4jConfigListener (no rootwebapp property defined). The Listener is defined as the first one in the webapplication, no servlets configured with load-on-startup.

When I start the server an use the app, verything goes smoothly.
When I hotdeploy to a running server afterwards, the method WebUtil.setWebAppRootSystemProperty() throws an exception, saying that the systemproperty DEFAULT_WEB_APP_ROOT_KEY is already defined.

The reason is probably, that System properties is shared between webapps, so the newly loaded app is seing the property from the previous time the app was loaded, and complains because of that.

Suggested solution: Only throw an IllegalStateException, if the Systemproperty is defined already, AND THE OLD VALUE IS DIFFERENT FROM THE NEW ONE.


Affects: 1.0 M4

Uninformative error message from auto-wire failure [SPR-45]

Nick Minutello opened SPR-45 and commented

If, in your spring config, you make an <ref bean="polpot"> error and refer to a bean of the wrong type, the error message just says that it "couldnt satisfy the dependancy for constructor arg n "- rather than "The ref you have given doesnt match the type, you fool".

I was using a <constructor-arg> to declare dependancies.

I wasnt using index="1" - which is probably why the error message wasnt as informative as it could have been - it just couldnt find a constructor arg that matched the type.... (it didnt know there was an additional <constructor-arg> that didnt make sense.

It would be really nice if this error message was more precise.

We ended up wasting 1/2 hour on what was a stupid error :-( ... because the error message wasnt giving us all the info... (and/or we were not smart enough to believe what it was telling us :-)


Affects: 1.0 RC1

Container complains if it has more than 96 beans [SPR-34]

Ross Mason opened SPR-34 and commented

If we have 96 beans in the container everything works fine, but if we add one more bean, say bean97, the container complains that there may be a circular reference even though I'm sure there isn't. But if we remove a different (and totally unrelated) bean and add our bean97 bean it works fine. It seems the container has a bean threshold of 96?!

Basically, we cannot add anymore than 96 beans to the container.


No further details from SPR-34

Returning new ModelAndView("foo", null) produces NullPointerException [SPR-9]

Lars Hoss opened SPR-9 and commented

The sample code in chapter 9.3.1 in the reference documentation returns a ModelAndView object with a String and a null object. This however doesn't work with the latest version for it produces a NullPointerException (see stack trace below).
Returning new ModelAndView("foo", new HashMap()) works fine.


Stack trace:
ava.lang.NullPointerException
at java.util.HashMap.putAll(HashMap.java:487)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:201)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:511)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:416)
at org.springframework.web.servlet.FrameworkServlet.serviceWrapper(FrameworkServlet.java:276)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:253)


Affects: 1.0 M3

Log4j error working with MVC step-by-step [SPR-12]

Randy Johnson opened SPR-12 and commented

Step 12 - Create Views

When attempting to execute springapp/hello.htm - the web page displays properly, but nothing is logged to the log file defined in log4j.properties.

In addition, when I start the web server (Jetty), I get two warning errors:

No appenders could be found for logger (org.springframework.web.servlet.DispatcherServlet)
Please initialize the log4j system properly

The log4j.properties file is located in the ./classes directory, as instructed.

Finally, FYI, the instructions (Step 7) directs me to copy the log4j-1.2.8.jar file from the ./lib directory of the downloaded zip file, BUT the jar file is not included in the zip file.


Affects: 1.0 M3

SystemPropertyResourceConfigurer [SPR-23]

Peter den Haan opened SPR-23 and commented

It can be useful to refer to system properties like ${user.home} in Spring configuration files. As far as I could see, this is not supported out of the box.

A new SystemPropertyResourceConfigurer class along the lines of PropertyPlaceholderConfigurer would be a simple way to implement this. The simplest implementation would be to subclass the latter to use to the system properties.

Alternatively, the PropertyPlaceholderConfigurer class itself could be modified to default to the system properties if neither properties nor a location are configured.

I can submit an implementation/patch if required.

  • Peter

Affects: 1.0 M4

BeanUtils.copyProperties does not check for read method access [SPR-18]

John M. Shields opened SPR-18 and commented

If a bean has a property that has a public setter and a private/protected getter then BeanUtils.copyProperties attempts to call the non-visible read method and throws a FatalBeanException.

I'm not sure if that is the intended result, but here is a code snippet from line 135 of BeanUtils.java for release 1.0-m4 that changes the behavior to what I expect (:-)):

if (targetDesc.getWriteMethod() != null &&
sourceDesc.getReadMethod() != null &&
(ignoreProperties == null || (!ignoreList.contains(name)))) {
values.addPropertyValue(new PropertyValue(name, sourceBw.getPropertyValue(name)));
}

Thanks for an awesome framework!


Affects: 1.0 M4

Collection support in PropertiesBeanDefinitionReader [SPR-20]

Mike Rudolph opened SPR-20 and commented

registerBeanDefinition(String beanName, Map m, String
prefix) doesn't handle the case where the string value
for a property is actually a List that may contain
the 'reference prefix' (which is **).

In this case, it appears the **xyz should be replaced by
a RuntimeBeanReference("xyz") object in the List.


Affects: 1.0 M3, 1.1 RC1

Attachments:

1 votes, 2 watchers

Invalid exception in BeanWrapperImpl [SPR-25]

Mike Rudolph opened SPR-25 and commented

In BeanWrapperImpl, there is an exception thrown that will be reported during property type conversion. This exception will be misleading if the type conversion occurs within an array, as opposed to on a single value... See code for details:

public Object doTypeConversionIfNecessary(String propertyName, Object oldValue, Object newValue,
																					Class requiredType) throws BeansException {
	if (newValue instanceof List && requiredType.isArray()) {
		List list = (List) newValue;
		Class componentType = requiredType.getComponentType();
		try {
			Object[] arr = (Object[]) Array.newInstance(componentType, list.size());
			for (int i = 0; i < list.size(); i++) {
				arr[i] = doTypeConversionIfNecessary(propertyName, null, list.get(i), componentType);
			}
			return arr;
		}
		catch (ArrayStoreException ex) {
            ex.printStackTrace();
			throw new TypeMismatchException(createPropertyChangeEvent(propertyName, oldValue, newValue), requiredType, ex);
		}
	}

โ€”

In the above code, if it is invoked for an array (bc newValue instanceof List is true), it will proceed to execute the same method for each object in the array:

for (int i = 0; i < list.size(); i++) {
     arr[i] = doTypeConversionIfNecessary(propertyName, null, list.get(i), componentType);
}

If the inner type conversion fails to convert to the type of value that the array expects, it will throw an ArrayStoreException, that is then caught by:

} catch (ArrayStoreException ex) {
  ex.printStackTrace();
     throw new TypeMismatchException(createPropertyChangeEvent(propertyName, oldValue, newValue), requiredType, ex);
}

Which will then report the conversion error as being a type mismatch converting the ArrayList to the specified type (on the set method). In fact the error is in converting a single element within the array to the type the array expects.

For example:

PropertyVetoExceptionsException: 1 errors:-- ErrorCodedPropertyVetoException: message=[Failed to convert property value of type [java.util.ArrayList] to required type [[Lorg.springframework.web.servl
t.HandlerInterceptor;] for property named 'interceptors'; nested exception is:

Would indicate (if you didn't step through the source) that the method setInterceptors() takes a single HandlerInterceptor as an argument. This is not true, it does in fact take a List and that is what you are passing into it. It was just that one of the elements in this list wasn't a HandlerInterceptor (perhaps because you accidentally specified a String instead of a beanref in the XML).


Affects: 1.0 M4

Performance improvement in HashMapCachingAdvisorChainFactory [SPR-31]

Steven Bazyl opened SPR-31 and commented

I did some profiling of the aspect support in Spring and found that the HashMapCachingAdvisorChainFactory was taking up a significant portion of the time. In particular, most of the time was spent computing the hashcode of the Method object used as the key (ends up calling getName() on the class which is native.) This accounted for about 35% of the execution time of the test.

I switched from HashMap to IdentityHashMap to take advantage of the fact that the Method instances are cached along with the class and the result was a big boost :) Please incorporate this into the next release. Spring's runtime AOP support is still to slow for me at the moment, but I expect it will get better over time.


Affects: 1.0 M4

testDateTimeElement does not pass!!! [SPR-2]

Dmitriy Kopylenko opened SPR-2 and commented

Imported from sourceforge==================>


A fresh checked out CVS copy of spring fails to pass
the test :
org.springframework.web.servlet.view.xslt.FormatHelperTests
testDateTimeElement
Interestingely enough I am in the US using a US locale,
when the test is referring to a UK locale.....
The following asserts do not pass because :
"day-of-week"="Tuesday" not Wednesday
"day-of-month"=23 not 24

el = (Element)
e.getElementsByTagName("day-of-week").item(0);
assertTrue(
"Wednesday".equals(el.getFirstChild().getNodeValue() ));

el = (Element)
e.getElementsByTagName("day-of-month").item(0);
assertTrue(
"24".equals(el.getFirstChild().getNodeValue() ));

I have no idea on how to provide a resolution.
I leave to you .

Please note that the last check-in you made was about
that very same test (see version 1.5 change log)
"mysteriously fails on some installation"
On mine, hours="3", not 12....

BTW, it is not very explicit to use assertTrue for
strings, when assertEquals is much more explicit, and
assertEquals with a description is always preferred.
Philippe O.


Affects: 1.0 RC1

TransactionProxyFactoryBean failes if no transactionAttributes were set [SPR-3]

Lars Hoss opened SPR-3 and commented

Snippet from applicationContext.xml:

<bean id="mooService" class="org.springframework...TransactionProxyFactoryBean">
<property name="transactionManager"><ref local="myTransactionManager"/></property>
<property name="target"><ref local="mooTarget"/></property>
</bean>
Line 175 in TransactionProxyFactoryBean crashes with a NullPointerException because it tries to iterate over a keySet which is null (in my case).


Affects: 1.0 M3

OracleLobHandler needs flush after blob is written [SPR-21]

Mike Rudolph opened SPR-21 and commented

For some implementations of the Oracle JDBC drivers, it appears you need to flush() the output stream on the BLOB in order to be sure it was written.

In the comments below, added an additional logger.debug() to show the length of the actual BLOB as opposed to just the byte array that was used as an argument, too!


Specifically, within OracleLobHandler:

public void setBlobAsBytes(PreparedStatement ps, int parameterIndex, final byte[] content)
          throws SQLException {
     Blob blob = (Blob) createLob(ps, "oracle.sql.BLOB", new LobCallback() {
          public void populateLob(Object lob) throws Exception {
               Method methodToInvoke = lob.getClass().getMethod("getBinaryOutputStream", new Class[0]);
               OutputStream out = (OutputStream) methodToInvoke.invoke(lob, null);
           out.write(content);
           out.flush();
          }
     });
     ps.setBlob(parameterIndex, blob);
     logger.debug("Set bytes for BLOB with length " + content.length);
   logger.debug("Actual BLOB length: " + blob.length() );
}

No further details from SPR-21

NullPointerException in JdbcTemplate.execute() [SPR-7]

Whitney Hunter opened SPR-7 and commented

If the call to CallableStatementCreator.createCallableStatement(Connection) on line 548 of JdbcTemplate.java throws an SQLException, then the cs variable will remain null. This causes the cs.toString() to throw a NullPointerException on line 562 in the catch block. This effectively obscures the real problem.


Affects: 1.0 M3

countParameterPlaceholders bug [SPR-5]

Tom Lauren opened SPR-5 and commented

The countParameterPlaceholders method of the org.springframework.jdbc.core.support.JdbcUtils class does not correctly handle queries that have the following substring:

?+?

The "?" marker must be followed by a space or a ")". To get by, one must modify all such sql portions to be like the following:

? +?

or

? + ?


Affects: 1.0 M3

autowiring by type does not take into account parent context [SPR-8]

Jacques Morel opened SPR-8 and commented

Context:
Simple java app (not J2EE): IntelliJ IDEA plugin.
This app uses a third party container (propriatery not J2EE) that needs to be bridged into Spring. I use the strategy of creating a StaticApplicationContext to load all singletons created by the third party container and passing it as the parent of my own XML application context.

Problem:
I want to autowire all my beans. Some of my beans refer to beans defined in the StaticApplicationContext. Everything is fine if I use autowiring by name. However the autowiring by type does not work since it doesn't take into account the parent factory.


Affects: 1.0 M3

Attachments:

PropertyResourceConfigurer should know about $HOME [SPR-22]

Peter den Haan opened SPR-22 and commented

PropertyResourceConfigurers are conceived for "custom config files targetted at system administrators that override bean properties". However, this requires the property file to reside in a well-known place on the filesystem, outside the (web) application itself.

One of the most obvious places for this file would be $HOME. However, as far as I could ascertain there is currently no way to refer to the ${user.home} system property. If true, this limits the usefulness of the configurers a bit.

There are a few implementations I can think of:

  • Expose a "setHomeRelativeLocation" or similar on PropertyResourceConfigurer. Not the most elegant, but a minor change that would achieve the objective without any compatibility issues.

  • Modify ResourceEditor to expand system properties including ${user.home}. This is in many ways the most elegant solution. While in theory this could break existing software, the likelihood seems small, especially if properties that can't be expanded will not be considered an error but passed on as-is.

  • Modify the FileSystemResource(String) constructor to expand system properties. This is an alternative to the previous option, but arguably the fact that property expansion only works for filesystem resources would represent an inconsistency.

  • Depending on how it is implemented, scripting support might provide this ability as well. But that won't happen until well after the 1.0 release.

I can submit patches for any of the first three above if desired.

  • Peter

Affects: 1.0 M4

Custom PropertyEditor not invoked for String[] [SPR-38]

Rainer Schmitz opened SPR-38 and commented

A CustomPropertyEditor registered with BeanWrapperImpl is not invoked in doTypeConversionIfNecessary(...) if newValue is converted from a String array.
In RC1 an 'else' in line 692 was added preventing (correctly) the invocation of the 'if (newValue instanceof String)'. Unfortunately the check for a custom PropertyEditor is skipped, too.


Affects: 1.0 RC1

PropertiesEditor misuse of LinkedList [SPR-27]

Miguel A Paraz opened SPR-27 and commented

Iteration through a LinkedList using get() instead of the Iterator:

private void dropComments(Properties props) {
    ...
	List commentKeys = new LinkedList();

     ...
	for (int i = 0; i < commentKeys.size(); i++) {
		String key = (String) commentKeys.get(i);

I think, either commentKeys.iterator() should be used, or this should be an ArrayList.


Affects: 1.0 M4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.