Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lang] Enablement of the automatic generation of the equality test fu…
…nctions. In order to enable or disable the compiler's feature that automatically generates the equality test functions (equals and hashCode) from the declared fields, the following elements are added into the SARL compiler: * Configuration option for enabling or disabling the feature; * Update of the bactch compiler with a new command-line option; * Addition of a UI component within the Eclipse preferences; and * Addition of the `@NoEqualityTestFunctionsGeneration` for disabling the generation from the SARL source code. Signed-off-by: Stéphane Galland <galland@arakhne.org>
- Loading branch information
1 parent
c407c86
commit c1437c9
Showing
10 changed files
with
230 additions
and
51 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
45 changes: 45 additions & 0 deletions
45
...gins/io.sarl.lang.core/src/io/sarl/lang/annotation/NoEqualityTestFunctionsGeneration.java
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,45 @@ | ||
/* | ||
* $Id$ | ||
* | ||
* SARL is an general-purpose agent programming language. | ||
* More details on http://www.sarl.io | ||
* | ||
* Copyright (C) 2014-2018 the original authors or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.sarl.lang.annotation; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** Annotation for avoiding the automatic generation of the equality test functions. | ||
* | ||
* <p>The SARL compiler may be configured for generating the code of the equality test functions, i.e. | ||
* {@code equals()} and {@code hashCode()}, based on the type's fields. This annotation avoids the | ||
* generation of these functions in order to use the default Java definitions. | ||
* | ||
* @author $Author: sgalland$ | ||
* @version $FullVersion$ | ||
* @mavengroupid $GroupId$ | ||
* @mavenartifactid $ArtifactId$ | ||
* @since 0.8 | ||
*/ | ||
@Target({ElementType.TYPE, ElementType.FIELD}) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface NoEqualityTestFunctionsGeneration { | ||
// | ||
} |
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
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
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
1 change: 1 addition & 0 deletions
1
main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/preferences/messages.properties
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
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
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
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
Oops, something went wrong.