package io.perfmark.impl;

import java.util.Arrays;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;

@Immutable
public final class Marker {

  public static final Marker NONE = new Marker(null);

  private final @Nullable StackTraceElement location;

  Marker(@Nullable StackTraceElement location) {
    this.location = location;
  }

  @Override
  public String toString() {
    return "Marker{" + location + "}";
  }

  @Override
  public int hashCode() {
    return Arrays.hashCode(new Object[] {location});
  }

  @Override
  public boolean equals(Object obj) {
    if (!(obj instanceof Marker)) {
      return false;
    }
    Marker other = (Marker) obj;
    return Arrays.equals(new Object[] {location}, new Object[] {other.location});
  }
}

@@ -24,33 +24,8 @@
 l;%0A%0A
-import java.util.Arrays;%0A
 impo
@@ -473,47 +473,50 @@
 urn 
-Arrays.hashCode(new Object%5B%5D %7Blocation%7D
+location == null ? 31 : location.hashCode(
 );%0A 
@@ -672,68 +672,112 @@
     
-return Arrays.equals(new Object%5B%5D %7Blocation%7D, new Object%5B%5D %7B
+if (this.location == null) %7B%0A      return other.location == null;%0A    %7D%0A    return this.location.equals(
 othe
@@ -786,17 +786,16 @@
 location
-%7D
 );%0A  %7D%0A%7D

simplify Marker