This is an automated email from the ASF dual-hosted git repository.

joshtynjala pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/flex-flexunit.git


The following commit(s) were added to refs/heads/develop by this push:
     new 0c80e93  FlexUnit4AntTasks: parse Adobe AIR version including both 
major and minor
0c80e93 is described below

commit 0c80e93bfc72523b517e32e4ebc9216e65795f83
Author: Josh Tynjala <[email protected]>
AuthorDate: Thu Feb 19 16:35:13 2026 -0800

    FlexUnit4AntTasks: parse Adobe AIR version including both major and minor
    
    When the version number went into the double-digits, the minor part started 
getting ignored. This wasn't a huge issue because the minor part was usually 0. 
However, Harman started using minor versions again, like 33.1 and 51.2.
---
 .../ant/launcher/commands/player/AdlCommand.java   | 59 +++++++++++++---------
 1 file changed, 35 insertions(+), 24 deletions(-)

diff --git 
a/FlexUnit4AntTasks/src/org/flexunit/ant/launcher/commands/player/AdlCommand.java
 
b/FlexUnit4AntTasks/src/org/flexunit/ant/launcher/commands/player/AdlCommand.java
index a6fe7e8..a83ea94 100644
--- 
a/FlexUnit4AntTasks/src/org/flexunit/ant/launcher/commands/player/AdlCommand.java
+++ 
b/FlexUnit4AntTasks/src/org/flexunit/ant/launcher/commands/player/AdlCommand.java
@@ -1,19 +1,19 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.flexunit.ant.launcher.commands.player;
 
 import java.io.File;
@@ -116,21 +116,32 @@ public class AdlCommand extends DefaultPlayerCommand
 
    private double parseAdtVersionNumber( String versionString )
    {
-         double version;
+      double version;
 
       //AIR 2.6 and greater only returns the version number.
       if( versionString.startsWith("adt") )
       {
-          //Parse version number and return as int
-             int prefixIndex = versionString.indexOf("adt version \"");
-             version = Double.parseDouble(versionString.substring(prefixIndex 
+ 13, prefixIndex + 16));
-
-      }else
+         //Parse version number and return as int
+         int prefixIndex = versionString.indexOf("adt version \"");
+         version = Double.parseDouble(versionString.substring(prefixIndex + 
13, prefixIndex + 16));
+      }
+      else
       {
-         version = Double.parseDouble(versionString.substring(0, 3) );
+         // the version number typically contains four parts, but we need
+         // the first two only.
+         int endIndex = versionString.indexOf(".");
+         endIndex = versionString.indexOf(".", endIndex + 1);
+         if (endIndex == -1)
+         {
+            // this shouldn't happen, but if some specific version of adt
+            // reports a version number with two parts only, we'll fall back
+            // to the original behavior that parses exactly three characters
+            endIndex = 3;
+         }
+         version = Double.parseDouble(versionString.substring(0, endIndex));
       }
 
-         return version;
+      return version;
    }
 
    @Override

Reply via email to