Class IncorrectInternalClassUse

  • All Implemented Interfaces:
    edu.umd.cs.findbugs.Detector, edu.umd.cs.findbugs.Priorities

    public class IncorrectInternalClassUse
    extends java.lang.Object
    implements edu.umd.cs.findbugs.Detector
    looks for classes that use objects from com.sun.xxx packages. As these are internal to sun and subject to change, this should not be done.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private edu.umd.cs.findbugs.BugReporter bugReporter  
      private static java.util.Set<java.lang.String> externalPackages  
      private static java.util.Set<java.lang.String> internalPackages  
      • Fields inherited from interface edu.umd.cs.findbugs.Priorities

        EXP_PRIORITY, HIGH_PRIORITY, IGNORE_PRIORITY, LOW_PRIORITY, NORMAL_PRIORITY
    • Constructor Summary

      Constructors 
      Constructor Description
      IncorrectInternalClassUse​(edu.umd.cs.findbugs.BugReporter bugReporter)
      constructs a IICU detector given the reporter to report bugs on
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static boolean isInternal​(java.lang.String clsName)
      determines if the class in question is an internal class by looking at package prefixes
      void report()
      implementation stub for Detector interface
      java.lang.String toString()  
      void visitClassContext​(edu.umd.cs.findbugs.ba.ClassContext context)
      implements the visitor to look for classes that reference com.sun.xxx, or org.apache.xerces.xxx classes by looking for class constants in the constant pool
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • internalPackages

        private static final java.util.Set<java.lang.String> internalPackages
      • externalPackages

        private static final java.util.Set<java.lang.String> externalPackages
      • bugReporter

        private final edu.umd.cs.findbugs.BugReporter bugReporter
    • Constructor Detail

      • IncorrectInternalClassUse

        public IncorrectInternalClassUse​(edu.umd.cs.findbugs.BugReporter bugReporter)
        constructs a IICU detector given the reporter to report bugs on
        Parameters:
        bugReporter - the sync of bug reports
    • Method Detail

      • visitClassContext

        public void visitClassContext​(edu.umd.cs.findbugs.ba.ClassContext context)
        implements the visitor to look for classes that reference com.sun.xxx, or org.apache.xerces.xxx classes by looking for class constants in the constant pool
        Specified by:
        visitClassContext in interface edu.umd.cs.findbugs.Detector
        Parameters:
        context - the context object of the currently parsed class
      • report

        public void report()
        implementation stub for Detector interface
        Specified by:
        report in interface edu.umd.cs.findbugs.Detector
      • isInternal

        private static boolean isInternal​(java.lang.String clsName)
        determines if the class in question is an internal class by looking at package prefixes
        Parameters:
        clsName - the name of the class to check
        Returns:
        whether the class is internal
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object