Skip to content

Commit

Permalink
Change the package name from javax.validation to jakarta.validation
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmet committed Feb 3, 2020
1 parent ff162d1 commit a5e6c18
Show file tree
Hide file tree
Showing 110 changed files with 398 additions and 358 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
<configuration>
<instructions>
<Export-Package>
javax.validation.*;version="${project.version}",
jakarta.validation.*;version="${project.version}",
</Export-Package>
<Automatic-Module-Name>java.validation</Automatic-Module-Name>
</instructions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

import java.util.Map;
import java.util.Set;

import javax.validation.executable.ExecutableType;
import javax.validation.executable.ValidateOnExecution;
import javax.validation.spi.ValidationProvider;
import javax.validation.valueextraction.ValueExtractor;
import jakarta.validation.executable.ExecutableType;
import jakarta.validation.executable.ValidateOnExecution;
import jakarta.validation.spi.ValidationProvider;
import jakarta.validation.valueextraction.ValueExtractor;

/**
* Represents the user specified default configuration in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

import java.time.Clock;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

import java.io.InputStream;

import javax.validation.spi.ValidationProvider;
import javax.validation.valueextraction.ValueExtractor;
import javax.validation.valueextraction.ValueExtractorDeclarationException;
import jakarta.validation.spi.ValidationProvider;
import jakarta.validation.valueextraction.ValueExtractor;
import jakarta.validation.valueextraction.ValueExtractorDeclarationException;

/**
* Receives configuration information, selects the appropriate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
Expand All @@ -13,8 +13,8 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import javax.validation.constraintvalidation.SupportedValidationTarget;
import javax.validation.constraintvalidation.ValidationTarget;
import jakarta.validation.constraintvalidation.SupportedValidationTarget;
import jakarta.validation.constraintvalidation.ValidationTarget;

/**
* Marks an annotation as being a Jakarta Bean Validation constraint.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

/**
* Exception raised if a constraint declaration is not legal.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

/**
* Exception raised if a constraint definition is not legal.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

/**
* Defines the constraint target.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

import java.lang.annotation.Annotation;

import javax.validation.constraintvalidation.SupportedValidationTarget;
import jakarta.validation.constraintvalidation.SupportedValidationTarget;

/**
* Defines the logic to validate a given constraint {@code A}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

import java.time.Clock;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

/**
* Instantiates a {@link ConstraintValidator} instance based off its class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

import javax.validation.metadata.ConstraintDescriptor;
import jakarta.validation.metadata.ConstraintDescriptor;

/**
* Describes a constraint violation. This object exposes the constraint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

import java.util.HashSet;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

/**
* Enum of possible kinds of elements encountered in Jakarta Bean Validation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

/**
* Exception raised if a group definition is not legal.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
Expand All @@ -13,7 +13,7 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import javax.validation.groups.Default;
import jakarta.validation.groups.Default;

/**
* Defines group sequence.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

import java.util.Locale;

import javax.validation.metadata.ConstraintDescriptor;
import jakarta.validation.metadata.ConstraintDescriptor;

/**
* Interpolates a given constraint violation message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

/**
* Exception raised if no Jakarta Bean Validation provider could be found.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
Expand All @@ -15,7 +15,7 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import javax.validation.OverridesAttribute.List;
import jakarta.validation.OverridesAttribute.List;

/**
* Marks an attribute as overriding the attribute of a composing constraint.
Expand Down Expand Up @@ -59,7 +59,7 @@
/**
* Defines several {@link OverridesAttribute} annotations on the same element
*
* @see javax.validation.OverridesAttribute
* @see jakarta.validation.OverridesAttribute
*/
@Documented
@Target({ METHOD })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

import java.util.List;

import javax.validation.valueextraction.ValueExtractor;
import jakarta.validation.valueextraction.ValueExtractor;

/**
* Represents the navigation path from an object to another
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

import javax.validation.valueextraction.Unwrapping;
import jakarta.validation.valueextraction.Unwrapping;

/**
* Payload type that can be attached to a given
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

import java.lang.annotation.ElementType;
import static jakarta.validation.Path.*;

import static javax.validation.Path.*;
import java.lang.annotation.ElementType;

/**
* Contract determining if a property can be accessed by the Jakarta Bean Validation provider.
Expand Down Expand Up @@ -46,7 +46,7 @@ boolean isReachable(Object traversableObject,
* marked as {@code @Valid}.
* <p>
* Note that this method is called only if
* {@link #isReachable(Object, javax.validation.Path.Node, Class, Path, java.lang.annotation.ElementType)}
* {@link #isReachable(Object, jakarta.validation.Path.Node, Class, Path, java.lang.annotation.ElementType)}
* returns {@code true} for the same set of arguments and if the property
* is marked as {@link Valid}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

/**
* Exception raised in the case that the constraint validator resolution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

import java.lang.ref.SoftReference;
import java.security.AccessController;
Expand All @@ -16,10 +16,10 @@
import java.util.ServiceLoader;
import java.util.WeakHashMap;

import javax.validation.bootstrap.GenericBootstrap;
import javax.validation.bootstrap.ProviderSpecificBootstrap;
import javax.validation.spi.BootstrapState;
import javax.validation.spi.ValidationProvider;
import jakarta.validation.bootstrap.GenericBootstrap;
import jakarta.validation.bootstrap.ProviderSpecificBootstrap;
import jakarta.validation.spi.BootstrapState;
import jakarta.validation.spi.ValidationProvider;

/**
* This class is the entry point for Jakarta Bean Validation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

/**
* Base exception of all Jakarta Bean Validation "unexpected" problems.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package javax.validation;
package jakarta.validation;

import java.util.List;

import javax.validation.spi.ValidationProvider;
import jakarta.validation.spi.ValidationProvider;

/**
* Determines the list of Jakarta Bean Validation providers available in the runtime environment
* <p>
* Jakarta Bean Validation providers are identified by the presence of
* {@code META-INF/services/javax.validation.spi.ValidationProvider}
* {@code META-INF/services/jakarta.validation.spi.ValidationProvider}
* files following the Service Provider pattern described
* <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html#Service_Provider">here</a>.
* <p>
* Each {@code META-INF/services/javax.validation.spi.ValidationProvider} file contains the
* Each {@code META-INF/services/jakarta.validation.spi.ValidationProvider} file contains the
* list of {@link ValidationProvider} implementations each of them representing a provider.
* <p>
* Implementations must be thread-safe.
Expand Down

4 comments on commit a5e6c18

@bdus
Copy link

@bdus bdus commented on a5e6c18 Sep 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming was a bad choice.

@gsmet
Copy link
Contributor Author

@gsmet gsmet commented on a5e6c18 Sep 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bdus it's not a choice. We had to rename all packages because Oracle didn't allow the Jakarta project to use the javax. root package.

And trust me, I know how painful it was given I'm working on the whole migration for the Quarkus project. I recommend using the Jakarta Eclipse Transformer to automate the migration.

@bdus
Copy link

@bdus bdus commented on a5e6c18 Sep 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gsmet
It turned out not to be a technical reason. Appreciate your advice.

@gsmet
Copy link
Contributor Author

@gsmet gsmet commented on a5e6c18 Sep 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bdus also be careful: you don't have to upgrade unless the rest of your stack has upgraded to Jakarta EE 9 or 10. Hibernate Validator 6.2 is still maintained and has all the features of the others.

Please sign in to comment.