Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8068566

Migrating from 1.7 -> 1.8 caused language errors in method calls

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      os_x

      Description

      FULL PRODUCT VERSION :
      java version "1.8.0_25"
      Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
      Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Darwin Daniels-MacBook-Pro.local 14.0.0 Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64

      A DESCRIPTION OF THE PROBLEM :
      public static someMethod(){
      if(MobileController.testUserAgent()){
       // some code needs to get executed here...
      }
      }

      testUserAgent - is a static method that returns a boolean after some evaluation.

      In 1.7 code works fine. in 1.8 I get language errors that seem to be some sort of casting error.
      Type 'java/lang/Object' (current frame, stack[0]) is not assignable to 'java/lang/String' (from method signature)

      Could this be an issue with the new implementation with the new lambda notations and calling a method/static method in a conditional if?

      --Here is the full error--
      Execution exception (In /app/controllers/MainSystemController.java around line 100)
      VerifyError occured : Bad return type Exception Details: Location: controllers/MobileController.mobileCrossSite()Ljava/lang/String; @20: areturn Reason: Type 'java/lang/Object' (current frame, stack[0]) is not assignable to 'java/lang/String' (from method signature) Current Frame: bci: @20 flags: { } locals: { top, 'java/lang/Object' } stack: { 'java/lang/Object' } Bytecode: 0x0000000: b800 7101 a700 0b4d 014c b800 732c bf4c 0x0000010: b800 752b b0 Exception Handler Table: bci [0, 7] => handler: 7 Stackmap Table: same_locals_1_stack_item_frame(@7,Object[#94]) same_locals_1_stack_item_frame(@15,Object[#37])

      play.exceptions.JavaExecutionException: Bad return type
      Exception Details:
        Location:
          controllers/MobileController.mobileCrossSite()Ljava/lang/String; @20: areturn
        Reason:
          Type 'java/lang/Object' (current frame, stack[0]) is not assignable to 'java/lang/String' (from method signature)
        Current Frame:
          bci: @20
          flags: { }
          locals: { top, 'java/lang/Object' }
          stack: { 'java/lang/Object' }
        Bytecode:
          0x0000000: b800 7101 a700 0b4d 014c b800 732c bf4c
          0x0000010: b800 752b b0
        Exception Handler Table:
          bci [0, 7] => handler: 7
        Stackmap Table:
          same_locals_1_stack_item_frame(@7,Object[#94])
          same_locals_1_stack_item_frame(@15,Object[#37])

      at play.mvc.ActionInvoker.invoke(ActionInvoker.java:237)
      at Invocation.HTTP Request(Play!)
      Caused by: java.lang.VerifyError: Bad return type
      Exception Details:
        Location:
          controllers/MobileController.mobileCrossSite()Ljava/lang/String; @20: areturn
        Reason:
          Type 'java/lang/Object' (current frame, stack[0]) is not assignable to 'java/lang/String' (from method signature)
        Current Frame:
          bci: @20
          flags: { }
          locals: { top, 'java/lang/Object' }
          stack: { 'java/lang/Object' }
        Bytecode:
          0x0000000: b800 7101 a700 0b4d 014c b800 732c bf4c
          0x0000010: b800 752b b0
        Exception Handler Table:
          bci [0, 7] => handler: 7
        Stackmap Table:
          same_locals_1_stack_item_frame(@7,Object[#94])
          same_locals_1_stack_item_frame(@15,Object[#37])

      REGRESSION. Last worked in version 7u72

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      I am working with play framework 1.2.7
      this method is being called out a class that extends a controller class.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I expect no error to be thrown when I call a function in a conditional evalutator.
      ACTUAL -
      Compilation error...

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Execution exception (In /app/controllers/MainSystemController.java around line 100)
      VerifyError occured : Bad return type Exception Details: Location: controllers/MobileController.mobileCrossSite()Ljava/lang/String; @20: areturn Reason: Type 'java/lang/Object' (current frame, stack[0]) is not assignable to 'java/lang/String' (from method signature) Current Frame: bci: @20 flags: { } locals: { top, 'java/lang/Object' } stack: { 'java/lang/Object' } Bytecode: 0x0000000: b800 7101 a700 0b4d 014c b800 732c bf4c 0x0000010: b800 752b b0 Exception Handler Table: bci [0, 7] => handler: 7 Stackmap Table: same_locals_1_stack_item_frame(@7,Object[#94]) same_locals_1_stack_item_frame(@15,Object[#37])

      play.exceptions.JavaExecutionException: Bad return type
      Exception Details:
        Location:
          controllers/MobileController.mobileCrossSite()Ljava/lang/String; @20: areturn
        Reason:
          Type 'java/lang/Object' (current frame, stack[0]) is not assignable to 'java/lang/String' (from method signature)
        Current Frame:
          bci: @20
          flags: { }
          locals: { top, 'java/lang/Object' }
          stack: { 'java/lang/Object' }
        Bytecode:
          0x0000000: b800 7101 a700 0b4d 014c b800 732c bf4c
          0x0000010: b800 752b b0
        Exception Handler Table:
          bci [0, 7] => handler: 7
        Stackmap Table:
          same_locals_1_stack_item_frame(@7,Object[#94])
          same_locals_1_stack_item_frame(@15,Object[#37])

      at play.mvc.ActionInvoker.invoke(ActionInvoker.java:237)
      at Invocation.HTTP Request(Play!)
      Caused by: java.lang.VerifyError: Bad return type
      Exception Details:
        Location:
          controllers/MobileController.mobileCrossSite()Ljava/lang/String; @20: areturn
        Reason:
          Type 'java/lang/Object' (current frame, stack[0]) is not assignable to 'java/lang/String' (from method signature)
        Current Frame:
          bci: @20
          flags: { }
          locals: { top, 'java/lang/Object' }
          stack: { 'java/lang/Object' }
        Bytecode:
          0x0000000: b800 7101 a700 0b4d 014c b800 732c bf4c
          0x0000010: b800 752b b0
        Exception Handler Table:
          bci [0, 7] => handler: 7
        Stackmap Table:
          same_locals_1_stack_item_frame(@7,Object[#94])
          same_locals_1_stack_item_frame(@15,Object[#37])

      REPRODUCIBILITY :
      This bug can be reproduced always.

        Attachments

          Activity

            People

            Assignee:
            hseigel Harold Seigel
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: