public boolean isAllowedPackage(String packageName)
   {

      // No packages in set? Accept all packages.
      if (packageSet.isEmpty())
      {
         return true;
      }

      // check all valid packages
      for (String validPackage : packageSet)
      {
         // accept if package is a sub-package of a valid package
         if (packageName.startsWith(validPackage))
         {
            return true;
         }
      }

      // package noch accepted
      return false;

   }
public boolean isAllowedPackage(String packageName)
   {

      
      if (packageSet.isEmpty())
      {
         return true;
      }

      
      for (String validPackage : packageSet)
      {
         
         if (packageName.startsWith(validPackage))
         {
            return true;
         }
      }

      
      return false;

   }
public boolean isAllowedPackage ( String packageName ) { // No packages in set? Accept all packages. if ( packageSet . isEmpty ( ) ) { return true ; } // check all valid packages for ( String validPackage : packageSet ) { // accept if package is a sub-package of a valid package if ( packageName . startsWith ( validPackage ) ) { return true ; } } // package noch accepted return false ; }
<p>
Checks whether the supplied packages matches the filter.
</p>
<p>
The method returns <code>true</code> if one of the following checks succeed:
</p>
<ul>
<li>The supplied package is one of the packages specified in the filter condition.</li>
<li>The supplied package is a sub-package of one of the packages specified in the filter condition.</li>
</ul>

@param packageName A package name
@return <code>true</code> if the filter matches
<p > Checks whether the supplied packages matches the filter . < / p > <p > The method returns <code > true< / code > if one of the following checks succeed : < / p > <ul > <li > The supplied package is one of the packages specified in the filter condition . < / li > <li > The supplied package is a sub - package of one of the packages specified in the filter condition . < / li > < / ul >