Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinrushforth committed Feb 21, 2020
2 parents fde42da + d8e7f85 commit 66a8f49
Show file tree
Hide file tree
Showing 14 changed files with 55 additions and 27 deletions.
6 changes: 3 additions & 3 deletions apps/samples/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<classpathentry kind="src" path="Ensemble8/src/compiletime/java"/>
<classpathentry kind="src" path="Ensemble8/src/generated/java"/>
<classpathentry kind="src" path="Ensemble8/src/generated/resources"/>
<classpathentry kind="lib" path="Ensemble8/lib/lucene-core-7.7.1.jar"/>
<classpathentry kind="lib" path="Ensemble8/lib/lucene-grouping-7.7.1.jar"/>
<classpathentry kind="lib" path="Ensemble8/lib/lucene-queryparser-7.7.1.jar"/>
<classpathentry kind="lib" path="Ensemble8/lib/lucene-core-7.7.2.jar"/>
<classpathentry kind="lib" path="Ensemble8/lib/lucene-grouping-7.7.2.jar"/>
<classpathentry kind="lib" path="Ensemble8/lib/lucene-queryparser-7.7.2.jar"/>
<classpathentry kind="src" path="MandelbrotSet/src"/>
<classpathentry kind="src" path="Modena/src/main/java"/>
<classpathentry kind="src" path="Modena/src/main/resources"/>
Expand Down
4 changes: 2 additions & 2 deletions apps/samples/Ensemble8/UPDATING-lucene.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ To update to a new version of Lucene:
gradle clean
gradle sdk apps

NOTE: if upgrading to a new major version there are usually compilation errors that need to be fixed.
NOTE: if upgrading to a new major version there are usually compilation or runtime errors that need to be fixed.


3. Regenerate the index files:
3. Regenerate the index files. This step can be skipped if only the "bugfix" number (the third digit) of the release changes:

$ cd apps/samples/Ensemble8
$ rm -rf src/generated/resources/ensemble/search/index
Expand Down
6 changes: 3 additions & 3 deletions apps/samples/Ensemble8/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ apply plugin:'application'
def mainClassName = "ensemble.EnsembleApp"

def FileCollection apachecp = files(
"./lib/lucene-core-7.7.1.jar",
"./lib/lucene-grouping-7.7.1.jar",
"./lib/lucene-queryparser-7.7.1.jar")
"./lib/lucene-core-7.7.2.jar",
"./lib/lucene-grouping-7.7.2.jar",
"./lib/lucene-queryparser-7.7.2.jar")

sourceSets {
main {
Expand Down
2 changes: 1 addition & 1 deletion apps/samples/Ensemble8/legal/lucene.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Apache Lucene v7.7.1
## Apache Lucene v7.7.2

### Apache Lucene Notice
```
Expand Down
2 changes: 1 addition & 1 deletion apps/samples/Ensemble8/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dist.jar=${dist.dir}/Ensemble8.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
lucene.version=7.7.1
lucene.version=7.7.2
file.reference.lucene-core.jar=lib/lucene-core-${lucene.version}.jar
file.reference.lucene-grouping.jar=lib/lucene-grouping-${lucene.version}.jar
file.reference.lucene-queryparser.jar=lib/lucene-queryparser-${lucene.version}.jar
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4148,7 +4148,7 @@ project(":apps") {
// The apps build is Ant based, we will exec ant from gradle.

// Download the Lucene libraries needed for the Ensemble8 app
def luceneVersion = "7.7.1"
def luceneVersion = "7.7.2"
getConfigurations().create("lucene");
dependencies {
lucene group: "org.apache.lucene", name: "lucene-core", version: luceneVersion
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2020, 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 @@ -576,7 +576,7 @@ public static <T> boolean replaceAll(ObservableList<T> list, T oldVal, T newVal)
}

/**
* Reverse the order in the list
* Reverses the order in the list.
* Fires only <b>one</b> change notification on the list.
* @param list the list to be reversed
* @see Collections#reverse(java.util.List)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2020, 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 @@ -27,6 +27,7 @@
import javafx.collections.ListChangeListener;
import javafx.collections.ObservableList;
import javafx.collections.ObservableListBase;
import javafx.collections.WeakListChangeListener;

import java.lang.ref.WeakReference;
import java.util.ArrayList;
Expand All @@ -46,6 +47,8 @@ public abstract class SelectedItemsReadOnlyObservableList<E> extends ObservableL
itemsListChanged = true;
itemsListChange = c;
};
private final WeakListChangeListener weakItemsListListener =
new WeakListChangeListener(itemsListListener);

private final Supplier<Integer> modelSizeSupplier;

Expand Down Expand Up @@ -120,11 +123,11 @@ public int size() {
// Used by ListView and TableView to allow for improved handling.
public void setItemsList(ObservableList<E> itemsList) {
if (this.itemsList != null) {
this.itemsList.removeListener(itemsListListener);
this.itemsList.removeListener(weakItemsListListener);
}
this.itemsList = itemsList;
if (itemsList != null) {
itemsList.addListener(itemsListListener);
itemsList.addListener(weakItemsListListener);
}
}

Expand Down
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, 2020, 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 @@ -28,6 +28,7 @@
import com.sun.javafx.scene.control.VirtualScrollBar;
import com.sun.javafx.scene.control.behavior.ListCellBehavior;
import com.sun.javafx.tk.Toolkit;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -1975,4 +1976,28 @@ public void testEventIndicesOnSelectRange() {
assertEquals("List item at index 1 should be selected", 1, (int) sm.getSelectedIndices().get(0));
assertEquals("List item at index 2 should be selected", 2, (int) sm.getSelectedIndices().get(1));
}

@Test
public void testListViewLeak() {
ObservableList<String> items = FXCollections.observableArrayList();
WeakReference<ListView<String>> listViewRef = new WeakReference<>(new ListView<>(items));
attemptGC(listViewRef, 10);
assertNull("ListView has a leak.", listViewRef.get());
}

private void attemptGC(WeakReference<ListView<String>> weakRef, int n) {
for (int i = 0; i < n; i++) {
System.gc();
System.runFinalization();

if (weakRef.get() == null) {
break;
}
try {
Thread.sleep(50);
} catch (InterruptedException e) {
fail("InterruptedException occurred during Thread.sleep()");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ public final ReadOnlyObjectProperty<Duration> cycleDurationProperty() {

/**
* Read-only variable to indicate the total duration of this
* {@code Animation}, including repeats. A {@code Animation} with a {@code cycleCount}
* {@code Animation}, including repeats. An {@code Animation} with a {@code cycleCount}
* of {@code Animation.INDEFINITE} will have a {@code totalDuration} of
* {@code Duration.INDEFINITE}.
*
Expand Down Expand Up @@ -961,7 +961,7 @@ public void playFromStart() {

/**
* Stops the animation and resets the play head to its initial position. If
* the animation is not currently running, this method has no effect.
* the animation is already stopped, this method has no effect.
* <p>
* Note: <ul>
* <li>{@code stop()} is an asynchronous call, the {@code Animation} may not stop
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2020, 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 @@ -175,7 +175,7 @@ public static void requestNextPulse() {

/**
* Returns true if the calling thread is the JavaFX Application Thread.
* Use this call the ensure that a given task is being executed
* Use this call to ensure that a given task is being executed
* (or not being executed) on the JavaFX Application Thread.
*
* @return true if running on the JavaFX Application Thread
Expand Down
4 changes: 2 additions & 2 deletions modules/javafx.graphics/src/main/java/javafx/scene/Node.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2020, 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 @@ -1566,7 +1566,7 @@ public final Node getClip() {
}

/**
* Specifies a {@code Node} to use to define the the clipping shape for this
* Specifies a {@code Node} to use to define the clipping shape for this
* Node. This clipping Node is not a child of this {@code Node} in the scene
* graph sense. Rather, it is used to define the clip for this {@code Node}.
* <p>
Expand Down
4 changes: 2 additions & 2 deletions modules/javafx.graphics/src/main/native-glass/win/OleUtils.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2020, 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 @@ -227,7 +227,7 @@ inline HRESULT checkJavaException(JNIEnv *env)
s_jcidThrowable_getMessage
));
if(jsMessage){
STRACE1(_T("Java Messsge:%s"), (LPCWSTR)JString(env, jsMessage) );
STRACE1(_T("Java Message:%s"), (LPCWSTR)JString(env, jsMessage) );
}
env->ExceptionDescribe();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ inline Opcode getOpcodeWide16(OpcodeID id)
#if ENABLE(COMPUTED_GOTO_OPCODES)
return g_opcodeMapWide16[id];
#else
return static_cast<Opcode>(id - numOpcodeIDs);
return static_cast<Opcode>(id + numOpcodeIDs);
#endif
}

Expand All @@ -114,7 +114,7 @@ inline Opcode getOpcodeWide32(OpcodeID id)
#if ENABLE(COMPUTED_GOTO_OPCODES)
return g_opcodeMapWide32[id];
#else
return static_cast<Opcode>(id - numOpcodeIDs);
return static_cast<Opcode>(id + numOpcodeIDs*2);
#endif
}

Expand Down

0 comments on commit 66a8f49

Please sign in to comment.