Skip to content

Commit f759dd9

Browse files
Merge
2 parents fed185a + 2593dea commit f759dd9

File tree

13 files changed

+652
-47
lines changed

13 files changed

+652
-47
lines changed

.hgtags

+1
Original file line numberDiff line numberDiff line change
@@ -541,3 +541,4 @@ c91a28ed4845c265cd3d3340755e018da5e10698 13+10
541541
e21afe5aabed9f81fdcc7fe061536e2c13d19456 13+12
542542
dde636c6219c01c7d640f04acd92a344d6f9f421 13+13
543543
6425e1f958fcad3bc17299880c167306273207dd 13+14
544+
67129a01074e2422de976d01feb5f074276cdbff 14+1

.jcheck/conf

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
;
2+
; Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
3+
; DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
;
5+
; This code is free software; you can redistribute it and/or modify it
6+
; under the terms of the GNU General Public License version 2 only, as
7+
; published by the Free Software Foundation.
8+
;
9+
; This code is distributed in the hope that it will be useful, but WITHOUT
10+
; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
; version 2 for more details (a copy is included in the LICENSE file that
13+
; accompanied this code).
14+
;
15+
; You should have received a copy of the GNU General Public License version
16+
; 2 along with this work; if not, write to the Free Software Foundation,
17+
; Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
;
19+
; Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
; or visit www.oracle.com if you need additional information or have any
21+
; questions.
22+
;
23+
24+
[general]
25+
project=openjfx
26+
jbs=jdk
27+
28+
[repository]
29+
tags=(jdk-){0,1}([1-9]([0-9]*)(\.(0|[1-9][0-9]*)){0,3})(\+(([0-9]+))|(-ga))|[1-9]((\.\d{1,3}){0,2})-((b\d{2,3})|(ga))|[1-9]u(\d{1,3})-((b\d{2,3})|(ga))
30+
31+
[checks]
32+
error=blacklist,author,reviewers,merge,message,issues,whitespace,executable
33+
34+
[census]
35+
version=0
36+
domain=openjdk.org
37+
38+
[checks "whitespace"]
39+
files=.*\.java$|.*\.c$|.*\.h$|.*\.cpp$|.*\.hpp$
40+
41+
[checks "reviewers"]
42+
minimum=1
43+
44+
[checks "merge"]
45+
message=Merge
46+
47+
[checks "issues"]
48+
pattern=^([124-8][0-9]{6}): (\S.*)$

CONTRIBUTING.md

+116-27
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,19 @@ If you are a first time contributor to OpenJFX, welcome! Please do the following
4141

4242
* Sign the Contributor Agreement
4343

44-
In order for us to evaluate your contribution, you need to sign the [Oracle Contributor Agreement](https://www.oracle.com/technetwork/community/oca-486395.html) (OCA). Ultimately, the goal is to send accepted Pull Requests upstream to the OpenJFX repository hosted on openjdk.java.net. We are not asking you to give up your copyright, but to give us the right to distribute your code without restriction. By doing this you assert that the code you contribute is *yours* to contribute, and not third-party code that you do not own. We ask this of all contributors in order to assure our users of the origin and continuing existence of the code. You only need to sign the OCA once.
44+
In order for us to evaluate your contribution, you need to sign the [Oracle Contributor Agreement](https://www.oracle.com/technetwork/community/oca-486395.html) (OCA). We are not asking you to give up your copyright, but to give us the right to distribute your code without restriction. By doing this you assert that the code you contribute is *yours* to contribute, and not third-party code that you do not own. We ask this of all contributors in order to assure our users of the origin and continuing existence of the code. You only need to sign the OCA once.
4545

4646
* Read the code review policies
4747

4848
Please read the entire section below on how to submit a pull request, as well as the [OpenJFX Code Review Policies](https://wiki.openjdk.java.net/display/OpenJFX/Code+Reviews). If this is a feature request, please note the additional requirements and expectations in the [New features / API additions](https://wiki.openjdk.java.net/display/OpenJFX/Code+Reviews#CodeReviews-NewFeaturesC.Newfeatures/APIadditions.) section of the Code Review Policies doc.
4949

50+
* File a bug in JBS for every pull request
51+
52+
A [JBS](https://bugs.openjdk.java.net) bug ID is needed for every
53+
pull request. If there isn't already a bug filed in JBS, then please
54+
file one at [bugreport.java.com](https://bugreport.java.com/).
55+
A developer with an active OpenJDK ID can file a bug directly in JBS.
56+
5057
TIP: A GitHub pull request (PR) should not be the first time we hear about your proposed change to OpenJFX. Unless clearly identified as experimental or work-in-progress (WIP), we will usually close a pull request that isn't associated with an existing bug report. Reading the policies below will help you in getting your change approved.
5158

5259
### Submitting your changes via a pull request
@@ -61,39 +68,121 @@ Once your changes and tests are ready to submit for review:
6168

6269
Update your local repository with the most recent code from the main [repository]((https://github.com/openjdk/jfx)), and rebase your branch on top of the latest `master` branch. We prefer your initial changes to be squashed into a single commit. See the [GitHub help page](https://help.github.com/articles/about-git-rebase/) for help. Later, if we ask you to make changes, add them as separate commits. This makes them easier to review.
6370

64-
3. File a bug in JBS
65-
66-
If there isn't already a bug filed in [JBS](https://bugs.openjdk.java.net), then please file one at [bugreport.java.com](https://bugreport.java.com/). A JBS bug ID is needed even if you have already filed an issue in the GitHub issue tracker. A GitHub issue can be used as a convenience, but JBS is the official bug database for the OpenJFX Project. Once you submit a pull request, you can add an Issue link to the PR in the JBS bug. If you don't have direct JBS access, one of the Project Committers or Authors will do this for you.
67-
68-
4. Submit a pull request
71+
3. Submit a pull request
6972

70-
Push your local changes to your forked copy of the repository and [submit a pull request](https://help.github.com/articles/using-pull-requests). In the pull request, choose a title which sums up the changes that you have made, and in the body provide more details about what your changes do. The title *should include a JBS Bug ID*, which will make it easier for reviewers to cross-reference your pull requests with JBS.
73+
Push your local changes to your forked copy of the repository and
74+
[submit a pull request](https://help.github.com/articles/using-pull-requests).
75+
The title of the pull request must start with the 7-digit JBS bug id
76+
(without the `JDK-` prefix), followed by a colon (`:`), then a space,
77+
and finally the bug title as taken from JBS. You should include
78+
additional details about your change in the Description of the pull
79+
request. For example, the following is a valid pull request title:
7180

72-
5. Send an email requesting a code review
81+
```
82+
8231326: Update README and CONTRIBUTING docs for Skara
83+
```
7384
74-
NOTE: Project Skara will automate the RFR email, so this step will likely be removed.
85+
The Skara bot will then run `jcheck` on the server to verify the format
86+
of the PR title and check for whitespace errors. Once that passes,
87+
it will automatically send a Request For Review (RFR) email to the
88+
[openjfx-dev](mailto:[email protected]) mailing list.
89+
See the
90+
[Skara project page](https://github.com/openjdk/skara#openjdk-project-skara)
91+
for information on `jcheck` and other Skara tools.
92+
93+
TIP: prefix the pull request title with `WIP:` if you aren't yet
94+
ready for it to be reviewed. The Skara bot will not send an RFR
95+
email unless the title starts with a 7-digit bug ID.
96+
97+
Please cross-link the JBS Issue and the pull request. A link to the
98+
JBS issue can be added as part of the pull request's Description. A
99+
link to the PR, can be added as an issue link in the JBS bug. If
100+
you don't have direct JBS access, one of the Project Committers or
101+
Authors will do this for you.
102+
103+
Please adhere to the general guideline that you should never force push
104+
to a publicly shared branch. Once you have opened your pull request, you
105+
should consider your branch publicly shared. Instead of force pushing
106+
you can just add incremental commits; this is generally easier on your
107+
reviewers. If you need to pick up changes from `master`, you can merge
108+
`master` into your branch. A reviewer might ask you to rebase a
109+
long-running pull request in which case force pushing is okay for that
110+
request. Note that squashing at the end of the review process should
111+
also not be done. The Skara bot will squash your commits into a
112+
single commit, and rebase it onto the target branch when the pull
113+
request is integrated.
114+
115+
4. Code review
116+
117+
All pull requests _must_ be reviewed according to the
118+
[OpenJFX Code Review Policies](https://wiki.openjdk.java.net/display/OpenJFX/Code+Reviews).
119+
It is the responsibility of the Reviewer(s) and the Committer who
120+
will integrate the change to ensure that the code review policies
121+
are followed, and that all concerns have been addressed.
122+
123+
Discussion and review of the pull request can happen either by adding
124+
a comment to the PR itself, or by replying to the mailing list "RFR"
125+
thread. The Skara bot will cross-forward between them.
126+
To approve a pull request, a reviewer must do that in the PR itself.
127+
See the following
128+
[GitHub help page](https://help.github.com/en/articles/reviewing-proposed-changes-in-a-pull-request)
129+
for help on reviewing a pull request.
130+
131+
If any changes
132+
are needed, you would push additional commits to the branch
133+
from which you made the pull request.
134+
135+
The code review continues until there are no unaddressed concerns, and
136+
at least the minimum number of reviewers have approved the PR -- which
137+
is one for low-impact bug fixes and two for enhancements or high-impact
138+
bug fixes.
139+
140+
NOTE: while the Skara tooling will indicate that the PR is
141+
ready to integrate once the first reviewer with a "Reviewer" role
142+
in the project has approved it, this may or may not be sufficient
143+
depending on the type of fix. For example, you must wait for a second
144+
approval for enhancements or high-impact bug fixes.
145+
146+
5. Integrate the pull request
147+
148+
Once the review has completed as described above, you can integrate
149+
the PR.
150+
151+
A. Verify the commit message. The Skara tooling adds a comment with
152+
the commit message that will be used. You can add a summary to the
153+
commit message with the `/summary` command. You can add additional
154+
contributors with the `/contributor` command. Commands are issued
155+
by adding a comment to the PR that starts with a slash `/` character.
156+
157+
B. Issue the `/integrate` command. If you have the "Committer" role
158+
(or higher) in the Project, then the Skara bot will merge the change
159+
with no further action on your part. If you are not a Committer,
160+
then you must get a Committer to sponsor your change. This is often
161+
one of the reviewers who reviewed your PR, but it need not be. The
162+
sponsor will issue the `/sponsor` command after you issue `/integrate`
163+
once they are satisfied that the review criteria have been met.
164+
165+
6. Resolve the JBS bug as "Fixed"
166+
167+
There is currently no automation for resolving JBS bugs, although
168+
a future Skara improvement will automate this. Until then,
169+
the Committer who integrated or sponsored the fix is responsible for
170+
resolving the JBS issue. You do this with the "Resolve" action in JBS,
171+
selecting "Fixed" as the resolution. You also need to add the commit
172+
notification message (minus the list of modified files) as a comment.
173+
This includes the URL of the commit. For example:
75174
76-
Send a Request For Review (RFR) email to the [openjfx-dev](mailto:[email protected]) mailing list. The email subject should include the JBS bug ID. The body of the review request should contain a pointer to the JBS issue and a pointer to the pull request. Here is an example RFR email:
77175
```
78-
Subject: RFR: 8888888: The Bug Synopsis
176+
Changeset: 1de25a49
177+
Author: Kevin Rushforth <[email protected]>
178+
Date: 2019-09-23 08:15:36 +7000
179+
URL: https://git.openjdk.java.net/jfx/commit/1de25a49
79180
80-
Please review the fix for The Bug Synopsis:
81-
https://bugs.openjdk.java.net/browse/JDK-8888888
82-
https://github.com/openjdk/jfx/pull/12345
83-
```
181+
8231126: libxslt.md has incorrect version string
84182
85-
Then sit back and wait. There will probably be discussion about the pull request and, if any changes are needed, we would love to work with you to get your pull request merged into OpenJFX.
183+
Reviewed-by: ghb
184+
```
86185
87-
Please adhere to the general guideline that you should never force push
88-
to a publicly shared branch. Once you have opened your pull request, you
89-
should consider your branch publicly shared. Instead of force pushing
90-
you can just add incremental commits; this is generally easier on your
91-
reviewers. If you need to pick up changes from `master`, you can merge
92-
`master` into your branch. A reviewer might ask you to rebase a
93-
long-running pull request in which case force pushing is okay for that
94-
request. Note that squashing at the end of the review process should
95-
also not be done, that will be done when the pull request is [integrated
96-
via GitHub](https://github.com/blog/2141-squash-your-commits).
97186
98187
Contributing to the OpenJFX codebase
99188
------------------------------------------
@@ -106,7 +195,7 @@ Currently OpenJFX builds are running on JDK 11 (recommended) and JDK 12.
106195
It is possible to develop in any major Java IDE (Eclipse, IntelliJ, NetBeans). IDEs can automatically configure projects based on Gradle setup.
107196
108197
The following formatting rules are enforced for source code files by
109-
the white-space checker that is run as part of our CI test builds:
198+
`git jcheck`, which is run by the Skara bot:
110199
111200
* Use Unix-style (LF) line endings not DOS-style (CRLF)
112201
* Do not use TAB characters (exception: Makefiles can have TABS)

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ OpenJFX is a project under the charter of the OpenJDK. The [OpenJDK Bylaws](http
1010

1111
If you think you have found a bug in OpenJFX, first make sure that you are testing against the latest version - your issue may already have been fixed. If not, search our [issues list](https://bugs.openjdk.java.net) in the Java Bug System (JBS) in case a similar issue has already been opened. More information on where and how to report a bug can be found at [bugreport.java.com](https://bugreport.java.com/).
1212

13-
Please note that while the issue tracker in this Github project can be a convenient place to file an issue (either a bug or an enhancement request), the official bug database for OpenJFX is [JBS](https://bugs.openjdk.java.net).
14-
1513
## Getting Started
1614

1715
For instructions on building JavaFX, see the [Building OpenJFX](https://wiki.openjdk.java.net/display/OpenJFX/Building+OpenJFX) Wiki page.

modules/javafx.base/src/main/java/com/sun/javafx/event/CompositeEventHandler.java

+48-4
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@ record = record.nextRecord;
101101
}
102102
}
103103

104+
public boolean hasFilter() {
105+
return find(true);
106+
}
107+
108+
public boolean hasHandler() {
109+
if (getEventHandler() != null) return true;
110+
return find(false);
111+
}
112+
104113
/* Used for testing. */
105114
boolean containsHandler(final EventHandler<? super T> eventHandler) {
106115
return find(eventHandler, false) != null;
@@ -184,13 +193,28 @@ record = record.nextRecord;
184193
return null;
185194
}
186195

196+
private boolean find(boolean isFilter) {
197+
EventProcessorRecord<T> record = firstRecord;
198+
while (record != null) {
199+
if (record.isDisconnected()) {
200+
remove(record);
201+
} else if (isFilter == record.isFilter()) {
202+
return true;
203+
}
204+
record = record.nextRecord;
205+
}
206+
return false;
207+
}
208+
187209
private static abstract class EventProcessorRecord<T extends Event> {
188210
private EventProcessorRecord<T> nextRecord;
189211
private EventProcessorRecord<T> prevRecord;
190212

191213
public abstract boolean stores(EventHandler<? super T> eventProcessor,
192214
boolean isFilter);
193215

216+
public abstract boolean isFilter();
217+
194218
public abstract void handleBubblingEvent(T event);
195219

196220
public abstract void handleCapturingEvent(T event);
@@ -210,7 +234,12 @@ public NormalEventHandlerRecord(
210234
@Override
211235
public boolean stores(final EventHandler<? super T> eventProcessor,
212236
final boolean isFilter) {
213-
return !isFilter && (this.eventHandler == eventProcessor);
237+
return isFilter == isFilter() && (this.eventHandler == eventProcessor);
238+
}
239+
240+
@Override
241+
public boolean isFilter() {
242+
return false;
214243
}
215244

216245
@Override
@@ -240,7 +269,12 @@ public WeakEventHandlerRecord(
240269
@Override
241270
public boolean stores(final EventHandler<? super T> eventProcessor,
242271
final boolean isFilter) {
243-
return !isFilter && (weakEventHandler == eventProcessor);
272+
return isFilter == isFilter() && (weakEventHandler == eventProcessor);
273+
}
274+
275+
@Override
276+
public boolean isFilter() {
277+
return false;
244278
}
245279

246280
@Override
@@ -270,7 +304,12 @@ public NormalEventFilterRecord(
270304
@Override
271305
public boolean stores(final EventHandler<? super T> eventProcessor,
272306
final boolean isFilter) {
273-
return isFilter && (this.eventFilter == eventProcessor);
307+
return isFilter == isFilter() && (this.eventFilter == eventProcessor);
308+
}
309+
310+
@Override
311+
public boolean isFilter() {
312+
return true;
274313
}
275314

276315
@Override
@@ -300,7 +339,12 @@ public WeakEventFilterRecord(
300339
@Override
301340
public boolean stores(final EventHandler<? super T> eventProcessor,
302341
final boolean isFilter) {
303-
return isFilter && (weakEventFilter == eventProcessor);
342+
return isFilter == isFilter() && (weakEventFilter == eventProcessor);
343+
}
344+
345+
@Override
346+
public boolean isFilter() {
347+
return true;
304348
}
305349

306350
@Override

modules/javafx.base/src/main/java/com/sun/javafx/event/EventHandlerManager.java

+2-6
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,7 @@ private Event dispatchCapturingEvent(
216216
final CompositeEventHandler<? extends Event> compositeEventHandler =
217217
eventHandlerMap.get(handlerType);
218218

219-
if (compositeEventHandler != null) {
220-
// TODO: skip when no filters are registered in the
221-
// CompositeEventHandler (RT-23952)
219+
if (compositeEventHandler != null && compositeEventHandler.hasFilter()) {
222220
event = fixEventSource(event, eventSource);
223221
compositeEventHandler.dispatchCapturingEvent(event);
224222
}
@@ -231,9 +229,7 @@ private Event dispatchBubblingEvent(
231229
final CompositeEventHandler<? extends Event> compositeEventHandler =
232230
eventHandlerMap.get(handlerType);
233231

234-
if (compositeEventHandler != null) {
235-
// TODO: skip when no handlers are registered in the
236-
// CompositeEventHandler (RT-23952)
232+
if (compositeEventHandler != null && compositeEventHandler.hasHandler()) {
237233
event = fixEventSource(event, eventSource);
238234
compositeEventHandler.dispatchBubblingEvent(event);
239235
}

0 commit comments

Comments
 (0)