@@ -266,10 +266,7 @@ private void deleteTrapFileAndDependencies(IrDeclaration sym, String signature)
266
266
* Any unique suffix needed to distinguish `sym` from other declarations with the same name.
267
267
* For functions for example, this means its parameter signature.
268
268
*/
269
- private TrapFileManager getMembersWriterForDecl (IrDeclaration sym , String signature ) {
270
- File trap = getTrapFileForDecl (sym , signature );
271
- if (trap ==null )
272
- return null ;
269
+ private TrapFileManager getMembersWriterForDecl (File trap , IrDeclaration sym , String signature ) {
273
270
TrapClassVersion currVersion = TrapClassVersion .fromSymbol (sym , log );
274
271
String shortName = sym instanceof IrDeclarationWithName ? ((IrDeclarationWithName )sym ).getName ().asString () : "(name unknown)" ;
275
272
if (trap .exists ()) {
@@ -424,33 +421,30 @@ public class TrapLocker implements AutoCloseable {
424
421
private final IrDeclaration sym ;
425
422
private final File trapFile ;
426
423
private final String signature ;
427
- private final boolean isNonSourceTrapFile ;
428
424
private TrapLocker (IrDeclaration decl , String signature ) {
429
425
this .sym = decl ;
430
426
this .signature = signature ;
431
427
if (sym ==null ) {
432
- trapFile = getTrapFileForCurrentSourceFile ();
428
+ log .error ("Null symbol passed for Kotlin TRAP locker" );
429
+ trapFile = null ;
433
430
} else {
434
431
trapFile = getTrapFileForDecl (sym , signature );
435
432
}
436
- isNonSourceTrapFile = false ;
437
433
}
438
434
private TrapLocker (File jarFile ) {
439
435
sym = null ;
440
436
signature = null ;
441
437
trapFile = getTrapFileForJarFile (jarFile );
442
- isNonSourceTrapFile = true ;
443
438
}
444
439
private TrapLocker (String moduleName ) {
445
440
sym = null ;
446
441
signature = null ;
447
442
trapFile = getTrapFileForModule (moduleName );
448
- isNonSourceTrapFile = true ;
449
443
}
450
444
public TrapFileManager getTrapFileManager () {
451
445
if (trapFile !=null ) {
452
446
lockTrapFile (trapFile );
453
- return getMembersWriterForDecl (sym , signature );
447
+ return getMembersWriterForDecl (trapFile , sym , signature );
454
448
} else {
455
449
return null ;
456
450
}
0 commit comments