Bug 39366 - Changing the targetted JDK in an ant script affects the declaring class of method invocation
Summary: Changing the targetted JDK in an ant script affects the declaring class of me...
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M2   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-26 09:13 EDT by Olivier Thomann CLA
Modified: 2003-06-26 09:30 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2003-06-26 09:13:47 EDT
Using 0625, changing the targetted JDK from 1.1 to 1.3 in an ant script changed
the declaring class of method invocation and field references.
The guilty piece of code is in MessageSend and FieldReference.

	// and not from Object or implicit static method call.	
	if (binding.declaringClass != this.qualifyingType
		&& !this.qualifyingType.isArrayType()
		&& ((currentScope.environment().options.targetJDK >= CompilerOptions.JDK1_2
				&& (!receiver.isImplicitThis() || !binding.isStatic())
				&& binding.declaringClass.id != T_Object) // no change for Object methods
			|| !binding.declaringClass.canBeSeenBy(currentScope))) {

		this.codegenBinding =
currentScope.enclosingSourceType().getUpdatedMethodBinding(binding,
(ReferenceBinding) this.qualifyingType);

		// Post 1.4.0 target, array clone() invocations are qualified with array type 
		// This is handled in array type #clone method binding resolution (see Scope
and UpdatedMethodBinding)
	}

We need to investigate the behavior of JDK1.3 when you set the target to be 1.3
instead of 1.1.
Comment 1 Olivier Thomann CLA 2003-06-26 09:30:53 EDT
javac 1.3 has the behavior. If the target JDK is set to 1.3 then there is a 
side-effect on the declaring class of method invocation and field reference.

So the actual behavior of the batch compiler is perfectly acceptable.

Close as WONTFIX.