Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 332767

Summary: API builder should detect leaked types in APIs that are package-visible or type arguments
Product: [Eclipse Project] PDE Reporter: Markus Keller <markus.kell.r>
Component: API ToolsAssignee: Vikas Chandra <Vikas.Chandra>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Ed.Merks, Vikas.Chandra
Version: 3.7   
Target Milestone: 4.21 M2   
Hardware: PC   
OS: Windows 7   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=547296
https://git.eclipse.org/r/c/pde/eclipse.pde.ui/+/182843
https://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=29df5087dfeeb26d3b3ee8f61ea2aa8c24a71198
Whiteboard:
Bug Depends on: 574859    
Bug Blocks: 574746    

Description Markus Keller CLA 2010-12-16 11:59:21 EST
HEAD

The API builder should detect leaked types in APIs that are package-visible or type arguments. Examples in org.eclipse.jdt.core.dom.TagElement:

	public List<IDocElement> fragments() {
		return this.fragments;
	}
	
	/**
	 * @since 3.7
	 */
	public IDocElement test() {
		return null;
	}

	/**
	 * Good warning:
	 * "TagElement.test2() has non-API return type CompilerOptions"
	 * @since 3.7
	 */
	public CompilerOptions test2() {
		return null;
	}
	
	/**
	 * @since 3.7
	 */
	public List<CompilerOptions> test3() {
		return null;
	}
Comment 1 Eclipse Genie CLA 2019-02-01 12:06:15 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 Vikas Chandra CLA 2019-05-15 02:56:23 EDT
Extracted Bug 547296 from this bug.

>> List<CompilerOptions>

This needs more investigation and will be tracked by this bug.
Comment 3 Eclipse Genie CLA 2021-05-05 15:23:38 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 4 Eclipse Genie CLA 2021-07-07 05:36:10 EDT
New Gerrit change created: https://git.eclipse.org/r/c/pde/eclipse.pde.ui/+/182843
Comment 6 Vikas Chandra CLA 2021-07-28 06:17:17 EDT
verified on Version: 2021-09 (4.21)
Build id: I20210727-1800
Comment 7 Ed Merks CLA 2022-10-11 03:56:14 EDT
(In reply to Vikas Chandra from comment #6)
> verified on Version: 2021-09 (4.21)
> Build id: I20210727-1800

While working on this issue

https://github.com/eclipse-pde/eclipse.pde/issues/356

I was looking at all the cases where a type fails to resolve and I noticed that  Reference.getParameterList() does not properly extract class names and was the original of most of the unresolved classes.  Tracking that back to this Bugzilla leads me to wonder what exactly that method should return. 


For example, for a complex case like this with nested generic types:

	public static class X1 {}
	public static class X2 {}
	public static class X3 {}
	public static class X4 {}
	
	static <T extends X1> T foo(List<Map.Entry<X2, X3>> arg1, List<X4> arg2) {
		return null;
	}

Isn't it the case that all these occurrences of X* be returned (as well as Map.Entry)?