Commit Graph

5116 Commits

Author SHA1 Message Date
Ben Liblit a888a49fdd Fix all Eclipse warnings about unnecessary semicolons
I have *not* upgraded this problem to be treated as an error in the
future.  Unfortunately Eclipse uses a single configuration setting for
both unnecessary semicolons and also for empty control-flow statements
like `while (p) ;`.  I'm not convinced that it's worth rewriting all
instances of the latter into `while (p) { }`.  So this is just going
to stay as a warning for now.
2017-07-14 22:39:01 -07:00
Ben Liblit 594525a83f Fix Eclipse warnings about methods that can be declared static
The fix is to add "static" where appropriate, of course.  I've also
simplified calls to such methods to reflect the fact that they no
longer need a specific object to call the method on.

In projects that contain test inputs, I've left the non-static
declarations unchanged, and instead downgraded the warning to be
ignored.  In all other projects, this warning has been upgraded to an
error.
2017-07-14 22:38:38 -07:00
Julian Dolby 0aadaa7aa0 small extensions to native code 2017-07-13 21:20:48 +00:00
Ben Liblit 0e6b00e29f Revert accidental, harmless, but unnecessary make config changes 2017-07-12 10:39:06 -07:00
Ben Liblit 9d6e362eaa Fix additional uses of raw types related to IVariable
These were not producing warnings in the Eclipse Oxygen GUI, and also
produced no warnings from Tycho when running Maven tests on my local
machine.  However, they did result in errors under Travis-CI.  I'm not
sure why this inconsistency exists, but hopefully we have now fixed
these raw-type uses in a way that makes everything happy.
2017-07-12 10:39:06 -07:00
Ben Liblit 1d27ca974b Upgrade raw-types-usage warnings to errors where possible
In general, these diagnostics are now errors in projects for which all
such warnings have been fixed.  There are three unfixed warnings in
two projects, so this diagnostic remains a warning (not an error) in
those projects.

There are also many places where rwa-types-usage warnings have been
locally suppressed using @SuppressWarnings annotations.  I haven't
systematically revisited those to see if any can be fixed properly.
So for those projects this diagnostic must also remain a warning (not
an error), since @SuppressWarnings does not work on things Eclipse is
configured to treat as errors.
2017-07-12 10:39:06 -07:00
Ben Liblit e316471d88 Fix nearly all Eclipse warnings about using raw types
Along the way, I also converted many "for (;;)" loops into modern
"for (:)" loops.  I didn't systematically look for all opportunities
to do this, though.  I merely made this change where I was already
converting raw Iterator uses into modern Iterator<...> uses.

Better use of generics also allowed many casts to become statically
redundant.  I have removed all such redundant casts.

Only three raw-types warnings remain after this batch of fixes.  All
three involve raw uses of CallGraphBuilder.  I've tried to fix these
too, but it quickly snowballs into a cascade of changes that may or
may not eventually reach a statically-type-save fixed point.  I may
give these last few problem areas another go in the future.  For now,
though, the hundreds of other fixes seem worth keeping even if there
are a few stragglers.

This commit may change some public APIs, but only by making weaker
type signatures stronger by replacing raw types with generic types.
For example, we may change something like "Set" into "Set<String>",
but we're not adding new arguments, changing any
underlying (post-generics-erasure) types, etc.
2017-07-12 10:39:06 -07:00
Ben Liblit cdce02573e Suppress warning about redundant type arguments in pre-1.7 code
Apparently this code is built using Java 1.6 under Tycho.  This leads
to complaints about the Java 1.7+ "<>" generic type inference feature,
if I try to use it.  Weirdly, the Eclipse GUI does not complain about
this, so apparently the Eclipse GUI is using Java 1.7 or later.  I do
not understand why Tycho and the Eclipse GUI are mismatched in this
way.
2017-07-12 10:39:06 -07:00
Ben Liblit f948b01e15 Suppress warnings about using raw types that we cannot fix
Some of the code in this project is machine-generated, so we cannot do
anything about raw-type warnings that arise.
2017-07-12 10:39:06 -07:00
Ben Liblit 65e6e5fbcf Suppress warnings about using raw types in test input
We shouldn't use raw types in real application code, but we often want
test inputs to do things that are simpler, or even not-quite-kosher.
2017-07-12 10:39:06 -07:00
Ben Liblit 0bbe9970c6 Enable Eclipse Oxygen's new "unlikely argument types" diagnostics
There are two such diagnostics: one for collection methods and one for
equals().  See
<https://www.eclipse.org/eclipse/news/4.7/jdt.php#unlikely-argument-types>
for more information about these two new diagnostics.

