Bug 254703 - Missing error report while accessing private member of a class
Summary: Missing error report while accessing private member of a class
Status: RESOLVED DUPLICATE of bug 185422
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-10 02:04 EST by Sergey Elin CLA
Modified: 2008-11-10 06:25 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Elin CLA 2008-11-10 02:04:04 EST
Here is a simple EJB with private constant for query name. JDT compiles it while Sun JDK's javac (both 1.6 and 1.5 latest versions) gives an error:
 
[java.compile] /home/selin/projects/teko/d-Source/development/business/oss/core/java/ru/topsbi/oss/core/customer/Customer.java:31: FIND_BY_USER has private access in ru.topsbi.oss.core.customer.Customer
[java.compile] 	@NamedQuery(name = Customer.FIND_BY_USER, query = "select c from Customer c where c.user = :user AND c.sysStatus = :status")
[java.compile]                                    ^

EJB:
package ru.topsbi.oss.core.customer;

@NamedQueries({
	@NamedQuery(name = Customer.FIND_BY_USER, query = "select c from Customer c where c.user = :user AND c.sysStatus = :status")
})
public class Customer extends AbstractEntity<Customer> {

	private static final String FIND_BY_USER = "findCustomerByUser";

}
Comment 1 Philipe Mulet CLA 2008-11-10 06:23:52 EST
This is a known issue where the scope for private access in ECJ is larger the compilation unit, where it should be the body of the declaring class. 
Comment 2 Philipe Mulet CLA 2008-11-10 06:25:30 EST
Dup of bug 185422

*** This bug has been marked as a duplicate of bug 185422 ***