Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-35425

LabelManager.getForLabels returns all ContentEntityObjects when given a class that is a subclass of CEO

XMLWordPrintable

      NOTE: This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report.

      Calling getForLabels(Page.class, labels) for example, returns a List<Page> that contains all ContentEntityObject s matching the labels passed in, and not just Pages.

      For example, if you created a Page and a BlogPost with a label1, and called

      List<Page> myList = labelManager.getForLabels(Page.class, label1);
      

      You get back a list with both your Page and your BlogPost, so when you try to fetch the BlogPost result as a Page, you get a ClassCastException.

            Unassigned Unassigned
            nbhawnani Niraj Bhawnani
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: