Commit Graph

65 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 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
Julian Dolby bb0f38338e Merge branch 'warning-fixes-resource-management' of https://github.com/liblit/WALA 2017-03-13 10:44:38 -04:00
Ben Liblit b1678882b3 Plug numerous potential resource leaks
This fixes 33 out of 37 Eclipse "Potential resource leak: '...' may
not be closed" warnings.  It also fixes 3 out of 37 Eclipse "Resource
'...' should be managed by try-with-resource" warnings, although that
was not the main focus of this effort.

The remaining 4 warnings about potential resource leaks all involve a
leaked JarFile instance that is passed to a JarFileModule constructor
call.  JarFileModile never attempts to close its underlying JarFile;
this code is written as though JarFile cleanup were the caller's
responsibility.  However, the JarFile often cannot be closed by the
code that creates the JarFileModule either, since the JarFile needs to
remain open while the JarFileModule is in use, and some of these
JarFileModules stay around beyond the lifetime of the code that
created them.  Truly fixing this would essentially require making
JarFileModule implement Closeable, which in turn would probably
require that Module implement Closeable, which in turn would require
changes to lots of code that deals with Module instances to arrange
for them to be properly closed.  That's more invasive than I'm
prepared to take on right now.
2017-03-12 21:38:43 -05: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 e28b97b1ec fix null pointer exception handling tag 2016-03-28 12:56:36 -04:00
Julian Dolby 9267003c5b changes for language and solver work 2015-12-09 17:28:45 -05:00
Julian Dolby ab22d9abb0 enable specialization of source extractor for Web pages 2015-11-30 21:28:40 -05:00
Juergen Graf 6f8aee80c6 Merge branch 'wala' into master 2014-07-28 17:09:02 +02:00
Julian Dolby dd3124479e allow control flow in induced cfgs, and various related fixes 2014-07-08 14:44:06 -04:00
Julian Dolby dcfa05d922 ignore generated variables in hack for window state 2014-05-28 13:34:25 -04:00
Julian Dolby 50373e122d 1) handle files with byte order marks
2) ignore code in comment blocks
2014-05-28 13:33:49 -04:00
Juergen Graf 428a3975ed Merge branch 'wala' into master
Conflicts:
	com.ibm.wala.cast.java/src/com/ibm/wala/cast/java/loader/JavaSourceLoaderImpl.java
	com.ibm.wala.cast.java/src/com/ibm/wala/cast/java/ssa/AstJavaInstructionFactory.java
	com.ibm.wala.cast.java/src/com/ibm/wala/cast/java/ssa/AstJavaInvokeInstruction.java
	com.ibm.wala.cast.js.test/harness-src/com/ibm/wala/cast/js/test/TestSimpleCallGraphShape.java
	com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/html/WebPageLoaderFactory.java
	com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/loader/JavaScriptLoader.java
	com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/ssa/JSInstructionFactory.java
	com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/ssa/JavaScriptInvoke.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ipa/callgraph/AstCallGraph.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ir/ssa/AbstractLexicalInvoke.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ir/ssa/AstInstructionFactory.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ir/ssa/AstLexicalRead.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ir/ssa/AstLexicalWrite.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ir/ssa/FixedParametersInvokeInstruction.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ir/translator/AstTranslator.java
	com.ibm.wala.core/.classpath
	com.ibm.wala.core/.settings/org.eclipse.jdt.core.prefs
	com.ibm.wala.ide/src/com/ibm/wala/ide/util/ProgressMonitorDelegate.java
	com.ibm.wala.util/src/com/ibm/wala/util/NullProgressMonitor.java
	com.ibm.wala.util/src/com/ibm/wala/util/ProgressMaster.java
2014-05-20 17:59:16 +02:00
Julian Dolby 92bec0cc0b move to Reader API to help with annoying /r/n issues is source mapping 2014-04-29 11:21:01 -04:00
Julian Dolby 6bb598e6dc fix for annyoing \r\n newline issues in text from html files 2014-04-29 11:19:14 -04:00
Julian Dolby 05cf4e4f66 Merge branch 'master' of https://github.com/wala/WALA
Conflicts:
	com.ibm.wala.core/.classpath
