[ 
https://issues.apache.org/jira/browse/BVAL-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13290124#comment-13290124
 ] 

Matt Benson commented on BVAL-106:
----------------------------------

Hi again,
  Here's my hesitation:  there is who-knows-how-much Java code out there like:

{code}
class Foo {
  private Object value;
...
  public boolean equals(Object o) {
    return (o instanceof Foo) && ((Foo) o).value.equals(this.value);
  }
}
{code}

Thus we can be sure that a class still retains access to private members 
defined within itself, even across instances.  In this particular case, the 
argument to the method in question is generic, and this is what gives rise to 
the problem.  In my opinion this usage should still be allowed.  If the 
parameter is guaranteed to be a FeaturesCapable instance, it follows that the 
FeaturesCapable class could access its private members regardless.  I am torn 
between thinking that I lack the energy to pursue the notion from the 
perspective of actually getting something done about it, and being of the 
stubbornly held opinion that I am right.  In any event, I have simply removed 
the generic from the method in question as it's not really needed here, and I 
think this should solve the compilation issue without unnecessarily tipping our 
hand, as it were.  I haven't tested on JDK7 yet; will do so later today unless 
you tell me trunk is now working for you.

Thanks again!
                
> Maven compilation fails on FeaturesCapable
> ------------------------------------------
>
>                 Key: BVAL-106
>                 URL: https://issues.apache.org/jira/browse/BVAL-106
>             Project: BVal
>          Issue Type: Bug
>          Components: build
>    Affects Versions: 0.5
>            Reporter: Eric Charles
>         Attachments: BVAL-106.patch
>
>
> I receive the following error when I invoke 'mvn install' current trunk (Last 
> Changed Rev: 1311512)
> [ERROR] 
> /d/bval.svn/bval-core/src/main/java/org/apache/bval/model/FeaturesCapable.java:[148,14]
>  error: features has private access in FeaturesCapable
> [ERROR] 
> /d/bval.svn/bval-core/src/main/java/org/apache/bval/model/FeaturesCapable.java:[149,14]
>  error: features has private access in FeaturesCapable
> [ERROR] 
> /d/bval.svn/bval-core/src/main/java/org/apache/bval/model/FeaturesCapable.java:[151,18]
>  error: validations has private access in FeaturesCapable
> [INFO] 3 errors 
> This occurs on Ubuntu with JDK7 and JDK6
> java -version
> java version "1.7.0_04-ea"
> Java(TM) SE Runtime Environment (build 1.7.0_04-ea-b17)
> Java HotSpot(TM) 64-Bit Server VM (build 23.0-b18, mixed mode)
> java -version
> java version "1.6.0_31"
> Java(TM) SE Runtime Environment (build 1.6.0_31-b04)
> Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed mode)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to