/*
- * Copyright 2000-2015 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.
}
final PsiClassObjectAccessExpression objectAccessExpression = (PsiClassObjectAccessExpression)argument2;
final PsiType type = objectAccessExpression.getOperand().getType();
- if (!field.getType().equals(type)) {
+ if (!TypeUtils.areConvertible(type, field.getType())) {
registerError(lastArgument, InspectionGadgetsBundle.message("field.incorrect.type.problem.descriptor",
fieldName, type.getPresentableText()));
return;
/*
- * Copyright 2000-2015 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.
"}");
}
+ public void testRightType() {
+ doTest("import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;" +
+ "import java.util.RandomAccess;" +
+ "class A<T extends RandomAccess> {" +
+ " private volatile T value = null;" +
+ " private static final AtomicReferenceFieldUpdater updater = " +
+ " AtomicReferenceFieldUpdater.newUpdater(A.class, RandomAccess.class, \"value\");" +
+ "}");
+ }
+
public void testNotAccessible1() {
doTest("import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;" +
"class Z {" +