Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 7f33045

Browse files
committed
Catch up with latest internal repository changes with 1.9.40.
1 parent d8753eb commit 7f33045

File tree

2 files changed

+34
-14
lines changed

2 files changed

+34
-14
lines changed

appengine-managed-runtime/src/main/java/com/google/apphosting/utils/config/AppEngineWebXml.java

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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();

appengine-managed-runtime/src/main/java/com/google/apphosting/utils/config/AppEngineWebXmlProcessor.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,14 @@ private void processSecondLevelNode(Element elt, AppEngineWebXml appEngineWebXml
136136
case "application":
137137
processApplicationNode(elt, appEngineWebXml);
138138
break;
139+
case "runtime":
140+
processRuntimeNode(elt, appEngineWebXml);
141+
break;
139142
case "version":
140143
processVersionNode(elt, appEngineWebXml);
141144
break;
142145
case "source-language":
143-
processSourceLanguageNode(elt, appEngineWebXml);
146+
// Obsolete, ignore.
144147
break;
145148
case "module":
146149
moduleNodeFound = true;
@@ -242,8 +245,8 @@ private void processVersionNode(Element node, AppEngineWebXml appEngineWebXml) {
242245
appEngineWebXml.setMajorVersionId(XmlUtils.getText(node));
243246
}
244247

245-
private void processSourceLanguageNode(Element node, AppEngineWebXml appEngineWebXml) {
246-
appEngineWebXml.setSourceLanguage(XmlUtils.getText(node));
248+
private void processRuntimeNode(Element node, AppEngineWebXml appEngineWebXml) {
249+
appEngineWebXml.setRuntime(XmlUtils.getText(node));
247250
}
248251

249252
private void processModuleNode(Element node, AppEngineWebXml appEngineWebXml) {

0 commit comments

Comments
 (0)