com.atlassian.plugin.osgi.util
Class Clazz
java.lang.Object
com.atlassian.plugin.osgi.util.Clazz
public class Clazz
- extends Object
Copied from the bndlib version 0.255, adding the capture of referred classes
|
Nested Class Summary |
protected static class |
Clazz.Assoc
|
|
Method Summary |
protected void |
constantClass(DataInputStream in,
int poolIndex)
|
protected void |
constantDouble(DataInputStream in,
int poolIndex)
|
protected void |
constantLong(DataInputStream in,
int poolIndex)
|
protected void |
constantUtf8(DataInputStream in,
int poolIndex)
|
protected void |
crawl(byte[] code)
We must find Class.forName references ... |
static String |
getPackage(String clazz)
|
String |
getPath()
|
Map |
getReferred()
|
Set |
getReferredClasses()
|
String |
getSourceFile()
|
String |
getSuperClassName()
|
protected void |
nameAndType(DataInputStream in,
int poolIndex,
byte tag)
|
protected void |
pool(Object[] pool,
int[] intPool)
|
void |
reset()
.class construct for different compilers
sun 1.1 Detect static variable class$com$acme$MyClass 1.2 " 1.3 " 1.4 "
1.5 ldc_w (class) 1.6 "
eclipse 1.1 class$0, ldc (string), invokestatic Class.forName 1.2 " 1.3 "
1.5 ldc (class) 1.6 "
1.5 and later is not an issue, sun pre 1.5 is easy to detect the static
variable that decodes the class name. |
Set |
xref(InputStream in)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Clazz
public Clazz(String path)
Clazz
public Clazz(String path,
InputStream in)
throws IOException
- Throws:
IOException
pool
protected void pool(Object[] pool,
int[] intPool)
nameAndType
protected void nameAndType(DataInputStream in,
int poolIndex,
byte tag)
throws IOException
- Parameters:
in - poolIndex - tag -
- Throws:
IOException
constantClass
protected void constantClass(DataInputStream in,
int poolIndex)
throws IOException
- Parameters:
in - poolIndex -
- Throws:
IOException
constantDouble
protected void constantDouble(DataInputStream in,
int poolIndex)
throws IOException
- Parameters:
in -
- Throws:
IOException
constantLong
protected void constantLong(DataInputStream in,
int poolIndex)
throws IOException
- Parameters:
in -
- Throws:
IOException
constantUtf8
protected void constantUtf8(DataInputStream in,
int poolIndex)
throws IOException
- Parameters:
in - poolIndex -
- Throws:
IOException
crawl
protected void crawl(byte[] code)
- We must find Class.forName references ...
- Parameters:
code -
getPackage
public static String getPackage(String clazz)
getReferred
public Map getReferred()
getReferredClasses
public Set getReferredClasses()
getPath
public String getPath()
getSuperClassName
public String getSuperClassName()
xref
public Set xref(InputStream in)
throws IOException
- Throws:
IOException
getSourceFile
public String getSourceFile()
reset
public void reset()
- .class construct for different compilers
sun 1.1 Detect static variable class$com$acme$MyClass 1.2 " 1.3 " 1.4 "
1.5 ldc_w (class) 1.6 "
eclipse 1.1 class$0, ldc (string), invokestatic Class.forName 1.2 " 1.3 "
1.5 ldc (class) 1.6 "
1.5 and later is not an issue, sun pre 1.5 is easy to detect the static
variable that decodes the class name. For eclipse, the class$0 gives away
we have a reference encoded in a string.
compilerversions/compilerversions.jar contains test versions of all
versions/compilers.
Copyright © 2011 Atlassian. All Rights Reserved.