Finding out which methods were changed by a checkin?

Here's the deal - I want a way to figure out specifically which methods were touched or changed within the last milestone/iteration so that the methods' Javadoc is checked for correct content, especially for the public API methods.

Any ideas on how to do this, perhaps with an SVN hook?

Asked by: Lucas961 | Posted: 21-01-2022

Answer 1

there is no single command to achieve this, but you can combine some svn commands to achive something similar:

  1. svn diff last tag with your trunk:HEAD revision with --summarize option
  2. svn annotate each file you revceived by step 1 and parse the output to find the changed codelines (their rev is greater than tag-rev.)
  3. mark associated functions or output them into a report file(just remember the last function signature if you parse the file line by line)

the class/methodname is trivial to get for usual java classes, however, if you use innerclasses, it will be more difficult, but then : do they have or need javadoc comments?

Answered by: Sawyer752 | Posted: 22-02-2022

Answer 2

An idea, at least: svn diff has the ability to pass arguments to the diff command. One such option is -p, also known as --show-c-function. This would probably figure in a solution of this problem for C code. So, the question becomes: is there a diff implementation that knows enough of the Java syntax to support a similar option? I've Googled, but not found anything yet.

Answered by: Paul970 | Posted: 22-02-2022

Similar questions

java - Finding the number of test methods in a JUnit test class

How I can get the number of total test methods in a JUnit test class? There exists a similar question which was for JUnit4. As I am using JUnit3, is there any way in junit3 to get the number o...

finding the index of a stack with java (only using methods push, pop, and peek)

New programmer learning java here! I'm trying to count how many steps does it take for a loop to stop taking what the user inputted into account. Bear in mind, there is limitation set by some guy in school sigh you can only use some methods in stack. These methods are push, pop, and peek. Input: first input is how many elements added. second input is a list of books y...

java - Finding unused jars used in an eclipse project

Are there any plugins/tools available to go through the classpath of an eclipse project (or workspace) and highlight any unused jars?

java - Finding the class with the main method in an applet

I'm trying to use this tool to find some information out about an applet's swing structure. Unfortunately, I didn't develop the applet. I've pulled the jars for the applet from the cache, but there are several hundred .class files in the jars, and I don't know which one has the main method. ...

java - Finding Struts version?

What is the easiest way to find the Struts library version? I'm adding Struts libraries to an generic eclipse project, and need to be able to differentiate between versions. (Other libraries like Spring have a getVersion() call) I can always read the jar manifest, but I'm looking for an easier way.

java - Finding which .class file has a bad version

Whats the easiest way to determine which Java class is compiled with the "wrong" version number? I've a project with a large number of dependencies and somewhere I've a class compiled using Java 1.6, where Java 1.5 is required. At runtime I get the uninformative exception: [WARN] StandardWrapperValve[shell]: Servlet.service() for servlet shell threw exception java.lang.UnsupportedClassVersionError: Bad ...

Finding tokens in a Java String

Is there a nice way to extract tokens that start with a pre-defined string and end with a pre-defined string? For example, let's say the starting string is "[" and the ending string is "]". If I have the following string: "hello[world]this[[is]me" The output should be: token[0] = "world" token[1] = "[is" (Note: the second token has a 'start' string in it)

java - Finding all valid xpath from xml

I am trying to write a program in java where in i can find all the xpath for the given xml.I found out the link on the internet xpath generator but it does not work when one element can repeat multipletimes for example if we have xml like the following :- <?xml version="1.0" encodi...

java - OQL for finding new objects only in heap dumps?

Does anyone know the OQL syntax for finding new objects only in a heap output? I can't find good documentation on OQL options, sun even has an example of new-only output without sample syntax of the query that generated it.What I've done is Created a set of heaps with jhat Served them up with jmap -base...

java - Finding and sorting unique numbers, is there a better way?

macos - Finding the version of OSX inside java

I need to test if the version of osx is < 10.5 inside java is this possible?

jvm - Java: Finding out *why* a class is loaded

I am currently having the problem that I have a (partial) program that is trying to load a class but fails because it cannot find this class. Looking at the stack trace, I cannot see any particular reason for why the VM tries to load this particular class at the first place. Are there any tools that would let me figure out why a particular class is being loaded? Hint: I am already getting a stack trace at...

Still can't find your answer? Check out these amazing Java communities for help...

Java Reddit Community | Java Help Reddit Community | Java Community | Java Discord | Java Programmers (Facebook) | Java developers (Facebook)