Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 6516 Details for
Bug 45365
Eclipse compiler rejects valid code
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Compile this source
CompileError.java (text/plain), 1.13 KB, created by
Olivier Thomann
on 2003-10-22 08:40:29 EDT
(
hide
)
Description:
Compile this source
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2003-10-22 08:40:29 EDT
Size:
1.13 KB
patch
obsolete
>/** > * class CompileError > */ >public class CompileError { >private static final class MethodProvider { >// If you remove the 'throws Exception': The error Message disapears > public Object openAppletJarOf(Object o) throws Exception { > return null; > } >} >/** >* This method compiles with a Compiler Error: >* "The local variable oResult may not have been initialized" >* Question: Why? >*/ >public static Object badUninitializedVariableErrorMessage() throws Exception { > final MethodProvider oMethodProvider = new MethodProvider(); > final boolean bFlag1 = !true, bFlag2 = !true; > // If you uncomment the next if-else: The error Message disapears > if (!bFlag1) { > final Object o2 = null; > } else { > final Object o2 = oMethodProvider.openAppletJarOf(null); > } > final Object oResult, o1 = null; > if (o1 != null) { > oResult = null; > oMethodProvider.openAppletJarOf(null); > } else { > // If you uncomment the next line: The error Message disapears > final Object o4 = oMethodProvider.openAppletJarOf(null); > oResult = null; > } > return oResult; >} >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 45365
: 6516