struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Nenning <Christoph.Nenn...@lex-com.net>
Subject Re: [GitHub] struts pull request: WW-4540: Strict DMI
Date Fri, 25 Sep 2015 14:04:52 GMT
> > But actually it currently does not behave as I would expect it. Due to
> > PackageConfig.isStrictMethodInvocation(). It checks parent packages 
first
> > which are usually preconfigured packages from s2 jars. If an 
application
> > package wants do disable strict-DMI it cannot extend a framework 
package.
> 
> Ok, found a gut solution! Now Strict DMI is enabled by default but it
> can be simple disabled by setting the attribute to false.
> 
> https://github.com/lukaszlenart/struts/commit/
> 
86afcbe611f7c3afda26e396cc4504d3c9998398#diff-655da7abe6e0dfac1f56124ac21adb5dR608
> 
> 

Well, I don't think it is necessary to check parent packages at all. 
Because strictDMI is a primitive boolean and cannot be null. So each 
package has it explicitly configured, inheriting it is not required. 
PackageConfig.isStrictMethodInvocation() should just return that value.

What does the current implementation do?
if strictDMI is set to false it returns false.
if it is set to true parent packages are checked. if it is true in one 
parent true is returned.
otherwise true is returned in anycase.

IMHO it can be just a simple getter.



Regards,
Christoph

This Email was scanned by Sophos Anti Virus

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message