git/list[1] front-page[2] threads[3] people[4] search[5] about
 

java diffs show no method context

From
UWUlrich Windl <ulrich.windl@rz.uni-regensburg.de>
Date
Apr 25, 2018, 12:53 UTC
Message-ID
<5AE07A3A020000A10002B5C5@gwsmtp1.uni-regensburg.de>
Hi!

This is for git 2.13.6, and it may be an FAQ or frequent feature request. Anyway: I'm new to Java, and writing my first project using Git, I found that "git diff" only reports the class in the diff context, but not the method (as seen for C, for example). I'd wish to have the method where the diff is located. Here is an example chunk:

@@ -100,6 +119,8 @@ public class PdfParser {
        PdfObject obj, value;
        PdfObjectName name;
        for ( int pos = startIndex; pos < endIndex; pos += 2 ) {
+           if ( (obj = objects.get(pos)).type != PdfObject.Type.Name )
+               exception("Name expected");
            name = (PdfObjectName) obj;
            if ( pos + 1 == endIndex )
                exception("missing value");

The corrsponding definition of the method is like this:

    /**
     * Populate Dictionary with parsed objects
     * @param dict Dictionary to fill
     * @param startIndex Position of first item to add
     * @param endIndex Position of first item not to add
     */
    private void populateDictionary(PdfObjectDictionary dict, int startIndex, in
t endIndex)
    {
...

Regards,
Ulrich
Next: Alban Gruin
Message 1 of 4 in “java diffs show no method context”
  1. Ulrich WindlApr 25, 2018
  2. Alban GruinApr 25, 2018
  3. Antw: Re: java diffs show no method contextUlrich Windl, Apr 26, 2018
  4. Ævar Arnfjörð BjarmasonApr 26, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.