code
stringlengths
73
34.1k
label
stringclasses
1 value
private void completeMultipart(String bucketName, String objectName, String uploadId, Part[] parts) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, Int...
java
private void abortMultipartUpload(String bucketName, String objectName, String uploadId) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalExcept...
java
public void removeIncompleteUpload(String bucketName, String objectName) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException { for (R...
java
public void listenBucketNotification(String bucketName, String prefix, String suffix, String[] events, BucketEventListener eventCallback) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullPa...
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...
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...
java
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 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 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 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 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 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 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 String credential(String accessKey, DateTime date, String region) { return accessKey + "/" + date.toString(DateFormat.SIGNER_DATE_FORMAT) + "/" + region + "/s3/aws4_request"; }
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...
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(); }
java
public void setContentType(String contentType) throws InvalidArgumentException { if (Strings.isNullOrEmpty(contentType)) { throw new InvalidArgumentException("empty content type"); } this.contentType = contentType; }
java
public void setContentEncoding(String contentEncoding) throws InvalidArgumentException { if (Strings.isNullOrEmpty(contentEncoding)) { throw new InvalidArgumentException("empty content encoding"); } this.contentEncoding = contentEncoding; }
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...
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...
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)); }
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); }
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); }
java
public void parseXml(Reader reader) throws IOException, XmlPullParserException { this.xmlPullParser.setInput(reader); Xml.parseElement(this.xmlPullParser, this, this.defaultNamespaceDictionary, null); }
java
protected void parseXml(Reader reader, XmlNamespaceDictionary namespaceDictionary) throws IOException, XmlPullParserException { this.xmlPullParser.setInput(reader); Xml.parseElement(this.xmlPullParser, this, namespaceDictionary, null); }
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 ...
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; }
java
public static void checkNotNullOrEmpty(String string, String message) { if (string == null || string.isEmpty()) { throw new IllegalArgumentException(message); } }
java
@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) { Preconditions.checkNotNull(context, "context == null"); Preconditions.checkNotNull(strategy, "strategy == null...
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...
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; }
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...
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;...
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>...
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) { ...
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...
java
public ClassGraph enableAllInfo() { enableClassInfo(); enableFieldInfo(); enableMethodInfo(); enableAnnotationInfo(); enableStaticFinalFieldConstantInitializerValues(); ignoreClassVisibility(); ignoreFieldVisibility(); ignoreMethodVisibility(); ret...
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");...
java
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 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 whitelistPackagesNonRecursive(final String... packageNames) { enableClassInfo(); for (final String packageName : packageNames) { final String packageNameNormalized = WhiteBlackList.normalizePackageOrClassName(packageName); if (packageNameNormalized.contains("*")...
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...
java
public ClassGraph blacklistPackages(final String... packageNames) { enableClassInfo(); for (final String packageName : packageNames) { final String packageNameNormalized = WhiteBlackList.normalizePackageOrClassName(packageName); if (packageNameNormalized.isEmpty()) { ...
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 ...
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 ...
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...
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...
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()) { ...
java
public ClassGraph whitelistModules(final String... moduleNames) { for (final String moduleName : moduleNames) { scanSpec.moduleWhiteBlackList.addToWhitelist(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; }
java
public ClassGraph whitelistClasspathElementsContainingResourcePath(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...
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) { ...
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) { ...
java
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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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
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
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
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
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 extendScanningUpwards() { // Check superclass if (superclassName != null) { scheduleScanningIfExternalClass(superclassName, "superclass"); } // Check implemented interfaces if (implementedInterfaces != null) { for (final String interfaceName :...
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...
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; }
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) + "] ...
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...
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...
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 ...
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. " ...
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 ...
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...
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...
java
private AnnotationInfo readAnnotation() throws IOException { // Lcom/xyz/Annotation; -> Lcom.xyz.Annotation; final String annotationClassName = getConstantPoolClassDescriptor( inputStreamOrByteBuffer.readUnsignedShort()); final int numElementValuePairs = inputStreamOrByteBuffer.r...
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...
java
private void readBasicClassInfo() throws IOException, ClassfileFormatException, SkipClassException { // Modifier flags classModifiers = inputStreamOrByteBuffer.readUnsignedShort(); isInterface = (classModifiers & 0x0200) != 0; isAnnotation = (classModifiers & 0x2000) != 0; // Th...
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()); ...
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++) { ...
java
private void appendPath(final StringBuilder buf) { if (parentZipFileSlice != null) { parentZipFileSlice.appendPath(buf); if (buf.length() > 0) { buf.append("!/"); } } buf.append(pathWithinParentZipFileSlice); }
java
public void filterClasspathElements(final ClasspathElementFilter classpathElementFilter) { if (this.classpathElementFilters == null) { this.classpathElementFilters = new ArrayList<>(2); } this.classpathElementFilters.add(classpathElementFilter); }
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...
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<>(); }...
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)); } ...
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...
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....
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);...
java