Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This compliant solution combines all privileged code into the same package and reduces the accessibility of the getValue() method to package-private. Sealing the package is necessary to prevent attackers from inserting any rogue classes.

Code Block
bgColor#ccccff
package trusted;

public class MixMatch {
  // ...
}

package trusted;

class RetValue {
  int getValue() {
   // ... return 1;
  }
}

To seal a package, use the sealed attribute in the manifest file header. This is shown below.

...