@@ -49,13 +49,12 @@ public static Configuration getConfiguration() {
4949 * <p>
5050 * This method supports the "offline" mode which assumes that there is
5151 * no Internet connectivity available.
52- *
53- * @param file
5452 *
55- * @return
53+ * @param file - Find a file
54+ * @return string
5655 */
5756 public static String getDownloadFilesBaseUrl (String file ) {
58- if (configuration .getBoolean ("offline.enabled" ) == true ) {
57+ if (configuration .getBoolean ("offline.enabled" )) {
5958 return configuration .getString ("offline.downloadfiles.baseurl" ) + (file .startsWith ("/" ) ? "" : "/" ) + file ;
6059 } else {
6160 return configuration .getString ("downloadfiles.baseurl" ) + (file .startsWith ("/" ) ? "" : "/" ) + file ;
@@ -64,15 +63,15 @@ public static String getDownloadFilesBaseUrl(String file) {
6463
6564 public static boolean isOauthEnabled (String oauthProvider ) {
6665 // Disable Oauth if we are running offline
67- if (configuration .getBoolean ("offline.enabled" ) == true ) {
68- return false ;
66+ if (configuration .getBoolean ("offline.enabled" )) {
67+ return false ;
6968 } else {
7069 return configuration .getBoolean ("oauth." + oauthProvider + ".enabled" , true );
7170 }
7271 }
73-
72+
7473 //
75-
74+
7675 /**
7776 * Obtain the state of experimental menu items.
7877 * <p>
@@ -81,25 +80,25 @@ public static boolean isOauthEnabled(String oauthProvider) {
8180 * contained in the application properties file will trigger the menu
8281 * system to expose experimental menu items. If this option is off or
8382 * missing, the experimental menu items will be disabled.
84- *
85- * @param state
86- * @return
83+ *
84+ * @param state - True if experimental menu is enabled
85+ * @return boolean
8786 */
8887 public static boolean isExperimentalMenu (Boolean state ) {
8988 try {
90- if (configuration .getBoolean ("experimental.menu" ) == true ) {
89+ if (state && configuration .getBoolean ("experimental.menu" )) {
9190 return true ;
9291 }
9392 } catch (java .util .NoSuchElementException ex ) {
9493 return false ;
9594 }
96-
95+
9796 return false ;
9897 }
9998
10099 public static boolean isCoppaRestricted () {
101100 LoggerFactory .getLogger (Properties .class ).info ("Checking for COPPA restrictions" );
102-
101+
103102 // Get the current user context
104103 User user = BlocklyPropSecurityUtils .getUserInfo ();
105104 LoggerFactory .getLogger (Properties .class ).info ("Completed call to getUserInfo()" );
@@ -110,12 +109,12 @@ public static boolean isCoppaRestricted() {
110109 LoggerFactory .getLogger (Properties .class ).info ("Anonymous user. No COPPA restrictions" );
111110 return false ;
112111 }
113-
114- // LoggerFactory.getLogger(Properties.class).info("User screen name is: {}.", user.getScreenname());
115- // LoggerFactory.getLogger(Properties.class).info("User COPPA requirement: {}.", user.isCoppaEligible());
116- // LoggerFactory.getLogger(Properties.class).info("User COPPA month: {}.", user.getBirthMonth());
117- // LoggerFactory.getLogger(Properties.class).info("User COPPA year: {}.", user.getBirthYear());
118-
112+
113+ LoggerFactory .getLogger (Properties .class ).info ("User screen name is: {}." , user .getScreenname ());
114+ LoggerFactory .getLogger (Properties .class ).info ("User COPPA requirement: {}." , user .isCoppaEligible ());
115+ LoggerFactory .getLogger (Properties .class ).info ("User COPPA month: {}." , user .getBirthMonth ());
116+ LoggerFactory .getLogger (Properties .class ).info ("User COPPA year: {}." , user .getBirthYear ());
117+
119118 return user .isCoppaEligible ();
120119 }
121120}
0 commit comments