@@ -75,7 +75,6 @@ abstract class ClassfileParser(reader: ReusableInstance[ReusableDataReader]) {
75
75
protected var classTParams = Map [Name ,Symbol ]()
76
76
protected var srcfile0 : Option [AbstractFile ] = None
77
77
protected def moduleClass : Symbol = staticModule.moduleClass
78
- private var sawPrivateConstructor = false
79
78
80
79
private def ownerForFlags (jflags : JavaAccFlags ) = if (jflags.isStatic) moduleClass else clazz
81
80
@@ -532,13 +531,8 @@ abstract class ClassfileParser(reader: ReusableInstance[ReusableDataReader]) {
532
531
533
532
in.bp = fieldsStartBp
534
533
0 until u2 foreach (_ => parseField())
535
- sawPrivateConstructor = false
536
534
0 until u2 foreach (_ => parseMethod())
537
- val needsConstructor = (
538
- ! sawPrivateConstructor
539
- && ! (instanceScope containsName nme.CONSTRUCTOR )
540
- && ((sflags & INTERFACE ) == 0 )
541
- )
535
+ val needsConstructor = (sflags & JAVA_ANNOTATION ) != 0
542
536
if (needsConstructor)
543
537
instanceScope enter clazz.newClassConstructor(NoPosition )
544
538
@@ -603,27 +597,20 @@ abstract class ClassfileParser(reader: ReusableInstance[ReusableDataReader]) {
603
597
604
598
def parseMethod () {
605
599
val jflags = readMethodFlags()
606
- val sflags = jflags.toScalaFlags
607
600
if (jflags.isPrivate) {
608
- val isConstructor = pool.getName(u2).value == " <init>" // opt avoid interning a Name for private methods we're about to discard
609
- if (isConstructor)
610
- sawPrivateConstructor = true
611
- in.skip(2 ); skipAttributes()
601
+ in.skip(4 ); skipAttributes()
612
602
} else {
613
- if ((sflags & PRIVATE ) != 0L ) {
614
- in.skip(4 ); skipAttributes()
615
- } else {
616
- val name = readName()
617
- val sym = ownerForFlags(jflags).newMethod(name.toTermName, NoPosition , sflags)
618
- // Note: the info may be overwritten later with a generic signature
619
- // parsed from SignatureATTR
620
- val lazyInfo = new MemberTypeCompleter (name, jflags, pool.getExternalName(u2).value)
621
- sym.info = lazyInfo
622
- propagatePackageBoundary(jflags, sym)
623
- parseAttributes(sym, lazyInfo)
624
- addJavaFlagsAnnotations(sym, jflags)
625
- getScope(jflags) enter sym
626
- }
603
+ val name = readName()
604
+ val sflags = jflags.toScalaFlags
605
+ val sym = ownerForFlags(jflags).newMethod(name.toTermName, NoPosition , sflags)
606
+ // Note: the info may be overwritten later with a generic signature
607
+ // parsed from SignatureATTR
608
+ val lazyInfo = new MemberTypeCompleter (name, jflags, pool.getExternalName(u2).value)
609
+ sym.info = lazyInfo
610
+ propagatePackageBoundary(jflags, sym)
611
+ parseAttributes(sym, lazyInfo)
612
+ addJavaFlagsAnnotations(sym, jflags)
613
+ getScope(jflags) enter sym
627
614
}
628
615
}
629
616
0 commit comments