Project

General

Profile

feature request #8257

Remove factory methods for term node creation

Added by Patrick Plitzner 3 months ago. Updated 2 months ago.

Status:
Closed
Priority:
New
Category:
cdmlib
Target version:
Start date:
05/06/2019
Due date:
% Done:

100%

Severity:
normal
Tags:

Description

Currently it is possible to create a FeatureNode on its own, e.g. with a given term

 public static <T extends DefinedTermBase<T>> FeatureNode<T> NewInstance(T term){
        FeatureNode<T> result = new FeatureNode<>(term.getTermType());
        result.setTerm(term);
        return result;
    }

It should only be possible to create a term node based on its parent or its term tree.

AM: Aus einem ähnlichen Grund hatte ich bei TaxonNodes glaube ich mal grundsätzlich keine alleinstehende Instanzerzeugung zugelassen, weil es gefährlich ist, einen Knoten ohne seinen Baum zu erzeugen.
Ich denke, in diesem Fall sollten wir das auch anpassen. Erzeugen von Knoten sollte nur über Parent oder den Baum möglich sein mittels add-Methoden oder ähnlichem. In diesem Fall ist dann der termType des Baums immer bekannt und wird immer korrekt gesetzt.

Associated revisions

Revision 48e5bbde (diff)
Added by Patrick Plitzner 3 months ago

fix #8257 Remove factory methods for term node creation

Revision 7691ed2a (diff)
Added by Andreas Müller 3 months ago

ref #8257 remove factory method for term node creation in app-import

Revision 179a8467 (diff)
Added by Andreas Müller 2 months ago

fix #8257 remove remaining deprecated FeatureNode.NewInstance method

History

#1 Updated by Patrick Plitzner 3 months ago

  • Status changed from New to In Progress

#2 Updated by Patrick Plitzner 3 months ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 50

#3 Updated by Patrick Plitzner 3 months ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Patrick Plitzner to Andreas Müller

@Andreas M.: Can you please have look at the last remaining factory method which is used in one last spot:

    @Deprecated
    public static FeatureNode<Feature> NewInstance(){
        return new FeatureNode<>(TermType.Feature);
    }

#4 Updated by Andreas Müller 2 months ago

  • Status changed from Feedback to Resolved

#5 Updated by Andreas Müller 2 months ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Andreas Müller to Patrick Plitzner
  • % Done changed from 50 to 80

should be fixed now and can be closed I guess

#6 Updated by Patrick Plitzner 2 months ago

  • Status changed from Feedback to Closed
  • % Done changed from 80 to 100

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)