Commit Graph

28 Commits

Author SHA1 Message Date
Erik Derr ee13713c4d Impl of IMethod.is(Wala)Synthetic and IClass.isSynthetic (#359)
* Impl of IMethod isSynthetic and isWalaSynthetic

So far IMethod.isSynthetic referred to WALA-generated helper functions
and there was no equivalent to check whether an IMethod is synthetic in
terms of compiler-generated.

To make naming consistent this patch first renames the isSynthetic to
isWalaSynthetic to clearly indicate that a given IMethod was generated
by WALA. Then, we re-introduce isSynthetic that from now on checks
whether an IMethod is synthetic/compiler-generated (referring to the
synthetic flag in bytecode)

* Implementation of IClass.isSynthetic

Complementary to IMethod.isSynthetic, this method checks whether
an IClass is compiler-generated.

* updated JavaDoc
2018-10-02 22:28:21 -07:00
Ben Liblit 0286c2b048 Use Iterator2Iterable helper to convert more loops to for-each 2017-12-04 14:04:39 -08:00
Ben Liblit 544a71ae72 Remove type arguments that Java 1.7+ can infer for us 2017-12-04 14:04:39 -08: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 8ef6ad5069 Add proper type parameters to nearly all uses of Iterator
Java sources used as test data have been excluded.
2017-11-28 14:09:30 -06:00
Ben Liblit ba84b5a403 Fix warning about unchecked cast to generic by being less specific
Casting to `Foo<Bar>` results in an unchecked-cast warning due to Java
generics type erasure.  However, sometimes we don't really need a
`Foo<Bar>`, but could simply use any `Foo<?>`.  Casting to the latter
creates no warning.
2017-08-15 09:16:59 -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 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
Ben Liblit ed0ddd780f Correct HTML embedded in Javadoc comments
Most of the invalid HTML arose from bare "<" and ">" characters.
These should be escaped as "&lt;" and "&gt;" when not intended to
introduce HTML tags.  When you have many such characters close
together, "{@literal ...}" is a nice, readable alternative that
automatically escapes its contents.  If the text in question is
intended to be a code fragment, then "{@code ...}"  is appropriate:
this is essentially equivalent to "<code>{@literal ...}</code>".

There were a few other HTML violations too, but none common enough to
be worth detailing here.
2016-11-28 11:14:41 -06: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
msridhar1 857e456806 organize imports
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4081 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-04-03 04:08:05 +00:00
dolby-oss 00871016cb adapt to checkcast change
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3817 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2010-04-28 19:33:34 +00:00
sjfink 933043fccf deprecate SyntheticMethod.getStatements(options)
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3717 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-07-02 19:19:25 +00:00
sjfink 7bb0b09935 refactoring: move IBytecodeMethod to the classloader package
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3664 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-06-12 14:47:30 +00:00
sjfink 2bf8eab491 tweak comments
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3494 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-04-21 19:31:33 +00:00
dolby-oss e80dc6ef8c refactor handling of constants in Shrike to abstract away from Java bytecode
introduce factories to create SSAInstruction objects


git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3433 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-04-10 18:33:07 +00:00
msridhar1 2b210ddb54 added ability to scan for array writes
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3063 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-10-22 15:37:15 +00:00
sjfink 2b1cffddfd IllegalArgumentExceptions and minor refactoring
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1634 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-08-20 14:49:39 +00:00
sjfink c2a17a5fbc IllegalArgumentExceptions and minor cleanups
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1632 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-08-20 13:38:41 +00:00
sjfink 7f5f313f0c more checks for IllegalArgumentExceptions
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1630 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-08-17 21:37:41 +00:00
sjfink 9c58d8e2a8 change some Iterators in API to Collections
remove some unnecessary WarningSet parameters

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1208 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-05-31 02:38:49 +00:00
sjfink fdb7a17af3 add @Overrides annotations and nuke unnecessary casts
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1197 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-05-30 15:16:05 +00:00
sjfink b0598a95f4 more argument checking
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1133 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-05-15 19:35:57 +00:00
sjfink 4acf542744 validate some arguments; throw IllegalArgumentExceptions
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1119 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-05-15 03:15:05 +00:00
sjfink ed509d5910 throw IllegalArgumentExceptions
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1098 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-05-08 21:49:58 +00:00
sjfink 979451f05c rename Shrike*Wrapper to just Shrike*
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@551 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-01-10 20:49:24 +00:00
sjfink 01e9a15d8b more generics
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@497 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2006-11-27 04:51:06 +00:00
sjfink df97f42b7e attempt to introduce tags and trunk
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@490 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2006-11-22 17:38:46 +00:00