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

fix compilation warning and javadoc warnings #343

Merged
merged 1 commit into from
Aug 28, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,29 @@ public FluentMethodInfo(JMethod jmethod, FluentMethodType fluentMethodType, bool
this.isOverride = isOverride;
}

/** Creates a fluent API method in the given class. */
/**
* Creates a fluent API method in the given class.
*
* @param implClass the class to create fluent-api
*/
public void createFluentMethod(JDefinedClass implClass) {
fluentMethodType.createFluentMethod(implClass, this);
}

/** Returns true if the fluent API method is one overriding a parent method. */
/**
* Returns true if the fluent API method is one overriding a parent method.
*
* @return <code>true</code> if fluent api method is one overriding a parent method
*/
public boolean isOverride() {
return isOverride;
}

/** Returns the original method for which a fluent API method will be generated. */
/**
* Returns the original method for which a fluent API method will be generated.
*
* @return original JMethod for which a fluent-api method will be generated
*/
public JMethod getJmethod() {
return jmethod;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ public boolean run(final Outline outline, final Options options, final ErrorHand
/**
* Takes a collection of fields, and returns a new collection containing only the instance
* (i.e. non-static) fields.
*
* @param fields fields to get non-static fields
* @return new List containing only non-static fields
*/
protected Collection<JFieldVar> getInstanceFields(final Collection<JFieldVar> fields) {
final List<JFieldVar> instanceFields = new ArrayList<JFieldVar>();
Expand All @@ -129,6 +132,9 @@ protected Collection<JFieldVar> getInstanceFields(final Collection<JFieldVar> fi

/**
* Whether or not to generate a constructor parameter for the given field.
*
* @param field field to test
* @return <code>true</code> if we need to generate a constructor for the given field
*/
protected boolean generateConstructorParameter(final JFieldVar field) {
final boolean isStaticField = (field.mods().getValue() & JMod.STATIC) > 0;
Expand All @@ -138,6 +144,9 @@ protected boolean generateConstructorParameter(final JFieldVar field) {
/**
* Retrieve a List of the fields of each ancestor class. I walk up the class hierarchy
* until I reach a class that isn't being generated by JAXB.
*
* @param implClass the class to get fields from
* @return List of fields in each ancestor class
*/
protected List<JFieldVar> getSuperclassFields(final JDefinedClass implClass) {
final List<JFieldVar> fieldList = new LinkedList<JFieldVar>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import org.jvnet.jaxb.maven.AbstractXJC2Mojo;
import org.jvnet.jaxb.maven.test.RunXJC2Mojo;

import com.sun.tools.xjc.Options;

public class RunCopyablePlugin extends RunXJC2Mojo {

@Override
Expand All @@ -15,7 +17,7 @@ public File getSchemaDirectory() {
}

@Override
protected void configureMojo(AbstractXJC2Mojo mojo) {
protected void configureMojo(AbstractXJC2Mojo<Options> mojo) {
super.configureMojo(mojo);
mojo.setForceRegenerate(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import org.jvnet.jaxb.maven.AbstractXJC2Mojo;
import org.jvnet.jaxb.maven.test.RunXJC2Mojo;

import com.sun.tools.xjc.Options;

public class RunEqualsPlugin extends RunXJC2Mojo {

@Override
Expand All @@ -15,7 +17,7 @@ public File getSchemaDirectory() {
}

@Override
protected void configureMojo(AbstractXJC2Mojo mojo) {
protected void configureMojo(AbstractXJC2Mojo<Options> mojo) {
super.configureMojo(mojo);
mojo.setForceRegenerate(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import org.jvnet.jaxb.maven.AbstractXJC2Mojo;
import org.jvnet.jaxb.maven.test.RunXJC2Mojo;

import com.sun.tools.xjc.Options;

public class RunMergeablePlugin extends RunXJC2Mojo {

@Override
Expand All @@ -15,7 +17,7 @@ public File getSchemaDirectory() {
}

@Override
protected void configureMojo(AbstractXJC2Mojo mojo) {
protected void configureMojo(AbstractXJC2Mojo<Options> mojo) {
super.configureMojo(mojo);
mojo.setForceRegenerate(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import org.jvnet.jaxb.maven.test.RunXJC2Mojo;
import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;

import com.sun.tools.xjc.Options;

public class RunToStringPlugin extends RunXJC2Mojo {

@Override
Expand All @@ -16,14 +18,14 @@ public File getSchemaDirectory() {
}

@Override
protected void configureMojo(AbstractXJC2Mojo mojo) {
protected void configureMojo(AbstractXJC2Mojo<Options> mojo) {
super.configureMojo(mojo);
mojo.setForceRegenerate(true);
}

@Override
public List<String> getArgs() {
final List<String> args = new ArrayList<String>(super.getArgs());
final List<String> args = new ArrayList<>(super.getArgs());
args.add("-XtoString");
args.add("-XtoString-toStringStrategy="
+ JAXBToStringStrategy.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import javax.xml.transform.dom.DOMSource;

import org.custommonkey.xmlunit.Diff;
import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.w3c.dom.Node;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.jvnet.jaxb2_commons.xml.bind.model.MAttributePropertyInfo;
import org.jvnet.jaxb2_commons.xml.bind.model.MClassInfo;
import org.jvnet.jaxb2_commons.xml.bind.model.MElementPropertyInfo;
import org.jvnet.jaxb2_commons.xml.bind.model.MElementRefPropertyInfo;
import org.jvnet.jaxb2_commons.xml.bind.model.MElementRefsPropertyInfo;
import org.jvnet.jaxb2_commons.xml.bind.model.MElementsPropertyInfo;
import org.jvnet.jaxb2_commons.xml.bind.model.MModelInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
import org.jvnet.jaxb.maven.AbstractXJC2Mojo;
import org.jvnet.jaxb.maven.test.RunXJC2Mojo;

import com.sun.tools.xjc.Options;

public class RunIssuesPlugin extends RunXJC2Mojo {

@Override
protected void configureMojo(AbstractXJC2Mojo mojo) {
protected void configureMojo(AbstractXJC2Mojo<Options> mojo) {
super.configureMojo(mojo);
mojo.setExtension(true);
mojo.setForceRegenerate(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
import org.jvnet.jaxb.maven.AbstractXJC2Mojo;
import org.jvnet.jaxb.maven.test.RunXJC2Mojo;

import com.sun.tools.xjc.Options;

public class RunNamespacePlugin extends RunXJC2Mojo {

@Override
protected void configureMojo(AbstractXJC2Mojo mojo) {
protected void configureMojo(AbstractXJC2Mojo<Options> mojo) {
super.configureMojo(mojo);
mojo.setExtension(true);
mojo.setForceRegenerate(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
import org.jvnet.jaxb.maven.AbstractXJC2Mojo;
import org.jvnet.jaxb.maven.test.RunXJC2Mojo;

import com.sun.tools.xjc.Options;

public class RunOnePlugin extends RunXJC2Mojo {

@Override
protected void configureMojo(AbstractXJC2Mojo mojo) {
protected void configureMojo(AbstractXJC2Mojo<Options> mojo) {
super.configureMojo(mojo);
mojo.setExtension(true);
mojo.setForceRegenerate(true);
Expand All @@ -18,7 +20,7 @@ protected void configureMojo(AbstractXJC2Mojo mojo) {

@Override
public List<String> getArgs() {
final List<String> args = new ArrayList<String>(super.getArgs());
final List<String> args = new ArrayList<>(super.getArgs());
args.add("-XtoString");
args.add("-Xequals");
args.add("-XhashCode");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.jvnet.jaxb2_commons.reflection.util.test;

import java.net.URI;
import java.net.URISyntaxException;

import org.junit.Assert;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void testIssueJAP9TypeBField() throws NoSuchFieldException {

@Test
public void testIssueJAP9TypeCField() throws NoSuchFieldException {
String valueInXsd = "EscapedQuote\"/Here";
String valueInXsd = "NoEscapedBackSlashes\"/Here";
IssueJAP9Type type = new IssueJAP9Type();
XmlMimeType ann = type.getClass().getDeclaredField("c").getAnnotation(XmlMimeType.class);
Assert.assertEquals(valueInXsd, ann.value());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,20 @@
import org.jvnet.jaxb.maven.AbstractXJC2Mojo;
import org.jvnet.jaxb.maven.test.RunXJC2Mojo;

import com.sun.tools.xjc.Options;

public class RunAnnotatePlugin extends RunXJC2Mojo {

@Override
protected void configureMojo(AbstractXJC2Mojo mojo) {
protected void configureMojo(AbstractXJC2Mojo<Options> mojo) {
super.configureMojo(mojo);
mojo.setExtension(true);
mojo.setForceRegenerate(true);
}

@Override
public List<String> getArgs() {
final List<String> args = new ArrayList<String>(super.getArgs());
final List<String> args = new ArrayList<>(super.getArgs());
args.add("-Xannotate");
return args;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@
import org.jvnet.jaxb.maven.AbstractXJC2Mojo;
import org.jvnet.jaxb.maven.test.RunXJC2Mojo;

import com.sun.tools.xjc.Options;

public class RunIssuesPlugin extends RunXJC2Mojo {

@Override
protected void configureMojo(AbstractXJC2Mojo mojo) {
protected void configureMojo(AbstractXJC2Mojo<Options> mojo) {
super.configureMojo(mojo);
mojo.setExtension(true);
mojo.setForceRegenerate(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@
import org.jvnet.jaxb.maven.AbstractXJC2Mojo;
import org.jvnet.jaxb.maven.test.RunXJC2Mojo;

import com.sun.tools.xjc.Options;

public class RunOnePlugin extends RunXJC2Mojo {

@Override
protected void configureMojo(AbstractXJC2Mojo mojo) {
protected void configureMojo(AbstractXJC2Mojo<Options> mojo) {
super.configureMojo(mojo);
mojo.setExtension(true);
mojo.setForceRegenerate(true);
Expand All @@ -46,7 +48,7 @@ protected void configureMojo(AbstractXJC2Mojo mojo) {

@Override
public List<String> getArgs() {
final List<String> args = new ArrayList<String>(super.getArgs());
final List<String> args = new ArrayList<>(super.getArgs());
args.add("-XtoString");
args.add("-Xequals");
args.add("-XhashCode");
Expand Down
2 changes: 1 addition & 1 deletion jaxb-annox-parent/jaxb-annox/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Manifest-Version: 1.0
Bnd-LastModified: 1692905945319
Bnd-LastModified: 1693257226836
Build-Jdk: 1.8.0_311
Built-By: lschoelens
Bundle-Description: JAXB Annox is a part of JAXB Tools project which imp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public class XPackage extends XAnnotatedElement<Package> {
* target package.
* @param xannotations
* package annotations, may be <code>null</code>.
* @param xclasses
* annotated classes
*/
public XPackage(Package targetPackage, XAnnotation<?>[] xannotations,
XClass[] xclasses) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.jvnet.jaxb.annox.parser;

import japa.parser.ast.Node;
import japa.parser.ast.expr.AnnotationExpr;
import japa.parser.ast.expr.ArrayInitializerExpr;
import japa.parser.ast.expr.Expression;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.jvnet.jaxb.maven.resolver.tools;

import com.sun.org.apache.xml.internal.resolver.CatalogManager;

import org.apache.maven.plugin.logging.Log;
import org.jvnet.jaxb.maven.plugin.logging.NullLog;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import java.nio.file.Paths;
import java.util.Optional;

import com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser;
import org.apache.maven.plugin.logging.Log;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.jvnet.jaxb.maven.IOptionsFactory;
import org.jvnet.jaxb.maven.RawXJC2Mojo;

import java.io.ByteArrayOutputStream;
import java.io.File;
Expand Down Expand Up @@ -58,7 +56,7 @@ public void collectBindingUrisFromDependencies() throws Exception {
public MavenProject getProject() {
MavenProject project = new MavenProject() {
@Override
public Set getArtifacts() {
public Set<Artifact> getArtifacts() {
Set<Artifact> artifacts = new HashSet<>();
ArtifactStub stubJar = new ArtifactStub();
stubJar.setArtifactId("test");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import org.junit.Assert;
import org.junit.Test;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

public class IOUtilsTests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectBuilder;
import org.jvnet.jaxb.maven.XJC2Mojo;

public abstract class JAXBGenerateTest extends AbstractMojoTestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.sun.tools.xjc.Options;

/**
* Abstract test for plugins.
*
Expand Down Expand Up @@ -63,17 +65,17 @@ public boolean isWriteCode() {
return true;
}

public AbstractXJC2Mojo initMojo() {
final AbstractXJC2Mojo mojo = createMojo();
public AbstractXJC2Mojo<Options> initMojo() {
final AbstractXJC2Mojo<Options> mojo = createMojo();
configureMojo(mojo);
return mojo;
}

protected AbstractXJC2Mojo createMojo() {
protected AbstractXJC2Mojo<Options> createMojo() {
return new XJC2Mojo();
}

protected void configureMojo(final AbstractXJC2Mojo mojo) {
protected void configureMojo(final AbstractXJC2Mojo<Options> mojo) {
mojo.setProject(new MavenProject());
mojo.setSchemaDirectory(getSchemaDirectory());
mojo.setGenerateDirectory(getGeneratedDirectory());
Expand Down
Loading