For each of these diagnostics, I've set the severity level to
"warning" in projects that have some instances of the suspicious code,
or to "error" in projects that have no instances of the suspicious
code.
2017-07-08 13:22:00 -07:00
Ben Liblit 42c1c0a37e Ignore Eclipse warnings about missing hashCode() methods in tests
In regular application code, these warnings should be taken seriously
and fixed.  But for test code, it's better to keep things simple and
not add any methods that aren't strictly needed by the test.
2017-06-30 10:24:36 -07:00
Ben Liblit 29f53d11fe Add a hashCode() method to a class that already has equals()
Generally, overriding one means you should be overriding the other
too.

Also, configure Eclipse to treat any similar cases as errors, rather
than merely warnings.
2017-06-30 10:24:36 -07:00
Ben Liblit bb032c9869 Add @Override annotations wherever possible
In the `com.ibm.wala.util` project, configure Eclipse to treat any
future violations of this as errors, not merely warnings.

However, in `com.ibm.wala.cast.java.test.data`, configure Eclipse to
silently ignore missing @Override annotations.  The JLex code in this
project is machine-generated, and we don't have a way to get the
generator to produce @Override annotations.
2017-06-30 08:54:12 -07:00
Julian Dolby 773fa68a3f made native test run on a linux vm 2017-06-29 09:07:29 +00:00
Julian Dolby f3a38f50d8 more linking 2017-06-28 17:56:04 -04:00
Julian Dolby 9789eb4216 remove import 2017-06-28 17:36:34 -04:00
Julian Dolby 6a6bf888e8 try some static linking 2017-06-28 17:30:55 -04:00
Julian Dolby c51321f4ba try to load libs on linux 2017-06-28 16:26:03 -04:00
Julian Dolby a8ba39fa99 kill native test for now 2017-06-28 15:59:22 -04:00
Julian Dolby 5374ce3169 more linking 2017-06-28 15:38:38 -04:00
Julian Dolby d8f6bf2a26 more linking hacks 2017-06-28 15:24:22 -04:00
Julian Dolby 8c8f352325 link object file 2017-06-28 15:06:47 -04:00
Julian Dolby 9b6e29dcfd try extern "C" 2017-06-28 14:50:01 -04:00
Julian Dolby 3722190ece try extern "C" 2017-06-28 14:48:05 -04:00
Julian Dolby c57a21d4ef linking 2017-06-28 13:53:59 -04:00
Julian Dolby cf4b27a065 linking 2017-06-28 13:44:17 -04:00
Julian Dolby c979c9700e header needed on linux 2017-06-28 13:37:26 -04:00
Julian Dolby e21257f3e3 more lib paths 2017-06-28 13:33:13 -04:00
Julian Dolby 8138497ee2 more lib paths 2017-06-28 13:30:46 -04:00
Julian Dolby 1cd8db5571 jvm lib in different place on linux 2017-06-28 13:20:58 -04:00
Julian Dolby 2c5fb1aa1b linux perhaps needs more headers 2017-06-28 13:12:26 -04:00
Julian Dolby 5c242e8e10 more .. fussiness on linux
someone does not like -std=c++11
2017-06-28 13:04:51 -04:00
Julian Dolby b1c1ba8a48 linux seems fussier than the mac about .. 2017-06-28 12:57:33 -04:00
Julian Dolby 589da154a1 get realpath 2017-06-28 12:52:30 -04:00
Julian Dolby 7c476eac3d native interface for WALA 2017-06-28 12:42:49 -04:00
Ben Liblit d32b2a29ad Ignore Eclipse warnings about potentially-static test code
In general, test code may do all sorts of things that would be
considered poor style in production code.  I assume that these
potentially-static methods are declared non-static by design.
2017-06-26 11:16:09 -07:00
Ben Liblit b3df445a4a Ignore Eclipse warnings about non-externalized string literals
There seems to be no effort to internationalize WALA, so such warnings
are just noise that we have no plans to fix.
2017-06-26 11:16:09 -07:00
Ben Liblit 3187d09c1f Roll some diagnostics back to ignore instead of warning or error
These should mostly be things that we've already decided earlier that
we explicitly don't want to "fix" because they simply disagree with
the WALA project's coding style.
2017-06-26 11:16:09 -07:00
Ben Liblit fb9042d3a6 Activate more Eclipse diagnostics, and treat many warnings as errors
The additional diagnostics are ones that were previously being
ignored, but which we seem to have been ignoring by default rather
than as a conscious choice.

For diagnostics of which we currently have *zero* instances, treat
these as errors rather than merely warnings.  The intent is to
permanently lock out future regressions of things we've completely
fixed.  In the future, whenever we fix the last instance of a given
warning in a given Eclipse project, we should also promote that
diagnostic to an error to keep things clean into the future.
2017-06-26 11:16:09 -07:00
Ben Liblit 457a294889 Treat API restriction diagnostics as warnings, not errors
The Eclipse IDE shows no such diagnostics, so it would be nice to
treat them as errors if any appear in the future.  However, the batch
Tycho-based build ("mvn clean install -DskipTests") does find and
report numerous such violations.  This discrepancy is strange; Manu
and I currently don't know why it's happening.  We suspect some
Maven-related weirdness may be creating slightly different
environments in the Eclipse GUI versus the command-line-driven build.
2017-06-26 11:16:09 -07:00
Ben Liblit 0b712f46b3 Simpler strategy for telling Tycho to use existing project settings
See
<https://eclipse.org/tycho/sitedocs/tycho-compiler-plugin/compile-mojo.html#useProjectSettings>
for more documentation on this feature, which first arrived in Tycho
0.22.
2017-06-26 11:16:09 -07:00
Manu Sridharan fbf4ff731d speed up some CG tests by disabling reflection handling
We should add some proper unit tests if we really care about how
reflection is handled for these tests; they take way too long to run
2017-06-26 10:57:31 -07:00
Manu Sridharan 469734f61e Various fixes to nodejs project config files
* Fix pom.xml to be like other projects
* Check for existence of nodejs download before re-downloading
* Fix Eclipse config files to be like other projects
2017-06-23 07:01:18 +02:00
Manu Sridharan 7d29573a26 Remove code to scan call sites for max param count
We cannot find any case where this code fixes a problem,
and it doesn't seem to be a good fix anyway.
2017-06-22 14:39:13 +02:00
Ben Liblit 16f673490d Fix all remaining Eclipse "Unnecessary Code" warnings
There were only three left, all fairly straightforward to fix.
2017-06-22 14:08:44 +02:00
Julian Dolby ea844f0f4c Merge pull request #187 from liblit/warning-fixes-plug-in-development-misc
Fix nearly all Eclipse “Plug-in Development” warnings
2017-06-22 11:01:49 +02:00
Ben Liblit 83e82111fb Merge branch 'warning-fixes-plug-in-development-misc' of github.com:liblit/WALA into warning-fixes-plug-in-development-misc 2017-06-07 17:47:20 +02:00
Ben Liblit 69149ed472 Match classpath to JavaSE-1.7 execution environment
This fixes one Eclipse "The JRE container on the classpath is not a
perfect match to the 'JavaSE-1.7' execution environment" warning in
the "Plug-in Development" category.
2017-06-07 17:42:11 +02:00
Ben Liblit a940935056 Export all packages
This fixes eleven Eclipse "This plug-in does not export all of its
packages" warnings in the "Plug-in Development" category.
2017-06-07 17:42:11 +02:00