1

I have a JCodeModel object which includes a class body, would be written to a .java file:

codeModel.build(new File("src").getAbsoluteFile());

There might already be the same .java class file in the folder, which I tend to compare with the current JcodeModel's object content, and save this JCodeModel to .java file only if the class body has been updated and differs from the old .java file.

I couldn't find any way to do this with JCodeModel's default methods. How should this be done? Comparing the fields of the two classes should also do the job in my case, But a more general way to compare the whole bodies of the classes would be preferable.

DummyBeginner
  • 411
  • 10
  • 34

0 Answers0