File tree Expand file tree Collapse file tree 8 files changed +13
-16
lines changed
windows/classes/sun/nio/fs Expand file tree Collapse file tree 8 files changed +13
-16
lines changed Original file line number Diff line number Diff line change @@ -2190,8 +2190,8 @@ public int compareTo(File pathname) {
21902190 * {@code false} otherwise
21912191 */
21922192 public boolean equals (Object obj ) {
2193- if (obj instanceof File ) {
2194- return compareTo (( File ) obj ) == 0 ;
2193+ if (obj instanceof File file ) {
2194+ return compareTo (file ) == 0 ;
21952195 }
21962196 return false ;
21972197 }
Original file line number Diff line number Diff line change @@ -308,8 +308,7 @@ public Type[] getGenericExceptionTypes() {
308308 * same formal parameter types.
309309 */
310310 public boolean equals (Object obj ) {
311- if (obj instanceof Constructor ) {
312- Constructor <?> other = (Constructor <?>)obj ;
311+ if (obj instanceof Constructor <?> other ) {
313312 if (getDeclaringClass () == other .getDeclaringClass ()) {
314313 return equalParamTypes (parameterTypes , other .parameterTypes );
315314 }
Original file line number Diff line number Diff line change @@ -279,8 +279,7 @@ public Type getGenericType() {
279279 * and type.
280280 */
281281 public boolean equals (Object obj ) {
282- if (obj instanceof Field ) {
283- Field other = (Field )obj ;
282+ if (obj instanceof Field other ) {
284283 return (getDeclaringClass () == other .getDeclaringClass ())
285284 && (getName () == other .getName ())
286285 && (getType () == other .getType ());
Original file line number Diff line number Diff line change @@ -358,8 +358,7 @@ public Type[] getGenericExceptionTypes() {
358358 * and formal parameter types and return type.
359359 */
360360 public boolean equals (Object obj ) {
361- if (obj instanceof Method ) {
362- Method other = (Method )obj ;
361+ if (obj instanceof Method other ) {
363362 if ((getDeclaringClass () == other .getDeclaringClass ())
364363 && (getName () == other .getName ())) {
365364 if (!returnType .equals (other .getReturnType ()))
Original file line number Diff line number Diff line change @@ -352,8 +352,8 @@ public int hashCode() {
352352 * @see java.net.InetAddress#getAddress()
353353 */
354354 public boolean equals (Object obj ) {
355- return (obj instanceof Inet4Address ) &&
356- ((( InetAddress ) obj ) .holder ().getAddress () == holder ().getAddress () );
355+ return (obj instanceof Inet4Address inet4Address ) &&
356+ inet4Address .holder ().getAddress () == holder ().getAddress ();
357357 }
358358
359359 // Utilities
Original file line number Diff line number Diff line change @@ -66,8 +66,8 @@ static Negotiator getNegotiator(HttpCallerInfo hci) {
6666 } catch (ReflectiveOperationException roe ) {
6767 finest (roe );
6868 Throwable t = roe .getCause ();
69- if (t instanceof Exception )
70- finest (( Exception ) t );
69+ if (t instanceof Exception exception )
70+ finest (exception );
7171 return null ;
7272 }
7373 }
Original file line number Diff line number Diff line change @@ -149,8 +149,8 @@ public PollingWatchKey run() throws IOException {
149149 });
150150 } catch (PrivilegedActionException pae ) {
151151 Throwable cause = pae .getCause ();
152- if (cause instanceof IOException )
153- throw ( IOException ) cause ;
152+ if (cause instanceof IOException ioe )
153+ throw ioe ;
154154 throw new AssertionError (pae );
155155 }
156156 }
Original file line number Diff line number Diff line change @@ -798,8 +798,8 @@ public int compareTo(Path obj) {
798798
799799 @ Override
800800 public boolean equals (Object obj ) {
801- if (obj instanceof WindowsPath ) {
802- return compareTo (( Path ) obj ) == 0 ;
801+ if (obj instanceof WindowsPath path ) {
802+ return compareTo (path ) == 0 ;
803803 }
804804 return false ;
805805 }
You can’t perform that action at this time.
0 commit comments