Uploaded image for project: 'ProtoStream'
  1. ProtoStream
  2. IPROTO-195

Generate proper initializers for variables corresponding to required primitive fields when @ProtoFactory is used

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 4.4.0.Alpha6
    • 4.3.0.Final
    • None
    • False
    • False

    Description

      This leads to uninitialized local vars and does not compile/pass bytecode verification:

      static final class AlphaColor {
      
       private final int r;
      
       private final int g;
      
       private final int b;
      
       private final float transparency;
      
       @ProtoFactory
       public AlphaColor(int r, int g, int b, float transparency) {
       this.r = r;
       this.g = g;
       this.b = b;
       this.transparency = transparency;
       }
      
       @ProtoField(number = 1, required = true)
       public int getR() {
       return r;
       }
      
       @ProtoField(number = 2, required = true)
       public int getG() {
       return g;
       }
      
       @ProtoField(number = 3, required = true)
       public int getB() {
       return b;
       }
      
       @ProtoField(number = 4, required = true)
       public float getTransparency() {
       return transparency;
       }
      }

       

      Attachments

        Activity

          People

            anistor Adrian Nistor (Inactive)
            anistor Adrian Nistor (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: