8184239: Fix broken nashorn/samples
authorsdama
Thu, 13 Jul 2017 16:51:45 +0530
changeset 45898 f66344672e6c
parent 45871 878e21603932
child 45899 2bd03e968d2d
8184239: Fix broken nashorn/samples Summary: Fixed broken nashorn samples Reviewed-by: sundar, hannesw, jlaskey Contributed-by: srinivas.dama@oracle.com
nashorn/samples/barchart_weather.js
nashorn/samples/datepick.js
nashorn/samples/jsonviewer.js
--- a/nashorn/samples/barchart_weather.js	Thu Aug 24 16:29:13 2017 +0200
+++ b/nashorn/samples/barchart_weather.js	Thu Jul 13 16:51:45 2017 +0530
@@ -60,7 +60,7 @@
 }
 
 // change URL for your city here!
-var url = "http://api.openweathermap.org/data/2.5/forecast?q=chennai,india&units=metric&mode=json";
+var url = "http://api.openweathermap.org/data/2.5/forecast?q=chennai,india&units=metric&mode=json&appid=9b2982987c080ae88d81f081dcb129e8";
 
 // download JSON document and parse
 var json = readTextFromURL(url);
--- a/nashorn/samples/datepick.js	Thu Aug 24 16:29:13 2017 +0200
+++ b/nashorn/samples/datepick.js	Thu Jul 13 16:51:45 2017 +0530
@@ -37,6 +37,7 @@
 }
 
 load("fx:controls.js");
+var Scene = Java.type("javafx.scene.Scene");
 
 function start(stage) {
     var picker = new DatePicker();
--- a/nashorn/samples/jsonviewer.js	Thu Aug 24 16:29:13 2017 +0200
+++ b/nashorn/samples/jsonviewer.js	Thu Jul 13 16:51:45 2017 +0530
@@ -103,7 +103,7 @@
     return item;
 }
 
-var DEFAULT_URL = "http://api.openweathermap.org/data/2.5/forecast/daily?q=Chennai&mode=json&units=metric&cnt=7`";
+var DEFAULT_URL = "http://api.openweathermap.org/data/2.5/forecast?q=chennai,india&units=metric&mode=json&appid=9b2982987c080ae88d81f081dcb129e8";
 
 var url = arguments.length == 0? DEFAULT_URL : arguments[0];
 var obj = JSON.parse(readTextFromURL(url));