Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2021, 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
Expand Down Expand Up @@ -55,7 +55,7 @@ protected void initialize(MenuItem target) {

private boolean isSeparator() {
String label = ((MenuItem)getTarget()).getLabel();
return (label != null && label.equals("-"));
return "-".equals(label);
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/java.desktop/share/classes/java/awt/Window.java
Original file line number Diff line number Diff line change
Expand Up @@ -417,11 +417,11 @@ public static enum Type {
@SuppressWarnings("removal")
String s = java.security.AccessController.doPrivileged(
new GetPropertyAction("java.awt.syncLWRequests"));
systemSyncLWRequests = (s != null && s.equals("true"));
systemSyncLWRequests = "true".equals(s);
@SuppressWarnings("removal")
String s2 = java.security.AccessController.doPrivileged(
new GetPropertyAction("java.awt.Window.locationByPlatform"));
locationByPlatformProp = (s2 != null && s2.equals("true"));
locationByPlatformProp = "true".equals(s2);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021, 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
Expand Down Expand Up @@ -328,9 +328,9 @@ private void setupDragMode(JComponent f) {
Window window = SwingUtilities.getWindowAncestor(f);
if (window != null && !window.isOpaque()) {
dragMode = DEFAULT_DRAG_MODE;
} else if (mode != null && mode.equals("outline")) {
} else if ("outline".equals(mode)) {
dragMode = OUTLINE_DRAG_MODE;
} else if (mode != null && mode.equals("faster")
} else if ("faster".equals(mode)
&& f instanceof JInternalFrame
&& ((JInternalFrame)f).isOpaque() &&
(parent == null || parent.isOpaque())) {
Expand Down
4 changes: 2 additions & 2 deletions src/java.desktop/share/classes/javax/swing/JLayeredPane.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021, 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
Expand Down Expand Up @@ -205,7 +205,7 @@ private void validateOptimizedDrawing() {
(layer = (Integer)((JComponent)c).
getClientProperty(LAYER_PROPERTY)) != null))
{
if(layer != null && layer.equals(FRAME_CONTENT_LAYER))
if (FRAME_CONTENT_LAYER.equals(layer))
continue;
layeredComponentFound = true;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ public boolean isFloppyDrive(File dir) {
public boolean isComputerNode(File dir) {
if (dir != null) {
String parent = dir.getParent();
if (parent != null && parent.equals("/net")) {
if ("/net".equals(parent)) {
return true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,7 @@ public View create(Element elem) {
} else if (kind == HTML.Tag.IMPLIED) {
String ws = (String) elem.getAttributes().getAttribute(
CSS.Attribute.WHITE_SPACE);
if ((ws != null) && ws.equals("pre")) {
if ("pre".equals(ws)) {
return new LineView(elem);
}
return new javax.swing.text.html.ParagraphView(elem);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import sun.java2d.loops.Blit;
import sun.java2d.loops.BlitBg;
import sun.awt.image.SurfaceManager;
import sun.awt.image.SurfaceManager.FlushableCacheData;

import java.security.AccessController;
import sun.security.action.GetPropertyAction;
Expand Down Expand Up @@ -74,7 +73,7 @@ public abstract class SurfaceDataProxy
@SuppressWarnings("removal")
String manimg = AccessController.doPrivileged(
new GetPropertyAction("sun.java2d.managedimages"));
if (manimg != null && manimg.equals("false")) {
if ("false".equals(manimg)) {
cachingAllowed = false;
System.out.println("Disabling managed images");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@ public void print(PrintRequestAttributeSet attributes)
* PrintRequestAttributeSet while calling print(attributes)
*/
JobSheets js = (JobSheets)psvc.getDefaultAttributeValue(JobSheets.class);
if (js != null && js.equals(JobSheets.NONE)) {
if (JobSheets.NONE.equals(js)) {
noJobSheet = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ final class XTaskbarPeer implements TaskbarPeer {
String de = AccessController.doPrivileged(
(PrivilegedAction<String>) ()
-> System.getenv("XDG_CURRENT_DESKTOP"));
isUnity = de != null && de.equals("Unity");
isUnity = "Unity".equals(de);
}

private static void initWithLock() {
Expand Down
2 changes: 1 addition & 1 deletion src/java.desktop/unix/classes/sun/print/UnixPrintJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public class UnixPrintJob implements CancelablePrintJob {
mDestType = UnixPrintJob.DESTPRINTER;
JobSheets js = (JobSheets)(service.
getDefaultAttributeValue(JobSheets.class));
if (js != null && js.equals(JobSheets.NONE)) {
if (JobSheets.NONE.equals(js)) {
mNoJobSheet = true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ synchronized RenderingHints getDesktopAAHints() {

Boolean smoothingOn = (Boolean)map.get("win.text.fontSmoothingOn");

if (smoothingOn != null && smoothingOn.equals(Boolean.TRUE)) {
if (Boolean.TRUE.equals(smoothingOn)) {
Integer typeID = (Integer)map.get("win.text.fontSmoothingType");
/* "1" is GASP/Standard but we'll also use that if the return
* value is anything other than "2" for LCD.
Expand Down