|
| 1 | +package generatedtest; |
| 2 | + |
| 3 | +import org.springframework.beans.PropertyValue; |
| 4 | + |
| 5 | + |
| 6 | +public class Test { |
| 7 | + Object getMapKey(Object container) { |
| 8 | + return null; |
| 9 | + } |
| 10 | + |
| 11 | + Object getMapValue(Object container) { |
| 12 | + return null; |
| 13 | + } |
| 14 | + |
| 15 | + Object newWithMapKey(Object element) { |
| 16 | + return null; |
| 17 | + } |
| 18 | + |
| 19 | + Object newWithMapValue(Object element) { |
| 20 | + return null; |
| 21 | + } |
| 22 | + |
| 23 | + Object source() { |
| 24 | + return null; |
| 25 | + } |
| 26 | + |
| 27 | + void sink(Object o) {} |
| 28 | + |
| 29 | + public void test() { |
| 30 | + // @formatter:off |
| 31 | + // "org.springframework.beans;PropertyValue;false;;(String,Object);;Argument[0];MapKey of Argument[-1];value", |
| 32 | + { |
| 33 | + PropertyValue v = new PropertyValue((String) source(), null); |
| 34 | + sink(newWithMapKey(v)); // $hasValueFlow |
| 35 | + sink(newWithMapValue(v)); // Safe |
| 36 | + } |
| 37 | + // "org.springframework.beans;PropertyValue;false;;(String,Object);;Argument[1];MapValue of Argument[-1];value", |
| 38 | + { |
| 39 | + PropertyValue v = new PropertyValue("", source()); |
| 40 | + sink(newWithMapKey(v)); // Safe |
| 41 | + sink(newWithMapValue(v)); // $hasValueFlow |
| 42 | + } |
| 43 | + // "org.springframework.beans;PropertyValue;false;;(PropertyValue);;Argument[0];Argument[-1];value", |
| 44 | + { |
| 45 | + PropertyValue v1 = new PropertyValue((String) source(), null); |
| 46 | + PropertyValue v2 = new PropertyValue(v1); |
| 47 | + sink(newWithMapKey(v2)); // $hasValueFlow |
| 48 | + sink(newWithMapValue(v2)); // Safe |
| 49 | + PropertyValue v3 = new PropertyValue("", source()); |
| 50 | + PropertyValue v4 = new PropertyValue(v3); |
| 51 | + sink(newWithMapKey(v4)); // Safe |
| 52 | + sink(newWithMapValue(v4)); // $hasValueFlow |
| 53 | + } |
| 54 | + // "org.springframework.beans;PropertyValue;false;;(PropertyValue,Object);;MapKey of Argument[0];MapKey of Argument[-1];value", |
| 55 | + // "org.springframework.beans;PropertyValue;false;getName;;;MapKey of Argument[-1];ReturnValue;value", |
| 56 | + // "org.springframework.beans;PropertyValue;false;getValue;;;MapValue of Argument[-1];ReturnValue;value", |
| 57 | + // "org.springframework.beans;PropertyValues;true;getPropertyValue;;;MapValue of Argument[-1];ReturnValue;value", |
| 58 | + // "org.springframework.beans;PropertyValues;true;getPropertyValues;;;Element of Argument[-1];ArrayElement of ReturnValue;value", |
| 59 | + // "org.springframework.beans;MutablePropertyValues;true;add;(String,Object);;Argument[0];MapKey of Element of Argument[-1];value", |
| 60 | + // "org.springframework.beans;MutablePropertyValues;true;add;(String,Object);;Argument[0];MapKey of Element of ReturnValue;value", |
| 61 | + // "org.springframework.beans;MutablePropertyValues;true;add;(String,Object);;Argument[1];MapValue of Element of Argument[-1];value", |
| 62 | + // "org.springframework.beans;MutablePropertyValues;true;add;(String,Object);;Argument[1];MapValue of Element of ReturnValue;value", |
| 63 | + // "org.springframework.beans;MutablePropertyValues;true;addPropertyValue;(PropertyValue);;Argument[0];Element of Argument[-1];value", |
| 64 | + // "org.springframework.beans;MutablePropertyValues;true;addPropertyValue;(PropertyValue);;Argument[0];Element of ReturnValue;value", |
| 65 | + // "org.springframework.beans;MutablePropertyValues;true;addPropertyValue;(String,Object);;Argument[0];MapKey of Element of Argument[-1];value", |
| 66 | + // "org.springframework.beans;MutablePropertyValues;true;addPropertyValue;(String,Object);;Argument[1];MapValue of Element of Argument[-1];value", |
| 67 | + // "org.springframework.beans;MutablePropertyValues;true;addPropertyValues;(Map);;MapKey of Argument[0];MapKey of Element of Argument[-1];value", |
| 68 | + // "org.springframework.beans;MutablePropertyValues;true;addPropertyValues;(Map);;MapKey of Argument[0];MapKey of Element of ReturnValue;value", |
| 69 | + // "org.springframework.beans;MutablePropertyValues;true;addPropertyValues;(Map);;MapValue of Argument[0];MapValue of Element of Argument[-1];value", |
| 70 | + // "org.springframework.beans;MutablePropertyValues;true;addPropertyValues;(Map);;MapValue of Argument[0];MapValue of Element of ReturnValue;value", |
| 71 | + // "org.springframework.beans;MutablePropertyValues;true;addPropertyValues;(PropertyValues);;MapKey of Element of Argument[0];MapKey of Element of Argument[-1];value", |
| 72 | + // "org.springframework.beans;MutablePropertyValues;true;addPropertyValues;(PropertyValues);;MapKey of Element of Argument[0];MapKey of Element of ReturnValue;value", |
| 73 | + // "org.springframework.beans;MutablePropertyValues;true;addPropertyValues;(PropertyValues);;MapValue of Element of Argument[0];MapValue of Element of Argument[-1];value", |
| 74 | + // "org.springframework.beans;MutablePropertyValues;true;addPropertyValues;(PropertyValues);;MapValue of Element of Argument[0];MapValue of Element of ReturnValue;value", |
| 75 | + // "org.springframework.beans;MutablePropertyValues;true;get;;;MapValue of Element of Argument[-1];ReturnValue;value", |
| 76 | + // "org.springframework.beans;MutablePropertyValues;true;getPropertyValue;;;Element of Argument[-1];ReturnValue;value", |
| 77 | + // "org.springframework.beans;MutablePropertyValues;true;getPropertyValueList;;;Element of Argument[-1];Element of ReturnValue;value", |
| 78 | + // "org.springframework.beans;MutablePropertyValues;true;getPropertyValues;;;Element of Argument[-1];ArrayElement of ReturnValue;value", |
| 79 | + // "org.springframework.beans;MutablePropertyValues;true;setPropertyValueAt;;;Argument[0];Element of Argument[-1];value" |
| 80 | + // @formatter:on |
| 81 | + |
| 82 | + } |
| 83 | +} |
0 commit comments