Skip to content

Commit

Permalink
Merge pull request #553 from microsoft/jakarta_annotations
Browse files Browse the repository at this point in the history
Jakarta Annotations
  • Loading branch information
ramsessanchez authored Aug 14, 2023
2 parents b4e8eed + bfa58ad commit 4da7ad9
Show file tree
Hide file tree
Showing 108 changed files with 171 additions and 152 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

## [0.6.0] - 2023-08-08

### Changed

- Javax annotations replaced in favor of Jakarta annotations.

## [0.5.0] - 2023-07-26

### Added
Expand Down
1 change: 0 additions & 1 deletion components/abstractions/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
// Apply the java-library plugin to add support for Java Library
id 'java-library'
id 'java'
id 'eclipse'
id 'maven-publish'
id 'signing'
Expand Down
2 changes: 1 addition & 1 deletion components/abstractions/gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies {
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:32.1.2-jre'
implementation 'org.javatuples:javatuples:1.2'
implementation 'javax.annotation:javax.annotation-api:1.3.2'
implementation 'io.opentelemetry:opentelemetry-api:1.29.0'
implementation 'io.opentelemetry:opentelemetry-context:1.29.0'
implementation 'jakarta.annotation:jakarta.annotation-api:2.1.1'
}
8 changes: 8 additions & 0 deletions components/abstractions/spotBugsExcludeFilter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,12 @@ xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubu
<Class name="com.microsoft.kiota.UriTemplate$UriTemplateParser" />
<Bug pattern="SF_SWITCH_FALLTHROUGH" />
</Match>
<Match>
<Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
<Or>
<Class name="com.microsoft.kiota.BaseRequestBuilder" />
<Class name="com.microsoft.kiota.BaseRequestConfiguration" />
<Class name="com.microsoft.kiota.RequestInformation" />
</Or>
</Match>
</FindBugsFilter>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import java.util.Objects;

import javax.annotation.Nonnull;
import jakarta.annotation.Nonnull;

/** Provides a builder for creating an ApiClient and register the default serializers/deserializers. */
public class ApiClientBuilder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.Objects;

import javax.annotation.Nonnull;
import jakarta.annotation.Nonnull;

/** Parent type for exceptions thrown by the client when receiving failed responses to its requests. */
public class ApiException extends Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.HashMap;
import java.util.Objects;

import javax.annotation.Nonnull;
import jakarta.annotation.Nonnull;

/** Base class for request builders */
public abstract class BaseRequestBuilder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.Collections;

import javax.annotation.Nullable;
import jakarta.annotation.Nullable;

/** Base class for request configuration */
public abstract class BaseRequestConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import java.util.Objects;
import java.util.Set;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;

