Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318124 - "Unhandled event loop exception" when trying to generate class method element comment when return statement is 'return isset(...'
Summary: "Unhandled event loop exception" when trying to generate class method element...
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 minor (vote)
Target Milestone: ---   Edit
Assignee: PHP UI CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-27 08:57 EDT by IanD CLA
Modified: 2020-05-14 11:08 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description IanD CLA 2010-06-27 08:57:52 EDT
Build Identifier: 20100218-1602

When the return statement of a class method has the function 'isset' as its outermost layer, 'generate element comment' throws the exception.

Presumably there's something missing that prevents eclipse from determining the return type of the function 'isset' - see workaround below

Bottom of exception stack is 
java.lang.NullPointerException
	at org.eclipse.php.ui.CodeGeneration.getMethodComment(CodeGeneration.java:385)


Reproducible: Always

Steps to Reproduce:
Try to "generate element comment" for method 'doSomething' in the following examples:

1.

class A {
public function doSomething() {
$a=1;
return isset($a);
}
}
2.

class A {
public function doSomething() {
$a=1;
return (bool) isset($a);
}
}
3.

class A {
public function doSomething() {
$a=1;
return is_int($a);
}
}

Expected results:
- all examples generate an element comment

Actual results:
- Examples 2 & 3 generate the comment
- Example 1 fails with the exception described

Workaround:
- prefix the 'isset' with '(bool)' or '!!' and generate the comment.
Comment 1 Zhongwei Zhao CLA 2010-06-27 09:22:49 EDT
Could not reproduce this bug using latest code.
Comment 2 Gadi Goldbarg CLA 2010-08-19 11:19:50 EDT
Verified fixed.
Kalin Yanev
kalin.a@zend.com