repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
minio/minio-java | api/src/main/java/io/minio/MinioClient.java | MinioClient.completeMultipart | private void completeMultipart(String bucketName, String objectName, String uploadId, Part[] parts)
throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException,
InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException,
Int... | java | private void completeMultipart(String bucketName, String objectName, String uploadId, Part[] parts)
throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException,
InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException,
Int... | [
"private",
"void",
"completeMultipart",
"(",
"String",
"bucketName",
",",
"String",
"objectName",
",",
"String",
"uploadId",
",",
"Part",
"[",
"]",
"parts",
")",
"throws",
"InvalidBucketNameException",
",",
"NoSuchAlgorithmException",
",",
"InsufficientDataException",
... | Executes complete multipart upload of given bucket name, object name, upload ID and parts. | [
"Executes",
"complete",
"multipart",
"upload",
"of",
"given",
"bucket",
"name",
"object",
"name",
"upload",
"ID",
"and",
"parts",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/MinioClient.java#L4746-L4778 | train |
minio/minio-java | api/src/main/java/io/minio/MinioClient.java | MinioClient.abortMultipartUpload | private void abortMultipartUpload(String bucketName, String objectName, String uploadId)
throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException,
InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException,
InternalExcept... | java | private void abortMultipartUpload(String bucketName, String objectName, String uploadId)
throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException,
InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException,
InternalExcept... | [
"private",
"void",
"abortMultipartUpload",
"(",
"String",
"bucketName",
",",
"String",
"objectName",
",",
"String",
"uploadId",
")",
"throws",
"InvalidBucketNameException",
",",
"NoSuchAlgorithmException",
",",
"InsufficientDataException",
",",
"IOException",
",",
"Invali... | Aborts multipart upload of given bucket name, object name and upload ID. | [
"Aborts",
"multipart",
"upload",
"of",
"given",
"bucket",
"name",
"object",
"name",
"and",
"upload",
"ID",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/MinioClient.java#L4907-L4914 | train |
minio/minio-java | api/src/main/java/io/minio/MinioClient.java | MinioClient.removeIncompleteUpload | public void removeIncompleteUpload(String bucketName, String objectName)
throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException,
InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException,
InternalException {
for (R... | java | public void removeIncompleteUpload(String bucketName, String objectName)
throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException,
InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException,
InternalException {
for (R... | [
"public",
"void",
"removeIncompleteUpload",
"(",
"String",
"bucketName",
",",
"String",
"objectName",
")",
"throws",
"InvalidBucketNameException",
",",
"NoSuchAlgorithmException",
",",
"InsufficientDataException",
",",
"IOException",
",",
"InvalidKeyException",
",",
"NoResp... | Removes incomplete multipart upload of given object.
</p><b>Example:</b><br>
<pre>{@code minioClient.removeIncompleteUpload("my-bucketname", "my-objectname");
System.out.println("successfully removed all incomplete upload session of my-bucketname/my-objectname"); }</pre>
@param bucketName Bucket name.
@param objectNa... | [
"Removes",
"incomplete",
"multipart",
"upload",
"of",
"given",
"object",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/MinioClient.java#L4940-L4951 | train |
minio/minio-java | api/src/main/java/io/minio/MinioClient.java | MinioClient.listenBucketNotification | public void listenBucketNotification(String bucketName, String prefix, String suffix, String[] events,
BucketEventListener eventCallback)
throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException,
InvalidKeyException, NoResponseException, XmlPullPa... | java | public void listenBucketNotification(String bucketName, String prefix, String suffix, String[] events,
BucketEventListener eventCallback)
throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException,
InvalidKeyException, NoResponseException, XmlPullPa... | [
"public",
"void",
"listenBucketNotification",
"(",
"String",
"bucketName",
",",
"String",
"prefix",
",",
"String",
"suffix",
",",
"String",
"[",
"]",
"events",
",",
"BucketEventListener",
"eventCallback",
")",
"throws",
"InvalidBucketNameException",
",",
"NoSuchAlgori... | Listen to bucket notifications.
@param bucketName Bucket name.
@param prefix Prefix of concerned objects events.
@param suffix Suffix of concerned objects events.
@param events List of events to watch.
@param eventCallback Event handler.
@throws InvalidBucketNameException upon invalid bucket name is given
@throws No... | [
"Listen",
"to",
"bucket",
"notifications",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/MinioClient.java#L4977-L5020 | train |
minio/minio-java | api/src/main/java/io/minio/MinioClient.java | MinioClient.calculateMultipartSize | private static int[] calculateMultipartSize(long size)
throws InvalidArgumentException {
if (size > MAX_OBJECT_SIZE) {
throw new InvalidArgumentException("size " + size + " is greater than allowed size 5TiB");
}
double partSize = Math.ceil((double) size / MAX_MULTIPART_COUNT);
partSize = Math... | java | private static int[] calculateMultipartSize(long size)
throws InvalidArgumentException {
if (size > MAX_OBJECT_SIZE) {
throw new InvalidArgumentException("size " + size + " is greater than allowed size 5TiB");
}
double partSize = Math.ceil((double) size / MAX_MULTIPART_COUNT);
partSize = Math... | [
"private",
"static",
"int",
"[",
"]",
"calculateMultipartSize",
"(",
"long",
"size",
")",
"throws",
"InvalidArgumentException",
"{",
"if",
"(",
"size",
">",
"MAX_OBJECT_SIZE",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"size \"",
"+",
"size",
"... | Calculates multipart size of given size and returns three element array contains part size, part count
and last part size. | [
"Calculates",
"multipart",
"size",
"of",
"given",
"size",
"and",
"returns",
"three",
"element",
"array",
"contains",
"part",
"size",
"part",
"count",
"and",
"last",
"part",
"size",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/MinioClient.java#L5027-L5044 | train |
minio/minio-java | api/src/main/java/io/minio/MinioClient.java | MinioClient.getAvailableSize | private int getAvailableSize(Object inputStream, int expectedReadSize) throws IOException, InternalException {
RandomAccessFile file = null;
BufferedInputStream stream = null;
if (inputStream instanceof RandomAccessFile) {
file = (RandomAccessFile) inputStream;
} else if (inputStream instanceof Bu... | java | private int getAvailableSize(Object inputStream, int expectedReadSize) throws IOException, InternalException {
RandomAccessFile file = null;
BufferedInputStream stream = null;
if (inputStream instanceof RandomAccessFile) {
file = (RandomAccessFile) inputStream;
} else if (inputStream instanceof Bu... | [
"private",
"int",
"getAvailableSize",
"(",
"Object",
"inputStream",
",",
"int",
"expectedReadSize",
")",
"throws",
"IOException",
",",
"InternalException",
"{",
"RandomAccessFile",
"file",
"=",
"null",
";",
"BufferedInputStream",
"stream",
"=",
"null",
";",
"if",
... | Return available size of given input stream up to given expected read size. If less data is available than
expected read size, it returns how much data available to read. | [
"Return",
"available",
"size",
"of",
"given",
"input",
"stream",
"up",
"to",
"given",
"expected",
"read",
"size",
".",
"If",
"less",
"data",
"is",
"available",
"than",
"expected",
"read",
"size",
"it",
"returns",
"how",
"much",
"data",
"available",
"to",
"... | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/MinioClient.java#L5050-L5102 | train |
minio/minio-java | api/src/main/java/io/minio/MinioClient.java | MinioClient.traceOn | public void traceOn(OutputStream traceStream) {
if (traceStream == null) {
throw new NullPointerException();
} else {
this.traceStream = new PrintWriter(new OutputStreamWriter(traceStream, StandardCharsets.UTF_8), true);
}
} | java | public void traceOn(OutputStream traceStream) {
if (traceStream == null) {
throw new NullPointerException();
} else {
this.traceStream = new PrintWriter(new OutputStreamWriter(traceStream, StandardCharsets.UTF_8), true);
}
} | [
"public",
"void",
"traceOn",
"(",
"OutputStream",
"traceStream",
")",
"{",
"if",
"(",
"traceStream",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"else",
"{",
"this",
".",
"traceStream",
"=",
"new",
"PrintWriter",
"("... | Enables HTTP call tracing and written to traceStream.
@param traceStream {@link OutputStream} for writing HTTP call tracing.
@see #traceOff | [
"Enables",
"HTTP",
"call",
"tracing",
"and",
"written",
"to",
"traceStream",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/MinioClient.java#L5112-L5118 | train |
minio/minio-java | api/src/main/java/io/minio/http/HeaderParser.java | HeaderParser.set | public static void set(Headers headers, Object destination) {
Field[] publicFields;
Field[] privateFields;
Field[] fields;
Class<?> cls = destination.getClass();
publicFields = cls.getFields();
privateFields = cls.getDeclaredFields();
fields = new Field[publicFields.length + privateFields.... | java | public static void set(Headers headers, Object destination) {
Field[] publicFields;
Field[] privateFields;
Field[] fields;
Class<?> cls = destination.getClass();
publicFields = cls.getFields();
privateFields = cls.getDeclaredFields();
fields = new Field[publicFields.length + privateFields.... | [
"public",
"static",
"void",
"set",
"(",
"Headers",
"headers",
",",
"Object",
"destination",
")",
"{",
"Field",
"[",
"]",
"publicFields",
";",
"Field",
"[",
"]",
"privateFields",
";",
"Field",
"[",
"]",
"fields",
";",
"Class",
"<",
"?",
">",
"cls",
"=",... | Sets destination object from Headers object. | [
"Sets",
"destination",
"object",
"from",
"Headers",
"object",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/http/HeaderParser.java#L42-L84 | train |
minio/minio-java | api/src/main/java/io/minio/S3Escaper.java | S3Escaper.encode | public static String encode(String str) {
if (str == null) {
return "";
}
return ESCAPER.escape(str)
.replaceAll("\\!", "%21")
.replaceAll("\\$", "%24")
.replaceAll("\\&", "%26")
.replaceAll("\\'", "%27")
.replaceAll("\\(", "%28")
.replaceAll("\\)", "%29")
.r... | java | public static String encode(String str) {
if (str == null) {
return "";
}
return ESCAPER.escape(str)
.replaceAll("\\!", "%21")
.replaceAll("\\$", "%24")
.replaceAll("\\&", "%26")
.replaceAll("\\'", "%27")
.replaceAll("\\(", "%28")
.replaceAll("\\)", "%29")
.r... | [
"public",
"static",
"String",
"encode",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"return",
"ESCAPER",
".",
"escape",
"(",
"str",
")",
".",
"replaceAll",
"(",
"\"\\\\!\"",
",",
"\"%21\"",
")... | Returns S3 encoded string. | [
"Returns",
"S3",
"encoded",
"string",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/S3Escaper.java#L29-L51 | train |
minio/minio-java | api/src/main/java/io/minio/Signer.java | Signer.getChunkSignature | public static String getChunkSignature(String chunkSha256, DateTime date, String region, String secretKey,
String prevSignature)
throws NoSuchAlgorithmException, InvalidKeyException {
Signer signer = new Signer(null, chunkSha256, date, region, null, secretKey, prevSignat... | java | public static String getChunkSignature(String chunkSha256, DateTime date, String region, String secretKey,
String prevSignature)
throws NoSuchAlgorithmException, InvalidKeyException {
Signer signer = new Signer(null, chunkSha256, date, region, null, secretKey, prevSignat... | [
"public",
"static",
"String",
"getChunkSignature",
"(",
"String",
"chunkSha256",
",",
"DateTime",
"date",
",",
"String",
"region",
",",
"String",
"secretKey",
",",
"String",
"prevSignature",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
"{",
... | Returns chunk signature calculated using given arguments. | [
"Returns",
"chunk",
"signature",
"calculated",
"using",
"given",
"arguments",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/Signer.java#L241-L251 | train |
minio/minio-java | api/src/main/java/io/minio/Signer.java | Signer.getChunkSeedSignature | public static String getChunkSeedSignature(Request request, String region, String secretKey)
throws NoSuchAlgorithmException, InvalidKeyException {
String contentSha256 = request.header("x-amz-content-sha256");
DateTime date = DateFormat.AMZ_DATE_FORMAT.parseDateTime(request.header("x-amz-date"));
Sign... | java | public static String getChunkSeedSignature(Request request, String region, String secretKey)
throws NoSuchAlgorithmException, InvalidKeyException {
String contentSha256 = request.header("x-amz-content-sha256");
DateTime date = DateFormat.AMZ_DATE_FORMAT.parseDateTime(request.header("x-amz-date"));
Sign... | [
"public",
"static",
"String",
"getChunkSeedSignature",
"(",
"Request",
"request",
",",
"String",
"region",
",",
"String",
"secretKey",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
"{",
"String",
"contentSha256",
"=",
"request",
".",
"header",... | Returns seed signature for given request. | [
"Returns",
"seed",
"signature",
"for",
"given",
"request",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/Signer.java#L257-L270 | train |
minio/minio-java | api/src/main/java/io/minio/Signer.java | Signer.signV4 | public static Request signV4(Request request, String region, String accessKey, String secretKey)
throws NoSuchAlgorithmException, InvalidKeyException {
String contentSha256 = request.header("x-amz-content-sha256");
DateTime date = DateFormat.AMZ_DATE_FORMAT.parseDateTime(request.header("x-amz-date"));
... | java | public static Request signV4(Request request, String region, String accessKey, String secretKey)
throws NoSuchAlgorithmException, InvalidKeyException {
String contentSha256 = request.header("x-amz-content-sha256");
DateTime date = DateFormat.AMZ_DATE_FORMAT.parseDateTime(request.header("x-amz-date"));
... | [
"public",
"static",
"Request",
"signV4",
"(",
"Request",
"request",
",",
"String",
"region",
",",
"String",
"accessKey",
",",
"String",
"secretKey",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
"{",
"String",
"contentSha256",
"=",
"request"... | Returns signed request object for given request, region, access key and secret key. | [
"Returns",
"signed",
"request",
"object",
"for",
"given",
"request",
"region",
"access",
"key",
"and",
"secret",
"key",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/Signer.java#L276-L290 | train |
minio/minio-java | api/src/main/java/io/minio/Signer.java | Signer.presignV4 | public static HttpUrl presignV4(Request request, String region, String accessKey, String secretKey, int expires)
throws NoSuchAlgorithmException, InvalidKeyException {
String contentSha256 = "UNSIGNED-PAYLOAD";
DateTime date = DateFormat.AMZ_DATE_FORMAT.parseDateTime(request.header("x-amz-date"));
Sign... | java | public static HttpUrl presignV4(Request request, String region, String accessKey, String secretKey, int expires)
throws NoSuchAlgorithmException, InvalidKeyException {
String contentSha256 = "UNSIGNED-PAYLOAD";
DateTime date = DateFormat.AMZ_DATE_FORMAT.parseDateTime(request.header("x-amz-date"));
Sign... | [
"public",
"static",
"HttpUrl",
"presignV4",
"(",
"Request",
"request",
",",
"String",
"region",
",",
"String",
"accessKey",
",",
"String",
"secretKey",
",",
"int",
"expires",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
"{",
"String",
"co... | Returns pre-signed HttpUrl object for given request, region, access key, secret key and expires time. | [
"Returns",
"pre",
"-",
"signed",
"HttpUrl",
"object",
"for",
"given",
"request",
"region",
"access",
"key",
"secret",
"key",
"and",
"expires",
"time",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/Signer.java#L328-L343 | train |
minio/minio-java | api/src/main/java/io/minio/Signer.java | Signer.credential | public static String credential(String accessKey, DateTime date, String region) {
return accessKey + "/" + date.toString(DateFormat.SIGNER_DATE_FORMAT) + "/" + region + "/s3/aws4_request";
} | java | public static String credential(String accessKey, DateTime date, String region) {
return accessKey + "/" + date.toString(DateFormat.SIGNER_DATE_FORMAT) + "/" + region + "/s3/aws4_request";
} | [
"public",
"static",
"String",
"credential",
"(",
"String",
"accessKey",
",",
"DateTime",
"date",
",",
"String",
"region",
")",
"{",
"return",
"accessKey",
"+",
"\"/\"",
"+",
"date",
".",
"toString",
"(",
"DateFormat",
".",
"SIGNER_DATE_FORMAT",
")",
"+",
"\"... | Returns credential string of given access key, date and region. | [
"Returns",
"credential",
"string",
"of",
"given",
"access",
"key",
"date",
"and",
"region",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/Signer.java#L349-L351 | train |
minio/minio-java | api/src/main/java/io/minio/Signer.java | Signer.postPresignV4 | public static String postPresignV4(String stringToSign, String secretKey, DateTime date, String region)
throws NoSuchAlgorithmException, InvalidKeyException {
Signer signer = new Signer(null, null, date, region, null, secretKey, null);
signer.stringToSign = stringToSign;
signer.setSigningKey();
sign... | java | public static String postPresignV4(String stringToSign, String secretKey, DateTime date, String region)
throws NoSuchAlgorithmException, InvalidKeyException {
Signer signer = new Signer(null, null, date, region, null, secretKey, null);
signer.stringToSign = stringToSign;
signer.setSigningKey();
sign... | [
"public",
"static",
"String",
"postPresignV4",
"(",
"String",
"stringToSign",
",",
"String",
"secretKey",
",",
"DateTime",
"date",
",",
"String",
"region",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
"{",
"Signer",
"signer",
"=",
"new",
... | Returns pre-signed post policy string for given stringToSign, secret key, date and region. | [
"Returns",
"pre",
"-",
"signed",
"post",
"policy",
"string",
"for",
"given",
"stringToSign",
"secret",
"key",
"date",
"and",
"region",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/Signer.java#L357-L365 | train |
minio/minio-java | api/src/main/java/io/minio/Signer.java | Signer.sumHmac | public static byte[] sumHmac(byte[] key, byte[] data)
throws NoSuchAlgorithmException, InvalidKeyException {
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(new SecretKeySpec(key, "HmacSHA256"));
mac.update(data);
return mac.doFinal();
} | java | public static byte[] sumHmac(byte[] key, byte[] data)
throws NoSuchAlgorithmException, InvalidKeyException {
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(new SecretKeySpec(key, "HmacSHA256"));
mac.update(data);
return mac.doFinal();
} | [
"public",
"static",
"byte",
"[",
"]",
"sumHmac",
"(",
"byte",
"[",
"]",
"key",
",",
"byte",
"[",
"]",
"data",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
"{",
"Mac",
"mac",
"=",
"Mac",
".",
"getInstance",
"(",
"\"HmacSHA256\"",
"... | Returns HMacSHA256 digest of given key and data. | [
"Returns",
"HMacSHA256",
"digest",
"of",
"given",
"key",
"and",
"data",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/Signer.java#L371-L379 | train |
minio/minio-java | api/src/main/java/io/minio/PostPolicy.java | PostPolicy.setContentType | public void setContentType(String contentType) throws InvalidArgumentException {
if (Strings.isNullOrEmpty(contentType)) {
throw new InvalidArgumentException("empty content type");
}
this.contentType = contentType;
} | java | public void setContentType(String contentType) throws InvalidArgumentException {
if (Strings.isNullOrEmpty(contentType)) {
throw new InvalidArgumentException("empty content type");
}
this.contentType = contentType;
} | [
"public",
"void",
"setContentType",
"(",
"String",
"contentType",
")",
"throws",
"InvalidArgumentException",
"{",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"contentType",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"empty content type\"",
... | Sets content type. | [
"Sets",
"content",
"type",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/PostPolicy.java#L86-L92 | train |
minio/minio-java | api/src/main/java/io/minio/PostPolicy.java | PostPolicy.setContentEncoding | public void setContentEncoding(String contentEncoding) throws InvalidArgumentException {
if (Strings.isNullOrEmpty(contentEncoding)) {
throw new InvalidArgumentException("empty content encoding");
}
this.contentEncoding = contentEncoding;
} | java | public void setContentEncoding(String contentEncoding) throws InvalidArgumentException {
if (Strings.isNullOrEmpty(contentEncoding)) {
throw new InvalidArgumentException("empty content encoding");
}
this.contentEncoding = contentEncoding;
} | [
"public",
"void",
"setContentEncoding",
"(",
"String",
"contentEncoding",
")",
"throws",
"InvalidArgumentException",
"{",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"contentEncoding",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"empty conte... | Sets content encoding. | [
"Sets",
"content",
"encoding",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/PostPolicy.java#L98-L104 | train |
minio/minio-java | api/src/main/java/io/minio/PostPolicy.java | PostPolicy.setContentRange | public void setContentRange(long startRange, long endRange) throws InvalidArgumentException {
if (startRange <= 0 || endRange <= 0) {
throw new InvalidArgumentException("negative start/end range");
}
if (startRange > endRange) {
throw new InvalidArgumentException("start range is higher than end... | java | public void setContentRange(long startRange, long endRange) throws InvalidArgumentException {
if (startRange <= 0 || endRange <= 0) {
throw new InvalidArgumentException("negative start/end range");
}
if (startRange > endRange) {
throw new InvalidArgumentException("start range is higher than end... | [
"public",
"void",
"setContentRange",
"(",
"long",
"startRange",
",",
"long",
"endRange",
")",
"throws",
"InvalidArgumentException",
"{",
"if",
"(",
"startRange",
"<=",
"0",
"||",
"endRange",
"<=",
"0",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
... | Sets content range. | [
"Sets",
"content",
"range",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/PostPolicy.java#L122-L133 | train |
minio/minio-java | api/src/main/java/io/minio/PostPolicy.java | PostPolicy.formData | public Map<String,String> formData(String accessKey, String secretKey, String region)
throws NoSuchAlgorithmException, InvalidKeyException, InvalidArgumentException {
if (Strings.isNullOrEmpty(region)) {
throw new InvalidArgumentException("empty region");
}
return makeFormData(accessKey, secre... | java | public Map<String,String> formData(String accessKey, String secretKey, String region)
throws NoSuchAlgorithmException, InvalidKeyException, InvalidArgumentException {
if (Strings.isNullOrEmpty(region)) {
throw new InvalidArgumentException("empty region");
}
return makeFormData(accessKey, secre... | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"formData",
"(",
"String",
"accessKey",
",",
"String",
"secretKey",
",",
"String",
"region",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
",",
"InvalidArgumentException",
"{",
"if",
"(",... | Returns form data of this post policy setting the provided region. | [
"Returns",
"form",
"data",
"of",
"this",
"post",
"policy",
"setting",
"the",
"provided",
"region",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/PostPolicy.java#L177-L185 | train |
minio/minio-java | api/src/main/java/io/minio/CopyConditions.java | CopyConditions.setModified | public void setModified(DateTime date) throws InvalidArgumentException {
if (date == null) {
throw new InvalidArgumentException("Date cannot be empty");
}
copyConditions.put("x-amz-copy-source-if-modified-since", date.toString(DateFormat.HTTP_HEADER_DATE_FORMAT));
} | java | public void setModified(DateTime date) throws InvalidArgumentException {
if (date == null) {
throw new InvalidArgumentException("Date cannot be empty");
}
copyConditions.put("x-amz-copy-source-if-modified-since", date.toString(DateFormat.HTTP_HEADER_DATE_FORMAT));
} | [
"public",
"void",
"setModified",
"(",
"DateTime",
"date",
")",
"throws",
"InvalidArgumentException",
"{",
"if",
"(",
"date",
"==",
"null",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"Date cannot be empty\"",
")",
";",
"}",
"copyConditions",
".",
... | Set modified condition, copy object modified since given time.
@throws InvalidArgumentException
When date is null | [
"Set",
"modified",
"condition",
"copy",
"object",
"modified",
"since",
"given",
"time",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/CopyConditions.java#L45-L50 | train |
minio/minio-java | api/src/main/java/io/minio/CopyConditions.java | CopyConditions.setMatchETag | public void setMatchETag(String etag) throws InvalidArgumentException {
if (etag == null) {
throw new InvalidArgumentException("ETag cannot be empty");
}
copyConditions.put("x-amz-copy-source-if-match", etag);
} | java | public void setMatchETag(String etag) throws InvalidArgumentException {
if (etag == null) {
throw new InvalidArgumentException("ETag cannot be empty");
}
copyConditions.put("x-amz-copy-source-if-match", etag);
} | [
"public",
"void",
"setMatchETag",
"(",
"String",
"etag",
")",
"throws",
"InvalidArgumentException",
"{",
"if",
"(",
"etag",
"==",
"null",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"ETag cannot be empty\"",
")",
";",
"}",
"copyConditions",
".",
... | Set matching ETag condition, copy object which matches
the following ETag.
@throws InvalidArgumentException
When etag is null | [
"Set",
"matching",
"ETag",
"condition",
"copy",
"object",
"which",
"matches",
"the",
"following",
"ETag",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/CopyConditions.java#L73-L78 | train |
minio/minio-java | api/src/main/java/io/minio/CopyConditions.java | CopyConditions.setMatchETagNone | public void setMatchETagNone(String etag) throws InvalidArgumentException {
if (etag == null) {
throw new InvalidArgumentException("ETag cannot be empty");
}
copyConditions.put("x-amz-copy-source-if-none-match", etag);
} | java | public void setMatchETagNone(String etag) throws InvalidArgumentException {
if (etag == null) {
throw new InvalidArgumentException("ETag cannot be empty");
}
copyConditions.put("x-amz-copy-source-if-none-match", etag);
} | [
"public",
"void",
"setMatchETagNone",
"(",
"String",
"etag",
")",
"throws",
"InvalidArgumentException",
"{",
"if",
"(",
"etag",
"==",
"null",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"ETag cannot be empty\"",
")",
";",
"}",
"copyConditions",
".... | Set matching ETag none condition, copy object which does not
match the following ETag.
@throws InvalidArgumentException
When etag is null | [
"Set",
"matching",
"ETag",
"none",
"condition",
"copy",
"object",
"which",
"does",
"not",
"match",
"the",
"following",
"ETag",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/CopyConditions.java#L87-L92 | train |
minio/minio-java | api/src/main/java/io/minio/messages/XmlEntity.java | XmlEntity.parseXml | public void parseXml(Reader reader) throws IOException, XmlPullParserException {
this.xmlPullParser.setInput(reader);
Xml.parseElement(this.xmlPullParser, this, this.defaultNamespaceDictionary, null);
} | java | public void parseXml(Reader reader) throws IOException, XmlPullParserException {
this.xmlPullParser.setInput(reader);
Xml.parseElement(this.xmlPullParser, this, this.defaultNamespaceDictionary, null);
} | [
"public",
"void",
"parseXml",
"(",
"Reader",
"reader",
")",
"throws",
"IOException",
",",
"XmlPullParserException",
"{",
"this",
".",
"xmlPullParser",
".",
"setInput",
"(",
"reader",
")",
";",
"Xml",
".",
"parseElement",
"(",
"this",
".",
"xmlPullParser",
",",... | Parses content from given reader input stream. | [
"Parses",
"content",
"from",
"given",
"reader",
"input",
"stream",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/messages/XmlEntity.java#L63-L66 | train |
minio/minio-java | api/src/main/java/io/minio/messages/XmlEntity.java | XmlEntity.parseXml | protected void parseXml(Reader reader, XmlNamespaceDictionary namespaceDictionary)
throws IOException, XmlPullParserException {
this.xmlPullParser.setInput(reader);
Xml.parseElement(this.xmlPullParser, this, namespaceDictionary, null);
} | java | protected void parseXml(Reader reader, XmlNamespaceDictionary namespaceDictionary)
throws IOException, XmlPullParserException {
this.xmlPullParser.setInput(reader);
Xml.parseElement(this.xmlPullParser, this, namespaceDictionary, null);
} | [
"protected",
"void",
"parseXml",
"(",
"Reader",
"reader",
",",
"XmlNamespaceDictionary",
"namespaceDictionary",
")",
"throws",
"IOException",
",",
"XmlPullParserException",
"{",
"this",
".",
"xmlPullParser",
".",
"setInput",
"(",
"reader",
")",
";",
"Xml",
".",
"p... | Parses content from given reader input stream and namespace dictionary. | [
"Parses",
"content",
"from",
"given",
"reader",
"input",
"stream",
"and",
"namespace",
"dictionary",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/messages/XmlEntity.java#L72-L76 | train |
minio/minio-java | api/src/main/java/io/minio/ChunkedInputStream.java | ChunkedInputStream.read | public int read() throws IOException {
if (this.bytesRead == this.length) {
// All chunks and final additional chunk are read.
// This means we have reached EOF.
return -1;
}
try {
// Read a chunk from given input stream when
// it is first chunk or all bytes in chunk body is ... | java | public int read() throws IOException {
if (this.bytesRead == this.length) {
// All chunks and final additional chunk are read.
// This means we have reached EOF.
return -1;
}
try {
// Read a chunk from given input stream when
// it is first chunk or all bytes in chunk body is ... | [
"public",
"int",
"read",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"bytesRead",
"==",
"this",
".",
"length",
")",
"{",
"// All chunks and final additional chunk are read.",
"// This means we have reached EOF.",
"return",
"-",
"1",
";",
"}",
"... | read single byte from chunk body. | [
"read",
"single",
"byte",
"from",
"chunk",
"body",
"."
] | b2028f56403c89ce2d5900ae813bc1314c87bc7f | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/ChunkedInputStream.java#L164-L203 | train |
pwittchen/ReactiveNetwork | library/src/main/java/com/github/pwittchen/reactivenetwork/library/rx2/internet/observing/strategy/SocketInternetObservingStrategy.java | SocketInternetObservingStrategy.adjustHost | protected String adjustHost(final String host) {
if (host.startsWith(HTTP_PROTOCOL)) {
return host.replace(HTTP_PROTOCOL, EMPTY_STRING);
} else if (host.startsWith(HTTPS_PROTOCOL)) {
return host.replace(HTTPS_PROTOCOL, EMPTY_STRING);
}
return host;
} | java | protected String adjustHost(final String host) {
if (host.startsWith(HTTP_PROTOCOL)) {
return host.replace(HTTP_PROTOCOL, EMPTY_STRING);
} else if (host.startsWith(HTTPS_PROTOCOL)) {
return host.replace(HTTPS_PROTOCOL, EMPTY_STRING);
}
return host;
} | [
"protected",
"String",
"adjustHost",
"(",
"final",
"String",
"host",
")",
"{",
"if",
"(",
"host",
".",
"startsWith",
"(",
"HTTP_PROTOCOL",
")",
")",
"{",
"return",
"host",
".",
"replace",
"(",
"HTTP_PROTOCOL",
",",
"EMPTY_STRING",
")",
";",
"}",
"else",
... | adjusts host to needs of SocketInternetObservingStrategy
@return transformed host | [
"adjusts",
"host",
"to",
"needs",
"of",
"SocketInternetObservingStrategy"
] | cfeb3b79a1e44d106581af5e6709ff206e60c369 | https://github.com/pwittchen/ReactiveNetwork/blob/cfeb3b79a1e44d106581af5e6709ff206e60c369/library/src/main/java/com/github/pwittchen/reactivenetwork/library/rx2/internet/observing/strategy/SocketInternetObservingStrategy.java#L81-L88 | train |
pwittchen/ReactiveNetwork | library/src/main/java/com/github/pwittchen/reactivenetwork/library/rx2/Preconditions.java | Preconditions.checkNotNullOrEmpty | public static void checkNotNullOrEmpty(String string, String message) {
if (string == null || string.isEmpty()) {
throw new IllegalArgumentException(message);
}
} | java | public static void checkNotNullOrEmpty(String string, String message) {
if (string == null || string.isEmpty()) {
throw new IllegalArgumentException(message);
}
} | [
"public",
"static",
"void",
"checkNotNullOrEmpty",
"(",
"String",
"string",
",",
"String",
"message",
")",
"{",
"if",
"(",
"string",
"==",
"null",
"||",
"string",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"message",... | Validation method, which checks if a string is null or empty
@param string to verify
@param message to be thrown in exception | [
"Validation",
"method",
"which",
"checks",
"if",
"a",
"string",
"is",
"null",
"or",
"empty"
] | cfeb3b79a1e44d106581af5e6709ff206e60c369 | https://github.com/pwittchen/ReactiveNetwork/blob/cfeb3b79a1e44d106581af5e6709ff206e60c369/library/src/main/java/com/github/pwittchen/reactivenetwork/library/rx2/Preconditions.java#L39-L43 | train |
pwittchen/ReactiveNetwork | library/src/main/java/com/github/pwittchen/reactivenetwork/library/rx2/ReactiveNetwork.java | ReactiveNetwork.observeNetworkConnectivity | @RequiresPermission(Manifest.permission.ACCESS_NETWORK_STATE)
public static Observable<Connectivity> observeNetworkConnectivity(final Context context) {
final NetworkObservingStrategy strategy;
if (Preconditions.isAtLeastAndroidMarshmallow()) {
strategy = new MarshmallowNetworkObservingStrategy();
... | java | @RequiresPermission(Manifest.permission.ACCESS_NETWORK_STATE)
public static Observable<Connectivity> observeNetworkConnectivity(final Context context) {
final NetworkObservingStrategy strategy;
if (Preconditions.isAtLeastAndroidMarshmallow()) {
strategy = new MarshmallowNetworkObservingStrategy();
... | [
"@",
"RequiresPermission",
"(",
"Manifest",
".",
"permission",
".",
"ACCESS_NETWORK_STATE",
")",
"public",
"static",
"Observable",
"<",
"Connectivity",
">",
"observeNetworkConnectivity",
"(",
"final",
"Context",
"context",
")",
"{",
"final",
"NetworkObservingStrategy",
... | Observes network connectivity. Information about network state, type and typeName are contained
in
observed Connectivity object.
@param context Context of the activity or an application
@return RxJava Observable with Connectivity class containing information about network state,
type and typeName | [
"Observes",
"network",
"connectivity",
".",
"Information",
"about",
"network",
"state",
"type",
"and",
"typeName",
"are",
"contained",
"in",
"observed",
"Connectivity",
"object",
"."
] | cfeb3b79a1e44d106581af5e6709ff206e60c369 | https://github.com/pwittchen/ReactiveNetwork/blob/cfeb3b79a1e44d106581af5e6709ff206e60c369/library/src/main/java/com/github/pwittchen/reactivenetwork/library/rx2/ReactiveNetwork.java#L60-L73 | train |
pwittchen/ReactiveNetwork | library/src/main/java/com/github/pwittchen/reactivenetwork/library/rx2/ReactiveNetwork.java | ReactiveNetwork.observeNetworkConnectivity | @RequiresPermission(Manifest.permission.ACCESS_NETWORK_STATE)
public static Observable<Connectivity> observeNetworkConnectivity(final Context context,
final NetworkObservingStrategy strategy) {
Preconditions.checkNotNull(context, "context == null");
Preconditions.checkNotNull(strategy, "strategy == null... | java | @RequiresPermission(Manifest.permission.ACCESS_NETWORK_STATE)
public static Observable<Connectivity> observeNetworkConnectivity(final Context context,
final NetworkObservingStrategy strategy) {
Preconditions.checkNotNull(context, "context == null");
Preconditions.checkNotNull(strategy, "strategy == null... | [
"@",
"RequiresPermission",
"(",
"Manifest",
".",
"permission",
".",
"ACCESS_NETWORK_STATE",
")",
"public",
"static",
"Observable",
"<",
"Connectivity",
">",
"observeNetworkConnectivity",
"(",
"final",
"Context",
"context",
",",
"final",
"NetworkObservingStrategy",
"stra... | Observes network connectivity. Information about network state, type and typeName are contained
in observed Connectivity object. Moreover, allows you to define NetworkObservingStrategy.
@param context Context of the activity or an application
@param strategy NetworkObserving strategy to be applied - you can use one of... | [
"Observes",
"network",
"connectivity",
".",
"Information",
"about",
"network",
"state",
"type",
"and",
"typeName",
"are",
"contained",
"in",
"observed",
"Connectivity",
"object",
".",
"Moreover",
"allows",
"you",
"to",
"define",
"NetworkObservingStrategy",
"."
] | cfeb3b79a1e44d106581af5e6709ff206e60c369 | https://github.com/pwittchen/ReactiveNetwork/blob/cfeb3b79a1e44d106581af5e6709ff206e60c369/library/src/main/java/com/github/pwittchen/reactivenetwork/library/rx2/ReactiveNetwork.java#L86-L92 | train |
pwittchen/ReactiveNetwork | library/src/main/java/com/github/pwittchen/reactivenetwork/library/rx2/ReactiveNetwork.java | ReactiveNetwork.observeInternetConnectivity | @RequiresPermission(Manifest.permission.INTERNET)
protected static Observable<Boolean> observeInternetConnectivity(
final InternetObservingStrategy strategy, final int initialIntervalInMs,
final int intervalInMs, final String host, final int port, final int timeoutInMs,
final int httpResponse, final... | java | @RequiresPermission(Manifest.permission.INTERNET)
protected static Observable<Boolean> observeInternetConnectivity(
final InternetObservingStrategy strategy, final int initialIntervalInMs,
final int intervalInMs, final String host, final int port, final int timeoutInMs,
final int httpResponse, final... | [
"@",
"RequiresPermission",
"(",
"Manifest",
".",
"permission",
".",
"INTERNET",
")",
"protected",
"static",
"Observable",
"<",
"Boolean",
">",
"observeInternetConnectivity",
"(",
"final",
"InternetObservingStrategy",
"strategy",
",",
"final",
"int",
"initialIntervalInMs... | Observes connectivity with the Internet in a given time interval.
@param strategy for observing Internet connectivity
@param initialIntervalInMs in milliseconds determining the delay of the first connectivity
check
@param intervalInMs in milliseconds determining how often we want to check connectivity
@param host for ... | [
"Observes",
"connectivity",
"with",
"the",
"Internet",
"in",
"a",
"given",
"time",
"interval",
"."
] | cfeb3b79a1e44d106581af5e6709ff206e60c369 | https://github.com/pwittchen/ReactiveNetwork/blob/cfeb3b79a1e44d106581af5e6709ff206e60c369/library/src/main/java/com/github/pwittchen/reactivenetwork/library/rx2/ReactiveNetwork.java#L142-L150 | train |
pwittchen/ReactiveNetwork | library/src/main/java/com/github/pwittchen/reactivenetwork/library/rx2/ConnectivityPredicate.java | ConnectivityPredicate.appendUnknownNetworkTypeToTypes | protected static int[] appendUnknownNetworkTypeToTypes(int[] types) {
int i = 0;
final int[] extendedTypes = new int[types.length + 1];
for (int type : types) {
extendedTypes[i] = type;
i++;
}
extendedTypes[i] = Connectivity.UNKNOWN_TYPE;
return extendedTypes;
} | java | protected static int[] appendUnknownNetworkTypeToTypes(int[] types) {
int i = 0;
final int[] extendedTypes = new int[types.length + 1];
for (int type : types) {
extendedTypes[i] = type;
i++;
}
extendedTypes[i] = Connectivity.UNKNOWN_TYPE;
return extendedTypes;
} | [
"protected",
"static",
"int",
"[",
"]",
"appendUnknownNetworkTypeToTypes",
"(",
"int",
"[",
"]",
"types",
")",
"{",
"int",
"i",
"=",
"0",
";",
"final",
"int",
"[",
"]",
"extendedTypes",
"=",
"new",
"int",
"[",
"types",
".",
"length",
"+",
"1",
"]",
"... | Returns network types from the input with additional unknown type,
what helps during connections filtering when device
is being disconnected from a specific network
@param types of the network as an array of ints
@return types of the network with unknown type as an array of ints | [
"Returns",
"network",
"types",
"from",
"the",
"input",
"with",
"additional",
"unknown",
"type",
"what",
"helps",
"during",
"connections",
"filtering",
"when",
"device",
"is",
"being",
"disconnected",
"from",
"a",
"specific",
"network"
] | cfeb3b79a1e44d106581af5e6709ff206e60c369 | https://github.com/pwittchen/ReactiveNetwork/blob/cfeb3b79a1e44d106581af5e6709ff206e60c369/library/src/main/java/com/github/pwittchen/reactivenetwork/library/rx2/ConnectivityPredicate.java#L79-L88 | train |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/json/JSONParser.java | JSONParser.getAndParseHexChar | private int getAndParseHexChar() throws ParseException {
final char hexChar = getc();
if (hexChar >= '0' && hexChar <= '9') {
return hexChar - '0';
} else if (hexChar >= 'a' && hexChar <= 'f') {
return hexChar - 'a' + 10;
} else if (hexChar >= 'A' && hexChar <= 'F... | java | private int getAndParseHexChar() throws ParseException {
final char hexChar = getc();
if (hexChar >= '0' && hexChar <= '9') {
return hexChar - '0';
} else if (hexChar >= 'a' && hexChar <= 'f') {
return hexChar - 'a' + 10;
} else if (hexChar >= 'A' && hexChar <= 'F... | [
"private",
"int",
"getAndParseHexChar",
"(",
")",
"throws",
"ParseException",
"{",
"final",
"char",
"hexChar",
"=",
"getc",
"(",
")",
";",
"if",
"(",
"hexChar",
">=",
"'",
"'",
"&&",
"hexChar",
"<=",
"'",
"'",
")",
"{",
"return",
"hexChar",
"-",
"'",
... | Get and parse a hexadecimal digit character.
@return the hex char
@throws ParseException
if the character was not hexadecimal | [
"Get",
"and",
"parse",
"a",
"hexadecimal",
"digit",
"character",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/json/JSONParser.java#L68-L79 | train |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/json/JSONParser.java | JSONParser.parseNumber | private Number parseNumber() throws ParseException {
final int startIdx = getPosition();
if (peekMatches("Infinity")) {
advance(8);
return Double.POSITIVE_INFINITY;
} else if (peekMatches("-Infinity")) {
advance(9);
return Double.NEGATIVE_INFINITY;... | java | private Number parseNumber() throws ParseException {
final int startIdx = getPosition();
if (peekMatches("Infinity")) {
advance(8);
return Double.POSITIVE_INFINITY;
} else if (peekMatches("-Infinity")) {
advance(9);
return Double.NEGATIVE_INFINITY;... | [
"private",
"Number",
"parseNumber",
"(",
")",
"throws",
"ParseException",
"{",
"final",
"int",
"startIdx",
"=",
"getPosition",
"(",
")",
";",
"if",
"(",
"peekMatches",
"(",
"\"Infinity\"",
")",
")",
"{",
"advance",
"(",
"8",
")",
";",
"return",
"Double",
... | Parses and returns Integer, Long or Double type.
<pre>
Number ← Minus? IntegralPart FractionalPart? ExponentPart?
Minus ← "-"
IntegralPart ← "0" / [1-9] [0-9]*
FractionalPart ← "." [0-9]+
ExponentPart ← ( "e" / "E" ) ( "+" / "-" )? [0-9]+
</pre>
@return the number
@throws ParseException
if parsing fails | [
"Parses",
"and",
"returns",
"Integer",
"Long",
"or",
"Double",
"type",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/json/JSONParser.java#L211-L286 | train |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/json/JSONParser.java | JSONParser.parseJSONObject | private JSONObject parseJSONObject() throws ParseException {
expect('{');
skipWhitespace();
if (peek() == '}') {
// Empty object
next();
return new JSONObject(Collections.<Entry<String, Object>> emptyList());
}
final List<Entry<String, Object>... | java | private JSONObject parseJSONObject() throws ParseException {
expect('{');
skipWhitespace();
if (peek() == '}') {
// Empty object
next();
return new JSONObject(Collections.<Entry<String, Object>> emptyList());
}
final List<Entry<String, Object>... | [
"private",
"JSONObject",
"parseJSONObject",
"(",
")",
"throws",
"ParseException",
"{",
"expect",
"(",
"'",
"'",
")",
";",
"skipWhitespace",
"(",
")",
";",
"if",
"(",
"peek",
"(",
")",
"==",
"'",
"'",
")",
"{",
"// Empty object",
"next",
"(",
")",
";",
... | Parse a JSON Object.
<pre>
Object ← "{" ( String ":" JSON ( "," String ":" JSON )* / S? ) "}"
</pre>
@return the JSON object
@throws ParseException
if parsing fails | [
"Parse",
"a",
"JSON",
"Object",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/json/JSONParser.java#L342-L382 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ObjectTypedValueWrapper.java | ObjectTypedValueWrapper.instantiateOrGet | Object instantiateOrGet(final ClassInfo annotationClassInfo, final String paramName) {
final boolean instantiate = annotationClassInfo != null;
if (enumValue != null) {
return instantiate ? enumValue.loadClassAndReturnEnumValue() : enumValue;
} else if (classRef != null) {
... | java | Object instantiateOrGet(final ClassInfo annotationClassInfo, final String paramName) {
final boolean instantiate = annotationClassInfo != null;
if (enumValue != null) {
return instantiate ? enumValue.loadClassAndReturnEnumValue() : enumValue;
} else if (classRef != null) {
... | [
"Object",
"instantiateOrGet",
"(",
"final",
"ClassInfo",
"annotationClassInfo",
",",
"final",
"String",
"paramName",
")",
"{",
"final",
"boolean",
"instantiate",
"=",
"annotationClassInfo",
"!=",
"null",
";",
"if",
"(",
"enumValue",
"!=",
"null",
")",
"{",
"retu... | Instantiate or get the wrapped value.
@param annotationClassInfo
if non-null, instantiate this object as a parameter value of this annotation class.
@param paramName
if non-null, instantiate this object as a value of this named parameter.
@return The value wrapped by this wrapper class. | [
"Instantiate",
"or",
"get",
"the",
"wrapped",
"value",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ObjectTypedValueWrapper.java#L196-L262 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ObjectTypedValueWrapper.java | ObjectTypedValueWrapper.getArrayValueClassOrName | private Object getArrayValueClassOrName(final ClassInfo annotationClassInfo, final String paramName,
final boolean getClass) {
// Find the method in the annotation class with the same name as the annotation parameter.
final MethodInfoList annotationMethodList = annotationClassInfo.methodInfo... | java | private Object getArrayValueClassOrName(final ClassInfo annotationClassInfo, final String paramName,
final boolean getClass) {
// Find the method in the annotation class with the same name as the annotation parameter.
final MethodInfoList annotationMethodList = annotationClassInfo.methodInfo... | [
"private",
"Object",
"getArrayValueClassOrName",
"(",
"final",
"ClassInfo",
"annotationClassInfo",
",",
"final",
"String",
"paramName",
",",
"final",
"boolean",
"getClass",
")",
"{",
"// Find the method in the annotation class with the same name as the annotation parameter.",
"fi... | Get the element type of an array element.
@param annotationClassInfo
annotation class
@param paramName
the parameter name
@param getClass
If true, return a {@code Class<?>} reference, otherwise return the class name.
@return the array value type as a {@code Class<?>} reference if getClass is true, otherwise the class ... | [
"Get",
"the",
"element",
"type",
"of",
"an",
"array",
"element",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ObjectTypedValueWrapper.java#L287-L343 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ClassGraph.java | ClassGraph.enableAllInfo | public ClassGraph enableAllInfo() {
enableClassInfo();
enableFieldInfo();
enableMethodInfo();
enableAnnotationInfo();
enableStaticFinalFieldConstantInitializerValues();
ignoreClassVisibility();
ignoreFieldVisibility();
ignoreMethodVisibility();
ret... | java | public ClassGraph enableAllInfo() {
enableClassInfo();
enableFieldInfo();
enableMethodInfo();
enableAnnotationInfo();
enableStaticFinalFieldConstantInitializerValues();
ignoreClassVisibility();
ignoreFieldVisibility();
ignoreMethodVisibility();
ret... | [
"public",
"ClassGraph",
"enableAllInfo",
"(",
")",
"{",
"enableClassInfo",
"(",
")",
";",
"enableFieldInfo",
"(",
")",
";",
"enableMethodInfo",
"(",
")",
";",
"enableAnnotationInfo",
"(",
")",
";",
"enableStaticFinalFieldConstantInitializerValues",
"(",
")",
";",
... | Enables the scanning of all classes, fields, methods, annotations, and static final field constant
initializer values, and ignores all visibility modifiers, so that both public and non-public classes, fields
and methods are all scanned.
<p>
Calls {@link #enableClassInfo()}, {@link #enableFieldInfo()}, {@link #enableMe... | [
"Enables",
"the",
"scanning",
"of",
"all",
"classes",
"fields",
"methods",
"annotations",
"and",
"static",
"final",
"field",
"constant",
"initializer",
"values",
"and",
"ignores",
"all",
"visibility",
"modifiers",
"so",
"that",
"both",
"public",
"and",
"non",
"-... | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassGraph.java#L126-L136 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ClassGraph.java | ClassGraph.overrideClasspath | public ClassGraph overrideClasspath(final Iterable<?> overrideClasspathElements) {
final String overrideClasspath = JarUtils.pathElementsToPathStr(overrideClasspathElements);
if (overrideClasspath.isEmpty()) {
throw new IllegalArgumentException("Can't override classpath with an empty path");... | java | public ClassGraph overrideClasspath(final Iterable<?> overrideClasspathElements) {
final String overrideClasspath = JarUtils.pathElementsToPathStr(overrideClasspathElements);
if (overrideClasspath.isEmpty()) {
throw new IllegalArgumentException("Can't override classpath with an empty path");... | [
"public",
"ClassGraph",
"overrideClasspath",
"(",
"final",
"Iterable",
"<",
"?",
">",
"overrideClasspathElements",
")",
"{",
"final",
"String",
"overrideClasspath",
"=",
"JarUtils",
".",
"pathElementsToPathStr",
"(",
"overrideClasspathElements",
")",
";",
"if",
"(",
... | Override the automatically-detected classpath with a custom path. Causes system ClassLoaders and the
java.class.path system property to be ignored. Also causes modules not to be scanned.
<p>
Works for Iterables of any type whose toString() method resolves to a classpath element string, e.g. String,
File or Path.
@par... | [
"Override",
"the",
"automatically",
"-",
"detected",
"classpath",
"with",
"a",
"custom",
"path",
".",
"Causes",
"system",
"ClassLoaders",
"and",
"the",
"java",
".",
"class",
".",
"path",
"system",
"property",
"to",
"be",
"ignored",
".",
"Also",
"causes",
"mo... | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassGraph.java#L388-L395 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ClassGraph.java | ClassGraph.whitelistPackages | public ClassGraph whitelistPackages(final String... packageNames) {
enableClassInfo();
for (final String packageName : packageNames) {
final String packageNameNormalized = WhiteBlackList.normalizePackageOrClassName(packageName);
if (packageNameNormalized.startsWith("!") || packag... | java | public ClassGraph whitelistPackages(final String... packageNames) {
enableClassInfo();
for (final String packageName : packageNames) {
final String packageNameNormalized = WhiteBlackList.normalizePackageOrClassName(packageName);
if (packageNameNormalized.startsWith("!") || packag... | [
"public",
"ClassGraph",
"whitelistPackages",
"(",
"final",
"String",
"...",
"packageNames",
")",
"{",
"enableClassInfo",
"(",
")",
";",
"for",
"(",
"final",
"String",
"packageName",
":",
"packageNames",
")",
"{",
"final",
"String",
"packageNameNormalized",
"=",
... | Scan one or more specific packages and their sub-packages.
<p>
N.B. Automatically calls {@link #enableClassInfo()} -- call {@link #whitelistPaths(String...)} instead if you
only need to scan resources.
@param packageNames
The fully-qualified names of packages to scan (using '.' as a separator). May include a glob
wil... | [
"Scan",
"one",
"or",
"more",
"specific",
"packages",
"and",
"their",
"sub",
"-",
"packages",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassGraph.java#L558-L585 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ClassGraph.java | ClassGraph.whitelistPaths | public ClassGraph whitelistPaths(final String... paths) {
for (final String path : paths) {
final String pathNormalized = WhiteBlackList.normalizePath(path);
// Whitelist path
final String packageName = WhiteBlackList.pathToPackageName(pathNormalized);
scanSpec.pa... | java | public ClassGraph whitelistPaths(final String... paths) {
for (final String path : paths) {
final String pathNormalized = WhiteBlackList.normalizePath(path);
// Whitelist path
final String packageName = WhiteBlackList.pathToPackageName(pathNormalized);
scanSpec.pa... | [
"public",
"ClassGraph",
"whitelistPaths",
"(",
"final",
"String",
"...",
"paths",
")",
"{",
"for",
"(",
"final",
"String",
"path",
":",
"paths",
")",
"{",
"final",
"String",
"pathNormalized",
"=",
"WhiteBlackList",
".",
"normalizePath",
"(",
"path",
")",
";"... | Scan one or more specific paths, and their sub-directories or nested paths.
@param paths
The paths to scan, relative to the package root of the classpath element (with '/' as a
separator). May include a glob wildcard ({@code '*'}).
@return this (for method chaining). | [
"Scan",
"one",
"or",
"more",
"specific",
"paths",
"and",
"their",
"sub",
"-",
"directories",
"or",
"nested",
"paths",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassGraph.java#L595-L617 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ClassGraph.java | ClassGraph.whitelistPackagesNonRecursive | public ClassGraph whitelistPackagesNonRecursive(final String... packageNames) {
enableClassInfo();
for (final String packageName : packageNames) {
final String packageNameNormalized = WhiteBlackList.normalizePackageOrClassName(packageName);
if (packageNameNormalized.contains("*")... | java | public ClassGraph whitelistPackagesNonRecursive(final String... packageNames) {
enableClassInfo();
for (final String packageName : packageNames) {
final String packageNameNormalized = WhiteBlackList.normalizePackageOrClassName(packageName);
if (packageNameNormalized.contains("*")... | [
"public",
"ClassGraph",
"whitelistPackagesNonRecursive",
"(",
"final",
"String",
"...",
"packageNames",
")",
"{",
"enableClassInfo",
"(",
")",
";",
"for",
"(",
"final",
"String",
"packageName",
":",
"packageNames",
")",
"{",
"final",
"String",
"packageNameNormalized... | Scan one or more specific packages, without recursively scanning sub-packages unless they are themselves
whitelisted.
<p>
N.B. Automatically calls {@link #enableClassInfo()} -- call {@link #whitelistPathsNonRecursive(String...)}
instead if you only need to scan resources.
<p>
This may be particularly useful for scann... | [
"Scan",
"one",
"or",
"more",
"specific",
"packages",
"without",
"recursively",
"scanning",
"sub",
"-",
"packages",
"unless",
"they",
"are",
"themselves",
"whitelisted",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassGraph.java#L637-L653 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ClassGraph.java | ClassGraph.whitelistPathsNonRecursive | public ClassGraph whitelistPathsNonRecursive(final String... paths) {
for (final String path : paths) {
if (path.contains("*")) {
throw new IllegalArgumentException("Cannot use a glob wildcard here: " + path);
}
final String pathNormalized = WhiteBlackList.nor... | java | public ClassGraph whitelistPathsNonRecursive(final String... paths) {
for (final String path : paths) {
if (path.contains("*")) {
throw new IllegalArgumentException("Cannot use a glob wildcard here: " + path);
}
final String pathNormalized = WhiteBlackList.nor... | [
"public",
"ClassGraph",
"whitelistPathsNonRecursive",
"(",
"final",
"String",
"...",
"paths",
")",
"{",
"for",
"(",
"final",
"String",
"path",
":",
"paths",
")",
"{",
"if",
"(",
"path",
".",
"contains",
"(",
"\"*\"",
")",
")",
"{",
"throw",
"new",
"Illeg... | Scan one or more specific paths, without recursively scanning sub-directories or nested paths unless they are
themselves whitelisted.
<p>
This may be particularly useful for scanning the package root ("") without recursively scanning everything in
the jar, dir or module.
@param paths
The paths to scan, relative to th... | [
"Scan",
"one",
"or",
"more",
"specific",
"paths",
"without",
"recursively",
"scanning",
"sub",
"-",
"directories",
"or",
"nested",
"paths",
"unless",
"they",
"are",
"themselves",
"whitelisted",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassGraph.java#L668-L682 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ClassGraph.java | ClassGraph.blacklistPackages | public ClassGraph blacklistPackages(final String... packageNames) {
enableClassInfo();
for (final String packageName : packageNames) {
final String packageNameNormalized = WhiteBlackList.normalizePackageOrClassName(packageName);
if (packageNameNormalized.isEmpty()) {
... | java | public ClassGraph blacklistPackages(final String... packageNames) {
enableClassInfo();
for (final String packageName : packageNames) {
final String packageNameNormalized = WhiteBlackList.normalizePackageOrClassName(packageName);
if (packageNameNormalized.isEmpty()) {
... | [
"public",
"ClassGraph",
"blacklistPackages",
"(",
"final",
"String",
"...",
"packageNames",
")",
"{",
"enableClassInfo",
"(",
")",
";",
"for",
"(",
"final",
"String",
"packageName",
":",
"packageNames",
")",
"{",
"final",
"String",
"packageNameNormalized",
"=",
... | Prevent the scanning of one or more specific packages and their sub-packages.
<p>
N.B. Automatically calls {@link #enableClassInfo()} -- call {@link #blacklistPaths(String...)} instead if you
only need to scan resources.
@param packageNames
The fully-qualified names of packages to blacklist (with '.' as a separator).... | [
"Prevent",
"the",
"scanning",
"of",
"one",
"or",
"more",
"specific",
"packages",
"and",
"their",
"sub",
"-",
"packages",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassGraph.java#L696-L715 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ClassGraph.java | ClassGraph.whitelistClasses | public ClassGraph whitelistClasses(final String... classNames) {
enableClassInfo();
for (final String className : classNames) {
if (className.contains("*")) {
throw new IllegalArgumentException("Cannot use a glob wildcard here: " + className);
}
final ... | java | public ClassGraph whitelistClasses(final String... classNames) {
enableClassInfo();
for (final String className : classNames) {
if (className.contains("*")) {
throw new IllegalArgumentException("Cannot use a glob wildcard here: " + className);
}
final ... | [
"public",
"ClassGraph",
"whitelistClasses",
"(",
"final",
"String",
"...",
"classNames",
")",
"{",
"enableClassInfo",
"(",
")",
";",
"for",
"(",
"final",
"String",
"className",
":",
"classNames",
")",
"{",
"if",
"(",
"className",
".",
"contains",
"(",
"\"*\"... | Scan one or more specific classes, without scanning other classes in the same package unless the package is
itself whitelisted.
<p>
N.B. Automatically calls {@link #enableClassInfo()}.
@param classNames
The fully-qualified names of classes to scan (using '.' as a separator). May not include a glob
wildcard ({@code '... | [
"Scan",
"one",
"or",
"more",
"specific",
"classes",
"without",
"scanning",
"other",
"classes",
"in",
"the",
"same",
"package",
"unless",
"the",
"package",
"is",
"itself",
"whitelisted",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassGraph.java#L757-L776 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ClassGraph.java | ClassGraph.blacklistClasses | public ClassGraph blacklistClasses(final String... classNames) {
enableClassInfo();
for (final String className : classNames) {
if (className.contains("*")) {
throw new IllegalArgumentException("Cannot use a glob wildcard here: " + className);
}
final ... | java | public ClassGraph blacklistClasses(final String... classNames) {
enableClassInfo();
for (final String className : classNames) {
if (className.contains("*")) {
throw new IllegalArgumentException("Cannot use a glob wildcard here: " + className);
}
final ... | [
"public",
"ClassGraph",
"blacklistClasses",
"(",
"final",
"String",
"...",
"classNames",
")",
"{",
"enableClassInfo",
"(",
")",
";",
"for",
"(",
"final",
"String",
"className",
":",
"classNames",
")",
"{",
"if",
"(",
"className",
".",
"contains",
"(",
"\"*\"... | Specifically blacklist one or more specific classes, preventing them from being scanned even if they are in a
whitelisted package.
<p>
N.B. Automatically calls {@link #enableClassInfo()}.
@param classNames
The fully-qualified names of classes to blacklist (using '.' as a separator). May not include a
glob wildcard ({... | [
"Specifically",
"blacklist",
"one",
"or",
"more",
"specific",
"classes",
"preventing",
"them",
"from",
"being",
"scanned",
"even",
"if",
"they",
"are",
"in",
"a",
"whitelisted",
"package",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassGraph.java#L790-L802 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ClassGraph.java | ClassGraph.whitelistJars | public ClassGraph whitelistJars(final String... jarLeafNames) {
for (final String jarLeafName : jarLeafNames) {
final String leafName = JarUtils.leafName(jarLeafName);
if (!leafName.equals(jarLeafName)) {
throw new IllegalArgumentException("Can only whitelist jars by leaf... | java | public ClassGraph whitelistJars(final String... jarLeafNames) {
for (final String jarLeafName : jarLeafNames) {
final String leafName = JarUtils.leafName(jarLeafName);
if (!leafName.equals(jarLeafName)) {
throw new IllegalArgumentException("Can only whitelist jars by leaf... | [
"public",
"ClassGraph",
"whitelistJars",
"(",
"final",
"String",
"...",
"jarLeafNames",
")",
"{",
"for",
"(",
"final",
"String",
"jarLeafName",
":",
"jarLeafNames",
")",
"{",
"final",
"String",
"leafName",
"=",
"JarUtils",
".",
"leafName",
"(",
"jarLeafName",
... | Whitelist one or more jars. This will cause only the whitelisted jars to be scanned.
@param jarLeafNames
The leafnames of the jars that should be scanned (e.g. {@code "mylib.jar"}). May contain a
wildcard glob ({@code "mylib-*.jar"}).
@return this (for method chaining). | [
"Whitelist",
"one",
"or",
"more",
"jars",
".",
"This",
"will",
"cause",
"only",
"the",
"whitelisted",
"jars",
"to",
"be",
"scanned",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassGraph.java#L812-L821 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ClassGraph.java | ClassGraph.blacklistJars | public ClassGraph blacklistJars(final String... jarLeafNames) {
for (final String jarLeafName : jarLeafNames) {
final String leafName = JarUtils.leafName(jarLeafName);
if (!leafName.equals(jarLeafName)) {
throw new IllegalArgumentException("Can only blacklist jars by leaf... | java | public ClassGraph blacklistJars(final String... jarLeafNames) {
for (final String jarLeafName : jarLeafNames) {
final String leafName = JarUtils.leafName(jarLeafName);
if (!leafName.equals(jarLeafName)) {
throw new IllegalArgumentException("Can only blacklist jars by leaf... | [
"public",
"ClassGraph",
"blacklistJars",
"(",
"final",
"String",
"...",
"jarLeafNames",
")",
"{",
"for",
"(",
"final",
"String",
"jarLeafName",
":",
"jarLeafNames",
")",
"{",
"final",
"String",
"leafName",
"=",
"JarUtils",
".",
"leafName",
"(",
"jarLeafName",
... | Blacklist one or more jars, preventing them from being scanned.
@param jarLeafNames
The leafnames of the jars that should be scanned (e.g. {@code "badlib.jar"}). May contain a
wildcard glob ({@code "badlib-*.jar"}).
@return this (for method chaining). | [
"Blacklist",
"one",
"or",
"more",
"jars",
"preventing",
"them",
"from",
"being",
"scanned",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassGraph.java#L831-L840 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ClassGraph.java | ClassGraph.whitelistOrBlacklistLibOrExtJars | private void whitelistOrBlacklistLibOrExtJars(final boolean whitelist, final String... jarLeafNames) {
if (jarLeafNames.length == 0) {
// If no jar leafnames are given, whitelist or blacklist all lib or ext jars
for (final String libOrExtJar : SystemJarFinder.getJreLibOrExtJars()) {
... | java | private void whitelistOrBlacklistLibOrExtJars(final boolean whitelist, final String... jarLeafNames) {
if (jarLeafNames.length == 0) {
// If no jar leafnames are given, whitelist or blacklist all lib or ext jars
for (final String libOrExtJar : SystemJarFinder.getJreLibOrExtJars()) {
... | [
"private",
"void",
"whitelistOrBlacklistLibOrExtJars",
"(",
"final",
"boolean",
"whitelist",
",",
"final",
"String",
"...",
"jarLeafNames",
")",
"{",
"if",
"(",
"jarLeafNames",
".",
"length",
"==",
"0",
")",
"{",
"// If no jar leafnames are given, whitelist or blacklist... | Add lib or ext jars to whitelist or blacklist.
@param whitelist
if true, add to whitelist, otherwise add to blacklist.
@param jarLeafNames
the jar leaf names to whitelist | [
"Add",
"lib",
"or",
"ext",
"jars",
"to",
"whitelist",
"or",
"blacklist",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassGraph.java#L850-L905 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ClassGraph.java | ClassGraph.whitelistModules | public ClassGraph whitelistModules(final String... moduleNames) {
for (final String moduleName : moduleNames) {
scanSpec.moduleWhiteBlackList.addToWhitelist(WhiteBlackList.normalizePackageOrClassName(moduleName));
}
return this;
} | java | public ClassGraph whitelistModules(final String... moduleNames) {
for (final String moduleName : moduleNames) {
scanSpec.moduleWhiteBlackList.addToWhitelist(WhiteBlackList.normalizePackageOrClassName(moduleName));
}
return this;
} | [
"public",
"ClassGraph",
"whitelistModules",
"(",
"final",
"String",
"...",
"moduleNames",
")",
"{",
"for",
"(",
"final",
"String",
"moduleName",
":",
"moduleNames",
")",
"{",
"scanSpec",
".",
"moduleWhiteBlackList",
".",
"addToWhitelist",
"(",
"WhiteBlackList",
".... | Whitelist one or more modules to scan.
@param moduleNames
The names of the modules that should be scanned. May contain a wildcard glob ({@code '*'}).
@return this (for method chaining). | [
"Whitelist",
"one",
"or",
"more",
"modules",
"to",
"scan",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassGraph.java#L943-L948 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ClassGraph.java | ClassGraph.blacklistModules | public ClassGraph blacklistModules(final String... moduleNames) {
for (final String moduleName : moduleNames) {
scanSpec.moduleWhiteBlackList.addToBlacklist(WhiteBlackList.normalizePackageOrClassName(moduleName));
}
return this;
} | java | public ClassGraph blacklistModules(final String... moduleNames) {
for (final String moduleName : moduleNames) {
scanSpec.moduleWhiteBlackList.addToBlacklist(WhiteBlackList.normalizePackageOrClassName(moduleName));
}
return this;
} | [
"public",
"ClassGraph",
"blacklistModules",
"(",
"final",
"String",
"...",
"moduleNames",
")",
"{",
"for",
"(",
"final",
"String",
"moduleName",
":",
"moduleNames",
")",
"{",
"scanSpec",
".",
"moduleWhiteBlackList",
".",
"addToBlacklist",
"(",
"WhiteBlackList",
".... | Blacklist one or more modules, preventing them from being scanned.
@param moduleNames
The names of the modules that should not be scanned. May contain a wildcard glob ({@code '*'}).
@return this (for method chaining). | [
"Blacklist",
"one",
"or",
"more",
"modules",
"preventing",
"them",
"from",
"being",
"scanned",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassGraph.java#L957-L962 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ClassGraph.java | ClassGraph.whitelistClasspathElementsContainingResourcePath | public ClassGraph whitelistClasspathElementsContainingResourcePath(final String... resourcePaths) {
for (final String resourcePath : resourcePaths) {
final String resourcePathNormalized = WhiteBlackList.normalizePath(resourcePath);
scanSpec.classpathElementResourcePathWhiteBlackList.addT... | java | public ClassGraph whitelistClasspathElementsContainingResourcePath(final String... resourcePaths) {
for (final String resourcePath : resourcePaths) {
final String resourcePathNormalized = WhiteBlackList.normalizePath(resourcePath);
scanSpec.classpathElementResourcePathWhiteBlackList.addT... | [
"public",
"ClassGraph",
"whitelistClasspathElementsContainingResourcePath",
"(",
"final",
"String",
"...",
"resourcePaths",
")",
"{",
"for",
"(",
"final",
"String",
"resourcePath",
":",
"resourcePaths",
")",
"{",
"final",
"String",
"resourcePathNormalized",
"=",
"WhiteB... | Whitelist classpath elements based on resource paths. Only classpath elements that contain resources with
paths matching the whitelist will be scanned.
@param resourcePaths
The resource paths, any of which must be present in a classpath element for the classpath element
to be scanned. May contain a wildcard glob ({@co... | [
"Whitelist",
"classpath",
"elements",
"based",
"on",
"resource",
"paths",
".",
"Only",
"classpath",
"elements",
"that",
"contain",
"resources",
"with",
"paths",
"matching",
"the",
"whitelist",
"will",
"be",
"scanned",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassGraph.java#L973-L979 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ClassGraph.java | ClassGraph.blacklistClasspathElementsContainingResourcePath | public ClassGraph blacklistClasspathElementsContainingResourcePath(final String... resourcePaths) {
for (final String resourcePath : resourcePaths) {
final String resourcePathNormalized = WhiteBlackList.normalizePath(resourcePath);
scanSpec.classpathElementResourcePathWhiteBlackList.addT... | java | public ClassGraph blacklistClasspathElementsContainingResourcePath(final String... resourcePaths) {
for (final String resourcePath : resourcePaths) {
final String resourcePathNormalized = WhiteBlackList.normalizePath(resourcePath);
scanSpec.classpathElementResourcePathWhiteBlackList.addT... | [
"public",
"ClassGraph",
"blacklistClasspathElementsContainingResourcePath",
"(",
"final",
"String",
"...",
"resourcePaths",
")",
"{",
"for",
"(",
"final",
"String",
"resourcePath",
":",
"resourcePaths",
")",
"{",
"final",
"String",
"resourcePathNormalized",
"=",
"WhiteB... | Blacklist classpath elements based on resource paths. Classpath elements that contain resources with paths
matching the blacklist will not be scanned.
@param resourcePaths
The resource paths which cause a classpath not to be scanned if any are present in a classpath
element for the classpath element. May contain a wil... | [
"Blacklist",
"classpath",
"elements",
"based",
"on",
"resource",
"paths",
".",
"Classpath",
"elements",
"that",
"contain",
"resources",
"with",
"paths",
"matching",
"the",
"blacklist",
"will",
"not",
"be",
"scanned",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassGraph.java#L990-L996 | train |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/recycler/Recycler.java | Recycler.acquire | public T acquire() throws E {
final T instance;
final T recycledInstance = unusedInstances.poll();
if (recycledInstance == null) {
// Allocate a new instance -- may throw an exception of type E
final T newInstance = newInstance();
if (newInstance == null) {
... | java | public T acquire() throws E {
final T instance;
final T recycledInstance = unusedInstances.poll();
if (recycledInstance == null) {
// Allocate a new instance -- may throw an exception of type E
final T newInstance = newInstance();
if (newInstance == null) {
... | [
"public",
"T",
"acquire",
"(",
")",
"throws",
"E",
"{",
"final",
"T",
"instance",
";",
"final",
"T",
"recycledInstance",
"=",
"unusedInstances",
".",
"poll",
"(",
")",
";",
"if",
"(",
"recycledInstance",
"==",
"null",
")",
"{",
"// Allocate a new instance --... | Acquire on object instance of type T, either by reusing a previously recycled instance if possible, or if
there are no currently-unused instances, by allocating a new instance.
@return Either a new or a recycled object instance.
@throws E
if {@link #newInstance()} threw an exception of type E.
@throws NullPointerExcep... | [
"Acquire",
"on",
"object",
"instance",
"of",
"type",
"T",
"either",
"by",
"reusing",
"a",
"previously",
"recycled",
"instance",
"if",
"possible",
"or",
"if",
"there",
"are",
"no",
"currently",
"-",
"unused",
"instances",
"by",
"allocating",
"a",
"new",
"inst... | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/recycler/Recycler.java#L74-L90 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ScanResult.java | ScanResult.getClasspathURIs | public List<URI> getClasspathURIs() {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
final List<URI> classpathElementOrderURIs = new ArrayList<>();
for (final ClasspathElement classpathElement : classpathOrder) {
... | java | public List<URI> getClasspathURIs() {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
final List<URI> classpathElementOrderURIs = new ArrayList<>();
for (final ClasspathElement classpathElement : classpathOrder) {
... | [
"public",
"List",
"<",
"URI",
">",
"getClasspathURIs",
"(",
")",
"{",
"if",
"(",
"closed",
".",
"get",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot use a ScanResult after it has been closed\"",
")",
";",
"}",
"final",
"List",
... | Returns an ordered list of unique classpath element and module URIs.
@return The unique classpath element and module URIs. | [
"Returns",
"an",
"ordered",
"list",
"of",
"unique",
"classpath",
"element",
"and",
"module",
"URIs",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ScanResult.java#L440-L456 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ScanResult.java | ScanResult.getAllResources | public ResourceList getAllResources() {
if (allWhitelistedResourcesCached == null) {
// Index Resource objects by path
final ResourceList whitelistedResourcesList = new ResourceList();
for (final ClasspathElement classpathElt : classpathOrder) {
if (classpathE... | java | public ResourceList getAllResources() {
if (allWhitelistedResourcesCached == null) {
// Index Resource objects by path
final ResourceList whitelistedResourcesList = new ResourceList();
for (final ClasspathElement classpathElt : classpathOrder) {
if (classpathE... | [
"public",
"ResourceList",
"getAllResources",
"(",
")",
"{",
"if",
"(",
"allWhitelistedResourcesCached",
"==",
"null",
")",
"{",
"// Index Resource objects by path",
"final",
"ResourceList",
"whitelistedResourcesList",
"=",
"new",
"ResourceList",
"(",
")",
";",
"for",
... | Get the list of all resources.
@return A list of all resources (including classfiles and non-classfiles) found in whitelisted packages. | [
"Get",
"the",
"list",
"of",
"all",
"resources",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ScanResult.java#L525-L538 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ScanResult.java | ScanResult.getResourcesWithPath | public ResourceList getResourcesWithPath(final String resourcePath) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
final ResourceList allWhitelistedResources = getAllResources();
if (allWhitelistedResources.isEm... | java | public ResourceList getResourcesWithPath(final String resourcePath) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
final ResourceList allWhitelistedResources = getAllResources();
if (allWhitelistedResources.isEm... | [
"public",
"ResourceList",
"getResourcesWithPath",
"(",
"final",
"String",
"resourcePath",
")",
"{",
"if",
"(",
"closed",
".",
"get",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot use a ScanResult after it has been closed\"",
")",
";",
... | Get the list of all resources found in whitelisted packages that have the given path, relative to the package
root of the classpath element. May match several resources, up to one per classpath element.
@param resourcePath
A complete resource path, relative to the classpath entry package root.
@return A list of all re... | [
"Get",
"the",
"list",
"of",
"all",
"resources",
"found",
"in",
"whitelisted",
"packages",
"that",
"have",
"the",
"given",
"path",
"relative",
"to",
"the",
"package",
"root",
"of",
"the",
"classpath",
"element",
".",
"May",
"match",
"several",
"resources",
"u... | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ScanResult.java#L572-L584 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ScanResult.java | ScanResult.getResourcesWithLeafName | public ResourceList getResourcesWithLeafName(final String leafName) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
final ResourceList allWhitelistedResources = getAllResources();
if (allWhitelistedResources.isEm... | java | public ResourceList getResourcesWithLeafName(final String leafName) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
final ResourceList allWhitelistedResources = getAllResources();
if (allWhitelistedResources.isEm... | [
"public",
"ResourceList",
"getResourcesWithLeafName",
"(",
"final",
"String",
"leafName",
")",
"{",
"if",
"(",
"closed",
".",
"get",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot use a ScanResult after it has been closed\"",
")",
";",
... | Get the list of all resources found in whitelisted packages that have the requested leafname.
@param leafName
A resource leaf filename.
@return A list of all resources found in whitelisted packages that have the requested leafname. | [
"Get",
"the",
"list",
"of",
"all",
"resources",
"found",
"in",
"whitelisted",
"packages",
"that",
"have",
"the",
"requested",
"leafname",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ScanResult.java#L619-L637 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ScanResult.java | ScanResult.getResourcesWithExtension | public ResourceList getResourcesWithExtension(final String extension) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
final ResourceList allWhitelistedResources = getAllResources();
if (allWhitelistedResources.is... | java | public ResourceList getResourcesWithExtension(final String extension) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
final ResourceList allWhitelistedResources = getAllResources();
if (allWhitelistedResources.is... | [
"public",
"ResourceList",
"getResourcesWithExtension",
"(",
"final",
"String",
"extension",
")",
"{",
"if",
"(",
"closed",
".",
"get",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot use a ScanResult after it has been closed\"",
")",
";"... | Get the list of all resources found in whitelisted packages that have the requested filename extension.
@param extension
A filename extension, e.g. "xml" to match all resources ending in ".xml".
@return A list of all resources found in whitelisted packages that have the requested filename extension. | [
"Get",
"the",
"list",
"of",
"all",
"resources",
"found",
"in",
"whitelisted",
"packages",
"that",
"have",
"the",
"requested",
"filename",
"extension",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ScanResult.java#L646-L670 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ScanResult.java | ScanResult.getResourcesMatchingPattern | public ResourceList getResourcesMatchingPattern(final Pattern pattern) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
final ResourceList allWhitelistedResources = getAllResources();
if (allWhitelistedResources.i... | java | public ResourceList getResourcesMatchingPattern(final Pattern pattern) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
final ResourceList allWhitelistedResources = getAllResources();
if (allWhitelistedResources.i... | [
"public",
"ResourceList",
"getResourcesMatchingPattern",
"(",
"final",
"Pattern",
"pattern",
")",
"{",
"if",
"(",
"closed",
".",
"get",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot use a ScanResult after it has been closed\"",
")",
";... | Get the list of all resources found in whitelisted packages that have a path matching the requested pattern.
@param pattern
A pattern to match {@link Resource} paths with.
@return A list of all resources found in whitelisted packages that have a path matching the requested
pattern. | [
"Get",
"the",
"list",
"of",
"all",
"resources",
"found",
"in",
"whitelisted",
"packages",
"that",
"have",
"a",
"path",
"matching",
"the",
"requested",
"pattern",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ScanResult.java#L680-L697 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ScanResult.java | ScanResult.getModuleInfo | public ModuleInfoList getModuleInfo() {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
if (!scanSpec.enableClassInfo) {
throw new IllegalArgumentException("Please call ClassGraph#enableClassInfo() before #scan... | java | public ModuleInfoList getModuleInfo() {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
if (!scanSpec.enableClassInfo) {
throw new IllegalArgumentException("Please call ClassGraph#enableClassInfo() before #scan... | [
"public",
"ModuleInfoList",
"getModuleInfo",
"(",
")",
"{",
"if",
"(",
"closed",
".",
"get",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot use a ScanResult after it has been closed\"",
")",
";",
"}",
"if",
"(",
"!",
"scanSpec",
"... | Get all modules found during the scan.
@return A list of all modules found during the scan, or the empty list if none. | [
"Get",
"all",
"modules",
"found",
"during",
"the",
"scan",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ScanResult.java#L725-L733 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ScanResult.java | ScanResult.getPackageInfo | public PackageInfoList getPackageInfo() {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
if (!scanSpec.enableClassInfo) {
throw new IllegalArgumentException("Please call ClassGraph#enableClassInfo() before #sc... | java | public PackageInfoList getPackageInfo() {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
if (!scanSpec.enableClassInfo) {
throw new IllegalArgumentException("Please call ClassGraph#enableClassInfo() before #sc... | [
"public",
"PackageInfoList",
"getPackageInfo",
"(",
")",
"{",
"if",
"(",
"closed",
".",
"get",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot use a ScanResult after it has been closed\"",
")",
";",
"}",
"if",
"(",
"!",
"scanSpec",
... | Get all packages found during the scan.
@return A list of all packages found during the scan, or the empty list if none. | [
"Get",
"all",
"packages",
"found",
"during",
"the",
"scan",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ScanResult.java#L761-L769 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ScanResult.java | ScanResult.getAllClasses | public ClassInfoList getAllClasses() {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
if (!scanSpec.enableClassInfo) {
throw new IllegalArgumentException("Please call ClassGraph#enableClassInfo() before #scan(... | java | public ClassInfoList getAllClasses() {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
if (!scanSpec.enableClassInfo) {
throw new IllegalArgumentException("Please call ClassGraph#enableClassInfo() before #scan(... | [
"public",
"ClassInfoList",
"getAllClasses",
"(",
")",
"{",
"if",
"(",
"closed",
".",
"get",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot use a ScanResult after it has been closed\"",
")",
";",
"}",
"if",
"(",
"!",
"scanSpec",
".... | Get all classes, interfaces and annotations found during the scan.
@return A list of all whitelisted classes found during the scan, or the empty list if none. | [
"Get",
"all",
"classes",
"interfaces",
"and",
"annotations",
"found",
"during",
"the",
"scan",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ScanResult.java#L850-L858 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ScanResult.java | ScanResult.getSubclasses | public ClassInfoList getSubclasses(final String superclassName) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
if (!scanSpec.enableClassInfo) {
throw new IllegalArgumentException("Please call ClassGraph#enab... | java | public ClassInfoList getSubclasses(final String superclassName) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
if (!scanSpec.enableClassInfo) {
throw new IllegalArgumentException("Please call ClassGraph#enab... | [
"public",
"ClassInfoList",
"getSubclasses",
"(",
"final",
"String",
"superclassName",
")",
"{",
"if",
"(",
"closed",
".",
"get",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot use a ScanResult after it has been closed\"",
")",
";",
"}... | Get all subclasses of the named superclass.
@param superclassName
The name of the superclass.
@return A list of subclasses of the named superclass, or the empty list if none. | [
"Get",
"all",
"subclasses",
"of",
"the",
"named",
"superclass",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ScanResult.java#L899-L913 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ScanResult.java | ScanResult.getSuperclasses | public ClassInfoList getSuperclasses(final String subclassName) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
if (!scanSpec.enableClassInfo) {
throw new IllegalArgumentException("Please call ClassGraph#enab... | java | public ClassInfoList getSuperclasses(final String subclassName) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
if (!scanSpec.enableClassInfo) {
throw new IllegalArgumentException("Please call ClassGraph#enab... | [
"public",
"ClassInfoList",
"getSuperclasses",
"(",
"final",
"String",
"subclassName",
")",
"{",
"if",
"(",
"closed",
".",
"get",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot use a ScanResult after it has been closed\"",
")",
";",
"}... | Get superclasses of the named subclass.
@param subclassName
The name of the subclass.
@return A list of superclasses of the named subclass, or the empty list if none. | [
"Get",
"superclasses",
"of",
"the",
"named",
"subclass",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ScanResult.java#L922-L931 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ScanResult.java | ScanResult.getClassesWithMethodAnnotation | public ClassInfoList getClassesWithMethodAnnotation(final String methodAnnotationName) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
if (!scanSpec.enableClassInfo || !scanSpec.enableMethodInfo || !scanSpec.enableAnnota... | java | public ClassInfoList getClassesWithMethodAnnotation(final String methodAnnotationName) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
if (!scanSpec.enableClassInfo || !scanSpec.enableMethodInfo || !scanSpec.enableAnnota... | [
"public",
"ClassInfoList",
"getClassesWithMethodAnnotation",
"(",
"final",
"String",
"methodAnnotationName",
")",
"{",
"if",
"(",
"closed",
".",
"get",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot use a ScanResult after it has been closed... | Get classes that have a method with an annotation of the named type.
@param methodAnnotationName
the name of the method annotation.
@return A list of classes with a method that has an annotation of the named type, or the empty list if none. | [
"Get",
"classes",
"that",
"have",
"a",
"method",
"with",
"an",
"annotation",
"of",
"the",
"named",
"type",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ScanResult.java#L940-L950 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ScanResult.java | ScanResult.getClassesWithMethodParameterAnnotation | public ClassInfoList getClassesWithMethodParameterAnnotation(final String methodParameterAnnotationName) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
if (!scanSpec.enableClassInfo || !scanSpec.enableMethodInfo || !sca... | java | public ClassInfoList getClassesWithMethodParameterAnnotation(final String methodParameterAnnotationName) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
if (!scanSpec.enableClassInfo || !scanSpec.enableMethodInfo || !sca... | [
"public",
"ClassInfoList",
"getClassesWithMethodParameterAnnotation",
"(",
"final",
"String",
"methodParameterAnnotationName",
")",
"{",
"if",
"(",
"closed",
".",
"get",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot use a ScanResult after ... | Get classes that have a method with a parameter that is annotated with an annotation of the named type.
@param methodParameterAnnotationName
the name of the method parameter annotation.
@return A list of classes that have a method with a parameter annotated with the named annotation type, or
the empty list if none. | [
"Get",
"classes",
"that",
"have",
"a",
"method",
"with",
"a",
"parameter",
"that",
"is",
"annotated",
"with",
"an",
"annotation",
"of",
"the",
"named",
"type",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ScanResult.java#L960-L970 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ScanResult.java | ScanResult.getClassesWithFieldAnnotation | public ClassInfoList getClassesWithFieldAnnotation(final String fieldAnnotationName) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
if (!scanSpec.enableClassInfo || !scanSpec.enableFieldInfo || !scanSpec.enableAnnotatio... | java | public ClassInfoList getClassesWithFieldAnnotation(final String fieldAnnotationName) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
if (!scanSpec.enableClassInfo || !scanSpec.enableFieldInfo || !scanSpec.enableAnnotatio... | [
"public",
"ClassInfoList",
"getClassesWithFieldAnnotation",
"(",
"final",
"String",
"fieldAnnotationName",
")",
"{",
"if",
"(",
"closed",
".",
"get",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot use a ScanResult after it has been closed\"... | Get classes that have a field with an annotation of the named type.
@param fieldAnnotationName
the name of the field annotation.
@return A list of classes that have a field with an annotation of the named type, or the empty list if none. | [
"Get",
"classes",
"that",
"have",
"a",
"field",
"with",
"an",
"annotation",
"of",
"the",
"named",
"type",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ScanResult.java#L979-L989 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ScanResult.java | ScanResult.getInterfaces | public ClassInfoList getInterfaces(final String className) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
if (!scanSpec.enableClassInfo) {
throw new IllegalArgumentException("Please call ClassGraph#enableCla... | java | public ClassInfoList getInterfaces(final String className) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
if (!scanSpec.enableClassInfo) {
throw new IllegalArgumentException("Please call ClassGraph#enableCla... | [
"public",
"ClassInfoList",
"getInterfaces",
"(",
"final",
"String",
"className",
")",
"{",
"if",
"(",
"closed",
".",
"get",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot use a ScanResult after it has been closed\"",
")",
";",
"}",
... | Get all interfaces implemented by the named class or by one of its superclasses, if this is a standard class,
or the superinterfaces extended by this interface, if this is an interface.
@param className
The class name.
@return A list of interfaces implemented by the named class (or superinterfaces extended by the name... | [
"Get",
"all",
"interfaces",
"implemented",
"by",
"the",
"named",
"class",
"or",
"by",
"one",
"of",
"its",
"superclasses",
"if",
"this",
"is",
"a",
"standard",
"class",
"or",
"the",
"superinterfaces",
"extended",
"by",
"this",
"interface",
"if",
"this",
"is",... | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ScanResult.java#L1019-L1028 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ScanResult.java | ScanResult.getClassesWithAnnotation | public ClassInfoList getClassesWithAnnotation(final String annotationName) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
if (!scanSpec.enableClassInfo || !scanSpec.enableAnnotationInfo) {
throw new IllegalA... | java | public ClassInfoList getClassesWithAnnotation(final String annotationName) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
if (!scanSpec.enableClassInfo || !scanSpec.enableAnnotationInfo) {
throw new IllegalA... | [
"public",
"ClassInfoList",
"getClassesWithAnnotation",
"(",
"final",
"String",
"annotationName",
")",
"{",
"if",
"(",
"closed",
".",
"get",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot use a ScanResult after it has been closed\"",
")",
... | Get classes with the named class annotation or meta-annotation.
@param annotationName
The name of the class annotation or meta-annotation.
@return A list of all non-annotation classes that were found with the named class annotation during the scan,
or the empty list if none. | [
"Get",
"classes",
"with",
"the",
"named",
"class",
"annotation",
"or",
"meta",
"-",
"annotation",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ScanResult.java#L1093-L1103 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ScanResult.java | ScanResult.fromJSON | public static ScanResult fromJSON(final String json) {
final Matcher matcher = Pattern.compile("\\{[\\n\\r ]*\"format\"[ ]?:[ ]?\"([^\"]+)\"").matcher(json);
if (!matcher.find()) {
throw new IllegalArgumentException("JSON is not in correct format");
}
if (!CURRENT_SERIALIZATI... | java | public static ScanResult fromJSON(final String json) {
final Matcher matcher = Pattern.compile("\\{[\\n\\r ]*\"format\"[ ]?:[ ]?\"([^\"]+)\"").matcher(json);
if (!matcher.find()) {
throw new IllegalArgumentException("JSON is not in correct format");
}
if (!CURRENT_SERIALIZATI... | [
"public",
"static",
"ScanResult",
"fromJSON",
"(",
"final",
"String",
"json",
")",
"{",
"final",
"Matcher",
"matcher",
"=",
"Pattern",
".",
"compile",
"(",
"\"\\\\{[\\\\n\\\\r ]*\\\"format\\\"[ ]?:[ ]?\\\"([^\\\"]+)\\\"\"",
")",
".",
"matcher",
"(",
"json",
")",
";"... | Deserialize a ScanResult from previously-serialized JSON.
@param json
The JSON string for the serialized {@link ScanResult}.
@return The deserialized {@link ScanResult}. | [
"Deserialize",
"a",
"ScanResult",
"from",
"previously",
"-",
"serialized",
"JSON",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ScanResult.java#L1308-L1368 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/ScanResult.java | ScanResult.toJSON | public String toJSON(final int indentWidth) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
if (!scanSpec.enableClassInfo) {
throw new IllegalArgumentException("Please call ClassGraph#enableClassInfo() before... | java | public String toJSON(final int indentWidth) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
if (!scanSpec.enableClassInfo) {
throw new IllegalArgumentException("Please call ClassGraph#enableClassInfo() before... | [
"public",
"String",
"toJSON",
"(",
"final",
"int",
"indentWidth",
")",
"{",
"if",
"(",
"closed",
".",
"get",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot use a ScanResult after it has been closed\"",
")",
";",
"}",
"if",
"(",
... | Serialize a ScanResult to JSON.
@param indentWidth
If greater than 0, JSON will be formatted (indented), otherwise it will be minified (un-indented).
@return This {@link ScanResult}, serialized as a JSON string. | [
"Serialize",
"a",
"ScanResult",
"to",
"JSON",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ScanResult.java#L1377-L1392 | train |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/json/TypeResolutions.java | TypeResolutions.resolveTypeVariables | Type resolveTypeVariables(final Type type) {
if (type instanceof Class<?>) {
// Arrays and non-generic classes have no type variables
return type;
} else if (type instanceof ParameterizedType) {
// Recursively resolve parameterized types
final Parameteriz... | java | Type resolveTypeVariables(final Type type) {
if (type instanceof Class<?>) {
// Arrays and non-generic classes have no type variables
return type;
} else if (type instanceof ParameterizedType) {
// Recursively resolve parameterized types
final Parameteriz... | [
"Type",
"resolveTypeVariables",
"(",
"final",
"Type",
"type",
")",
"{",
"if",
"(",
"type",
"instanceof",
"Class",
"<",
"?",
">",
")",
"{",
"// Arrays and non-generic classes have no type variables",
"return",
"type",
";",
"}",
"else",
"if",
"(",
"type",
"instanc... | Resolve the type variables in a type using a type variable resolution list, producing a resolved type.
@param type
the type
@return the resolved type | [
"Resolve",
"the",
"type",
"variables",
"in",
"a",
"type",
"using",
"a",
"type",
"variable",
"resolution",
"list",
"producing",
"a",
"resolved",
"type",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/json/TypeResolutions.java#L71-L150 | train |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/json/JSONSerializer.java | JSONSerializer.assignObjectIds | private static void assignObjectIds(final Object jsonVal,
final Map<ReferenceEqualityKey<Object>, JSONObject> objToJSONVal, final ClassFieldCache classFieldCache,
final Map<ReferenceEqualityKey<JSONReference>, CharSequence> jsonReferenceToId,
final AtomicInteger objId, final boolean ... | java | private static void assignObjectIds(final Object jsonVal,
final Map<ReferenceEqualityKey<Object>, JSONObject> objToJSONVal, final ClassFieldCache classFieldCache,
final Map<ReferenceEqualityKey<JSONReference>, CharSequence> jsonReferenceToId,
final AtomicInteger objId, final boolean ... | [
"private",
"static",
"void",
"assignObjectIds",
"(",
"final",
"Object",
"jsonVal",
",",
"final",
"Map",
"<",
"ReferenceEqualityKey",
"<",
"Object",
">",
",",
"JSONObject",
">",
"objToJSONVal",
",",
"final",
"ClassFieldCache",
"classFieldCache",
",",
"final",
"Map"... | Create a unique id for each referenced JSON object.
@param jsonVal
the json val
@param objToJSONVal
a map from obj to JSON val
@param classFieldCache
the class field cache
@param jsonReferenceToId
a map from json reference to id
@param objId
the object id
@param onlySerializePublicFields
whether to only serialize publ... | [
"Create",
"a",
"unique",
"id",
"for",
"each",
"referenced",
"JSON",
"object",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/json/JSONSerializer.java#L78-L137 | train |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/json/JSONSerializer.java | JSONSerializer.jsonValToJSONString | static void jsonValToJSONString(final Object jsonVal,
final Map<ReferenceEqualityKey<JSONReference>, CharSequence> jsonReferenceToId,
final boolean includeNullValuedFields, final int depth, final int indentWidth,
final StringBuilder buf) {
if (jsonVal == null) {
... | java | static void jsonValToJSONString(final Object jsonVal,
final Map<ReferenceEqualityKey<JSONReference>, CharSequence> jsonReferenceToId,
final boolean includeNullValuedFields, final int depth, final int indentWidth,
final StringBuilder buf) {
if (jsonVal == null) {
... | [
"static",
"void",
"jsonValToJSONString",
"(",
"final",
"Object",
"jsonVal",
",",
"final",
"Map",
"<",
"ReferenceEqualityKey",
"<",
"JSONReference",
">",
",",
"CharSequence",
">",
"jsonReferenceToId",
",",
"final",
"boolean",
"includeNullValuedFields",
",",
"final",
... | Serialize a JSON object, array, or value.
@param jsonVal
the json val
@param jsonReferenceToId
a map from json reference to id
@param includeNullValuedFields
the include null valued fields
@param depth
the depth
@param indentWidth
the indent width
@param buf
the buf | [
"Serialize",
"a",
"JSON",
"object",
"array",
"or",
"value",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/json/JSONSerializer.java#L417-L452 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/Classfile.java | Classfile.scheduleScanningIfExternalClass | private void scheduleScanningIfExternalClass(final String className, final String relationship) {
// Don't scan Object
if (className != null && !className.equals("java.lang.Object")
// Only schedule each external class once for scanning, across all threads
&& classNamesScheduledF... | java | private void scheduleScanningIfExternalClass(final String className, final String relationship) {
// Don't scan Object
if (className != null && !className.equals("java.lang.Object")
// Only schedule each external class once for scanning, across all threads
&& classNamesScheduledF... | [
"private",
"void",
"scheduleScanningIfExternalClass",
"(",
"final",
"String",
"className",
",",
"final",
"String",
"relationship",
")",
"{",
"// Don't scan Object",
"if",
"(",
"className",
"!=",
"null",
"&&",
"!",
"className",
".",
"equals",
"(",
"\"java.lang.Object... | Extend scanning to a superclass, interface or annotation.
@param className
the class name
@param relationship
the relationship type | [
"Extend",
"scanning",
"to",
"a",
"superclass",
"interface",
"or",
"annotation",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Classfile.java#L231-L277 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/Classfile.java | Classfile.extendScanningUpwards | private void extendScanningUpwards() {
// Check superclass
if (superclassName != null) {
scheduleScanningIfExternalClass(superclassName, "superclass");
}
// Check implemented interfaces
if (implementedInterfaces != null) {
for (final String interfaceName :... | java | private void extendScanningUpwards() {
// Check superclass
if (superclassName != null) {
scheduleScanningIfExternalClass(superclassName, "superclass");
}
// Check implemented interfaces
if (implementedInterfaces != null) {
for (final String interfaceName :... | [
"private",
"void",
"extendScanningUpwards",
"(",
")",
"{",
"// Check superclass",
"if",
"(",
"superclassName",
"!=",
"null",
")",
"{",
"scheduleScanningIfExternalClass",
"(",
"superclassName",
",",
"\"superclass\"",
")",
";",
"}",
"// Check implemented interfaces",
"if"... | Check if scanning needs to be extended upwards to an external superclass, interface or annotation. | [
"Check",
"if",
"scanning",
"needs",
"to",
"be",
"extended",
"upwards",
"to",
"an",
"external",
"superclass",
"interface",
"or",
"annotation",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Classfile.java#L282-L330 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/Classfile.java | Classfile.link | void link(final Map<String, ClassInfo> classNameToClassInfo,
final Map<String, PackageInfo> packageNameToPackageInfo,
final Map<String, ModuleInfo> moduleNameToModuleInfo) {
boolean isModuleDescriptor = false;
boolean isPackageDescriptor = false;
ClassInfo classInfo = nul... | java | void link(final Map<String, ClassInfo> classNameToClassInfo,
final Map<String, PackageInfo> packageNameToPackageInfo,
final Map<String, ModuleInfo> moduleNameToModuleInfo) {
boolean isModuleDescriptor = false;
boolean isPackageDescriptor = false;
ClassInfo classInfo = nul... | [
"void",
"link",
"(",
"final",
"Map",
"<",
"String",
",",
"ClassInfo",
">",
"classNameToClassInfo",
",",
"final",
"Map",
"<",
"String",
",",
"PackageInfo",
">",
"packageNameToPackageInfo",
",",
"final",
"Map",
"<",
"String",
",",
"ModuleInfo",
">",
"moduleNameT... | Link classes. Not threadsafe, should be run in a single-threaded context.
@param classNameToClassInfo
map from class name to class info
@param packageNameToPackageInfo
map from package name to package info
@param moduleNameToModuleInfo
map from module name to module info | [
"Link",
"classes",
".",
"Not",
"threadsafe",
"should",
"be",
"run",
"in",
"a",
"single",
"-",
"threaded",
"context",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Classfile.java#L344-L439 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/Classfile.java | Classfile.intern | private String intern(final String str) {
if (str == null) {
return null;
}
final String interned = stringInternMap.putIfAbsent(str, str);
if (interned != null) {
return interned;
}
return str;
} | java | private String intern(final String str) {
if (str == null) {
return null;
}
final String interned = stringInternMap.putIfAbsent(str, str);
if (interned != null) {
return interned;
}
return str;
} | [
"private",
"String",
"intern",
"(",
"final",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"String",
"interned",
"=",
"stringInternMap",
".",
"putIfAbsent",
"(",
"str",
",",
"str",
")",
";",
... | Intern a string. | [
"Intern",
"a",
"string",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Classfile.java#L446-L455 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/Classfile.java | Classfile.getConstantPoolStringOffset | private int getConstantPoolStringOffset(final int cpIdx, final int subFieldIdx)
throws ClassfileFormatException {
if (cpIdx < 1 || cpIdx >= cpCount) {
throw new ClassfileFormatException("Constant pool index " + cpIdx + ", should be in range [1, "
+ (cpCount - 1) + "] ... | java | private int getConstantPoolStringOffset(final int cpIdx, final int subFieldIdx)
throws ClassfileFormatException {
if (cpIdx < 1 || cpIdx >= cpCount) {
throw new ClassfileFormatException("Constant pool index " + cpIdx + ", should be in range [1, "
+ (cpCount - 1) + "] ... | [
"private",
"int",
"getConstantPoolStringOffset",
"(",
"final",
"int",
"cpIdx",
",",
"final",
"int",
"subFieldIdx",
")",
"throws",
"ClassfileFormatException",
"{",
"if",
"(",
"cpIdx",
"<",
"1",
"||",
"cpIdx",
">=",
"cpCount",
")",
"{",
"throw",
"new",
"Classfil... | Get the byte offset within the buffer of a string from the constant pool, or 0 for a null string.
@param cpIdx
the constant pool index
@param subFieldIdx
should be 0 for CONSTANT_Utf8, CONSTANT_Class and CONSTANT_String, and for
CONSTANT_NameAndType_info, fetches the name for value 0, or the type descriptor for value ... | [
"Get",
"the",
"byte",
"offset",
"within",
"the",
"buffer",
"of",
"a",
"string",
"from",
"the",
"constant",
"pool",
"or",
"0",
"for",
"a",
"null",
"string",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Classfile.java#L469-L529 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/Classfile.java | Classfile.getConstantPoolString | private String getConstantPoolString(final int cpIdx, final int subFieldIdx)
throws ClassfileFormatException, IOException {
final int constantPoolStringOffset = getConstantPoolStringOffset(cpIdx, subFieldIdx);
return constantPoolStringOffset == 0 ? null
: intern(inputStreamOr... | java | private String getConstantPoolString(final int cpIdx, final int subFieldIdx)
throws ClassfileFormatException, IOException {
final int constantPoolStringOffset = getConstantPoolStringOffset(cpIdx, subFieldIdx);
return constantPoolStringOffset == 0 ? null
: intern(inputStreamOr... | [
"private",
"String",
"getConstantPoolString",
"(",
"final",
"int",
"cpIdx",
",",
"final",
"int",
"subFieldIdx",
")",
"throws",
"ClassfileFormatException",
",",
"IOException",
"{",
"final",
"int",
"constantPoolStringOffset",
"=",
"getConstantPoolStringOffset",
"(",
"cpId... | Get a string from the constant pool.
@param cpIdx
the constant pool index
@param subFieldIdx
should be 0 for CONSTANT_Utf8, CONSTANT_Class and CONSTANT_String, and for
CONSTANT_NameAndType_info, fetches the name for value 0, or the type descriptor for value 1.
@return the constant pool string
@throws ClassfileFormatEx... | [
"Get",
"a",
"string",
"from",
"the",
"constant",
"pool",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Classfile.java#L569-L575 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/Classfile.java | Classfile.getConstantPoolStringFirstByte | private byte getConstantPoolStringFirstByte(final int cpIdx) throws ClassfileFormatException, IOException {
final int constantPoolStringOffset = getConstantPoolStringOffset(cpIdx, /* subFieldIdx = */ 0);
if (constantPoolStringOffset == 0) {
return '\0';
}
final int utfLen = i... | java | private byte getConstantPoolStringFirstByte(final int cpIdx) throws ClassfileFormatException, IOException {
final int constantPoolStringOffset = getConstantPoolStringOffset(cpIdx, /* subFieldIdx = */ 0);
if (constantPoolStringOffset == 0) {
return '\0';
}
final int utfLen = i... | [
"private",
"byte",
"getConstantPoolStringFirstByte",
"(",
"final",
"int",
"cpIdx",
")",
"throws",
"ClassfileFormatException",
",",
"IOException",
"{",
"final",
"int",
"constantPoolStringOffset",
"=",
"getConstantPoolStringOffset",
"(",
"cpIdx",
",",
"/* subFieldIdx = */",
... | Get the first UTF8 byte of a string in the constant pool, or '\0' if the string is null or empty.
@param cpIdx
the constant pool index
@return the first byte of the constant pool string
@throws ClassfileFormatException
If a problem occurs.
@throws IOException
If an IO exception occurs. | [
"Get",
"the",
"first",
"UTF8",
"byte",
"of",
"a",
"string",
"in",
"the",
"constant",
"pool",
"or",
"\\",
"0",
"if",
"the",
"string",
"is",
"null",
"or",
"empty",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Classfile.java#L603-L613 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/Classfile.java | Classfile.constantPoolStringEquals | private boolean constantPoolStringEquals(final int cpIdx, final String asciiString)
throws ClassfileFormatException, IOException {
final int strOffset = getConstantPoolStringOffset(cpIdx, /* subFieldIdx = */ 0);
if (strOffset == 0) {
return asciiString == null;
} else if ... | java | private boolean constantPoolStringEquals(final int cpIdx, final String asciiString)
throws ClassfileFormatException, IOException {
final int strOffset = getConstantPoolStringOffset(cpIdx, /* subFieldIdx = */ 0);
if (strOffset == 0) {
return asciiString == null;
} else if ... | [
"private",
"boolean",
"constantPoolStringEquals",
"(",
"final",
"int",
"cpIdx",
",",
"final",
"String",
"asciiString",
")",
"throws",
"ClassfileFormatException",
",",
"IOException",
"{",
"final",
"int",
"strOffset",
"=",
"getConstantPoolStringOffset",
"(",
"cpIdx",
",... | Compare a string in the constant pool with a given ASCII string, without constructing the constant pool
String object.
@param cpIdx
the constant pool index
@param asciiString
the ASCII string to compare to
@return true, if successful
@throws ClassfileFormatException
If a problem occurs.
@throws IOException
If an IO ex... | [
"Compare",
"a",
"string",
"in",
"the",
"constant",
"pool",
"with",
"a",
"given",
"ASCII",
"string",
"without",
"constructing",
"the",
"constant",
"pool",
"String",
"object",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Classfile.java#L661-L681 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/Classfile.java | Classfile.cpReadUnsignedShort | private int cpReadUnsignedShort(final int cpIdx) throws IOException {
if (cpIdx < 1 || cpIdx >= cpCount) {
throw new ClassfileFormatException("Constant pool index " + cpIdx + ", should be in range [1, "
+ (cpCount - 1) + "] -- cannot continue reading class. "
... | java | private int cpReadUnsignedShort(final int cpIdx) throws IOException {
if (cpIdx < 1 || cpIdx >= cpCount) {
throw new ClassfileFormatException("Constant pool index " + cpIdx + ", should be in range [1, "
+ (cpCount - 1) + "] -- cannot continue reading class. "
... | [
"private",
"int",
"cpReadUnsignedShort",
"(",
"final",
"int",
"cpIdx",
")",
"throws",
"IOException",
"{",
"if",
"(",
"cpIdx",
"<",
"1",
"||",
"cpIdx",
">=",
"cpCount",
")",
"{",
"throw",
"new",
"ClassfileFormatException",
"(",
"\"Constant pool index \"",
"+",
... | Read an unsigned short from the constant pool.
@param cpIdx
the constant pool index.
@return the unsigned short
@throws IOException
If an I/O exception occurred. | [
"Read",
"an",
"unsigned",
"short",
"from",
"the",
"constant",
"pool",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Classfile.java#L694-L701 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/Classfile.java | Classfile.cpReadInt | private int cpReadInt(final int cpIdx) throws IOException {
if (cpIdx < 1 || cpIdx >= cpCount) {
throw new ClassfileFormatException("Constant pool index " + cpIdx + ", should be in range [1, "
+ (cpCount - 1) + "] -- cannot continue reading class. "
+ "Please ... | java | private int cpReadInt(final int cpIdx) throws IOException {
if (cpIdx < 1 || cpIdx >= cpCount) {
throw new ClassfileFormatException("Constant pool index " + cpIdx + ", should be in range [1, "
+ (cpCount - 1) + "] -- cannot continue reading class. "
+ "Please ... | [
"private",
"int",
"cpReadInt",
"(",
"final",
"int",
"cpIdx",
")",
"throws",
"IOException",
"{",
"if",
"(",
"cpIdx",
"<",
"1",
"||",
"cpIdx",
">=",
"cpCount",
")",
"{",
"throw",
"new",
"ClassfileFormatException",
"(",
"\"Constant pool index \"",
"+",
"cpIdx",
... | Read an int from the constant pool.
@param cpIdx
the constant pool index.
@return the int
@throws IOException
If an I/O exception occurred. | [
"Read",
"an",
"int",
"from",
"the",
"constant",
"pool",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Classfile.java#L712-L719 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/Classfile.java | Classfile.cpReadLong | private long cpReadLong(final int cpIdx) throws IOException {
if (cpIdx < 1 || cpIdx >= cpCount) {
throw new ClassfileFormatException("Constant pool index " + cpIdx + ", should be in range [1, "
+ (cpCount - 1) + "] -- cannot continue reading class. "
+ "Pleas... | java | private long cpReadLong(final int cpIdx) throws IOException {
if (cpIdx < 1 || cpIdx >= cpCount) {
throw new ClassfileFormatException("Constant pool index " + cpIdx + ", should be in range [1, "
+ (cpCount - 1) + "] -- cannot continue reading class. "
+ "Pleas... | [
"private",
"long",
"cpReadLong",
"(",
"final",
"int",
"cpIdx",
")",
"throws",
"IOException",
"{",
"if",
"(",
"cpIdx",
"<",
"1",
"||",
"cpIdx",
">=",
"cpCount",
")",
"{",
"throw",
"new",
"ClassfileFormatException",
"(",
"\"Constant pool index \"",
"+",
"cpIdx",... | Read a long from the constant pool.
@param cpIdx
the constant pool index.
@return the long
@throws IOException
If an I/O exception occurred. | [
"Read",
"a",
"long",
"from",
"the",
"constant",
"pool",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Classfile.java#L730-L737 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/Classfile.java | Classfile.getFieldConstantPoolValue | private Object getFieldConstantPoolValue(final int tag, final char fieldTypeDescriptorFirstChar,
final int cpIdx) throws ClassfileFormatException, IOException {
switch (tag) {
case 1: // Modified UTF8
case 7: // Class -- N.B. Unused? Class references do not seem to actually be stored... | java | private Object getFieldConstantPoolValue(final int tag, final char fieldTypeDescriptorFirstChar,
final int cpIdx) throws ClassfileFormatException, IOException {
switch (tag) {
case 1: // Modified UTF8
case 7: // Class -- N.B. Unused? Class references do not seem to actually be stored... | [
"private",
"Object",
"getFieldConstantPoolValue",
"(",
"final",
"int",
"tag",
",",
"final",
"char",
"fieldTypeDescriptorFirstChar",
",",
"final",
"int",
"cpIdx",
")",
"throws",
"ClassfileFormatException",
",",
"IOException",
"{",
"switch",
"(",
"tag",
")",
"{",
"c... | Get a field constant from the constant pool.
@param tag
the tag
@param fieldTypeDescriptorFirstChar
the first char of the field type descriptor
@param cpIdx
the constant pool index
@return the field constant pool value
@throws ClassfileFormatException
If a problem occurs.
@throws IOException
If an IO exception occurs. | [
"Get",
"a",
"field",
"constant",
"from",
"the",
"constant",
"pool",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Classfile.java#L756-L796 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/Classfile.java | Classfile.readAnnotation | private AnnotationInfo readAnnotation() throws IOException {
// Lcom/xyz/Annotation; -> Lcom.xyz.Annotation;
final String annotationClassName = getConstantPoolClassDescriptor(
inputStreamOrByteBuffer.readUnsignedShort());
final int numElementValuePairs = inputStreamOrByteBuffer.r... | java | private AnnotationInfo readAnnotation() throws IOException {
// Lcom/xyz/Annotation; -> Lcom.xyz.Annotation;
final String annotationClassName = getConstantPoolClassDescriptor(
inputStreamOrByteBuffer.readUnsignedShort());
final int numElementValuePairs = inputStreamOrByteBuffer.r... | [
"private",
"AnnotationInfo",
"readAnnotation",
"(",
")",
"throws",
"IOException",
"{",
"// Lcom/xyz/Annotation; -> Lcom.xyz.Annotation;",
"final",
"String",
"annotationClassName",
"=",
"getConstantPoolClassDescriptor",
"(",
"inputStreamOrByteBuffer",
".",
"readUnsignedShort",
"("... | Read annotation entry from classfile.
@return the annotation, as an {@link AnnotationInfo} object.
@throws IOException
If an IO exception occurs. | [
"Read",
"annotation",
"entry",
"from",
"classfile",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Classfile.java#L807-L822 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/Classfile.java | Classfile.readAnnotationElementValue | private Object readAnnotationElementValue() throws IOException {
final int tag = (char) inputStreamOrByteBuffer.readUnsignedByte();
switch (tag) {
case 'B':
return (byte) cpReadInt(inputStreamOrByteBuffer.readUnsignedShort());
case 'C':
return (char) cpReadInt(inp... | java | private Object readAnnotationElementValue() throws IOException {
final int tag = (char) inputStreamOrByteBuffer.readUnsignedByte();
switch (tag) {
case 'B':
return (byte) cpReadInt(inputStreamOrByteBuffer.readUnsignedShort());
case 'C':
return (char) cpReadInt(inp... | [
"private",
"Object",
"readAnnotationElementValue",
"(",
")",
"throws",
"IOException",
"{",
"final",
"int",
"tag",
"=",
"(",
"char",
")",
"inputStreamOrByteBuffer",
".",
"readUnsignedByte",
"(",
")",
";",
"switch",
"(",
"tag",
")",
"{",
"case",
"'",
"'",
":",... | Read annotation element value from classfile.
@return the annotation element value
@throws IOException
If an IO exception occurs. | [
"Read",
"annotation",
"element",
"value",
"from",
"classfile",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Classfile.java#L831-L881 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/Classfile.java | Classfile.readBasicClassInfo | private void readBasicClassInfo() throws IOException, ClassfileFormatException, SkipClassException {
// Modifier flags
classModifiers = inputStreamOrByteBuffer.readUnsignedShort();
isInterface = (classModifiers & 0x0200) != 0;
isAnnotation = (classModifiers & 0x2000) != 0;
// Th... | java | private void readBasicClassInfo() throws IOException, ClassfileFormatException, SkipClassException {
// Modifier flags
classModifiers = inputStreamOrByteBuffer.readUnsignedShort();
isInterface = (classModifiers & 0x0200) != 0;
isAnnotation = (classModifiers & 0x2000) != 0;
// Th... | [
"private",
"void",
"readBasicClassInfo",
"(",
")",
"throws",
"IOException",
",",
"ClassfileFormatException",
",",
"SkipClassException",
"{",
"// Modifier flags",
"classModifiers",
"=",
"inputStreamOrByteBuffer",
".",
"readUnsignedShort",
"(",
")",
";",
"isInterface",
"=",... | Read basic class information.
@throws IOException
if an I/O exception occurs.
@throws ClassfileFormatException
if the classfile is incorrectly formatted.
@throws SkipClassException
if the classfile needs to be skipped (e.g. the class is non-public, and ignoreClassVisibility is
false) | [
"Read",
"basic",
"class",
"information",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Classfile.java#L1056-L1098 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/Classfile.java | Classfile.readInterfaces | private void readInterfaces() throws IOException {
// Interfaces
final int interfaceCount = inputStreamOrByteBuffer.readUnsignedShort();
for (int i = 0; i < interfaceCount; i++) {
final String interfaceName = getConstantPoolClassName(inputStreamOrByteBuffer.readUnsignedShort());
... | java | private void readInterfaces() throws IOException {
// Interfaces
final int interfaceCount = inputStreamOrByteBuffer.readUnsignedShort();
for (int i = 0; i < interfaceCount; i++) {
final String interfaceName = getConstantPoolClassName(inputStreamOrByteBuffer.readUnsignedShort());
... | [
"private",
"void",
"readInterfaces",
"(",
")",
"throws",
"IOException",
"{",
"// Interfaces",
"final",
"int",
"interfaceCount",
"=",
"inputStreamOrByteBuffer",
".",
"readUnsignedShort",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"interface... | Read the class' interfaces.
@throws IOException
if an I/O exception occurs. | [
"Read",
"the",
"class",
"interfaces",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Classfile.java#L1108-L1118 | train |
classgraph/classgraph | src/main/java/io/github/classgraph/Classfile.java | Classfile.readClassAttributes | private void readClassAttributes() throws IOException, ClassfileFormatException {
// Class attributes (including class annotations, class type variables, module info, etc.)
final int attributesCount = inputStreamOrByteBuffer.readUnsignedShort();
for (int i = 0; i < attributesCount; i++) {
... | java | private void readClassAttributes() throws IOException, ClassfileFormatException {
// Class attributes (including class annotations, class type variables, module info, etc.)
final int attributesCount = inputStreamOrByteBuffer.readUnsignedShort();
for (int i = 0; i < attributesCount; i++) {
... | [
"private",
"void",
"readClassAttributes",
"(",
")",
"throws",
"IOException",
",",
"ClassfileFormatException",
"{",
"// Class attributes (including class annotations, class type variables, module info, etc.)",
"final",
"int",
"attributesCount",
"=",
"inputStreamOrByteBuffer",
".",
"... | Read class attributes.
@throws IOException
if an I/O exception occurs.
@throws ClassfileFormatException
if the classfile is incorrectly formatted. | [
"Read",
"class",
"attributes",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Classfile.java#L1365-L1433 | train |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/fastzipfilereader/ZipFileSlice.java | ZipFileSlice.appendPath | private void appendPath(final StringBuilder buf) {
if (parentZipFileSlice != null) {
parentZipFileSlice.appendPath(buf);
if (buf.length() > 0) {
buf.append("!/");
}
}
buf.append(pathWithinParentZipFileSlice);
} | java | private void appendPath(final StringBuilder buf) {
if (parentZipFileSlice != null) {
parentZipFileSlice.appendPath(buf);
if (buf.length() > 0) {
buf.append("!/");
}
}
buf.append(pathWithinParentZipFileSlice);
} | [
"private",
"void",
"appendPath",
"(",
"final",
"StringBuilder",
"buf",
")",
"{",
"if",
"(",
"parentZipFileSlice",
"!=",
"null",
")",
"{",
"parentZipFileSlice",
".",
"appendPath",
"(",
"buf",
")",
";",
"if",
"(",
"buf",
".",
"length",
"(",
")",
">",
"0",
... | Recursively append the path in top down ancestral order.
@param buf
the buf to append the path to | [
"Recursively",
"append",
"the",
"path",
"in",
"top",
"down",
"ancestral",
"order",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/fastzipfilereader/ZipFileSlice.java#L178-L186 | train |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/ScanSpec.java | ScanSpec.filterClasspathElements | public void filterClasspathElements(final ClasspathElementFilter classpathElementFilter) {
if (this.classpathElementFilters == null) {
this.classpathElementFilters = new ArrayList<>(2);
}
this.classpathElementFilters.add(classpathElementFilter);
} | java | public void filterClasspathElements(final ClasspathElementFilter classpathElementFilter) {
if (this.classpathElementFilters == null) {
this.classpathElementFilters = new ArrayList<>(2);
}
this.classpathElementFilters.add(classpathElementFilter);
} | [
"public",
"void",
"filterClasspathElements",
"(",
"final",
"ClasspathElementFilter",
"classpathElementFilter",
")",
"{",
"if",
"(",
"this",
".",
"classpathElementFilters",
"==",
"null",
")",
"{",
"this",
".",
"classpathElementFilters",
"=",
"new",
"ArrayList",
"<>",
... | Add a classpath element filter. The provided ClasspathElementFilter should return true if the path string
passed to it is a path you want to scan.
@param classpathElementFilter
The classpath element filter to apply to all discovered classpath elements, to decide which should
be scanned. | [
"Add",
"a",
"classpath",
"element",
"filter",
".",
"The",
"provided",
"ClasspathElementFilter",
"should",
"return",
"true",
"if",
"the",
"path",
"string",
"passed",
"to",
"it",
"is",
"a",
"path",
"you",
"want",
"to",
"scan",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/ScanSpec.java#L270-L275 | train |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/ScanSpec.java | ScanSpec.isModuleLayer | private static boolean isModuleLayer(final Object moduleLayer) {
if (moduleLayer == null) {
throw new IllegalArgumentException("ModuleLayer references must not be null");
}
for (Class<?> currClass = moduleLayer.getClass(); currClass != null; currClass = currClass
.get... | java | private static boolean isModuleLayer(final Object moduleLayer) {
if (moduleLayer == null) {
throw new IllegalArgumentException("ModuleLayer references must not be null");
}
for (Class<?> currClass = moduleLayer.getClass(); currClass != null; currClass = currClass
.get... | [
"private",
"static",
"boolean",
"isModuleLayer",
"(",
"final",
"Object",
"moduleLayer",
")",
"{",
"if",
"(",
"moduleLayer",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"ModuleLayer references must not be null\"",
")",
";",
"}",
"for",
... | Return true if the argument is a ModuleLayer or a subclass of ModuleLayer.
@param moduleLayer
the module layer
@return true if the argument is a ModuleLayer or a subclass of ModuleLayer. | [
"Return",
"true",
"if",
"the",
"argument",
"is",
"a",
"ModuleLayer",
"or",
"a",
"subclass",
"of",
"ModuleLayer",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/ScanSpec.java#L320-L331 | train |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/ScanSpec.java | ScanSpec.addModuleLayer | public void addModuleLayer(final Object moduleLayer) {
if (!isModuleLayer(moduleLayer)) {
throw new IllegalArgumentException("moduleLayer must be of type java.lang.ModuleLayer");
}
if (this.addedModuleLayers == null) {
this.addedModuleLayers = new ArrayList<>();
}... | java | public void addModuleLayer(final Object moduleLayer) {
if (!isModuleLayer(moduleLayer)) {
throw new IllegalArgumentException("moduleLayer must be of type java.lang.ModuleLayer");
}
if (this.addedModuleLayers == null) {
this.addedModuleLayers = new ArrayList<>();
}... | [
"public",
"void",
"addModuleLayer",
"(",
"final",
"Object",
"moduleLayer",
")",
"{",
"if",
"(",
"!",
"isModuleLayer",
"(",
"moduleLayer",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"moduleLayer must be of type java.lang.ModuleLayer\"",
")",
";",... | Add a ModuleLayer to the list of ModuleLayers to scan. Use this method if you define your own ModuleLayer,
but the scanning code is not running within that custom ModuleLayer.
<p>
This call is ignored if it is called before {@link #overrideModuleLayers(Object...)}.
@param moduleLayer
The additional ModuleLayer to sca... | [
"Add",
"a",
"ModuleLayer",
"to",
"the",
"list",
"of",
"ModuleLayers",
"to",
"scan",
".",
"Use",
"this",
"method",
"if",
"you",
"define",
"your",
"own",
"ModuleLayer",
"but",
"the",
"scanning",
"code",
"is",
"not",
"running",
"within",
"that",
"custom",
"Mo... | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/ScanSpec.java#L344-L352 | train |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/ScanSpec.java | ScanSpec.log | public void log(final LogNode log) {
if (log != null) {
final LogNode scanSpecLog = log.log("ScanSpec:");
for (final Field field : ScanSpec.class.getDeclaredFields()) {
try {
scanSpecLog.log(field.getName() + ": " + field.get(this));
} ... | java | public void log(final LogNode log) {
if (log != null) {
final LogNode scanSpecLog = log.log("ScanSpec:");
for (final Field field : ScanSpec.class.getDeclaredFields()) {
try {
scanSpecLog.log(field.getName() + ": " + field.get(this));
} ... | [
"public",
"void",
"log",
"(",
"final",
"LogNode",
"log",
")",
"{",
"if",
"(",
"log",
"!=",
"null",
")",
"{",
"final",
"LogNode",
"scanSpecLog",
"=",
"log",
".",
"log",
"(",
"\"ScanSpec:\"",
")",
";",
"for",
"(",
"final",
"Field",
"field",
":",
"ScanS... | Write to log.
@param log
The {@link LogNode} to log to. | [
"Write",
"to",
"log",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/ScanSpec.java#L493-L504 | train |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/classpath/CallStackReader.java | CallStackReader.getCallStackViaSecurityManager | private static Class<?>[] getCallStackViaSecurityManager(final LogNode log) {
try {
return new CallerResolver().getClassContext();
} catch (final SecurityException e) {
// Creating a SecurityManager can fail if the current SecurityManager does not allow
// RuntimePerm... | java | private static Class<?>[] getCallStackViaSecurityManager(final LogNode log) {
try {
return new CallerResolver().getClassContext();
} catch (final SecurityException e) {
// Creating a SecurityManager can fail if the current SecurityManager does not allow
// RuntimePerm... | [
"private",
"static",
"Class",
"<",
"?",
">",
"[",
"]",
"getCallStackViaSecurityManager",
"(",
"final",
"LogNode",
"log",
")",
"{",
"try",
"{",
"return",
"new",
"CallerResolver",
"(",
")",
".",
"getClassContext",
"(",
")",
";",
"}",
"catch",
"(",
"final",
... | Get the call stack via the SecurityManager API.
@param log
the log
@return the call stack. | [
"Get",
"the",
"call",
"stack",
"via",
"the",
"SecurityManager",
"API",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/classpath/CallStackReader.java#L121-L132 | train |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/classpath/CallStackReader.java | CallStackReader.getClassContext | static Class<?>[] getClassContext(final LogNode log) {
// For JRE 9+, use StackWalker to get call stack.
// N.B. need to work around StackWalker bug fixed in JDK 13, and backported to 12.0.2 and 11.0.4
// (probably introduced in JDK 9, when StackWalker was introduced):
// https://github.... | java | static Class<?>[] getClassContext(final LogNode log) {
// For JRE 9+, use StackWalker to get call stack.
// N.B. need to work around StackWalker bug fixed in JDK 13, and backported to 12.0.2 and 11.0.4
// (probably introduced in JDK 9, when StackWalker was introduced):
// https://github.... | [
"static",
"Class",
"<",
"?",
">",
"[",
"]",
"getClassContext",
"(",
"final",
"LogNode",
"log",
")",
"{",
"// For JRE 9+, use StackWalker to get call stack.",
"// N.B. need to work around StackWalker bug fixed in JDK 13, and backported to 12.0.2 and 11.0.4",
"// (probably introduced i... | Get the class context.
@param log
the log
@return The classes in the call stack. | [
"Get",
"the",
"class",
"context",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/classpath/CallStackReader.java#L143-L204 | train |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/concurrency/SingletonMap.java | SingletonMap.values | public List<V> values() throws InterruptedException {
final List<V> entries = new ArrayList<>(map.size());
for (final Entry<K, SingletonHolder<V>> ent : map.entrySet()) {
final V entryValue = ent.getValue().get();
if (entryValue != null) {
entries.add(entryValue);... | java | public List<V> values() throws InterruptedException {
final List<V> entries = new ArrayList<>(map.size());
for (final Entry<K, SingletonHolder<V>> ent : map.entrySet()) {
final V entryValue = ent.getValue().get();
if (entryValue != null) {
entries.add(entryValue);... | [
"public",
"List",
"<",
"V",
">",
"values",
"(",
")",
"throws",
"InterruptedException",
"{",
"final",
"List",
"<",
"V",
">",
"entries",
"=",
"new",
"ArrayList",
"<>",
"(",
"map",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"final",
"Entry",
"<",
"K... | Get all valid singleton values in the map.
@return the singleton values in the map, skipping over any value for which newInstance() threw an exception
or returned null.
@throws InterruptedException
If getting the values was interrupted. | [
"Get",
"all",
"valid",
"singleton",
"values",
"in",
"the",
"map",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/concurrency/SingletonMap.java#L212-L221 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.