Skip to content

Instantly share code, notes, and snippets.

@fkowal
Created October 26, 2017 14:03
Show Gist options
  • Save fkowal/33369c5315d6bb2b14caf2bb6387b888 to your computer and use it in GitHub Desktop.
Save fkowal/33369c5315d6bb2b14caf2bb6387b888 to your computer and use it in GitHub Desktop.
scala 2.12.4 access java inner abstract class protected method problem
lazy val root = (project in file(".")).
settings(
crossScalaVersions := Seq("2.12.3", "2.12.4"),
inThisBuild(List(
organization := "com.example",
scalaVersion := "2.12.3",
version := "0.1.0-SNAPSHOT"
)),
name := "Hello"
)
package com.example;
public interface Converter {
abstract class FactoryFactory {
protected static String getString() { // the problem is with accessing this method
return "string";
}
}
}
package example
import com.example.Converter
import com.example.Converter.FactoryFactory
class FactoryImpl extends Converter.FactoryFactory {
import FactoryFactory.getString
def method(): Unit = {
val s = getString() // getting -> not found: value getString in scala 2.12.4
}
}
@fkowal
Copy link
Author

fkowal commented Oct 26, 2017

after bumping the scala version 2.12.3 to 2.12.4

i encountered this problem with my scala implementation of https://github.com/square/retrofit/blob/master/retrofit/src/main/java/retrofit2/Converter.java

access to getParameterUpperBound, getRawType stopped working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment