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

Add Index Checker annotations #2

Open
wants to merge 90 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
2ab3356
Add check-index Ant target
mernst Jan 27, 2017
def1f40
Ignore generated files
mernst Jan 27, 2017
d64daa4
Merge github.com:jfree/jfreechart
mernst Sep 21, 2017
4fb83b3
begin pass at annotations
kelloggm Nov 17, 2017
3df94d1
annotations
kelloggm Nov 28, 2017
0c85993
more annotations
kelloggm Nov 29, 2017
18d524b
more annotations
kelloggm Dec 5, 2017
38a283b
more annotations
kelloggm Dec 7, 2017
1c4c2bf
Remove gratuitous diff against upstream
mernst Dec 13, 2017
86154e5
Add missing import statements
mernst Dec 13, 2017
1f24c04
annotations on a bunch of dataset classes
kelloggm Dec 13, 2017
34f6086
more annotations for 12/13/17
kelloggm Dec 14, 2017
bc6dc86
mostly finished with data/xy package
kelloggm Dec 15, 2017
731f19b
annotations on many packages in org/jfree/data
kelloggm Dec 16, 2017
3dbc048
improve annotations on data package. All classes now annotated; reduc…
kelloggm Dec 19, 2017
56ef4ca
add suppresswarnings/switch some annotations to remove all? warnings …
kelloggm Dec 20, 2017
8d9a536
finish annotating/suppressing warnings in data package
kelloggm Dec 20, 2017
a02a68a
begin annotating chart super-package
kelloggm Dec 22, 2017
ff61de0
additional annotations in chart packages
kelloggm Dec 22, 2017
4b3f6e7
fix crash
kelloggm Dec 24, 2017
7df959f
more annotations
kelloggm Dec 24, 2017
459770f
remove a few more warnings
kelloggm Dec 25, 2017
cfdb626
more annotations/suppressions
kelloggm Dec 28, 2017
61c1649
work from plane
kelloggm Dec 30, 2017
a04f724
afternoon work
kelloggm Dec 30, 2017
bba4571
2 warnings! The only remaining type checking warnings are super weird…
kelloggm Dec 30, 2017
8c5de67
Ignore output files
mernst Jan 3, 2018
8ae6208
updates based on jdk changes
kelloggm Jan 5, 2018
315c75e
Merge branch 'index' of https://github.com/kelloggm/jfreechart into i…
kelloggm Jan 5, 2018
b5947d3
change comments
kelloggm Jan 12, 2018
47c9284
update messages to clarify what is and is not a bug
kelloggm Jan 12, 2018
8045aa5
fix changes introduced b/c of jdk changes
kelloggm Jan 13, 2018
1cf2d12
remove unneeded suppress warnings
kelloggm Jan 22, 2018
055a8b1
actually remove them
kelloggm Jan 22, 2018
dc8ae7f
minor changes
kelloggm Jan 23, 2018
55038b9
fix bad choice
kelloggm Jan 24, 2018
a2e017a
audit establish rep invariant sws
kelloggm Jan 25, 2018
b5cf5fb
Mark warning supressions with new issue.
smillst Jan 25, 2018
9ccdcd4
Workaround FlowExpression parsing problem.
smillst Jan 26, 2018
c91631b
Add LessThan annotations.
smillst Jan 26, 2018
eb569c8
reenable warnings suppressions in dynamic time series collection
kelloggm Jan 26, 2018
731eccd
Add Stat Checkers.
smillst Jan 26, 2018
a922df9
Merge branch 'index' of github.com:kelloggm/jfreechart into index
smillst Jan 26, 2018
de27638
readd sws to xyBarRenderer
kelloggm Jan 26, 2018
4126044
Merge branch 'index' of github.com:kelloggm/jfreechart into index
smillst Jan 27, 2018
b1c6a5a
Run AnnotationStatistics and JavaCodeStatistics checkers
smillst Jan 27, 2018
31342e8
replace closed issue 195 with open and PR'd issue 218
kelloggm Jan 28, 2018
66ca971
a bit of consolidation
kelloggm Jan 28, 2018
59208e9
more consolidation
kelloggm Jan 28, 2018
280a385
more consolidation
kelloggm Jan 28, 2018
67d6f87
a few more consolidations in jfc
kelloggm Jan 28, 2018
6c78aed
almost finished with consolidation
kelloggm Jan 28, 2018
164e57a
finish consolidation
kelloggm Jan 28, 2018
b3f8b47
Remove suppress warnings for typetools/kelloggm#218
panacekcz Jan 29, 2018
eb918a7
Merge pull request #1 from panacekcz/unsuppress-218
smillst Jan 29, 2018
9a26b56
Remove Unneeded annotations.
smillst Jan 30, 2018
3a5f674
Merge branch 'index' of github.com:kelloggm/jfreechart into index
smillst Jan 30, 2018
446de1a
remove some unnecessary sws
kelloggm Jan 30, 2018
48d91b0
Merge branch 'index' of https://github.com/kelloggm/jfreechart into i…
kelloggm Jan 30, 2018
6312c5e
a few more annotations
kelloggm Jan 30, 2018
f71225f
apparently an annotation is required on protected fields
kelloggm Jan 30, 2018
ba66e2a
fix merge conflicts
kelloggm Feb 22, 2018
c32ec43
readd lib files that CF needs apparently
kelloggm Feb 22, 2018
e78d4ce
minor fix
kelloggm Feb 22, 2018
f19cea1
Fix test that fails in different timezones.
jfree Feb 23, 2018
6eaddd4
Fix for bug #75 - add same outline options as XYLineAndShapeRenderer.
jfree Feb 23, 2018
4752f0d
Update Javadocs for overlays.
jfree Feb 26, 2018
893f9b1
Add generics for subtitles list.
jfree Feb 26, 2018
520a4be
Don't use buffering in ChartPanel.
jfree Apr 14, 2018
fb40637
fix build
kelloggm May 1, 2018
787248d
remove old lib file, delete them from .gitignore
kelloggm May 1, 2018
468caee
minor cosmetic fixes Vlastimil noticed
kelloggm May 3, 2018
2852491
add travis integration
kelloggm May 3, 2018
90dd716
change timeout
kelloggm May 4, 2018
67929f4
some whitespace fixes
kelloggm May 4, 2018
3bf0c0a
more whitespace fixes
kelloggm May 4, 2018
3d284b2
minor changes to travis ci config
kelloggm May 4, 2018
fc51946
more whitespace fixes
kelloggm May 4, 2018
9febaa0
address a number of Mike's comments
kelloggm May 8, 2018
7532528
fix merge
kelloggm May 8, 2018
6fbf1c1
address more of Mike's commments
kelloggm May 8, 2018
b24c696
more changes to address Mike's comments
kelloggm May 9, 2018
2514371
add a second extra argument because Maven is bad
kelloggm May 9, 2018
5632a20
minor fixes
kelloggm May 10, 2018
4d42a42
Work on Guaranteed index false positives.
smillst May 22, 2018
7db9d8f
Remove warning suppressions that aren't needed.
smillst May 23, 2018
35c8d58
Improve comment.
smillst May 25, 2018
a88a6cf
Convert 4 false positives into one.
smillst May 25, 2018
a4fb36d
Add type argument to iterator and @NonNeg
smillst May 29, 2018
0508981
Merge pull request #2 from smillst/index
kelloggm Jun 7, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: java
sudo: false
script:
- travis_wait mvn compile
82 changes: 74 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,31 +59,78 @@
<version>4.11</version>
<scope>test</scope>
</dependency>
<!-- Annotations from the Checker Framework: nullness, interning, locking, ... -->
<dependency>
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
<version>2.5.1</version>
</dependency>
<dependency>
<groupId>org.checkerframework</groupId>
<artifactId>jdk8</artifactId>
<version>2.5.1</version>
</dependency>
</dependencies>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was (gratiutous) whitespace at the end of this line, which you removed. Please reinstate it, and review the diffs to ensure that no other whitespace changes remain.

</distributionManagement>

<build>
<testSourceDirectory>src/test/java</testSourceDirectory>

<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>${project.source.level}</source>
<target>${project.target.level}</target>
<encoding>${project.build.sourceEncoding}</encoding>
<source>1.8</source>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than hard-coding here, why not change the version number at line 159? That will reduce the size of the diffs and make it easier to merge in future changes.

<target>1.8</target>
<compilerArguments>
<Xmaxerrs>10000</Xmaxerrs>
<Xmaxwarns>10000</Xmaxwarns>
</compilerArguments>
<annotationProcessorPaths>
<path>
<groupId>org.checkerframework</groupId>
<artifactId>checker</artifactId>
<version>2.5.1</version>
</path>
</annotationProcessorPaths>
<annotationProcessors>
<!-- Add all the checkers you want to enable here -->
<annotationProcessor>${checkerframework.checkers}</annotationProcessor>
</annotationProcessors>
<compilerArgs>
<arg>-AprintErrorStack</arg>
<!-- location of the annotated JDK, which comes from a Maven dependency -->
<arg>-Xbootclasspath/p:${annotatedJdk}</arg>
<arg>-AskipDefs=Test</arg>
<arg>${checkerframework.extraargs}</arg>
<arg>${checkerframework.extraargs2}</arg>
<!-- Uncomment the following line to turn type-checking warnings into errors. -->
<!-- <arg>-Awarns</arg> -->
</compilerArgs>
</configuration>
</plugin>

