File tree Expand file tree Collapse file tree
src/main/java/org/glavo/nbt/tag Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -158,6 +158,7 @@ protected void writeContent(DataWriter writer) throws IOException {
158158 }
159159
160160 @ Override
161+ @ Contract (value = "-> new" , pure = true )
161162 public ByteArrayTag clone () {
162163 ByteArrayTag tag = new ByteArrayTag (name );
163164 if (size > 0 ) {
Original file line number Diff line number Diff line change @@ -200,6 +200,7 @@ protected void writeContent(DataWriter writer) throws IOException {
200200 }
201201
202202 @ Override
203+ @ Contract (value = "-> new" , pure = true )
203204 public IntArrayTag clone () {
204205 IntArrayTag tag = new IntArrayTag (name );
205206 if (size > 0 ) {
Original file line number Diff line number Diff line change @@ -255,5 +255,6 @@ public final Stream<T> stream() {
255255 }
256256
257257 @ Override
258+ @ Contract (value = "-> new" , pure = true )
258259 public abstract ParentTag <T > clone ();
259260}
Original file line number Diff line number Diff line change @@ -199,7 +199,7 @@ public String toString() {
199199 ///
200200 /// This method always performs a deep copy, and the returned tag will not have a parent tag.
201201 @ Override
202- @ Contract (pure = true )
202+ @ Contract (value = "-> new" , pure = true )
203203 public abstract Tag clone ();
204204
205205 /// Returns a hash code for this tag.
Original file line number Diff line number Diff line change @@ -60,6 +60,6 @@ protected ValueTag(String name) {
6060 public abstract void setValue (V value );
6161
6262 @ Override
63- @ Contract (pure = true )
63+ @ Contract (value = "-> new" , pure = true )
6464 public abstract ValueTag <V > clone ();
6565}
You can’t perform that action at this time.
0 commit comments