Skip to content

Commit

Permalink
Removed use of auto service. Reformatted code.
Browse files Browse the repository at this point in the history
  • Loading branch information
david-waltermire committed Oct 30, 2024
1 parent af0fbc1 commit b8efe51
Show file tree
Hide file tree
Showing 17 changed files with 12 additions and 37 deletions.
9 changes: 3 additions & 6 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@
</scm>

<dependencies>
<dependency>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service-annotations</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
Expand Down Expand Up @@ -151,6 +145,9 @@

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>${project.build.directory}/generated-resources/xmlbeans</directory>
</resource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@

package gov.nist.secauto.metaschema.core.datatype.adapter;

import com.google.auto.service.AutoService;

import gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeProvider;
import gov.nist.secauto.metaschema.core.datatype.IDataTypeProvider;

import edu.umd.cs.findbugs.annotations.NonNull;

Expand All @@ -17,7 +14,6 @@
* data types.
*/
@SuppressWarnings("PMD.CouplingBetweenObjects")
@AutoService(IDataTypeProvider.class)
public final class MetaschemaDataTypeProvider // NOPMD - Used for service initialization
extends AbstractDataTypeProvider {
@NonNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@

package gov.nist.secauto.metaschema.core.datatype.markup;

import com.google.auto.service.AutoService;

import gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeProvider;
import gov.nist.secauto.metaschema.core.datatype.IDataTypeProvider;

import edu.umd.cs.findbugs.annotations.NonNull;

/**
* Provides for runtime discovery of built-in implementations of the markup
* Metaschema data types.
*/
@AutoService(IDataTypeProvider.class)
public final class MarkupDataTypeProvider
extends AbstractDataTypeProvider {
@NonNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@

package gov.nist.secauto.metaschema.core.metapath.function.library;

import com.google.auto.service.AutoService;

import gov.nist.secauto.metaschema.core.metapath.MetapathConstants;
import gov.nist.secauto.metaschema.core.metapath.function.FunctionLibrary;
import gov.nist.secauto.metaschema.core.metapath.function.IFunctionLibrary;
import gov.nist.secauto.metaschema.core.metapath.item.atomic.IBooleanItem;
import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateItem;
import gov.nist.secauto.metaschema.core.metapath.item.atomic.IDateTimeItem;
Expand All @@ -31,7 +28,6 @@
*/
@SuppressWarnings({ "removal" })
@SuppressFBWarnings("UWF_UNWRITTEN_FIELD")
@AutoService(IFunctionLibrary.class)
public class DefaultFunctionLibrary
extends FunctionLibrary {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import gov.nist.secauto.metaschema.core.metapath.StaticContext;
import gov.nist.secauto.metaschema.core.model.AbstractLoader;
import gov.nist.secauto.metaschema.core.model.IConstraintLoader;
import gov.nist.secauto.metaschema.core.model.ISource;
import gov.nist.secauto.metaschema.core.model.MetaschemaException;
import gov.nist.secauto.metaschema.core.model.constraint.AssemblyConstraintSet;
import gov.nist.secauto.metaschema.core.model.constraint.AssemblyTargetedConstraints;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline;
import gov.nist.secauto.metaschema.core.metapath.MetapathException;
import gov.nist.secauto.metaschema.core.model.IAttributable;
import gov.nist.secauto.metaschema.core.model.ISource;
import gov.nist.secauto.metaschema.core.model.constraint.IAllowedValue;
import gov.nist.secauto.metaschema.core.model.constraint.IAllowedValuesConstraint;
import gov.nist.secauto.metaschema.core.model.constraint.ICardinalityConstraint;
Expand Down Expand Up @@ -374,6 +375,7 @@ private ConstraintXmlSupport() {
// disable construction
}

@SuppressWarnings("unused")
private static final class XmlbeanGeneratingVisitor
implements IConstraintVisitor<DefineAssemblyConstraintsType, Void> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import gov.nist.secauto.metaschema.core.model.IContainerFlagSupport;
import gov.nist.secauto.metaschema.core.model.IFieldInstance;
import gov.nist.secauto.metaschema.core.model.IFlagInstance;
import gov.nist.secauto.metaschema.core.model.ModuleScopeEnum;
import gov.nist.secauto.metaschema.core.model.constraint.IValueConstrained;
import gov.nist.secauto.metaschema.core.model.constraint.ValueConstraintSet;
import gov.nist.secauto.metaschema.core.model.xml.xmlbeans.GlobalFieldDefinitionType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import gov.nist.secauto.metaschema.core.model.AbstractGlobalFlagDefinition;
import gov.nist.secauto.metaschema.core.model.IAttributable;
import gov.nist.secauto.metaschema.core.model.IFlagInstance;
import gov.nist.secauto.metaschema.core.model.constraint.ISource;
import gov.nist.secauto.metaschema.core.model.constraint.IValueConstrained;
import gov.nist.secauto.metaschema.core.model.constraint.ValueConstraintSet;
import gov.nist.secauto.metaschema.core.model.xml.xmlbeans.GlobalFlagDefinitionType;
Expand Down
1 change: 0 additions & 1 deletion core/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

requires static org.eclipse.jdt.annotation;
requires static biz.aQute.bnd.util;
requires static com.google.auto.service;
requires static com.github.spotbugs.annotations;

requires com.ctc.wstx;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gov.nist.secauto.metaschema.core.datatype.adapter.MetaschemaDataTypeProvider
gov.nist.secauto.metaschema.core.datatype.markup.MarkupDataTypeProvider
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gov.nist.secauto.metaschema.core.metapath.function.library.DefaultFunctionLibrary
6 changes: 0 additions & 6 deletions databind/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@
<artifactId>metaschema-core</artifactId>
</dependency>

<dependency>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service-annotations</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,10 @@ public IBoundModule registerModule(
assert key != null;

IBoundModule boundModule;
Class<? extends IBoundModule> moduleClass;
if (key instanceof IBoundModule) {
boundModule = (IBoundModule) key;
moduleClass = boundModule.getClass();
} else {
moduleClass = handleUnboundModule(key);
Class<? extends IBoundModule> moduleClass = handleUnboundModule(key);
boundModule = lookupInstance(moduleClass, bindingContext);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@

package gov.nist.secauto.metaschema.databind.metapath.function;

import com.google.auto.service.AutoService;

import gov.nist.secauto.metaschema.core.metapath.function.FunctionLibrary;
import gov.nist.secauto.metaschema.core.metapath.function.IFunctionLibrary;

@AutoService(IFunctionLibrary.class)
public class DatabindFunctionLibrary
extends FunctionLibrary {

Expand Down
1 change: 0 additions & 1 deletion databind/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
requires com.ctc.wstx;
requires com.fasterxml.jackson.dataformat.yaml;
requires com.fasterxml.jackson.dataformat.xml;
requires transitive com.google.auto.service;
requires transitive com.squareup.javapoet;
requires nl.talsmasoftware.lazy4j;
requires transitive org.apache.commons.lang3;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gov.nist.secauto.metaschema.databind.metapath.function.DatabindFunctionLibrary
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import gov.nist.secauto.metaschema.core.model.MetaschemaException;
import gov.nist.secauto.metaschema.core.util.ObjectUtils;
import gov.nist.secauto.metaschema.databind.IBindingContext;
import gov.nist.secauto.metaschema.databind.model.metaschema.IBindingMetaschemaModule;

import org.junit.jupiter.api.Test;

Expand All @@ -30,7 +29,7 @@ void testIssue187() throws IOException, MetaschemaException {
.compilePath(ObjectUtils.notNull(Files.createTempDirectory(Paths.get("target"), "modules-")))
.build();

IBindingMetaschemaModule module = bindingContext.loadMetaschema(ObjectUtils.notNull(
bindingContext.loadMetaschema(ObjectUtils.notNull(
Paths.get("src/test/resources/content/issue187-metaschema.xml")));

IBoundLoader loader = new DefaultBoundLoader(bindingContext);
Expand Down

0 comments on commit b8efe51

Please sign in to comment.