For the record, none of those work for non-toplevel classes.
For instance for class B { class B1 } we have the following printout:
javaSimpleName = B1
javaBinaryName = B/B1
javaClassName = B.B1
calculatedName = B$B1 (stuff that I wrote myself)
On Jul 12, 10:51 am, Eugene Burmako <
eugene.burm...@epfl.ch> wrote:
> What I need is a name that I can path to Class.forName. I though binary
> name is something different, no?
>
> Yeah, just found those out methods, but I don't know which of them to use
> :) Will try all of them out.
>
> On 12 July 2012 10:49, Grzegorz Kossakowski
> <
grzegorz.kossakow...@gmail.com>wrote:
>
>
>
>
>
>
>
> > On 12 July 2012 10:45, Eugene Burmako <
eugene.burm...@epfl.ch> wrote:
>
> >> Is there an existing way to find out a java class name (with all $'s
> >> and $$'s) from a symbol?
>
> > I hope you mean binary name (it's good to learn this terminology), have a
> > look at:
>
> > /** These should be moved somewhere like JavaPlatform.
> > */
> > def javaSimpleName: Name =
> > addModuleSuffix(nme.dropLocalSuffix(simpleName))
> > def javaBinaryName: Name = addModuleSuffix(fullNameInternal('/'))
> > def javaClassName: String =
> > addModuleSuffix(fullNameInternal('.')).toString
>
> > in Symbol (
> >
https://github.com/scala/scala/blob/2.10.x/src/reflect/scala/reflect/...
> > )
>
> > --
> > Grzegorz Kossakowski