Details

      Description

      I use spring mvc to create the controllers.
      Every thing is ok, but some parameters have been rename after compile in somes method of my controllers.

      I found that in debug mode of idea

      TravelSheetController.scala
      @RequestMapping(value = Array(""), method = Array(RequestMethod.GET))
      @ResponseBody
      def query(
              @RequestParam(value="start", defaultValue="0") start:Int,
              @RequestParam(value="limit", defaultValue="10") limit:Int,
              @RequestParam(required = false) startDate: String,
              @RequestParam(required = false) endDate: String,
              @RequestParam(defaultValue="0") driverId: Long): PaginationBase[TravelSheetDto] = {
             // ignore code
      }
      

      the driverId is rename to driverId$1, So I cannot receive the value from spring mvc.

      Here's a minimal reproduction by Jason Zaugg:

       
      scala> class T { def foo(a: Int) = () => a }
      defined class T
      
      scala> :javap -v T
      Compiled from "<console>"
      ...
      public scala.Function0 foo(int);
        Code:
         Stack=4, Locals=2, Args_size=2
         0:   new     #7; //class T$$anonfun$foo$1
         3:   dup
         4:   aload_0
         5:   iload_1
         6:   invokespecial   #12; //Method T$$anonfun$foo$1."<init>":(LT;I)V
         9:   areturn
        LineNumberTable:
         line 7: 0
      
        LocalVariableTable:
         Start  Length  Slot  Name   Signature
         0      10      0    this       LT;
         0      10      1    a$1       I
      

        Activity

        Show
        Jason Zaugg added a comment - https://github.com/scala/scala/pull/847
        Hide
        Paul Phillips added a comment -

        "I went further and restored the names of all symbols captured by lifted free variables."

        Awesome!

        Show
        Paul Phillips added a comment - "I went further and restored the names of all symbols captured by lifted free variables." Awesome!
        Hide
        Jason Zaugg added a comment -

        Bumping to critical so it's considered for 2.10.

        Show
        Jason Zaugg added a comment - Bumping to critical so it's considered for 2.10.
        Hide
        Jason Zaugg added a comment -
        Show
        Jason Zaugg added a comment - Merged in https://github.com/scala/scala/commit/d9629db638
        Hide
        Jason Zaugg added a comment -

        BTW, a workaround is to use @RequestParam("paramName") to explicitly bind the parameter to a name.

        Show
        Jason Zaugg added a comment - BTW, a workaround is to use @RequestParam("paramName") to explicitly bind the parameter to a name.

          People

          • Assignee:
            Jason Zaugg
            Reporter:
            wang
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development