2014-04-29 09:21:18 -04:00
Julian Dolby 99512c5cd0 uuse PrinterWriter; make DOM model optional 2014-04-11 10:00:05 -04:00
Julian Dolby 893f4b7308 type in CAst var decls 2014-03-16 18:05:49 -04:00
Julian Dolby e04ac682f3 final class 2014-02-08 22:51:22 -05:00
Julian Dolby 0964104dde use java functionality to handle urls 2014-02-08 22:50:59 -05:00
Julian Dolby 026f04cbfc get more error information from Rhino 2013-11-26 17:20:16 -05:00
Julian Dolby dd4d794517 merge 2013-09-18 14:00:04 -04:00
Julian Dolby 42714d9bf3 fixes for getting original source code for included locations 2013-09-18 13:55:17 -04:00
Manu Sridharan 898e1c3810 add modeling of window.onload invocation 2013-09-16 09:37:18 -07:00
Julian Dolby 0117b88698 reflect function statements into 'window' object. i have checked that
firefox does this.
2013-08-07 15:11:25 -04:00
Juergen Graf cdaaddf88b Merge branch 'wala' into master 2013-07-02 14:23:24 +02:00
Julian Dolby 080325b5f6 merge 2013-06-25 11:57:37 -04:00
Julian Dolby 3015d1c5f9 added container access to ModuleEntry 2013-06-25 11:53:58 -04:00
Manu Sridharan 3b1889121b add missing copyright headers 2013-05-22 15:39:19 -07:00
Manu Sridharan 4f7ec12edd Expose temporary file created by source extractor. Fixes #19 2013-04-10 12:22:57 -07:00
Manu Sridharan 11c6619c7f Variety of changes to JS front end.
- crash fixes
- small enhancements to prologue and preamble
- tighter handling of timeouts during CG construction
2013-04-09 15:47:22 -07:00
Juergen Graf 80920368ef incorporate changes from other branch
- remove extraneous printing
- fixes for parse errors in JS and HTML
- fixes for handling parse errors in JS and HTML
- update comments
- Change BitVectorRepository to use LinkedLists
- improve javadoc
- fix for for in contexts for NEVER case
- missing VectorKill println method
2013-03-12 00:21:26 +01:00
Juergen Graf b82d5dba90 Merge branch 'wala' into master 2012-11-06 04:23:10 +01:00
dolby f7a7d66b28 move loop unrolling code to wala from Miniatur/MemSAT 2012-10-03 10:53:04 -04: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
Juergen Graf 4648f0404a Merge branch 'wala' into master 2012-07-17 13:57:43 +02:00
dolby d0d1ff1a2b Merge branch 'master' of https://github.com/wala/WALA.git 2012-07-03 19:22:37 -04:00
dolby f7eb9bd174 apply changes for WALA git issue 3 2012-07-03 19:22:08 -04:00
Manu Sridharan 1a5f8954f2 fix NPE 2012-07-03 15:55:14 -07:00
dolby 4b3cba710d changes from upstream 2012-06-29 15:47:54 -04:00
Juergen Graf 10792bec73 Merge branch 'wala' into master 2012-05-16 14:02:20 +02:00
dolby b2034ed90f extensions to HTML file source position tracking 2012-05-08 14:03:43 -04:00
dolby dfe06b8ff3 changes to Web source mapping to exploit rhino 1.7R3 source offsets 2012-05-08 13:17:01 -04:00
Juergen Graf 7477b1730b Merge branch 'wala' into master 2012-03-19 13:33:48 +01:00
msridhar1 c0a99989a4 Support for applying a preprocessor to the generated CAst tree before
translating it to IR.

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4300 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-01-06 21:17:39 +00:00
msridhar1 05f0d27d45 move code related to validator.nu HTML parser to a separate project
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4296 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-01-05 19:58:35 +00:00
msridhar1 59e46916ce Generalize certain IR data structures to be less Java-specific. Generalize annotations code to allow for reading annotation parameters. Various other fixes
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4290 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-12-28 17:03:27 +00:00
Juergen Graf f5ac0c543f Merge branch 'wala' into master 2011-07-12 19:50:39 +00:00