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

Missing Diffs #35

Open
ali-ghanbari opened this issue Oct 17, 2022 · 0 comments
Open

Missing Diffs #35

ali-ghanbari opened this issue Oct 17, 2022 · 0 comments

Comments

@ali-ghanbari
Copy link

ali-ghanbari commented Oct 17, 2022

Hi,

Thanks for this useful library.
When parsing the attached unified diff file, I noticed that the library fails to retrieve all the diffs (it only sees the first one).
I am not sure if the format of the file is correct; when I delete the blank lines between the diffs the library works just fine.
I am guessing this might be a bug in the library, and it would be ideal to fix it.

Here is my use case:

final DiffParser parser = new UnifiedDiffParser();
try (InputStream is = new FileInputStream("test.patch")) {
   System.out.println(parser.parse(is).size()); // This is supposed to print 2, but it prints 1: it only sees the first diff!
}

And here is the patch file test.patch:

--- /source/org/jfree/chart/plot/CategoryPlot.java
+++ /source/org/jfree/chart/plot/CategoryPlot.java
@@ -1042,7 +1042,8 @@
             result = (ValueAxis) this.rangeAxes.get(index);
         }
         if (result == null) {
-            Plot parent = getParent();
+            CategoryAxis xAxis = (CategoryAxis) this.domainAxes.get(index);
+			Plot parent = getParent();
             if (parent instanceof CategoryPlot) {
                 CategoryPlot cp = (CategoryPlot) parent;
                 result = cp.getRangeAxis(index);
@@ -1349,7 +1350,8 @@
      */
     public void setDataset(int index, CategoryDataset dataset) {
 
-        CategoryDataset existing = (CategoryDataset) this.datasets.get(index);
+        Object result = null;
+        CategoryDataset existing = (CategoryDataset) this.datasets.get(index);
         if (existing != null) {
             existing.removeChangeListener(this);
         }


--- /source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java
+++ /source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java
@@ -1795,7 +1795,7 @@
         int index = this.plot.getIndexOf(this);
         CategoryDataset dataset = this.plot.getDataset(index);
         if (dataset != null) {
-            return result;
+            Paint outlinePaint = plot.getOutlinePaint();
         }
         int seriesCount = dataset.getRowCount();
         if (plot.getRowRenderingOrder().equals(SortOrder.ASCENDING)) {

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

No branches or pull requests

1 participant