Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce number of raw types warnings #31523

Merged
merged 2 commits into from
Jun 25, 2018
Merged

Conversation

cbuescher
Copy link
Member

Among the ~7000 warnings we currently have, raw type warnings are one of the biggest
group (aprox. 1700) and one that is the easiest to reduce, I think. This PR is a first attempt
to reduce this number, most of the time by using the unbounded wildcard.

@cbuescher cbuescher added >non-issue review :Core/Infra/Core Core issues without another label v7.0.0 labels Jun 22, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@cbuescher
Copy link
Member Author

As an aside: figuring out why we have so many generic types (and reducing that number) is a different matter I think.

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -688,6 +688,7 @@ public void testRealmLookupThrowingExceptionRest() throws Exception {
}
}

@SuppressWarnings("unchecked")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this suppression still necessary (and the others in this file)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this particular case L699 i.getArguments() returns an Object[] which needs to be cast to ActionListener. Some of the Mockito stuff in here also requires SupressWarnings but I haven't added it elsewhere to keep this PR focused in raw tapes removals. I also haven't removed some other warnings in the classes touched since I think its makes any clean-up PR like this harder to review.

Among the ~7000 warnings we currently have, raw type warnings are one of the
biggest group (aprox. 1700) and one that is the easiest to reduce. This PR is a
fist attempt to reduce this number, most of the time by using the unbounded
wildcard.
 Conflicts:
	server/src/test/java/org/elasticsearch/common/geo/BaseGeoParsingTestCase.java
	server/src/test/java/org/elasticsearch/common/geo/builders/AbstractShapeBuilderTestCase.java
@cbuescher cbuescher merged commit 86ab3a2 into elastic:master Jun 25, 2018
@cbuescher
Copy link
Member Author

cbuescher commented Jun 25, 2018

@rjernst @jpountz I'm not sure if we want to backport non-issues with changes across many classes like this to 6.x. Does it make merging back easier or more complicated? Wdyt?

@rjernst
Copy link
Member

rjernst commented Jun 25, 2018

I would not backport cleanups like this unless there is a compelling reason to do so.

jasontedor added a commit to hub-cap/elasticsearch that referenced this pull request Jun 25, 2018
* elastic/master: (92 commits)
  Reduce number of raw types warnings (elastic#31523)
  Migrate scripted metric aggregation scripts to ScriptContext design (elastic#30111)
  turn GetFieldMappingsResponse to ToXContentObject (elastic#31544)
  Close xcontent parsers (partial) (elastic#31513)
  Ingest Attachment: Upgrade Tika to 1.18 (elastic#31252)
  TEST: Correct the assertion arguments order (elastic#31540)
  Add get field mappings to High Level REST API Client (elastic#31423)
  [DOCS] Updates Watcher examples for code testing (elastic#31152)
  TEST: Add bwc recovery tests with synced-flush index
  [DOCS] Move sql to docs (elastic#31474)
  [DOCS] Move monitoring to docs folder (elastic#31477)
  Core: Combine doExecute methods in TransportAction (elastic#31517)
  IndexShard should not return null stats (elastic#31528)
  fix repository update with the same settings but different type (elastic#31458)
  Fix Mockito trying to mock IOException that isn't thrown by method (elastic#31433) (elastic#31527)
  Node selector per client rather than per request (elastic#31471)
  Core: Combine messageRecieved methods in TransportRequestHandler (elastic#31519)
  Upgrade to Lucene 7.4.0. (elastic#31529)
  [ML] Add ML filter update API (elastic#31437)
  Allow multiple unicast host providers (elastic#31509)
  ...
dnhatn added a commit that referenced this pull request Jun 26, 2018
* master:
  ingest: Add ignore_missing property to foreach filter (#22147) (#31578)
  Fix a formatting issue in the docvalue_fields documentation. (#31563)
  reduce log level at gradle configuration time
  [TEST] Close additional clients created while running yaml tests (#31575)
  Docs: Clarify sensitive fields watcher encryption (#31551)
  Watcher: Remove never executed code (#31135)
  Add support for switching distribution for all integration tests (#30874)
  Improve robustness of geo shape parser for malformed shapes (#31449)
  QA: Create xpack yaml features (#31403)
  Improve test times for tests using `RandomObjects::addFields` (#31556)
  [Test] Add full cluster restart test for Rollup (#31533)
  Enhance thread context uniqueness assertion
  [DOCS] Fix heading format errors (#31483)
  fix writeIndex evaluation for aliases (#31562)
  Add x-opaque-id to search slow logs (#31539)
  Watcher: Fix put watch action (#31524)
  Add package pre-install check for java binary (#31343)
  Reduce number of raw types warnings (#31523)
  Migrate scripted metric aggregation scripts to ScriptContext design (#30111)
  turn GetFieldMappingsResponse to ToXContentObject (#31544)
  Close xcontent parsers (partial) (#31513)
  Ingest Attachment: Upgrade Tika to 1.18 (#31252)
  TEST: Correct the assertion arguments order (#31540)
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this pull request Jul 4, 2018
cbuescher pushed a commit that referenced this pull request Jul 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Core Core issues without another label >non-issue v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants