Skip to content

Commit 9f9bd20

Browse files
committed
Expand internals javadoc to package types/members
The earlier work fixing run-busting errors in javadoc comments permits the javadoc coverage for the o.p.p.internal module to be expanded to cover package-private types and members. In passing, add enough missing class-level javadoc comments to make the resulting package listings somewhat presentable.
1 parent a9047d0 commit 9f9bd20

33 files changed

+339
-45
lines changed

pljava/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ function executeReport(report, locale)
140140
"-quiet",
141141
"--show-module-contents", "all",
142142
"--show-packages", "all",
143+
"--show-types", "package",
144+
"--show-members", "package",
143145
/*
144146
* Options that are passed to the doclet.
145147
*/

pljava/src/main/java/org/postgresql/pljava/internal/AbstractNoSplitList.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023 Tada AB and other contributors, as listed below.
2+
* Copyright (c) 2023-2025 Tada AB and other contributors, as listed below.
33
*
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the The BSD 3-Clause License
@@ -54,6 +54,9 @@ public Spliterator<E> spliterator()
5454
return new IteratorNonSpliterator<>(iterator(), size(), ORDERED|SIZED);
5555
}
5656

57+
/**
58+
* As promised, an iterator whose spliterator won't split.
59+
*/
5760
public static class IteratorNonSpliterator<E> extends AbstractSpliterator<E>
5861
{
5962
private Iterator<E> it;

pljava/src/main/java/org/postgresql/pljava/internal/CacheMap.java

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022 Tada AB and other contributors, as listed below.
2+
* Copyright (c) 2022-2025 Tada AB and other contributors, as listed below.
33
*
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the The BSD 3-Clause License
@@ -31,6 +31,11 @@
3131

3232
import static java.util.stream.Collectors.joining;
3333

34+
/**
35+
* Utility class for constructing caches that map from keys that consist of
36+
* one or more primitive values, whose entries can be retained strongly, softly,
37+
* or weakly.
38+
*/
3439
public class CacheMap<T>
3540
{
3641
private final Map<ByteBuffer,KeyedEntry<T>> m_map;
@@ -198,17 +203,27 @@ public void forEachValue(Consumer<T> action)
198203
.forEach(action);
199204
}
200205

206+
/**
207+
* An entry in a {@link CacheMap CacheMap}.
208+
*/
201209
public interface Entry<T>
202210
{
203211
T get();
204212
void remove();
205213
}
206214

215+
/**
216+
* An {@link Entry Entry} that keeps a reference to its key.
217+
*/
207218
interface KeyedEntry<T> extends Entry<T>
208219
{
209220
ByteBuffer key();
210221
}
211222

223+
/**
224+
* A {@link KeyedEntry KeyedEntry} that holds
225+
* a {@link SoftReference SoftReference} to its value.
226+
*/
212227
static class SoftEntry<T> extends SoftReference<T> implements KeyedEntry<T>
213228
{
214229
final ByteBuffer m_key;
@@ -233,6 +248,10 @@ public void remove()
233248
}
234249
}
235250

251+
/**
252+
* A {@link KeyedEntry KeyedEntry} that holds
253+
* a {@link WeakReference WeakReference} to its value.
254+
*/
236255
static class WeakEntry<T> extends WeakReference<T> implements KeyedEntry<T>
237256
{
238257
final ByteBuffer m_key;
@@ -257,6 +276,10 @@ public void remove()
257276
}
258277
}
259278

