Tag Archives: Eclipse plugin

Code Querying Made Easy!

This free Eclipse plugin seems quite intersting. I think I remember some other approaches in this direction, but none went so far. According to their front page the following features are supported:

  • Search and Navigate code – search semantic properties of code (both source and bytecode), and define customized tree-views.
  • Find bugs – use SemmleCode’s standard library to detect common bugs; adjust existing code queries to search for bug patterns that are specific to your projects and frameworks.
  • Compute metrics – do change impact analysis, spot bad code smells and explore dependencies, all with the library of metrics queries.
  • Enforce coding conventions – introduce your own checks with intuitive custom queries; show violations as errors or warnings in Eclipse.
  • Generate charts and graphs – view analysis results in no less than seven different ways, including charts and graphs; navigation is further simplified as each view is linked back to the source code.

You can read more here. I really hope to have the time to try it out.


1 Comment

Filed under Uncategorized

My Eclipse code-folding plugin

I will probably have to start with some apologies for letting you guys wait so long for the plugin I have announced in a couple of previous posts, but (as you probably already know the excuse) I’ve been very busy lately.
However in order to keep things short: here is the download link. It is not a real release, but the version I’ve been tweaking for a while and I am currently using. There are still problems with it, but most of the time it works (or at least using another programmer excuse: it works for me [smile/]). Please give it a try and let me know.


Filed under Uncategorized

Eclipse code-folding plugin: Coffee-Bytes

In a previous post I was talking about some small changes I have applied to one of the first OSS projects I was a core developer and committer: Coffee-Bytes. After that post, I have received quite a few messages expressing their interest in this plugin and the changes I have done to make it work with Eclipse 3.2.

Lately I have been very busy (speaking at JavaZone and JAOO) and I haven’t been able to do much about it. Still, on this project we were two developers, so before doing anything I will have to discuss these details and see what are the options. However, I promise I will keep everybody interested posted.



Filed under Uncategorized

Eclipse API and Code Folding

One of the my first open source projects I have worked on was Coffee-Bytes code folding plugin. It happened a long time ago and at some point the development has been discontinued.

However, tonight, working on some very long sources I have remembered it and I said I should give it a new try. Unfortunately, once I enabled it no editors could been displayed. Checking the .log file I have found the reason: the folding code was broken with a NoSuchMethod exception.

I have found in my archives the last version of the plugin and I thought I should check the API. To my surprise the API was still available (or at least reachable), but what made me post this entry is a feature added in Eclise 3.1: Access Restrictions, according to which when you create a plugin you can restrict others plugin access to its code. While I find the idea quite good (as it makes the API more clear), I have found out that almost everything related to java source code editors is restricted, and I am wondering why? I thought some other plugins would benefit from a clear API (for example AJDT), and now finding this makes me wonder about the reasons (I am quite sure there are good reasons).

However, getting back to the points of this entry, you can read more about Access restrictions: here.

Following the last advise specified at the above link:

But what if you really, really, really, really need to use the class? In that case, you can use it, but you need to be aware of what it means (four really’s usually does it for me).

I have done some small changes to readapt the code and now I have again Coffee-Bytes code folding working on Eclipse 3.2. Just look at the picture to see how reach it is compaired with the default code folding offered by Eclipse:

Reach Eclipse Code Folding

It offers you folding for:

  • top level types
  • normal methods
  • constructors
  • getters and setters
  • main methods
  • inner types
  • static initializers
  • import statements
  • source headers
  • comment blocks
  • javadocs

and even User defined code folding:

User defined code folding



Filed under Uncategorized

Code reviews and tools (plugins) that may help

After reading Cedric‘s post on Code reviews I remembered that I have used an Eclipse plugin that helped me doing code reviews: Jupiter (I have even submitted at that time some patches [blink/]). As far as I know the plugin is continuously improved so if you are in need for something like this go and get it a try.
Another nice Eclipse plugin that might help with code reviews is Mylar even if its intention is not exactly this one.


Filed under Uncategorized

Sharing IDEA project definition files

In a previous post I have tried to figure out how Idea project and modules definition files can be shared between team members considering etherogenous environments.
While I could find a few references in the Help, none of them is really describing how things should be done. I have mentioned how this can be achieved while working with Eclipse by using path variables. This same notion exists in Idea too, but I couldn’t figure out how can one can use it from the UI. But, the good news is that you can define variables to be used with modules, and also you can use variables while defining classpaths. I have figured out that by editting the .ipr file (project definition) and adding:

<macro name=”MAVEN_REPO” />

you will force your project to define this variable and than you can use it in both module paths and different classpaths just by specifying $MAVEN_REPO$/rest_of_path. The only thing left is to find out how you can do this without having to manually edit the .ipr and .iml files. Does anybody know the answer to this?

Disclaimer: this is the 3rd post in row about Idea and considering what may happen if Hani is picking you, I will just let everybody know that I am not associated and nor do I work for Eclipse or Idea.

category: , ,

1 Comment

Filed under Uncategorized

An Eclipse user in IDEA-land meets paths

If you haven’t followed the first part of this series, I will briefly restate here that the goal of these posts is not to start the long discussion about which IDE is better, but rather to raise some questions about things that remained unclear while playing with Idea.