class CaseInsensitiveMap implements Map<String, Set<String>>{
private final HashMap<String, HashSet<String>> internalMap = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.Objects;
import java.util.Set;

import javax.annotation.Nonnull;
import jakarta.annotation.Nonnull;

class Headers extends CaseInsensitiveMap {
/** Default constructor */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import java.util.UUID;
import java.util.function.Consumer;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;

import com.google.common.base.Strings;
import com.microsoft.kiota.serialization.Parsable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import java.util.Map;
import java.util.concurrent.CompletableFuture;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;

import com.microsoft.kiota.serialization.Parsable;
import com.microsoft.kiota.serialization.ParsableFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.microsoft.kiota;

import javax.annotation.Nonnull;
import javax.annotation.concurrent.Immutable;
import jakarta.annotation.Nonnull;
import java.io.Serializable;
import java.time.Duration;
import java.time.Period;
Expand All @@ -28,7 +27,6 @@
/**
* The aggregate type for {@code Period} and {@code Duration }
*/
@Immutable
public final class PeriodAndDuration implements TemporalAmount, Comparable<PeriodAndDuration>, Serializable {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import java.util.HashMap;
import java.util.List;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;

import com.microsoft.kiota.serialization.Parsable;
import com.microsoft.kiota.serialization.ParsableFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.microsoft.kiota;

import javax.annotation.Nonnull;
import jakarta.annotation.Nonnull;

/**
* A class representing the headers of a request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import java.time.OffsetDateTime;


import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;

import com.microsoft.kiota.serialization.Parsable;
import com.microsoft.kiota.serialization.SerializationWriter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.microsoft.kiota;

import javax.annotation.Nonnull;
import jakarta.annotation.Nonnull;

/** Represents a request option. */
public interface RequestOption {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import java.util.HashMap;
import java.util.concurrent.CompletableFuture;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;

import com.microsoft.kiota.serialization.Parsable;
import com.microsoft.kiota.serialization.ParsableFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.microsoft.kiota;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;

/** Request option that can be used to provide a callback and handle the raw response */
public class ResponseHandlerOption implements RequestOption {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.microsoft.kiota;

import javax.annotation.Nonnull;
import jakarta.annotation.Nonnull;

/**
* A class representing the headers of a request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import java.util.Map;
import java.util.concurrent.CompletableFuture;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;

/** Returns access tokens */
public interface AccessTokenProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.util.Locale;
import java.util.Set;

import javax.annotation.Nonnull;
import jakarta.annotation.Nonnull;

/** Maintains a list of valid hosts and allows authentication providers to check whether a host is valid before authenticating a request */
public class AllowedHostsValidator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import java.util.Map;
import java.util.concurrent.CompletableFuture;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;

/** This authentication provider does not perform any authentication. */
public class AnonymousAuthenticationProvider implements AuthenticationProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import java.util.Objects;
import java.util.concurrent.CompletableFuture;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;

import com.microsoft.kiota.RequestInformation;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import java.util.Map;
import java.util.concurrent.CompletableFuture;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;

/** Authenticates the application request. */
public interface AuthenticationProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import java.util.Map;
import java.util.Objects;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;

/** Provides a base class for implementing AuthenticationProvider for Bearer token scheme. */
public class BaseBearerTokenAuthenticationProvider implements AuthenticationProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.Map;

import javax.annotation.Nonnull;
import jakarta.annotation.Nonnull;

/** Defines a contract for models that can hold additional data besides the described properties. */
public interface AdditionalDataHolder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.Map;
import java.util.function.Consumer;

import javax.annotation.Nonnull;
import jakarta.annotation.Nonnull;
/**
* Defines a serializable model object.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.microsoft.kiota.serialization;

import javax.annotation.Nonnull;
import jakarta.annotation.Nonnull;

/**
* Defines the factory for creating parsable objects.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import java.util.UUID;
import java.util.function.Consumer;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;

/**
* Interface for a deserialization node in a parse tree. This interface provides an abstraction layer over serialization formats, libraries and implementations.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.io.InputStream;

import javax.annotation.Nonnull;
import jakarta.annotation.Nonnull;

/**
* Defines the contract for a factory that is used to create {@link ParseNode}s.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.util.Objects;
import java.util.regex.Pattern;

import javax.annotation.Nonnull;
import jakarta.annotation.Nonnull;

/**
* This factory holds a list of all the registered factories for the various types of nodes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.util.Map.Entry;
import java.util.function.Consumer;

import javax.annotation.Nonnull;
import jakarta.annotation.Nonnull;

/** Utility methods to reduce the amount of code being generated. */
public class ParseNodeHelper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import java.io.InputStream;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;

/** Proxy factory that allows the composition of before and after callbacks on existing factories. */
public abstract class ParseNodeProxyFactory implements ParseNodeFactory {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import java.util.function.Consumer;
import java.util.function.BiConsumer;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;

/** Defines an interface for serialization of objects to a stream. */
public interface SerializationWriter extends Closeable {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.microsoft.kiota.serialization;

import javax.annotation.Nonnull;
import jakarta.annotation.Nonnull;
/** Defines the contract for a factory that creates SerializationWriter instances. */
public interface SerializationWriterFactory {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.Objects;
import java.util.regex.Pattern;

import javax.annotation.Nonnull;
import jakarta.annotation.Nonnull;
/** This factory holds a list of all the registered factories for the various types of nodes. */
public class SerializationWriterFactoryRegistry implements SerializationWriterFactory {
/** Default constructor for the registry. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import java.util.function.BiConsumer;
import java.util.Objects;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;

/** Proxy factory that allows the composition of before and after callbacks on existing factories. */
public abstract class SerializationWriterProxyFactory implements SerializationWriterFactory {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.microsoft.kiota.serialization;

import javax.annotation.Nonnull;
import jakarta.annotation.Nonnull;

/** The interface for the valued enum. */
public interface ValuedEnum {
Expand Down
Loading

0 comments on commit 4da7ad9

Please sign in to comment.