Skip to content

Commit

Permalink
Issue #11277: update code base to have javadoc tag to explain noinspe…
Browse files Browse the repository at this point in the history
…ction content
  • Loading branch information
nrmancuso authored and strkkk committed Jul 14, 2022
1 parent 40b3384 commit c5acf2d
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/puppycrawl/tools/checkstyle/XmlLoader.java
Expand Up @@ -45,6 +45,8 @@
* </p>
*
* @noinspection ThisEscapedInObjectConstruction
* @noinspectionreason ThisEscapedInObjectConstruction - only reference is used and not
* accessed until initialized
*/
public class XmlLoader
extends DefaultHandler {
Expand Down
Expand Up @@ -338,6 +338,8 @@ private void registerAnonymousInnerClassToSuperClass(DetailAST literalNewAst,
* @param countProvider the function to apply to calculate the name matching count
* @return {@link Optional} of {@link ClassDesc} object of the nearest class with the same name.
* @noinspection CallToStringConcatCanBeReplacedByOperator
* @noinspectionreason CallToStringConcatCanBeReplacedByOperator - operator causes
* pitest to fail
*/
private Optional<ClassDesc> getNearestClassWithSameName(String className,
Function<ClassDesc, Integer> countProvider) {
Expand Down
Expand Up @@ -46,6 +46,8 @@ public class HandlerFactory {
* Creates a HandlerFactory.
*
* @noinspection OverlyCoupledMethod
* @noinspectionreason OverlyCoupledMethod - complex nature of indentation check
* requires this coupling
*/
public HandlerFactory() {
register(TokenTypes.CASE_GROUP, CaseHandler.class);
Expand Down
Expand Up @@ -60,6 +60,8 @@
* Original&nbsp;Source&nbsp;Location</a>
*
* @noinspection ThisEscapedInObjectConstruction
* @noinspectionreason ThisEscapedInObjectConstruction - only reference is used and not
* accessed until initialized
*/
public final class TreeTable extends JTable {

Expand Down
Expand Up @@ -39,11 +39,13 @@
import com.puppycrawl.tools.checkstyle.api.CheckstyleException;

/**
* Custom class loader is needed to pass URLs to pretend these are loaded from the classpath
* though we can't add/change the files for testing. The class loader is nested in this class,
* so the custom class loader we are using is safe.
* Tests loading of package names from XML files.
*
* @noinspection ClassLoaderInstantiation
* @noinspectionreason ClassLoaderInstantiation - Custom class loader is needed to pass URLs to
* pretend these are loaded from the classpath though we can't add/change the files for
* testing. The class loader is nested in this class, so the custom class loader we
* are using is safe.
*/
public class PackageNamesLoaderTest extends AbstractPathTestSupport {

Expand Down Expand Up @@ -227,10 +229,11 @@ public void testPackagesWithIoExceptionGetResources() {
}

/**
* Custom class loader is needed to pass URLs to pretend these are loaded from the classpath
* though we can't add/change the files for testing.
* Mocked ClassLoader for testing URL loading.
*
* @noinspection CustomClassloader
* @noinspectionreason CustomClassloader - needed to pass URLs to pretend these are loaded
* from the classpath though we can't add/change the files for testing
*/
private static class TestUrlsClassLoader extends ClassLoader {

Expand All @@ -247,9 +250,11 @@ public Enumeration<URL> getResources(String name) {
}

/**
* Custom class loader is needed to throw an exception to test a catch statement.
* Mocked ClassLoader for testing exceptions.
*
* @noinspection CustomClassloader
* @noinspectionreason CustomClassloader - needed to throw an exception to
* test a catch statement
*/
private static class TestIoExceptionClassLoader extends ClassLoader {
@Override
Expand Down
Expand Up @@ -47,6 +47,8 @@
* so the custom class loader we are using is safe.
*
* @noinspection ClassLoaderInstantiation
* @noinspectionreason ClassLoaderInstantiation - Custom class loader is needed to
* pass URLs for testing
*/
public class ViolationTest {

Expand Down Expand Up @@ -444,10 +446,11 @@ public void tearDown() {
}

/**
* Custom class loader is needed to pass URLs to pretend these are loaded from the classpath
* though we can't add/change the files for testing.
* Mocked ClassLoader for testing URL loading.
*
* @noinspection CustomClassloader
* @noinspectionreason CustomClassloader - needed to pass URLs to pretend these are loaded
* from the classpath though we can't add/change the files for testing
*/
private static class TestUrlsClassLoader extends ClassLoader {

Expand Down

0 comments on commit c5acf2d

Please sign in to comment.