Skip to content
Permalink
Browse files
8283711: Remove redundant 'new String' calls after concatenation
Reviewed-by: wetmore, vromero, xuelei
  • Loading branch information
Andrey Turbanov committed Mar 28, 2022
1 parent c0aecd1 commit d472c019344524aa20c74bdc4ab7823b6940be67
Showing 3 changed files with 12 additions and 13 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2022, 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
@@ -146,8 +146,7 @@ public static void checkInitCredPermission(Krb5NameElement name) {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
String realm = (name.getKrb5PrincipalName()).getRealmAsString();
String tgsPrincipal =
new String("krbtgt/" + realm + '@' + realm);
String tgsPrincipal = "krbtgt/" + realm + '@' + realm;
ServicePermission perm =
new ServicePermission(tgsPrincipal, "initiate");
try {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2022, 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
@@ -497,13 +497,13 @@ public synchronized void writeKey(CCacheOutputStream cos)
}

public String toString() {
return new String("EncryptionKey: keyType=" + keyType
+ " kvno=" + kvno
+ " keyValue (hex dump)="
+ (keyValue == null || keyValue.length == 0 ?
" Empty Key" : '\n'
+ Krb5.hexDumper.encodeBuffer(keyValue)
+ '\n'));
return "EncryptionKey: keyType=" + keyType
+ " kvno=" + kvno
+ " keyValue (hex dump)="
+ (keyValue == null || keyValue.length == 0 ?
" Empty Key" : '\n'
+ Krb5.hexDumper.encodeBuffer(keyValue)
+ '\n');
}

/**
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2022, 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
@@ -2054,7 +2054,7 @@ public Symbol baseSymbol() {
};
break;
case CAPTURED_OUTER_THIS:
Name name = names.fromString(new String(sym.flatName().toString().replace('.', '$') + names.dollarThis));
Name name = names.fromString(sym.flatName().toString().replace('.', '$') + names.dollarThis);
ret = new VarSymbol(SYNTHETIC | FINAL | PARAMETER, name, types.erasure(sym.type), translatedSym) {
@Override
public Symbol baseSymbol() {

1 comment on commit d472c01

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on d472c01 Mar 28, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.