Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Blocker Blocker
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: 1.10.0
    • Component/s: core
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      499

      Description

      This problem might be related to the
      https://glazedlists.dev.java.net/issues/show_bug.cgi?id=491.

      below is a modified case that breaks the latest build with the patch for issue
      491.

      thanks for your help

      package sandbox;

      import java.util.Comparator;

      import junit.framework.TestCase;
      import ca.odell.glazedlists.BasicEventList;
      import ca.odell.glazedlists.GroupingList;
      import ca.odell.glazedlists.TransactionList;

      public class test extends TestCase
      {

      protected void setUp() throws Exception

      { super.setUp(); }

      protected void tearDown() throws Exception

      { super.tearDown(); }

      public void testIt()
      {
      TransactionList<String> source = new TransactionList<String>(new
      BasicEventList<String>());

      Comparator<String> comparator = new StringPrefixComparator(1);
      GroupingList<String> grouped = new GroupingList<String>(source,
      comparator);

      String[] s = new
      String[]

      {"MSFT","MSFT","IBM","C","IBM","C","C","IBM","IBM","C"}

      ;
      String[] upd = new
      String[]

      {"MSFT","MSFT","MSFT","C","C","IBM","IBM","IBM","C","MSFT"}

      ;

      for( int i = 0; i < s.length; i++ )
      source.add(s[i]);

      System.out.println(grouped.toString());

      source.beginEvent();
      for (int i = 0; i < upd.length; i++)
      source.set(i, upd[i]);
      source.commitEvent();

      System.out.println(grouped.toString());
      }

      private static class StringPrefixComparator implements
      Comparator<String>
      {
      private final int prefixLen;

      public StringPrefixComparator(int prefixLen)

      { this.prefixLen = prefixLen; }

      public int compare(String o1, String o2)

      { return o1.substring(0, prefixLen).compareTo(o2.substring(0, prefixLen)); }

      }

      }

        Activity

        Hide
        vgoldshteyn added a comment -

        this is the actual exception:

        java.lang.NullPointerException
        at
        ca.odell.glazedlists.impl.adt.barcode2.FourColorTree.convertIndexColor(FourColor
        Tree.java:902)
        at
        ca.odell.glazedlists.impl.event.Tree4Deltas.targetUpdate(Tree4Deltas.java:79)
        at
        ca.odell.glazedlists.event.ListEventAssembler.addChange(ListEventAssembler.java:
        236)
        at
        ca.odell.glazedlists.event.ListEventAssembler.addChange(ListEventAssembler.java:
        156)
        at
        ca.odell.glazedlists.event.ListEventAssembler.addChange(ListEventAssembler.java:
        165)
        at
        ca.odell.glazedlists.event.ListEventAssembler.addUpdate(ListEventAssembler.java:
        189)
        at
        ca.odell.glazedlists.GroupingList$GrouperClient.groupChanged(GroupingList.java:1
        60)
        at ca.odell.glazedlists.impl.Grouper.listChanged(Grouper.java:313)
        at ca.odell.glazedlists.GroupingList.listChanged(GroupingList.java:244)
        at
        ca.odell.glazedlists.event.ListEventAssembler$ListEventFormat.fire(ListEventAsse
        mbler.java:414)
        at
        ca.odell.glazedlists.event.ListEventAssembler$ListEventFormat.fire(ListEventAsse
        mbler.java:411)
        at
        ca.odell.glazedlists.event.SequenceDependenciesEventPublisher$SubjectAndListener
        .firePendingEvent(SequenceDependenciesEventPublisher.java:445)
        at
        ca.odell.glazedlists.event.SequenceDependenciesEventPublisher.fireEvent(Sequence
        DependenciesEventPublisher.java:344)
        at
        ca.odell.glazedlists.event.ListEventAssembler.commitEvent(ListEventAssembler.jav
        a:316)
        at
        ca.odell.glazedlists.TransactionList$Context.commit(TransactionList.java:283)
        at
        ca.odell.glazedlists.TransactionList.commitEvent(TransactionList.java:181)
        at sandbox.test.testIt(test.java:41)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
        sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
        a:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at junit.framework.TestCase.runTest(TestCase.java:168)
        at junit.framework.TestCase.runBare(TestCase.java:134)
        at junit.framework.TestResult$1.protect(TestResult.java:110)
        at junit.framework.TestResult.runProtected(TestResult.java:128)
        at junit.framework.TestResult.run(TestResult.java:113)
        at junit.framework.TestCase.run(TestCase.java:124)
        at junit.framework.TestSuite.runTest(TestSuite.java:232)
        at junit.framework.TestSuite.run(TestSuite.java:227)
        at
        org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:91)
        at
        org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReferen
        ce.java:46)
        at
        org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at
        org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner
        .java:467)
        at
        org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner
        .java:683)
        at
        org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java
        :390)
        at
        org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.jav
        a:197)

        Show
        vgoldshteyn added a comment - this is the actual exception: java.lang.NullPointerException at ca.odell.glazedlists.impl.adt.barcode2.FourColorTree.convertIndexColor(FourColor Tree.java:902) at ca.odell.glazedlists.impl.event.Tree4Deltas.targetUpdate(Tree4Deltas.java:79) at ca.odell.glazedlists.event.ListEventAssembler.addChange(ListEventAssembler.java: 236) at ca.odell.glazedlists.event.ListEventAssembler.addChange(ListEventAssembler.java: 156) at ca.odell.glazedlists.event.ListEventAssembler.addChange(ListEventAssembler.java: 165) at ca.odell.glazedlists.event.ListEventAssembler.addUpdate(ListEventAssembler.java: 189) at ca.odell.glazedlists.GroupingList$GrouperClient.groupChanged(GroupingList.java:1 60) at ca.odell.glazedlists.impl.Grouper.listChanged(Grouper.java:313) at ca.odell.glazedlists.GroupingList.listChanged(GroupingList.java:244) at ca.odell.glazedlists.event.ListEventAssembler$ListEventFormat.fire(ListEventAsse mbler.java:414) at ca.odell.glazedlists.event.ListEventAssembler$ListEventFormat.fire(ListEventAsse mbler.java:411) at ca.odell.glazedlists.event.SequenceDependenciesEventPublisher$SubjectAndListener .firePendingEvent(SequenceDependenciesEventPublisher.java:445) at ca.odell.glazedlists.event.SequenceDependenciesEventPublisher.fireEvent(Sequence DependenciesEventPublisher.java:344) at ca.odell.glazedlists.event.ListEventAssembler.commitEvent(ListEventAssembler.jav a:316) at ca.odell.glazedlists.TransactionList$Context.commit(TransactionList.java:283) at ca.odell.glazedlists.TransactionList.commitEvent(TransactionList.java:181) at sandbox.test.testIt(test.java:41) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav a:25) at java.lang.reflect.Method.invoke(Method.java:597) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:91) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReferen ce.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner .java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner .java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java :390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.jav a:197)
        Hide
        brands added a comment -

        I confirm that it's caused by patch for issue 491....

        Show
        brands added a comment - I confirm that it's caused by patch for issue 491....
        Hide
        cryowizard added a comment -

        Gents has this ever been resolved? GroupingList continues to cause issues in our app due to the above-mentioned exception...

        Show
        cryowizard added a comment - Gents has this ever been resolved? GroupingList continues to cause issues in our app due to the above-mentioned exception...
        Hide
        cryowizard added a comment -

        Guys, any luck on this. It's been 5 years...the grouping NPE continues to cause stability issues in my UI...is there any way some cycles can be spared for this one?

        Show
        cryowizard added a comment - Guys, any luck on this. It's been 5 years...the grouping NPE continues to cause stability issues in my UI...is there any way some cycles can be spared for this one?

          People

          • Assignee:
            Unassigned
            Reporter:
            vgoldshteyn
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: