Problema con el assert

jhosua
19 de Mayo del 2005

hola amigos
tengo un problema, haber si ustedes me pueden ayudar a resolverlo, me dice que el asser es una palabra clave y no puede ser usada como un identificador. se supone que assert es para checar si una expresion es booleana o no, y no me lo acepta pueden ayudarem porfa, gracias . aqui es donde me marca el error

assert(false);

no se si necesito instalar un paquete o algo.
public synchronized List getFlavorsForNative(String nat) {

// Check cache, even for null nat
SoftReference ref = (SoftReference)getFlavorsForNativeCache.get(nat);
if (ref != null) {
ArrayList retval = (ArrayList)ref.get();
if (retval != null) {
return (List)retval.clone();
}
}

LinkedList retval = new LinkedList();

if (nat == null) {
List natives = getNativesForFlavor(null);
HashSet dups = new HashSet(natives.size());

for (Iterator natives_iter = natives.iterator();
natives_iter.hasNext(); )
{
List flavors =
getFlavorsForNative((String)natives_iter.next());
for (Iterator flavors_iter = flavors.iterator();
flavors_iter.hasNext(); )
{
Object flavor = flavors_iter.next();
if (dups.add(flavor)) {
retval.add(flavor);
}
}
}
} else {
List flavors = nativeToFlavorLookup(nat);

if (disabledMappingGenerationKeys.contains(nat)) {
return flavors;
}

HashSet dups = new HashSet(flavors.size());

List flavorsAndbaseTypes = nativeToFlavorLookup(nat);

for (Iterator flavorsAndbaseTypes_iter =
flavorsAndbaseTypes.iterator();
flavorsAndbaseTypes_iter.hasNext(); )
{
Object value = flavorsAndbaseTypes_iter.next();
if (value instanceof String) {
String baseType = (String)value;
String subType = null;
try {
MimeType mimeType = new MimeType(baseType);
subType = mimeType.getSubType();
} catch (MimeTypeParseException mtpe) {
// Cannot happen, since we checked all mappings
// on load from flavormap.properties.
assert(false);
}
if (DataTransferer.doesSubtypeSupportCharset(subType,
null)) {
if (TEXT_PLAIN_BASE_TYPE.equals(baseType) &&
dups.add(DataFlavor.stringFlavor))
{
retval.add(DataFlavor.stringFlavor);
}

for (int i = 0; i < UNICODE_TEXT_CLASSES.length; i++) {
DataFlavor toAdd = null;
try {
toAdd = new DataFlavor
(baseType + ";charset=Unicode;class=" +
UNICODE_TEXT_CLASSES[i]);
} catch (ClassNotFoundException cannotHappen) {
}
if (dups.add(toAdd)) {
retval.add(toAdd);
}
}

for (Iterator charset_iter =
DataTransferer.standardEncodings();
charset_iter.hasNext(); )
{
String charset = (String)charset_iter.next();

for (int i = 0; i < ENCODED_TEXT_CLASSES.length;
i++)
{
DataFlavor toAdd = null;
try {
toAdd = new DataFlavor
(baseType + ";charset=" + charset +
";class=" + ENCODED_TEXT_CLASSES[i]);
} catch (ClassNotFoundException cannotHappen) {
}

// Check for equality to plainTextFlavor so
// that we can ensure that the exact charset of
// plainTextFlavor, not the canonical charset
// or another equivalent charset with a
// different name, is used.
if (toAdd.equals(DataFlavor.plainTextFlavor)) {
toAdd = DataFlavor.plainTextFlavor;
}

if (dups.add(toAdd)) {
retval.add(toAdd);
}
}
}

if (TEXT_PLAIN_BASE_TYPE.equals(baseType) &&
dups.add(DataFlavor.plainTextFlavor))
{
retval.add(DataFlavor.plainTextFlavor);
}
} else {
// Non-charset text natives should be treated as
// opaque, 8-bit data in any of its various
// representations.
for (int i = 0; i < ENCODED_TEXT_CLASSES.length; i++) {
DataFlavor toAdd = null;
try {
toAdd = new DataFlavor(baseType +
";class=" + ENCODED_TEXT_CLASSES[i]);
} catch (ClassNotFoundException cannotHappen) {
}

if (dups.add(toAdd)) {
retval.add(toAdd);
}
}
}
} else {
DataFlavor flavor = (DataFlavor)value;
if (dups.add(flavor)) {
retval.add(flavor);
}
}
}
}

ArrayList arrayList = new ArrayList(retval);
getFlavorsForNativeCache.put(nat, new SoftReference(arrayList));
return (List)arrayList.clone();
}

Char
19 de Mayo del 2005
Ni idea de como sea, sorryy!!!!

asdf
19 de Mayo del 2005
compila con:

javac -source 1.4 ttufichero.java

Antes de hacer estas preguntas, respondidas millones de veces, pq no le preguntais a google:

http://java.sun.com/j2se/1.4.2/docs/guide/lang/assert.html

Saludos