title: References to generic type should be parameterized. A constructor or a type argument related warning
body: <p>I'm creating a LinkedList class and a LinkedListNode and I want them to be generic so that I can choose type arguments later depending on the situation.
  So I created these two classes:</p>
  
  <p>DoublyLinkedList class:</p>
  
  <pre><code>public class DoublyLinkedList&lt;T&gt; {
  
      // sentinel before first item
      private NodeDoublyLinked&lt;T&gt; head;
      // sentinel after last item
      private NodeDoublyLinked&lt;T&gt; tail;
      //number of elements
      private int size;
  
      // getter and setter methods here
  
      //add new node to the linked List
      public void addNode(T data){
  
          NodeDoublyLinked&lt;T&gt; prev = tail.getPrev();
          NodeDoublyLinked&lt;T&gt; node = new NodeDoublyLinked(data, prev, tail);
          tail.setPrev(node);
          size++;
  
      }
  }
  </code></pre>
  
  <p>and the NodeDoublyLinked class: </p>
  
  <pre><code>import java.util.Iterator;
  import java.util.NoSuchElementException;
  
  public class NodeDoublyLinked&lt;T&gt; implements Iterable&lt;T&gt; {
  
      private T data;
      private NodeDoublyLinked&lt;T&gt; prev;
      private NodeDoublyLinked&lt;T&gt; next;
  
      public NodeDoublyLinked(T value, NodeDoublyLinked&lt;T&gt; previousN, NodeDoublyLinked&lt;T&gt; nextN) {
          this.data = value;
          this.prev = previousN;
          this.next = nextN;
      }
  
      // getter and setter methods
  
      @Override
      public Iterator&lt;T&gt; iterator() {
          return new NodeDoublyLinkedIterator();
      }
  
      private class NodeDoublyLinkedIterator implements Iterator&lt;T&gt; {
          // the current node returned by next()
          NodeDoublyLinked&lt;T&gt; current = prev.next;
  
          @Override
          public boolean hasNext() {
              return current != null;
          }
  
          @Override
          public T next() {
              // code here
  
          }
  
          public void remove(){
              // code here
  
          }
  
      }
  
  }
  </code></pre>
  
  <p>In the method addNode in DoublyLinkedList class, at this line:</p>
  
  <pre><code>NodeDoublyLinked&lt;T&gt; node = new NodeDoublyLinked(data, prev, tail);
  </code></pre>
  
  <p>I get a warning:</p>
  
  <blockquote>
    <p>NodeDoublyLinked is a raw type. References to generic type
    NodeDoublyLinked should be parameterized</p>
  </blockquote>
  
  <p>I checked the <a href="https://docs.oracle.com/javase/tutorial/java/generics/types.html" rel="nofollow noreferrer">documentation of generics</a> and <a href="https://docs.oracle.com/javase/tutorial/java/generics/genTypeInference.html" rel="nofollow noreferrer">type inference</a> so I understand that I should assign a type parameter at the right side but it's not correct either. Should I replace the type parameter with a type argument like Integer for example? Is there something wrong with the constructor of NodeDoublyLinked?</p>