Uploaded image for project: 'Commons Collections'
  1. Commons Collections
  2. COLLECTIONS-721

functors.InvokerTransformer backward incompatibility bug

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Bug
    • Affects Version/s: 4.1, 4.2, 4.3
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Flags:
      Important

      Description

      The following code snippets throw a NotSerializableException. It works well before commons-collections4 4.0 and commons-collection3. When I update it to 4.1 or newer versions, it failed.

      	@Test
      	public void Demo() throws IOException{
      		InvokerTransformer transformer = new InvokerTransformer("toString", new Class[]{}, new Object[]{});
              Queue priorityQueue = new PriorityQueue(2, new TransformingComparator(transformer));
              priorityQueue.add(1);
              
              ByteArrayOutputStream bout = new ByteArrayOutputStream();
              ObjectOutputStream out = new ObjectOutputStream(bout);
              out.writeObject(priorityQueue);
      		
      		}
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                lingchao xia0c
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: