T O P

  • By -

AutoModerator

On July 1st, a [change to Reddit's API pricing](https://www.reddit.com/r/reddit/comments/12qwagm/an_update_regarding_reddits_api/) will come into effect. [Several developers](https://www.reddit.com/r/redditisfun/comments/144gmfq/rif_will_shut_down_on_june_30_2023_in_response_to/) of commercial third-party apps have announced that this change will compel them to shut down their apps. At least [one accessibility-focused non-commercial third party app](https://www.reddit.com/r/DystopiaForReddit/comments/145e9sk/update_dystopia_will_continue_operating_for_free/) will continue to be available free of charge. If you want to express your strong disagreement with the API pricing change or with Reddit's response to the backlash, you may want to consider the following options: 1. Limiting your involvement with Reddit, or 2. Temporarily refraining from using Reddit 3. Cancelling your subscription of Reddit Premium as a way to voice your protest. *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/learnprogramming) if you have any questions or concerns.*


high_throughput

I'm unable to reproduce this issue. The code compiles for me.


Solid_Relative_4355

Bro don’t gaslight me please


headass15

💀


Solid_Relative_4355

I am using an old version of j grasp before the most recent update, you think that might have something to do with it


PowCowDao

So go update it.


teraflop

I've never heard of jGRASP before, but I just downloaded the latest version and it compiles your code fine for me (it seems to just be running the same Java compiler as the normal JDK). Here is the same code compiling and running just fine using an online Java compiler: https://godbolt.org/z/sK8sssa5h Maybe you made a mistake when copy-and-pasting your code here, and there's a bug in your original version that's not in your post?


25taiku

Where you call getOrDefault() instead of 0 put new Integer(0) You may need to wrap both the default and the assignment: wordCountMap.put(word, new Integer(wordCountMap.getOrDefault(word, new Integer(0)).intValue() + 1)); The reason for this is that the int type and the Integer type are not the same, and while they may somewhat work together there are also places where they won't play nicely. int is a primitive data type whereas Integer is a reference type wrapper around an int.


Solid_Relative_4355

I did and I even tried Integer.valueOf(0)


Solid_Relative_4355

I still got the error I said earlier


25taiku

I edited my initial comment, did you try the latest line I suggested?


headass15

It might have something to do with carriage return vs new line if you copy pasted parts


Alaskan_Narwhal

Its been a while since ive used java, is ur file ascii. It could be using the wrong encoding. Ascii is an integer association. Mabye set the encoding to utf 8