Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GWTP- 1.x: update to new gin version and jakarta namespace #38

Open
wants to merge 1 commit into
base: gwtp-1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 150 additions & 0 deletions dispatch-rest-delegates/codequality/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://users.tpg.com.au/ojburn/dtds/configuration_1_3.dtd">

<module name="Checker">
<property name="severity" value="error"/>
<property name="localeCountry" value="CA"/>
<property name="localeLanguage" value="en"/>

<module name="LineLength">
<property name="fileExtensions" value="java"/>
<property name="max" value="120"/>
<property name="ignorePattern" value="^(import( static)?|package) [^ ]+$"/>
</module>

<module name="TreeWalker">
<module name="DeclarationOrder"/>
<module name="EqualsHashCode"/>
<module name="ExplicitInitialization"/>
<module name="GenericWhitespace"/>
<module name="MethodParamPad"/>
<module name="MissingOverride"/>
<module name="ModifiedControlVariable"/>
<module name="ParameterAssignment"/>
<module name="ParenPad"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="StringLiteralEquality"/>
<module name="UnnecessaryParentheses"/>
<module name="Indentation">
<property name="basicOffset" value="4" />
<property name="throwsIndent" value="8"/>
<property name="arrayInitIndent" value="8"/>
<property name="lineWrappingIndentation" value="8"/>
</module>
<module name="InterfaceIsType"/>
<module name="RedundantImport"/>
<module name="UnusedImports">
<property name="processJavadoc" value="true"/>
</module>
<module name="IllegalImport"/>
<module name="AvoidStarImport"/>
<module name="ImportOrder">
<property name="option" value="bottom"/>
<property name="ordered" value="true"/>
<property name="separated" value="true"/>
<property name="groups" value="java,javax,org,com"/>
</module>
<module name="JavadocStyle">
<property name="checkHtml" value="false"/>
<property name="tokens" value="CLASS_DEF,CTOR_DEF,INTERFACE_DEF,METHOD_DEF,VARIABLE_DEF"/>
<metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Well formed java docs"/>
</module>
<module name="ParameterName"/>
<module name="LocalFinalVariableName">
<property name="format" value="^(\$|\$?[a-z][a-zA-Z0-9]*)$"/>
</module>
<module name="LocalVariableName">
<property name="tokens" value="VARIABLE_DEF"/>
<property name="format" value="^(\$|\$?[a-z][a-zA-Z0-9]*)$"/>
</module>
<module name="LeftCurly"/>
<module name="RightCurly"/>
<module name="NeedBraces">
<metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="make sure if has braces"/>
</module>
<module name="CovariantEquals"/>
<module name="IllegalInstantiation">
<property name="classes" value="java.lang.Boolean"/>
</module>
<module name="UpperEll">
<metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="checking for 4l rather than 4L"/>
</module>
<module name="DefaultComesLast"/>
<module name="MultipleStringLiterals">
<property name="ignoreStringsRegexp" value=".{0,3}"/>
</module>
<module name="IllegalInstantiation">
<property name="classes" value="Boolean"/>
</module>
<module name="Regexp">
<property name="format" value="[\r]?[\n][ \t]*[\r]?[\n][ \t]*[\r]?[\n][ \t]*"/>
<property name="message" value="more than one blank line"/>
<property name="illegalPattern" value="true"/>
<metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="more than one blank line"/>
</module>
<module name="Regexp">
<property name="format" value="[\r]?[\n][ \t]*[\r]?[\n][ \t]+[}][ ]*[\n]"/>
<property name="message" value="newline before }"/>
<property name="illegalPattern" value="true"/>
<metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="newline before }"/>
</module>
<module name="Regexp">
<property name="format" value="[^*][ \t]+[\r]?[\n]"/>
<property name="message" value="trailing whitespace"/>
<property name="illegalPattern" value="true"/>
<metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="trailing whitespace"/>
</module>
<module name="RedundantModifier"/>
<module name="ModifierOrder"/>
<module name="EmptyStatement"/>
<module name="MethodName"/>
<module name="MemberName">
<property name="format" value="[a-z]|[a-z][a-z_0-9][A-Za-z0-9_]*|[a-z](?&lt;!f)[A-Z0-9]*"/>
</module>
<module name="NoWhitespaceBefore">
<property name="allowLineBreaks" value="true"/>
<property name="tokens" value="DOT"/>
</module>
<module name="NoWhitespaceAfter">
<property name="allowLineBreaks" value="false"/>
<property name="tokens" value="BNOT,DEC,DOT,INC,LNOT,UNARY_MINUS,UNARY_PLUS"/>
</module>
<module name="WhitespaceAround">
<property name="tokens"
value="COLON,NOT_EQUAL,QUESTION,DIV,DIV_ASSIGN,BXOR,BXOR_ASSIGN,MINUS,LCURLY,STAR,STAR_ASSIGN,TYPE_EXTENSION_AND,BAND,LAND,BAND_ASSIGN,MOD,MOD_ASSIGN,PLUS,PLUS_ASSIGN,LT,SL,SL_ASSIGN,LE,ASSIGN,MINUS_ASSIGN,EQUAL,GT,GE,SR,SR_ASSIGN,BSR,BSR_ASSIGN,BOR,BOR_ASSIGN,LOR,LITERAL_ASSERT,LITERAL_ASSERT,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,SLIST,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE"/>
<metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Must have spaces"/>
</module>
<module name="WhitespaceAfter">
<property name="tokens" value="TYPECAST"/>
</module>
<module name="TypecastParenPad">
<property name="tokens" value="RPAREN,TYPECAST"/>
</module>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE_OFF"/>
<property name="onCommentFormat" value="CHECKSTYLE_ON"/>
</module>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE_NAMING_OFF"/>
<property name="onCommentFormat" value="CHECKSTYLE_NAMING_ON"/>
<property name="checkFormat" value=".*Name.*"/>
<property name="messageFormat" value=".*name.*"/>
<metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Avoid name checking"/>
</module>
</module>

