[jps] excludes module-info classes from instrumentation

This commit is contained in:
Roman Shevchenko
2016-12-12 17:15:12 +01:00
parent c2fd22f05a
commit 97b235937e
3 changed files with 6 additions and 6 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -115,7 +115,7 @@ public class ClassFilesIndicesBuilder extends BaseInstrumentingBuilder {
@Override
protected boolean canInstrument(final CompiledClass compiledClass, final int classFileVersion) {
return true;
return !"module-info".equals(compiledClass.getClassName());
}
@Override
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -69,7 +69,7 @@ public class NotNullInstrumentingBuilder extends BaseInstrumentingBuilder{
@Override
protected boolean canInstrument(CompiledClass compiledClass, int classFileVersion) {
return classFileVersion >= Opcodes.V1_5;
return classFileVersion >= Opcodes.V1_5 && !"module-info".equals(compiledClass.getClassName());
}
// todo: probably instrument other NotNull-like annotations defined in project settings?
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -53,7 +53,7 @@ public class PatternValidatorBuilder extends BaseInstrumentingBuilder{
@Override
protected boolean canInstrument(CompiledClass compiledClass, int classFileVersion) {
return true;
return !"module-info".equals(compiledClass.getClassName());
}
@Nullable