Bug 20400 - Fully qualified class names break visibility in WSWB 1.0.
Summary: Fully qualified class names break visibility in WSWB 1.0.
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 M1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-14 17:44 EDT by OTI Support CLA
Modified: 2002-09-10 08:51 EDT (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 OTI Support CLA 2002-06-14 17:44:59 EDT
AIM Issue Tracker is HD100125.

This problem does not happen in Eclipse 1.0, only in WSWB 1.0.

Using a fully qualified class name breaks the visiblity of the superclass.  If 
you don't use the fully qualified name, it is fine.  Is the compiler different 
in WSWB 1.0 and Eclipse 1.0?

Try to build the following 2 classes in a package called problem1 in WSWB:

==================
package problem1;
class B {
}
==================

package problem1;

class A extends problem1.B {
}

==================

You will see an error in the Tasks List saying:
Superclass problem 1.B is not visible
Comment 1 Philipe Mulet CLA 2002-06-14 18:06:30 EDT
It should not make a difference, even in 2.0 we should compile it clear.
Should investigate.
Comment 2 Olivier Thomann CLA 2002-06-17 09:39:14 EDT
There is no error in 2.0. It compiles fine.
Where can I get a copy of WSWB 1.0. I need it in order to reproduce this problem.
Comment 3 Judy Mullins CLA 2002-06-17 10:06:42 EDT
You can get WSWB 1.0 from the jumpstart page.  This is where our customers are 
downloading the product:

http://jumpstart.raleigh.ibm.com/Workbench_Drivers/WSWB_1_0/wswb_1_0.html
Comment 4 Olivier Thomann CLA 2002-06-17 10:43:41 EDT
I reproduced the problem in both eclipse 1.0 and wswb 1.0. So it makes sense
that the two behaviors are consistent.
Should we investigate a fix or is it fine to say this is fixed in 2.0?
Comment 5 Judy Mullins CLA 2002-06-17 11:05:21 EDT
The customer has been told that it is fixed in 2.0, but they are still 
requesting a fix.  They claim they have too many errors to use a workaround of 
not using fully qualified class names.
Comment 6 Olivier Thomann CLA 2002-06-17 11:51:07 EDT
Fix proposal:
Instead of:
if (checkVisibility && n == size) { // if we're finished and know the final 
superinterface then check visibility
	SourceTypeBinding enclosingSourceType = enclosingSourceType();
	if (enclosingSourceType == null
		? !superType.canBeSeenBy(sourceType.fPackage)
		: !superType.canBeSeenBy(sourceType, enclosingSourceType))
			return new ProblemReferenceBinding
(CharOperation.subarray(compoundName, 0, n), NotVisible);
}

I would put:

if (checkVisibility && n == size) { // if we're finished and know the final 
superinterface then check visibility
 if (!superType.canBeSeenBy(sourceType.fPackage))
return new ProblemReferenceBinding(CharOperation.subarray(compoundName, 0, n), 
NotVisible);
}

According to the existing code in 2.0. Could you please, Philippe, double check 
it? Thanks.
Comment 7 Philipe Mulet CLA 2002-06-18 20:01:47 EDT
Olivier - did you check other occurrences of usage of #checkVisibility ? Have 
they all evolved in the same way ?
Comment 8 Olivier Thomann CLA 2002-06-19 13:24:23 EDT
This seems to be the only occurrence of checkVisibility with a condition on the
enclosing type.
Comment 9 Philipe Mulet CLA 2002-07-17 04:49:46 EDT
Backporting 2.0 behavior, and issuing a patch for this one, see details on the 
JDT/Core page (plug-in version for it will be 1.0.6) :

http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/jdt-core-
home/patches/org.eclipse.jdt.core_1.0.6.zip
Comment 10 Andrew Cornwall CLA 2002-07-17 12:20:55 EDT
Sent fix to customer
Comment 11 Philipe Mulet CLA 2002-07-25 07:40:32 EDT
Can we closed this defect ?
Comment 12 Philipe Mulet CLA 2002-07-25 07:41:10 EDT
Actually, was closed already.