RFR: JDK-8066619: String(byte[],int,int,int) in String has been deprecated in Manifest and Attributes

Lance Andersen lance.andersen at oracle.com
Tue Dec 18 21:10:34 UTC 2018


Hi Philipp,

A question as to why for tests such as:

———————

    @Test
    public void testMainAttributesHeaderNameEmpty() throws Exception {
        Manifest mf = new Manifest();
        mf.getMainAttributes().put(Name.MANIFEST_VERSION, "1.0");
        mf.getMainAttributes().put(EMPTY_NAME, SOME_VALUE);
        try {
            mf = writeAndRead(mf);
            fail();
        } catch ( /* out: */ IOException e) {
            return; // ok, was always like this
        }
    }

——————————

Is there a reason you did not use

@Test(expectedExceptions = IOException.class)

It just seems to make the test a bit more readable

Best
Lance


> On Dec 18, 2018, at 10:38 AM, Roger Riggs <Roger.Riggs at oracle.com> wrote:
> 
> Hi Philipp,
> 
> I'm satisfied with this update.
> 
> BTW, your workspace may be a bit out of date, the patch did not merge without warnings.
> 
> For convenience of other reviewers, here a webrev:
>  http://cr.openjdk.java.net/~rriggs/webrev-8066619-3.patch/
> 
> Thanks, Roger
> 
> 
> On 12/18/2018 02:15 AM, Philipp Kunz wrote:
>> Thanks. Find a new patch attached.
>> 
>> On Mon, 2018-12-17 at 12:12 -0500, Roger Riggs wrote:
>>> Hi Philipp,
>>> 
>>> Manifest.java:
>>> 
>>>  - Line 258: creating a new array for two characters on each call isn't as efficient as:
>>>     out.write('\r');
>>>     out.write('\n').
>>> 
>>> The new test that need internal access can gain that access by adding:
>>>    @modules java.base/java.util.jar:+open
>>> 
>>> That instructs testng to add the correct command line switches.
>>> Then you can remove --illegal-access=warn and the tests will work.
>>> 
>>> 
>>> In the test ValueUtf8Coding, just a mention of a method to create a string with repeats.
>>>      "-".repeat(80);
>>> 
> 

 <http://oracle.com/us/design/oracle-email-sig-198324.gif>
 <http://oracle.com/us/design/oracle-email-sig-198324.gif> <http://oracle.com/us/design/oracle-email-sig-198324.gif>
 <http://oracle.com/us/design/oracle-email-sig-198324.gif>Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering 
1 Network Drive 
Burlington, MA 01803
Lance.Andersen at oracle.com <mailto:Lance.Andersen at oracle.com>





More information about the core-libs-dev mailing list