Commit Graph

695 Commits

Author SHA1 Message Date
Ben Liblit df2e39b0fc Add Gradle logic for building a native library
This approach uses no external makefiles; it's pure Gradle.  Nice!
2018-04-17 15:02:35 -05:00
Ben Liblit aae1c2230a Consistently use simple sorted order for dependencies
This isn't even sorting by library or subproject name.  It's just a
dumb textual sort of the contents of each line.
2018-04-17 15:02:35 -05:00
Ben Liblit 695cd2863c Properly distinguish main from test code, now that I know how 2018-04-17 15:02:35 -05:00
Ben Liblit 401fbaf89a Many improvements to Gradle build support, including within Eclipse 2018-04-17 15:02:35 -05:00
Sungho Lee 6dceb3d8ef Change build.gradle files for proper format and delete all tests 2018-04-17 15:00:03 -05:00
Sungho Lee 04923544f0 Gradle build scripts 2018-04-17 15:00:03 -05:00
Ben Liblit 4bb4a3104a WALA uses Git, so CVS ignore patterns are moot 2018-04-14 19:08:14 -05:00
Julian Dolby 436d3165f7 rename getNumberOfParameters to getNumberOfPositionalParameters since the Python front end now supports keyword parameters
support variable names in IR for synthetic summaries
2018-04-12 19:09:25 -04:00
Julian Dolby e1def2ffb5 more generalization for reuse 2018-02-17 22:08:09 +01:00
Julian Dolby 6c1d0d9cb6 more work for reuse
make synthetic code better support non-Java languages
2018-02-14 09:00:07 -05:00
Julian Dolby c8cdaf8616 further refactoring to enable more reuse
eliminate all non-jva 8 compilation
2018-02-05 15:18:37 -08:00
Julian Dolby b7d9d037a6 more refactoring for reuse 2018-01-30 14:08:25 -05:00
Julian Dolby cd944a8f12 refactoring of CAst front end machinery to allow more reuse 2018-01-25 14:42:27 -05:00
Julian Dolby 742b42efdf native config cleanup 2018-01-20 17:40:10 +00:00
Ben Liblit 372f0bd5d8 Fix several broken cross-references in Javadoc comments 2018-01-17 10:35:49 -08:00
Ben Liblit 0d6d9f2b2e Remove useless "@return" tags with no descriptive text 2017-12-19 16:53:56 -06:00
Ben Liblit 0286c2b048 Use Iterator2Iterable helper to convert more loops to for-each 2017-12-04 14:04:39 -08:00
Ben Liblit b25e461bfe Convert a few more loops into modern for-each loops 2017-12-04 14:04:39 -08:00
Ben Liblit 9c83e87cc1 Merge branch 'master' into modernization-java-8-lambdas-and-method-references 2017-11-29 10:51:33 -06:00
Ben Liblit ebfd885d22 Use modern for-each loops where possible
Java sources used as test data have been excluded from this mass
clean-up.
2017-11-28 14:44:53 -06:00
Ben Liblit 74e0640771 Replace simple lambdas with method references wherever possible 2017-11-27 11:31:15 -06:00
Ben Liblit 790d37781b Convert many single-method anonymous classes to lambdas
Eclipse's automated code clean-up tool did most of the heavy lifting
here: it specifically has a clean-up option for converting functional
interfaces to lambdas.  I merely had to revert the automated changes
for a single enumeration class for which it produced invalid results,
and for a few test inputs that apparently aren't set up to be compiled
with Java 8.
2017-11-27 11:31:15 -06:00
Ben Liblit 28f0e09435 Make FilterIterator and Predicate statically type-correct
Previously FilterIterator was very permissive regarding the type
relationships between the original iterator, the filtered iterator,
and the predicate used to prune the former down to the latter.  Now we
enforce those relationships more strictly, including proper use of
covariant ("<? extends T>") and contravariant ("<? super T>")
polymorphic type parameters where appropriate.