Today the Eclipse user (n.b.: me) had to play with paths. And I am including here: source paths, output paths and classpaths.
First: source paths. In Eclipse I have to define the source folders under the current project directory. The only possibility to include in a project external source dirs is through linked directories. Idea allows providing more Content Roots for each module, and so you can include multiple source directories from different locations on the file system.
Output paths: Idea allows you to set only 2 output directories per module: the source output directory and the test output directory. Even if at the first glance this looks a little bit restrictive, things are not so bad cause for real big projects requiring multiple output folders you will however have to define a build system (Ant, Maven based) to really manage the project.
So far, everything went as expected. Unfortunately, the things weren’t as clear while trying to set the classpath. In a multi-module project, Idea introduces 3 types of classpaths: Global libraries, Project libraries and Module libraries. While at the first glance these look really good, I finally haven’t been able to achieve what I wanted.

And I think this is the moment for the first question: considering a project that is shared by a team of developers, and the project is built using jars from a MAVEN local repository (each developer may have the repository on a different location), how should I define the classpath so that the project/module definition can be shared? Or, what is the correct approach for achieving this with Idea. In Eclipse I am doing this using a variable pointing to MAVEN_REPO and than defining the classpath in terms of this variable (the classpath will look something like: MAVEN_REPO/log4j/jars/log4j-1.2.8.jar;MAVEN_REPO/lucene/jars/lucene-1.4.3.jar. Considering that each developer can define this variable to point to his repository than the team will be able to share the project definition file). Can this be achieved with Idea?

In Eclipse I can include a jar in my project classpath using one of the following solutions:

  • contained in the current project (the most usual way)
  • anywhere on the filesystem (not very usefully in a shared project)
  • extended variable (as shown above)
  • relative to another project (very usefully in a shared project: the classpath description is persisted in relative terms ignoring the real locations of the projects)

My final question for the 2nd day in the Idea-land would be: how can I achieve the 3rd and 4th scenarios in the above list, and also be assured that the project/module definition can be shared. I really hope to have some answers from expert Idea users, so that I will have a 3rd day in Idea-land. Thanks.

category: , ,


Filed under Uncategorized

An Eclipse user in IDEA-land

I am an Eclipse user for more than 3 years, but I find it interesting to have a look at the other approaches in the world of Java IDEs. This post is not meant to start once again the long and so useless discussion about which one is the best, but rather to ask questions about how to achieve some goals (and hopefully have some advanced users answer ’em [smile/]).

Since back in the days of Netbeans 3, I got used to define in my workspace projects that are related to my current work. For example, if my current work project is using WebWork than usually I will create a WebWork project. This will allow me to navigate through its sourcecode and also help me when debugging.

IntelliJ IDEA allows you to work with a project at a time. But it allows you to define more modules inside a project and as I found out groups of modules. And here is my first question:

Can I use modules to refere the external projects my current project is based on? Or in case this is a wrong approach from the perspective of IDEA than what is the way to define my project so that I can navigate the source code of the projects it depends on?

I will be very happy to hear how I can do this in the IDEA-way. Thanks in advance to everyone giving me hints.

Disclaimer: I have spent some time reading the IDEA help, but I haven’t found references to this question. The approach I am describing above it’s coming mainly from using the Eclipse workspace export plugin provided with IDEA.

Update: Scott posted the hint to succesfully see the dependency projects while debugging.

category: , ,


Filed under Uncategorized

TestNG and IDE support

During the last months, while developing TestNG, I have read and also received lots of comments about the lack of support for TestNG in the most used IDEs (Eclipse, IntelliJ IDEA and NetBeans). I have put some of my spare time into developing a plugin for Eclipse (by the way it is working great, and the features are quite nice [blink/]). I’ve had intentions to do the same for Idea, but I cannot see how I can develop a plugin with the Plugin Development Package.
Why? That 14Megs download contains 45Megs javadocs, which are mostly empty. I don’t have any document describing which way to go. And those 6 examples are little toys. While the Eclipse API is really huge, I was able to find valid javadoc comments, lots of examples and even some good books (not to mention the fact that developing with Eclipse means learning SWT/JFace). I also know about the support site, but I usually go to this kind of places to ask important/specific questions, and not <<Please help…>> ones.
I keep my interest open to support TestNG in Idea, but for the moment this seems to me quite impossible.

Disclaimer: this post is by no means meant to upset IntelliJ IDEA‘s developers. It is only my short experience while trying to develop a plugin.


Filed under Uncategorized

Eclipse TestNG plugin public availability

A few days ago we have announced on the TestNG MLs the release candidate of the TestNG-Eclipse plugin.
Today, Cedric and myself are very pleased to announce the general public availability of the TestNG Eclipse plugin (in fact this post was meant for yesterday but I was not able to publish it).
It can be downloaded from:

Now the official announcement:

Hi all!
The TestNG team is pleased to announce (and distribute also ;-)) the first version of TestNG Eclipse plugin.

1/ TestNG View (Window -> Show View -> Other -> Java -> TestNG) featuring
– the Red-Green Bar
– test results statistics
– hierarchical test results presentation
– failures stack traces presentation.

2/ TestNG Launcher (Run … -> TestNG) featuring
– browse and run a TestNG enabled test class
– browse and run groups defined in the project tests
– browse and run suites

3/ Contextual TestNG Launcher (Right Click -> Run) featuring:
– run class as TestNG test
– run type as TestNG test
– run method as TestNG test
– run suite as TestNG test

The current version is working with Eclipse 3.1M5 (and probably 3.1M4).

Your feedback is welcome (and needed). Enjoy!

TestNG Team

You can see a set of nice snapshots on Cedric’s announcement.

We hope that this release will bring more pleasure on your experience with TestNG.

Leave a comment

Filed under Uncategorized