Skip to content

Commit

Permalink
Fix Javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
blerer committed Jul 20, 2023
1 parent f22a4e6 commit 75b6b3f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/org/github/jamm/MemoryMeter.java
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ private MemoryMeter(Builder builder) {
/**
* Create a new {@link MemoryMeter} instance from the different component it needs to measure object graph.
* <p>Unless there is a specific need to override some of the {@code MemoryMeter} logic people should only create
* {@MemoryMeter} instances through {@code MemoryMeter.builder()}. This constructor provides a way to modify part of the
* {@code MemoryMeter} instances through {@code MemoryMeter.builder()}. This constructor provides a way to modify part of the
* logic being used by allowing to use specific implementations for the strategy or filters.</p>
*
* @param strategy the {@code MemoryMeterStrategy} to use for measuring object shallow size.
Expand Down Expand Up @@ -602,6 +602,10 @@ public MemoryMeter build() {

/**
* Specify what should be the strategy used to measure the shallow size of object.
*
* @param strategy the strategy that should be used to measure objects
* @param fallbacks the fallback strategies
* @return this builder
*/
public Builder withGuessing(Guess strategy, Guess... fallbacks) {

Expand Down
3 changes: 3 additions & 0 deletions src/org/github/jamm/strategies/MemoryLayoutBasedStrategy.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ public long computeArraySize(int length, int elementSize) {
}

/**
* Returns the size of a field of the specified type.
*
* @param type the field type
* @return The memory size of a field of a class of the provided type; for Objects this is the size of the reference only
*/
protected final int measureField(Class<?> type) {
Expand Down
2 changes: 1 addition & 1 deletion src/org/github/jamm/strategies/UnsafeStrategy.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import sun.misc.Unsafe;

/**
* {@code MemoryMeterStrategy} relying on {@code Unsafe} to measure object sizes for Java versions >= 15.
* {@code MemoryMeterStrategy} relying on {@code Unsafe} to measure object sizes for Java versions &ge; 15.
*
* <p>In Java 15, the way the JVM layout fields across the hierarchy changed. Prior to Java 15 superclass field
* always came first. Therefore that strategy could only look at the current class to find the greatest offsets.
Expand Down
4 changes: 2 additions & 2 deletions src/org/github/jamm/utils/MethodHandleUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static Optional<MethodHandle> mayBeMethodHandle(Class<?> klass, String me
*
* @param method the method
* @return the {@code MethodHandle} for the specified method
* @throws IllegalAccessException
* @throws IllegalAccessException if the method is not accessible
*/
public static MethodHandle methodHandle(Method method) throws IllegalAccessException {
return MethodHandles.lookup().unreflect(method);
Expand All @@ -40,7 +40,7 @@ public static MethodHandle methodHandle(Method method) throws IllegalAccessExcep
*
* @param field the field
* @return the {@code MethodHandle} for the specified field
* @throws IllegalAccessException
* @throws IllegalAccessException if the method is not accessible
*/
public static MethodHandle methodHandle(Field field) throws IllegalAccessException {
return MethodHandles.lookup().unreflectGetter(field);
Expand Down

0 comments on commit 75b6b3f

Please sign in to comment.