I’m writing some REST WebServices that return JSON and wanted to ensure that my JSON was correctly formatted and parsable. Since the JDK ships with a JavaScript engine built into it now, I figured it would be simplest to just use that and avoid any external dependencies. Here’s my code:
ScriptEngine se = new ScriptEngineManager().getEngineByExtension("js");
se.eval("var obj = " + json + ";");
Pretty simple overall. The only tricky part is that you need to add the “var obj = ” and the semicolon on the end so that the JavaScript engine can evaluate it correctly.
I’ve been using IntelliJ IDEA for the past 7 years and anyone who knows me will tell you that I’m an IDE snob. However, over the past 7 years I have been using the exact same configuration for IntelliJ IDEA and all of my project files have rarely changed. Over those 7 years I would merrily install the new version of IntelliJ IDEA and when it asked me to import the configuration from an old version, I would. Likewise, when new versions of IntelliJ IDEA tried to open an older project file it would often ask me if I wanted to upgrade the file format to the new version and I would.
Over the years my IDE configuration files and project files seemed to becoming less and less stable. I assumed that even though I was upgrading consistently, IntelliJ IDEA was managing all that complexity behind the scenes without any problems. This is not the case. But let me be clear, this is NOT an issue with the IDE, but the user.
In order to innovate things must change. Often that change is not backwards compatible or backwards compatibility is not always perfect. If you really want to innovate, you should just toss backwards compatibility out the door and charge forward (but that’s a topic for another post). The folks over at JetBrains have been innovating on the world’s best IDE for years. They have also tried and mostly succeeded at providing working upgrade paths between versions because often they break backwards compatibility. However, nothing is perfect and there comes a point when you must wipe the slate clean and start fresh.
I decided it was time to start fresh with IntelliJ IDEA. Here’s what I did:
- Un-installed IntelliJ IDEA completely
- Deleted all the preferences, caches and logs
- Deleted all my IDE project files
- Re-installed IntelliJ IDEA fresh
- Re-configured IntelliJ from scratch
- Re-created all my IDE projects files by hand
At first I was really annoyed at having to do this process. But now that I’m mostly finished, I’m glad I did. I noticed that a number of files I had been using (i.e. .eml files) were no longer needed and IntelliJ was probably just dealing with them since they were there, even though it really preferred to use a different structure. I’d much rather use the new methodology instead of an older one, which might not have the same level of support and integration, and could unexpectedly break at any time.
I think I’ll be doing this refresh again each time IntelliJ releases a new major version. Might as well keep things clean and charging forward.
Posted in IntelliJ, Java
|

Inversoft announced last week a new partnership with Metaverse Mod Squad. The full press release can be viewed at http://www.prweb.com/releases/2010/03/prweb3702164.htm
We are very excited about this new partnership and know that it will help both companies serve our customers better. With the combination of Inversoft’s products and Metaverse Mod Squads services, our customers will be able to provide the best possible experience for their users.

Last week Inversoft launched the Clean Speak family of products and our new website. Clean Speak is a complete rewrite of our old profanity products and our website is a complete rebrand of our company.
Clean Speak includes all of the same features of the older profanity products and many new ones. Here are some of the best features of Clean Speak:
- Profanity Filter
- Email Filter
- URL Filter
- Phone Number Filter
- Management Interface
- Integrated Testing Tools
- Real-Time Database Updating
- Real-Time Filtering
- Content Moderation
- Much More
Additionally, Clean Speak is much faster. We have the best performance available and that means our filter and moderation tools can be used in even the highest volume games and websites.
If you haven’t checked it out already, head over to http://www.inversoft.com and see what we’ve been working on.
For some of the Inversoft products I’ve been adding new tables for new features into our standard schema. The tricky part with updating the database is also giving customers all the update scripts that they need to run and instructions on how to run them correctly.
I figured I’d see what happened if I added all the JPA Entity classes to the persistence.xml file and didn’t update the database. Since none of the existing JPA Entity classes was changed, the application appears to work fine without the tables in the database.
This is good news for me as it allows me to ship new versions of the application without any fear of breaking customers who don’t update their database. This is true only if that customer doesn’t use any of the new features that access the new tables.