Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'remotes/origin/master' into xml-parser-…
…refactoring # Conflicts: # xml-parser/src/main/java/net/adoptopenjdk/icedteaweb/xmlparser/MalformedXMLParser.java
- Loading branch information
1 parent
266b11a
commit aafb870
Showing
133 changed files
with
2,144 additions
and
1,420 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Contributor Covenant Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to creating a positive environment include: | ||
|
||
* Using welcoming and inclusive language | ||
* Being respectful of differing viewpoints and experiences | ||
* Gracefully accepting constructive criticism | ||
* Focusing on what is best for the community | ||
* Showing empathy towards other community members | ||
|
||
Examples of unacceptable behavior by participants include: | ||
|
||
* The use of sexualized language or imagery and unwelcome sexual attention or advances | ||
* Trolling, insulting/derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or electronic address, without explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a professional setting | ||
|
||
## Our Responsibilities | ||
|
||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at hendrik.ebbers@karakun.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. | ||
|
||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] | ||
|
||
[homepage]: http://contributor-covenant.org | ||
[version]: http://contributor-covenant.org/version/1/4/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Contributing to IcedTeaWeb | ||
|
||
As an open source project, IcedTeaWeb welcomes contributions of many forms. | ||
|
||
## Bug reporting | ||
|
||
Please use the [issue tracker on GitHub][1]. | ||
|
||
Please make sure to check these notes whenever you create an issue for IcedTeaWeb: | ||
- If you are not using the latest version of IcedTeaWeb please add the used version in the description | ||
- Please give us some information about the infrastructure that you are using. Examples: AdoptOpenJDK Version 11.0.2 on Win10 | ||
- In case of an error / bug it's always helpful to add the error log | ||
|
||
[1]: https://github.com/AdoptOpenJDK/icedtea-web/issues | ||
|
||
## Patches submission | ||
|
||
Patches are welcome as [pull requests on GitHub][2] | ||
|
||
[2]: https://github.com/AdoptOpenJDK/icedtea-web/pulls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
# Java Style Guide | ||
This guide defines the coding standards for source code in the Java™ Programming Language for IcedTeaWeb. | ||
|
||
## Why do we need this | ||
When writing source code one main goal should be to create classes and code blocks that are easy to read, understand and maintain. | ||
By doing so bugs can be found much easier in source code and new developers will understand the functionality of the code faster. | ||
This style guide contains common rules that are known by mostly all Java developers. | ||
|
||
## Source files | ||
All source files (*.java) must have case-sensitive name of the top-level class it contains. Source files are always encoded in UTF-8. If the file belongs to an open source project a licence header must be added to the top of the file. | ||
|
||
## Naming and declaration | ||
|
||
### Package names | ||
Package names are all lowercase, with consecutive words simply concatenated together (no underscores). For example, `com.example.deepspace`, | ||
not `com.example.deepSpace` or `com.example.deep_space`. | ||
|
||
### Class names | ||
Class names are written in UpperCamelCase. Test classes are named starting with the name of the class they are testing, and ending with | ||
`Test`. For example, `HashTest` or `HashIntegrationTest`. | ||
|
||
### Method names | ||
Method names are written in lowerCamelCase. | ||
|
||
### Constant names | ||
Constant names use CONSTANT_CASE: all uppercase letters, with each word separated from the next by a single underscore. Constants are static final fields whose contents are deeply immutable and whose methods have no detectable side effects. This includes primitives, Strings, immutable types, and immutable collections of immutable types. If any of the instance's observable state can change, it is not a constant. Merely intending to never mutate the object is not enough. | ||
|
||
### Non-constant field names | ||
Non-constant field names (static or otherwise) are written in lowerCamelCase. | ||
|
||
### Parameter names | ||
Parameter names are written in lowerCamelCase. One-character parameter names in public methods should be avoided. | ||
|
||
### Local variable names | ||
Local variable names are written in lowerCamelCase. Even when final and immutable, local variables are not considered to be constants, and should not be styled as constants. | ||
|
||
## Programming Practices | ||
|
||
### Declaration of variables | ||
Every variable declaration (field or local) declares only one variable: declarations such as `int a, b;` are not used. | ||
|
||
### Usage of @Override | ||
A method is marked with the @Override annotation whenever it is legal. This includes a class method overriding a superclass method, a class method implementing an interface method, and an interface method respecifying a superinterface method. | ||
|
||
### No wildcard imports | ||
Wildcard imports make the source of an imported class less clear. | ||
|
||
### Avoid assert | ||
We avoid the assert statement since it can be disabled at execution time. | ||
|
||
### Minimize visibility | ||
In a class API, you should support access to any methods and fields that you make accessible. Therefore, only expose what you intend the caller to use. This can be imperative when writing thread-safe code. | ||
|
||
### Favor immutability | ||
Mutable objects carry a burden - you need to make sure that those who are able to mutate it are not violating expectations of other users of the object, and that it's even safe for them to modify. Based on this the `final` keyword must be added to any field, paramater and variable if possible. | ||
|
||
Negative example: | ||
|
||
```java | ||
public class SpecificService { | ||
|
||
private String name; | ||
|
||
public SpecificService(String name) { | ||
this.name = name; | ||
ServiceProvider provider = new ServiceProvider(); | ||
provider.register(this); | ||
} | ||
} | ||
``` | ||
|
||
Good example: | ||
|
||
```java | ||
public final class SpecificService { | ||
|
||
private final String name; | ||
|
||
public SpecificService(final String name) { | ||
this.name = name; | ||
final ServiceProvider provider = new ServiceProvider(); | ||
provider.register(this); | ||
} | ||
} | ||
``` | ||
|
||
Next to general immutability all collections that are returned by classes should be immutable. If a collection should be | ||
mutated from the outside methods can be added to the class. | ||
|
||
Negative example: | ||
|
||
```java | ||
public class SpecificService { | ||
|
||
private List<String> names = new ArrayList(); | ||
|
||
public List<String> getNames() {return names;} | ||
|
||
public void setNames(List<String> names) {this.names = names;} | ||
|
||
} | ||
|
||
//somewhere else: | ||
SpecificService service = .... | ||
service.getNames().add("Duke"); | ||
|
||
``` | ||
|
||
Good example: | ||
|
||
```java | ||
public class SpecificService { | ||
|
||
private final List<String> names = new ArrayList(); | ||
|
||
public List<String> getNames() {return Collections.unmodifiableList(names);} | ||
|
||
public void addName(final String name) {this.names.add(name);} | ||
|
||
public void removeName(final String name) {this.names.remove(name);} | ||
|
||
} | ||
|
||
//somewhere else: | ||
final SpecificService service = .... | ||
service.addName("Duke"); | ||
|
||
// service.getNames().add("Duke"); <- This call would throw an exception now | ||
|
||
|
||
``` | ||
|
||
|
||
### Do null checks | ||
Each parameter, variable & field that is accessed after initalization / change must be directly checked for a `null` value. | ||
|
||
Example: | ||
|
||
```java | ||
public class Service { | ||
|
||
private Handler handler; | ||
|
||
public Service(final Handler handler) { | ||
this.handler = Objects.requireNonNull(handler); | ||
} | ||
|
||
public void setHandler(final Handler handler) { | ||
this.handler = Objects.requireNonNull(handler); | ||
} | ||
|
||
public void start() { | ||
handler.start(); | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
*************************************** | ||
** LGPLv2+ and GPLv2 with exceptions ** | ||
*************************************** | ||
|
||
Details: | ||
All newest files, unless claiming differently and all files inherited from GNU Classpath (mostly base of plugin) are GPL+Exceptions | ||
NetX code is GPL and LGPL only. |
Oops, something went wrong.