Skip to content

Commit 19bd601

Browse files
committed
javadoc
1 parent 35e93ae commit 19bd601

File tree

1 file changed

+37
-4
lines changed

1 file changed

+37
-4
lines changed

class-match/src/main/java/datadog/instrument/classmatch/ClassInfoCache.java

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ public final class ClassInfoCache<T> {
3535
private final SharedInfo[] shared;
3636
private final int slotMask;
3737

38+
/**
39+
* Creates a new class-info cache with the given capacity.
40+
*
41+
* @param capacity the cache capacity
42+
*/
3843
public ClassInfoCache(int capacity) {
3944
if (capacity < MIN_CAPACITY) {
4045
capacity = MIN_CAPACITY;
@@ -46,29 +51,54 @@ public ClassInfoCache(int capacity) {
4651
this.shared = new SharedInfo[slotMask + 1];
4752
}
4853

49-
/** Finds information for the given class-name, across all class-loaders. */
54+
/**
55+
* Finds information for the given class-name, across all class-loaders.
56+
*
57+
* @param className the class-name
58+
* @return information shared under the class-name
59+
*/
5060
public T find(String className) {
5161
return find(className, ALL_CLASS_LOADERS);
5262
}
5363

54-
/** Shares information for the given class-name, across all class-loaders. */
64+
/**
65+
* Shares information for the given class-name, across all class-loaders.
66+
*
67+
* @param className the class-name
68+
* @param info the information to share under the class-name
69+
*/
5570
public void share(String className, T info) {
5671
share(className, info, ALL_CLASS_LOADERS);
5772
}
5873

59-
/** Finds information for the given class-name, under the given class-loader. */
74+
/**
75+
* Finds information for the given class-name, under the given class-loader.
76+
*
77+
* @param className the class-name
78+
* @param cl the class-loader
79+
* @return information shared under the class-name and class-loader
80+
*/
6081
public T find(String className, ClassLoader cl) {
6182
return find(className, ClassLoaderIndex.getClassLoaderKeyId(cl));
6283
}
6384

64-
/** Shares information for the given class-name, under the given class-loader. */
85+
/**
86+
* Shares information for the given class-name, under the given class-loader.
87+
*
88+
* @param className the class-name
89+
* @param info the information to share under the class-name and class-loader
90+
* @param cl limit the information to this class-loader
91+
*/
6592
public void share(String className, T info, ClassLoader cl) {
6693
share(className, info, ClassLoaderIndex.getClassLoaderKeyId(cl));
6794
}
6895

6996
/**
7097
* Finds information for the given class-name, under the given class-loader key.
7198
*
99+
* @param className the class-name
100+
* @param classLoaderKeyId the class-loader's key-id
101+
* @return information shared under the class-name and class-loader
72102
* @see ClassLoaderIndex#getClassLoaderKeyId(ClassLoader)
73103
*/
74104
@SuppressWarnings("unchecked")
@@ -106,6 +136,9 @@ public T find(String className, int classLoaderKeyId) {
106136
/**
107137
* Shares information for the given class-name, under the given class-loader key.
108138
*
139+
* @param className the class-name
140+
* @param info the information to share under the class-name and class-loader
141+
* @param classLoaderKeyId limit the information to this class-loader key-id
109142
* @see ClassLoaderIndex#getClassLoaderKeyId(ClassLoader)
110143
*/
111144
@SuppressWarnings("StatementWithEmptyBody")

0 commit comments

Comments
 (0)