Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8003671

[findbugs] sun.management.AgentConfigurationError.getParams() may expose internal representation by returning AgentConfigurationError.params

XMLWordPrintable

      The array which returns should be copied as it done in constructor. It is not easy to predict who could catch this exception and rethrow it (or updated version).

       P2 Found by Findbugs: sun.management.AgentConfigurationError.getParams() may expose internal representation by returning AgentConfigurationError.params. Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object. If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations.. In class sun.management.AgentConfigurationError; In method getParams()[Ljava/lang/String;; Field params; At AgentConfigurationError.java:[line 151]

            sla Staffan Larsen (Inactive)
            lmesnik Leonid Mesnik
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: