Skip to content

Commit

Permalink
Move o.e.tips.tests to Java 17
Browse files Browse the repository at this point in the history
  • Loading branch information
vrubezhny authored and akurtakov committed Feb 3, 2023
1 parent 35340f0 commit 89044e7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion org.eclipse.tips.tests/.classpath
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src">
<attributes>
Expand Down
6 changes: 3 additions & 3 deletions org.eclipse.tips.tests/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
Expand Down Expand Up @@ -111,7 +111,7 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=11
org.eclipse.jdt.core.compiler.source=17
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16
Expand Down
4 changes: 2 additions & 2 deletions org.eclipse.tips.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Tip of the Day Tests
Bundle-SymbolicName: org.eclipse.tips.tests
Bundle-Version: 1.1.100.qualifier
Bundle-Version: 1.2.0.qualifier
Bundle-Vendor: Eclipse
Bundle-RequiredExecutionEnvironment: JavaSE-11
Bundle-RequiredExecutionEnvironment: JavaSE-17
Require-Bundle: org.junit;bundle-version="4.12.0",
org.eclipse.tips.examples;bundle-version="0.1.0",
org.eclipse.tips.ide;bundle-version="0.1.0",
Expand Down
32 changes: 16 additions & 16 deletions org.eclipse.tips.tests/src/org/eclipse/tips/manual/tests/Sleak.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2021 IBM Corp.
* Copyright (c) 2000, 2023 IBM Corp.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -184,26 +184,26 @@ void paintCanvas(Event event) {
}
GC gc = event.gc;
Object object = objects[index];
if (object instanceof Color) {
if (((Color) object).isDisposed()) {
if (object instanceof Color color) {
if (color.isDisposed()) {
return;
}
gc.setBackground((Color) object);
gc.setBackground(color);
gc.fillRectangle(canvas.getClientArea());
return;
}
if (object instanceof Cursor) {
if (((Cursor) object).isDisposed()) {
if (object instanceof Cursor cursor) {
if (cursor.isDisposed()) {
return;
}
canvas.setCursor((Cursor) object);
canvas.setCursor(cursor);
return;
}
if (object instanceof Font) {
if (((Font) object).isDisposed()) {
if (object instanceof Font font) {
if (font.isDisposed()) {
return;
}
gc.setFont((Font) object);
gc.setFont(font);
FontData[] array = gc.getFont().getFontData();
String string = "";
String lf = text.getLineDelimiter();
Expand All @@ -227,18 +227,18 @@ void paintCanvas(Event event) {
// if (object instanceof GC) {
// return;
// }
if (object instanceof Image) {
if (((Image) object).isDisposed()) {
if (object instanceof Image image) {
if (image.isDisposed()) {
return;
}
gc.drawImage((Image) object, 0, 0);
gc.drawImage(image, 0, 0);
return;
}
if (object instanceof Region) {
if (((Region) object).isDisposed()) {
if (object instanceof Region region) {
if (region.isDisposed()) {
return;
}
String string = ((Region) object).getBounds().toString();
String string = region.getBounds().toString();
gc.drawString(string, 0, 0);
return;
}
Expand Down

0 comments on commit 89044e7

Please sign in to comment.