Strange creation of $1 class from source containing no inner classes
I have an abstract class containing no inner classes, that has a $1 class created when I compile it.
The basic structure of the class is as follows:
publicabstractclass ManagedObjectImplimplements InternalManagedObject{
protected Set<ManagedObjectImpl> associatedMOs =null;
protected ManagedObjectImpl(){
}
protected ManagedObjectImpl(String name,byte[] attributeBitmap){
assertnull != name :"Name not specified";
assertnull != attributeBitmap :"No Bitmap supplied";
moName = name;
moFDN = getType() +'=' + name;
moAttributeBits = attributeBitmap;
if (thisinstanceof MIBRootImpl){
moMIBRoot = (MIBRootImpl)this;
}
long time = Time.getCurrentTime();
moTimestampCreated = time;
moTimestampChanged = time;
// mark as being started
beingCreated =true;
}
}
As can be seen, there are no inner classes of any description. Is there any other context in which an anonymous class can be created when there is no inner classes?
When I run javap with the "-c" switch on the $1 class, I get the following:
C:\ecordav_cs_view\cif2_cs\nms_cif_cs\cslib\build\classes\instrumented\integration\bare\com\xxx\nms\cif\cs\managedobject>javap -c ManagedObjectImpl$1
Compiled from "ManagedObjectImpl.java"
class com.xxx.nms.cif.cs.managedobject.ManagedObjectImpl$1 extends java.lang.Object{
static final int[] $SwitchMap$com$xxx$nms$cif$cslib$PlanningState;
static {};
Code:
0:invokestatic#1; //Method com/xxx/nms/cif/cslib/PlanningState.values:()[Lcom/xxx/nms/cif/cslib/PlanningState;
3:arraylength
4:newarray int
6:putstatic#2; //Field $SwitchMap$com$xxx$nms$cif$cslib$PlanningState:[I
9:getstatic#2; //Field $SwitchMap$com$xxx$nms$cif$cslib$PlanningState:[I
12: getstatic#3; //Field com/xxx/nms/cif/cslib/PlanningState.UNPLANNED:Lcom/xxx/nms/cif/cslib/PlanningState;
15: invokevirtual#4; //Method com/xxx/nms/cif/cslib/PlanningState.ordinal:()I
18: iconst_1
19: iastore
20: goto24
23: astore_0
24: getstatic#2; //Field $SwitchMap$com$xxx$nms$cif$cslib$PlanningState:[I
27: getstatic#6; //Field com/xxx/nms/cif/cslib/PlanningState.CREATED:Lcom/xxx/nms/cif/cslib/PlanningState;
30: invokevirtual#4; //Method com/xxx/nms/cif/cslib/PlanningState.ordinal:()I
33: iconst_2
34: iastore
35: goto39
38: astore_0
39: getstatic#2; //Field $SwitchMap$com$xxx$nms$cif$cslib$PlanningState:[I
42: getstatic#7; //Field com/xxx/nms/cif/cslib/PlanningState.CHANGED:Lcom/xxx/nms/cif/cslib/PlanningState;
45: invokevirtual#4; //Method com/xxx/nms/cif/cslib/PlanningState.ordinal:()I
48: iconst_3
49: iastore
50: goto54
53: astore_0
54: getstatic#2; //Field $SwitchMap$com$xxx$nms$cif$cslib$PlanningState:[I
57: getstatic#8; //Field com/xxx/nms/cif/cslib/PlanningState.DELETED:Lcom/xxx/nms/cif/cslib/PlanningState;
60: invokevirtual#4; //Method com/xxx/nms/cif/cslib/PlanningState.ordinal:()I
63: iconst_4
64: iastore
65: goto69
68: astore_0
69: return
Exception table:
fromto target type
92023Class java/lang/NoSuchFieldError
243538Class java/lang/NoSuchFieldError
395053Class java/lang/NoSuchFieldError
546568Class java/lang/NoSuchFieldError
}
ManagedObject is the following:
package com.xxx.nms.cif.cslib.managedobject;
import com.xxx.nms.cif.cslib.Action;
import com.xxx.nms.cif.cslib.PlanningState;
import com.xxx.nms.cif.cslib.UnplanScope;
import com.xxx.nms.cif.cslib.exception.*;
import com.xxx.nms.cif.cslib.mim.ClassDef;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
public interface ManagedObject {
String getName();
String getType();
ClassDef getClassDefinition();
String getRDN();
String getFDN();
String getDN();
ManagedObject getParent();
MIBRoot getRoot();
ManagedObject getChild(String rdn) throws TransactionException;
Collection<? extends ManagedObject> getChildren()
throws TransactionException;
Collection<? extends ManagedObject> getChildren(String type)
throws IllegalChildTypeException, TransactionException;
Collection<? extends ManagedObject> getChildren(String type, String filter)
throws NotAcceptedException, TransactionException;
Object getAttribute(String name) throws NotAcceptedException,
TransactionException;
Map<String, ? extends Object> getAttributes(String[] names)
throws NotAcceptedException, TransactionException;
Object setAttribute(String name, Object value) throws NotAcceptedException,
ProcessingFailureException, TransactionException;
void setAttributes(Map<String, ? extends Object> attrMap)
throws NotAcceptedException, ProcessingFailureException,
TransactionException;
void addAttributeItems(String name, Object value)
throws NotAcceptedException, ProcessingFailureException,
TransactionException;
void removeAttributeItems(String name, Object value)
throws NotAcceptedException, ProcessingFailureException,
TransactionException;
String[] getAssociationNames();
Collection<? extends ManagedObject> getAssociation(String assocName)
throws UnknownFieldException, TransactionException;
void addAssociation(String assocName, ManagedObject toObject)
throws NotAcceptedException, TransactionException;
void removeAssociation(String assocName, ManagedObject toObject)
throws UnknownFieldException, TransactionException;
void setAssociation(String assocname, Set<? extends ManagedObject> toMOs)
throws NotAcceptedException, TransactionException;
Map<String, ? extends Object> getValidAttributes(String[] attrNames)
throws NotAcceptedException, TransactionException,
ProcessingFailureException;
Collection<? extends ManagedObject> getValidAssociations(String assocName);
Object action(String actionName,
Map<String, ? extends Object> actionArguments)
throws NotAcceptedException, TransactionException,
ProcessingFailureException;
void removeAction(String actionName) throws NotAcceptedException,
TransactionException, ProcessingFailureException;
PlanningState getPlanningState();
PlanningState getAnachronisticPlanningState() throws TransactionException,
ProcessingFailureException;
String[] getPlannedAttributeNames() throws NotAcceptedException,
TransactionException, ProcessingFailureException;
Map<String, ? extends Object> getPlannedAttributes(String[] attributeNames)
throws NotAcceptedException, TransactionException,
ProcessingFailureException;
String[] getPlannedAssociationNames() throws NotAcceptedException,
TransactionException, ProcessingFailureException;
Collection<? extends ManagedObject> getPlannedCreatedAssociations(
String assocType) throws NotAcceptedException,
TransactionException, ProcessingFailureException;
Collection<? extends ManagedObject> getPlannedDeletedAssociations(
String assocType) throws NotAcceptedException,
TransactionException, ProcessingFailureException;
Action[] getPlannedActions() throws NotAcceptedException,
TransactionException, ProcessingFailureException;
void confirm() throws NotAcceptedException, TransactionException,
ProcessingFailureException;
void unplan(UnplanScope scope) throws NotAcceptedException,
TransactionException, ProcessingFailureException;
void unplanAttributes(String[] attributeNames) throws NotAcceptedException,
TransactionException, ProcessingFailureException;
void unplanAssociation(String assocType, ManagedObject toMO)
throws NotAcceptedException, TransactionException,
ProcessingFailureException;
}