Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Generic Map get does not return the right object?
Generic Map get does not return the right object? [message #1787152] Sun, 20 May 2018 08:49 Go to next message
Christian Eugster is currently offline Christian EugsterFriend
Messages: 175
Registered: July 2009
Location: St. Gallen Switzerland
Senior Member
Hi
First I must admit, that I am a newcomer concerning xtend. I read the manual and googled but did not find a solution to my problem:

Ich have a map initialized and filled with two different subclasses of ViewerFilter, a TermViewerFilter and a DeletedEntityViewerFilter, where as key I use the classes (see below):

Map<Class<T xtends ViewerFilter>, ViewerFilter  filters = new HashMap();


val style = SWT.BORDER.bitwiseOr(SWT.SEARCH.bitwiseOr(SWT.ICON_CANCEL.bitwiseOr(SWT.ICON_SEARCH)))
filter = formToolkit.createText(parent, part.getPersistedState().getOrDefault("filter.value", ""), style)
filter.setLayoutData(new GridData(GridData.FILL_HORIZONTAL))
filter.addModifyListener(event |
	{
		putPersistedState("filter.value", filter.getText())
		val viewerFilter = viewerFilters.get(TermViewerFilter) as TermViewerFilter
		viewerFilter.setFilter(filter.getText())
		viewer.refresh()
	})
viewerFilters.put(TermViewerFilter, getTermViewerFilter())
viewerFilters.put(DeletedEntityViewerFilter, new DeletedEntityViewerFilter)


I expected, that the following part of the code:

val viewerFilter = viewerFilters.get(TermViewerFilter) as TermViewerFilter


returns the concrete subclass of ViewerFilter, e.g. TermViewerFilter. But as I must see the returned object is not of type TermViewerFilter but of type ViewerFilter. The subclass TermViewerFilter has a public method setFilter(String):

val viewerFilter = viewerFilters.get(TermViewerFilter) as TermViewerFilter
viewerFilter.setFilter(filter.getText())


I get a class cast exception at:

val viewerFilter = viewerFilters.get(TermViewerFilter) as TermViewerFilter


the exception is:
ch.eugster.herakles.authority.views.AuthorityView$3 cannot be cast to ch.eugster.herakles.ui.views.filters.TermViewerFilter


What am I doing wrong? Thank you for any hint!

P.S. In the meantime I also tried with classnames as keys, same strange result

[Updated on: Sun, 20 May 2018 08:57]

Report message to a moderator

Re: Generic Map get does not return the right object? [message #1787154 is a reply to message #1787152] Sun, 20 May 2018 09:25 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12229
Registered: July 2009
Senior Member
Your snipped miss the important parts

getTermViewerFilter


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Generic Map get does not return the right object? [message #1787188 is a reply to message #1787154] Mon, 21 May 2018 16:44 Go to previous messageGo to next message
Christian Eugster is currently offline Christian EugsterFriend
Messages: 175
Registered: July 2009
Location: St. Gallen Switzerland
Senior Member
Hi Christian,
sorry about that, so the missing method is:

	/*
	 * (non-Javadoc)
	 *
	 * @see ch.eugster.herakles.ui.view.AbstractSearchableView#getTermViewerFilter()
	 */
	@Override
	protected TermViewerFilter getTermViewerFilter()
	{
		final TermViewerFilter filter = new TermViewerFilter()
		{
			@Override
			protected boolean check(Object element)
			{
				if (element instanceof Person)
				{
					final Person person = (Person) element;
					return person.getFirstname().contains(this.getFilter()) || person.getLastname().contains(this.getFilter());
				}
				return true;
			}
		};
		return filter;
	}


and the ViewerFilter class is:

/*******************************************************************************
 * Copyright (c) 2017 Christian Eugster.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     Christian Eugster - initial API and implementation
 *******************************************************************************/

package ch.eugster.herakles.ui.views.filters

import org.eclipse.jface.viewers.Viewer
import org.eclipse.jface.viewers.ViewerFilter
import org.eclipse.xtend.lib.annotations.Accessors

/**
 * @author christian
 * 
 */
abstract class TermViewerFilter extends ViewerFilter
{
	@Accessors String filter
	
	override select(Viewer viewer, Object parentElement, Object element)
	{
		if (this.filter === null || this.filter.isEmpty())
		{
			return true;
		}
		return check(element);
	}

	def protected abstract boolean check(Object element);
}

Re: Generic Map get does not return the right object? [message #1787190 is a reply to message #1787188] Mon, 21 May 2018 17:14 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12229
Registered: July 2009
Senior Member
on a first sight this looks legit.
did you have a look if the same instance you store is the one you get?

you you share a complete minimal example that shows the issue


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Mon, 21 May 2018 17:16]

Report message to a moderator

Re: Generic Map get does not return the right object? [message #1787234 is a reply to message #1787190] Tue, 22 May 2018 15:18 Go to previous messageGo to next message
Christian Eugster is currently offline Christian EugsterFriend
Messages: 175
Registered: July 2009
Location: St. Gallen Switzerland
Senior Member
I tried to put all required classes in one bundle to test and it works so far. But I am not able to find the error. Maybe the stack trace may show you something, that I am missing (below) the object ids seem to be the same when it is put into map and get again.

!SESSION 2018-05-22 17:07:30.962 -----------------------------------------------
eclipse.buildId=unknown
java.version=9
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=de_CH
Framework arguments:  -product ch.eugster.herakles.app.product
Command-line arguments:  -product ch.eugster.herakles.app.product -data /Users/christian/Projekte/Herakles/workspace/../runtime-herakles -dev file:/Users/christian/Projekte/Herakles/workspace/.metadata/.plugins/org.eclipse.pde.core/Eclipse Application/dev.properties -os macosx -ws cocoa -arch x86_64 -consoleLog -console

!ENTRY org.eclipse.e4.ui.workbench 4 0 2018-05-22 17:10:56.673
!MESSAGE Unable to create class 'ch.eugster.herakles.authority.views.AdministrationView' from bundle '7'
!STACK 0
org.eclipse.e4.core.di.InjectionException: java.lang.ClassCastException: ch.eugster.herakles.authority.views.AuthorityView$3 cannot be cast to ch.eugster.herakles.ui.views.filters.TermViewerFilter
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:65)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:990)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:955)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:955)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:955)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:955)
	at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:124)
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:399)
	at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:318)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:105)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:74)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:56)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:129)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:992)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:661)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:767)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$0(PartRenderingEngine.java:738)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:732)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:716)
	at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:1293)
	at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.lambda$0(LazyStackRenderer.java:68)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:40)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:233)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4871)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:212)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:36)
	at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:201)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
	at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
	at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
	at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
	at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:52)
	at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:60)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:173)
	at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:102)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:679)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:767)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$0(PartRenderingEngine.java:738)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:732)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:716)
	at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:69)
	at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:137)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:675)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:767)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$0(PartRenderingEngine.java:738)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:732)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:716)
	at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:69)
	at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveRenderer.processContents(PerspectiveRenderer.java:49)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:675)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:767)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$0(PartRenderingEngine.java:738)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:732)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:716)
	at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.showTab(PerspectiveStackRenderer.java:79)
	at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.lambda$0(LazyStackRenderer.java:68)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:40)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:233)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4871)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:212)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:36)
	at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:201)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
	at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
	at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
	at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
	at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:52)
	at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:60)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
	at org.eclipse.e4.ui.model.application.ui.advanced.impl.PerspectiveStackImpl.setSelectedElement(PerspectiveStackImpl.java:135)
	at org.eclipse.e4.ui.model.application.ui.advanced.impl.PerspectiveStackImpl.setSelectedElement(PerspectiveStackImpl.java:1)
	at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:102)
	at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.postProcess(PerspectiveStackRenderer.java:61)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:679)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:767)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$0(PartRenderingEngine.java:738)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:732)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:716)
	at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:69)
	at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.processContents(WBWRenderer.java:704)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:675)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:767)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$0(PartRenderingEngine.java:738)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:732)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:716)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1076)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:162)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1472)
