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

Bug 366290

Summary: Provide an OMBundle.getClasses() method
Product: [Modeling] EMF Reporter: Eike Stepper <stepper>
Component: cdo.net4jAssignee: Eike Stepper <stepper>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: enhancement    
Priority: P3    
Version: 4.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: Power to the People

Description Eike Stepper CLA 2011-12-10 04:21:20 EST
/**
   * @since 3.2
   */
  public Iterator<Class<?>> getClasses();
Comment 1 Eike Stepper CLA 2011-12-10 04:22:54 EST
This makes it possible to add Bugzilla tests automatically, see ConfigTestSuite:

  protected List<Class<? extends ConfigTest>> getTestClasses(OMBundle bundle, String packageName)
  {
    List<Class<? extends ConfigTest>> result = new ArrayList<Class<? extends ConfigTest>>();

    for (Iterator<Class<?>> it = bundle.getClasses(); it.hasNext();)
    {
      Class<?> c = it.next();
      if (ConfigTest.class.isAssignableFrom(c) && c.getName().startsWith(packageName))
      {
        @SuppressWarnings("unchecked")
        Class<? extends ConfigTest> configTest = (Class<? extends ConfigTest>)c;
        result.add(configTest);
      }
    }

    Collections.sort(result, new Comparator<Class<? extends ConfigTest>>()
    {
      public int compare(Class<? extends ConfigTest> c1, Class<? extends ConfigTest> c2)
      {
        return c1.getName().compareTo(c2.getName());
      }
    });

    return result;
  }
Comment 2 Eike Stepper CLA 2011-12-10 04:25:08 EST
commit 206773b98acdf77c2691c60eded4775853b440fe
Author: Eike Stepper <stepper@esc-net.de> 2011-12-10 10:23:23
Committer: Eike Stepper <stepper@esc-net.de> 2011-12-10 10:23:23
Parent: f4c6530fe89f4c3bfa6f4486c0abc0dd1fe277be ([365204] Invalidate transition creates illegal object for audit view  https://bugs.eclipse.org/bugs/show_bug.cgi?id=365204)
Branches: master

[366290] Provide an OMBundle.getClasses() method 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=366290
Comment 3 Eike Stepper CLA 2011-12-10 04:41:37 EST
JarFile only starts in JDK7 to implement Closeable ;-(

commit 666a16e73cd70e59f572f66b8325e4c5dedc3f29
Comment 4 Eike Stepper CLA 2012-01-05 04:14:44 EST
Fixed bug in OSGiBundle:
commit 20527bdddd1d43eb05d371fd2c91eb48ff4f6f43
Comment 5 Eike Stepper CLA 2012-09-21 07:17:35 EDT
Closing.