Skip to content

Commit

Permalink
Merge pull request #70 from rollbar/alpha-bug-fixes
Browse files Browse the repository at this point in the history
Alpha bug fixes
  • Loading branch information
rokob authored Oct 25, 2017
2 parents 77aafde + b2d2306 commit f05e8ed
Show file tree
Hide file tree
Showing 10 changed files with 591 additions and 118 deletions.
48 changes: 40 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
[![Build Status](https://travis-ci.org/rollbar/rollbar-java.svg?branch=master)](https://travis-ci.org/rollbar/rollbar-java)

The current library has undergone a major overhaul and is released as an alpha version.
We do not recommend upgrading from any prior version of `rollbar-java` yet. This
disclaimer will be removed and a non-alpha version will be released when we are confident
in general consumption of this library.
The current library has undergone a major overhaul and is now released as a beta version.
We recommend upgrading from prior versions of `rollbar-java`, but that process may require some
work on your end for the more complex use cases of the old library.

The code is documented with javadoc and therefore should be usable from viewing
the documentation in the source. There are examples in the `examples` directory showing different
Expand Down Expand Up @@ -33,12 +32,12 @@ The example directory contains examples using `rollbar-java` directly as well as

# Feedback

To report problems or ask a question about the alpha release, please [create an issue](https://github.com/rollbar/rollbar-java/issues/new) and apply the label `1.0.0-alpha` so our team can follow up with you.
To report problems or ask a question about the alpha release, please [create an issue](https://github.com/rollbar/rollbar-java/issues/new) and apply the label `1.0.0-beta` so our team can follow up with you.

## Installation

```groovy
compile('com.rollbar:rollbar-java:1.0.0-alpha-1')
compile('com.rollbar:rollbar-java:1.0.0-beta-1')
```

## Upgrading from 0.5.4 or earlier to 1.0.0
Expand Down Expand Up @@ -108,6 +107,39 @@ Rollbar rollbar = Rollbar.init(config);
rollbar.error(t);
```

There is a shim that has the same basic API as the old library located in the `rollbar-java`
package at `com.rollbar.Rollbar`. This class is marked as deprecated as it is only intended to
make upgrading slightly more convenient. This old example code should still work thanks to this shim class:

```java
import com.rollbar.Rollbar;
public class MainClass {
public static final Rollbar rollbar = new Rollbar("ACCESS_TOKEN", "production");
public int main(String[] args) {
rollbar.handleUncaughtErrors();
OtherClass.runProgram();
return 0;
}
}
```

However, we strongly advise upgrading to at least this equivalent using the new library:

```java
import com.rollbar.notifier.Rollbar;
public class MainClass {
public static final Rollbar rollbar = new Rollbar(
withAccessToken("ACCESS_TOKEN")
.environment("production")
.handleUncaughtErrors(true)
.build());
public int main(String[] args) {
OtherClass.runProgram();
return 0;
}
}
```

## Installing

You can, of course, build it yourself and depend on the .jar manually,
Expand All @@ -124,15 +156,15 @@ dependency to your pom file:
<dependency>
<groupId>com.rollbar</groupId>
<artifactId>rollbar-java</artifactId>
<version>1.0.0-alpha-1</version>
<version>1.0.0-beta-1</version>
</dependency>
</dependencies>
```

### Gradle

```groovy
compile('com.rollbar:rollbar-java:1.0.0-alpha-1')
compile('com.rollbar:rollbar-java:1.0.0-beta-1')
```

## Usage
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_NAME=1.0.0-alpha-1
VERSION_NAME=1.0.0-beta-1
GROUP=com.rollbar

POM_DESCRIPTION=For connecting your applications built on the JVM to Rollbar for Error Reporting
Expand All @@ -14,4 +14,4 @@ POM_DEVELOPER_NAME=Andrew Weiss

POM_NAME=rollbar
POM_ARTIFACT_ID=rollbar
POM_PACKAGING=jar
POM_PACKAGING=jar
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import java.util.concurrent.TimeUnit;

public class Rollbar {
private static final String NOTIFIER_VERSION = "0.2.1";
private static final String NOTIFIER_VERSION = "1.0.0-beta-1";
private static final String ITEM_DIR_NAME = "rollbar-items";
private static final String ANDROID = "android";
private static final String DEFAULT_ENVIRONMENT = "production";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@ public NotifierProvider(String version) {
.build();
}

public NotifierProvider(String version, String name) {
this.notifier = new Notifier.Builder()
.name(name)
.version(version)
.build();
}

@Override
public Notifier provide() {
return notifier;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,8 @@ public Map<String, Object> getKeywordArgs() {
public Object asJson() {
Map<String, Object> values = new HashMap<>();

if (filename != null) {
values.put("filename", filename);
}
values.put("filename", filename != null ? filename : "[unknown]");

if (lineNumber != null) {
values.put("lineno", lineNumber);
}
Expand Down
Loading

0 comments on commit f05e8ed

Please sign in to comment.