Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 334386 - Bug in FilteringScope???
Summary: Bug in FilteringScope???
Status: CLOSED DUPLICATE of bug 330404
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 1.0.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-14 10:12 EST by Victor Noël CLA
Modified: 2011-01-17 02:28 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Noël CLA 2011-01-14 10:12:43 EST
Build Identifier: 

Hello,

I was trying to use org.eclipse.xtext.scoping.impl.FilteringScope and I noticed the following code:
	public FilteringScope(IScope delegate, final EClass ...allowedTypes) {
		this.delegate = delegate;
		this.filter = new Predicate<IEObjectDescription>(){

			public boolean apply(IEObjectDescription input) {
				for (EClass eClass : allowedTypes) {
					if (eClass.isSuperTypeOf(eClass))
						return true;
				}
				return false;
			}};
	}

Shouldn't it be something like:
	public FilteringScope(IScope delegate, final EClass ...allowedTypes) {
		this.delegate = delegate;
		this.filter = new Predicate<IEObjectDescription>(){

			public boolean apply(IEObjectDescription input) {
				for (EClass eClass : allowedTypes) {
					if (eClass.isSuperTypeOf(input.getEClass()))
						return true;
				}
				return false;
			}};
	}

Thanks

Reproducible: Always
Comment 1 Sven Efftinge CLA 2011-01-17 02:28:28 EST

*** This bug has been marked as a duplicate of bug 330404 ***