给出以下代码:
enum Functions
{
background,clear,colorMode,fill,noFill,noStroke,stroke,applyMatrix,popMatrix,
printMatrix,pushMatrix,resetMatrix,rotate,rotateX,rotateY,rotateZ,scale,shearX,shearY,
translate,ellipseMode,smooth,noSmooth,rectMode,strokeCap,strokeJoin,strokeWeight,arc,ellipse,
line,point,quad,rect,triangle,size,frameRate;
}
switch(Functions.valueOf(f))
{
case background:
//background()
background(random(255),random(255),random(255));
break;
case clear:
//clear()
break;
case colorMode:
//colorMode()
break;
case fill:
//fill()
fill(random(255),random(255),random(255));
break;
case size:
//size()
break;
.....
}
大部分时间都运行良好,没有其他Enum const抛出此错误:
IllegalArgumentException: No enum const class Functions.size
但由于某种原因,Functions.size有时会导致抛出此错误。有谁知道为什么会间歇性地发生这种情况?