0

These days lot of Java code is available on internet and probably whatever class you want to write, someone has already written it in some project. In a simple e.g if I want to create an Address bean with fields like streetName, streetNumber, postalCode etc. someone has already created this bean class in their project, why not just search download(may be some quick changes) and use it in your project.

If the project is open source, personally I dont think that there will be any moral issues or are there?

What I found so far is grepcode.com, a Java code specific tool, which allows you to search by class names. For e.g PostalAddress

Are there any other tools available for finding Java code on class level? (for re-using)

Arsal
  • 919
  • 3
  • 11
  • 19
  • 5
    Be careful with legal issues, most open source software comes with a license. – Henry Jan 07 '13 at 04:39
  • 1
    What about "Google"? That's probably the most effective tool ... if you are smart with your choice of search terms. – Stephen C Jan 07 '13 at 04:48
  • A) If you've too lazy to create beans (especially when your IDE will basically do it for you) ... B) Google has never failed me. – Brian Roach Jan 07 '13 at 04:51
  • True, IDE or XSD can generate the code for me in case of beans, I think I was more interested in finding specific functions though a simple example was of a bean. – Arsal Jan 07 '13 at 14:57

2 Answers2

2

Even if the code is open source, you need to be careful, especially if your own application is commercial. When reusing open source you should look at the license under which the code is available, because it may have implications on how you distribute your own application that uses this code. There are various open source licences such as GPL, LGPL, Apache License etc. For example, if the code is under GPL and you include it in your application, you would have to distribute it under the same GPL license. You should make sure that you have gone through the license under which your open source library/code is available.

Shyamal Pandya
  • 532
  • 3
  • 16
0

You should try code.google.com. Also findjar.com is there but I dont think that is what you are looking for.

Deepak Singhal
  • 10,568
  • 11
  • 59
  • 98