gnodet commented on code in PR #1194:
URL: https://github.com/apache/maven/pull/1194#discussion_r1253270018
##########
api/maven-api-settings/src/main/mdo/settings.mdo:
##########
@@ -535,6 +539,62 @@
<type>String</type>
</field>
</fields>
+ <codeSegments>
+ <codeSegment>
+ <version>1.0.0/1.3.0</version>
+ <code>
+ <![CDATA[
+ public boolean isActive() {
+ return (getActiveString() != null) ?
Boolean.parseBoolean(getActiveString()) : true;
+ }
+
+ public void setActive(boolean active) {
+ setActiveString(String.valueOf(active));
+ }
+
+ public int getPort() {
+ return (getPortString() != null) ? Integer.parseInt(getPortString()) :
8080;
+ }
+
+ public void setPort(int port) {
+ setPortString(String.valueOf(port));
+ }
+ ]]>
+ </code>
+ </codeSegment>
+ <codeSegment>
+ <version>2.0.0+</version>
+ <code>
+ <.
So the process is the following:
* parse user/project/global settings.xml
* merge them
* interpolate
* validate
This usually is done by Maven, so in this case it does make sense to
validate the port value during the validation phase. Not sure if we can add an
int storage, but if that's validate earlier, I would just remove the doc about
the `NumberFormatException` as this should not happen at runtime because the
builder would have rejected the mirror validation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]