Skip to content

Commit f05e8ed

Browse files
authored
Merge pull request #70 from rollbar/alpha-bug-fixes
Alpha bug fixes
2 parents 77aafde + b2d2306 commit f05e8ed

File tree

10 files changed

+591
-118
lines changed

10 files changed

+591
-118
lines changed

README.md

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
[![Build Status](https://travis-ci.org/rollbar/rollbar-java.svg?branch=master)](https://travis-ci.org/rollbar/rollbar-java)
22

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

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

3433
# Feedback
3534

36-
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.
35+
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.
3736

3837
## Installation
3938

4039
```groovy
41-
compile('com.rollbar:rollbar-java:1.0.0-alpha-1')
40+
compile('com.rollbar:rollbar-java:1.0.0-beta-1')
4241
```
4342

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

110+
There is a shim that has the same basic API as the old library located in the `rollbar-java`
111+
package at `com.rollbar.Rollbar`. This class is marked as deprecated as it is only intended to
112+
make upgrading slightly more convenient. This old example code should still work thanks to this shim class:
113+
114+
```java
115+
import com.rollbar.Rollbar;
116+
public class MainClass {
117+
public static final Rollbar rollbar = new Rollbar("ACCESS_TOKEN", "production");
118+
public int main(String[] args) {
119+
rollbar.handleUncaughtErrors();
120+
OtherClass.runProgram();
121+
return 0;
122+
}
123+
}
124+
```
125+
126+
However, we strongly advise upgrading to at least this equivalent using the new library:
127+
128+
```java
129+
import com.rollbar.notifier.Rollbar;
130+
public class MainClass {
131+
public static final Rollbar rollbar = new Rollbar(
132+
withAccessToken("ACCESS_TOKEN")
133+
.environment("production")
134+
.handleUncaughtErrors(true)
135+
.build());
136+
public int main(String[] args) {
137+
OtherClass.runProgram();
138+
return 0;
139+
}
140+
}
141+
```
142+
111143
## Installing
112144

113145
You can, of course, build it yourself and depend on the .jar manually,
@@ -124,15 +156,15 @@ dependency to your pom file:
124156
<dependency>
125157
<groupId>com.rollbar</groupId>
126158
<artifactId>rollbar-java</artifactId>
127-
<version>1.0.0-alpha-1</version>
159+
<version>1.0.0-beta-1</version>
128160
</dependency>
129161
</dependencies>
130162
```
131163

132164
### Gradle
133165

134166
```groovy
135-
compile('com.rollbar:rollbar-java:1.0.0-alpha-1')
167+
compile('com.rollbar:rollbar-java:1.0.0-beta-1')
136168
```
137169

138170
## Usage

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION_NAME=1.0.0-alpha-1
1+
VERSION_NAME=1.0.0-beta-1
22
GROUP=com.rollbar
33

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

1515
POM_NAME=rollbar
1616
POM_ARTIFACT_ID=rollbar
17-
POM_PACKAGING=jar
17+
POM_PACKAGING=jar

rollbar-android/src/main/java/com/rollbar/android/Rollbar.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import java.util.concurrent.TimeUnit;
2626

2727
public class Rollbar {
28-
private static final String NOTIFIER_VERSION = "0.2.1";
28+
private static final String NOTIFIER_VERSION = "1.0.0-beta-1";
2929
private static final String ITEM_DIR_NAME = "rollbar-items";
3030
private static final String ANDROID = "android";
3131
private static final String DEFAULT_ENVIRONMENT = "production";

rollbar-android/src/main/java/com/rollbar/android/provider/NotifierProvider.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,15 @@ public NotifierProvider(String version) {
1717
.build();
1818
}
1919

20+
public NotifierProvider(String version, String name) {
21+
this.notifier = new Notifier.Builder()
22+
.name(name)
23+
.version(version)
24+
.build();
25+
}
26+
2027
@Override
2128
public Notifier provide() {
2229
return notifier;
2330
}
24-
}
31+
}

rollbar-api/src/main/java/com/rollbar/api/payload/data/body/Frame.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,8 @@ public Map<String, Object> getKeywordArgs() {
120120
public Object asJson() {
121121
Map<String, Object> values = new HashMap<>();
122122

123-
if (filename != null) {
124-
values.put("filename", filename);
125-
}
123+
values.put("filename", filename != null ? filename : "[unknown]");
124+
126125
if (lineNumber != null) {
127126
values.put("lineno", lineNumber);
128127
}

0 commit comments

Comments
 (0)