@@ -105,29 +105,30 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
105105 " Such classes will overwrite one another on case-insensitive filesystems." )
106106 }
107107
108- debuglog(" Created new bytecode generator for " + classes.size + " classes." )
108+ debuglog(s " Created new bytecode generator for ${ classes.size} classes. " )
109109 val bytecodeWriter = initBytecodeWriter(sortedClasses filter isJavaEntryPoint)
110110 val plainCodeGen = new JPlainBuilder (bytecodeWriter)
111111 val mirrorCodeGen = new JMirrorBuilder (bytecodeWriter)
112112 val beanInfoCodeGen = new JBeanInfoBuilder (bytecodeWriter)
113113
114- while (! sortedClasses.isEmpty) {
115- val c = sortedClasses.head
116-
114+ def emitFor (c : IClass ) {
117115 if (isStaticModule(c.symbol) && isTopLevelModule(c.symbol)) {
118- if (c.symbol.companionClass == NoSymbol ) {
119- mirrorCodeGen.genMirrorClass(c.symbol, c.cunit)
120- } else {
121- log(" No mirror class for module with linked class: " + c.symbol.fullName)
122- }
116+ if (c.symbol.companionClass == NoSymbol )
117+ mirrorCodeGen genMirrorClass (c.symbol, c.cunit)
118+ else
119+ log(s " No mirror class for module with linked class: ${c.symbol.fullName}" )
123120 }
121+ plainCodeGen genClass c
122+ if (c.symbol hasAnnotation BeanInfoAttr ) beanInfoCodeGen genBeanInfoClass c
123+ }
124124
125- plainCodeGen.genClass(c)
126-
127- if (c.symbol hasAnnotation BeanInfoAttr ) {
128- beanInfoCodeGen.genBeanInfoClass(c)
125+ while (! sortedClasses.isEmpty) {
126+ val c = sortedClasses.head
127+ try emitFor(c)
128+ catch {
129+ case e : FileConflictException =>
130+ c.cunit.error(c.symbol.pos, s " error writing ${c.symbol}: ${e.getMessage}" )
129131 }
130-
131132 sortedClasses = sortedClasses.tail
132133 classes -= c.symbol // GC opportunity
133134 }
@@ -454,7 +455,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
454455 }
455456
456457 // -----------------------------------------------------------------------------------------
457- // utitilies useful when emitting plain, mirror, and beaninfo classes.
458+ // utilities useful when emitting plain, mirror, and beaninfo classes.
458459 // -----------------------------------------------------------------------------------------
459460
460461 def writeIfNotTooBig (label : String , jclassName : String , jclass : asm.ClassWriter , sym : Symbol ) {
@@ -1397,7 +1398,6 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
13971398 addInnerClasses(clasz.symbol, jclass)
13981399 jclass.visitEnd()
13991400 writeIfNotTooBig(" " + c.symbol.name, thisName, jclass, c.symbol)
1400-
14011401 }
14021402
14031403 /**
@@ -2903,7 +2903,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
29032903 JAVA_LANG_OBJECT .getInternalName,
29042904 EMPTY_STRING_ARRAY )
29052905
2906- log(" Dumping mirror class for '%s' " .format(mirrorName) )
2906+ log(s " Dumping mirror class for ' $mirrorName ' " )
29072907
29082908 // typestate: entering mode with valid call sequences:
29092909 // [ visitSource ] [ visitOuterClass ] ( visitAnnotation | visitAttribute )*
@@ -2926,8 +2926,6 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
29262926 mirrorClass.visitEnd()
29272927 writeIfNotTooBig(" " + modsym.name, mirrorName, mirrorClass, modsym)
29282928 }
2929-
2930-
29312929 } // end of class JMirrorBuilder
29322930
29332931
0 commit comments