Join FlipAndroid.COM Telegram Group: https://t.me/joinchat/F_aqThGkhwcLzmI49vKAiw


Lista de palabras clave "noinspection" en Android Studio

En Android Studio a veces uso este tipo de comentario para deshabilitar una advertencia de inspección en una línea específica de código que ya manejé, por ejemplo:

if(Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) { //noinspection deprecation textView.setBackgroundDrawable(ContextCompat.getDrawable(mContext, R.drawable.calendar_item_separator)); } else { textView.setBackground(ContextCompat.getDrawable(mContext, R.drawable.calendar_item_separator)); } 

En este ejemplo he utilizado la palabra clave "depreciación", pero no puedo encontrar la lista completa de palabras clave disponibles.

  • ¿Cómo deshace el modo flotante para la ventana logcat en Android Studio
  • Especificación de las dependencias de prueba con el sistema de compilación de Gradle Android
  • Abrir nuevo espacio de trabajo en el android studio
  • Android Studio: El módulo no aparecerá en "Editar configuración"
  • Obtención de contexto en AndroidTestCase o InstrumentationTestCase en la función Prueba de unidad de Android Studio
  • Android studio AssertionError: No invocar waitForSmartMode desde dentro de la acción de lectura en modo mudo
  • ¿Alguien se enteró?

    ¡Gracias!

  • ¿Se eliminan las preferencias compartidas de las aplicaciones de Android cuando un usuario actualiza la aplicación?
  • Android Calendar obtiene el día de la semana actual como string
  • Intent.ACTION_CALL problema (SecurityException)
  • Error de Eclipse: R no se puede resolver con una variable
  • Recurso dibujable utilizando una variable
  • ¿Expande el área seleccionable de un ImageView mediante el relleno?
  • 2 Solutions collect form web for “Lista de palabras clave "noinspection" en Android Studio”

    Finalmente conseguí obtener la lista de palabras clave de este código fuente de Github.

    Lo pego aquí por si acaso:

     "localInspection": [ { "language": "JAVA", "shortName": "UndesirableClassUsage", "displayName": "Undesirable class usage", "groupName": "IntelliJ IDEA Platform Inspections", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.internal.UndesirableClassUsageInspection" }, { "language": "JAVA", "shortName": "FileEqualsUsage", "displayName": "File.equals() usage", "groupName": "IntelliJ IDEA Platform Inspections", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.internal.FileEqualsUsageInspection" }, { "language": "JAVA", "shortName": "GtkPreferredJComboBoxRenderer", "displayName": "Preferred JComboBox renderer", "groupName": "IntelliJ IDEA Platform Inspections", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.internal.GtkPreferredJComboBoxRendererInspection" }, { "language": "JAVA", "shortName": "UnsafeVfsRecursion", "displayName": "Unsafe VFS recursion", "groupName": "IntelliJ IDEA Platform Inspections", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.internal.UnsafeVfsRecursionInspection" }, { "language": "JAVA", "shortName": "ConstantConditions", "bundle": "messages.InspectionsBundle", "key": "inspection.data.flow.display.name", "groupName": "Probable bugs", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.dataFlow.DataFlowInspection" }, { "language": "JAVA", "shortName": "UnusedAssignment", "displayName": "Unused assignment", "groupName": "Probable bugs", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.defUse.DefUseInspection" }, { "language": "JAVA", "shortName": "NumericOverflow", "displayName": "Numeric overflow", "groupName": "Numeric issues", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.NumericOverflowInspection" }, { "language": "JAVA", "shortName": "RedundantCast", "displayName": "Redundant type cast", "groupName": "Verbose or redundant code constructs", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.redundantCast.RedundantCastInspection" }, { "language": "JAVA", "shortName": "RedundantTypeArguments", "bundle": "messages.InspectionsBundle", "key": "inspection.redundant.type.display.name", "groupName": "Verbose or redundant code constructs", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.miscGenerics.RedundantTypeArgsInspection" }, { "language": "JAVA", "shortName": "RedundantArrayCreation", "bundle": "messages.InspectionsBundle", "key": "inspection.redundant.array.creation.display.name", "groupName": "Verbose or redundant code constructs", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.miscGenerics.RedundantArrayForVarargsCallInspection" }, { "language": "JAVA", "shortName": "SuspiciousMethodCalls", "bundle": "messages.InspectionsBundle", "key": "inspection.suspicious.collections.method.calls.display.name", "groupName": "Probable bugs", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.miscGenerics.SuspiciousCollectionsMethodCallsInspection" }, { "language": "JAVA", "shortName": "LocalCanBeFinal", "bundle": "messages.InspectionsBundle", "key": "inspection.local.can.be.final.display.name", "groupName": "Code style issues", "enabledByDefault": "false", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.localCanBeFinal.LocalCanBeFinal" }, { "language": "JAVA", "shortName": "JavaDoc", "bundle": "messages.InspectionsBundle", "key": "inspection.javadoc.display.name", "groupKey": "group.names.javadoc.issues", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.javaDoc.JavaDocLocalInspection" }, { "language": "JAVA", "shortName": "JavadocReference", "bundle": "messages.InspectionsBundle", "key": "inspection.javadoc.ref.display.name", "groupKey": "group.names.javadoc.issues", "enabledByDefault": "true", "level": "ERROR", "implementationClass": "com.intellij.codeInspection.javaDoc.JavaDocReferenceInspection" }, { "language": "JAVA", "suppressId": "deprecation", "shortName": "Deprecation", "displayName": "Deprecated API usage", "groupName": "", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.deprecation.DeprecationInspection" }, { "language": "JAVA", "suppressId": "extensionSyntax", "bundle": "messages.InspectionsBundle", "key": "deprecated.defender.syntax.description", "groupName": "", "enabledByDefault": "true", "level": "ERROR", "implementationClass": "com.intellij.codeInspection.deprecation.DeprecatedDefenderSyntaxInspection" }, { "language": "XML", "shortName": "DeprecatedClassUsageInspection", "displayName": "Deprecated API usage in XML", "groupName": "XML", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.util.xml.DeprecatedClassUsageInspection" }, { "language": "JAVA", "shortName": "EqualsAndHashcode", "bundle": "messages.InspectionsBundle", "key": "inspection.equals.hashcode.display.name", "groupName": "", "enabledByDefault": "false", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.equalsAndHashcode.EqualsAndHashcode" }, { "language": "JAVA", "shortName": "Since15", "bundle": "messages.InspectionsBundle", "key": "inspection.1.5.display.name", "groupName": "Java language level migration aids", "enabledByDefault": "false", "level": "ERROR", "implementationClass": "com.intellij.codeInspection.java15api.Java15APIUsageInspection" }, { "language": "JAVA", "shortName": "Dependency", "displayName": "Illegal package dependencies", "groupName": "", "enabledByDefault": "true", "level": "ERROR", "implementationClass": "com.intellij.codeInspection.dependencyViolation.DependencyInspection" }, { "language": "JAVA", "shortName": "FieldCanBeLocal", "bundle": "messages.InspectionsBundle", "key": "inspection.field.can.be.local.display.name", "groupName": "Class structure", "enabledByDefault": "true", "level": "WARNING", "runForWholeFile": "true", "implementationClass": "com.intellij.codeInspection.varScopeCanBeNarrowed.FieldCanBeLocalInspection" }, { "language": "JAVA", "shortName": "ParameterCanBeLocal", "key": "inspection.parameter.can.be.local.display.name", "groupName": "Class structure", "enabledByDefault": "true", "level": "WARNING", "bundle": "messages.InspectionsBundle", "implementationClass": "com.intellij.codeInspection.varScopeCanBeNarrowed.ParameterCanBeLocalInspection" }, { "language": "JAVA", "shortName": "NullableProblems", "bundle": "messages.InspectionsBundle", "key": "inspection.nullable.problems.display.name", "groupName": "Probable bugs", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.nullable.NullableStuffInspection" }, { "language": "JAVA", "shortName": "TestOnlyProblems", "bundle": "messages.InspectionsBundle", "key": "inspection.test.only.problems.display.name", "groupName": "General", "enabledByDefault": "false", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.testOnly.TestOnlyInspection" }, { "language": "JAVA", "shortName": "WrongPackageStatement", "bundle": "messages.InspectionsBundle", "key": "wrong.package.statement", "groupName": "", "enabledByDefault": "true", "level": "ERROR", "implementationClass": "com.intellij.codeInspection.wrongPackageStatement.WrongPackageStatementInspection" }, { "language": "JAVA", "shortName": "SillyAssignment", "bundle": "messages.InspectionsBundle", "key": "inspection.variable.assigned.to.itself.display.name", "groupName": "", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.sillyAssignment.SillyAssignmentInspection" }, { "language": "JAVA", "shortName": "RedundantThrowsDeclaration", "bundle": "messages.InspectionsBundle", "key": "redundant.throws.declaration", "groupName": "Declaration redundancy", "enabledByDefault": "false", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.unneededThrows.RedundantThrowsDeclaration" }, { "language": "JAVA", "shortName": "AccessStaticViaInstance", "bundle": "messages.InspectionsBundle", "key": "access.static.via.instance", "groupName": "", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.accessStaticViaInstance.AccessStaticViaInstance" }, { "shortName": "DefaultFileTemplate", "bundle": "messages.InspectionsBundle", "key": "default.file.template.display.name", "groupName": "General", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.defaultFileTemplateUsage.DefaultFileTemplateUsageInspection" }, { "language": "JAVA", "suppressId": "UnusedDeclaration", "alternativeId": "unused", "shortName": "UNUSED_SYMBOL", "displayName": "Unused symbol", "groupName": "Declaration redundancy", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.unusedSymbol.UnusedSymbolLocalInspection", "unfair": "true" }, { "language": "JAVA", "shortName": "UNUSED_IMPORT", "displayName": "Unused import (editor light)", "groupName": "Imports", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.unusedImport.UnusedImportLocalInspection" }, { "language": "JAVA", "suppressId": "unchecked", "shortName": "UNCHECKED_WARNING", "displayName": "Unchecked warning", "groupName": "", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.uncheckedWarnings.UncheckedWarningLocalInspection" }, { "language": "JAVA", "shortName": "SuspiciousNameCombination", "bundle": "messages.InspectionsBundle", "key": "suspicious.name.combination.display.name", "groupName": "Probable bugs", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.suspiciousNameCombination.SuspiciousNameCombinationInspection" }, { "language": "JAVA", "shortName": "DuplicateThrows", "bundle": "messages.InspectionsBundle", "key": "inspection.duplicate.throws.display.name", "groupName": "Declaration redundancy", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.duplicateThrows.DuplicateThrowsInspection" }, { "language": "JAVA", "shortName": "FieldAccessNotGuarded", "displayName": "Unguarded field access", "groupName": "Concurrency annotation issues", "enabledByDefault": "false", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.concurrencyAnnotations.FieldAccessNotGuardedInspection" }, { "language": "JAVA", "shortName": "InstanceGuardedByStatic", "displayName": "Instance member guarded by static field", "groupName": "Concurrency annotation issues", "enabledByDefault": "false", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.concurrencyAnnotations.InstanceGuardedByStaticInspection" }, { "language": "JAVA", "shortName": "NonFinalFieldInImmutable", "displayName": "Non-final field in @Immutable class", "groupName": "Concurrency annotation issues", "enabledByDefault": "false", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.concurrencyAnnotations.NonFinalFieldInImmutableInspection" }, { "language": "JAVA", "shortName": "NonFinalGuard", "displayName": "Non-final @GuardedBy field", "groupName": "Concurrency annotation issues", "enabledByDefault": "false", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.concurrencyAnnotations.NonFinalGuardInspection" }, { "language": "JAVA", "shortName": "StaticGuardedByInstance", "displayName": "Static member guarded by instance field or this", "groupName": "Concurrency annotation issues", "enabledByDefault": "false", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.concurrencyAnnotations.StaticGuardedByInstanceInspection" }, { "language": "JAVA", "shortName": "UnknownGuard", "displayName": "Unknown @GuardedBy field", "groupName": "Concurrency annotation issues", "enabledByDefault": "false", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.concurrencyAnnotations.UnknownGuardInspection" }, { "language": "JAVA", "shortName": "Convert2Diamond", "displayName": "Explicit type can be replaced with <>", "groupName": "Java language level migration aids", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.ExplicitTypeCanBeDiamondInspection" }, { "language": "JAVA", "shortName": "Convert2Lambda", "displayName": "Anonymous type can be replaced with lambda", "groupName": "Java language level migration aids", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.AnonymousCanBeLambdaInspection" }, { "language": "JAVA", "shortName": "Anonymous2MethodRef", "displayName": "Anonymous type can be replaced with method reference", "groupName": "Java language level migration aids", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.AnonymousCanBeMethodReferenceInspection" }, { "language": "JAVA", "shortName": "Convert2MethodRef", "displayName": "Lambda can be replaced with method reference", "groupName": "Java language level migration aids", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.LambdaCanBeMethReferenceInspection" }, { "language": "JAVA", "shortName": "CodeBlock2Expr", "displayName": "Lambda code block can be replaced with expression", "groupName": "Java language level migration aids", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.RedundantLambdaCodeBlockInspection" }, { "language": "JAVA", "suppressId": "unchecked", "shortName": "SafeVarargsDetector", "displayName": "Possible heap pollution from parameterized vararg type", "groupName": "Java language level migration aids", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.PossibleHeapPollutionVarargsInspection" }, { "language": "JAVA", "shortName": "JavacQuirks", "bundle": "messages.InspectionsBundle", "key": "inspection.compiler.javac.quirks.name", "groupName": "Compiler issues", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.compiler.JavacQuirksInspection" }, { "language": "JAVA", "shortName": "MagicConstant", "displayName": "Magic Constant", "groupName": "Probable bugs", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.magicConstant.MagicConstantInspection" } ], "globalInspection": [ { "shortName": "WeakerAccess", "displayName": "Declaration access can be weaker", "groupName": "Declaration redundancy", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.visibility.VisibilityInspection" }, { "shortName": "CanBeFinal", "displayName": "Declaration can have final modifier", "groupName": "Declaration redundancy", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.canBeFinal.CanBeFinalInspection" }, { "shortName": "UnusedParameters", "bundle": "messages.InspectionsBundle", "key": "inspection.unused.parameter.display.name", "groupName": "Declaration redundancy", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.unusedParameters.UnusedParametersInspection" }, { "shortName": "SameParameterValue", "bundle": "messages.InspectionsBundle", "key": "inspection.same.parameter.display.name", "groupName": "Declaration redundancy", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.sameParameterValue.SameParameterValueInspection" }, { "shortName": "UnusedReturnValue", "bundle": "messages.InspectionsBundle", "key": "inspection.unused.return.value.display.name", "groupName": "Declaration redundancy", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.unusedReturnValue.UnusedReturnValue" }, { "shortName": "SameReturnValue", "bundle": "messages.InspectionsBundle", "key": "inspection.same.return.value.display.name", "groupName": "Declaration redundancy", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.sameReturnValue.SameReturnValueInspection" }, { "shortName": "EmptyMethod", "displayName": "Empty method", "groupName": "Declaration redundancy", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.emptyMethod.EmptyMethodInspection" }, { "shortName": "RedundantThrows", "displayName": "Redundant throws clause", "groupName": "Declaration redundancy", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.unneededThrows.RedundantThrows" }, { "shortName": "UnnecessaryModuleDependencyInspection", "bundle": "messages.InspectionsBundle", "key": "unnecessary.module.dependency.display.name", "groupName": "Declaration redundancy", "enabledByDefault": "true", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.unnecessaryModuleDependency.UnnecessaryModuleDependencyInspection" }, { "shortName": "RedundantSuppression", "bundle": "messages.InspectionsBundle", "key": "inspection.redundant.suppression.name", "groupName": "Declaration redundancy", "enabledByDefault": "false", "level": "WARNING", "implementationClass": "com.intellij.codeInspection.RedundantSuppressInspection" } ] 

    Por una razón que aún no sé, el uso del comentario //noinspection <keyword> no funciona todo el tiempo.

    Para poder usar la palabra clave UnusedDeclaration tuve que escribir esta línea antes de mi declaración de variables:

     /** @noinspection UnusedDeclaration */ private static final String TAG = "DateTools"; 

    Puedo estar equivocado, pero creo que lo más cercano que puedes conseguir es la vista de Inspections en la configuración de Android Studio. Pulse Ctrl + Alt + S , elija Editor -> Inspections .

    No le mostrará la lista de palabras clave de noinspection disponibles, pero le proporcionará la lista completa de las inspecciones disponibles en Android Studio.

    BTW, ¿por qué lo necesitas en primer lugar? Siempre que se muestre la advertencia en Android Studio, esta opción de reparación rápida está disponible con Alt + Enter, que muestra cómo se puede suprimir esta advertencia.

    FlipAndroid es un fan de Google para Android, Todo sobre Android Phones, Android Wear, Android Dev y Aplicaciones para Android Aplicaciones.