Issue #957: Resolve PMD DefaultPackage rule problems in imports package
This commit is contained in:
parent
4b2c1aaebe
commit
3b970321aa
|
|
@ -88,7 +88,7 @@ class Guard {
|
|||
* @param forImport the package to check.
|
||||
* @return a result {@link AccessResult} indicating whether it can be used.
|
||||
*/
|
||||
AccessResult verifyImport(final String forImport) {
|
||||
public AccessResult verifyImport(final String forImport) {
|
||||
if (className != null) {
|
||||
final boolean classMatch;
|
||||
|
||||
|
|
@ -125,7 +125,7 @@ class Guard {
|
|||
/**
|
||||
* @return returns whether the guard is to only be applied locally.
|
||||
*/
|
||||
boolean isLocalOnly() {
|
||||
public boolean isLocalOnly() {
|
||||
return localOnly;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ final class ImportControlLoader extends AbstractLoader {
|
|||
* @return the root {@link PkgControl} object.
|
||||
* @throws CheckstyleException if an error occurs.
|
||||
*/
|
||||
static PkgControl load(final URI uri) throws CheckstyleException {
|
||||
public static PkgControl load(final URI uri) throws CheckstyleException {
|
||||
final InputStream inputStream;
|
||||
try {
|
||||
inputStream = uri.toURL().openStream();
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ package com.puppycrawl.tools.checkstyle.checks.imports;
|
|||
import java.util.Deque;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
/**
|
||||
|
|
@ -65,13 +66,14 @@ class PkgControl {
|
|||
* Adds a guard to the node.
|
||||
* @param thug the guard to be added.
|
||||
*/
|
||||
void addGuard(final Guard thug) {
|
||||
protected void addGuard(final Guard thug) {
|
||||
guards.addFirst(thug);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the full package name represented by the node.
|
||||
*/
|
||||
@VisibleForTesting
|
||||
String getFullPackage() {
|
||||
return fullPackage;
|
||||
}
|
||||
|
|
@ -81,7 +83,7 @@ class PkgControl {
|
|||
* @param forPkg the package to search for.
|
||||
* @return the finest match, or null if no match at all.
|
||||
*/
|
||||
PkgControl locateFinest(final String forPkg) {
|
||||
public PkgControl locateFinest(final String forPkg) {
|
||||
PkgControl finestMatch = null;
|
||||
// Check if we are a match.
|
||||
// This algorithm should be improved to check for a trailing "."
|
||||
|
|
@ -111,7 +113,7 @@ class PkgControl {
|
|||
* @param inPkg the package doing the import.
|
||||
* @return an {@link AccessResult}.
|
||||
*/
|
||||
AccessResult checkAccess(final String forImport, final String inPkg) {
|
||||
public AccessResult checkAccess(final String forImport, final String inPkg) {
|
||||
final AccessResult result;
|
||||
final AccessResult returnValue = localCheckAccess(forImport, inPkg);
|
||||
if (returnValue != AccessResult.UNKNOWN) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue