Summary: We issue a thread safety warning on a class not marked ThreadSafe, when it has a super that is. This makes some sense. But, it will be nice to remind that a super is so maeked, else the mesg could seem out of context or surprising Reviewed By: sblackshear Differential Revision: D4075145 fbshipit-source-id: ebc2b83master
parent
3fb8801b6c
commit
ec45b44dfd
@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016 - present Facebook, Inc.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the BSD style license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree. An additional grant
|
||||||
|
* of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
*/
|
||||||
|
class ExtendsThreadSafeExample extends ThreadSafeExample{
|
||||||
|
|
||||||
|
Integer field;
|
||||||
|
|
||||||
|
(* Presently,we will warn not just on overwridden methods from
|
||||||
|
@ThreadSafe class, but potentially on other methods in subclass *)
|
||||||
|
public void newmethodBad() {
|
||||||
|
field = 22;
|
||||||
|
}
|
||||||
|
|
||||||
|
(* Bad now that it's overridden *)
|
||||||
|
public void tsOK() {
|
||||||
|
field = 44;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in new issue