Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scalabuff-compiler imports @beans.BeanProperty instead of @reflect.BeanProperty #101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ class Generator protected (sourceName: String, importedSymbols: Map[String, Impo
if (ge210)
out.append("@beans.BeanProperty val defaultInstance = new ")
else
out.append("@reflect.BeanProperty val defaultInstance = new ")
out.append("@beans.BeanProperty val defaultInstance = new ")

out.append(name).append("()\n").append("\n")

Expand Down
6 changes: 3 additions & 3 deletions scalabuff-compiler/src/test/resources/generated/Complex.scala
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ final case class ComplexMessage (
}

object ComplexMessage {
@reflect.BeanProperty val defaultInstance = new ComplexMessage()
@beans.BeanProperty val defaultInstance = new ComplexMessage()

def parseFrom(data: Array[Byte]): ComplexMessage = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): ComplexMessage = defaultInstance.mergeFrom(data, offset, length)
Expand Down Expand Up @@ -212,7 +212,7 @@ object ComplexMessage {
}

object Nested {
@reflect.BeanProperty val defaultInstance = new Nested()
@beans.BeanProperty val defaultInstance = new Nested()

def parseFrom(data: Array[Byte]): Nested = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): Nested = defaultInstance.mergeFrom(data, offset, length)
Expand Down Expand Up @@ -289,7 +289,7 @@ final case class AnotherMessage (
}

