*/
@Override
public void sawOpcode(int seen) {
if (seen == GETSTATIC) {
XField f = getXFieldOperand();
if (pendingBugs.containsKey(f)) {
if (!isLocked()) {
reporter.reportBug(pendingBugs.remove(f));
}
}
}
// we are only interested in method calls
if (seen != INVOKEVIRTUAL) {
return;
}
try {
@SlashedClassName String className = getClassConstantOperand();
if (className.startsWith("[")) {
// Ignore array classes
return;
}
ClassDescriptor cDesc = DescriptorFactory.createClassDescriptor(className);
// if it is not compatible with Calendar or DateFormat, we are not
// interested anymore
boolean isCalendar = subtypes2.isSubtype(cDesc, calendarType);
boolean isDateFormat = subtypes2.isSubtype(cDesc, dateFormatType);
if (!isCalendar && !isDateFormat) {
return;
}
// determine the number of arguments the method expects
int numArguments = getNumberArguments(getSigConstantOperand());
// go back on the stack to find what the receiver of the method is
OpcodeStack.Item invokedOn = stack.getStackItem(numArguments);
XField field = invokedOn.getXField();
// find out, if the field is static. if not, we are not interested
// anymore
if (field == null || !field.isStatic()) {
return;
}
if (getMethodName().equals("<clinit>") && field.getClassName().equals(getDottedClassName())) {
return;
}
String invokedName = getNameConstantOperand();
if (invokedName.startsWith("get")) {
return;
}
if (invokedName.equals("equals") && numArguments == 1) {
OpcodeStack.Item passedAsArgument = stack.getStackItem(0);
field = passedAsArgument.getXField();
if (field == null || !field.isStatic()) {
return;
}
}
if (!SystemProperties.getBoolean(PROP_SKIP_SYNCHRONIZED_CHECK)) {