Bug 59722 - Use StandardCharsets when possible
Summary: Use StandardCharsets when possible
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: 3.0
Hardware: All All
: P2 minor (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-19 14:09 UTC by Felix Schumacher
Modified: 2016-06-19 21:25 UTC (History)
0 users



Attachments
Use StandardCharsets when possible (28.26 KB, patch)
2016-06-19 14:09 UTC, Felix Schumacher
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Schumacher 2016-06-19 14:09:10 UTC
Created attachment 33963 [details]
Use StandardCharsets when possible

Use StandardCharsets when possible and try to use the CharSet directly instead of constructing one from a string.

That way we can reduce a few catch statements and be a bit surer, that we have used the right constant for a CharSet name.
Comment 1 Felix Schumacher 2016-06-19 19:47:00 UTC
Date: Sun Jun 19 19:46:02 2016
New Revision: 1749200

URL: http://svn.apache.org/viewvc?rev=1749200&view=rev
Log:
Use StandardCharsets to reduce the possibility of misspelling Charset names.

Bugzilla Id: 59722

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/assertions/HTMLAssertion.java
    jmeter/trunk/src/components/org/apache/jmeter/assertions/XPathAssertion.java
    jmeter/trunk/src/components/org/apache/jmeter/extractor/XPathExtractor.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/RenderAsXPath.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/graphite/GraphiteMetricsSender.java
    jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java
    jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java
    jmeter/trunk/src/core/org/apache/jmeter/save/CSVSaveService.java
    jmeter/trunk/src/core/org/apache/jmeter/save/converters/ConversionHelp.java
    jmeter/trunk/src/core/org/apache/jmeter/util/XPathUtil.java
    jmeter/trunk/src/functions/org/apache/jmeter/functions/UrlDecode.java
    jmeter/trunk/src/functions/org/apache/jmeter/functions/UrlEncode.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HttpMirrorThread.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/HtmlParsingUtils.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/JTidyHTMLParser.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/PostWriter.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/ConversionUtils.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/EncoderCache.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/accesslog/TCLogParser.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/visualizers/RequestViewHTTP.java
    jmeter/trunk/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/AbstractJDBCTestElement.java
    jmeter/trunk/src/protocol/ldap/org/apache/jmeter/protocol/ldap/sampler/LDAPExtSampler.java
    jmeter/trunk/xdocs/changes.xml
Comment 2 Sebb 2016-06-19 21:25:00 UTC
Better to use the Charset directly where possible:

URL: http://svn.apache.org/viewvc?rev=1749208&view=rev
Log:
 Use StandardCharsets when possible
 Might as well use the Charset directly
Bugzilla Id: 59722

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HttpMirrorThread.java
Comment 3 The ASF infrastructure team 2022-09-24 20:38:04 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/4006