Skip to content

Commit 65a78f9

Browse files
authored
Refactors in conjunction with microbean-reference (#6)
Signed-off-by: Laird Nelson <[email protected]>
1 parent 1f074a4 commit 65a78f9

File tree

9 files changed

+499
-119
lines changed

9 files changed

+499
-119
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ dependency:
2727
<groupId>org.microbean</groupId>
2828
<artifactId>microbean-scopelet</artifactId>
2929
<!-- Always check https://search.maven.org/artifact/org.microbean/microbean-scopelet for up-to-date available versions. -->
30-
<version>0.0.5</version>
30+
<version>0.0.6</version>
3131
</dependency>
3232
```
3333

pom.xml

Lines changed: 23 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
<!-- maven-javadoc-plugin properties -->
8181
<bottom><![CDATA[Copyright &copy; ${project.inceptionYear}&ndash;{currentYear}, <a href="${project.organization.url}" target="_top">${project.organization.name}</a>. All rights reserved.]]></bottom>
8282
<doctitle>&lt;a href="${project.url}" target="_top"&gt;&lt;span style="font-family:Lobster, cursive;"&gt;µb&lt;/span&gt; ${project.artifactId}&lt;/a&gt; ${project.version}</doctitle>
83-
<links>https://microbean.github.io/microbean-bean/apidocs/,https://microbean.github.io/microbean-construct/apidocs/,https://microbean.github.io/microbean-qualifier/apidocs/,https://microbean.github.io/microbean-scope/apidocs/</links>
83+
<links>https://microbean.github.io/microbean-assign/apidocs/,https://microbean.github.io/microbean-attributes/apidocs/,https://microbean.github.io/microbean-bean/apidocs/,https://microbean.github.io/microbean-construct/apidocs/,https://microbean.github.io/microbean-reference/apidocs/</links>
8484
<sourcetab>2</sourcetab>
8585

8686
<!-- maven-release-plugin properties -->
@@ -125,7 +125,7 @@
125125
<dependency>
126126
<groupId>org.junit</groupId>
127127
<artifactId>junit-bom</artifactId>
128-
<version>5.11.3</version>
128+
<version>5.11.4</version>
129129
<type>pom</type>
130130
<scope>import</scope>
131131
</dependency>
@@ -135,19 +135,19 @@
135135
<dependency>
136136
<groupId>org.microbean</groupId>
137137
<artifactId>microbean-assign</artifactId>
138-
<version>0.0.1</version>
138+
<version>0.0.5</version>
139139
</dependency>
140140

141141
<dependency>
142142
<groupId>org.microbean</groupId>
143-
<artifactId>microbean-bean</artifactId>
144-
<version>0.0.13</version>
143+
<artifactId>microbean-attributes</artifactId>
144+
<version>0.0.2</version>
145145
</dependency>
146146

147147
<dependency>
148148
<groupId>org.microbean</groupId>
149-
<artifactId>microbean-constant</artifactId>
150-
<version>0.0.7</version>
149+
<artifactId>microbean-bean</artifactId>
150+
<version>0.0.15</version>
151151
</dependency>
152152

153153
<dependency>
@@ -158,14 +158,8 @@
158158

159159
<dependency>
160160
<groupId>org.microbean</groupId>
161-
<artifactId>microbean-qualifier</artifactId>
162-
<version>0.2.4</version>
163-
</dependency>
164-
165-
<dependency>
166-
<groupId>org.microbean</groupId>
167-
<artifactId>microbean-scope</artifactId>
168-
<version>0.0.3</version>
161+
<artifactId>microbean-reference</artifactId>
162+
<version>0.0.1</version>
169163
</dependency>
170164

171165
</dependencies>
@@ -181,34 +175,28 @@
181175

182176
<dependency>
183177
<groupId>org.microbean</groupId>
184-
<artifactId>microbean-bean</artifactId>
185-
<scope>compile</scope>
186-
</dependency>
187-
188-
<dependency>
189-
<groupId>org.microbean</groupId>
190-
<artifactId>microbean-constant</artifactId>
178+
<artifactId>microbean-attributes</artifactId>
191179
<scope>compile</scope>
192180
</dependency>
193181

194182
<dependency>
195183
<groupId>org.microbean</groupId>
196-
<artifactId>microbean-construct</artifactId>
184+
<artifactId>microbean-bean</artifactId>
197185
<scope>compile</scope>
198186
</dependency>
199187

200188
<dependency>
201189
<groupId>org.microbean</groupId>
202-
<artifactId>microbean-qualifier</artifactId>
190+
<artifactId>microbean-construct</artifactId>
203191
<scope>compile</scope>
204192
</dependency>
205193

206194
<dependency>
207195
<groupId>org.microbean</groupId>
208-
<artifactId>microbean-scope</artifactId>
196+
<artifactId>microbean-reference</artifactId>
209197
<scope>compile</scope>
210198
</dependency>
211-
199+
212200
<!-- Test-scoped dependencies. -->
213201

214202
<dependency>
@@ -222,7 +210,7 @@
222210
<artifactId>junit-jupiter-engine</artifactId>
223211
<scope>test</scope>
224212
</dependency>
225-
213+
226214
</dependencies>
227215

228216
<build>
@@ -240,7 +228,7 @@
240228
<artifactId>maven-checkstyle-plugin</artifactId>
241229
<version>3.6.0</version>
242230
<configuration>
243-
<checkstyleRules>
231+
<checkstyleRules>
244232
<module name="Checker">
245233
<module name="BeforeExecutionExclusionFileFilter">
246234
<property name="fileNamePattern" value="module\-info\.java$" />
@@ -350,7 +338,7 @@
350338
</plugin>
351339
<plugin>
352340
<artifactId>maven-clean-plugin</artifactId>
353-
<version>3.4.0</version>
341+
<version>3.4.1</version>
354342
<configuration>
355343
<filesets>
356344
<fileset>
@@ -365,28 +353,21 @@
365353
</plugin>
366354
<plugin>
367355
<artifactId>maven-compiler-plugin</artifactId>
368-
<version>3.13.0</version>
356+
<version>3.14.0</version>
369357
<configuration>
370358
<compilerArgs>
371359
<arg>-Xlint:all</arg>
372360
<arg>-parameters</arg>
373361
</compilerArgs>
374362
</configuration>
375-
<dependencies>
376-
<dependency>
377-
<groupId>org.codehaus.plexus</groupId>
378-
<artifactId>plexus-java</artifactId>
379-
<version>1.3.0</version>
380-
</dependency>
381-
</dependencies>
382363
</plugin>
383364
<plugin>
384365
<artifactId>maven-dependency-plugin</artifactId>
385366
<version>3.8.1</version>
386367
</plugin>
387368
<plugin>
388369
<artifactId>maven-deploy-plugin</artifactId>
389-
<version>3.1.3</version>
370+
<version>3.1.4</version>
390371
</plugin>
391372
<plugin>
392373
<artifactId>maven-enforcer-plugin</artifactId>
@@ -399,7 +380,7 @@
399380
</plugin>
400381
<plugin>
401382
<artifactId>maven-install-plugin</artifactId>
402-
<version>3.1.3</version>
383+
<version>3.1.4</version>
403384
</plugin>
404385
<plugin>
405386
<artifactId>maven-jar-plugin</artifactId>
@@ -435,7 +416,7 @@
435416
</plugin>
436417
<plugin>
437418
<artifactId>maven-project-info-reports-plugin</artifactId>
438-
<version>3.8.0</version>
419+
<version>3.9.0</version>
439420
</plugin>
440421
<plugin>
441422
<artifactId>maven-release-plugin</artifactId>
@@ -488,7 +469,7 @@
488469
<plugin>
489470
<groupId>com.github.spotbugs</groupId>
490471
<artifactId>spotbugs-maven-plugin</artifactId>
491-
<version>4.8.6.6</version>
472+
<version>4.9.2.0</version>
492473
</plugin>
493474
<plugin>
494475
<groupId>org.codehaus.mojo</groupId>
@@ -498,7 +479,7 @@
498479
<plugin>
499480
<groupId>io.smallrye</groupId>
500481
<artifactId>jandex-maven-plugin</artifactId>
501-
<version>3.2.3</version>
482+
<version>3.2.7</version>
502483
</plugin>
503484
<plugin>
504485
<groupId>org.sonatype.plugins</groupId>

src/main/java/module-info.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
exports org.microbean.scopelet;
2323

2424
requires transitive org.microbean.assign;
25+
requires org.microbean.attributes;
2526
requires transitive org.microbean.bean;
2627
requires org.microbean.constant;
2728
requires org.microbean.construct;
28-
requires transitive org.microbean.qualifier;
29-
requires transitive org.microbean.scope;
29+
requires transitive org.microbean.reference;
3030

3131
}

src/main/java/org/microbean/scopelet/MapBackedScopelet.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import org.microbean.bean.Factory;
2828
import org.microbean.bean.Request;
2929

30-
import org.microbean.qualifier.NamedAttributeMap;
30+
import org.microbean.attributes.Attributes;
3131

3232
/**
3333
* A thread-safe, partial {@link Scopelet} implementation backed by {@link ConcurrentMap} machinery.
@@ -45,14 +45,14 @@ public abstract class MapBackedScopelet<M extends MapBackedScopelet<M>> extends
4545
/**
4646
* Creates a new {@link MapBackedScopelet}.
4747
*
48-
* @param scopeId a {@link NamedAttributeMap} identifying the scope this {@link MapBackedScopelet} serves; must not be
48+
* @param scopeId an {@link Attributes} identifying the scope this {@link MapBackedScopelet} serves; must not be
4949
* {@code null}
5050
*
5151
* @exception NullPointerException if {@code scopeId} is {@code null}
5252
*
53-
* @see Scopelet#Scopelet(NamedAttributeMap)
53+
* @see Scopelet#Scopelet(Attributes)
5454
*/
55-
protected MapBackedScopelet(final NamedAttributeMap<?> scopeId) {
55+
protected MapBackedScopelet(final Attributes scopeId) {
5656
super(scopeId);
5757
this.creationLocks = new ConcurrentHashMap<>();
5858
this.instances = new ConcurrentHashMap<>();

src/main/java/org/microbean/scopelet/NoneScopelet.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,18 @@
2424
import java.util.Optional;
2525

2626
import org.microbean.bean.AutoCloseableRegistry;
27+
import org.microbean.bean.BeanTypeList;
2728
import org.microbean.bean.DisposableReference;
2829
import org.microbean.bean.Factory;
2930
import org.microbean.bean.Id;
3031
import org.microbean.bean.Request;
3132

32-
import org.microbean.constant.Constables;
33-
3433
import org.microbean.construct.Domain;
3534

3635
import static java.lang.constant.ConstantDescs.BSM_INVOKE;
3736

3837
import static org.microbean.assign.Qualifiers.anyQualifier;
3938

40-
import static org.microbean.scope.Scope.NONE_ID;
41-
import static org.microbean.scope.Scope.SINGLETON_ID;
42-
4339
/**
4440
* A {@link Scopelet} implementation that does not cache objects at all.
4541
*
@@ -67,12 +63,12 @@ public NoneScopelet(final Domain domain) {
6763
@Override // Scopelet<NoneScopelet>
6864
public Id id() {
6965
return
70-
new Id(List.of(this.domain.declaredType(NoneScopelet.class.getName()),
71-
this.domain.declaredType(null,
72-
this.domain.typeElement(Scopelet.class.getName()),
73-
this.domain.declaredType(NoneScopelet.class.getName()))),
74-
List.of(NONE_ID, anyQualifier()), // qualifiers
75-
SINGLETON_ID); // the scope we belong to
66+
new Id(BeanTypeList.of(this.domain,
67+
List.of(this.domain.declaredType(NoneScopelet.class.getCanonicalName()),
68+
this.domain.declaredType(null,
69+
this.domain.typeElement(Scopelet.class.getCanonicalName()),
70+
this.domain.declaredType(NoneScopelet.class.getCanonicalName())))),
71+
List.of(NONE_ID, anyQualifier())); // qualifiers
7672
}
7773

7874
// All parameters are nullable.

0 commit comments

Comments
 (0)