Skip to content

jee9#32

Open
thiagotognoli wants to merge 3 commits intoteiid:1.1.xfrom
thiagotognoli:1.1.x
Open

jee9#32
thiagotognoli wants to merge 3 commits intoteiid:1.1.xfrom
thiagotognoli:1.1.x

Conversation

@thiagotognoli
Copy link

No description provided.

Copilot AI review requested due to automatic review settings August 2, 2025 02:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates the odata4j project from Java EE to Jakarta EE 9 by updating all JAX-RS and servlet dependencies and configurations. The migration addresses compatibility requirements for modern Java enterprise environments by transitioning from the javax.* namespace to jakarta.*.

Key changes include:

  • Updated all JAX-RS imports from javax.ws.rs to jakarta.ws.rs
  • Migrated servlet imports from javax.servlet to jakarta.servlet
  • Upgraded Jersey from version 1.1.5 to 3.1.3
  • Updated Jetty, CXF, and other framework dependencies to Jakarta EE compatible versions
  • Modernized Java version from 1.6 to 1.8

Reviewed Changes

Copilot reviewed 122 out of 122 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
Multiple test files Updated imports to use jakarta namespace and modernized test infrastructure
Jersey integration files Completely refactored Jersey client/server code for v3.x compatibility
Core producer resources Updated all JAX-RS annotations and imports to jakarta namespace
pom.xml Updated dependency versions and Java target version
Multiple config files Updated servlet and JAX-RS application configurations

import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.fail;
Copy link

Copilot AI Aug 2, 2025

Choose a reason for hiding this comment

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

Duplicate import of fail method. Line 6 imports from JUnit Jupiter while line 7 imports from JUnit 4 matchers. This will cause a compilation error due to conflicting imports.

Suggested change
import static org.junit.jupiter.api.Assertions.fail;

Copilot uses AI. Check for mistakes.
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.matchers.JUnitMatchers.containsString;
Copy link

Copilot AI Aug 2, 2025

Choose a reason for hiding this comment

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

The import org.junit.matchers.JUnitMatchers.containsString is deprecated. This should be replaced with org.hamcrest.Matchers.containsString for modern JUnit versions.

Suggested change
import static org.junit.matchers.JUnitMatchers.containsString;
import static org.hamcrest.Matchers.containsString;

Copilot uses AI. Check for mistakes.
try {
unauthorizedConsumer.getEntities("Persons").execute();
fail();
Assert.fail();
Copy link

Copilot AI Aug 2, 2025

Choose a reason for hiding this comment

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

Using Assert.fail() when fail() is already imported. This is inconsistent with the static import on line 5 and should use the imported method instead.

Suggested change
Assert.fail();
fail();

Copilot uses AI. Check for mistakes.
ContentExchange exchange = sendRequest(BASE_URI);
exchange.waitForDone();
ContentResponse response = sendRequest(BASE_URI);
// exchange.waitForDone();
Copy link

Copilot AI Aug 2, 2025

Choose a reason for hiding this comment

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

Dead code comment should be removed. The commented line refers to old Jetty API that is no longer needed in the updated implementation.

Suggested change
// exchange.waitForDone();

Copilot uses AI. Check for mistakes.
} catch (IllegalAccessException e) {
throw Throwables.propagate(e);
}
// try {
Copy link

Copilot AI Aug 2, 2025

Choose a reason for hiding this comment

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

Large block of commented-out code (lines 146-181) should be removed rather than left as comments. This appears to be old implementation code that has been replaced.

Copilot uses AI. Check for mistakes.
return entity;
}

// /**
Copy link

Copilot AI Aug 2, 2025

Choose a reason for hiding this comment

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

Large block of commented-out code (lines 104-241) for batch request handling should be removed if not needed, or completed if this functionality is required.

Copilot uses AI. Check for mistakes.
Comment on lines 3 to 10
import org.glassfish.jersey.client.JerseyClient;
import org.glassfish.jersey.client.JerseyClientBuilder;

import jakarta.ws.rs.client.Client;
import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.client.JerseyClient;
import org.glassfish.jersey.client.JerseyClientBuilder;

Copy link

Copilot AI Aug 2, 2025

Choose a reason for hiding this comment

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

Duplicate imports: JerseyClient and JerseyClientBuilder are imported twice (lines 3-4 and 8-9). Remove the duplicate imports on lines 3-4.

Suggested change
import org.glassfish.jersey.client.JerseyClient;
import org.glassfish.jersey.client.JerseyClientBuilder;
import jakarta.ws.rs.client.Client;
import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.client.JerseyClient;
import org.glassfish.jersey.client.JerseyClientBuilder;
import jakarta.ws.rs.client.Client;
import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.client.JerseyClient;
import org.glassfish.jersey.client.JerseyClientBuilder;

Copilot uses AI. Check for mistakes.
Comment on lines +9 to 11
import junit.framework.Assert;

import org.joda.time.LocalDateTime;
Copy link

Copilot AI Aug 2, 2025

Choose a reason for hiding this comment

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

Using deprecated JUnit 3 Assert class. Should use org.junit.Assert instead of junit.framework.Assert for consistency with modern JUnit practices.

Suggested change
import junit.framework.Assert;
import org.joda.time.LocalDateTime;
import org.junit.Assert;
import org.joda.time.LocalDateTime;

Copilot uses AI. Check for mistakes.
thiagotognoli added 2 commits August 1, 2025 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant