Commit Graph

149 Commits

Author SHA1 Message Date
Ben Liblit d70e52e323 Set required build property for project-specific compiler settings
This fixes two Eclipse Plug-in Development warnings of the form "The
'javacProjectSettings' build entry should be set when there are
project specific compiler settings".
2017-09-17 14:25:40 -07:00
Ben Liblit 182073ff4f Silently allow plug-ins to not export all of their packages
This removes three Eclipse Plug-in Development warnings of the form
"This plug-in does not export all of its packages"

I assume that omitting some exports is OK, because apparently nothing
else fails to build against these.  If an omitted export were needed
elsewhere, something would fail to build.
2017-09-17 14:25:40 -07:00
Julian Dolby 36ab38c659 expanded Monitor2 2017-09-16 14:24:47 -04: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 a39da55d97 need shrike
update monitor test
2017-09-16 14:06:28 -04:00
Ben Liblit 65672f98ba Suppress Eclipse warnings that arise in JLex, which we don't control 2017-08-30 17:03:35 -07:00
Ben Liblit 2d641251fb Enforce Eclipse resource leak diagnostics more strongly
In Eclipse projects that currently have no definite or potential
resource leaks, treat any such diagnostics as errors in the future.

In `com.ibm.wala.core`, enable warnings about definite or potential
resource leaks.  Previously these diagnostics were turned off entirely
in this project.  So we actually end up with more warnings now than we
had before, but they are all warnings we should eventually look into.
2017-08-27 11:03:14 -07: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 3371e23de0 java 8 stuff 2017-08-16 14:50:01 -04:00
Julian Dolby 4a33c527d2 Merge branch 'master' of https://github.com/wala/WALA 2017-08-15 18:01:41 -04:00
Ben Liblit d73b11fd8f Escalate switch-related diagnostics from warnings to errors
We have fixed all of these that Eclipse reports.  Treating them as
errors in the future should help us keep moving in the direction of
cleaner code.
2017-08-15 14:55:34 -07:00
Julian Dolby 6431cbeb60 java 8 2017-08-15 12:39:19 -04:00
Manu Sridharan e8bdf2f8f9 version 1.4.4-SNAPSHOT 2017-08-06 07:25:20 -07:00
Manu Sridharan d901b13425 version 1.4.3 2017-08-05 20:52:32 -07:00
Ben Liblit c1572ec3a5 Remove unnecessary warning-suppression annotations
These annotations used to suppress real Eclipse warnings.  However,
we've now turned those warnings off for the entire project.
2017-07-26 20:08:34 -07:00
Ben Liblit 455a4a2bd6 Disable or suppress various Eclipse warnings in test data
These are all things one might consider fixing in real application
data.  Java code used as test inputs, though, serves a different
purpose.  Weird code is generally acceptable or even intentional.
2017-07-26 20:08:34 -07:00
Ben Liblit ec0d7354ef Disable Eclipse warnings about empty statements
Previously we had 5 such warnings.  That's not very many, but it
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 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
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
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 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 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 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
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 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 9c81cae9be Externalize bundle names and vendors
This fixes 33 Eclipse "The value for attribute '...' is not
externalized.  The value must begin with %" warnings in the "Plug-in
Development" category.
2017-06-07 17:42:11 +02:00
Ben Liblit 8cc4daf6a0 Access static fields directly via the classes that declare them
Previously some of these were accessing such fields through a subclass
of the declaring class.  That creates an unnecessary extra inter-class
dependency lower in the type hierarchy than necessary.

