-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#385] Duplicate field definition error when @protofield methods over…
…ridden
- Loading branch information
1 parent
a613cef
commit 12097ed
Showing
3 changed files
with
94 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...a/org/infinispan/protostream/annotations/impl/processor/tests/testdomain/Inheritance.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package org.infinispan.protostream.annotations.impl.processor.tests.testdomain; | ||
|
||
import org.infinispan.protostream.annotations.ProtoFactory; | ||
import org.infinispan.protostream.annotations.ProtoField; | ||
|
||
public class Inheritance { | ||
public static class ParentType { | ||
final String message; | ||
|
||
@ProtoFactory | ||
public ParentType(String message) { | ||
this.message = message; | ||
} | ||
|
||
@ProtoField(1) | ||
public String getMessage() { | ||
return message; | ||
} | ||
} | ||
|
||
public static class ChildType extends ParentType { | ||
@ProtoFactory | ||
public ChildType(String message) { | ||
super(message); | ||
} | ||
} | ||
|
||
public static class Parent { | ||
final ParentType field; | ||
|
||
@ProtoFactory | ||
public Parent(ParentType field) { | ||
this.field = field; | ||
} | ||
|
||
@ProtoField(1) | ||
ParentType getField() { | ||
return field; | ||
} | ||
} | ||
|
||
public static class Child extends Parent { | ||
@ProtoFactory | ||
public Child(ChildType field) { | ||
super(field); | ||
} | ||
|
||
@ProtoField(1) | ||
ChildType getField() { | ||
return (ChildType) super.getField(); | ||
} | ||
} | ||
} |