Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-core-dev] Compiler bug: Assigning to 'this'

Someone has noticed that assigning to 'this' compiles
successfully in Eclipse 2.1.1. It's a more general
case of
https://bugs.eclipse.org/bugs/show_bug.cgi?id=38143

I'd prefer not to download the latest builds to see if
the fix for 38143 also covers the case of a non-null
assignment, I figured it would be best to simply make
a note on the mailing list.

Example code:

class MyClass {
public void instanceMethod() {
  this = new MyClass();
}
}

The code above compiles, and decompiling the output
shows that instanceMethod() actually contains no
instructions.

David Weitzman

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com


Back to the top