[java-support] branch main updated: Javadoc fixes.
Scott Cantor
cantor.2 at osu.edu
Thu Jul 7 14:19:41 UTC 2022
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository java-support.
View the commit online:
http://git.shibboleth.net/view/?p=java-support.git;a=commit;h=f6c159e24da0b97668b6de63c2702a7890506bd9
The following commit(s) were added to refs/heads/main by this push:
new f6c159e Javadoc fixes.
f6c159e is described below
commit f6c159e24da0b97668b6de63c2702a7890506bd9
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Jul 7 10:19:38 2022 -0400
Javadoc fixes.
---
.../shibboleth/utilities/java/support/ddf/DDF.java | 19 ++++++++-------
.../support/ddf/RemotedHttpServletResponse.java | 28 ++++++++++++++++++++++
2 files changed, 39 insertions(+), 8 deletions(-)
diff --git a/src/main/java/net/shibboleth/utilities/java/support/ddf/DDF.java b/src/main/java/net/shibboleth/utilities/java/support/ddf/DDF.java
index b6e1798..c65784e 100644
--- a/src/main/java/net/shibboleth/utilities/java/support/ddf/DDF.java
+++ b/src/main/java/net/shibboleth/utilities/java/support/ddf/DDF.java
@@ -128,6 +128,7 @@ public class DDF implements Iterable<DDF> {
*
* @throws IllegalArgumentException if the type is out of range
*/
+// Checkstyle: CyclomaticComplexity OFF
public static DDFType valueOf(final int val) throws IllegalArgumentException {
final DDFType type;
switch (val) {
@@ -178,6 +179,7 @@ public class DDF implements Iterable<DDF> {
}
};
+// Checkstyle: CyclomaticComplexity ON
/** Node type. */
@Nonnull private DDFType type;
@@ -193,7 +195,7 @@ public class DDF implements Iterable<DDF> {
/**
* Constructor.
*
- * <p>For compatibility, the name is constrained to <= 255 characters.</p>
+ * <p>For compatibility, the name is constrained to no more than 255 characters.</p>
*
* @param n node name
*/
@@ -205,7 +207,7 @@ public class DDF implements Iterable<DDF> {
/**
* Constructor.
*
- * <p>For compatibility, the name is constrained to <= 255 characters.</p>
+ * <p>For compatibility, the name is constrained to no more than 255 characters.</p>
*
* @param n node name
* @param val string value, assumed to be "safe" Unicode
@@ -218,7 +220,7 @@ public class DDF implements Iterable<DDF> {
/**
* Constructor.
*
- * <p>For compatibility, the name is constrained to <= 255 characters.</p>
+ * <p>For compatibility, the name is constrained to no more than 255 characters.</p>
*
* @param n node name
* @param val byte array value, handled without knowledge of the encoding
@@ -231,7 +233,7 @@ public class DDF implements Iterable<DDF> {
/**
* Constructor.
*
- * <p>For compatibility, the name is constrained to <= 255 characters.</p>
+ * <p>For compatibility, the name is constrained to no more than 255 characters.</p>
*
* @param n node name
* @param val integer value
@@ -244,7 +246,7 @@ public class DDF implements Iterable<DDF> {
/**
* Constructor.
*
- * <p>For compatibility, the name is constrained to <= 255 characters.</p>
+ * <p>For compatibility, the name is constrained to no more than 255 characters.</p>
*
* @param n node name
* @param val long integer value
@@ -257,7 +259,7 @@ public class DDF implements Iterable<DDF> {
/**
* Constructor.
*
- * <p>For compatibility, the name is constrained to <= 255 characters.</p>
+ * <p>For compatibility, the name is constrained to no more than 255 characters.</p>
*
* @param n node name
* @param val floating value
@@ -270,7 +272,7 @@ public class DDF implements Iterable<DDF> {
/**
* Constructor.
*
- * <p>For compatibility, the name is constrained to <= 255 characters.</p>
+ * <p>For compatibility, the name is constrained to no more than 255 characters.</p>
*
* @param n node name
* @param val object value
@@ -1383,6 +1385,7 @@ public class DDF implements Iterable<DDF> {
*
* @throws IOException if an error occurs
*/
+// Checkstyle: ReturnCount OFF
@Nonnull public static DDF deserialize(@Nonnull final InputStream is) throws IOException {
int ch;
@@ -1559,7 +1562,7 @@ public class DDF implements Iterable<DDF> {
throw new IOException("Unexpected record type");
}
}
-// Checkstyle: MethodLength|CyclomaticComplexity ON
+// Checkstyle: MethodLength|CyclomaticComplexity|ReturnCount ON
/**
* A simple encoder for non-ASCII characters.
diff --git a/src/main/java/net/shibboleth/utilities/java/support/ddf/RemotedHttpServletResponse.java b/src/main/java/net/shibboleth/utilities/java/support/ddf/RemotedHttpServletResponse.java
index 973402b..b9ff05b 100644
--- a/src/main/java/net/shibboleth/utilities/java/support/ddf/RemotedHttpServletResponse.java
+++ b/src/main/java/net/shibboleth/utilities/java/support/ddf/RemotedHttpServletResponse.java
@@ -387,19 +387,41 @@ public class RemotedHttpServletResponse implements HttpServletResponse {
/** Wrapped array. */
private final byte[] buffer;
+ /**
+ * Constructor.
+ *
+ * @param size buffer size
+ */
private ByteArrayWrapper(final int size) {
buffer = new byte[size];
offset = 0;
}
+ /**
+ * Gets the buffer.
+ *
+ * @return the buffer
+ */
@Nonnull private byte[] getBuffer() {
return buffer;
}
+ /**
+ * Gets the offset.
+ *
+ * @return the offset
+ */
private int getOffset() {
return offset;
}
+ /**
+ * Writes a byte to the buffer.
+ *
+ * @param b byte to write
+ *
+ * @return true iff the buffer was large enough to accommodate the byte
+ */
private boolean write(final int b) {
if (offset < buffer.length) {
buffer[offset++] = Integer.valueOf(b).byteValue();
@@ -410,6 +432,7 @@ public class RemotedHttpServletResponse implements HttpServletResponse {
}
}
+ /** A pseudo {@link ServletOutputStream} to catch output. */
private class BodyOutputStream extends ServletOutputStream {
@@ -426,16 +449,19 @@ public class RemotedHttpServletResponse implements HttpServletResponse {
bufferList.add(currentBuffer);
}
+ /** {@inheritDoc} */
@Override
public boolean isReady() {
return true;
}
+ /** {@inheritDoc} */
@Override
public void setWriteListener(final WriteListener writeListener) {
throw new UnsupportedOperationException();
}
+ /** {@inheritDoc} */
@Override
public void write(final int b) throws IOException {
if (!currentBuffer.write(b)) {
@@ -445,6 +471,7 @@ public class RemotedHttpServletResponse implements HttpServletResponse {
}
}
+ /** {@inheritDoc} */
@Override
public void flush() throws IOException {
@@ -460,6 +487,7 @@ public class RemotedHttpServletResponse implements HttpServletResponse {
committed = true;
}
+ /** {@inheritDoc} */
@Override
public void close() throws IOException {
flush();
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list