diff options
Diffstat (limited to 'plugins/java-i18n/src')
5 files changed, 23 insertions, 6 deletions
diff --git a/plugins/java-i18n/src/META-INF/plugin.xml b/plugins/java-i18n/src/META-INF/plugin.xml index 399a14245c2e..b352a2f78e08 100644 --- a/plugins/java-i18n/src/META-INF/plugin.xml +++ b/plugins/java-i18n/src/META-INF/plugin.xml @@ -24,7 +24,7 @@ implementationClass="com.intellij.lang.properties.PropertiesReferenceProvider"/> <psi.referenceContributor implementation="com.intellij.psi.impl.source.resolve.reference.impl.providers.JavaReferenceContributor"/> <psi.referenceContributor implementation="com.intellij.lang.properties.PropertiesReferenceContributor"/> - <lang.foldingBuilder language="JAVA" implementationClass="com.intellij.codeInspection.i18n.folding.PropertyFoldingBuilder" /> + <lang.foldingBuilder language="JAVA" implementationClass="com.intellij.codeInspection.i18n.folding.PropertyFoldingBuilder" order="FIRST"/> <gotoDeclarationHandler implementation="com.intellij.codeInspection.i18n.folding.I18nMessageGotoDeclarationHandler" order="FIRST"/> <localInspection shortName="HardCodedStringLiteral" bundle="messages.CodeInsightBundle" key="inspection.i18n.display.name" diff --git a/plugins/java-i18n/src/com/intellij/codeInspection/i18n/inconsistentResourceBundle/InconsistentPropertiesEndsInspectionProvider.java b/plugins/java-i18n/src/com/intellij/codeInspection/i18n/inconsistentResourceBundle/InconsistentPropertiesEndsInspectionProvider.java index ff1e8b6c1daf..9b5b96a035f3 100644 --- a/plugins/java-i18n/src/com/intellij/codeInspection/i18n/inconsistentResourceBundle/InconsistentPropertiesEndsInspectionProvider.java +++ b/plugins/java-i18n/src/com/intellij/codeInspection/i18n/inconsistentResourceBundle/InconsistentPropertiesEndsInspectionProvider.java @@ -19,6 +19,7 @@ import com.intellij.codeInspection.*; import com.intellij.codeInspection.reference.RefManager; import com.intellij.lang.properties.IProperty; import com.intellij.lang.properties.psi.PropertiesFile; +import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.PsiElement; import com.intellij.util.containers.BidirectionalMap; import com.intellij.util.containers.ContainerUtil; @@ -65,7 +66,7 @@ public class InconsistentPropertiesEndsInspectionProvider implements Inconsisten final IProperty property = file.findPropertyByKey(commonKey); assert property != null; final String propertyValue = property.getValue(); - if (propertyValue == null) { + if (StringUtil.isEmptyOrSpaces(propertyValue)) { continue; } final char lastChar = propertyValue.charAt(propertyValue.length() - 1); diff --git a/plugins/java-i18n/src/com/intellij/codeInspection/i18n/inconsistentResourceBundle/InconsistentResourceBundleInspection.java b/plugins/java-i18n/src/com/intellij/codeInspection/i18n/inconsistentResourceBundle/InconsistentResourceBundleInspection.java index 48f4b05adfb2..1e71e5d1ce50 100644 --- a/plugins/java-i18n/src/com/intellij/codeInspection/i18n/inconsistentResourceBundle/InconsistentResourceBundleInspection.java +++ b/plugins/java-i18n/src/com/intellij/codeInspection/i18n/inconsistentResourceBundle/InconsistentResourceBundleInspection.java @@ -144,7 +144,7 @@ public class InconsistentResourceBundleInspection extends GlobalSimpleInspection ResourceBundle resourceBundle = propertiesFile.getResourceBundle(); assert visitedBundles != null; if (!visitedBundles.add(resourceBundle)) return; - List<PropertiesFile> files = resourceBundle.getPropertiesFiles(manager.getProject()); + List<PropertiesFile> files = resourceBundle.getPropertiesFiles(); if (files.size() < 2) return; BidirectionalMap<PropertiesFile, PropertiesFile> parents = new BidirectionalMap<PropertiesFile, PropertiesFile>(); for (PropertiesFile f : files) { diff --git a/plugins/java-i18n/src/com/intellij/lang/properties/PropertiesReferenceContributor.java b/plugins/java-i18n/src/com/intellij/lang/properties/PropertiesReferenceContributor.java index a322d400b95f..bce0f3683c6e 100644 --- a/plugins/java-i18n/src/com/intellij/lang/properties/PropertiesReferenceContributor.java +++ b/plugins/java-i18n/src/com/intellij/lang/properties/PropertiesReferenceContributor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -37,7 +37,7 @@ public class PropertiesReferenceContributor extends PsiReferenceContributor{ } }; - public void registerReferenceProviders(final PsiReferenceRegistrar registrar) { + public void registerReferenceProviders(@NotNull final PsiReferenceRegistrar registrar) { registrar.registerReferenceProvider(literalExpression(), new PropertiesReferenceProvider(true)); registrar.registerReferenceProvider(literalExpression().withParent( psiNameValuePair().withName(AnnotationUtil.PROPERTY_KEY_RESOURCE_BUNDLE_PARAMETER)), diff --git a/plugins/java-i18n/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/JavaReferenceContributor.java b/plugins/java-i18n/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/JavaReferenceContributor.java index a97a2fb69718..b38f94079933 100644 --- a/plugins/java-i18n/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/JavaReferenceContributor.java +++ b/plugins/java-i18n/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/JavaReferenceContributor.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2014 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.intellij.psi.impl.source.resolve.reference.impl.providers; import com.intellij.codeInsight.AnnotationUtil; @@ -6,6 +21,7 @@ import com.intellij.patterns.PlatformPatterns; import com.intellij.psi.*; import com.intellij.psi.filters.ElementFilter; import com.intellij.psi.filters.position.FilterPattern; +import org.jetbrains.annotations.NotNull; import java.util.HashMap; import java.util.Map; @@ -17,7 +33,7 @@ import static com.intellij.patterns.XmlPatterns.xmlTag; * @author peter */ public class JavaReferenceContributor extends PsiReferenceContributor{ - public void registerReferenceProviders(final PsiReferenceRegistrar registrar) { + public void registerReferenceProviders(@NotNull final PsiReferenceRegistrar registrar) { final JavaClassListReferenceProvider classListProvider = new JavaClassListReferenceProvider(); registrar.registerReferenceProvider(xmlAttributeValue(), classListProvider, PsiReferenceRegistrar.LOWER_PRIORITY); |