Add extension support to InspectorSonarPlugin

Summary:
This mirrors the extension support added to the desktop plugin and allows people to dynamically
add extension commands

Reviewed By: danielbuechele

Differential Revision: D8691167

fbshipit-source-id: 60136b960f8bbdfa42b2077d1f5f7b391fc44443
This commit is contained in:
Hilal Alsibai
2018-07-03 16:25:28 -07:00
committed by Facebook Github Bot
parent 44f561a683
commit e6fa377d75
3 changed files with 60 additions and 16 deletions

View File

@@ -13,7 +13,9 @@ import java.util.HashMap;
import java.util.Map;
import javax.annotation.Nullable;
class ObjectTracker {
public class ObjectTracker {
ObjectTracker() {}
private final Map<String, WeakReference<Object>> mObjects = new HashMap<>();
void put(String id, Object obj) {
@@ -21,7 +23,7 @@ class ObjectTracker {
}
@Nullable
Object get(String id) {
public Object get(String id) {
final WeakReference<Object> weakObj = mObjects.get(id);
if (weakObj == null) {
return null;