This lets us get rid of seven suppressed warnings about generic types
and/or unchecked conversions.  It also moves us toward being able to
use modern Java features like lambdas and streams more easily.
2017-11-27 11:31:14 -06:00
Ben Liblit 9ef6ff1a9c Remove "build.xml" files not used by corresponding "pom.xml" files 2017-11-26 18:11:56 -06:00
Ben Liblit ded9e880b1 Update Maven Central configurations to also use Java 8 (#264)
E-mail exchanged with Julian Dolby suggests that this is the right
thing to do, and that it should have been done back when we converted
other parts of the build configuration to Java 8.
2017-11-23 12:55:05 -08:00
Julian Dolby d124256835 remove java 7 support 2017-11-11 21:20:41 -05:00
Julian Dolby 8d65788aef convert to Java 8 Function and Predicate 2017-11-11 20:29:04 -05:00
Julian Dolby b38286621a remove unneeded type parameter 2017-10-19 13:08:34 -04:00
Julian Dolby 207181aa89 linking issues on Linux. It seems that the name 'launch' for a function was causing some weird linking issues that only happened sometimes. Quite ikely, the issue is another library using the same name. 2017-10-18 01:49:25 +00:00
Julian Dolby 601c9fae7b clean up native init 2017-10-17 20:25:46 -04:00
Julian Dolby 02e2193875 clean up native init 2017-10-17 20:14:35 -04:00
Julian Dolby b504165e64 clean up native init 2017-10-17 20:12:42 -04:00
Julian Dolby 3ee1f2d368 Merge branch 'master' of https://github.com/wala/WALA 2017-09-16 18:25:35 +00:00
Julian Dolby 3c898224ff Revert changes to native code for now
This reverts commit a39da55d97.
2017-09-16 14:23:00 -04:00
Julian Dolby e399d7b9f3 Merge branch 'master' of https://github.com/wala/WALA 2017-09-16 18:19:07 +00:00
Julian Dolby 5a04c422e3 merge 2017-09-16 18:19:04 +00:00
Julian Dolby a39da55d97 need shrike
update monitor test
2017-09-16 14:06:28 -04:00
Ben Liblit 559c577093 Treat diagnostics about unchecked type operations as errors 2017-08-28 11:55:56 -07:00
Julian Dolby ee8e4b4c83 type hack 2017-08-25 12:06:09 -04:00
Julian Dolby b5b67f3d7c issues with mvncentral.xml 2017-08-25 12:00:39 -04:00
Julian Dolby 44348b80d7 add neglected file 2017-08-25 11:13:40 -04:00
Julian Dolby 701cd1ac7d fix for paths on travis 2017-08-25 11:04:43 -04:00
Julian Dolby b6af5267f1 java 8 changes
minor fixes, such as making CheckForFrontEndErrors more accessible
minor hacks to make stuff compile with TeaVM
2017-08-25 10:58:00 -04:00
Julian Dolby e599d58cd7 Merge branch 'master' of https://github.com/wala/WALA 2017-08-16 14:50:12 -04:00
Julian Dolby 3371e23de0 java 8 stuff 2017-08-16 14:50:01 -04:00
Ben Liblit b70d69d62f Treat many Eclipse plugin-related problems as errors
These are all problems that Eclipse can detect, but that it detects no
instances of right now.  Treating these as warnings instead of errors
should help prevent us from slipping backward in the future.
2017-08-16 11:36:46 -07:00
Julian Dolby a92b881c22 Merge branch 'master' of https://github.com/wala/WALA 2017-08-15 12:39:27 -04:00
Julian Dolby 6431cbeb60 java 8 2017-08-15 12:39:19 -04:00
Ben Liblit bb6be21e2d Fix remaining "unlikely argument type" warnings from Eclipse Oxygen
Each of these required careful consideration of what the original
developer *intended* as distinguished from what the developer's code
actually *does*.  I believe I got each one right, and WALA's
regression tests agree.  A second opinion by a core WALA developer
would be welcome, though.
2017-08-15 09:16:14 -07:00
Julian Dolby 15f54f0248 Merge branch 'master' of https://github.com/wala/WALA 2017-08-06 10:30:32 -04:00
Manu Sridharan e8bdf2f8f9 version 1.4.4-SNAPSHOT 2017-08-06 07:25:20 -07:00
Julian Dolby 69929b4985 Merge branch 'master' of https://github.com/wala/WALA 2017-08-06 08:06:02 -04:00
Manu Sridharan d901b13425 version 1.4.3 2017-08-05 20:52:32 -07:00
Julian Dolby b9b498bd17 Merge branch 'master' of https://github.com/wala/WALA 2017-08-05 21:10:28 -04:00
Ben Liblit d6ce679a72 Add static private serialVersionUID fields to Serializable classes
We already have plenty of examples of Serializable classes with this
field, and the vast majority of those fields have generated IDs rather
than "1L".  From this I infer that using proper serialVersionUID
fields is considered appropriate WALA coding style.
2017-08-05 13:30:35 -07:00
Ben Liblit 321b28f149 Remove some unnecessary warning suppressions
One such annotation was unnecessary because the thing it was
suppressing no longer happens.  Any future unnecessary warning
suppressions of this kind will now be treated as errors.

The other annotations were unnecessary because the corresponding
warnings have been disabled entirely in the Eclipse projects'
configurations.  There seems to be no way to tell Eclipse to treat
these as anything other than "info" diagnostics in the future, so
that's how they will remain.
2017-08-05 13:29:50 -07:00
Julian Dolby 1d144db6d5 Merge branch 'master' of https://github.com/wala/WALA 2017-08-02 12:27:22 -04:00
Ben Liblit f7dc0a06de Treat unused parameters as errors, not merely warnings
We've fixed or suppressed all such warnings, except in projects
containing test inputs.  Let's make sure no more appear in the future.
2017-07-31 15:29:00 -07:00
Ben Liblit 6087b73cee Fix or suppress all 242 Eclipse warnings about unused parameters
In general, my approach was to try to eliminate each unused parameter
using Eclipse's "Change Method Signature" refactoring.  That did not
always succeed: a parameter may be unused in some base class method,
but then be used in subclass's override of that method.  In cases
where refactoring to eliminate a parameter failed, I instead annotated
the parameter with '@SuppressWarnings("unused")' to silence the
warning.

Note: this group of changes creates a significant risk of
incompatibility for third-party WALA code.  Some removed parameters
change externally-visible APIs.  Furthermore, these changes do not
necessarily lead to Java compilation errors.  For example, suppose
third-party code subclasses a WALA class or interface, overrides a
method, but does not annotate that method as @Override.  Removing a
parameter means that the third-party method no longer overrides.  This
can quietly change code behavior without compile-time errors or
warnings.  This is exactly why one should use @Override wherever
possible, but we cannot guarantee that third-party WALA users have
done that.
2017-07-31 15:29:00 -07:00
Julian Dolby f5aaa67598 merge 2017-07-30 18:08:06 -04:00
Julian Dolby 76435cfa92 prune dependencies 2017-07-29 01:17:52 +00:00
Julian Dolby 9dda017450 Merge branch 'master' of https://github.com/wala/WALA 2017-07-28 13:42:45 -04:00
Ben Liblit 191904d607 Remove "throws XYZ" declarations where XYZ cannot be thrown
Unnecessary "throws" declarations tend to cascade.  If foo() calls
bar() and bar() falsely declares that it might throw IOException, that
often leads a programmer to declare that foo() might throw IOException
as well.  Fixing the bar() throws declaration then reveals that we can
fix the foo() throws declaration too.  By the time we reach a fixed
point with cleaning these up, we have removed roughly 320 unnecessary
throws declarations.

In a few cases, this cleanup even lets us remove entire "try
... catch" statements where the only thing being caught was an
exception that we now statically know cannot be thrown.  Nice!

In Eclipse project configurations, upgrade any future such shenanigans
from warnings to errors.  Now that we've fixed this, we don't want it
coming back again.

There is a potential drawback to this change.  Conceivably some public
WALA API entry point might have declared that it could throw some
exception merely to reserve the *option* of throwing that exception in
third-party code that subclasses and overrides the API entry point in
question.  I have no idea whether this is a significant concern in
practice, though.
2017-07-28 10:20:28 -07:00
Julian Dolby 27e906135f Merge branch 'master' of https://github.com/wala/WALA 2017-07-24 10:08:10 -04:00
Ben Liblit 10dff7fb1c Disable Eclipse warnings about assignments to parameters
Previously we had 227 such warnings.  That large number suggests that
the WALA developers consider this to be an acceptable coding style.
If that's so, then it's better to hide these warnings rather than keep
them around as a perpetual distraction.
2017-07-18 20:43:36 -07:00
Ben Liblit d3c4200bc3 Disable Eclipse warnings about name shadowing
Previously we had 242 such warnings.  That large number suggests that
the WALA developers consider this to be an acceptable coding style.
If that's so, then it's better to hide these warnings rather than keep
them around as a perpetual distraction.
2017-07-18 20:43:36 -07:00
Julian Dolby ecf05f6bd8 Merge pull request #203 from liblit/fix-native-build-Makefile-configuration-churn
Fix native build `Makefile.configuration` churn
2017-07-15 21:10:00 -04:00
Julian Dolby 12e736b36f Merge branch 'master' of https://github.com/wala/WALA 2017-07-15 14:01:51 -04:00
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 2f44bbf518 Help Emacs recognize that these are (fragments of) makefiles 2017-07-14 21:46:46 -07:00
Ben Liblit fae3ff6789 Set Emacs indentation configuration to mimic existing code
This isn't fix per se, but adding this configuration info helps me
edit this file in Emacs without introducing unnecessary indentation
changes.
2017-07-14 21:46:29 -07:00
Ben Liblit a1ef133501 Fail early if any subcommand fails or if an udefined var is used
I like my shell scripts to be paranoid.
2017-07-14 21:45:51 -07:00
Ben Liblit 433cd78f65 Move logic from "cbuild.sh" into portable "Makefile.configuration"
In "com.ibm.wala.cast.test", the "cbuild.sh" script is gone entirely.
Instead, "pom.xml" directs Maven to run "make" directly.  We still
have a "Makefile.configuration" file in this project, but this file is
now independent of where WALA is being built and of where Java is
installed.

In "com.ibm.wala.cast", a small "cbuild.sh" remains, to do some
special processing involving Visual Studio variables under Windows.
When not building under Windows, "cbuild.sh" now simply runs "make".
It may well be possible to hoist the special Windows stuff up into
this subproject's "pom.xml", or to change that "pom.xml" to run
"cbuild.sh" only when on Windows, and to run "make" directly
otherwise.  I don't know "pom.xml" stuff very well, though.  We still
have a "Makefile.configuration" file in this project, but this file is
now independent of where WALA is being built and of where Java is
installed.

The changes I've made in both "Makefile.configuration" files use GNU
make extensions.  I assume that's safe because "Makefile.definitions"
already relies on GNU make.
2017-07-14 21:44:33 -07:00
Julian Dolby 0aadaa7aa0 small extensions to native code 2017-07-13 21:20:48 +00:00
Julian Dolby 004a81deba Merge branch 'master' of https://github.com/wala/WALA 2017-07-13 13:02:29 -04:00
Ben Liblit 0e6b00e29f Revert accidental, harmless, but unnecessary make config changes 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
Julian Dolby 289efc3bb8 Merge branch 'master' of https://github.com/wala/WALA 2017-07-12 08:08:34 -04:00
Julian Dolby a910795e05 merge 2017-07-09 05:58:20 -04: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
Julian Dolby 773fa68a3f made native test run on a linux vm 2017-06-29 09:07:29 +00:00
Julian Dolby 5f0a7180d0 merge 2017-06-28 18:37:03 -04:00
Julian Dolby facb4d7e35 merge 2017-06-28 18:28:19 -04:00
Julian Dolby 6a6bf888e8 try some static linking 2017-06-28 17:30:55 -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 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 7c476eac3d native interface for WALA 2017-06-28 12:42:49 -04:00
Julian Dolby 7ea9bca169 Merge branch 'master' of https://github.com/wala/WALA 2017-06-26 15:05:29 -04: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