Reserved Package Prefix
ID |
java.naming_reserved_package |
Severity |
low |
Remediation Complexity |
trivial |
Remediation Risk |
medium |
Remediation Effort |
low |
Resource |
Naming Convention |
Language |
Java |
Tags |
naming |
Description
Reports package declarations whose name starts with the reserved prefixes java. or javax..
Rationale
The java and javax package prefixes are reserved by the JDK specification. User code that uses these prefixes may trigger security-manager restrictions, fail at class loading when the JVM enforces sealed packages, and confuse readers about whether the code is part of the standard library or a third-party addition.
// Bad
package java.custom.util;
package javax.myapp.service;
// Good
package com.example.util;
package org.myapp.service;