Also, suppress this warning in an automated test input where the
indirect static accesses are explicitly intentional.
2017-06-07 08:29:23 -07:00
Ben Liblit 38c11f0fa6 Don't warn about intentional indirect access to static methods
This test code is intentionally crafted to use instances to access
static methods.  Eclipse's recommendation to access those methods
directly is, therefore, counterproductive.
2017-06-07 08:29:23 -07:00
Caius Brindescu 404a17c9cc When converting JDT AST to IR, a do-while loop in a case statement will throw NPE (#186)
* Fixed bug for source analysis

Do while in case statement would throw an NPE. Now it doesn't

* Added test case

The test will fail with an NPE if the fix is not applied.
2017-06-07 08:27:23 -07:00
Ben Liblit 24fb1f6d10 Suppress unused-local-variable warnings in test inputs
Test code can do many things we'd consider bad style in real
application code, including defining local variables that are never
subsequently used.
2017-05-26 14:25:03 -07:00
Manu Sridharan c9022b0743 update version to 1.4.3-SNAPSHOT 2017-04-19 09:19:09 -07:00
Manu Sridharan 44e433085e tag 1.4.2 release 2017-04-19 09:17:13 -07:00
Manu Sridharan c1b33fcab0 Merge pull request #162 from liblit/warning-fixes-type-safety-and-raw-types
Fix or disable Eclipse warnings about type safety and raw types
2017-04-06 16:19:11 -07:00
Ben Liblit 35aef3b383 Disable Eclipse unchecked-type-operation warnings in some test code
Often the easiest way to create a desired test scenario is to write
code that would make no sense in a complete, realistic application.
So we generally want to let test code do oddball things.
2017-03-28 20:01:31 -05:00
Ben Liblit 91b9c9e28b Suppress/disable some Eclipse unnecessary-code warnings in test code
Often the easiest way to create a desired test scenario is to write
code that would make no sense in a complete, realistic application.
So we generally want to let test code do oddball things.
2017-03-28 19:25:08 -05:00
Ben Liblit 65be11f222 Merge branch 'master' into warning-fixes-unnecessary-code-controversial 2017-03-25 22:12:03 -05:00
Manu Sridharan ab7e638c29 version 1.4.2-SNAPSHOT 2017-03-25 13:54:21 -07:00
Manu Sridharan 2d0518963d Tag release 1.4.1 2017-03-25 13:24:39 -07:00
Manu Sridharan b82e808b32 Merge pull request #156 from liblit/warning-fixes-unnecessary-code-uncontroversial
Fix 265 Eclipse warnings about unnecessary code
2017-03-23 17:48:10 -07:00
Ben Liblit 1bb3d827c4 Turn off Eclipse warnings about unused caught-exception parameters
Manu requested that we use this approach instead of adding
`@SuppressWarnings("unused")` at each affected catch block.  That
seems reasonable to me, given the large number of such warnings and
the lack of likely harm from ignoring such caught exceptions.
2017-03-23 16:39:58 -05:00
Ben Liblit 16492c7b78 Revert "Suppress 157 Eclipse warnings about unused exception parameters"
This reverts commit fe9f7a793a.
2017-03-23 16:32:00 -05:00
Ben Liblit 323224504a Suppress several unfixable warnings about unresolved type references
Fixing these Javadoc comments would require adding packages to various
other packages' build paths.  In some of the cases suppressed,
changing build paths in that manner would create circular build
dependencies.  In other cases, it would simply add a Javadoc-motivated
dependency that does not exist for the real code, which seems
undesirable.  For a few cases, the reference seems to be to types in
code we don't even have here, such as code from "android" or
"org.mozilla" packages.
2017-03-22 20:40:52 -05:00
Manu Sridharan 9b692e714f switch version to 1.4.1-SNAPSHOT 2017-03-21 09:38:36 -07:00
Manu Sridharan bfe378e7f2 1.4.0 release 2017-03-21 08:59:08 -07:00
Ben Liblit 059810c1ca Fix 9 Eclipse warnings about unused methods
Note: some of these methods are decidedly nontrivial.  Perhaps they
should not actually be removed?  If any should be kept around, please
identify them to me.  I'll revise this change to retain those methods
and simply annotate them as needed to suppress Eclipse's warning.
2017-03-20 00:44:36 -05:00
Ben Liblit fe9f7a793a Suppress 157 Eclipse warnings about unused exception parameters
In the cases addressed here, the caught exception is truly not needed
by the handling code.
2017-03-20 00:44:06 -05:00
Ben Liblit fde65340d2 Fix 132 Eclipse warnings about using raw generic types 2017-03-15 11:08:20 -05:00
Julian Dolby 5c6cf9724a Merge branch 'warning-fixes-java-versions' of https://github.com/liblit/WALA 2017-03-11 13:46:06 -05: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 522c382a19 Use consistent Java versions, usually 1.7
Previously, the various Eclipse projects' Java configurations used
mixtures of 1.6, 1.7, and 1.8.  Many were internally inconsistent,
such as requiring 1.7 in "MANIFEST.MF" but 1.6 in the Eclipse JDT
build preferences.  The Travis-CI configuration tests against both 1.7
and 1.8, but does not test against 1.6.

Across all projects, the most common version was 1.7.  So I'm going to
assume that 1.7 is the intended build target.  This commit makes 1.7
the selected version nearly everywhere.

"com.ibm.wala.core.testdata" is the one exception.  This specific
project uses a few features only found in 1.8, such as lambda
expressions.  Previously, "com.ibm.wala.core.testdata" used 1.7 in
some aspects of its configuration but 1.8 in others.  Now it
consistently targets 1.8.  I wish this one project didn't need to be
inconsistent with the rest of WALA, but at least now it's consistent
with itself.

(Personally, I'd be happy to target 1.8 only.  But my impression
across all of these configuration files is that the WALA developers
still want to be compatible with 1.7.  If that is no longer a
requirement, let me know and I will adjust these changes accordingly
to target 1.8 only.)

This change eliminates 11 "There is no 'jre.compilation.profile' build
entry and the project has Java compliance preferences set" warnings
and 13 "The JRE container on the classpath is not a perfect match to
the 'JavaSE-1.7' execution environment" warnings.  However, it also
adds 450 "Redundant specification of type arguments <...>" warnings
and 17 "Resource '...' should be managed by try-with-resource"
warnings.  So this seems like a net step backward in my wish to reduce
WALA warnings.  However, those new warnings concern Java 1.7 language
features that we were not previously using to good effect in projects
that targeted 1.6.  If we all agree that we can now target 1.7
instead, then we can use these helpful features as the newly-added
warnings suggest.  So I call that a step in the right direction.
2016-11-29 21:29:30 -06:00
Ben Liblit 18b79bf0f9 Merge branch 'master' into warning-fixes-xml-validation 2016-11-29 10:08:00 -06:00
Ben Liblit 391210bf2d Exclude Maven-generated Ant build scripts from XML validation
When Maven generates these "*/target/antrun/build-main.xml" Any build
scripts, it does not include any DTD or XML Schema declarations.
Eclipse's XML validator warns about the lack of grammar constraints.
The warning is sensible, but we are not in a position to do anything
about it.  Better, therefore, to suppress these warnings so that we
can more-clearly see warnings we *can* address.
2016-11-28 14:57:26 -06:00
Ben Liblit 3b1547f0a7 Exclude Maven-generated (?) files from XML validation
I think the "target/p2artifacts.xml" and "target/p2content.xml" files
are generated by Maven.  They are well-formed XML but Eclipse's XML
validator legitimately warns that they lack grammar constraints.
Since we're not maintaining the tool that creates these files, we are
not in a position to do anything about that.  Therefore, we may as
well exclude these from validation entirely.  That way we can
more-clearly recognize warnings that we *can* do something about.
2016-11-28 14:55:25 -06:00
Ben Liblit 80e8ea3c4e Add stub DOCTYPE declarations for Ant build scripts
Ant "build.xml" files don't have a standard DTD or XML Schema; the
contents are simply too flexible for that.  But we can at least
give each a stub DOCTYPE declaration.  That's enough to satisfy
Eclipse's XML validator, which otherwise complains that these files
lack grammar constraints.
2016-11-28 12:50:56 -06:00
Ben Liblit 2a5503b9aa Exclude Maven-generated HTML pages from validation
Eclipse validation warns about invalid HTML content in all
Maven-generated "target/site/dependency-convergence.html" files.  The
warnings are legitimate: these HTML files are indeed invalid.
However, we don't maintain the tool that generates these files, so we
are not in a position to fix them.  Better, therefore, to suppress
these warnings so that we can notice and fix other problems over which
we do have control.
2016-11-27 21:24:03 -06:00
Manu Sridharan cd560b3b2b switch version to 1.3.10-SNAPSHOT 2016-05-10 22:53:28 +09:00
Manu Sridharan 158a5deeb0 Version 1.3.9 2016-05-10 21:59:26 +09:00
Manu Sridharan e46bb81081 Update version to 1.3.9-SNAPSHOT 2015-10-09 12:55:49 -07:00
Manu Sridharan ed5093d6db Properly update version to 1.3.8
Other changes were accidentally committed last time.
2015-10-09 11:06:03 -07:00
Manu Sridharan 077cabc4eb Revert "update version to 1.3.8"
This reverts commit 4aac703ee5.
2015-10-09 11:03:46 -07:00
Manu Sridharan 4aac703ee5 update version to 1.3.8 2015-10-09 10:45:57 -07:00
Julian Dolby a6a060ed25 changes for handling of 'callbacks' in dynamic CGs 2015-06-28 17:06:21 -04:00
Julian Dolby 90a98521a1 whitespace 2015-06-04 17:50:24 -04:00
Manu Sridharan 052023581d update version to 1.3.8-SNAPSHOT 2015-05-31 13:53:07 -07:00
Manu Sridharan f2f65bfbc5 oops, version should be 1.3.7 2015-05-29 13:20:25 -07:00
Manu Sridharan 894f010ff9 version 1.3.8 2015-05-29 12:20:53 -07:00
Manu Sridharan 7ad8700064 update version numbers to 1.3.7-SNAPSHOT everywhere 2015-05-28 10:37:01 -07:00
Julian Dolby 43c37d6d0e fixes to regression tests:
now, for me, code works using e44 with maven
  dalvik tests refactored for mobile version with android dev tools
  IDE tests Eclipse metadata fixed to make e44 work for me
  new android entrypoint to fix failure in new droidbench tests
2015-03-24 21:51:35 -04:00
Julian Dolby a1bc84356d scandriod merge 2014-10-01 21:32:36 -04:00
Julian Dolby 080325b5f6 merge 2013-06-25 11:57:37 -04:00
Manu Sridharan 5926048e88 add bin directory if it doesn't exist 2013-05-28 09:34:42 -07:00
Manu Sridharan 06361377e3 progress on getting polyglot tests to run under maven 2013-05-27 16:34:06 -07:00
Manu Sridharan 3b1889121b add missing copyright headers 2013-05-22 15:39:19 -07:00
Manu Sridharan e6bef253ff Merge branch 'master' into maven 2013-05-02 10:58:55 -07:00
Manu Sridharan 8a3f86bad7 Merge branch 'master' into java-local-vals-for-lex 2013-04-30 11:51:33 -07:00
Manu Sridharan a9719a948d change default target to jar 2013-04-30 09:31:35 -07:00
Manu Sridharan 516d1522b9 indentation 2013-04-29 20:33:18 -07:00
Marcel Bruch 7c2d18cd58 [releng] added preliminary maven tycho build support 2013-04-29 13:13:22 +02:00
Manu Sridharan 00eb1d2bd2 Set all projects to build against Java 6; no semantic change. Fixes #20 2013-04-10 16:01:27 -07:00
Julian Dolby 321e925660 work on CHA 2013-04-03 12:12:43 -04:00
Julian Dolby 87b856928c fixes for handling parse errors in JS and HTML 2013-03-01 10:07:20 -05:00
Julian Dolby afccdd2189 Annotation support 2013-02-02 21:27:45 -05:00
Manu Sridharan 60db861a5f complete conversion to Unix line endings 2012-09-04 16:05:49 -07:00
dolby 319eacc529 merge changes and changes for atomic sets work 2012-08-29 16:35:34 -04:00
dolby 81c16d8121 ignore junk 2012-07-02 13:59:50 -04:00
dolby 803f664b15 automate building of test project for JDT wala tests 2012-04-17 12:51:43 -04:00
dolby-oss 3e573a992d upgrades to lexical soping implements to address some performance issues
fixes to HTML model to capture use of local vars as window state in scripts


git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4176 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-05-23 16:27:07 +00: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
msridhar1 3f5a4bcaca switch to ant for downloading external dependence. also, added ant as a builder, so hopefully files will be downloaded automatically
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4066 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-03-10 20:23:48 +00:00
dolby-oss f5065b11e4 beginnings of support for annotations
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4020 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2010-12-14 14:32:22 +00:00
dolby-oss c904bf1e14 fixes to Java source test failures
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3198 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-02-02 18:40:10 +00:00
dolby-oss 7935177e3a JDT-based CAst front end from Berkeley
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3170 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-01-09 14:14:04 +00:00
dolby-oss 2b2cb065cb add copyright messages
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3169 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-01-09 14:13:17 +00:00
dolby-oss f0bb415c25 remove old classpath entry
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3150 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-12-23 14:33:04 +00:00
dolby-oss 6fe59a49fd move CAst Java test data to separate project to ease use in plugin tests
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3140 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-12-16 15:19:56 +00:00
dolby-oss c181f33310 move CAst Java test data to separate project to ease use in plugin tests
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3139 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-12-16 15:14:00 +00:00