Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified Java files vs. Modified Java classes #521

Open
jose opened this issue Jul 3, 2023 · 0 comments
Open

Modified Java files vs. Modified Java classes #521

jose opened this issue Jul 3, 2023 · 0 comments

Comments

@jose
Copy link
Collaborator

jose commented Jul 3, 2023

Strictly speaking, the modified_classes directory (and the classes.modified property) lists the set of modified java files which may or may not be that set of modified classes. Although in most cases a .java file correspondents to the definition of a single Java class, .java files might define multiple nested classes. For example, the modified java file of Time-13

src/main/java/org/joda/time/format/PeriodFormatterBuilder.java

defines 1 top-level class and 7 nested classes:

public class PeriodFormatterBuilder {
  ...

  static class SimpleAffix implements PeriodFieldAffix {
    ...
  }

  static class PluralAffix implements PeriodFieldAffix {
    ...
  }

  static class CompositeAffix implements PeriodFieldAffix {
    ...
  }

  static class FieldFormatter implements PeriodPrinter, PeriodParser {
    ...
    // THE BUGGY CLASS
  }

  static class Literal implements PeriodPrinter, PeriodParser {
    ...
  }

  static class Separator implements PeriodPrinter, PeriodParser {
    ...
  }

  static class Composite implements PeriodPrinter, PeriodParser {
    ...
  }
}

Time-13's modified_classes/13.src lists

org.joda.time.format.PeriodFormatterBuilder

as the modified class, but it should list

org.joda.time.format.PeriodFormatterBuilder$FieldFormatter

A possible fix to this issue would require a more complex bug-mining procedure that given a diff and the set of modified java files, it would output the name of the modified classes. (javaparser might help on this.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant