Skip to content

Commit

Permalink
Reorganization and renaming (#11)
Browse files Browse the repository at this point in the history
Signed-off-by: Laird Nelson <ljnelson@gmail.com>
  • Loading branch information
ljnelson authored Jul 12, 2024
1 parent 04780b9 commit 623d806
Show file tree
Hide file tree
Showing 37 changed files with 1,025 additions and 1,319 deletions.
12 changes: 12 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@
<scope>import</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.10.2</version>
</dependency>


<!-- Normal dependencies. -->

Expand Down Expand Up @@ -161,6 +167,12 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>


</dependencies>

Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/microbean/bean/AbstractInitializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public AbstractInitializer(final SequencedSet<? extends Dependency> dependencies
*/


// TODO: c and r go together, always, so anytime you need an r you need a c.
@Override // Initializer<I>
public I initialize(final I i, final Request<I> r) {
return i;
Expand Down
163 changes: 0 additions & 163 deletions src/main/java/org/microbean/bean/Alternate.java

This file was deleted.

73 changes: 73 additions & 0 deletions src/main/java/org/microbean/bean/AmbiguousReductionException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/* -*- mode: Java; c-basic-offset: 2; indent-tabs-mode: nil; coding: utf-8-unix -*-
*
* Copyright © 2023–2024 microBean™.
*
* 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.
*/
package org.microbean.bean;

import java.util.Collection;
import java.util.List;

public class AmbiguousReductionException extends ReductionException {

private static final long serialVersionUID = 1L;

private final transient Collection<?> alternates;

public AmbiguousReductionException() {
this(null, null, null, null);
}

public AmbiguousReductionException(final Collection<?> alternates,
final String message) {
this(null, alternates, message, null);
}

public AmbiguousReductionException(final Object criteria,
final Collection<?> alternates,
final String message) {
this(criteria, alternates, message, null);
}

public AmbiguousReductionException(final Collection<?> alternates,
final Throwable cause) {
this(null, alternates, null, cause);
}

public AmbiguousReductionException(final Object criteria,
final Collection<?> alternates,
final Throwable cause) {
this(criteria, alternates, null, cause);
}

public AmbiguousReductionException(final Collection<?> alternates,
final String message,
final Throwable cause) {
this(null, alternates, message, cause);
}

public AmbiguousReductionException(final Object criteria,
final Collection<?> alternates,
final String message,
final Throwable cause) {
super(criteria, message, cause);
if (alternates == null || alternates.isEmpty()) {
this.alternates = List.of();
} else {
this.alternates = List.copyOf(alternates);
}
}

public final Collection<?> alternates() {
return this.alternates;
}

}
73 changes: 0 additions & 73 deletions src/main/java/org/microbean/bean/AmbiguousResolutionException.java

This file was deleted.

6 changes: 3 additions & 3 deletions src/main/java/org/microbean/bean/Assignability.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
* @see #matches(TypeMirror, TypeMirror)
*/
// Applies CDI assignability semantics to types.
public final class Assignability implements Constable {
public class Assignability implements Constable {


/*
Expand Down Expand Up @@ -105,7 +105,7 @@ public Assignability(final TypeAndElementSource tes) {


@Override // Constable
public final Optional<? extends ConstantDesc> describeConstable() {
public Optional<? extends ConstantDesc> describeConstable() {
if (this.tes instanceof Constable c) {
return c.describeConstable()
.map(tesDesc -> DynamicConstantDesc.of(BSM_INVOKE,
Expand Down Expand Up @@ -164,7 +164,7 @@ public final boolean oneMatches(final TypeMirror receiver, final Iterable<? exte
* @exception NullPointerException if either argument is {@code null}
*/
// Is the payload assignable to the receiver? That is, does the payload "match the receiver", in CDI parlance?
public final boolean matches(final TypeMirror receiver, final TypeMirror payload) {
public boolean matches(final TypeMirror receiver, final TypeMirror payload) {
// "A bean is assignable to a given injection point if:
//
// "The bean has a bean type [payload] that matches the required type [receiver]. For this purpose..."
Expand Down
12 changes: 0 additions & 12 deletions src/main/java/org/microbean/bean/AutoCloseableRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,6 @@ public interface AutoCloseableRegistry extends AutoCloseable {
@Override // AutoCloseable
public void close();

/*
* Returns {@code true} if and only if this {@link AutoCloseableRegistry} has been {@linkplain #close() closed}.
*
* @return {@code true} if and only if this {@link AutoCloseableRegistry} has been {@linkplain #close() closed}
*
* @idempotency Implementations of this method must be idempotent.
*
* @threadsafety Implementations of this method must be safe for concurrent use by multiple threads.
*/
// public boolean closed();

/**
* If this {@link AutoCloseableRegistry} is not {@linkplain #closed() closed}, and if the supplied {@link
* AutoCloseable} has not yet been registered, registers it such that it will be {@linkplain AutoCloseable#close()
Expand All @@ -88,7 +77,6 @@ public interface AutoCloseableRegistry extends AutoCloseable {
*
* @exception NullPointerException if {@code c} is {@code null}
*/
// @Deprecated(forRemoval = true) // should be an implementation detail of newChild()
public boolean register(final AutoCloseable c);

}
Loading

0 comments on commit 623d806

Please sign in to comment.