Skip to content

Commit

Permalink
revert: native agent
Browse files Browse the repository at this point in the history
(cherry picked from commit d2e7b2f)
  • Loading branch information
christianbuon authored and brianr committed Jan 23, 2025
1 parent 7fef995 commit 41f1175
Show file tree
Hide file tree
Showing 12 changed files with 7 additions and 340 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
import com.rollbar.notifier.config.Config;
import com.rollbar.notifier.config.ConfigBuilder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -30,11 +29,9 @@ public class Application {
public Application() {
this.greeting = new Greeting();
LOGGER.info("Configuring Rollbar");
List<String> appPackages = Arrays.asList("com.rollbar.example");
Config config = ConfigBuilder.withAccessToken(System.getenv("ROLLBAR_ACCESSTOKEN"))
.environment("development")
.codeVersion("1.0.0")
.appPackages(appPackages)
.build();
LOGGER.info("Initializing Rollbar");
this.rollbar = Rollbar.init(config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,34 @@ package com.rollbar.example
import com.rollbar.notifier.Rollbar
import com.rollbar.notifier.config.ConfigBuilder

import scala.collection.JavaConverters._
import scala.util.control.NonFatal

object Application {

def main(args: Array[String]) {
val appPackages = List("com.rollbar.example")
val config = ConfigBuilder.withAccessToken(sys.env("ROLLBAR_ACCESSTOKEN"))
.language("scala")
.codeVersion("1.0.0")
.environment("development")
.appPackages(appPackages.asJava)
.build();

val rollbar = new Rollbar(config)
val rollbar = Rollbar.init(config)

val whoa = 92
try {
exec()
} catch {
case NonFatal(e) => rollbar.error(e)
}

try {
rollbar.close(true);
} catch {
case NonFatal(e) => e.printStackTrace
}
}

def exec() {
val x = 42
val y = x + 99
greeting()

throw new RuntimeException("Execution error after greeting.")
}

def greeting() {
val zz = s"Hello Rollbar!"
println(zz)
println(s"Hello Rollbar!")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ public class Frame implements JsonSerializable, StringTruncatable<Frame> {

private final Map<String, Object> keywordArgs;

private final Map<String, Object> locals;

private Frame(Builder builder) {
this.filename = builder.filename;
this.lineNumber = builder.lineNumber;
Expand All @@ -53,8 +51,6 @@ private Frame(Builder builder) {
this.args = builder.args != null ? unmodifiableList(new ArrayList<>(builder.args)) : null;
this.keywordArgs = builder.keywordArgs != null
? unmodifiableMap(new HashMap<>(builder.keywordArgs)) : null;
this.locals = builder.locals != null
? unmodifiableMap(new HashMap<>(builder.locals)) : null;
}

/**
Expand Down Expand Up @@ -130,14 +126,6 @@ public Map<String, Object> getKeywordArgs() {
return keywordArgs;
}

/**
* Getter.
* @return the local variables for this frame.
*/
public Map<String, Object> getLocals() {
return locals;
}

@Override
public Object asJson() {
Map<String, Object> values = new HashMap<>();
Expand Down Expand Up @@ -168,9 +156,6 @@ public Object asJson() {
if (keywordArgs != null) {
values.put("kwargs", keywordArgs);
}
if (locals != null) {
values.put("locals", locals);
}

return values;
}
Expand All @@ -185,7 +170,6 @@ public Frame truncateStrings(int maxLength) {
.context(truncateStringsInObject(context, maxLength))
.args(truncateStringsInObjectList(args, maxLength))
.keywordArgs(truncateStringsInMap(keywordArgs, maxLength))
.locals(truncateStringsInMap(locals, maxLength))
.build();
}

Expand Down Expand Up @@ -225,10 +209,7 @@ public boolean equals(Object o) {
if (args != null ? !args.equals(frame.args) : frame.args != null) {
return false;
}
if (keywordArgs != null ? !keywordArgs.equals(frame.keywordArgs) : frame.keywordArgs != null) {
return false;
}
return locals != null ? locals.equals(frame.locals) : frame.locals == null;
return keywordArgs != null ? keywordArgs.equals(frame.keywordArgs) : frame.keywordArgs == null;
}

@Override
Expand All @@ -242,7 +223,6 @@ public int hashCode() {
result = 31 * result + (context != null ? context.hashCode() : 0);
result = 31 * result + (args != null ? args.hashCode() : 0);
result = 31 * result + (keywordArgs != null ? keywordArgs.hashCode() : 0);
result = 31 * result + (locals != null ? locals.hashCode() : 0);
return result;
}

Expand All @@ -258,7 +238,6 @@ public String toString() {
+ ", context=" + context
+ ", args=" + args
+ ", keywordArgs=" + keywordArgs
+ ", locals=" + locals
+ '}';
}

Expand All @@ -285,8 +264,6 @@ public static final class Builder {

private Map<String, Object> keywordArgs;

private Map<String, Object> locals;

/**
* Constructor.
*/
Expand All @@ -309,7 +286,6 @@ public Builder(Frame frame) {
this.context = frame.context;
this.args = frame.args;
this.keywordArgs = frame.keywordArgs;
this.locals = frame.locals;
}

/**
Expand Down Expand Up @@ -411,17 +387,6 @@ public Builder keywordArgs(Map<String, Object> keywordArgs) {
return this;
}

/**
* The local variables for this method from the stack frame (if available).
*
* @param locals the local variables.
* @return the builder instance.
*/
public Builder locals(Map<String, Object> locals) {
this.locals = locals;
return this;
}

/**
* Builds the {@link Frame frame}.
*
Expand Down
63 changes: 0 additions & 63 deletions rollbar-java/src/main/java/com/rollbar/jvmti/CacheFrame.java

This file was deleted.

44 changes: 0 additions & 44 deletions rollbar-java/src/main/java/com/rollbar/jvmti/LocalVariable.java

This file was deleted.

90 changes: 0 additions & 90 deletions rollbar-java/src/main/java/com/rollbar/jvmti/ThrowableCache.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public Rollbar(Config config) {
if (config.handleUncaughtErrors()) {
this.handleUncaughtErrors();
}
processAppPackages(config);
}

/**
Expand Down
Loading

0 comments on commit 41f1175

Please sign in to comment.