<module name="Translation"/>
<module name="NewlineAtEndOfFile">
<property name="lineSeparator" value="lf"/>
</module>
<module name="FileTabCharacter">
<metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="no tabs"/>
</module>
<module name="RegexpSingleline">
<property name="format" value=" [/][/][A-z]"/>
<property name="message" value="// comments must be followed by a space and be on their own line"/>
<metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="bad // comment"/>
</module>
</module>
15 changes: 15 additions & 0 deletions dispatch-rest-delegates/codequality/opensource.java.header
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/\*\*?
\* Copyright \d{4} ArcBees Inc\.
\*
\* Licensed under the Apache License, Version 2\.0 \(the "License"\); you may not
\* use this file except in compliance with the License\. You may obtain a copy of
\* the License at
\*
\* http://www\.apache\.org/licenses/LICENSE-2\.0
\*
\* Unless required by applicable law or agreed to in writing, software
\* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
\* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\. See the
\* License for the specific language governing permissions and limitations under
\* the License\.
\*/
15 changes: 15 additions & 0 deletions dispatch-rest-delegates/codequality/suppressions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://users.tpg.com.au/ojburn/dtds/suppressions_1_1.dtd">

<suppressions>
<!-- Suppress files under target -->
<suppress checks=".*" files=".*[/\\]target[/\\].*"/>

<!-- Suppress method naming under test -->
<suppress checks="MethodName" files=".*[/\\]test[/\\].*"/>

<!-- Suppress files under com/google -->
<suppress checks=".*" files="com[/\\]google[/\\]"/>
</suppressions>
36 changes: 15 additions & 21 deletions dispatch-rest-delegates/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,17 @@
<url>http://arcbees.github.io/GWTP/</url>

<properties>
<gwtp.version>1.6</gwtp.version>
<gwt.version>2.8.0</gwt.version>
<mockito.version>1.10.8</mockito.version>
<junit.version>4.12</junit.version>

<maven-compiler-plugin.version>3.2</maven-compiler-plugin.version>
<maven-checkstyle-plugin.version>2.13</maven-checkstyle-plugin.version>
<checkstyle.version>6.2</checkstyle.version>
<arcbees-checkstyle.version>1.2</arcbees-checkstyle.version>
<maven-javadoc-plugin.version>2.10.3</maven-javadoc-plugin.version>

<target.jdk>1.7</target.jdk>
<gwtp.version>1.7-SNAPSHOT</gwtp.version>
<gwt.version>2.12.1</gwt.version>
<mockito.version>4.11.0</mockito.version>
<junit.version>4.13.2</junit.version>

<maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
<maven-checkstyle-plugin.version>3.6.0</maven-checkstyle-plugin.version>
<checkstyle.version>10.20.1</checkstyle.version>
<maven-javadoc-plugin.version>3.11.1</maven-javadoc-plugin.version>

<target.jdk>11</target.jdk>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
Expand Down Expand Up @@ -66,12 +65,12 @@
<version>${gwtp.version}</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-dev</artifactId>
<version>${gwt.version}</version>
</dependency>
Expand Down Expand Up @@ -127,8 +126,8 @@
<version>${maven-checkstyle-plugin.version}</version>

<configuration>
<configLocation>/checkstyle.xml</configLocation>
<suppressionsLocation>/suppressions.xml</suppressionsLocation>
<configLocation>/codequality/checkstyle.xml</configLocation>
<suppressionsLocation>/codequality/suppressions.xml</suppressionsLocation>
<propertyExpansion>basedir=${basedir}</propertyExpansion>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
Expand All @@ -142,11 +141,6 @@
<artifactId>checkstyle</artifactId>
<version>${checkstyle.version}</version>
</dependency>
<dependency>
<groupId>com.arcbees</groupId>
<artifactId>checkstyle</artifactId>
<version>${arcbees-checkstyle.version}</version>
</dependency>
</dependencies>

<executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,35 @@
* interface and {@link com.gwtplatform.dispatch.rest.client.RestDispatch} to simplify your code. Note that if your
* resource interfaces don't return {@link com.gwtplatform.dispatch.rest.shared.RestAction RestAction&lt;?&gt;}s but the
* result type directly, you will need to inject a {@link ResourceDelegate} to use your resource.
* <p/>
* <p>
* This delegate will not send the HTTP request until you call a method, that is not a sub-resource, from the underlying
* resource. The underlying resource is returned when either {@link #withoutCallback()} or {@link
* #withCallback(AsyncCallback)} are called.
* <p/>
* <p>
* The following example shows how to retrieve the {@link DispatchRequest} and delete a potential car:
* <pre><code>
* {@literal @}Path("/cars")
* public interface CarsResource {
* CarResource car(int id);
* }
* <p/>
*
* public interface CarResource {
* {@literal @}DELETE
* void delete();
* }
* <p/>
*
* public class CarPresenter {
* private final ResourceDelegate&lt;CarsResource&gt; carsResourceDelegate;
* <p/>
*
* {@literal @}Inject
* CarPresenter(ResourceDelegate&lt;CarsResource&gt; carsResourceDelegate) {
* this.carsResourceDelegate = carsResourceDelegate;
* }
* <p/>
*
* {@literal @}Override
* public void onReveal() {
* DelegatingDispatchRequest dispatchRequest = new DelegatingDispatchRequest();
* <p/>
*
* carsResourceDelegate
* .withDelegatingDispatchRequest(dispatchRequest)
* .withCallback(new AsyncCallback&lt;Void&gt;() {/{@literal * snip *}/});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import java.util.Collection;
import java.util.List;

import javax.inject.Inject;

import com.google.gwt.core.ext.GeneratorContext;
import com.google.gwt.core.ext.UnableToCompleteException;
import com.gwtplatform.dispatch.rest.rebind.AbstractGenerator;
Expand All @@ -34,6 +32,8 @@
import com.gwtplatform.dispatch.rest.rebind.utils.ClassDefinition;
import com.gwtplatform.dispatch.rest.rebind.utils.Logger;

import jakarta.inject.Inject;

public class DelegateExtensionGenerator extends AbstractGenerator implements ExtensionGenerator {
private final DelegateGenerator delegateGenerator;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.util.Set;
import java.util.TreeSet;

import javax.inject.Inject;
import javax.ws.rs.Path;

import org.apache.velocity.app.VelocityEngine;
Expand All @@ -45,6 +44,8 @@
import com.gwtplatform.dispatch.rest.rebind.utils.Logger;
import com.gwtplatform.dispatch.rest.shared.RestAction;

import jakarta.inject.Inject;

import static com.gwtplatform.dispatch.rest.rebind.utils.Generators.findGenerator;

public class DelegateGenerator extends AbstractVelocityGenerator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import java.util.Map;
import java.util.Set;

import javax.inject.Inject;

import org.apache.velocity.app.VelocityEngine;

import com.google.gwt.core.ext.GeneratorContext;
Expand All @@ -40,6 +38,8 @@
import com.gwtplatform.dispatch.rest.rebind.utils.Logger;
import com.gwtplatform.dispatch.rest.shared.RestAction;

import jakarta.inject.Inject;

import static com.gwtplatform.dispatch.rest.rebind.utils.JPrimitives.classTypeOrConvertToBoxed;

public class DelegateMethodGenerator extends ActionMethodGenerator {
Expand Down Expand Up @@ -146,7 +146,7 @@ private boolean hasValidReturnType() {
JClassType classType = returnType.isClassOrInterface();
JPrimitiveType primitiveType = returnType.isPrimitive();

return (classType != null && restActionType != null && !classType.isAssignableTo(restActionType))
return classType != null && restActionType != null && !classType.isAssignableTo(restActionType)
|| primitiveType != null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package com.gwtplatform.dispatch.rest.delegates.rebind;

import javax.inject.Singleton;

import com.google.inject.AbstractModule;

import jakarta.inject.Singleton;

import static com.gwtplatform.dispatch.rest.rebind.extension.ExtensionModule.addExtensionGenerator;
import static com.gwtplatform.dispatch.rest.rebind.resource.ResourceModule.addMethodGenerator;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import java.util.List;
import java.util.Map;

import javax.inject.Inject;

import org.apache.velocity.app.VelocityEngine;

import com.google.gwt.core.ext.GeneratorContext;
Expand All @@ -34,6 +32,8 @@
import com.gwtplatform.dispatch.rest.rebind.resource.MethodDefinition;
import com.gwtplatform.dispatch.rest.rebind.utils.Logger;

import jakarta.inject.Inject;

public class DelegatedActionMethodGenerator extends AbstractDelegatedMethodGenerator {
private static final String TEMPLATE = "com/gwtplatform/dispatch/rest/delegates/rebind/DelegatedActionMethod.vm";
private static final String DEFAULT_ACTION_VARIABLE_NAME = "action";
Expand Down
Loading