@@ -72,6 +72,14 @@ public static enum ScalingType {
7272 public static final String URL_HANDLER_URLFETCH = "urlfetch" ;
7373 public static final String URL_HANDLER_NATIVE = "native" ;
7474
75+ // Runtime ids.
76+ private static final String JAVA_7_RUNTIME_ID = "java7" ;
77+ // Should accept java8* for multiple variations of Java8.
78+ private static final String JAVA_8_RUNTIME_ID = "java8" ;
79+ // This was used for Java6, but now is used only for Managed VMs,
80+ // not for standard editiom.
81+ private static final String JAVA_RUNTIME_ID = "java" ;
82+
7583 private String appId ;
7684
7785 private String majorVersionId ;
@@ -85,7 +93,7 @@ public static enum ScalingType {
8593 private final ManualScaling manualScaling ;
8694 private final BasicScaling basicScaling ;
8795
88- private String sourceLanguage ;
96+ private String runtime ;
8997 private boolean sslEnabled = true ;
9098 private boolean useSessions = false ;
9199 private boolean asyncSessionPersistence = false ;
@@ -235,12 +243,21 @@ public void setMajorVersionId(String majorVersionId) {
235243 this .majorVersionId = majorVersionId ;
236244 }
237245
238- public String getSourceLanguage () {
239- return this .sourceLanguage ;
246+ public String getRuntime () {
247+ if (runtime != null ) {
248+ return runtime ;
249+ }
250+ // The new env:flex means java, not java7:
251+ if (isFlexible ()) {
252+ runtime = JAVA_RUNTIME_ID ;
253+ } else {
254+ runtime = JAVA_7_RUNTIME_ID ;
255+ }
256+ return runtime ;
240257 }
241258
242- public void setSourceLanguage (String sourceLanguage ) {
243- this .sourceLanguage = sourceLanguage ;
259+ public void setRuntime (String runtime ) {
260+ this .runtime = runtime ;
244261 }
245262
246263 public String getModule () {
@@ -573,8 +590,8 @@ public String toString() {
573590 + ", majorVersionId='"
574591 + majorVersionId
575592 + '\''
576- + ", sourceLanguage ='"
577- + sourceLanguage
593+ + ", runtime ='"
594+ + runtime
578595 + '\''
579596 + ", service='"
580597 + service
@@ -749,9 +766,9 @@ public boolean equals(Object o) {
749766 : that .majorVersionId != null ) {
750767 return false ;
751768 }
752- if (sourceLanguage != null
753- ? !sourceLanguage .equals (that .sourceLanguage )
754- : that .sourceLanguage != null ) {
769+ if (runtime != null
770+ ? !runtime .equals (that .runtime )
771+ : that .runtime != null ) {
755772 return false ;
756773 }
757774 if (publicRoot != null ? !publicRoot .equals (that .publicRoot ) : that .publicRoot != null ) {
@@ -853,7 +870,7 @@ public int hashCode() {
853870 result = 31 * result + (userPermissions != null ? userPermissions .hashCode () : 0 );
854871 result = 31 * result + (appId != null ? appId .hashCode () : 0 );
855872 result = 31 * result + (majorVersionId != null ? majorVersionId .hashCode () : 0 );
856- result = 31 * result + (sourceLanguage != null ? sourceLanguage .hashCode () : 0 );
873+ result = 31 * result + (runtime != null ? runtime .hashCode () : 0 );
857874 result = 31 * result + (service != null ? service .hashCode () : 0 );
858875 result = 31 * result + (instanceClass != null ? instanceClass .hashCode () : 0 );
859876 result = 31 * result + automaticScaling .hashCode ();
0 commit comments