本文整理汇总了Java中com.intellij.codeInsight.daemon.ImplicitUsageProvider.isImplicitWrite方法的典型用法代码示例。如果您正苦于以下问题:Java ImplicitUsageProvider.isImplicitWrite方法的具体用法?Java ImplicitUsageProvider.isImplicitWrite怎么用?Java ImplicitUsageProvider.isImplicitWrite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.codeInsight.daemon.ImplicitUsageProvider
的用法示例。
在下文中一共展示了ImplicitUsageProvider.isImplicitWrite方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAllOriginalMembers
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
@Override
protected ClassMember[] getAllOriginalMembers(PsiClass aClass) {
PsiField[] fields = aClass.getFields();
ArrayList<ClassMember> array = new ArrayList<ClassMember>();
ImplicitUsageProvider[] implicitUsageProviders = Extensions.getExtensions(ImplicitUsageProvider.EP_NAME);
fieldLoop: for (PsiField field : fields) {
if (field.hasModifierProperty(PsiModifier.STATIC)) continue;
if (field.hasModifierProperty(PsiModifier.FINAL) && field.getInitializer() != null) continue;
for(ImplicitUsageProvider provider: implicitUsageProviders) {
if (provider.isImplicitWrite(field)) continue fieldLoop;
}
array.add(new PsiFieldMember(field));
}
return array.toArray(new ClassMember[array.size()]);
}
示例2: getAllOriginalMembers
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
@Override
protected ClassMember[] getAllOriginalMembers(PsiClass aClass) {
PsiField[] fields = aClass.getFields();
ArrayList<ClassMember> array = new ArrayList<ClassMember>();
ImplicitUsageProvider[] implicitUsageProviders = Extensions.getExtensions(ImplicitUsageProvider.EP_NAME);
fieldLoop:
for (PsiField field : fields) {
if (field.hasModifierProperty(PsiModifier.STATIC)) {
continue;
}
if (field.hasModifierProperty(PsiModifier.FINAL) && field.getInitializer() != null) {
continue;
}
for (ImplicitUsageProvider provider : implicitUsageProviders) {
if (!(provider instanceof LombokImplicitUsageProvider) && provider.isImplicitWrite(field)) {
continue fieldLoop;
}
}
array.add(new PsiFieldMember(field));
}
return array.toArray(new ClassMember[array.size()]);
}
示例3: hasImplicitReadOrWriteUsage
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
private static boolean hasImplicitReadOrWriteUsage(final PsiField field, ImplicitUsageProvider[] implicitUsageProviders) {
for (ImplicitUsageProvider provider : implicitUsageProviders) {
if (provider.isImplicitRead(field) || provider.isImplicitWrite(field)) {
return true;
}
}
return false;
}
示例4: isImplicitWrite
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
public static boolean isImplicitWrite(@NotNull Project project,
@NotNull PsiVariable element,
@NotNull ProgressIndicator progress) {
for(ImplicitUsageProvider provider: ourImplicitUsageProviders) {
progress.checkCanceled();
if (provider.isImplicitWrite(element)) {
return true;
}
}
return isInjected(project, element);
}
示例5: isInitializedImplicitly
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
private static boolean isInitializedImplicitly(PsiField field) {
field = CompletionUtil.getOriginalOrSelf(field);
for(ImplicitUsageProvider provider: ImplicitUsageProvider.EP_NAME.getExtensions()) {
if (provider.isImplicitWrite(field)) {
return true;
}
}
return false;
}
示例6: isImplicitWrite
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
private static boolean isImplicitWrite(final PsiVariable element, ProgressIndicator progress) {
for(ImplicitUsageProvider provider: ourImplicitUsageProviders) {
progress.checkCanceled();
if (provider.isImplicitWrite(element)) {
return true;
}
}
return UnusedSymbolLocalInspection.isInjected(element);
}
示例7: isImplicitWrite
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
public static boolean isImplicitWrite(@NotNull Project project,
@NotNull PsiVariable element,
@NotNull ProgressIndicator progress)
{
for(ImplicitUsageProvider provider : ourImplicitUsageProviders)
{
progress.checkCanceled();
if(provider.isImplicitWrite(element))
{
return true;
}
}
return isInjected(project, element);
}
示例8: isInitializedImplicitly
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
private static boolean isInitializedImplicitly(PsiField field)
{
field = CompletionUtil.getOriginalOrSelf(field);
for(ImplicitUsageProvider provider : ImplicitUsageProvider.EP_NAME.getExtensions())
{
if(provider.isImplicitWrite(field))
{
return true;
}
}
return false;
}
示例9: visitField
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
@Override
public void visitField(@NotNull PsiField field) {
if (field.hasModifierProperty(PsiModifier.STATIC) ||
field.hasModifierProperty(PsiModifier.FINAL)) {
return;
}
if (field.getInitializer() != null) {
return;
}
if (m_ignorePrimitives) {
final PsiType fieldType = field.getType();
if (ClassUtils.isPrimitive(fieldType)) {
return;
}
}
final PsiClass aClass = field.getContainingClass();
if (aClass == null) {
return;
}
final ImplicitUsageProvider[] implicitUsageProviders =
Extensions.getExtensions(ImplicitUsageProvider.EP_NAME);
for (ImplicitUsageProvider provider : implicitUsageProviders) {
if (provider.isImplicitWrite(field)) {
return;
}
}
final boolean isTestClass = TestUtils.isJUnitTestClass(aClass);
if (isTestClass) {
if (isInitializedInSetup(field, aClass)) {
return;
}
}
if (isInitializedInInitializer(field)) {
return;
}
if (isInitializedInConstructors(field, aClass)) {
return;
}
if (isTestClass) {
registerFieldError(field, Boolean.TRUE);
}
else {
registerFieldError(field, Boolean.FALSE);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:46,代码来源:InstanceVariableInitializationInspection.java
示例10: visitField
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
@Override
public void visitField(@NotNull PsiField field) {
if (field.hasModifierProperty(PsiModifier.STATIC) || field.hasModifierProperty(PsiModifier.FINAL)) {
return;
}
if (field.getInitializer() != null) {
return;
}
final PsiAnnotation annotation = AnnotationUtil.findAnnotation(field, annotationNames);
if (annotation != null) {
return;
}
if (m_ignorePrimitives) {
final PsiType fieldType = field.getType();
if (ClassUtils.isPrimitive(fieldType)) {
return;
}
}
final PsiClass aClass = field.getContainingClass();
if (aClass == null) {
return;
}
for (ImplicitUsageProvider provider :
Extensions.getExtensions(ImplicitUsageProvider.EP_NAME)) {
if (provider.isImplicitWrite(field)) {
return;
}
}
final UninitializedReadCollector uninitializedReadsCollector = new UninitializedReadCollector();
if (!isInitializedInInitializer(field, uninitializedReadsCollector)) {
final PsiMethod[] constructors = aClass.getConstructors();
for (final PsiMethod constructor : constructors) {
final PsiCodeBlock body = constructor.getBody();
uninitializedReadsCollector.blockAssignsVariable(body, field);
}
}
final PsiExpression[] badReads = uninitializedReadsCollector.getUninitializedReads();
for (PsiExpression expression : badReads) {
registerError(expression, field);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:42,代码来源:InstanceVariableUninitializedUseInspectionBase.java
示例11: visitField
import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
@Override
public void visitField(@NotNull PsiField field) {
if (field.hasModifierProperty(PsiModifier.STATIC)) {
return;
}
if (field.getInitializer() != null) {
return;
}
final PsiAnnotation annotation = AnnotationUtil.findAnnotation(field, annotationNames);
if (annotation != null) {
return;
}
if (m_ignorePrimitives) {
final PsiType fieldType = field.getType();
if (ClassUtils.isPrimitive(fieldType)) {
return;
}
}
final PsiClass aClass = field.getContainingClass();
if (aClass == null) {
return;
}
for (ImplicitUsageProvider provider :
Extensions.getExtensions(ImplicitUsageProvider.EP_NAME)) {
if (provider.isImplicitWrite(field)) {
return;
}
}
final UninitializedReadCollector uninitializedReadsCollector = new UninitializedReadCollector();
if (!isInitializedInInitializer(field, uninitializedReadsCollector)) {
final PsiMethod[] constructors = aClass.getConstructors();
for (final PsiMethod constructor : constructors) {
final PsiCodeBlock body = constructor.getBody();
uninitializedReadsCollector.blockAssignsVariable(body, field);
}
}
final PsiExpression[] badReads = uninitializedReadsCollector.getUninitializedReads();
for (PsiExpression expression : badReads) {
registerError(expression, field);
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:42,代码来源:InstanceVariableUninitializedUseInspection.java