<plugin>
<!-- This plugin will set properties values using dependency information -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>properties</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down Expand Up @@ -155,9 +202,15 @@
</reporting>

<properties>
<project.source.level>1.8</project.source.level>
<project.target.level>1.8</project.target.level>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.source.level>1.6</project.source.level>
<project.target.level>1.6</project.target.level>
<!-- These properties will be set by the Maven Dependency plugin -->
<annotatedJdk>${org.checkerframework:jdk8:jar}</annotatedJdk>
<!-- These properties are here for convenience when modifying the build from the command line -->
<checkerframework.checkers>org.checkerframework.checker.index.IndexChecker</checkerframework.checkers>
<checkerframework.extraargs></checkerframework.extraargs>
<checkerframework.extraargs2></checkerframework.extraargs2>
</properties>

<profiles>
Expand Down Expand Up @@ -225,6 +278,19 @@
</executions>
</plugin>

<plugin>
<!-- This plugin will set properties values using dependency information -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>properties</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>
</profile>
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/jfree/chart/ChartColor.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@

package org.jfree.chart;

import org.checkerframework.checker.index.qual.*;
import org.checkerframework.common.value.qual.*;

import java.awt.Color;
import java.awt.Paint;

Expand Down Expand Up @@ -146,7 +149,7 @@ public ChartColor(int r, int g, int b) {
*
* @return An array of objects with the {@code Paint} interface.
*/
public static Paint[] createDefaultPaintArray() {
public static Paint @ArrayLen(34) [] createDefaultPaintArray() {

return new Paint[] {
new Color(0xFF, 0x55, 0x55),
Expand Down
12 changes: 3 additions & 9 deletions src/main/java/org/jfree/chart/ChartFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* JFreeChart : a free chart library for the Java(tm) platform
* ===========================================================
*
* (C) Copyright 2000-2016, by Object Refinery Limited and Contributors.
* (C) Copyright 2000-2018, by Object Refinery Limited and Contributors.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the copyright dates should be changed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is because you want to revert the JFreeChart source code to an earlier version, that should be done in a separate pull request, to make this one easier to review.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is different because typetools hasn't merged from upstream, but this branch has (as of about 30 minutes ago when I realized I needed to because the tests were failing!). I certainly didn't change the copyright date. I'll merge upstream into typetools/master to fix the diff.

*
* Project Info: http://www.jfree.org/jfreechart/index.html
*
Expand All @@ -27,17 +27,11 @@
* ---------------
* ChartFrame.java
* ---------------
* (C) Copyright 2001-2008, by Object Refinery Limited and Contributors.
* (C) Copyright 2001-2018, by Object Refinery Limited and Contributors.
*
* Original Author: David Gilbert (for Object Refinery Limited);
* Contributor(s): -;
*
* Changes
* -------
* 22-Nov-2001 : Version 1 (DG);
* 08-Jan-2001 : Added chartPanel attribute (DG);
* 24-May-2002 : Renamed JFreeChartFrame --> ChartFrame (DG);
*
*/

package org.jfree.chart;
Expand Down Expand Up @@ -75,7 +69,7 @@ public ChartFrame(String title, JFreeChart chart) {
public ChartFrame(String title, JFreeChart chart, boolean scrollPane) {
super(title);
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
this.chartPanel = new ChartPanel(chart);
this.chartPanel = new ChartPanel(chart, false);
if (scrollPane) {
setContentPane(new JScrollPane(this.chartPanel));
}
Expand Down
Loading