# HG changeset patch # User godin # Date 1566309286 -7200 # Node ID 699b8ef42f30dd5bcd9bfc2e7269c39fa39a3616 # Parent 80fad5f39a42ba02c0294d70cabb513851ddd447 8152467: remove uses of anachronistic array declarations for method return type Reviewed-by: shade, alanb Contributed-by: Evgeny Mandrikov diff -r 80fad5f39a42 -r 699b8ef42f30 src/java.base/share/classes/sun/text/CompactByteArray.java --- a/src/java.base/share/classes/sun/text/CompactByteArray.java Tue Jul 02 12:28:41 2019 +0200 +++ b/src/java.base/share/classes/sun/text/CompactByteArray.java Tue Aug 20 15:54:46 2019 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -244,7 +244,7 @@ /** For internal use only. Do not modify the result, the behavior of * modified results are undefined. */ - public short getIndexArray()[] + public short[] getIndexArray() { return indices; } @@ -252,7 +252,7 @@ /** For internal use only. Do not modify the result, the behavior of * modified results are undefined. */ - public byte getStringArray()[] + public byte[] getStringArray() { return values; } diff -r 80fad5f39a42 -r 699b8ef42f30 src/jdk.rmic/share/classes/sun/tools/java/BinaryAttribute.java --- a/src/jdk.rmic/share/classes/sun/tools/java/BinaryAttribute.java Tue Jul 02 12:28:41 2019 +0200 +++ b/src/jdk.rmic/share/classes/sun/tools/java/BinaryAttribute.java Tue Aug 20 15:54:46 2019 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -105,7 +105,7 @@ public Identifier getName() { return name; } - public byte getData()[] { return data; } + public byte[] getData() { return data; } public BinaryAttribute getNextAttribute() { return next; } diff -r 80fad5f39a42 -r 699b8ef42f30 src/jdk.rmic/share/classes/sun/tools/java/BinaryClass.java --- a/src/jdk.rmic/share/classes/sun/tools/java/BinaryClass.java Tue Jul 02 12:28:41 2019 +0200 +++ b/src/jdk.rmic/share/classes/sun/tools/java/BinaryClass.java Tue Aug 20 15:54:46 2019 +0200 @@ -531,7 +531,7 @@ /** * Get a class attribute */ - public byte getAttribute(Identifier name)[] { + public byte[] getAttribute(Identifier name) { for (BinaryAttribute att = atts ; att != null ; att = att.next) { if (att.name.equals(name)) { return att.data; diff -r 80fad5f39a42 -r 699b8ef42f30 src/jdk.rmic/share/classes/sun/tools/java/BinaryCode.java --- a/src/jdk.rmic/share/classes/sun/tools/java/BinaryCode.java Tue Jul 02 12:28:41 2019 +0200 +++ b/src/jdk.rmic/share/classes/sun/tools/java/BinaryCode.java Tue Aug 20 15:54:46 2019 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -88,11 +88,11 @@ * Accessors */ - public BinaryExceptionHandler getExceptionHandlers()[] { + public BinaryExceptionHandler[] getExceptionHandlers() { return exceptionHandlers; } - public byte getCode()[] { return code; } + public byte[] getCode() { return code; } public int getMaxStack() { return maxStack; } diff -r 80fad5f39a42 -r 699b8ef42f30 src/jdk.rmic/share/classes/sun/tools/java/ClassDefinition.java --- a/src/jdk.rmic/share/classes/sun/tools/java/ClassDefinition.java Tue Jul 02 12:28:41 2019 +0200 +++ b/src/jdk.rmic/share/classes/sun/tools/java/ClassDefinition.java Tue Aug 20 15:54:46 2019 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -224,7 +224,7 @@ /** * Get the class' interfaces */ - public final ClassDeclaration getInterfaces()[] { + public final ClassDeclaration[] getInterfaces() { if (interfaces == null) throw new CompilerError("getInterfaces"); return interfaces; } diff -r 80fad5f39a42 -r 699b8ef42f30 src/jdk.rmic/share/classes/sun/tools/java/MethodType.java --- a/src/jdk.rmic/share/classes/sun/tools/java/MethodType.java Tue Jul 02 12:28:41 2019 +0200 +++ b/src/jdk.rmic/share/classes/sun/tools/java/MethodType.java Tue Aug 20 15:54:46 2019 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -62,7 +62,7 @@ return returnType; } - public Type getArgumentTypes()[] { + public Type[] getArgumentTypes() { return argTypes; } diff -r 80fad5f39a42 -r 699b8ef42f30 src/jdk.rmic/share/classes/sun/tools/java/Parser.java --- a/src/jdk.rmic/share/classes/sun/tools/java/Parser.java Tue Jul 02 12:28:41 2019 +0200 +++ b/src/jdk.rmic/share/classes/sun/tools/java/Parser.java Tue Aug 20 15:54:46 2019 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -282,13 +282,13 @@ } args[argIndex++] = n; } - protected final Expression exprArgs(int index)[] { + protected final Expression[] exprArgs(int index) { Expression e[] = new Expression[argIndex - index]; System.arraycopy(args, index, e, 0, argIndex - index); argIndex = index; return e; } - protected final Statement statArgs(int index)[] { + protected final Statement[] statArgs(int index) { Statement s[] = new Statement[argIndex - index]; System.arraycopy(args, index, s, 0, argIndex - index); argIndex = index; diff -r 80fad5f39a42 -r 699b8ef42f30 src/jdk.rmic/share/classes/sun/tools/java/Type.java --- a/src/jdk.rmic/share/classes/sun/tools/java/Type.java Tue Jul 02 12:28:41 2019 +0200 +++ b/src/jdk.rmic/share/classes/sun/tools/java/Type.java Tue Aug 20 15:54:46 2019 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -300,7 +300,7 @@ /** * Return the argument types. Only works for method types. */ - public Type getArgumentTypes()[] { + public Type[] getArgumentTypes() { throw new CompilerError("getArgumentTypes"); }