Commit Graph

59 Commits

Author SHA1 Message Date
Ben Liblit 5336a08af2 Avoid using deprecated boxing constructors
Boxing a primitive using the constructor ("new Integer(4)") always
creates a distinct new boxed instance.  That's rarely what you need,
and in fact all of those constructors have been deprecated in Java 9.
Using the static "valueOf" method instead ("Integer.valueOf(4)") can
give better performance by reusing existing instances.  You no longer
get a unique boxed object, but generally that's OK.
2018-06-05 14:44:59 -05:00
Ben Liblit 0286c2b048 Use Iterator2Iterable helper to convert more loops to for-each 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
Julian Dolby 8d65788aef convert to Java 8 Function and Predicate 2017-11-11 20:29:04 -05: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 72c754e874 Declare private methods static wherever possible
If a method is private, there's no risk that a subclass elsewhere
might be overriding it and depending on dynamic dispatch to choose the
right implementation.  So all of these private methods can safely be
declared static without risk of regression in either WALA code or
unseen third-party code.
2017-06-07 08:29:23 -07:00
Ben Liblit 994a70500f Remove redundant generic type parameters where possible
Instead, rely on Java's ability to infer type parameters in many
contexts.  This removes 665 Eclipse warnings.

Note: a few of these changes are to files under "test" subdirectories.
Presumably those are files that serve as test inputs rather than being
part of WALA code proper.  As far as I can tell, these changes do not
break any WALA tests.  But if any of those tests were specifically
intended to exercise WALA on code with non-inferred generic type
parameters, then I really should be leaving those alone.
2017-03-11 21:20:51 -06:00
Julian Dolby d24519e974 cross-cutting changes to make more of WALA runnable with TeaVM. The biggest change is refactoring to AnalysisCache and friends; since TeaVM does not support SoftReference, I needed to add a layer of interfaces so that I can use a more simpleminded caching implementation for TeaVM. There are other changes to Module and friends to break connections with File and URL, which also cause TeaVM grief. I also organized imports in many places to remove unused types that caused trouble. 2017-02-02 20:33:27 -05:00
Julian Dolby 15c8d711db changes for working with TeaVM and compilation to JavaScript 2017-01-03 20:58:16 -05:00
Julian Dolby 58b7c7324c test for reading java 8 2015-06-04 13:53:25 -04:00
Cosmin Radoi 853b5fc37a replace Filter with Predicate 2014-11-25 13:23:47 -06:00
Julian Dolby a1bc84356d scandriod merge 2014-10-01 21:32:36 -04:00
Michael Heilmann 0bb5e6998e Remove redundant casts and imports, improve doc comments 2014-06-26 17:51:26 +02:00
Julian Dolby 3e55f0b370 new graph implementation for incremental graph extension 2014-05-20 13:11:19 +02:00
ksrinivs bcc0d23c54 minor fixes 2013-12-03 16:01:28 -05:00
ksrinivs 639c876fe5 partial coloring 2013-12-02 14:42:51 -05:00
ksrinivs 3d91075842 partial coloring 2013-12-02 14:37:28 -05:00
Julian Dolby 7948f3b9ae merge 2013-11-26 16:25:43 -05:00
ksrinivs c1a923d0ba allow partial coloring 2013-11-26 15:04:09 -05:00
Julian Dolby dedbc2d443 coloring now requires numbered graphs. a performance hack. 2013-11-21 14:27:27 -05:00
Julian Dolby 080325b5f6 merge 2013-06-25 11:57:37 -04:00
Manu Sridharan 3b1889121b add missing copyright headers 2013-05-22 15:39:19 -07:00
Manu Sridharan 256cd06460 Convert all Java source files to use Unix line endings; no semantic change 2012-09-04 15:56:05 -07:00
dolby-oss 7a6af352b9 moved IR-independent visualization of graphs to util project
added DFS path find that finds all paths in sequence rather than just one
moved the WalaException out of warnings subpackage

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4257 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-08-16 16:51:11 +00:00
dolby-oss 15c202f8e6 Welsh-Powell graph coloring
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4180 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-06-01 21:47:15 +00:00
sjfink fa825de846 refactoring of fixpoint API
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4033 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-01-17 21:43:18 +00:00
dolby-oss d4ee31ad9e added clear() method to mutable int sets
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3981 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2010-10-15 02:10:44 +00:00
dolby-oss 502db2afb9 make some stuff static
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3977 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2010-10-11 14:35:08 +00:00
dolby-oss 48ff32f2e3 copyright comment update
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3975 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2010-10-11 14:29:47 +00:00
dolby-oss ed889de199 added Floyd-Warshall all pairs shortest path implementation
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3964 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2010-10-04 17:27:56 +00:00
msridhar1 93a4571961 undo WalaTestCase extending TestCase; dependent projects will have to be switched to JUnit 4. Also, more optimizations.
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3742 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-07-27 22:43:06 +00:00
msridhar1 02e7bf2894 switch to jUnit 4
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3739 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-07-27 20:38:48 +00:00
sjfink 4a80ac1984 tweak comments
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3726 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-07-13 18:01:00 +00:00
sjfink a0efbee8ff Major refactoring to introduce com.ibm.wala.ide. Many related changes and patches from Marcelo Paternostro.
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3693 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-06-22 15:06:12 +00:00
msridhar1 e08ed2663f Deprecate Iterator2Collection.toCollection(); use toSet() or toList() instead.
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3421 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-04-09 15:24:42 +00:00
sjfink 8fe9467be8 remove references to Trace
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2830 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-05-22 19:17:23 +00:00
sjfink c10084093a initial check-in
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2763 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-04-22 12:15:03 +00:00
sjfink d6c5b3bb55 thread IProgressMonitor and CancelException through many APIs
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2578 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-02-13 22:34:50 +00:00
sjfink 444d3a92b0 more cleanup of util packages
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2463 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-01-24 22:54:05 +00:00
sjfink 4fa9dfb414 work around weird failure for DominatorsA on a Sun 1.6_03 JDK on Win32
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2430 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-01-22 16:59:10 +00:00
dolby-oss 22859a76b7 adapt to Dominators changes
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2055 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-11-19 00:42:59 +00:00
sjfink 5c175e7898 more EMF obliteration
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2037 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-11-16 19:41:32 +00:00
dolby-oss f79938a9b8 tests of long sets
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1976 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-10-30 18:42:26 +00:00
sjfink 564fd0d977 default factory for SlowSparseNumberedGraph
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1739 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-09-07 02:10:04 +00:00
sjfink d606af773b lots of new generics for fixed point solver hierarchy
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1695 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-08-31 21:38:35 +00:00
sjfink a6e4894120 use Hash factories everywhere
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1442 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-07-11 21:08:35 +00:00
sjfink 10492c7298 massive overhaul of Warnings management
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1379 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-07-06 22:07:24 +00:00