object AnotherMessage {
@reflect.BeanProperty val defaultInstance = new AnotherMessage()
@beans.BeanProperty val defaultInstance = new AnotherMessage()

def parseFrom(data: Array[Byte]): AnotherMessage = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): AnotherMessage = defaultInstance.mergeFrom(data, offset, length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ final case class DataTypes (
}

object DataTypes {
@reflect.BeanProperty val defaultInstance = new DataTypes()
@beans.BeanProperty val defaultInstance = new DataTypes()

def parseFrom(data: Array[Byte]): DataTypes = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): DataTypes = defaultInstance.mergeFrom(data, offset, length)
Expand Down
12 changes: 6 additions & 6 deletions scalabuff-compiler/src/test/resources/generated/DhComplex.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ final case class Response (
}

object Response {
@reflect.BeanProperty val defaultInstance = new Response()
@beans.BeanProperty val defaultInstance = new Response()

def parseFrom(data: Array[Byte]): Response = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): Response = defaultInstance.mergeFrom(data, offset, length)
Expand Down Expand Up @@ -152,7 +152,7 @@ object Response {
}

object Rendition {
@reflect.BeanProperty val defaultInstance = new Rendition()
@beans.BeanProperty val defaultInstance = new Rendition()

def parseFrom(data: Array[Byte]): Rendition = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): Rendition = defaultInstance.mergeFrom(data, offset, length)
Expand Down Expand Up @@ -228,7 +228,7 @@ object Response {
}

object Property {
@reflect.BeanProperty val defaultInstance = new Property()
@beans.BeanProperty val defaultInstance = new Property()

def parseFrom(data: Array[Byte]): Property = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): Property = defaultInstance.mergeFrom(data, offset, length)
Expand Down Expand Up @@ -356,7 +356,7 @@ object Response {
}

object Video {
@reflect.BeanProperty val defaultInstance = new Video()
@beans.BeanProperty val defaultInstance = new Video()

def parseFrom(data: Array[Byte]): Video = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): Video = defaultInstance.mergeFrom(data, offset, length)
Expand Down Expand Up @@ -450,7 +450,7 @@ object Response {
}

object VideoFailure {
@reflect.BeanProperty val defaultInstance = new VideoFailure()
@beans.BeanProperty val defaultInstance = new VideoFailure()

def parseFrom(data: Array[Byte]): VideoFailure = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): VideoFailure = defaultInstance.mergeFrom(data, offset, length)
Expand Down Expand Up @@ -566,7 +566,7 @@ object Response {
}

object VideoResult {
@reflect.BeanProperty val defaultInstance = new VideoResult()
@beans.BeanProperty val defaultInstance = new VideoResult()

def parseFrom(data: Array[Byte]): VideoResult = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): VideoResult = defaultInstance.mergeFrom(data, offset, length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ final case class Outer (
}

object Outer {
@reflect.BeanProperty val defaultInstance = new Outer()
@beans.BeanProperty val defaultInstance = new Outer()

def parseFrom(data: Array[Byte]): Outer = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): Outer = defaultInstance.mergeFrom(data, offset, length)
Expand Down Expand Up @@ -208,7 +208,7 @@ final case class OuterDuplicate (
}

object OuterDuplicate {
@reflect.BeanProperty val defaultInstance = new OuterDuplicate()
@beans.BeanProperty val defaultInstance = new OuterDuplicate()

def parseFrom(data: Array[Byte]): OuterDuplicate = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): OuterDuplicate = defaultInstance.mergeFrom(data, offset, length)
Expand Down Expand Up @@ -298,7 +298,7 @@ final case class OuterEnumContainer (
}

object OuterEnumContainer {
@reflect.BeanProperty val defaultInstance = new OuterEnumContainer()
@beans.BeanProperty val defaultInstance = new OuterEnumContainer()

def parseFrom(data: Array[Byte]): OuterEnumContainer = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): OuterEnumContainer = defaultInstance.mergeFrom(data, offset, length)
Expand Down Expand Up @@ -365,7 +365,7 @@ object OuterEnumContainer {
}

object InnerEnumContainer {
@reflect.BeanProperty val defaultInstance = new InnerEnumContainer()
@beans.BeanProperty val defaultInstance = new InnerEnumContainer()

def parseFrom(data: Array[Byte]): InnerEnumContainer = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): InnerEnumContainer = defaultInstance.mergeFrom(data, offset, length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ final case class ExtensionsTest (
}

object ExtensionsTest {
@reflect.BeanProperty val defaultInstance = new ExtensionsTest()
@beans.BeanProperty val defaultInstance = new ExtensionsTest()

def parseFrom(data: Array[Byte]): ExtensionsTest = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): ExtensionsTest = defaultInstance.mergeFrom(data, offset, length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ final case class Groups (
}

object Groups {
@reflect.BeanProperty val defaultInstance = new Groups()
@beans.BeanProperty val defaultInstance = new Groups()

def parseFrom(data: Array[Byte]): Groups = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): Groups = defaultInstance.mergeFrom(data, offset, length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ final case class UsesImportPackage (
}

object UsesImportPackage {
@reflect.BeanProperty val defaultInstance = new UsesImportPackage()
@beans.BeanProperty val defaultInstance = new UsesImportPackage()

def parseFrom(data: Array[Byte]): UsesImportPackage = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): UsesImportPackage = defaultInstance.mergeFrom(data, offset, length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ final case class UsesImport (
}

object UsesImport {
@reflect.BeanProperty val defaultInstance = new UsesImport()
@beans.BeanProperty val defaultInstance = new UsesImport()

def parseFrom(data: Array[Byte]): UsesImport = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): UsesImport = defaultInstance.mergeFrom(data, offset, length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ final case class KeywordsTest (
}

object KeywordsTest {
@reflect.BeanProperty val defaultInstance = new KeywordsTest()
@beans.BeanProperty val defaultInstance = new KeywordsTest()

def parseFrom(data: Array[Byte]): KeywordsTest = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): KeywordsTest = defaultInstance.mergeFrom(data, offset, length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ final case class MutiMessageOne (
}

object MutiMessageOne {
@reflect.BeanProperty val defaultInstance = new MutiMessageOne()
@beans.BeanProperty val defaultInstance = new MutiMessageOne()

def parseFrom(data: Array[Byte]): MutiMessageOne = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): MutiMessageOne = defaultInstance.mergeFrom(data, offset, length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ final case class MultiMessageTwo (
}

object MultiMessageTwo {
@reflect.BeanProperty val defaultInstance = new MultiMessageTwo()
@beans.BeanProperty val defaultInstance = new MultiMessageTwo()

def parseFrom(data: Array[Byte]): MultiMessageTwo = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): MultiMessageTwo = defaultInstance.mergeFrom(data, offset, length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ final case class TopLevel (
}

object TopLevel {
@reflect.BeanProperty val defaultInstance = new TopLevel()
@beans.BeanProperty val defaultInstance = new TopLevel()

def parseFrom(data: Array[Byte]): TopLevel = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): TopLevel = defaultInstance.mergeFrom(data, offset, length)
Expand Down Expand Up @@ -124,7 +124,7 @@ object TopLevel {
}

object Inner {
@reflect.BeanProperty val defaultInstance = new Inner()
@beans.BeanProperty val defaultInstance = new Inner()

def parseFrom(data: Array[Byte]): Inner = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): Inner = defaultInstance.mergeFrom(data, offset, length)
Expand Down Expand Up @@ -279,7 +279,7 @@ final case class Foobar (
}

object Foobar {
@reflect.BeanProperty val defaultInstance = new Foobar()
@beans.BeanProperty val defaultInstance = new Foobar()

def parseFrom(data: Array[Byte]): Foobar = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): Foobar = defaultInstance.mergeFrom(data, offset, length)
Expand Down Expand Up @@ -356,7 +356,7 @@ object Foobar {
}

object Foo {
@reflect.BeanProperty val defaultInstance = new Foo()
@beans.BeanProperty val defaultInstance = new Foo()

def parseFrom(data: Array[Byte]): Foo = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): Foo = defaultInstance.mergeFrom(data, offset, length)
Expand Down Expand Up @@ -426,7 +426,7 @@ object Foobar {
}

object Bar {
@reflect.BeanProperty val defaultInstance = new Bar()
@beans.BeanProperty val defaultInstance = new Bar()

def parseFrom(data: Array[Byte]): Bar = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): Bar = defaultInstance.mergeFrom(data, offset, length)
Expand Down Expand Up @@ -496,7 +496,7 @@ object Foobar {
}

object FooBar {
@reflect.BeanProperty val defaultInstance = new FooBar()
@beans.BeanProperty val defaultInstance = new FooBar()

def parseFrom(data: Array[Byte]): FooBar = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): FooBar = defaultInstance.mergeFrom(data, offset, length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ final case class NumbersTest1 (
}

object NumbersTest1 {
@reflect.BeanProperty val defaultInstance = new NumbersTest1()
@beans.BeanProperty val defaultInstance = new NumbersTest1()

def parseFrom(data: Array[Byte]): NumbersTest1 = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): NumbersTest1 = defaultInstance.mergeFrom(data, offset, length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ final case class AkkaRemoteProtocol (
}

object AkkaRemoteProtocol {
@reflect.BeanProperty val defaultInstance = new AkkaRemoteProtocol()
@beans.BeanProperty val defaultInstance = new AkkaRemoteProtocol()

def parseFrom(data: Array[Byte]): AkkaRemoteProtocol = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): AkkaRemoteProtocol = defaultInstance.mergeFrom(data, offset, length)
Expand Down Expand Up @@ -174,7 +174,7 @@ final case class RemoteMessageProtocol (
}

object RemoteMessageProtocol {
@reflect.BeanProperty val defaultInstance = new RemoteMessageProtocol()
@beans.BeanProperty val defaultInstance = new RemoteMessageProtocol()

def parseFrom(data: Array[Byte]): RemoteMessageProtocol = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): RemoteMessageProtocol = defaultInstance.mergeFrom(data, offset, length)
Expand Down Expand Up @@ -266,7 +266,7 @@ final case class RemoteControlProtocol (
}

object RemoteControlProtocol {
@reflect.BeanProperty val defaultInstance = new RemoteControlProtocol()
@beans.BeanProperty val defaultInstance = new RemoteControlProtocol()

def parseFrom(data: Array[Byte]): RemoteControlProtocol = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): RemoteControlProtocol = defaultInstance.mergeFrom(data, offset, length)
Expand Down Expand Up @@ -358,7 +358,7 @@ final case class ActorRefProtocol (
}

object ActorRefProtocol {
@reflect.BeanProperty val defaultInstance = new ActorRefProtocol()
@beans.BeanProperty val defaultInstance = new ActorRefProtocol()

def parseFrom(data: Array[Byte]): ActorRefProtocol = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): ActorRefProtocol = defaultInstance.mergeFrom(data, offset, length)
Expand Down Expand Up @@ -442,7 +442,7 @@ final case class MessageProtocol (
}

object MessageProtocol {
@reflect.BeanProperty val defaultInstance = new MessageProtocol()
@beans.BeanProperty val defaultInstance = new MessageProtocol()

def parseFrom(data: Array[Byte]): MessageProtocol = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): MessageProtocol = defaultInstance.mergeFrom(data, offset, length)
Expand Down Expand Up @@ -519,7 +519,7 @@ final case class MetadataEntryProtocol (
}

object MetadataEntryProtocol {
@reflect.BeanProperty val defaultInstance = new MetadataEntryProtocol()
@beans.BeanProperty val defaultInstance = new MetadataEntryProtocol()

def parseFrom(data: Array[Byte]): MetadataEntryProtocol = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): MetadataEntryProtocol = defaultInstance.mergeFrom(data, offset, length)
Expand Down Expand Up @@ -602,7 +602,7 @@ final case class AddressProtocol (
}

object AddressProtocol {
@reflect.BeanProperty val defaultInstance = new AddressProtocol()
@beans.BeanProperty val defaultInstance = new AddressProtocol()

def parseFrom(data: Array[Byte]): AddressProtocol = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): AddressProtocol = defaultInstance.mergeFrom(data, offset, length)
Expand Down Expand Up @@ -693,7 +693,7 @@ final case class DaemonMsgCreateProtocol (
}

object DaemonMsgCreateProtocol {
@reflect.BeanProperty val defaultInstance = new DaemonMsgCreateProtocol()
@beans.BeanProperty val defaultInstance = new DaemonMsgCreateProtocol()

def parseFrom(data: Array[Byte]): DaemonMsgCreateProtocol = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): DaemonMsgCreateProtocol = defaultInstance.mergeFrom(data, offset, length)
Expand Down Expand Up @@ -798,7 +798,7 @@ final case class PropsProtocol (
}

object PropsProtocol {
@reflect.BeanProperty val defaultInstance = new PropsProtocol()
@beans.BeanProperty val defaultInstance = new PropsProtocol()

def parseFrom(data: Array[Byte]): PropsProtocol = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): PropsProtocol = defaultInstance.mergeFrom(data, offset, length)
Expand Down Expand Up @@ -897,7 +897,7 @@ final case class DeployProtocol (
}

object DeployProtocol {
@reflect.BeanProperty val defaultInstance = new DeployProtocol()
@beans.BeanProperty val defaultInstance = new DeployProtocol()

def parseFrom(data: Array[Byte]): DeployProtocol = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): DeployProtocol = defaultInstance.mergeFrom(data, offset, length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ final case class EmptyMessage (
}

object EmptyMessage {
@reflect.BeanProperty val defaultInstance = new EmptyMessage()
@beans.BeanProperty val defaultInstance = new EmptyMessage()

def parseFrom(data: Array[Byte]): EmptyMessage = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): EmptyMessage = defaultInstance.mergeFrom(data, offset, length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ final case class SimpleTest (
}

object SimpleTest {
@reflect.BeanProperty val defaultInstance = new SimpleTest()
@beans.BeanProperty val defaultInstance = new SimpleTest()

def parseFrom(data: Array[Byte]): SimpleTest = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): SimpleTest = defaultInstance.mergeFrom(data, offset, length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ final case class SimpleRequest (
}

object SimpleRequest {
@reflect.BeanProperty val defaultInstance = new SimpleRequest()
@beans.BeanProperty val defaultInstance = new SimpleRequest()

def parseFrom(data: Array[Byte]): SimpleRequest = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): SimpleRequest = defaultInstance.mergeFrom(data, offset, length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ final case class PackageTest (
}

object PackageTest {
@reflect.BeanProperty val defaultInstance = new PackageTest()
@beans.BeanProperty val defaultInstance = new PackageTest()

def parseFrom(data: Array[Byte]): PackageTest = defaultInstance.mergeFrom(data)
def parseFrom(data: Array[Byte], offset: Int, length: Int): PackageTest = defaultInstance.mergeFrom(data, offset, length)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<unknown>:5:11: `=' expected but `6' found
optional 6int640 invalid_field_user_type = 2; // invalid field user type

^
^
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<unknown>:3:17: `{' expected but `M' found
message Invalid Message { }
^
^
Loading