Package soot.jbco.name
Interface NameGenerator
-
- All Known Implementing Classes:
AbstractNameGenerator,HorrorNameGenerator,JunkNameGenerator
public interface NameGeneratorGenerates names that are compatible with Java identifiers.- Since:
- 21.03.18
- Author:
- p.nesterovich
-
-
Field Summary
Fields Modifier and Type Field Description static intNAME_MAX_LENGTHAccording to JVM specification, the name is limited to 65535 characters by the 16-bit unsigned length item of the CONSTANT_Utf8_info structure.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgenerateName(int size)Generates random name of required length that can be used as Java identifier.
-
-
-
Field Detail
-
NAME_MAX_LENGTH
static final int NAME_MAX_LENGTH
According to JVM specification, the name is limited to 65535 characters by the 16-bit unsigned length item of the CONSTANT_Utf8_info structure. As the limit is on the number of bytes and UTF-8 encodes some characters using two or three bytes, we assume that in worst case number or characters is 65535 / 3- See Also:
- Constant Field Values
-
-
Method Detail
-
generateName
String generateName(int size)
Generates random name of required length that can be used as Java identifier.- Parameters:
size- the expected size- Returns:
- the name of expected length
- Throws:
IllegalArgumentException- when passed size is more thanNAME_MAX_LENGTH
-
-