Reviewers: Ray Ryan,

Description:
Fix a potential bug in initialization found by findbugs


Please review this at http://gwt-code-reviews.appspot.com/325802/show

Affected files:
M bikeshed/src/com/google/gwt/sample/expenses/gwt/request/ExpensesKeyProcessor.java


Index: bikeshed/src/com/google/gwt/sample/expenses/gwt/request/ExpensesKeyProcessor.java
===================================================================
--- bikeshed/src/com/google/gwt/sample/expenses/gwt/request/ExpensesKeyProcessor.java (revision 7904) +++ bikeshed/src/com/google/gwt/sample/expenses/gwt/request/ExpensesKeyProcessor.java (working copy)
@@ -1,12 +1,12 @@
 /*
  * Copyright 2010 Google Inc.
- *
+ *
* Licensed 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
@@ -41,9 +41,10 @@

   private static Set<ExpensesKey<?>> get() {
     if (instance == null) {
-      instance = new HashSet<ExpensesKey<?>>();
-      instance.add(ReportKey.get());
-      instance.add(EmployeeKey.get());
+      HashSet<ExpensesKey<?>> newInstance = new HashSet<ExpensesKey<?>>();
+      newInstance.add(ReportKey.get());
+      newInstance.add(EmployeeKey.get());
+      instance = newInstance;
     }
     return instance;
   }


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

To unsubscribe, reply using "remove me" as the subject.

Reply via email to