Bug 410266 - [views] display role files logically is broken
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/packageview/PackageExplorerAdaptor/ContentProvider.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/packageview/PackageExplorerAdaptor/ContentProvider.java
index 130deb0..d7b5f77 100644
--- a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/packageview/PackageExplorerAdaptor/ContentProvider.java
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/packageview/PackageExplorerAdaptor/ContentProvider.java
@@ -76,16 +76,24 @@
 	callin Object[] getChildren(Object parentElement) 
     {
         List<Object> children = null;
-		if (parentElement instanceof IOTType)
-		{
-			IJavaElement javaParentElement = ((IOTJavaElement)parentElement).getCorrespondingJavaElement();
+        IOTType otType = null;
+        IJavaElement javaParentElement = null;
+        if (parentElement instanceof IOTType) {
+        	otType = (IOTType) parentElement;
+        	javaParentElement = ((IOTJavaElement)parentElement).getCorrespondingJavaElement();
+        } else if (parentElement instanceof IType) {
+        	// when asked for children of a TreeItem we always get the plain IType (see https://bugs.eclipse.org/355481)
+        	otType = OTModelManager.getOTElement((IType) parentElement);
+        	javaParentElement = (IJavaElement) parentElement;
+        }
+		if (otType != null) {
 			children = new ArrayList<Object>(Arrays.asList(getChildrenAdapted(javaParentElement)));
 			if (isHideRolePackages())
 			{
 				IType[] roleFiles = null;
                 try
                 {
-                    roleFiles = ((IOTType)parentElement).getRoleTypes(IOTType.ROLEFILE);
+                    roleFiles = otType.getRoleTypes(IOTType.ROLEFILE);
                     Util.replaceOTTypes(roleFiles);
                 }
                 catch (JavaModelException ex)
diff --git a/releng/map/otdt.map.in b/releng/map/otdt.map.in
index d3db4e6..9a59de5 100644
--- a/releng/map/otdt.map.in
+++ b/releng/map/otdt.map.in
@@ -1,8 +1,8 @@
 !***************  OTDT CONTRIBUTION  ******************************************************** 

 

 !-- Don't set version numbers for features, otherwise pdebuild would complain about a non-existent Basedir: -- 

-feature@org.eclipse.objectteams.otdt=GIT,repo=git://git.eclipse.org/gitroot/objectteams/org.eclipse.objectteams.git,path=features/org.eclipse.objectteams.otdt.feature,tag=builds/201306071800

-feature@org.eclipse.objectteams.otdt.source.feature=GIT,repo=git://git.eclipse.org/gitroot/objectteams/org.eclipse.objectteams.git,path=features/org.eclipse.objectteams.otdt.source.feature,tag=builds/201306071800

+feature@org.eclipse.objectteams.otdt=GIT,repo=git://git.eclipse.org/gitroot/objectteams/org.eclipse.objectteams.git,path=features/org.eclipse.objectteams.otdt.feature,tag=builds/201306081430

+feature@org.eclipse.objectteams.otdt.source.feature=GIT,repo=git://git.eclipse.org/gitroot/objectteams/org.eclipse.objectteams.git,path=features/org.eclipse.objectteams.otdt.source.feature,tag=builds/201306081430

 feature@org.eclipse.objectteams.otdt.core.patch=GIT,repo=git://git.eclipse.org/gitroot/objectteams/org.eclipse.objectteams.git,path=features/org.eclipse.objectteams.otdt.core.patch,tag=builds/201306071800

 feature@org.eclipse.objectteams.otequinox=GIT,repo=git://git.eclipse.org/gitroot/objectteams/org.eclipse.objectteams.git,path=features/org.eclipse.objectteams.otequinox.feature,tag=builds/201305210612

 

@@ -31,7 +31,7 @@
 

 !** OT/J Plugins **!

 plugin@org.eclipse.objectteams.otequinox.branding,2.2.0=GIT,repo=git://git.eclipse.org/gitroot/objectteams/org.eclipse.objectteams.git,path=plugins/org.eclipse.objectteams.otequinox.branding,tag=builds/201305210612

-plugin@org.eclipse.objectteams.otdt.jdt.ui,2.2.0=GIT,repo=git://git.eclipse.org/gitroot/objectteams/org.eclipse.objectteams.git,path=plugins/org.eclipse.objectteams.otdt.jdt.ui,tag=builds/201305210612

+plugin@org.eclipse.objectteams.otdt.jdt.ui,2.2.0=GIT,repo=git://git.eclipse.org/gitroot/objectteams/org.eclipse.objectteams.git,path=plugins/org.eclipse.objectteams.otdt.jdt.ui,tag=builds/201306081430

 plugin@org.eclipse.objectteams.otdt.ui.help,2.2.0=GIT,repo=git://git.eclipse.org/gitroot/objectteams/org.eclipse.objectteams.git,path=plugins/org.eclipse.objectteams.otdt.ui.help,tag=builds/201306040500

 plugin@org.eclipse.objectteams.otdt.apt,2.2.0=GIT,repo=git://git.eclipse.org/gitroot/objectteams/org.eclipse.objectteams.git,path=plugins/org.eclipse.objectteams.otdt.apt,tag=builds/201305210612

 plugin@org.eclipse.objectteams.otdt.compiler.adaptor,2.2.0=GIT,repo=git://git.eclipse.org/gitroot/objectteams/org.eclipse.objectteams.git,path=plugins/org.eclipse.objectteams.otdt.compiler.adaptor,tag=builds/201305210612