Caused by: java.lang.ClassCastException: ch.eugster.herakles.authority.views.AuthorityView$3 cannot be cast to ch.eugster.herakles.ui.views.filters.TermViewerFilter
	at ch.eugster.herakles.ui.views.AbstractSearchableView$1.modifyText(AbstractSearchableView.java:79)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:180)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4258)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1502)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1525)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1506)
	at org.eclipse.swt.widgets.Text.setText(Text.java:2148)
	at ch.eugster.herakles.ui.views.AbstractSearchableTreeView.createViewer(AbstractSearchableTreeView.java:103)
	at ch.eugster.herakles.ui.views.AbstractSearchableView.createContents(AbstractSearchableView.java:63)
	at ch.eugster.herakles.ui.views.AbstractView.postConstruct(AbstractView.java:99)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
	... 116 more
Re: Generic Map get does not return the right object? [message #1787236 is a reply to message #1787234] Tue, 22 May 2018 15:30 Go to previous messageGo to next message
Christian Eugster is currently offline Christian EugsterFriend
Messages: 175
Registered: July 2009
Location: St. Gallen Switzerland
Senior Member
Strange is that in the following code:

		val viewerFilter = getTermViewerFilter()
		System.out.println(viewerFilter.class.name)
		viewerFilters.put(TermViewerFilter, viewerFilter)
		viewerFilters.put(DeletedEntityViewerFilter, new DeletedEntityViewerFilter)


System.out.println(viewerFilter.class.name) gives ch.eugster.herakles.authority.views.AuthorityView$3
Re: Generic Map get does not return the right object? [message #1787237 is a reply to message #1787236] Tue, 22 May 2018 15:37 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12229
Registered: July 2009
Senior Member
well the question: if you add in instanceof after getTermViewerFilter.
and if you do a identityHashCode on the class at both places

System.out.println(TermViewerFilter.identityHashCode)
does it give the same or a different java.lang.Class instance


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Generic Map get does not return the right object? [message #1787239 is a reply to message #1787236] Tue, 22 May 2018 15:56 Go to previous messageGo to next message
Christian Eugster is currently offline Christian EugsterFriend
Messages: 175
Registered: July 2009
Location: St. Gallen Switzerland
Senior Member
When I change the code

viewerFilters.put(TermViewerFilter, getTermViewerFilter())
viewerFilters.put(DeletedEntityViewerFilter, new DeletedEntityViewerFilter)


to

viewerFilters.put(TermViewerFilter, new TermViewerFilter()
{
	override protected check(Object element)
	{
		throw new UnsupportedOperationException("TODO: auto-generated method stub")
	}
	})
viewerFilters.put(DeletedEntityViewerFilter, new DeletedEntityViewerFilter)


then the program runs right

[Updated on: Tue, 22 May 2018 15:57]

Report message to a moderator

Re: Generic Map get does not return the right object? [message #1787241 is a reply to message #1787239] Tue, 22 May 2018 16:09 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12229
Registered: July 2009
Senior Member
and you are sure the classes are the same in both places?

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Generic Map get does not return the right object? [message #1787287 is a reply to message #1787241] Wed, 23 May 2018 07:01 Go to previous message
Christian Eugster is currently offline Christian EugsterFriend
Messages: 175
Registered: July 2009
Location: St. Gallen Switzerland
Senior Member
At last you are right: There existed two TermViewerFilters in different bundles. Sorry about that. And thank you for the hint!
Previous Topic:The trick doesn't work for a rule that may be consumed without object instantiation
Next Topic:Release of Xtext and Xtend 2.14.0
Goto Forum:
  


Current Time: Wed Sep 19 03:08:44 GMT 2018

Powered by FUDForum. Page generated in 0.02789 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top