You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OpenJFX is an open source project and we love to receive contributions from our community — you! There are many ways to contribute, from improving the documentation, submitting bug reports and feature requests or writing code which can be incorporated into OpenJFX itself.
4
+
OpenJFX is an open source project and we love to receive contributions from our community — you! There are many ways to contribute, from improving the documentation, submitting bug reports and feature requests, or writing code which can be incorporated into OpenJFX itself.
5
5
6
6
Bug reports
7
7
-----------
8
8
9
-
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/).
9
+
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/issues/?filter=39543) 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/).
10
10
11
11
It is very helpful if you can prepare a reproduction of the bug. In other words, provide a small test case which we can run to confirm your bug. It makes it easier to find the problem and to fix it.
12
12
@@ -15,13 +15,14 @@ Provide as much information as you can. The easier it is for us to recreate your
15
15
Feature requests
16
16
----------------
17
17
18
-
If you find yourself wishing for a feature that doesn't exist in OpenJFX, you are probably not alone. There are bound to be others out there with similar needs. Many of the features that OpenJFX has today have been added because our users saw the need.
19
-
Open an issue on our [issues list](https://bugs.openjdk.java.net) on JBS which describes the feature you would like to see, why you need it, and how it should work.
18
+
If you find yourself wishing for a feature that doesn't exist in OpenJFX, you are probably not alone. There are bound to be others out there with similar needs. Many of the features that OpenJFX has today have been added because our users saw the need. Please be aware that
19
+
all new feature requests, including any API changes, need prior discussion on the [openjfx-dev](https://mail.openjdk.java.net/mailman/listinfo/openjfx-dev) mailing list, even if there is already an open
20
+
[JBS issue](https://bugs.openjdk.java.net). See the [New features / API additions](#new-features--api-additions) section below for more information.
20
21
21
22
Contributing code and documentation changes
22
23
-------------------------------------------
23
24
24
-
If you have a bug fix or new feature that you would like to contribute to OpenJFX, please find or open an issue about it first. Talk about what you would like to do. It may be that somebody is already working on it, or that there are particular issues that you should know about before implementing the change. Feature requests, in particular, should be discussed ahead of time and will require significant effort on your part.
25
+
If you have a bug fix or new feature that you would like to contribute to OpenJFX, please talk about what you would like to do on the [openjfx-dev](https://mail.openjdk.java.net/mailman/listinfo/openjfx-dev) mailing list. It may be that somebody is already working on it, or that there are particular issues that you should know about before implementing the change.
25
26
26
27
We enjoy working with contributors to get their code accepted. There are many approaches to fixing a problem and it is important to find the best approach before writing too much code.
27
28
@@ -45,24 +46,24 @@ If you are a first time contributor to OpenJFX, welcome! Please do the following
45
46
46
47
* Read the code review policies
47
48
48
-
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.
49
+
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](#new-features--api-additions) section at the end of this guide.
49
50
50
51
* File a bug in JBS for every pull request
51
52
52
-
A [JBS](https://bugs.openjdk.java.net) bug ID is needed for every
53
+
A unique [JBS](https://bugs.openjdk.java.net) bug ID is needed for every
53
54
pull request. If there isn't already a bug filed in JBS, then please
54
55
file one at [bugreport.java.com](https://bugreport.java.com/).
55
56
A developer with an active OpenJDK ID can file a bug directly in JBS.
56
57
57
-
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.
58
+
TIP: A GitHub pull request (PR) should not be the first time we hear about your proposed change to OpenJFX. Unless clearly identified as a `Draft`or work-in-progress (WIP), as described in the following section, 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.
58
59
59
60
### Submitting your changes via a pull request
60
61
61
62
Once your changes and tests are ready to submit for review:
62
63
63
64
1. Test your changes
64
65
65
-
Run the test suite to make sure that nothing is broken.
66
+
Run the test suite to make sure that nothing is broken. For most code changes, you need to provide new tests covering those changes. At least one of the new tests should fail before your proposed fix and pass after your proposed fix.
66
67
67
68
2. Rebase your changes
68
69
@@ -72,9 +73,11 @@ Once your changes and tests are ready to submit for review:
72
73
73
74
Push your local changes to your forked copy of the repository and
74
75
[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
76
+
The title of the pull request must start with the 7-digit JBS bug id,
77
+
followed by a colon (`:`), then a space,
78
+
and finally the bug title as taken from JBS. This title must _exactly_ match
79
+
the JBS bug, else the Skara bot will warn about the mismatch and block integration.
80
+
You should include
78
81
additional details about your change in the Description of the pull
79
82
request. For example, the following is a valid pull request title:
80
83
@@ -85,20 +88,15 @@ Once your changes and tests are ready to submit for review:
85
88
The Skara bot will then run `jcheck` on the server to verify the format
86
89
of the PR title and check for whitespace errors. Once that passes,
87
90
it will automatically send a Request For Review (RFR) email to the
The Skara bot will automatically resolve the JBS issue as "Fixed"
170
+
so there is no need to manually resolve it.
171
+
172
+
173
+
New features / API additions
174
+
----------------------------
175
+
176
+
Adding a new feature to OpenJFX requires us to consider what it means to support that API forever; we take compatibility seriously.
177
+
The main idea is to think in terms of "stewardship" when evolving the JavaFX API. This will require significant effort on your part.
178
+
It begins before you submit a pull request for review, and continues after the new feature is integrated.
179
+
With that in mind, here are the needed steps to get a new feature into JavaFX.
180
+
181
+
1. Discuss the proposed feature on the [openjfx-dev](https://mail.openjdk.java.net/mailman/listinfo/openjfx-dev) mailing list.
182
+
You should start with _why_ you think
183
+
adding the API to the core of JavaFX is a good and useful addition for multiple applications (not just your own)
184
+
and for the evolution of the JavaFX UI Toolkit. Part of this is to see whether the Project Leads and Reviewers
185
+
are generally supportive of the idea, as well as to see whether other developers have any ideas as to whether
186
+
and how it would be useful in their applications. We want to make sure that the new feature fits in with the
187
+
existing API and will move the API forward in a direction we want to go. We need to ensure that the value
188
+
proposition of the new feature justifies the investment, which goes well beyond the initial cost of developing it.
189
+
Presuming that the feature meets the cost / benefit assessment (including opportunity cost), then discussion can
190
+
proceed to the API.
191
+
192
+
2. Discuss the API needed to provide the feature. While this can't always be completely separated from its
193
+
implementation, it is the public API itself that is important to nail down and get right. While we don't currently
194
+
use the formal JEP process as is done for larger JDK features, the [JEP template](http://openjdk.java.net/jeps/2)
195
+
provides some ideas to consider when proposing an API, such as a summary of the changes, goals, motivation, testing,
196
+
dependencies, etc. A Draft (or WIP) pull request can be useful for illustrative purposes as long as the focus is on the public API.
197
+
If there are trade-offs to be made in the implementation, or different implementation approaches that you might take,
198
+
this is a good time to discuss it. Once this step is far enough along that there is general agreement as to the API,
199
+
then it's time to focus on the implementation.
200
+
201
+
3. Submit a review of your proposed implementation. As noted in the
202
+
[New features / API additions](https://wiki.openjdk.java.net/display/OpenJFX/Code+Reviews#CodeReviews-NewFeaturesC.Newfeatures/APIadditions.)
203
+
section of the Code Review Policies doc, we also need a [CSR](https://wiki.openjdk.java.net/display/csr/Main), which documents the API change and its approval.
204
+
The CSR can be reviewed in parallel. Changes in the API that arise during the review need to be reflected in the CSR, meaning
205
+
that the final review / approval of the CSR usually happens late in the review cycle.
206
+
You can avoid extra work by waiting to submit the CSR until the API is agreed upon and the code review for the documentation is reasonably far along.
207
+
208
+
TIP: a pull request is _not_ the starting point, since that skips the first two important steps and jumps right into
209
+
"given this new feature, and an API definition that specifies it, please review my proposed implementation".
210
+
211
+
Coding style and testing guidelines
188
212
------------------------------------------
189
213
190
-
JDK 11 (at a minimum) is required to build OpenJFX. You must have a JDK 11 installation
191
-
with the environment variable `JAVA_HOME` referencing the path to Java home for
192
-
your JDK 11 installation. By default, tests use the same runtime as `JAVA_HOME`.
193
-
Currently OpenJFX builds are running on JDK 11 (recommended) and JDK 12.
194
-
195
-
It is possible to develop in any major Java IDE (Eclipse, IntelliJ, NetBeans). IDEs can automatically configure projects based on Gradle setup.
196
-
197
214
The following formatting rules are enforced for source code files by
198
215
`git jcheck`, which is run by the Skara bot:
199
216
200
-
* Use Unix-style (LF) line endings not DOS-style (CRLF)
217
+
* Use Unix-style (LF) line endings, not DOS-style (CRLF)
201
218
* Do not use TAB characters (exception: Makefiles can have TABS)
202
219
* No trailing spaces
203
220
* No files with execute permission
@@ -207,10 +224,21 @@ Please also follow these formatting guidelines:
207
224
* Java indent is 4 spaces
208
225
* Line width is no more than 120 characters
209
226
* The rest is left to Java coding standards
210
-
* Disable “auto-format on save” to prevent unnecessary format changes. This makes reviews much harder as it generates unnecessary formatting changes. If your IDE supports formatting only modified chunks that is fine to do.
211
-
* Wildcard imports (`import foo.bar.baz.*`) are forbidden and may cause the build to fail. Please attempt to tame your IDE so it doesn't make them and please send a PR against this document with instructions for your IDE if it doesn't contain them.
227
+
* Avoid making changes that are unrelated to the bug you are fixing. This includes fixing minor errors such as warnings, spacing / indentation, spelling errors, etc, in code that you aren't otherwise modifying as part of your fix.
228
+
* Disable “auto-format on save” to prevent your IDE from making unnecessary formatting changes. This makes reviews much harder as it generates unnecessary diffs. If your IDE supports formatting only modified chunks, that is fine to do.
229
+
* Wildcard imports – for example, `import java.util.*;` – are forbidden and may cause the build to fail. Please attempt to configure your IDE so it doesn't generate wildcard imports. An exception to this rule is that wildcard static imports in test classes are allowed, for example, `import static org.junit.Assert.*;`.
212
230
* Don't worry too much about import order. Try not to change it but don't worry about fighting your IDE to stop it from doing so.
213
231
232
+
### Building and testing
233
+
234
+
JDK 11 (at a minimum) is required to build OpenJFX. You must have the JDK
235
+
installed on your system
236
+
with the environment variable `JAVA_HOME` referencing the path to Java home for
237
+
your JDK installation. By default, tests use the same runtime as `JAVA_HOME`.
238
+
Currently OpenJFX will build and run on JDK 11 through JDK 18. JDK 17 is recommended.
239
+
240
+
It is possible to develop in any major Java IDE (Eclipse, IntelliJ, NetBeans). IDEs can automatically configure projects based on Gradle setup.
241
+
214
242
OpenJFX uses Gradle for its build. Before submitting your changes, run the test suite to make sure that nothing is broken, with:
215
243
216
244
```sh
@@ -223,5 +251,7 @@ If you are changing anything that might possibly affect rendering, you should ru
223
251
bash ./gradlew -PFULL_TEST=true -PUSE_ROBOT=true all test
224
252
```
225
253
254
+
If you don't build WebKit (using the `-PCOMPILE_WEBKIT=true` option), you are likely to get test failures when running the web tests. See the [Web Testing](WEBKIT-MEDIA-STUBS.md) page for information on how to address this.
255
+
226
256
Even more documentation on OpenJFX projects and its build system can be found on the
0 commit comments