Raudius / Pushraven

A simple Java library to interface with Firebase Cloud Messaging (FCM) API. Pushraven allows you to push notifications to clients in very few lines of code.
MIT License
78 stars 34 forks source link

StackOverflowError upon component initialisation #16

Closed ajantis closed 6 years ago

ajantis commented 6 years ago

Problem

Hey! So if one follows the tutorial and inits the component like this:

Pushraven.setAccountFile(new File("service_account.json"));
<...>

Then the app enters an infinite loop and eventually crashes with a SO error:

Exception in thread "main" java.lang.StackOverflowError
    at us.raudi.pushraven.Pushraven.setAccountFile(Pushraven.java:36)
    at us.raudi.pushraven.Pushraven.setAccountFile(Pushraven.java:36)
    at us.raudi.pushraven.Pushraven.setAccountFile(Pushraven.java:36)
       <...>

Cause

That's is due to an infinite recursive call here: https://github.com/Raudius/Pushraven/blob/master/Pushraven/src/us/raudi/pushraven/Pushraven.java#L36

Fix

At first glance, that recursive call seems superfluous, and can be just removed. Right? 😉

Best, -Dmitry

Raudius commented 6 years ago

You are right!

I have no idea how that happened. I guess I shouldn't do staging at 2am anymore.

Anyway, I have just (2:10am... whatever!) uploaded the new version to maven and should become available soon.

The new version has code: 1.0.1

<dependency>
  <groupId>us.raudi</groupId>
  <artifactId>pushraven</artifactId>
  <version>1.0.1</version>
</dependency>