279+
/**
280+
* A {@link KeyedEntry KeyedEntry} that holds
281+
* a strong reference to its value.
282+
*/
260283
static class StrongEntry<T> implements KeyedEntry<T>
261284
{
262285
final ByteBuffer m_key;
@@ -295,6 +318,15 @@ public void remove()
295318
* construction and return (to avoid any chance of its being found
296319
* weakly reachable before its return).
297320
*/
321+
/**
322+
* An effectively private class used during {@link CacheMap CacheMap}
323+
* operations.
324+
*<p>
325+
* Until PL/Java's support horizon for Java moves to Java >= 11 where
326+
* classes have nestmates, there can be overhead in making nested classes
327+
* private, so some in the internal module have been left at package access
328+
* for now.
329+
*/
298330
static class KVHolder<T>
299331
{
300332
ByteBuffer key;

pljava/src/main/java/org/postgresql/pljava/internal/ExecutionPlan.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2004-2022 Tada AB and other contributors, as listed below.
2+
* Copyright (c) 2004-2025 Tada AB and other contributors, as listed below.
33
*
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the The BSD 3-Clause License
@@ -145,6 +145,10 @@ protected boolean removeEldestEntry(
145145
}
146146
};
147147

148+
/**
149+
* The actual (but treated as opaque {@code Object} key used in the plan
150+
* cache.
151+
*/
148152
static final class PlanKey
149153
{
150154
private final int m_hashCode;

pljava/src/main/java/org/postgresql/pljava/internal/LifespanImpl.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022 Tada AB and other contributors, as listed below.
2+
* Copyright (c) 2022-2025 Tada AB and other contributors, as listed below.
33
*
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the The BSD 3-Clause License
@@ -32,6 +32,11 @@
3232
*/
3333
public class LifespanImpl extends DualState.ListHead implements Lifespan
3434
{
35+
/**
36+
* Interface to be additionally implemented by
37+
* a {@link LifespanImpl LifespanImpl} with an associated native address
38+
* that may be needed during release handling.
39+
*/
3540
public interface Addressed
3641
{
3742
long address();

pljava/src/main/java/org/postgresql/pljava/internal/SQL_ASCII.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020-2021 Tada AB and other contributors, as listed below.
2+
* Copyright (c) 2020-2025 Tada AB and other contributors, as listed below.
33
*
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the The BSD 3-Clause License
@@ -54,13 +54,19 @@
5454
*/
5555
class SQL_ASCII extends Charset
5656
{
57+
/**
58+
* Holder class for list of provided {@link Charset Charset}s.
59+
*/
5760
static class Holder
5861
{
5962
static final List<Charset> s_list =
6063
singletonList((Charset)new SQL_ASCII());
6164
}
6265

6366

67+
/**
68+
* Provider for {@link Charset Charset} discovery.
69+
*/
6470
public static class Provider extends CharsetProvider
6571
{
6672
static final String s_canonName = "X-PGSQL_ASCII";
@@ -109,6 +115,9 @@ public CharsetEncoder newEncoder()
109115
}
110116

111117

118+
/**
119+
* Decoder for {@link SQL_ASCII SQL_ASCII}.
120+
*/
112121
static class Decoder extends CharsetDecoder
113122
{
114123
Decoder()
@@ -156,6 +165,9 @@ protected CoderResult decodeLoop(ByteBuffer in, CharBuffer out)
156165
}
157166
}
158167

168+
/**
169+
* Encoder for {@link SQL_ASCII SQL_ASCII}.
170+
*/
159171
static class Encoder extends CharsetEncoder
160172
{
161173
Encoder()

pljava/src/main/java/org/postgresql/pljava/internal/SyntheticXMLReader.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019 Tada AB and other contributors, as listed below.
2+
* Copyright (c) 2019-2025 Tada AB and other contributors, as listed below.
33
*
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the The BSD 3-Clause License
@@ -103,6 +103,9 @@ public abstract class SyntheticXMLReader implements XMLReader
103103
*/
104104
public final FluentAttributes2 m_attributes = new FluentAttributes2();
105105

106+
/**
107+
* Enumeration of features standardized by SAX 2.
108+
*/
106109
public enum SAX2FEATURE
107110
{
108111
EXTERNAL_GENERAL_ENTITIES("external-general-entities", null),
@@ -184,6 +187,9 @@ public static SAX2FEATURE fromUri(String uri)
184187
}
185188
}
186189

190+
/**
191+
* Enumeration of features originating with Apache.
192+
*/
187193
public enum ApacheFeature
188194
{
189195
DISALLOW_DOCTYPE_DECL("disallow-doctype-decl", false),
@@ -237,6 +243,9 @@ public static ApacheFeature fromUri(String uri)
237243
}
238244
}
239245

246+
/**
247+
* Enumeration of properties standardized by SAX 2.
248+
*/
240249
public enum SAX2PROPERTY
241250
{
242251
DECLARATION_HANDLER("declaration-handler", DeclHandler.class),

pljava/src/main/java/org/postgresql/pljava/pg/AccessMethodImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737

3838
import static org.postgresql.pljava.internal.UncheckedException.unchecked;
3939

40+
/**
41+
* Implementation of the {@link AccessMethod AccessMethod} interface.
42+
*/
4043
class AccessMethodImpl extends Addressed<AccessMethod>
4144
implements Nonshared<AccessMethod>, Named<Simple>, AccessMethod
4245
{

pljava/src/main/java/org/postgresql/pljava/pg/AclItem.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022-2023 Tada AB and other contributors, as listed below.
2+
* Copyright (c) 2022-2025 Tada AB and other contributors, as listed below.
33
*
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the The BSD 3-Clause License
@@ -29,6 +29,9 @@
2929
import static org.postgresql.pljava.pg.ModelConstants.N_ACL_RIGHTS;
3030
import static org.postgresql.pljava.pg.ModelConstants.PG_VERSION_NUM;
3131

32+
/**
33+
* Implementation of the {@link CatalogObject.Grant Grant} interface.
34+
*/
3235
public abstract class AclItem implements CatalogObject.Grant
3336
{
3437
/*

pljava/src/main/java/org/postgresql/pljava/pg/AttributeImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@
5353

5454
import static org.postgresql.pljava.internal.UncheckedException.unchecked;
5555

56+
/**
57+
* Implementation of the {@link Attribute Attribute} interface.
58+
*/
5659
abstract class AttributeImpl extends Addressed<RegClass>
5760
implements
5861
Nonshared<RegClass>, Named<Simple>,

0 commit comments

Comments
 (0)