1. 13 2月, 2012 1 次提交
  2. 12 2月, 2012 9 次提交
  3. 11 2月, 2012 1 次提交
  4. 10 2月, 2012 8 次提交
    • C
      Consider security in ClassUtils#getMostSpecificMethod · 45ad1833
      Chris Beams 提交于
      Recent changes in ExtendedBeanInfo involve invoking
      ClassUtils#getMostSpecificMethod when determining JavaBeans get/set
      pairs; if Java security settings control disallow reflective access,
      this results in an AccessControlException.
      
      This change defends against this (comparatively rare) scenario by
      catching the exception and falling back to returning the method
      originally supplied by the user.
      
      This change was a result of noticing CallbacksSecurityTests failing
      following the ExtendedBeanInfo modifications mentioned above
      
      Issue: SPR-8949
      45ad1833
    • T
      Adding null check for username being null. · 66012b95
      Thomas Risberg 提交于
      The username is usually not null, but it  could be for some embedded databases.
      
      Always setting generatedKeysColumnNameArraySupported to false when getGeneratedKeysSupported is false, since it can't be supported without having generated keys supported. This change only affects logging messages.
      
      Issue: SPR-9006
      66012b95
    • T
      Improvements for registering custom SQL exception translators in app contexts. · f6c7d99b
      Thomas Risberg 提交于
      Adding a static CustomSQLExceptionTranslatorRegistry and a CustomSQLExceptionTranslatorRegistrar that can be used to register custom SQLExceptionTranslator implementations for specific databases from any application context.
      
      This can be used in application contexts like this:
      
        <bean class="org.springframework.jdbc.support.CustomSQLExceptionTranslatorRegistrar">
          <property name="sqlExceptionTranslators">
            <map>
              <entry key="H2">
                <bean class="com.yourcompany.data.CustomSqlExceptionTranslator"/>
              </entry>
            </map>
          </property>
        </bean>
      
      Issue: SPR-7675
      f6c7d99b
    • T
    • R
      Minor polish in WebMvcConfigurationSupport · 21aed042
      Rossen Stoyanchev 提交于
      21aed042
    • C
      Detect overridden boolean getters in ExtendedBeanInfo · f1ecd1ca
      Chris Beams 提交于
      Prior to this commit, and due to idiosyncracies of
      java.beans.Introspector, overridden boolean getter methods were not
      detected by Spring's ExtendedBeanInfo, which relied on too-strict
      Method equality checks when selecting read and write methods.
      
      Now ExtendedBeanInfo uses Spring's ClassUtils#getMostSpecificMethod
      against the methods returned from java.beans.Introspector in order
      to ensure that subsequent equality checks are reasonable to make.
      
      Issue: SPR-8949
      f1ecd1ca
    • C
      Polish ExtendedBeanInfoTests · c1df51a3
      Chris Beams 提交于
      Clean up ignored test, consolidate and document tests cornering
      covariant return type edge cases.
      
      Issue: SPR-8079, SPR-8806
      c1df51a3
    • A
      Use request contentType/encoding in ServletServetHttpRequest/Response · edc80ffa
      Arjen Poutsma 提交于
      ServletServerHttpRequest now falls back on the contentType and the
      the characterEncoding of the ServletRequest, if the headers of the
      incoming request don't specify one. Similary ServletServerHttpResponse
      sets the contentType and the characterEncoding of the ServletResponse
      if not already set.
      
      This allows using the CharacterEncodingFilter to set a character
      encoding where the request doesn't specify one and have it be used
      in HttpMessageConverter's.
      
      SPR-9096
      edc80ffa
  5. 09 2月, 2012 8 次提交
  6. 08 2月, 2012 11 次提交
    • J
    • J
      9a61f36d
    • J
      fixed SpringValidatorAdapter regression to return correct error codes for... · 95e3f486
      Juergen Hoeller 提交于
      fixed SpringValidatorAdapter regression to return correct error codes for class-level constraints (SPR-8958)
      95e3f486
    • J
    • J
    • J
      Merge pull request #16 from cbeams/SPR-8954 · 5b18fc44
      jhoeller 提交于
      Check original beanClass in #isFactoryBean calls
      5b18fc44
    • R
      Update documentation with regards to differences between @mvc 3.0/3.1 · 4f4a2e7f
      Rossen Stoyanchev 提交于
      Although the reference documentation listed the new @mvc support
      classes and their benefits, it did not explicitly mention a few
      use cases that are no longer supported. There is now a specific
      section on the new support classes listing exactly what is not
      supported.
      
      Similary the @RequestMapping annotation never refered explicitly
      to the existence of old and new support and never made it clear
      exactly what the differences are.
      
      Both have not been corrected.
      
      SPR-9063, SPR-9042
      4f4a2e7f
    • C
      Refactor to consistent use of AnnotationAttributes · bf541db5
      Chris Beams 提交于
      Uses of AnnotationMetadata#getAnnotationAttributes throughout the
      framework have been updated to use the new AnnotationAttributes API in
      order to take advantage of the more concise, expressive and type-safe
      methods there.
      
      All changes are binary compatible to the 3.1.0 public API, save
      the exception below.
      
      A minor binary compatibility issue has been introduced in
      AbstractCachingConfiguration, AbstractAsyncConfiguration and
      AbstractTransactionManagementConfiguration when updating their
      protected Map<String, Object> fields representing annotation attributes
      to use the new AnnotationAttributes API. This is a negligible breakage,
      however, as the likelilhood of users subclassing these types is very
      low, the classes have only been in existence for a short time (further
      reducing the likelihood), and it is a source-compatible change given
      that AnnotationAttributes is assignable to Map<String, Object>.
      bf541db5
    • C
      Support reading nested annotations via ASM · d9f7fdd1
      Chris Beams 提交于
      Background
      
        Spring 3.1 introduced the @ComponentScan annotation, which can accept
        an optional array of include and/or exclude @Filter annotations, e.g.
      
           @ComponentScan(
               basePackages = "com.acme.app",
               includeFilters = { @Filter(MyStereotype.class), ... }
           )
           @Configuration
           public class AppConfig { ... }
      
        @ComponentScan and other annotations related to @Configuration class
        processing such as @Import, @ImportResource and the @Enable*
        annotations are parsed using reflection in certain code paths, e.g.
        when registered directly against AnnotationConfigApplicationContext,
        and via ASM in other code paths, e.g. when a @Configuration class is
        discovered via an XML bean definition or when included via the
        @Import annotation.
      
        The ASM-based approach is designed to avoid premature classloading of
        user types and is instrumental in providing tooling support (STS, etc).
      
        Prior to this commit, the ASM-based routines for reading annotation
        attributes were unable to recurse into nested annotations, such as in
        the @Filter example above. Prior to Spring 3.1 this was not a problem,
        because prior to @ComponentScan, there were no cases of nested
        annotations in the framework.
      
        This limitation manifested itself in cases where users encounter
        the ASM-based annotation parsing code paths AND declare
        @ComponentScan annotations with explicit nested @Filter annotations.
        In these cases, the 'includeFilters' and 'excludeFilters' attributes
        are simply empty where they should be populated, causing the framework
        to ignore the filter directives and provide incorrect results from
        component scanning.
      
        The purpose of this change then, is to introduce the capability on the
        ASM side to recurse into nested annotations and annotation arrays. The
        challenge in doing so is that the nested annotations themselves cannot
        be realized as annotation instances, so must be represented as a
        nested Map (or, as described below, the new AnnotationAttributes type).
      
        Furthermore, the reflection-based annotation parsing must also be
        updated to treat nested annotations in a similar fashion; even though
        the reflection-based approach has no problem accessing nested
        annotations (it just works out of the box), for substitutability
        against the AnnotationMetadata SPI, both ASM- and reflection-based
        implementations should return the same results in any case. Therefore,
        the reflection-based StandardAnnotationMetadata has also been updated
        with an optional 'nestedAnnotationsAsMap' constructor argument that is
        false by default to preserve compatibility in the rare case that
        StandardAnnotationMetadata is being used outside the core framework.
        Within the framework, all uses of StandardAnnotationMetadata have been
        updated to set this new flag to true, meaning that nested annotation
        results will be consistent regardless the parsing approach used.
      
        Spr9031Tests corners this bug and demonstrates that nested @Filter
        annotations can be parsed and read in both the ASM- and
        reflection-based paths.
      
      Major changes
      
       - AnnotationAttributes has been introduced as a concrete
         LinkedHashMap<String, Object> to be used anywhere annotation
         attributes are accessed, providing error reporting on attribute
         lookup and convenient type-safe access to common annotation types
         such as String, String[], boolean, int, and nested annotation and
         annotation arrays, with the latter two also returned as
         AnnotationAttributes instances.
      
       - AnnotationUtils#getAnnotationAttributes methods now return
         AnnotationAttributes instances, even though for binary compatibility
         the signatures of these methods have been preserved as returning
         Map<String, Object>.
      
       - AnnotationAttributes#forMap provides a convenient mechanism for
         adapting any Map<String, Object> into an AnnotationAttributes
         instance. In the case that the Map is already actually of
         type AnnotationAttributes, it is simply casted and returned.
         Otherwise, the map is supplied to the AnnotationAttributes(Map)
         constructor and wrapped in common collections style.
      
       - The protected MetadataUtils#attributesFor(Metadata, Class) provides
         further convenience in the many locations throughout the
         .context.annotation packagage that depend on annotation attribute
         introspection.
      
       - ASM-based core.type.classreading package reworked
      
         Specifically, AnnotationAttributesReadingVisitor has been enhanced to
         support recursive reading of annotations and annotation arrays, for
         example in @ComponentScan's nested array of @Filter annotations,
         ensuring that nested AnnotationAttributes objects are populated as
         described above.
      
         AnnotationAttributesReadingVisitor has also been refactored for
         clarity, being broken up into several additional ASM
         AnnotationVisitor implementations. Given that all types are
         package-private here, these changes represent no risk to binary
         compatibility.
      
       - Reflection-based StandardAnnotationMetadata updated
      
         As described above, the 'nestedAnnotationsAsMap' constructor argument
         has been added, and all framework-internal uses of this class have
         been updated to set this flag to true.
      
      Issue: SPR-7979, SPR-8719, SPR-9031
      d9f7fdd1
    • J
      LocalContainerEntityManagerFactoryBean etc · 905d17d4
      Juergen Hoeller 提交于
      905d17d4
    • J
      LocalContainerEntityManagerFactoryBean's "persistenceUnitName" applies to... · 62e5b9da
      Juergen Hoeller 提交于
      LocalContainerEntityManagerFactoryBean's "persistenceUnitName" applies to "packagesToScan" as well; DefaultPersistenceUnitManager uses containing jar as persistence unit root URL for default unit (SPR-8832)
      62e5b9da
  7. 07 2月, 2012 2 次提交