id
int32
0
12.9k
code
sequencelengths
2
264k
10,400
[ "<s>", "package", "edu", ".", "uestc", ".", "project", ".", "cycle", ".", "spirit", ";", "public", "class", "SpiritState", "{", "public", "static", "final", "int", "INIT_STATE", "=", "1", ";", "public", "static", "final", "int", "SELECTED_STATE", "=", "2", ";", "private", "int", "state", "=", "0", ";", "boolean", "isSelected", "=", "false", ";", "public", "int", "getState", "(", ")", "{", "return", "state", ";", "}", "public", "void", "resetState", "(", ")", "{", "state", "=", "0", ";", "}", "public", "void", "unmountState", "(", "int", "state", ")", "{", "this", ".", "state", "&=", "~", "state", ";", "}", "public", "void", "mountState", "(", "int", "state", ")", "{", "this", ".", "state", "|=", "state", ";", "}", "public", "static", "boolean", "equals", "(", "SpiritState", "state1", ",", "SpiritState", "state2", ")", "{", "if", "(", "state1", ".", "getState", "(", ")", "==", "state2", ".", "getState", "(", ")", ")", "{", "return", "true", ";", "}", "else", "{", "return", "false", ";", "}", "}", "public", "boolean", "containsState", "(", "int", "state", ")", "{", "if", "(", "(", "this", ".", "state", "&", "state", ")", "!=", "0", ")", "{", "return", "true", ";", "}", "else", "{", "return", "false", ";", "}", "}", "}", "</s>" ]
10,401
[ "<s>", "package", "edu", ".", "uestc", ".", "project", ".", "cycle", ".", "spirit", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "Vector", ";", "public", "class", "SpiritGroup", "{", "private", "Vector", "<", "SpiritObject", ">", "vector", ";", "public", "SpiritGroup", "(", ")", "{", "this", ".", "vector", "=", "new", "Vector", "<", "SpiritObject", ">", "(", ")", ";", "}", "public", "int", "size", "(", ")", "{", "return", "this", ".", "vector", ".", "size", "(", ")", ";", "}", "protected", "void", "addSpiritObject", "(", "SpiritObject", "object", ")", "{", "this", ".", "vector", ".", "add", "(", "object", ")", ";", "}", "protected", "void", "removeSpiritIndex", "(", "int", "location", ")", "{", "this", ".", "vector", ".", "remove", "(", "location", ")", ";", "}", "protected", "void", "removeSpiritIndex", "(", "SpiritObject", "object", ")", "{", "this", ".", "vector", ".", "remove", "(", "object", ")", ";", "}", "public", "Iterator", "<", "SpiritObject", ">", "iterator", "(", ")", "{", "return", "new", "SpiritGrouprIterator", "(", "this", ".", "vector", ")", ";", "}", "}", "</s>" ]
10,402
[ "<s>", "package", "edu", ".", "uestc", ".", "project", ".", "cycle", ".", "spirit", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "Vector", ";", "public", "class", "SpiritManager", "{", "private", "Vector", "<", "SpiritObject", ">", "spiritElements", ";", "public", "SpiritManager", "(", ")", "{", "this", ".", "spiritElements", "=", "new", "Vector", "<", "SpiritObject", ">", "(", ")", ";", "}", "public", "void", "registerSpirit", "(", "SpiritObject", "object", ")", "{", "this", ".", "spiritElements", ".", "add", "(", "object", ")", ";", "}", "public", "void", "unRegisterSpirit", "(", "int", "location", ")", "{", "this", ".", "spiritElements", ".", "remove", "(", "location", ")", ";", "}", "public", "void", "unRegisterSpirit", "(", "SpiritObject", "object", ")", "{", "this", ".", "spiritElements", ".", "remove", "(", "object", ")", ";", "}", "public", "int", "size", "(", ")", "{", "return", "this", ".", "spiritElements", ".", "size", "(", ")", ";", "}", "public", "Iterator", "<", "SpiritObject", ">", "iterator", "(", ")", "{", "return", "new", "SpiritManagerIterator", "(", "this", ".", "spiritElements", ")", ";", "}", "public", "SpiritGroup", "getGroupByState", "(", "SpiritState", "state", ")", "{", "Iterator", "<", "SpiritObject", ">", "iterator", "=", "this", ".", "iterator", "(", ")", ";", "SpiritGroup", "sg", "=", "new", "SpiritGroup", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "SpiritObject", "object", "=", "iterator", ".", "next", "(", ")", ";", "if", "(", "SpiritState", ".", "equals", "(", "state", ",", "object", ".", "getState", "(", ")", ")", ")", "{", "sg", ".", "addSpiritObject", "(", "object", ")", ";", "}", "}", "return", "sg", ";", "}", "public", "SpiritGroup", "getGroupByState", "(", "int", "state", ")", "{", "Iterator", "<", "SpiritObject", ">", "iterator", "=", "this", ".", "iterator", "(", ")", ";", "SpiritGroup", "sg", "=", "new", "SpiritGroup", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "SpiritObject", "object", "=", "iterator", ".", "next", "(", ")", ";", "if", "(", "object", ".", "getState", "(", ")", ".", "containsState", "(", "state", ")", ")", "{", "sg", ".", "addSpiritObject", "(", "object", ")", ";", "}", "}", "return", "sg", ";", "}", "public", "boolean", "removeByGroup", "(", "SpiritGroup", "group", ")", "{", "Iterator", "<", "SpiritObject", ">", "iterator", "=", "group", ".", "iterator", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "if", "(", "!", "this", ".", "spiritElements", ".", "contains", "(", "iterator", ".", "next", "(", ")", ")", ")", "{", "return", "false", ";", "}", "}", "iterator", "=", "group", ".", "iterator", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "if", "(", "this", ".", "spiritElements", ".", "remove", "(", "iterator", ".", "next", "(", ")", ")", ")", "{", "continue", ";", "}", "else", "{", "return", "false", ";", "}", "}", "group", "=", "null", ";", "return", "true", ";", "}", "}", "</s>" ]
10,403
[ "<s>", "package", "edu", ".", "uestc", ".", "project", ".", "cycle", ".", "spirit", ";", "import", "android", ".", "graphics", ".", "Bitmap", ";", "import", "android", ".", "graphics", ".", "Rect", ";", "public", "class", "SpiritObject", "{", "private", "SpiritState", "state", ";", "private", "Bitmap", "bitmap", ";", "private", "int", "startX", ",", "startY", ";", "private", "int", "oldestX", ",", "oldestY", ";", "public", "boolean", "isSelected", "(", ")", "{", "if", "(", "this", ".", "state", ".", "containsState", "(", "SpiritState", ".", "SELECTED_STATE", ")", ")", "{", "return", "true", ";", "}", "else", "{", "return", "false", ";", "}", "}", "public", "int", "getOldestX", "(", ")", "{", "return", "oldestX", ";", "}", "public", "void", "setOldestX", "(", "int", "oldestX", ")", "{", "this", ".", "oldestX", "=", "oldestX", ";", "}", "public", "int", "getOldestY", "(", ")", "{", "return", "oldestY", ";", "}", "public", "void", "setOldestY", "(", "int", "oldestY", ")", "{", "this", ".", "oldestY", "=", "oldestY", ";", "}", "public", "void", "setSelected", "(", "boolean", "isSelected", ")", "{", "if", "(", "isSelected", ")", "{", "this", ".", "state", ".", "mountState", "(", "SpiritState", ".", "SELECTED_STATE", ")", ";", "}", "else", "{", "this", ".", "state", ".", "unmountState", "(", "SpiritState", ".", "SELECTED_STATE", ")", ";", "}", "}", "public", "SpiritState", "getState", "(", ")", "{", "return", "state", ";", "}", "public", "void", "setState", "(", "SpiritState", "state", ")", "{", "this", ".", "state", "=", "state", ";", "}", "public", "SpiritObject", "(", "int", "x", ",", "int", "y", ")", "{", "this", ".", "state", "=", "new", "SpiritState", "(", ")", ";", "this", ".", "state", ".", "mountState", "(", "SpiritState", ".", "INIT_STATE", ")", ";", "this", ".", "oldestX", "=", "x", ";", "this", ".", "oldestY", "=", "y", ";", "this", ".", "startX", "=", "x", ";", "this", ".", "startY", "=", "y", ";", "}", "public", "SpiritObject", "(", ")", "{", "this", ".", "state", "=", "new", "SpiritState", "(", ")", ";", "this", ".", "state", ".", "mountState", "(", "SpiritState", ".", "INIT_STATE", ")", ";", "}", "public", "Bitmap", "getBitmap", "(", ")", "{", "return", "bitmap", ";", "}", "public", "void", "setBitmap", "(", "Bitmap", "bitmap", ")", "{", "this", ".", "bitmap", "=", "bitmap", ";", "}", "public", "int", "getStartX", "(", ")", "{", "return", "startX", ";", "}", "public", "void", "setStartX", "(", "int", "startX", ")", "{", "this", ".", "startX", "=", "startX", ";", "}", "public", "int", "getStartY", "(", ")", "{", "return", "startY", ";", "}", "public", "void", "setStartY", "(", "int", "startY", ")", "{", "this", ".", "startY", "=", "startY", ";", "}", "public", "Rect", "getRect", "(", ")", "{", "Rect", "rect", "=", "new", "Rect", "(", ")", ";", "rect", ".", "set", "(", "getStartX", "(", ")", ",", "getStartY", "(", ")", ",", "getStartX", "(", ")", "+", "getBitmap", "(", ")", ".", "getWidth", "(", ")", ",", "getStartY", "(", ")", "+", "getBitmap", "(", ")", ".", "getHeight", "(", ")", ")", ";", "return", "rect", ";", "}", "}", "</s>" ]
10,404
[ "<s>", "package", "edu", ".", "uestc", ".", "project", ".", "cycle", ".", "spirit", ";", "import", "java", ".", "util", ".", "Vector", ";", "public", "class", "SpiritManagerIterator", "implements", "java", ".", "util", ".", "Iterator", "<", "SpiritObject", ">", "{", "private", "Vector", "<", "SpiritObject", ">", "vector", ";", "private", "int", "cur", "=", "0", ";", "public", "SpiritManagerIterator", "(", "Vector", "<", "SpiritObject", ">", "v", ")", "{", "this", ".", "vector", "=", "v", ";", "}", "public", "boolean", "hasNext", "(", ")", "{", "if", "(", "this", ".", "cur", "==", "this", ".", "vector", ".", "size", "(", ")", ")", "{", "return", "false", ";", "}", "return", "true", ";", "}", "public", "SpiritObject", "next", "(", ")", "{", "if", "(", "this", ".", "hasNext", "(", ")", ")", "{", "return", "this", ".", "vector", ".", "get", "(", "this", ".", "cur", "++", ")", ";", "}", "else", "{", "return", "null", ";", "}", "}", "public", "void", "remove", "(", ")", "{", "this", ".", "vector", ".", "remove", "(", "this", ".", "cur", ")", ";", "}", "}", "</s>" ]
10,405
[ "<s>", "package", "edu", ".", "uestc", ".", "project", ".", "cycle", ".", "spirit", ";", "import", "java", ".", "util", ".", "Vector", ";", "public", "class", "SpiritGrouprIterator", "implements", "java", ".", "util", ".", "Iterator", "<", "SpiritObject", ">", "{", "private", "Vector", "<", "SpiritObject", ">", "vector", ";", "private", "int", "cur", "=", "0", ";", "public", "SpiritGrouprIterator", "(", "Vector", "<", "SpiritObject", ">", "v", ")", "{", "this", ".", "vector", "=", "v", ";", "}", "public", "boolean", "hasNext", "(", ")", "{", "if", "(", "this", ".", "cur", "==", "this", ".", "vector", ".", "size", "(", ")", ")", "{", "return", "false", ";", "}", "return", "true", ";", "}", "public", "SpiritObject", "next", "(", ")", "{", "if", "(", "this", ".", "hasNext", "(", ")", ")", "{", "return", "this", ".", "vector", ".", "get", "(", "this", ".", "cur", "++", ")", ";", "}", "else", "{", "return", "null", ";", "}", "}", "public", "void", "remove", "(", ")", "{", "}", "}", "</s>" ]
10,406
[ "<s>", "package", "zy", ".", "sheep", ";", "import", "android", ".", "app", ".", "Activity", ";", "import", "android", ".", "os", ".", "Bundle", ";", "import", "android", ".", "view", ".", "Window", ";", "import", "android", ".", "view", ".", "WindowManager", ";", "public", "class", "SheepCycleActivity", "extends", "Activity", "{", "@", "Override", "public", "void", "onCreate", "(", "Bundle", "savedInstanceState", ")", "{", "super", ".", "onCreate", "(", "savedInstanceState", ")", ";", "this", ".", "requestWindowFeature", "(", "Window", ".", "FEATURE_NO_TITLE", ")", ";", "this", ".", "getWindow", "(", ")", ".", "setFlags", "(", "WindowManager", ".", "LayoutParams", ".", "FLAG_FULLSCREEN", ",", "WindowManager", ".", "LayoutParams", ".", "FLAG_FULLSCREEN", ")", ";", "setContentView", "(", "new", "MySurfaceView", "(", "this", ")", ")", ";", "}", "}", "</s>" ]
10,407
[ "<s>", "package", "zy", ".", "sheep", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "Random", ";", "import", "java", ".", "util", ".", "Timer", ";", "import", "java", ".", "util", ".", "TimerTask", ";", "import", "edu", ".", "uestc", ".", "project", ".", "cycle", ".", "alg", ".", "basic", ".", "LinePath", ";", "import", "edu", ".", "uestc", ".", "project", ".", "cycle", ".", "spirit", ".", "SpiritGroup", ";", "import", "edu", ".", "uestc", ".", "project", ".", "cycle", ".", "spirit", ".", "SpiritManager", ";", "import", "edu", ".", "uestc", ".", "project", ".", "cycle", ".", "spirit", ".", "SpiritObject", ";", "import", "edu", ".", "uestc", ".", "project", ".", "cycle", ".", "spirit", ".", "SpiritState", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "graphics", ".", "Bitmap", ";", "import", "android", ".", "graphics", ".", "BitmapFactory", ";", "import", "android", ".", "graphics", ".", "Canvas", ";", "import", "android", ".", "graphics", ".", "Color", ";", "import", "android", ".", "graphics", ".", "Paint", ";", "import", "android", ".", "graphics", ".", "Path", ";", "import", "android", ".", "graphics", ".", "Paint", ".", "Style", ";", "import", "android", ".", "view", ".", "MotionEvent", ";", "import", "android", ".", "view", ".", "SurfaceHolder", ";", "import", "android", ".", "view", ".", "SurfaceHolder", ".", "Callback", ";", "import", "android", ".", "view", ".", "SurfaceView", ";", "public", "class", "MySurfaceView", "extends", "SurfaceView", "implements", "Callback", "{", "private", "SurfaceHolder", "sfh", ";", "private", "Paint", "paint", ";", "private", "Paint", "cyclePaint", ";", "private", "boolean", "flag", ";", "private", "float", "startX", ",", "startY", ";", "private", "float", "currentX", ",", "currentY", ";", "private", "boolean", "isCanvasCleared", "=", "false", ";", "private", "final", "int", "MAXCLOSE", "=", "300", ";", "private", "final", "int", "BMPNUM", "=", "10", ";", "private", "Path", "path", ";", "private", "LinePath", "linePath", ";", "private", "boolean", "dragFlag", "=", "false", ";", "private", "boolean", "pocketOn", "=", "false", ";", "private", "static", "final", "int", "POWERFULL", "=", "200", ";", "private", "int", "currentPower", "=", "POWERFULL", ";", "private", "SpiritGroup", "sg", ";", "SpiritManager", "spiritManager", ";", "private", "Paint", "powerPaint", ";", "private", "Timer", "powerFillTimer", ";", "private", "boolean", "isTimerRun", "=", "false", ";", "private", "Paint", "counterPaint", ";", "private", "int", "sheepCounter", "=", "0", ";", "private", "Bitmap", "sheepCounterBmp", ";", "public", "MySurfaceView", "(", "Context", "context", ")", "{", "super", "(", "context", ")", ";", "sfh", "=", "this", ".", "getHolder", "(", ")", ";", "sfh", ".", "addCallback", "(", "this", ")", ";", "paint", "=", "new", "Paint", "(", ")", ";", "powerPaint", "=", "new", "Paint", "(", ")", ";", "cyclePaint", "=", "new", "Paint", "(", ")", ";", "counterPaint", "=", "new", "Paint", "(", ")", ";", "counterPaint", ".", "setStyle", "(", "Style", ".", "STROKE", ")", ";", "counterPaint", ".", "setColor", "(", "Color", ".", "RED", ")", ";", "cyclePaint", ".", "setColor", "(", "Color", ".", "BLUE", ")", ";", "cyclePaint", ".", "setStyle", "(", "Style", ".", "STROKE", ")", ";", "paint", ".", "setColor", "(", "Color", ".", "WHITE", ")", ";", "paint", ".", "setAntiAlias", "(", "false", ")", ";", "paint", ".", "setStyle", "(", "Style", ".", "STROKE", ")", ";", "sheepCounterBmp", "=", "BitmapFactory", ".", "decodeResource", "(", "this", ".", "getResources", "(", ")", ",", "R", ".", "drawable", ".", "ic_launcher", ")", ";", "this", ".", "powerFillTimer", "=", "new", "Timer", "(", ")", ";", "spiritManager", "=", "new", "SpiritManager", "(", ")", ";", "path", "=", "new", "Path", "(", ")", ";", "linePath", "=", "new", "LinePath", "(", ")", ";", "}", "public", "void", "surfaceChanged", "(", "SurfaceHolder", "holder", ",", "int", "format", ",", "int", "width", ",", "int", "height", ")", "{", "}", "public", "void", "surfaceCreated", "(", "SurfaceHolder", "holder", ")", "{", "creator", "(", ")", ";", "flag", "=", "true", ";", "new", "Thread", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "while", "(", "flag", ")", "{", "long", "start", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "myDraw", "(", ")", ";", "long", "end", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "try", "{", "if", "(", "end", "-", "start", "<", "30", ")", "{", "Thread", ".", "sleep", "(", "30", "-", "(", "end", "-", "start", ")", ")", ";", "}", "}", "catch", "(", "Exception", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "}", "}", "}", ".", "start", "(", ")", ";", "}", "public", "void", "surfaceDestroyed", "(", "SurfaceHolder", "holder", ")", "{", "flag", "=", "false", ";", "}", "public", "void", "myDraw", "(", ")", "{", "Canvas", "canvas", "=", "sfh", ".", "lockCanvas", "(", ")", ";", "if", "(", "isCanvasCleared", ")", "{", "path", ".", "reset", "(", ")", ";", "canvas", ".", "drawColor", "(", "Color", ".", "BLACK", ")", ";", "canvas", ".", "drawPath", "(", "path", ",", "paint", ")", ";", "}", "else", "{", "canvas", ".", "drawPath", "(", "path", ",", "paint", ")", ";", "}", "Iterator", "<", "SpiritObject", ">", "iterator", "=", "this", ".", "spiritManager", ".", "iterator", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "SpiritObject", "object", "=", "iterator", ".", "next", "(", ")", ";", "canvas", ".", "drawBitmap", "(", "object", ".", "getBitmap", "(", ")", ",", "object", ".", "getStartX", "(", ")", ",", "object", ".", "getStartY", "(", ")", ",", "paint", ")", ";", "}", "canvas", ".", "drawCircle", "(", "0", "+", "100", ",", "this", ".", "getHeight", "(", ")", "-", "100", ",", "100", ",", "cyclePaint", ")", ";", "if", "(", "this", ".", "pocketOn", ")", "{", "cyclePaint", ".", "setStyle", "(", "Style", ".", "FILL", ")", ";", "}", "else", "{", "cyclePaint", ".", "setStyle", "(", "Style", ".", "STROKE", ")", ";", "}", "powerPaint", ".", "setStyle", "(", "Style", ".", "STROKE", ")", ";", "powerPaint", ".", "setColor", "(", "Color", ".", "RED", ")", ";", "canvas", ".", "drawRect", "(", "200", ",", "this", ".", "getHeight", "(", ")", "-", "20", ",", "200", "+", "POWERFULL", ",", "this", ".", "getHeight", "(", ")", "-", "10", ",", "powerPaint", ")", ";", "powerPaint", ".", "setStyle", "(", "Style", ".", "FILL", ")", ";", "powerPaint", ".", "setColor", "(", "Color", ".", "BLACK", ")", ";", "canvas", ".", "drawRect", "(", "201", ",", "this", ".", "getHeight", "(", ")", "-", "19", ",", "200", "+", "POWERFULL", ",", "this", ".", "getHeight", "(", ")", "-", "10", ",", "powerPaint", ")", ";", "powerPaint", ".", "setColor", "(", "Color", ".", "YELLOW", ")", ";", "canvas", ".", "drawRect", "(", "201", ",", "this", ".", "getHeight", "(", ")", "-", "19", ",", "200", "+", "this", ".", "currentPower", ",", "this", ".", "getHeight", "(", ")", "-", "10", ",", "powerPaint", ")", ";", "powerPaint", ".", "setColor", "(", "Color", ".", "RED", ")", ";", "canvas", ".", "drawBitmap", "(", "this", ".", "sheepCounterBmp", ",", "250", ",", "this", ".", "getHeight", "(", ")", "-", "100", ",", "paint", ")", ";", "counterPaint", ".", "setColor", "(", "Color", ".", "BLACK", ")", ";", "counterPaint", ".", "setStyle", "(", "Style", ".", "FILL", ")", ";", "canvas", ".", "drawRect", "(", "300", ",", "this", ".", "getHeight", "(", ")", "-", "70", ",", "300", "+", "10", ",", "this", ".", "getHeight", "(", ")", "-", "70", ",", "counterPaint", ")", ";", "counterPaint", ".", "setColor", "(", "Color", ".", "RED", ")", ";", "canvas", ".", "drawText", "(", "\"X", "\"", "+", "this", ".", "sheepCounter", ",", "305", ",", "this", ".", "getHeight", "(", ")", "-", "70", ",", "counterPaint", ")", ";", "sfh", ".", "unlockCanvasAndPost", "(", "canvas", ")", ";", "}", "public", "void", "clearCanvas", "(", ")", "{", "Canvas", "canvas", "=", "sfh", ".", "lockCanvas", "(", ")", ";", "canvas", ".", "drawRect", "(", "0", ",", "0", ",", "this", ".", "getWidth", "(", ")", ",", "this", ".", "getHeight", "(", ")", ",", "new", "Paint", "(", ")", ")", ";", "sfh", ".", "unlockCanvasAndPost", "(", "canvas", ")", ";", "}", "@", "Override", "public", "boolean", "onTouchEvent", "(", "MotionEvent", "event", ")", "{", "int", "x", "=", "(", "int", ")", "event", ".", "getX", "(", ")", ";", "int", "y", "=", "(", "int", ")", "event", ".", "getY", "(", ")", ";", "if", "(", "event", ".", "getAction", "(", ")", "==", "MotionEvent", ".", "ACTION_DOWN", ")", "{", "this", ".", "startX", "=", "x", ";", "this", ".", "startY", "=", "y", ";", "if", "(", "this", ".", "dragFlag", ")", "{", "if", "(", "!", "this", ".", "linePath", ".", "isContainsPoint", "(", "x", ",", "y", ")", ")", "{", "this", ".", "currentX", "=", "-", "1", ";", "this", ".", "currentX", "=", "-", "1", ";", "}", "else", "{", "this", ".", "currentX", "=", "x", ";", "this", ".", "currentY", "=", "y", ";", "}", "}", "else", "{", "if", "(", "isTimerRun", ")", "{", "}", "else", "{", "path", ".", "moveTo", "(", "x", ",", "y", ")", ";", "this", ".", "linePath", ".", "moveToStart", "(", "x", ",", "y", ")", ";", "this", ".", "isCanvasCleared", "=", "false", ";", "paint", ".", "setColor", "(", "Color", ".", "WHITE", ")", ";", "}", "}", "}", "else", "if", "(", "event", ".", "getAction", "(", ")", "==", "MotionEvent", ".", "ACTION_MOVE", ")", "{", "if", "(", "this", ".", "dragFlag", ")", "{", "if", "(", "this", ".", "currentX", "!=", "-", "1", "&&", "this", ".", "currentY", "!=", "-", "1", ")", "{", "float", "dx", "=", "x", "-", "this", ".", "currentX", ";", "float", "dy", "=", "y", "-", "this", ".", "currentY", ";", "Iterator", "<", "SpiritObject", ">", "iterator", "=", "this", ".", "sg", ".", "iterator", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "SpiritObject", "object", "=", "iterator", ".", "next", "(", ")", ";", "object", ".", "setStartX", "(", "(", "int", ")", "(", "object", ".", "getStartX", "(", ")", "+", "dx", ")", ")", ";", "object", ".", "setStartY", "(", "(", "int", ")", "(", "object", ".", "getStartY", "(", ")", "+", "dy", ")", ")", ";", "}", "int", "pocketX", "=", "100", ";", "int", "pocketY", "=", "this", ".", "getHeight", "(", ")", "-", "100", ";", "if", "(", "Math", ".", "sqrt", "(", "(", "pocketX", "-", "x", ")", "*", "(", "pocketX", "-", "x", ")", "+", "(", "pocketY", "-", "y", ")", "*", "(", "pocketY", "-", "y", ")", ")", "<=", "100.0", ")", "{", "this", ".", "pocketOn", "=", "true", ";", "}", "else", "{", "this", ".", "pocketOn", "=", "false", ";", "}", "this", ".", "currentX", "=", "x", ";", "this", ".", "currentY", "=", "y", ";", "}", "}", "else", "{", "if", "(", "(", "this", ".", "linePath", ".", "getPathLenght", "(", ")", "/", "10", ")", ">=", "200", ")", "{", "this", ".", "currentPower", "=", "0", ";", "paint", ".", "setColor", "(", "Color", ".", "RED", ")", ";", "}", "else", "{", "if", "(", "this", ".", "isTimerRun", ")", "{", "}", "else", "{", "path", ".", "lineTo", "(", "x", ",", "y", ")", ";", "linePath", ".", "lineTo", "(", "x", ",", "y", ")", ";", "this", ".", "currentPower", "=", "200", "-", "this", ".", "linePath", ".", "getPathLenght", "(", ")", "/", "10", ";", "}", "}", "}", "}", "else", "if", "(", "event", ".", "getAction", "(", ")", "==", "MotionEvent", ".", "ACTION_UP", ")", "{", "if", "(", "this", ".", "isTimerRun", ")", "{", "}", "else", "{", "if", "(", "this", ".", "currentPower", "<=", "POWERFULL", ")", "{", "if", "(", "this", ".", "currentPower", "==", "0", ")", "{", "this", ".", "linePath", ".", "reset", "(", ")", ";", "}", "powerFillTimer", ".", "schedule", "(", "new", "TimerTask", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "if", "(", "currentPower", ">=", "190", ")", "{", "currentPower", "=", "200", ";", "this", ".", "cancel", "(", ")", ";", "isTimerRun", "=", "false", ";", "}", "else", "{", "currentPower", "+=", "10", ";", "isTimerRun", "=", "true", ";", "}", "}", "}", ",", "0", ",", "10", ")", ";", "}", "else", "{", "}", "}", "if", "(", "this", ".", "dragFlag", ")", "{", "if", "(", "this", ".", "pocketOn", ")", "{", "this", ".", "sheepCounter", "+=", "this", ".", "sg", ".", "size", "(", ")", ";", "this", ".", "spiritManager", ".", "removeByGroup", "(", "this", ".", "sg", ")", ";", "this", ".", "pocketOn", "=", "false", ";", "if", "(", "this", ".", "spiritManager", ".", "size", "(", ")", "==", "0", ")", "{", "creator", "(", ")", ";", "}", "}", "else", "{", "Iterator", "<", "SpiritObject", ">", "iterator", "=", "this", ".", "sg", ".", "iterator", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "SpiritObject", "object", "=", "iterator", ".", "next", "(", ")", ";", "object", ".", "getState", "(", ")", ".", "unmountState", "(", "SpiritState", ".", "SELECTED_STATE", ")", ";", "object", ".", "setBitmap", "(", "BitmapFactory", ".", "decodeResource", "(", "this", ".", "getResources", "(", ")", ",", "R", ".", "drawable", ".", "ic_launcher", ")", ")", ";", "object", ".", "setStartX", "(", "object", ".", "getOldestX", "(", ")", ")", ";", "object", ".", "setStartY", "(", "object", ".", "getOldestY", "(", ")", ")", ";", "}", "}", "this", ".", "linePath", ".", "reset", "(", ")", ";", "this", ".", "dragFlag", "=", "false", ";", "}", "else", "{", "if", "(", "this", ".", "isTimerRun", ")", "{", "this", ".", "isCanvasCleared", "=", "true", ";", "this", ".", "linePath", ".", "reset", "(", ")", ";", "}", "else", "{", "path", ".", "lineTo", "(", "x", ",", "y", ")", ";", "linePath", ".", "lineTo", "(", "x", ",", "y", ")", ";", "int", "tmp", "=", "(", "int", ")", "Math", ".", "sqrt", "(", "(", "this", ".", "startX", "-", "x", ")", "*", "(", "this", ".", "startX", "-", "x", ")", "+", "(", "this", ".", "startY", "-", "y", ")", "*", "(", "this", ".", "startY", "-", "y", ")", ")", ";", "if", "(", "this", ".", "MAXCLOSE", "<", "tmp", ")", "{", "linePath", ".", "reset", "(", ")", ";", "}", "else", "{", "path", ".", "close", "(", ")", ";", "linePath", ".", "close", "(", ")", ";", "Iterator", "<", "SpiritObject", ">", "iterator", "=", "this", ".", "spiritManager", ".", "iterator", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "SpiritObject", "object", "=", "iterator", ".", "next", "(", ")", ";", "if", "(", "linePath", ".", "isContainsRect", "(", "object", ".", "getRect", "(", ")", ",", "LinePath", ".", "ALL_POINTS", ")", ")", "{", "object", ".", "setBitmap", "(", "BitmapFactory", ".", "decodeResource", "(", "this", ".", "getResources", "(", ")", ",", "R", ".", "drawable", ".", "a", ")", ")", ";", "object", ".", "setSelected", "(", "true", ")", ";", "this", ".", "dragFlag", "=", "true", ";", "}", "else", "{", "continue", ";", "}", "}", "}", "this", ".", "isCanvasCleared", "=", "true", ";", "if", "(", "this", ".", "dragFlag", ")", "{", "this", ".", "sg", "=", "this", ".", "spiritManager", ".", "getGroupByState", "(", "SpiritState", ".", "SELECTED_STATE", ")", ";", "}", "}", "}", "}", "return", "true", ";", "}", "private", "void", "creator", "(", ")", "{", "int", "viewHeight", "=", "this", ".", "getHeight", "(", ")", ";", "int", "viewtWidth", "=", "this", ".", "getWidth", "(", ")", ";", "Random", "random", "=", "new", "Random", "(", "System", ".", "currentTimeMillis", "(", ")", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "BMPNUM", ";", "i", "++", ")", "{", "int", "x", ",", "y", ";", "while", "(", "true", ")", "{", "x", "=", "random", ".", "nextInt", "(", "1000", ")", ";", "if", "(", "x", ">=", "viewtWidth", "-", "150", "||", "x", "<=", "150", ")", "{", "continue", ";", "}", "else", "{", "break", ";", "}", "}", "while", "(", "true", ")", "{", "y", "=", "random", ".", "nextInt", "(", "1000", ")", ";", "if", "(", "y", ">=", "viewHeight", "-", "100", "||", "y", "<", "100", ")", "{", "continue", ";", "}", "else", "{", "break", ";", "}", "}", "SpiritObject", "tmp", "=", "new", "SpiritObject", "(", "x", ",", "y", ")", ";", "tmp", ".", "setBitmap", "(", "BitmapFactory", ".", "decodeResource", "(", "this", ".", "getResources", "(", ")", ",", "R", ".", "drawable", ".", "ic_launcher", ")", ")", ";", "this", ".", "spiritManager", ".", "registerSpirit", "(", "tmp", ")", ";", "}", "}", "}", "</s>" ]
10,408
[ "<s>", "package", "zy", ".", "sheep", ";", "public", "final", "class", "BuildConfig", "{", "public", "final", "static", "boolean", "DEBUG", "=", "true", ";", "}", "</s>" ]
10,409
[ "<s>", "package", "zy", ".", "sheep", ";", "public", "final", "class", "R", "{", "public", "static", "final", "class", "attr", "{", "}", "public", "static", "final", "class", "drawable", "{", "public", "static", "final", "int", "a", "=", "0x7f020000", ";", "public", "static", "final", "int", "b", "=", "0x7f020001", ";", "public", "static", "final", "int", "ic_launcher", "=", "0x7f020002", ";", "}", "public", "static", "final", "class", "layout", "{", "public", "static", "final", "int", "main", "=", "0x7f030000", ";", "}", "public", "static", "final", "class", "string", "{", "public", "static", "final", "int", "app_name", "=", "0x7f040001", ";", "public", "static", "final", "int", "hello", "=", "0x7f040000", ";", "}", "}", "</s>" ]
10,410
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "businesstest", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "Comparator", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "junit", ".", "Assert", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "benedictoxvi", ".", "pe", ".", "business", ".", "AdmCompra", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Compra", ";", "import", "benedictoxvi", ".", "pe", ".", "datatest", ".", "DataBD", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "Loader", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "Validaciones", ";", "public", "class", "AdmCompraTest", "{", "ArrayList", "<", "Compra", ">", "arrCom", "=", "new", "ArrayList", "<", "Compra", ">", "(", ")", ";", "AdmCompra", "admCom", "=", "new", "AdmCompra", "(", ")", ";", "Compra", "objCom", "=", "new", "Compra", "(", ")", ";", "@", "Test", "public", "void", "cuandoFecEmisionMayorFecPagoTest", "(", ")", "{", "Assert", ".", "assertFalse", "(", "admCom", ".", "darAltaCompra", "(", "\"Suministro\"", ",", "40001", ",", "\"12/12/2012\"", ",", "\"FIRAS", "EIRL\"", ",", "4050.00", ",", "729.00", ",", "5229.00", ",", "\"USD\"", ",", "\"30/12/2012\"", ",", "\"Nuevo\"", ",", "\"10/12/2012\"", ",", "\"\"", ")", ")", ";", "}", "@", "Test", "public", "void", "darAltaCompraTest", "(", ")", "{", "Assert", ".", "assertTrue", "(", "admCom", ".", "darAltaCompra", "(", "\"Suministro\"", ",", "40001", ",", "\"12/12/2012\"", ",", "\"FIRAS", "EIRL\"", ",", "4050.00", ",", "729.00", ",", "5229.00", ",", "\"USD\"", ",", "\"30/12/2012\"", ",", "\"Nuevo\"", ",", "\"17/12/2012\"", ",", "\"\"", ")", ")", ";", "}", "@", "Test", "public", "void", "cuandoRegistramosSinLosValoresObligatoriosTest", "(", ")", "{", "Assert", ".", "assertFalse", "(", "admCom", ".", "darAltaCompra", "(", "null", ",", "40001", ",", "\"12/12/2012\"", ",", "\"FIRAS", "EIRL\"", ",", "4050.00", ",", "729.00", ",", "5229.00", ",", "\"USD\"", ",", "\"30/12/2012\"", ",", "\"Nuevo\"", ",", "\"17/12/2012\"", ",", "\"\"", ")", ")", ";", "}", "@", "Test", "public", "void", "cuandoRegistroCompraMismoNumeroTest", "(", ")", "{", "Assert", ".", "assertTrue", "(", "admCom", ".", "darAltaCompra", "(", "\"Suministro\"", ",", "40001", ",", "\"12/12/2012\"", ",", "\"FIRAS", "EIRL\"", ",", "4050.00", ",", "729.00", ",", "5229.00", ",", "\"USD\"", ",", "\"30/12/2012\"", ",", "\"Nuevo\"", ",", "\"17/12/2012\"", ",", "\"\"", ")", ")", ";", "Assert", ".", "assertFalse", "(", "admCom", ".", "darAltaCompra", "(", "\"Suministro", "2\"", ",", "40001", ",", "\"12/12/2012\"", ",", "\"FIRAS", "EIRL\"", ",", "4050.00", ",", "729.00", ",", "5229.00", ",", "\"USD\"", ",", "\"30/12/2012\"", ",", "\"Nuevo\"", ",", "\"17/12/2012\"", ",", "\"\"", ")", ")", ";", "}", "@", "Test", "public", "void", "buscarEncontrarComprasTest", "(", ")", "{", "Assert", ".", "assertTrue", "(", "admCom", ".", "encontrarCompras", "(", "\"Compra\"", ",", "0", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ")", ".", "size", "(", ")", ">", "0", ")", ";", "}", "@", "Test", "public", "void", "buscarSinEncontrarComprasTest", "(", ")", "{", "Assert", ".", "assertTrue", "(", "admCom", ".", "encontrarCompras", "(", "\"Accesorios\"", ",", "0", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ")", ".", "size", "(", ")", "==", "0", ")", ";", "}", "@", "Test", "public", "void", "anularCompraTest", "(", ")", "{", "Compra", "compra", "=", "admCom", ".", "getCompraByNum", "(", "50001", ")", ";", "Assert", ".", "assertEquals", "(", "\"NUEVA\"", ",", "compra", ".", "getEstado", "(", ")", ")", ";", "Assert", ".", "assertTrue", "(", "admCom", ".", "anularCompra", "(", "50001", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"ANULADA\"", ",", "compra", ".", "getEstado", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "pagarCompraTest", "(", ")", "{", "Compra", "compra", "=", "admCom", ".", "getCompraByNum", "(", "50001", ")", ";", "Assert", ".", "assertEquals", "(", "\"NUEVA\"", ",", "compra", ".", "getEstado", "(", ")", ")", ";", "Assert", ".", "assertTrue", "(", "admCom", ".", "pagarCompra", "(", "compra", ".", "getNumero", "(", ")", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"CANCELADA\"", ",", "compra", ".", "getEstado", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "anularCompraPagadaTest", "(", ")", "{", "Compra", "compra", "=", "admCom", ".", "getCompraByNum", "(", "50005", ")", ";", "Assert", ".", "assertEquals", "(", "\"CANCELADA\"", ",", "compra", ".", "getEstado", "(", ")", ")", ";", "Assert", ".", "assertFalse", "(", "admCom", ".", "anularCompra", "(", "compra", ".", "getNumero", "(", ")", ")", ")", ";", "}", "@", "Test", "public", "void", "pagarCompraAnuladaTest", "(", ")", "{", "Compra", "compra", "=", "admCom", ".", "getCompraByNum", "(", "50014", ")", ";", "Assert", ".", "assertEquals", "(", "\"ANULADA\"", ",", "compra", ".", "getEstado", "(", ")", ")", ";", "Assert", ".", "assertFalse", "(", "admCom", ".", "pagarCompra", "(", "compra", ".", "getNumero", "(", ")", ")", ")", ";", "}", "}", "</s>" ]
10,411
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "businesstest", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertTrue", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Date", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "junit", ".", "Assert", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "BeforeClass", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "benedictoxvi", ".", "pe", ".", "business", ".", "AdmVenta", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Cliente", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Compra", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Prospecto", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Venta", ";", "import", "benedictoxvi", ".", "pe", ".", "datatest", ".", "DataBD", ";", "public", "class", "AdmVentaTest", "{", "AdmVenta", "objAdmVenta", "=", "new", "AdmVenta", "(", ")", ";", "ArrayList", "<", "Venta", ">", "arrVenta", "=", "new", "ArrayList", "<", "Venta", ">", "(", ")", ";", "static", "ArrayList", "<", "Venta", ">", "arrMovimiento", "=", "new", "ArrayList", "<", "Venta", ">", "(", ")", ";", "@", "BeforeClass", "public", "static", "void", "cargarData", "(", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "cargarCursos", "(", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "cargarCliente", "(", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "cargarMovimientos", "(", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "}", "public", "void", "registrarVentaConBoleta", "(", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "listarMovimientos", "(", ")", ";", "int", "nroMovimiento", "=", "5", ";", "String", "CodTipoDocumento", "=", "\"1\"", ";", "String", "CodCurso", "=", "\"C01\"", ";", "String", "NomCuro", ";", "double", "PreCurso", ";", "int", "CanCurso", ";", "String", "NomEmpleado", ";", "String", "ApeEmpleado", ";", "String", "CodEmpleado", ";", "String", "CodCliente", "=", "\"CL00006\"", ";", "String", "CodTipCliente", ";", "String", "NroRucCliente", ";", "String", "nomCliente", "=", "\"Jose", "Salazar\"", ";", "String", "ApePatCliente", ";", "String", "ApeMatCliente", ";", "String", "FecEmision", "=", "\"12/12/2012\"", ";", "String", "NomEmpresa", "=", "\"FIRAS", "EIRL\"", ";", "Double", "Subtot", "=", "5000.00", ";", "Double", "MonIGV", "=", "900.00", ";", "Double", "MonTot", "=", "5900.00", ";", "String", "Moneda", "=", "\"USD\"", ";", "String", "FecVencim", "=", "\"10/12/2013\"", ";", "String", "Estado", "=", "\"Pagada\"", ";", "String", "FecPagoReal", "=", "\"20/12/2012\"", ";", "String", "Observ", "=", "\"\"", ";", "String", "concepto", "=", "\"\"", ";", "assertTrue", "(", "objAdmVenta", ".", "registrarPagoConBoleta", "(", "arrVenta", ",", "nroMovimiento", ",", "CodTipoDocumento", ",", "CodCurso", ",", "CodCliente", ",", "nomCliente", ",", "concepto", ",", "FecEmision", ",", "Subtot", ",", "MonIGV", ",", "MonTot", ",", "Moneda", ",", "FecVencim", ",", "Estado", ",", "FecPagoReal", ",", "Observ", ")", ")", ";", "arrMovimiento", ".", "add", "(", "arrVenta", ".", "get", "(", "0", ")", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "listarMovimientos", "(", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "}", "public", "void", "registrarVentaConFactura", "(", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "listarMovimientos", "(", ")", ";", "int", "nroMovimiento", "=", "6", ";", "String", "CodTipoDocumento", "=", "\"2\"", ";", "String", "CodCurso", "=", "\"C01\"", ";", "String", "NomCuro", ";", "double", "PreCurso", ";", "int", "CanCurso", ";", "String", "NomEmpleado", ";", "String", "ApeEmpleado", ";", "String", "CodEmpleado", ";", "String", "CodCliente", "=", "\"CL00005\"", ";", "String", "CodTipCliente", ";", "String", "NroRucCliente", "=", "\"41045820790\"", ";", "String", "nomCliente", "=", "\"\"", ";", "String", "ApePatCliente", ";", "String", "ApeMatCliente", ";", "String", "FecEmision", "=", "\"12/12/2012\"", ";", "String", "NomEmpresa", "=", "\"FIRAS", "EIRL\"", ";", "Double", "Subtot", "=", "5000.00", ";", "Double", "MonIGV", "=", "900.00", ";", "Double", "MonTot", "=", "5900.00", ";", "String", "Moneda", "=", "\"USD\"", ";", "String", "FecVencim", "=", "\"02/12/2013\"", ";", "String", "Estado", "=", "\"Pagada\"", ";", "String", "FecPagoReal", "=", "\"20/12/2012\"", ";", "String", "Observ", "=", "\"\"", ";", "String", "concepto", "=", "\"\"", ";", "assertTrue", "(", "objAdmVenta", ".", "registrarPagoConFactura", "(", "arrMovimiento", ",", "nroMovimiento", ",", "CodTipoDocumento", ",", "CodCurso", ",", "CodCliente", ",", "nomCliente", ",", "NroRucCliente", ",", "concepto", ",", "FecEmision", ",", "Subtot", ",", "MonIGV", ",", "MonTot", ",", "Moneda", ",", "FecVencim", ",", "Estado", ",", "FecPagoReal", ",", "Observ", ")", ")", ";", "arrMovimiento", ".", "add", "(", "arrVenta", ".", "get", "(", "0", ")", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "listarMovimientos", "(", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "registrarPagoBoleta", "(", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "int", "NroMovimiento", "=", "7", ";", "String", "TipoComprobante", "=", "\"1\"", ";", "String", "NroBoleta", "=", "\"BV-000130\"", ";", "String", "RUC", "=", "\"\"", ";", "String", "Observacion", "=", "\"\"", ";", "String", "UsuarioRegistro", "=", "\"eLopez\"", ";", "Date", "FechaRegistro", ";", "String", "CodCliente", "=", "\"C1010\"", ";", "String", "CodCuenta", "=", "\"CU000001\"", ";", "List", "<", "Venta", ">", "arrNroCuota", "=", "new", "ArrayList", "<", "Venta", ">", "(", ")", ";", "Venta", "oVenCuota", "=", "null", ";", "oVenCuota", "=", "new", "Venta", "(", ")", ";", "oVenCuota", ".", "setNroCuota", "(", "3", ")", ";", "arrNroCuota", ".", "add", "(", "oVenCuota", ")", ";", "assertTrue", "(", "objAdmVenta", ".", "registraPagoBoletaFactura", "(", "arrMovimiento", ",", "NroMovimiento", ",", "TipoComprobante", ",", "NroBoleta", ",", "RUC", ",", "CodCliente", ",", "CodCuenta", ",", "arrNroCuota", ",", "UsuarioRegistro", ")", ")", ";", "}", "@", "Test", "public", "void", "registrarPagoFacturaCuota1_2", "(", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "int", "NroMovimiento", "=", "8", ";", "String", "TipoComprobante", "=", "\"2\"", ";", "String", "NroBoleta", "=", "\"FC-000001\"", ";", "String", "RUC", "=", "\"11045820790\"", ";", "String", "Observacion", "=", "\"\"", ";", "String", "UsuarioRegistro", "=", "\"pmora\"", ";", "Date", "FechaRegistro", ";", "String", "CodCliente", "=", "\"C1015\"", ";", "String", "CodCuenta", "=", "\"CU000002\"", ";", "List", "<", "Venta", ">", "arrNroCuota", "=", "new", "ArrayList", "<", "Venta", ">", "(", ")", ";", "Venta", "oVenCuota", "=", "null", ";", "oVenCuota", "=", "new", "Venta", "(", ")", ";", "oVenCuota", ".", "setNroCuota", "(", "1", ")", ";", "arrNroCuota", ".", "add", "(", "oVenCuota", ")", ";", "oVenCuota", "=", "new", "Venta", "(", ")", ";", "oVenCuota", ".", "setNroCuota", "(", "2", ")", ";", "arrNroCuota", ".", "add", "(", "oVenCuota", ")", ";", "assertTrue", "(", "objAdmVenta", ".", "registraPagoBoletaFactura", "(", "arrMovimiento", ",", "NroMovimiento", ",", "TipoComprobante", ",", "NroBoleta", ",", "RUC", ",", "CodCliente", ",", "CodCuenta", ",", "arrNroCuota", ",", "UsuarioRegistro", ")", ")", ";", "}", "@", "Test", "public", "void", "registrarPagoFacturaCuota3", "(", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "int", "NroMovimiento", "=", "9", ";", "String", "TipoComprobante", "=", "\"2\"", ";", "String", "NroBoleta", "=", "\"FC-000002\"", ";", "String", "RUC", "=", "\"11045820790\"", ";", "String", "Observacion", "=", "\"\"", ";", "String", "UsuarioRegistro", "=", "\"pmora\"", ";", "Date", "FechaRegistro", ";", "String", "CodCliente", "=", "\"C1015\"", ";", "String", "CodCuenta", "=", "\"CU000002\"", ";", "List", "<", "Venta", ">", "arrNroCuota", "=", "new", "ArrayList", "<", "Venta", ">", "(", ")", ";", "Venta", "oVenCuota", "=", "null", ";", "oVenCuota", "=", "new", "Venta", "(", ")", ";", "oVenCuota", ".", "setNroCuota", "(", "3", ")", ";", "arrNroCuota", ".", "add", "(", "oVenCuota", ")", ";", "assertTrue", "(", "objAdmVenta", ".", "registraPagoBoletaFactura", "(", "arrMovimiento", ",", "NroMovimiento", ",", "TipoComprobante", ",", "NroBoleta", ",", "RUC", ",", "CodCliente", ",", "CodCuenta", ",", "arrNroCuota", ",", "UsuarioRegistro", ")", ")", ";", "}", "@", "Test", "public", "void", "registrarPagoBoletaCuota2", "(", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "int", "NroMovimiento", "=", "10", ";", "String", "TipoComprobante", "=", "\"1\"", ";", "String", "NroBoleta", "=", "\"BV-000133\"", ";", "String", "RUC", "=", "\"\"", ";", "String", "Observacion", "=", "\"\"", ";", "String", "UsuarioRegistro", "=", "\"eLopez\"", ";", "Date", "FechaRegistro", ";", "String", "CodCliente", "=", "\"C1010\"", ";", "String", "CodCuenta", "=", "\"CU000001\"", ";", "List", "<", "Venta", ">", "arrNroCuota", "=", "new", "ArrayList", "<", "Venta", ">", "(", ")", ";", "Venta", "oVenCuota", "=", "null", ";", "oVenCuota", "=", "new", "Venta", "(", ")", ";", "oVenCuota", ".", "setNroCuota", "(", "3", ")", ";", "arrNroCuota", ".", "add", "(", "oVenCuota", ")", ";", "assertTrue", "(", "objAdmVenta", ".", "registraPagoBoletaFactura", "(", "arrMovimiento", ",", "NroMovimiento", ",", "TipoComprobante", ",", "NroBoleta", ",", "RUC", ",", "CodCliente", ",", "CodCuenta", ",", "arrNroCuota", ",", "UsuarioRegistro", ")", ")", ";", "}", "@", "Test", "public", "void", "listarMovimientos", "(", ")", "{", "ArrayList", "<", "Venta", ">", "arrlstMovimiento", "=", "objAdmVenta", ".", "listarMovimientos", "(", "arrMovimiento", ")", ";", "Assert", ".", "assertTrue", "(", "arrlstMovimiento", ".", "size", "(", ")", ">=", "0", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "listarMovimientosBoleta", "(", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "String", "codTipoDocumento", "=", "\"1\"", ";", "ArrayList", "<", "Venta", ">", "arrlstMovimiento", "=", "objAdmVenta", ".", "listarMovimientosTipoDocumento", "(", "arrMovimiento", ",", "codTipoDocumento", ")", ";", "Assert", ".", "assertTrue", "(", "arrlstMovimiento", ".", "size", "(", ")", ">=", "0", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "listarMovimientosFactura", "(", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "String", "codTipoDocumento", "=", "\"2\"", ";", "ArrayList", "<", "Venta", ">", "arrlstMovimiento", "=", "objAdmVenta", ".", "listarMovimientosTipoDocumento", "(", "arrMovimiento", ",", "codTipoDocumento", ")", ";", "Assert", ".", "assertTrue", "(", "arrlstMovimiento", ".", "size", "(", ")", ">=", "0", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "listarDetalleMovimiento", "(", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "int", "nroMovimiento", "=", "2", ";", "ArrayList", "<", "Venta", ">", "arrlstMovimiento", "=", "objAdmVenta", ".", "listarDetalleMovimiento", "(", "arrMovimiento", ",", "nroMovimiento", ")", ";", "Assert", ".", "assertTrue", "(", "arrlstMovimiento", ".", "size", "(", ")", ">=", "0", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "listarDetalleMovimientoInexistente", "(", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "int", "nroMovimiento", "=", "6", ";", "ArrayList", "<", "Venta", ">", "arrlstMovimiento", "=", "objAdmVenta", ".", "listarDetalleMovimiento", "(", "arrMovimiento", ",", "nroMovimiento", ")", ";", "Assert", ".", "assertTrue", "(", "arrlstMovimiento", ".", "size", "(", ")", ">=", "0", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "anularFactura", "(", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "listarMovimientos", "(", ")", ";", "int", "nroMovimiento", "=", "4", ";", "String", "Estado", "=", "\"Pagada\"", ";", "assertTrue", "(", "objAdmVenta", ".", "anularDocumento", "(", "arrMovimiento", ",", "nroMovimiento", ")", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "listarMovimientos", "(", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "resumenMovimientos", "(", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "listarMovimientos", "(", ")", ";", "Double", "SumTotal", "=", "0.0", ";", "for", "(", "Venta", "oMovi", ":", "arrMovimiento", ")", "{", "SumTotal", "=", "SumTotal", "+", "oMovi", ".", "getMonTotal", "(", ")", ";", "}", "System", ".", "out", ".", "println", "(", "\"\"", "+", "SumTotal", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "}", "public", "static", "void", "cargarCursos", "(", ")", "{", "List", "<", "Venta", ">", "olstCurso", "=", "new", "ArrayList", "<", "Venta", ">", "(", ")", ";", "Venta", "objVenta", "=", "new", "Venta", "(", ")", ";", "olstCurso", "=", "objVenta", ".", "getDataCursos", "(", ")", ";", "for", "(", "Venta", "oVenta", ":", "olstCurso", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "oVenta", ".", "getCodCurso", "(", ")", "+", "\"\"", "+", "oVenta", ".", "getNomCurso", "(", ")", "+", "\"\"", "+", "oVenta", ".", "getPreCurso", "(", ")", ")", ";", "}", "}", "public", "static", "void", "cargarCliente", "(", ")", "{", "DataBD", "objData", "=", "new", "DataBD", "(", ")", ";", "List", "<", "Cliente", ">", "olstCliente", "=", "new", "ArrayList", "<", "Cliente", ">", "(", ")", ";", "olstCliente", "=", "objData", ".", "getDataCliente", "(", ")", ";", "for", "(", "Cliente", "oCliente", ":", "olstCliente", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "oCliente", ".", "getCodCliente", "(", ")", "+", "\"\"", "+", "oCliente", ".", "getNomCliente", "(", ")", "+", "\"", "DNI", ":\"", "+", "oCliente", ".", "getDniCliente", "(", ")", ")", ";", "}", "}", "static", "void", "cargarMovimientos", "(", ")", "{", "Venta", "objVenta", ";", "int", "nroMovimiento", "=", "1", ";", "String", "codTipoDocumento", "=", "\"2\"", ";", "String", "codCurso", "=", "\"C01\"", ";", "String", "nomCurso", ";", "double", "preCurso", ";", "int", "CanCurso", ";", "String", "NomEmpleado", ";", "String", "ApeEmpleado", ";", "String", "CodEmpleado", ";", "String", "codCliente", "=", "\"CL00001\"", ";", "String", "codTipCliente", ";", "String", "nroDniCliente", "=", "\"45820790\"", ";", "String", "nroRucCliente", "=", "\"12345820790\"", ";", "String", "nomCliente", "=", "\"\"", ";", "String", "ApePatCliente", ";", "String", "ApeMatCliente", ";", "String", "nomEmpresa", "=", "\"FIRAS", "EIRL\"", ";", "String", "concepto", "=", "\"\"", ";", "String", "fecEmision", "=", "\"12/12/2012\"", ";", "Double", "subTotal", "=", "5000.00", ";", "Double", "monIGV", "=", "900.00", ";", "Double", "monTotal", "=", "5900.00", ";", "String", "moneda", "=", "\"USD\"", ";", "String", "fecVencim", "=", "\"30/12/2012\"", ";", "String", "estado", "=", "\"Nuevo\"", ";", "String", "fecPagoReal", "=", "\"20/12/2012\"", ";", "String", "observacion", "=", "\"\"", ";", "objVenta", "=", "new", "Venta", "(", ")", ";", "objVenta", ".", "setNumero", "(", "nroMovimiento", ")", ";", "objVenta", ".", "setCodTipoDocumento", "(", "codTipoDocumento", ")", ";", "objVenta", ".", "setCodCurso", "(", "codCurso", ")", ";", "objVenta", ".", "setCodCliente", "(", "codCliente", ")", ";", "objVenta", ".", "setNomCliente", "(", "nomCliente", ")", ";", "objVenta", ".", "setNroRucCliente", "(", "nroRucCliente", ")", ";", "objVenta", ".", "setConcepto", "(", "concepto", ")", ";", "objVenta", ".", "setFecEmision", "(", "fecEmision", ")", ";", "objVenta", ".", "setMonSubtot", "(", "subTotal", ")", ";", "objVenta", ".", "setMonIGV", "(", "monIGV", ")", ";", "objVenta", ".", "setMonTotal", "(", "monTotal", ")", ";", "objVenta", ".", "setMoneda", "(", "moneda", ")", ";", "objVenta", ".", "setFecVencim", "(", "fecVencim", ")", ";", "objVenta", ".", "setEstado", "(", "estado", ")", ";", "objVenta", ".", "setFecPago", "(", "fecPagoReal", ")", ";", "objVenta", ".", "setObservacion", "(", "observacion", ")", ";", "arrMovimiento", ".", "add", "(", "objVenta", ")", ";", "nroMovimiento", "=", "2", ";", "codTipoDocumento", "=", "\"2\"", ";", "codCurso", "=", "\"C01\"", ";", "codCliente", "=", "\"CL00002\"", ";", "nroDniCliente", "=", "\"45820791\"", ";", "nroRucCliente", "=", "\"67845820790\"", ";", "nomCliente", "=", "\"Luis", "Jimenez\"", ";", "concepto", "=", "\"\"", ";", "fecEmision", "=", "\"13/04/2012\"", ";", "subTotal", "=", "10000.00", ";", "monIGV", "=", "1800.00", ";", "monTotal", "=", "11800.00", ";", "moneda", "=", "\"USD\"", ";", "fecVencim", "=", "\"30/02/2012\"", ";", "estado", "=", "\"Nuevo\"", ";", "fecPagoReal", "=", "\"20/12/2012\"", ";", "observacion", "=", "\"\"", ";", "objVenta", "=", "new", "Venta", "(", ")", ";", "objVenta", ".", "setNumero", "(", "nroMovimiento", ")", ";", "objVenta", ".", "setCodTipoDocumento", "(", "codTipoDocumento", ")", ";", "objVenta", ".", "setCodCurso", "(", "codCurso", ")", ";", "objVenta", ".", "setCodCliente", "(", "codCliente", ")", ";", "objVenta", ".", "setNomCliente", "(", "nomCliente", ")", ";", "objVenta", ".", "setNroRucCliente", "(", "nroRucCliente", ")", ";", "objVenta", ".", "setConcepto", "(", "concepto", ")", ";", "objVenta", ".", "setFecEmision", "(", "fecEmision", ")", ";", "objVenta", ".", "setMonSubtot", "(", "subTotal", ")", ";", "objVenta", ".", "setMonIGV", "(", "monIGV", ")", ";", "objVenta", ".", "setMonTotal", "(", "monTotal", ")", ";", "objVenta", ".", "setMoneda", "(", "moneda", ")", ";", "objVenta", ".", "setFecVencim", "(", "fecVencim", ")", ";", "objVenta", ".", "setEstado", "(", "estado", ")", ";", "objVenta", ".", "setFecPago", "(", "fecPagoReal", ")", ";", "objVenta", ".", "setObservacion", "(", "observacion", ")", ";", "arrMovimiento", ".", "add", "(", "objVenta", ")", ";", "nroMovimiento", "=", "3", ";", "codTipoDocumento", "=", "\"1\"", ";", "codCurso", "=", "\"C01\"", ";", "codCliente", "=", "\"CL00003\"", ";", "nroDniCliente", "=", "\"45820792\"", ";", "nomCliente", "=", "\"\"", ";", "concepto", "=", "\"\"", ";", "fecEmision", "=", "\"13/04/2012\"", ";", "subTotal", "=", "10000.00", ";", "monIGV", "=", "1800.00", ";", "monTotal", "=", "11800.00", ";", "moneda", "=", "\"USD\"", ";", "fecVencim", "=", "\"19/12/2012\"", ";", "estado", "=", "\"Nuevo\"", ";", "fecPagoReal", "=", "\"20/12/2012\"", ";", "observacion", "=", "\"\"", ";", "objVenta", "=", "new", "Venta", "(", ")", ";", "objVenta", ".", "setNumero", "(", "nroMovimiento", ")", ";", "objVenta", ".", "setCodTipoDocumento", "(", "codTipoDocumento", ")", ";", "objVenta", ".", "setCodCurso", "(", "codCurso", ")", ";", "objVenta", ".", "setCodCliente", "(", "codCliente", ")", ";", "objVenta", ".", "setNomCliente", "(", "nomCliente", ")", ";", "objVenta", ".", "setNroRucCliente", "(", "nroRucCliente", ")", ";", "objVenta", ".", "setConcepto", "(", "concepto", ")", ";", "objVenta", ".", "setFecEmision", "(", "fecEmision", ")", ";", "objVenta", ".", "setMonSubtot", "(", "subTotal", ")", ";", "objVenta", ".", "setMonIGV", "(", "monIGV", ")", ";", "objVenta", ".", "setMonTotal", "(", "monTotal", ")", ";", "objVenta", ".", "setMoneda", "(", "moneda", ")", ";", "objVenta", ".", "setFecVencim", "(", "fecVencim", ")", ";", "objVenta", ".", "setEstado", "(", "estado", ")", ";", "objVenta", ".", "setFecPago", "(", "fecPagoReal", ")", ";", "objVenta", ".", "setObservacion", "(", "observacion", ")", ";", "arrMovimiento", ".", "add", "(", "objVenta", ")", ";", "nroMovimiento", "=", "4", ";", "codTipoDocumento", "=", "\"1\"", ";", "codCurso", "=", "\"C01\"", ";", "codCliente", "=", "\"CL00004\"", ";", "nroDniCliente", "=", "\"45820792\"", ";", "nomCliente", "=", "\"\"", ";", "concepto", "=", "\"\"", ";", "fecEmision", "=", "\"13/04/2012\"", ";", "subTotal", "=", "10000.00", ";", "monIGV", "=", "1800.00", ";", "monTotal", "=", "11800.00", ";", "moneda", "=", "\"USD\"", ";", "fecVencim", "=", "\"21/05/2012\"", ";", "estado", "=", "\"Nuevo\"", ";", "fecPagoReal", "=", "\"20/12/2012\"", ";", "observacion", "=", "\"\"", ";", "objVenta", "=", "new", "Venta", "(", ")", ";", "objVenta", ".", "setNumero", "(", "nroMovimiento", ")", ";", "objVenta", ".", "setCodTipoDocumento", "(", "codTipoDocumento", ")", ";", "objVenta", ".", "setCodCurso", "(", "codCurso", ")", ";", "objVenta", ".", "setCodCliente", "(", "codCliente", ")", ";", "objVenta", ".", "setNomCliente", "(", "nomCliente", ")", ";", "objVenta", ".", "setNroRucCliente", "(", "nroRucCliente", ")", ";", "objVenta", ".", "setConcepto", "(", "concepto", ")", ";", "objVenta", ".", "setFecEmision", "(", "fecEmision", ")", ";", "objVenta", ".", "setMonSubtot", "(", "subTotal", ")", ";", "objVenta", ".", "setMonIGV", "(", "monIGV", ")", ";", "objVenta", ".", "setMonTotal", "(", "monTotal", ")", ";", "objVenta", ".", "setMoneda", "(", "moneda", ")", ";", "objVenta", ".", "setFecVencim", "(", "fecVencim", ")", ";", "objVenta", ".", "setEstado", "(", "estado", ")", ";", "objVenta", ".", "setFecPago", "(", "fecPagoReal", ")", ";", "objVenta", ".", "setObservacion", "(", "observacion", ")", ";", "arrMovimiento", ".", "add", "(", "objVenta", ")", ";", "}", "}", "</s>" ]
10,412
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "businesstest", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "org", ".", "junit", ".", "Assert", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "benedictoxvi", ".", "pe", ".", "business", ".", "AdmProspecto", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Prospecto", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "Loader", ";", "public", "class", "AdmProspectoTest", "{", "ArrayList", "<", "Prospecto", ">", "arrPro", "=", "new", "ArrayList", "<", "Prospecto", ">", "(", ")", ";", "AdmProspecto", "admPro", "=", "new", "AdmProspecto", "(", ")", ";", "@", "Test", "public", "void", "findEncontrarProspectoTest", "(", ")", "{", "String", "nombs", "=", "\"u\"", ",", "apepat", "=", "\"\"", ",", "apemat", "=", "\"\"", ",", "mail", "=", "\"\"", ",", "dni", "=", "\"\"", ",", "tel_cel", "=", "\"\"", ",", "fecha", "=", "\"\"", ";", "ArrayList", "<", "Prospecto", ">", "filtroPro", "=", "admPro", ".", "findProspecto", "(", "nombs", ",", "apepat", ",", "apemat", ",", "mail", ",", "dni", ",", "tel_cel", ",", "fecha", ",", "\"\"", ")", ";", "Assert", ".", "assertTrue", "(", "filtroPro", ".", "size", "(", ")", ">=", "0", ")", ";", "}", "@", "Test", "public", "void", "findSinEncontrarProspectoTest", "(", ")", "{", "String", "nombs", "=", "\"Marcos\"", ",", "apepat", "=", "\"\"", ",", "apemat", "=", "\"\"", ",", "mail", "=", "\"\"", ",", "dni", "=", "\"\"", ",", "tel_cel", "=", "\"\"", ",", "fecha", "=", "\"\"", ";", "ArrayList", "<", "Prospecto", ">", "filtroPro", "=", "admPro", ".", "findProspecto", "(", "nombs", ",", "apepat", ",", "apemat", ",", "mail", ",", "dni", ",", "tel_cel", ",", "fecha", ",", "\"\"", ")", ";", "Assert", ".", "assertTrue", "(", "filtroPro", ".", "size", "(", ")", "==", "0", ")", ";", "}", "@", "Test", "public", "void", "darAltaProspecto", "(", ")", "{", "Assert", ".", "assertEquals", "(", "\"", "\"", ",", "admPro", ".", "getProspectoByNum", "(", "1003", ")", ".", "getEstado", "(", ")", ")", ";", "Assert", ".", "assertTrue", "(", "admPro", ".", "deProspectoToCliente", "(", "1003", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"C\"", ",", "admPro", ".", "getProspectoByNum", "(", "1003", ")", ".", "getEstado", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "darAltaProspectoAClienteExistente", "(", ")", "{", "Assert", ".", "assertEquals", "(", "\"", "\"", ",", "admPro", ".", "getProspectoByNum", "(", "1001", ")", ".", "getEstado", "(", ")", ")", ";", "Assert", ".", "assertTrue", "(", "admPro", ".", "deProspectoToCliente", "(", "1001", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"C\"", ",", "admPro", ".", "getProspectoByNum", "(", "1001", ")", ".", "getEstado", "(", ")", ")", ";", "Assert", ".", "assertFalse", "(", "admPro", ".", "deProspectoToCliente", "(", "1001", ")", ")", ";", "}", "@", "Test", "public", "void", "modificarProspecto", "(", ")", "{", "Assert", ".", "assertNotSame", "(", "\"Enrique", "Luis\"", ",", "admPro", ".", "getProspectoByNum", "(", "1000", ")", ".", "getNombes", "(", ")", ")", ";", "Assert", ".", "assertTrue", "(", "admPro", ".", "modifcarProspecto", "(", "1000", ",", "null", ",", "\"Enrique", "Luis\"", ",", "\"Aguilar\"", ",", "\"Olivera\"", ",", "null", ",", "null", ",", "null", ",", "null", ",", "null", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"Enrique", "Luis\"", ",", "admPro", ".", "getProspectoByNum", "(", "1000", ")", ".", "getNombes", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "registrarProspectoTest", "(", ")", "{", "Assert", ".", "assertNull", "(", "admPro", ".", "getProspectoByNum", "(", "1", ")", ")", ";", "Assert", ".", "assertTrue", "(", "admPro", ".", "registrarProspecto", "(", "1", ",", "\"01/01/2013\"", ",", "\"Luis", "Enrique\"", ",", "\"Olivera\"", ",", "\"Aguilar\"", ",", "\"\"", ",", "\"34612331\"", ",", "\"3533332\"", ",", "\"983422323\"", ",", "\"\"", ")", ")", ";", "Assert", ".", "assertNotNull", "(", "admPro", ".", "getProspectoByNum", "(", "1", ")", ")", ";", "}", "@", "Test", "public", "void", "eliminarProspectoTest", "(", ")", "{", "int", "num_pro", "=", "1001", ";", "Assert", ".", "assertNotNull", "(", "admPro", ".", "getProspectoByNum", "(", "num_pro", ")", ")", ";", "Assert", ".", "assertTrue", "(", "admPro", ".", "eliminarProspecto", "(", "num_pro", ")", ")", ";", "Assert", ".", "assertNull", "(", "admPro", ".", "getProspectoByNum", "(", "num_pro", ")", ")", ";", "}", "}", "</s>" ]
10,413
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "businesstest", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "junit", ".", "framework", ".", "Assert", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "benedictoxvi", ".", "pe", ".", "business", ".", "AdmGrupoEstudio", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Cliente", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "GrupoEstudio", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "Loader", ";", "public", "class", "AdmGrupoEstudioTest", "{", "ArrayList", "<", "GrupoEstudio", ">", "arrGru", "=", "new", "ArrayList", "<", "GrupoEstudio", ">", "(", ")", ";", "AdmGrupoEstudio", "admGru", "=", "new", "AdmGrupoEstudio", "(", ")", ";", "@", "Test", "public", "void", "encontrarGruposEstudioTest", "(", ")", "{", "Assert", ".", "assertTrue", "(", "admGru", ".", "encontrarGrupoEstudio", "(", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ")", ".", "size", "(", ")", ">", "0", ")", ";", "}", "@", "Test", "public", "void", "sinEncontrarGruposEstudioTest", "(", ")", "{", "Assert", ".", "assertEquals", "(", "0", ",", "admGru", ".", "encontrarGrupoEstudio", "(", "\"Otro\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ")", ".", "size", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "registraGrupoEstudioTest", "(", ")", "{", "Assert", ".", "assertTrue", "(", "admGru", ".", "registraGrupoEstudio", "(", "\"GP2001\"", ",", "\"Nombre", "Grupo\"", ",", "\"Descripcion\"", ",", "\"Academia\"", ",", "\"Curso\"", ",", "\"01/01/2012\"", ",", "\"30/06/2012\"", ",", "new", "String", "[", "]", "{", "\"Instructor1\"", ",", "\"Instructor2\"", "}", ",", "\"\"", ",", "\"LOCAL", "SM\"", ",", "231", ",", "343.00", ",", "123.00", ")", ")", ";", "}", "@", "Test", "public", "void", "registraGrupoEstudioSinNomGrupoTest", "(", ")", "{", "Assert", ".", "assertFalse", "(", "admGru", ".", "registraGrupoEstudio", "(", "\"\"", ",", "\"\"", ",", "\"Descripcion\"", ",", "\"Academia\"", ",", "\"Curso\"", ",", "\"01/01/2012\"", ",", "\"30/06/2012\"", ",", "new", "String", "[", "]", "{", "\"Instructor1\"", ",", "\"Instructor2\"", "}", ",", "\"\"", ",", "\"LOCAL", "SM\"", ",", "231", ",", "343.00", ",", "123.00", ")", ")", ";", "}", "@", "Test", "public", "void", "registraGrupoEstudioSinFechasTest", "(", ")", "{", "Assert", ".", "assertFalse", "(", "admGru", ".", "registraGrupoEstudio", "(", "\"GP2003\"", ",", "\"Nom", "Grupo\"", ",", "\"Descripcion\"", ",", "\"Academia\"", ",", "\"Curso\"", ",", "\"\"", ",", "\"\"", ",", "new", "String", "[", "]", "{", "\"Instructor1\"", ",", "\"Instructor2\"", "}", ",", "\"\"", ",", "\"LOCAL", "SM\"", ",", "231", ",", "343.00", ",", "123.00", ")", ")", ";", "}", "@", "Test", "public", "void", "registraGrupoEstudioConFechaErrorTest", "(", ")", "{", "Assert", ".", "assertFalse", "(", "admGru", ".", "registraGrupoEstudio", "(", "\"GP2001\"", ",", "\"Nom", "Grupo\"", ",", "\"Descripcion\"", ",", "\"Academia\"", ",", "\"Curso\"", ",", "\"34/13/2010\"", ",", "\"\"", ",", "new", "String", "[", "]", "{", "\"Instructor1\"", ",", "\"Instructor2\"", "}", ",", "\"\"", ",", "\"LOCAL", "SM\"", ",", "231", ",", "343.00", ",", "123.00", ")", ")", ";", "}", "@", "Test", "public", "void", "registraGrupoEstudioConRangoFechaErrorTest", "(", ")", "{", "Assert", ".", "assertFalse", "(", "admGru", ".", "registraGrupoEstudio", "(", "\"GP2001\"", ",", "\"Nom", "Grupo\"", ",", "\"Descripcion\"", ",", "\"Academia\"", ",", "\"Curso\"", ",", "\"31/12/2010\"", ",", "\"01/12/2010\"", ",", "new", "String", "[", "]", "{", "\"Instructor1\"", ",", "\"Instructor2\"", "}", ",", "\"\"", ",", "\"LOCAL", "SM\"", ",", "231", ",", "343.00", ",", "123.00", ")", ")", ";", "}", "@", "Test", "public", "void", "agregarAlumnoPorClienteGrupoEstudioTest", "(", ")", "{", "GrupoEstudio", "grupo", "=", "admGru", ".", "getGrupoById", "(", "\"GP1001\"", ")", ";", "int", "num_alumnos", "=", "grupo", ".", "getNumAlumnos", "(", ")", ";", "Assert", ".", "assertTrue", "(", "admGru", ".", "addAlumnoGrupoEstudio", "(", "grupo", ".", "getCodGrupo", "(", ")", ",", "\"C1008\"", ")", ")", ";", "Assert", ".", "assertEquals", "(", "num_alumnos", "+", "1", ",", "grupo", ".", "getInscritos", "(", ")", ".", "size", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "agregarAlumnoPorClienteExistenteGrupoEstudioTest", "(", ")", "{", "GrupoEstudio", "grupo", "=", "admGru", ".", "getGrupoById", "(", "\"GP1001\"", ")", ";", "Assert", ".", "assertTrue", "(", "admGru", ".", "addAlumnoGrupoEstudio", "(", "grupo", ".", "getCodGrupo", "(", ")", ",", "\"C1008\"", ")", ")", ";", "}", "@", "Test", "public", "void", "agregarAlumnoPorClienteGrupoEstudioErroneoTest", "(", ")", "{", "Assert", ".", "assertFalse", "(", "admGru", ".", "addAlumnoGrupoEstudio", "(", "\"GP100X\"", ",", "\"C1008\"", ")", ")", ";", "}", "@", "Test", "public", "void", "agregarAlumnoPorClienteErroneoGrupoEstudioTest", "(", ")", "{", "Assert", ".", "assertFalse", "(", "admGru", ".", "addAlumnoGrupoEstudio", "(", "\"GP1001\"", ",", "\"C1XXX\"", ")", ")", ";", "}", "@", "Test", "public", "void", "agregarAlumnoGrupoEstudiosAforoMaximo", "(", ")", "{", "GrupoEstudio", "grupo", "=", "admGru", ".", "getGrupoById", "(", "\"GP1002\"", ")", ";", "Assert", ".", "assertEquals", "(", "grupo", ".", "getAforo", "(", ")", ",", "grupo", ".", "getNumAlumnos", "(", ")", ")", ";", "Assert", ".", "assertFalse", "(", "admGru", ".", "addAlumnoGrupoEstudio", "(", "grupo", ".", "getCodGrupo", "(", ")", ",", "\"C1008\"", ")", ")", ";", "}", "@", "Test", "public", "void", "quitarAlumnoGrupoEstudios", "(", ")", "{", "Assert", ".", "assertTrue", "(", "admGru", ".", "verificarAlumnoEnGrupo", "(", "\"GP1002\"", ",", "\"C1009\"", ")", ")", ";", "Assert", ".", "assertFalse", "(", "admGru", ".", "addAlumnoGrupoEstudio", "(", "\"GP1002\"", ",", "\"C1009\"", ")", ")", ";", "}", "}", "</s>" ]
10,414
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "businesstest", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "org", ".", "junit", ".", "Assert", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "benedictoxvi", ".", "pe", ".", "business", ".", "AdmCliente", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Cliente", ";", "public", "class", "AdmClienteTest", "{", "ArrayList", "<", "Cliente", ">", "arrCli", "=", "new", "ArrayList", "<", "Cliente", ">", "(", ")", ";", "AdmCliente", "admCli", "=", "new", "AdmCliente", "(", ")", ";", "@", "Test", "public", "void", "findEncontrarClienteTest", "(", ")", "{", "String", "nombs", "=", "\"o\"", ",", "apepat", "=", "\"\"", ",", "apemat", "=", "\"\"", ",", "mail", "=", "\"\"", ",", "dni", "=", "\"\"", ",", "tel_cel", "=", "\"\"", ",", "fecha", "=", "\"\"", ";", "ArrayList", "<", "Cliente", ">", "filtroCli", "=", "admCli", ".", "findCliente", "(", "nombs", ",", "apepat", ",", "apemat", ",", "mail", ",", "dni", ",", "tel_cel", ",", "fecha", ",", "\"\"", ")", ";", "Assert", ".", "assertTrue", "(", "filtroCli", ".", "size", "(", ")", ">=", "0", ")", ";", "}", "@", "Test", "public", "void", "findSinEncontrarClienteTest", "(", ")", "{", "String", "nombs", "=", "\"Marcos\"", ",", "apepat", "=", "\"\"", ",", "apemat", "=", "\"\"", ",", "mail", "=", "\"\"", ",", "dni", "=", "\"\"", ",", "tel_cel", "=", "\"\"", ",", "fecha", "=", "\"\"", ";", "ArrayList", "<", "Cliente", ">", "filtroCli", "=", "admCli", ".", "findCliente", "(", "nombs", ",", "apepat", ",", "apemat", ",", "mail", ",", "dni", ",", "tel_cel", ",", "fecha", ",", "\"\"", ")", ";", "Assert", ".", "assertTrue", "(", "filtroCli", ".", "size", "(", ")", "==", "0", ")", ";", "}", "@", "Test", "public", "void", "registrarClienteTest", "(", ")", "{", "Assert", ".", "assertNull", "(", "admCli", ".", "getClienteByNum", "(", "\"C1200\"", ")", ")", ";", "Assert", ".", "assertTrue", "(", "admCli", ".", "registrarCliente", "(", "\"C1200\"", ",", "\"01/01/2013\"", ",", "\"Luis", "Enrique\"", ",", "\"Olivera\"", ",", "\"Aguilar\"", ",", "\"\"", ",", "\"34612331\"", ",", "\"3533332\"", ",", "\"983422323\"", ",", "\"\"", ")", ")", ";", "Assert", ".", "assertNotNull", "(", "admCli", ".", "getClienteByNum", "(", "\"C1200\"", ")", ")", ";", "}", "@", "Test", "public", "void", "eliminarClienteTest", "(", ")", "{", "String", "cod_cli", "=", "\"C1008\"", ";", "Assert", ".", "assertNotNull", "(", "admCli", ".", "getClienteByNum", "(", "cod_cli", ")", ")", ";", "Assert", ".", "assertTrue", "(", "admCli", ".", "eliminarCliente", "(", "cod_cli", ")", ")", ";", "Assert", ".", "assertNull", "(", "admCli", ".", "getClienteByNum", "(", "cod_cli", ")", ")", ";", "}", "}", "</s>" ]
10,415
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "businesstest", ";", "import", "junit", ".", "framework", ".", "Assert", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "benedictoxvi", ".", "pe", ".", "business", ".", "AdmAccesosUser", ";", "public", "class", "AdmAccesosUserTest", "{", "AdmAccesosUser", "objAcc", "=", "new", "AdmAccesosUser", "(", ")", ";", "@", "Test", "public", "void", "verificarAccesoCorrectoTest", "(", ")", "{", "String", "my_user", "=", "\"USUARIO01\"", ";", "Assert", ".", "assertTrue", "(", "objAcc", ".", "requestAcceso", "(", "my_user", ",", "\"CLIENTES\"", ")", ")", ";", "}", "@", "Test", "public", "void", "verificarAccesoIncorrectoTest", "(", ")", "{", "String", "my_user", "=", "\"USUARIO02\"", ";", "Assert", ".", "assertFalse", "(", "objAcc", ".", "requestAcceso", "(", "my_user", ",", "\"PROSPECTOS\"", ")", ")", ";", "}", "@", "Test", "public", "void", "verificarAdicionCorrectoTest", "(", ")", "{", "String", "my_user", "=", "\"USUARIO01\"", ";", "Assert", ".", "assertTrue", "(", "objAcc", ".", "requestAdicion", "(", "my_user", ",", "\"CLIENTES\"", ")", ")", ";", "}", "@", "Test", "public", "void", "verificarAdicionIncorrectoTest", "(", ")", "{", "String", "my_user", "=", "\"USUARIO02\"", ";", "Assert", ".", "assertFalse", "(", "objAcc", ".", "requestAdicion", "(", "my_user", ",", "\"PROSPECTOS\"", ")", ")", ";", "}", "@", "Test", "public", "void", "verificarModificacionCorrectoTest", "(", ")", "{", "String", "my_user", "=", "\"USUARIO01\"", ";", "Assert", ".", "assertTrue", "(", "objAcc", ".", "requestModificacion", "(", "my_user", ",", "\"CLIENTES\"", ")", ")", ";", "}", "@", "Test", "public", "void", "verificarModificacionIncorrectoTest", "(", ")", "{", "String", "my_user", "=", "\"USUARIO02\"", ";", "Assert", ".", "assertFalse", "(", "objAcc", ".", "requestModificacion", "(", "my_user", ",", "\"PROSPECTOS\"", ")", ")", ";", "}", "@", "Test", "public", "void", "verificarEliminacionCorrectoTest", "(", ")", "{", "String", "my_user", "=", "\"USUARIO01\"", ";", "Assert", ".", "assertTrue", "(", "objAcc", ".", "requestEliminacion", "(", "my_user", ",", "\"CLIENTES\"", ")", ")", ";", "}", "@", "Test", "public", "void", "verificarEliminacionIncorrectoTest", "(", ")", "{", "String", "my_user", "=", "\"USUARIO02\"", ";", "Assert", ".", "assertFalse", "(", "objAcc", ".", "requestEliminacion", "(", "my_user", ",", "\"PROSPECTOS\"", ")", ")", ";", "}", "@", "Test", "public", "void", "rolesByUserTest", "(", ")", "{", "Assert", ".", "assertEquals", "(", "2", ",", "objAcc", ".", "rolesByUser", "(", "\"USUARIO02\"", ")", ".", "size", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "modulosByRolTest", "(", ")", "{", "Assert", ".", "assertEquals", "(", "5", ",", "objAcc", ".", "modulosByRol", "(", "\"ADM\"", ")", ".", "size", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "addRolUserTest", "(", ")", "{", "Assert", ".", "assertEquals", "(", "2", ",", "objAcc", ".", "rolesByUser", "(", "\"USUARIO02\"", ")", ".", "size", "(", ")", ")", ";", "Assert", ".", "assertTrue", "(", "objAcc", ".", "addRolUser", "(", "\"USUARIO02\"", ",", "\"ADM\"", ")", ")", ";", "Assert", ".", "assertEquals", "(", "3", ",", "objAcc", ".", "rolesByUser", "(", "\"USUARIO02\"", ")", ".", "size", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "addRolUserRepetidoTest", "(", ")", "{", "Assert", ".", "assertEquals", "(", "2", ",", "objAcc", ".", "rolesByUser", "(", "\"USUARIO02\"", ")", ".", "size", "(", ")", ")", ";", "Assert", ".", "assertFalse", "(", "objAcc", ".", "addRolUser", "(", "\"USUARIO01\"", ",", "\"ADM\"", ")", ")", ";", "Assert", ".", "assertEquals", "(", "2", ",", "objAcc", ".", "rolesByUser", "(", "\"USUARIO02\"", ")", ".", "size", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "removeRolUserTest", "(", ")", "{", "Assert", ".", "assertEquals", "(", "1", ",", "objAcc", ".", "rolesByUser", "(", "\"USUARIO04\"", ")", ".", "size", "(", ")", ")", ";", "Assert", ".", "assertTrue", "(", "objAcc", ".", "removeRolUser", "(", "\"USUARIO04\"", ",", "\"VTAS\"", ")", ")", ";", "Assert", ".", "assertEquals", "(", "0", ",", "objAcc", ".", "rolesByUser", "(", "\"USUARIO04\"", ")", ".", "size", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "removeRolInexistenteUserTest", "(", ")", "{", "Assert", ".", "assertEquals", "(", "1", ",", "objAcc", ".", "rolesByUser", "(", "\"USUARIO04\"", ")", ".", "size", "(", ")", ")", ";", "Assert", ".", "assertFalse", "(", "objAcc", ".", "removeRolUser", "(", "\"USUARIO04\"", ",", "\"ADM\"", ")", ")", ";", "Assert", ".", "assertEquals", "(", "1", ",", "objAcc", ".", "rolesByUser", "(", "\"USUARIO04\"", ")", ".", "size", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "removeUsuarioInexistenteRolTest", "(", ")", "{", "Assert", ".", "assertFalse", "(", "objAcc", ".", "removeRolUser", "(", "\"USUARIO_BAD\"", ",", "\"ADM\"", ")", ")", ";", "}", "@", "Test", "public", "void", "checkAddRolAccessUser", "(", ")", "{", "Assert", ".", "assertFalse", "(", "objAcc", ".", "requestAcceso", "(", "\"USUARIO02\"", ",", "\"PROSPECTOS\"", ")", ")", ";", "Assert", ".", "assertTrue", "(", "objAcc", ".", "addRolUser", "(", "\"USUARIO02\"", ",", "\"PROSP\"", ")", ")", ";", "Assert", ".", "assertTrue", "(", "objAcc", ".", "requestAcceso", "(", "\"USUARIO02\"", ",", "\"PROSPECTOS\"", ")", ")", ";", "}", "}", "</s>" ]
10,416
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "businesstest", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "*", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "junit", ".", "framework", ".", "Assert", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "benedictoxvi", ".", "pe", ".", "business", ".", "AdmUsuarios", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Rol", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Usuario", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "Security", ";", "public", "class", "AdmUsuarioTest", "{", "AdmUsuarios", "admUsuarios", "=", "new", "AdmUsuarios", "(", ")", ";", "AdmRolTest", "test", "=", "new", "AdmRolTest", "(", ")", ";", "Security", "sec", "=", "new", "Security", "(", ")", ";", "@", "Test", "public", "void", "createUsuarioTest", "(", ")", "{", "Assert", ".", "assertTrue", "(", "admUsuarios", ".", "createUsuario", "(", "\"USUARIO20\"", ",", "\"PASWORD20\"", ",", "\"PASWORD20\"", ",", "\"NOMBRES", "20\"", ",", "\"\"", ",", "\"\"", ",", "\"01/05/2012\"", ",", "new", "String", "[", "]", "{", "\"ADM\"", "}", ",", "\"\"", ",", "\"71033506\"", ")", ")", ";", "}", "@", "Test", "public", "void", "createUsuarioClavesDistintasTest", "(", ")", "{", "Assert", ".", "assertFalse", "(", "admUsuarios", ".", "createUsuario", "(", "\"USUARIO20\"", ",", "\"PASWORD20\"", ",", "\"PASWORD12\"", ",", "\"NOMBRES", "20\"", ",", "\"\"", ",", "\"\"", ",", "\"01/05/2012\"", ",", "new", "String", "[", "]", "{", "\"ADM\"", "}", ",", "\"\"", ",", "\"71033506\"", ")", ")", ";", "}", "@", "Test", "public", "void", "createUsuarioUsuarioVacioTest", "(", ")", "{", "Assert", ".", "assertFalse", "(", "admUsuarios", ".", "createUsuario", "(", "\"", "\"", ",", "\"PASWORD20\"", ",", "\"PASWORD20\"", ",", "\"NOMBRES", "20\"", ",", "\"\"", ",", "\"\"", ",", "\"01/05/2012\"", ",", "new", "String", "[", "]", "{", "\"ADM\"", "}", ",", "\"\"", ",", "\"71033506\"", ")", ")", ";", "}", "@", "Test", "public", "void", "cambiarClaveUsuarioTest", "(", ")", "{", "Assert", ".", "assertTrue", "(", "admUsuarios", ".", "cambiarClaveUsuario", "(", "\"USUARIO01\"", ",", "\"PASWORD01\"", ",", "\"NEWCLAVE01\"", ",", "\"NEWCLAVE01\"", ")", ")", ";", "}", "@", "Test", "public", "void", "loginUserTest", "(", ")", "{", "Assert", ".", "assertTrue", "(", "admUsuarios", ".", "loginUser", "(", "\"USUARIO01\"", ",", "\"PASWORD01\"", ")", ")", ";", "}", "@", "Test", "public", "void", "bloquearUsuarioTest", "(", ")", "{", "Assert", ".", "assertTrue", "(", "admUsuarios", ".", "loginUser", "(", "\"USUARIO01\"", ",", "\"PASWORD01\"", ")", ")", ";", "Assert", ".", "assertTrue", "(", "admUsuarios", ".", "bloquearUsuario", "(", "\"USUARIO01\"", ")", ")", ";", "Assert", ".", "assertFalse", "(", "admUsuarios", ".", "loginUser", "(", "\"USUARIO01\"", ",", "\"PASWORD01\"", ")", ")", ";", "}", "@", "Test", "public", "void", "desbloquearUsuarioTest", "(", ")", "{", "Assert", ".", "assertFalse", "(", "admUsuarios", ".", "loginUser", "(", "\"USUARIO15\"", ",", "\"PASWORD15\"", ")", ")", ";", "Assert", ".", "assertTrue", "(", "admUsuarios", ".", "desbloquearUsuario", "(", "\"USUARIO15\"", ")", ")", ";", "Assert", ".", "assertTrue", "(", "admUsuarios", ".", "loginUser", "(", "\"USUARIO15\"", ",", "\"PASWORD15\"", ")", ")", ";", "}", "@", "Test", "public", "void", "modificarDatosUsuarioTest", "(", ")", "{", "Usuario", "usr", "=", "admUsuarios", ".", "getUserByName", "(", "\"USUARIO01\"", ")", ";", "Assert", ".", "assertNotSame", "(", "\"Atencion\"", ",", "usr", ".", "getCargo", "(", ")", ")", ";", "Assert", ".", "assertNotSame", "(", "\"12345678\"", ",", "usr", ".", "getDni", "(", ")", ")", ";", "Assert", ".", "assertTrue", "(", "admUsuarios", ".", "modificarUsuario", "(", "\"USUARIO01\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "null", ",", "null", ",", "\"Atencion\"", ",", "\"12345678\"", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"Atencion\"", ",", "usr", ".", "getCargo", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"12345678\"", ",", "usr", ".", "getDni", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"\"", ",", "usr", ".", "getNombre", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"\"", ",", "usr", ".", "getApellidoPaterno", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"\"", ",", "usr", ".", "getApellidoMaterno", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "modificarDatosErroneosUsuarioTest", "(", ")", "{", "Usuario", "usr", "=", "admUsuarios", ".", "getUserByName", "(", "\"USUARIO01\"", ")", ";", "Assert", ".", "assertFalse", "(", "admUsuarios", ".", "modificarUsuario", "(", "\"USUARIO01\"", ",", "null", ",", "null", ",", "null", ",", "\"12/01/20A0\"", ",", "null", ",", "\"Atencion\"", ",", "\"assffddd\"", ")", ")", ";", "Assert", ".", "assertNotSame", "(", "\"Atencion\"", ",", "usr", ".", "getCargo", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "suprimirUsuarioTest", "(", ")", "{", "int", "num_usuarios", "=", "admUsuarios", ".", "getarrUsr", "(", ")", ".", "size", "(", ")", ";", "Assert", ".", "assertEquals", "(", "num_usuarios", ",", "admUsuarios", ".", "getarrUsr", "(", ")", ".", "size", "(", ")", ")", ";", "Assert", ".", "assertTrue", "(", "admUsuarios", ".", "quitarUsuario", "(", "\"USUARIO01\"", ")", ")", ";", "num_usuarios", "=", "num_usuarios", "-", "1", ";", "Assert", ".", "assertEquals", "(", "num_usuarios", ",", "admUsuarios", ".", "getarrUsr", "(", ")", ".", "size", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "suprimirUsuarioInexistenteTest", "(", ")", "{", "int", "num_usuarios", "=", "admUsuarios", ".", "getarrUsr", "(", ")", ".", "size", "(", ")", ";", "Assert", ".", "assertEquals", "(", "num_usuarios", ",", "admUsuarios", ".", "getarrUsr", "(", ")", ".", "size", "(", ")", ")", ";", "Assert", ".", "assertFalse", "(", "admUsuarios", ".", "quitarUsuario", "(", "\"USUARIOAAAA\"", ")", ")", ";", "Assert", ".", "assertEquals", "(", "num_usuarios", ",", "admUsuarios", ".", "getarrUsr", "(", ")", ".", "size", "(", ")", ")", ";", "}", "}", "</s>" ]
10,417
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "businesstest", ";", "import", "junit", ".", "framework", ".", "Assert", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "benedictoxvi", ".", "pe", ".", "business", ".", "AdmLoginUsuario", ";", "public", "class", "AdmLoginUsuarioTest", "{", "AdmLoginUsuario", "admUsr", "=", "new", "AdmLoginUsuario", "(", ")", ";", "@", "Test", "public", "void", "loginSatisfactorioTest", "(", ")", "{", "String", "usuario", "=", "\"USUARIO01\"", ";", "String", "clave", "=", "\"PASWORD01\"", ";", "Assert", ".", "assertTrue", "(", "admUsr", ".", "loginUsuario", "(", "usuario", ",", "clave", ")", ")", ";", "}", "@", "Test", "public", "void", "loginErroneoTest", "(", ")", "{", "String", "usuario", "=", "\"USUARIO01\"", ";", "String", "clave", "=", "\"INCORRECTO\"", ";", "Assert", ".", "assertFalse", "(", "admUsr", ".", "loginUsuario", "(", "usuario", ",", "clave", ")", ")", ";", "}", "@", "Test", "public", "void", "loginUsuarioVacioTest", "(", ")", "{", "String", "usuario", "=", "\"\"", ";", "String", "clave", "=", "\"INCORRECTO\"", ";", "Assert", ".", "assertFalse", "(", "admUsr", ".", "loginUsuario", "(", "usuario", ",", "clave", ")", ")", ";", "}", "@", "Test", "public", "void", "loginUsuarioInexistenteTest", "(", ")", "{", "String", "usuario", "=", "\"USUARIOXX\"", ";", "String", "clave", "=", "\"CLAVE01\"", ";", "Assert", ".", "assertFalse", "(", "admUsr", ".", "loginUsuario", "(", "usuario", ",", "clave", ")", ")", ";", "}", "@", "Test", "public", "void", "loginClaveVaciaTest", "(", ")", "{", "String", "usuario", "=", "\"USUARIO01\"", ";", "String", "clave", "=", "\"\"", ";", "Assert", ".", "assertFalse", "(", "admUsr", ".", "loginUsuario", "(", "usuario", ",", "clave", ")", ")", ";", "}", "@", "Test", "public", "void", "bloquearUsuarioPorIntentosFallidosTest", "(", ")", "{", "int", "max_intentos", "=", "5", ";", "String", "usuario", "=", "\"USUARIO01\"", ";", "String", "clave", "=", "\"INCORRECTO\"", ";", "for", "(", "int", "num_intento", "=", "1", ";", "num_intento", "<=", "max_intentos", ";", "num_intento", "++", ")", "{", "Assert", ".", "assertFalse", "(", "admUsr", ".", "loginUsuario", "(", "usuario", ",", "clave", ")", ")", ";", "}", "Assert", ".", "assertFalse", "(", "admUsr", ".", "loginUsuario", "(", "usuario", ",", "clave", ")", ")", ";", "}", "}", "</s>" ]
10,418
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "businesstest", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "*", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "junit", ".", "framework", ".", "Assert", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "benedictoxvi", ".", "pe", ".", "business", ".", "AdmRoles", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Modulo", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Rol", ";", "public", "class", "AdmRolTest", "{", "AdmRoles", "admRol", "=", "new", "AdmRoles", "(", ")", ";", "ArrayList", "<", "Modulo", ">", "arrMod", "=", "new", "ArrayList", "<", "Modulo", ">", "(", ")", ";", "Modulo", "modVentas", "=", "new", "Modulo", "(", "\"VENTAS\"", ",", "true", ",", "true", ",", "true", ",", "true", ")", ";", "Modulo", "modCompras", "=", "new", "Modulo", "(", "\"COMPRAS\"", ",", "true", ",", "true", ",", "true", ",", "true", ")", ";", "Modulo", "modClientes", "=", "new", "Modulo", "(", "\"CLIENTESS\"", ",", "true", ",", "true", ",", "true", ",", "true", ")", ";", "Modulo", "modProspectos", "=", "new", "Modulo", "(", "\"PROSPECTOS\"", ",", "true", ",", "true", ",", "true", ",", "true", ")", ";", "private", "Rol", "rolActual", ";", "@", "Before", "public", "void", "cargarModulos", "(", ")", "{", "arrMod", ".", "add", "(", "new", "Modulo", "(", "\"PROSPECTOS\"", ",", "true", ",", "true", ",", "true", ",", "true", ")", ")", ";", "arrMod", ".", "add", "(", "new", "Modulo", "(", "\"CLIENTESS\"", ",", "true", ",", "true", ",", "true", ",", "true", ")", ")", ";", "arrMod", ".", "add", "(", "new", "Modulo", "(", "\"USUARIOS\"", ",", "true", ",", "true", ",", "true", ",", "true", ")", ")", ";", "}", "@", "Test", "public", "void", "crearRolConModulosTest", "(", ")", "{", "ArrayList", "<", "Modulo", ">", "mods", "=", "new", "ArrayList", "<", "Modulo", ">", "(", ")", ";", "mods", ".", "add", "(", "modProspectos", ")", ";", "mods", ".", "add", "(", "modCompras", ")", ";", "Assert", ".", "assertTrue", "(", "admRol", ".", "registrarRol", "(", "\"NEW_ROL\"", ",", "\"\"", ",", "mods", ")", ")", ";", "}", "@", "Test", "public", "void", "crearRolConModulosErroneosTest", "(", ")", "{", "ArrayList", "<", "Modulo", ">", "mods", "=", "new", "ArrayList", "<", "Modulo", ">", "(", ")", ";", "mods", ".", "add", "(", "modProspectos", ")", ";", "mods", ".", "add", "(", "modClientes", ")", ";", "mods", ".", "add", "(", "modCompras", ")", ";", "Assert", ".", "assertFalse", "(", "admRol", ".", "registrarRol", "(", "\"NEW_ROL\"", ",", "\"\"", ",", "mods", ")", ")", ";", "}", "@", "Test", "public", "void", "crearRolConDatosVaciosErroneosTest", "(", ")", "{", "ArrayList", "<", "Modulo", ">", "mods", "=", "new", "ArrayList", "<", "Modulo", ">", "(", ")", ";", "mods", ".", "add", "(", "modProspectos", ")", ";", "Assert", ".", "assertFalse", "(", "admRol", ".", "registrarRol", "(", "\"NEW_\"", ",", "\"\"", ",", "mods", ")", ")", ";", "}", "@", "Test", "public", "void", "crearRolSinModulosTest", "(", ")", "{", "ArrayList", "<", "Modulo", ">", "mods", "=", "new", "ArrayList", "<", "Modulo", ">", "(", ")", ";", "Assert", ".", "assertTrue", "(", "admRol", ".", "registrarRol", "(", "\"NEW_ROL\"", ",", "\"\"", ",", "mods", ")", ")", ";", "}", "@", "Test", "public", "void", "modificarRolTest", "(", ")", "{", "ArrayList", "<", "Modulo", ">", "mods", "=", "new", "ArrayList", "<", "Modulo", ">", "(", ")", ";", "Assert", ".", "assertTrue", "(", "admRol", ".", "modificarRol", "(", "\"SECUR\"", ",", "\"Nuevo", "Nombre\"", ",", "mods", ")", ")", ";", "}", "@", "Test", "public", "void", "suprimirRolTest", "(", ")", "{", "int", "num_roles", "=", "admRol", ".", "getRoles", "(", ")", ".", "size", "(", ")", ";", "Assert", ".", "assertTrue", "(", "admRol", ".", "suprimirRol", "(", "\"SECUR\"", ")", ")", ";", "num_roles", "=", "num_roles", "-", "1", ";", "Assert", ".", "assertEquals", "(", "num_roles", ",", "admRol", ".", "getRoles", "(", ")", ".", "size", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "suprimirRolConUsuariosTest", "(", ")", "{", "int", "num_roles", "=", "admRol", ".", "getRoles", "(", ")", ".", "size", "(", ")", ";", "Assert", ".", "assertFalse", "(", "admRol", ".", "suprimirRol", "(", "\"VTAS\"", ")", ")", ";", "Assert", ".", "assertEquals", "(", "num_roles", ",", "admRol", ".", "getRoles", "(", ")", ".", "size", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "verificarExistenciaRolTest", "(", ")", "{", "Assert", ".", "assertNotNull", "(", "admRol", ".", "findModuloByIdent", "(", "\"VENTAS\"", ")", ")", ";", "}", "@", "Test", "public", "void", "verificarInexistenciaRolTest", "(", ")", "{", "Assert", ".", "assertNull", "(", "admRol", ".", "findModuloByIdent", "(", "\"VENTAS_MAL\"", ")", ")", ";", "}", "}", "</s>" ]
10,419
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "datatest", ";", "import", "junit", ".", "framework", ".", "Assert", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "com", ".", "sun", ".", "xml", ".", "internal", ".", "ws", ".", "developer", ".", "UsesJAXBContext", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Modulo", ";", "public", "class", "ModuloTest", "{", "@", "Test", "public", "void", "dataModulo1Test", "(", ")", "{", "Modulo", "objMod", "=", "new", "Modulo", "(", ")", ";", "objMod", ".", "setNombre", "(", "\"PROVEEDORES\"", ")", ";", "objMod", ".", "setDescripcion", "(", "\"\"", ")", ";", "objMod", ".", "setAcceso", "(", "true", ")", ";", "objMod", ".", "setAdicionar", "(", "false", ")", ";", "objMod", ".", "setEditar", "(", "true", ")", ";", "objMod", ".", "setEliminar", "(", "false", ")", ";", "Assert", ".", "assertEquals", "(", "\"PROVEEDORES\"", ",", "objMod", ".", "getNombre", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"\"", ",", "objMod", ".", "getDescripcion", "(", ")", ")", ";", "Assert", ".", "assertTrue", "(", "objMod", ".", "getAcceso", "(", ")", ")", ";", "Assert", ".", "assertFalse", "(", "objMod", ".", "getAdicionar", "(", ")", ")", ";", "Assert", ".", "assertTrue", "(", "objMod", ".", "getEditar", "(", ")", ")", ";", "Assert", ".", "assertFalse", "(", "objMod", ".", "getEliminar", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "dataModulo2Test", "(", ")", "{", "Modulo", "objMod", "=", "new", "Modulo", "(", ")", ";", "objMod", ".", "setNombre", "(", "\"ATENCION\"", ")", ";", "objMod", ".", "setDescripcion", "(", "\"\"", ")", ";", "objMod", ".", "setAcceso", "(", "true", ")", ";", "objMod", ".", "setAdicionar", "(", "true", ")", ";", "objMod", ".", "setEditar", "(", "false", ")", ";", "objMod", ".", "setEliminar", "(", "false", ")", ";", "Assert", ".", "assertEquals", "(", "\"ATENCION\"", ",", "objMod", ".", "getNombre", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"\"", ",", "objMod", ".", "getDescripcion", "(", ")", ")", ";", "Assert", ".", "assertTrue", "(", "objMod", ".", "getAcceso", "(", ")", ")", ";", "Assert", ".", "assertTrue", "(", "objMod", ".", "getAdicionar", "(", ")", ")", ";", "Assert", ".", "assertFalse", "(", "objMod", ".", "getEditar", "(", ")", ")", ";", "Assert", ".", "assertFalse", "(", "objMod", ".", "getEliminar", "(", ")", ")", ";", "}", "}", "</s>" ]
10,420
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "datatest", ";", "public", "class", "UsuarioTest", "{", "}", "</s>" ]
10,421
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "datatest", ";", "import", "org", ".", "junit", ".", "Test", ";", "public", "class", "VentasTest", "{", "@", "Test", "public", "void", "registrarVenta", "(", ")", "{", "}", "}", "</s>" ]
10,422
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "datatest", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "*", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Cliente", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "*", ";", "public", "class", "ClienteTest", "{", "Cliente", "objCli", "=", "new", "Cliente", "(", ")", ";", "List", "<", "String", ">", "gruEstudio", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "List", "<", "String", ">", "aluGrupo", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "@", "Before", "public", "void", "contruct__", "(", ")", "{", "objCli", ".", "setNomCliente", "(", "\"Jose", "Luis\"", ")", ";", "objCli", ".", "setApePatCliente", "(", "\"Guzman\"", ")", ";", "objCli", ".", "setApeMatCliente", "(", "\"Perez\"", ")", ";", "objCli", ".", "setDniCliente", "(", "\"34567543\"", ")", ";", "objCli", ".", "setFonCliente", "(", "\"7665456\"", ")", ";", "objCli", ".", "setFecConCliente", "(", "\"12/07/2012\"", ")", ";", "objCli", ".", "setEmaCliente", "(", "\"\"", ")", ";", "objCli", ".", "setEstCliente", "(", "\"Cliente\"", ")", ";", "gruEstudio", ".", "add", "(", "\"\"", ")", ";", "gruEstudio", ".", "add", "(", "\"\"", ")", ";", "gruEstudio", ".", "add", "(", "\"Grupo", "Fisica\"", ")", ";", "gruEstudio", ".", "add", "(", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "testDataCliente", "(", ")", "{", "assertEquals", "(", "\"Jose", "Luis\"", ",", "objCli", ".", "getNomCliente", "(", ")", ")", ";", "assertEquals", "(", "\"Guzman\"", ",", "objCli", ".", "getApePatCliente", "(", ")", ")", ";", "assertEquals", "(", "\"Perez\"", ",", "objCli", ".", "getApeMatCliente", "(", ")", ")", ";", "assertEquals", "(", "\"34567543\"", ",", "objCli", ".", "getDniCliente", "(", ")", ")", ";", "assertEquals", "(", "\"7665456\"", ",", "objCli", ".", "getFonCliente", "(", ")", ")", ";", "assertEquals", "(", "\"12/07/2012\"", ",", "objCli", ".", "getFecConCliente", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "objCli", ".", "getEmaCliente", "(", ")", ")", ";", "assertEquals", "(", "\"Cliente\"", ",", "objCli", ".", "getEstCliente", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "testValidaDni", "(", ")", "{", "Validaciones", "objVal", "=", "new", "Validaciones", "(", ")", ";", "assertEquals", "(", "true", ",", "objVal", ".", "isDNI", "(", "objCli", ".", "getDniCliente", "(", ")", ")", ")", ";", "}", "@", "Test", "public", "void", "testValidaCorreoCliente", "(", ")", "{", "Validaciones", "objVal", "=", "new", "Validaciones", "(", ")", ";", "assertEquals", "(", "true", ",", "objVal", ".", "isEmail", "(", "objCli", ".", "getEmaCliente", "(", ")", ")", ")", ";", "}", "@", "Test", "public", "void", "testLitarClienteGrupoEstudio", "(", ")", "{", "aluGrupo", ".", "add", "(", "objCli", ".", "getNomCliente", "(", ")", ")", ";", "assertEquals", "(", "objCli", ".", "getNomCliente", "(", ")", ",", "aluGrupo", ".", "get", "(", "0", ")", ")", ";", "System", ".", "out", ".", "print", "(", "aluGrupo", ".", "get", "(", "0", ")", "+", "\"", "-", "\"", "+", "gruEstudio", ".", "get", "(", "0", ")", ")", ";", "}", "}", "</s>" ]
10,423
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "datatest", ";", "import", "java", ".", "util", ".", "*", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "*", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "Loader", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "ProcessException", ";", "public", "final", "class", "DataBD", "{", "Loader", "objLoa", "=", "new", "Loader", "(", ")", ";", "ArrayList", "<", "Usuario", ">", "dataUsuarios", "=", "new", "ArrayList", "<", "Usuario", ">", "(", ")", ";", "ArrayList", "<", "Compra", ">", "dataCompras", "=", "new", "ArrayList", "<", "Compra", ">", "(", ")", ";", "ArrayList", "<", "GrupoEstudio", ">", "dataGrupoEstudio", "=", "new", "ArrayList", "<", "GrupoEstudio", ">", "(", ")", ";", "ArrayList", "<", "Prospecto", ">", "dataProspecto", "=", "new", "ArrayList", "<", "Prospecto", ">", "(", ")", ";", "ArrayList", "<", "Rol", ">", "dataRoles", "=", "new", "ArrayList", "<", "Rol", ">", "(", ")", ";", "ArrayList", "<", "Modulo", ">", "dataModulos", "=", "new", "ArrayList", "<", "Modulo", ">", "(", ")", ";", "ArrayList", "<", "Cliente", ">", "dataClientes", "=", "new", "ArrayList", "<", "Cliente", ">", "(", ")", ";", "public", "ArrayList", "<", "Cliente", ">", "getDataClientes", "(", ")", "{", "return", "dataClientes", ";", "}", "public", "void", "setDataClientes", "(", "ArrayList", "<", "Cliente", ">", "dataClientes", ")", "{", "this", ".", "dataClientes", "=", "dataClientes", ";", "}", "public", "void", "setDataModulos", "(", "ArrayList", "<", "Modulo", ">", "dataModulos", ")", "{", "this", ".", "dataModulos", "=", "dataModulos", ";", "}", "public", "DataBD", "(", ")", "{", "dataClientes", "=", "getDataCliente", "(", ")", ";", "dataModulos", "=", "getDataModulos", "(", ")", ";", "dataRoles", "=", "loadRoles", "(", ")", ";", "dataCompras", "=", "loadCompras", "(", ")", ";", "dataGrupoEstudio", "=", "loadGrupoEstudio", "(", ")", ";", "dataUsuarios", "=", "loadUsuarios", "(", ")", ";", "dataProspecto", "=", "loadProspectos", "(", ")", ";", "}", "public", "ArrayList", "<", "Modulo", ">", "getDataModulos", "(", ")", "{", "ArrayList", "<", "Modulo", ">", "mods", "=", "new", "ArrayList", "<", "Modulo", ">", "(", ")", ";", "Modulo", "objPro", "=", "null", ";", "String", "url", "=", "objLoa", ".", "getClass", "(", ")", ".", "getResource", "(", "\"\"", ")", ".", "getFile", "(", ")", ";", "ArrayList", "<", "String", "[", "]", ">", "lisPro", "=", "objLoa", ".", "getDataTxt", "(", "url", ")", ";", "for", "(", "String", "[", "]", "row", ":", "lisPro", ")", "{", "objPro", "=", "new", "Modulo", "(", ")", ";", "objPro", ".", "setNombre", "(", "row", "[", "0", "]", ")", ";", "objPro", ".", "setDescripcion", "(", "row", "[", "1", "]", ")", ";", "mods", ".", "add", "(", "objPro", ")", ";", "}", "return", "mods", ";", "}", "public", "ArrayList", "<", "Usuario", ">", "getDataUsuarios", "(", ")", "{", "return", "dataUsuarios", ";", "}", "public", "void", "setDataUsuarios", "(", "ArrayList", "<", "Usuario", ">", "dataUsuarios", ")", "{", "this", ".", "dataUsuarios", "=", "dataUsuarios", ";", "}", "public", "ArrayList", "<", "Compra", ">", "getDataCompras", "(", ")", "{", "return", "dataCompras", ";", "}", "public", "void", "setDataCompras", "(", "ArrayList", "<", "Compra", ">", "dataCompras", ")", "{", "this", ".", "dataCompras", "=", "dataCompras", ";", "}", "public", "ArrayList", "<", "GrupoEstudio", ">", "getDataGrupoEstudio", "(", ")", "{", "return", "dataGrupoEstudio", ";", "}", "public", "void", "setDataGrupoEstudio", "(", "ArrayList", "<", "GrupoEstudio", ">", "dataGrupoEstudio", ")", "{", "this", ".", "dataGrupoEstudio", "=", "dataGrupoEstudio", ";", "}", "public", "ArrayList", "<", "Prospecto", ">", "getDataProspecto", "(", ")", "{", "return", "dataProspecto", ";", "}", "public", "void", "setDataProspecto", "(", "ArrayList", "<", "Prospecto", ">", "dataProspecto", ")", "{", "this", ".", "dataProspecto", "=", "dataProspecto", ";", "}", "public", "ArrayList", "<", "Rol", ">", "getDataRoles", "(", ")", "{", "return", "dataRoles", ";", "}", "public", "void", "setDataRoles", "(", "ArrayList", "<", "Rol", ">", "dataRoles", ")", "{", "this", ".", "dataRoles", "=", "dataRoles", ";", "}", "public", "ArrayList", "<", "Rol", ">", "loadRoles", "(", ")", "{", "ArrayList", "<", "Rol", ">", "roles", "=", "new", "ArrayList", "<", "Rol", ">", "(", ")", ";", "Rol", "objPro", "=", "null", ";", "String", "url", "=", "objLoa", ".", "getClass", "(", ")", ".", "getResource", "(", "\"\"", ")", ".", "getFile", "(", ")", ";", "ArrayList", "<", "String", "[", "]", ">", "lisPro", "=", "objLoa", ".", "getDataTxt", "(", "url", ")", ";", "for", "(", "String", "[", "]", "row", ":", "lisPro", ")", "{", "objPro", "=", "new", "Rol", "(", ")", ";", "objPro", ".", "setNombre", "(", "row", "[", "0", "]", ")", ";", "objPro", ".", "setDescrip", "(", "row", "[", "1", "]", ")", ";", "for", "(", "String", "mod", ":", "row", "[", "2", "]", ".", "split", "(", "\"/\"", ")", ")", "{", "String", "[", "]", "parts", "=", "mod", ".", "split", "(", "\":\"", ")", ";", "if", "(", "Collections", ".", "binarySearch", "(", "dataModulos", ",", "new", "Modulo", "(", "parts", "[", "0", "]", ")", ",", "new", "Comparator", "<", "Modulo", ">", "(", ")", "{", "@", "Override", "public", "int", "compare", "(", "Modulo", "o1", ",", "Modulo", "o2", ")", "{", "return", "o1", ".", "getNombre", "(", ")", ".", "compareTo", "(", "o2", ".", "getNombre", "(", ")", ")", ";", "}", "}", ")", "<", "0", ")", "{", "new", "ProcessException", "(", "\"\"", "+", "parts", "[", "0", "]", "+", "\"'.\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "null", ";", "}", "Modulo", "mod_user", "=", "new", "Modulo", "(", "parts", "[", "0", "]", ")", ";", "mod_user", ".", "setAcceso", "(", "(", "Integer", ".", "parseInt", "(", "parts", "[", "1", "]", ")", "==", "0", ")", "?", "false", ":", "true", ")", ";", "mod_user", ".", "setAdicionar", "(", "(", "Integer", ".", "parseInt", "(", "parts", "[", "2", "]", ")", "==", "0", ")", "?", "false", ":", "true", ")", ";", "mod_user", ".", "setEditar", "(", "(", "Integer", ".", "parseInt", "(", "parts", "[", "3", "]", ")", "==", "0", ")", "?", "false", ":", "true", ")", ";", "mod_user", ".", "setEliminar", "(", "(", "Integer", ".", "parseInt", "(", "parts", "[", "4", "]", ")", "==", "0", ")", "?", "false", ":", "true", ")", ";", "objPro", ".", "getModulo", "(", ")", ".", "add", "(", "mod_user", ")", ";", "}", "roles", ".", "add", "(", "objPro", ")", ";", "}", "return", "roles", ";", "}", "public", "ArrayList", "<", "Prospecto", ">", "loadProspectos", "(", ")", "{", "ArrayList", "<", "Prospecto", ">", "prospectos", "=", "new", "ArrayList", "<", "Prospecto", ">", "(", ")", ";", "Prospecto", "objPro", "=", "null", ";", "String", "url", "=", "objLoa", ".", "getClass", "(", ")", ".", "getResource", "(", "\"\"", ")", ".", "getFile", "(", ")", ";", "ArrayList", "<", "String", "[", "]", ">", "lisPro", "=", "objLoa", ".", "getDataTxt", "(", "url", ")", ";", "for", "(", "String", "[", "]", "row", ":", "lisPro", ")", "{", "objPro", "=", "new", "Prospecto", "(", ")", ";", "objPro", ".", "setNumProspecto", "(", "Integer", ".", "parseInt", "(", "row", "[", "0", "]", ")", ")", ";", "objPro", ".", "setFecProspecto", "(", "row", "[", "1", "]", ")", ";", "objPro", ".", "setApePaterno", "(", "row", "[", "2", "]", ")", ";", "objPro", ".", "setApeMaterno", "(", "row", "[", "3", "]", ")", ";", "objPro", ".", "setNombes", "(", "row", "[", "4", "]", ")", ";", "objPro", ".", "setCorreo", "(", "row", "[", "5", "]", ")", ";", "objPro", ".", "setNroDNI", "(", "row", "[", "6", "]", ")", ";", "objPro", ".", "setTelefono", "(", "row", "[", "7", "]", ")", ";", "objPro", ".", "setCelular", "(", "row", "[", "8", "]", ")", ";", "objPro", ".", "setEstado", "(", "row", "[", "9", "]", ")", ";", "prospectos", ".", "add", "(", "objPro", ")", ";", "}", "return", "prospectos", ";", "}", "public", "ArrayList", "<", "Prospecto", ">", "loadCuentas", "(", ")", "{", "return", "null", ";", "}", "public", "void", "loadClientes", "(", ")", "{", "}", "public", "ArrayList", "<", "GrupoEstudio", ">", "loadGrupoEstudio", "(", ")", "{", "ArrayList", "<", "GrupoEstudio", ">", "grupos", "=", "new", "ArrayList", "<", "GrupoEstudio", ">", "(", ")", ";", "GrupoEstudio", "objGru", "=", "null", ";", "String", "url", "=", "objLoa", ".", "getClass", "(", ")", ".", "getResource", "(", "\"\"", ")", ".", "getFile", "(", ")", ";", "ArrayList", "<", "String", "[", "]", ">", "lisPro", "=", "objLoa", ".", "getDataTxt", "(", "url", ".", "substring", "(", "1", ")", ")", ";", "for", "(", "String", "[", "]", "row", ":", "lisPro", ")", "{", "if", "(", "row", ".", "length", "==", "0", ")", "continue", ";", "objGru", "=", "new", "GrupoEstudio", "(", ")", ";", "objGru", ".", "setCodGrupo", "(", "row", "[", "0", "]", ")", ";", "objGru", ".", "setNomGrupo", "(", "row", "[", "1", "]", ")", ";", "objGru", ".", "setDescripcion", "(", "row", "[", "2", "]", ")", ";", "objGru", ".", "setNomAcademia", "(", "row", "[", "3", "]", ")", ";", "objGru", ".", "setNomCurso", "(", "row", "[", "4", "]", ")", ";", "objGru", ".", "setFecInicio", "(", "row", "[", "5", "]", ")", ";", "objGru", ".", "setFecFin", "(", "row", "[", "6", "]", ")", ";", "objGru", ".", "setInstructor", "(", "row", "[", "7", "]", ".", "split", "(", "\";\"", ")", ")", ";", "objGru", ".", "setLinkSylabus", "(", "row", "[", "8", "]", ")", ";", "objGru", ".", "setLocal", "(", "row", "[", "9", "]", ")", ";", "objGru", ".", "setEstado", "(", "\"\"", ")", ";", "objGru", ".", "setAula", "(", "Integer", ".", "parseInt", "(", "row", "[", "10", "]", ")", ")", ";", "objGru", ".", "setCAltitud", "(", "Double", ".", "parseDouble", "(", "row", "[", "11", "]", ")", ")", ";", "objGru", ".", "setCLatitud", "(", "Double", ".", "parseDouble", "(", "row", "[", "12", "]", ")", ")", ";", "objGru", ".", "setAforo", "(", "Integer", ".", "parseInt", "(", "row", "[", "13", "]", ")", ")", ";", "grupos", ".", "add", "(", "objGru", ")", ";", "}", "int", "i", "=", "0", ";", "for", "(", "Cliente", "cli", ":", "dataClientes", ")", "{", "if", "(", "cli", ".", "getCodCliente", "(", ")", ".", "equals", "(", "\"C1008\"", ")", ")", "{", "continue", ";", "}", "i", "+=", "1", ";", "grupos", ".", "get", "(", "1", ")", ".", "getInscritos", "(", ")", ".", "add", "(", "cli", ")", ";", "}", "grupos", ".", "get", "(", "1", ")", ".", "setAforo", "(", "i", ")", ";", "return", "grupos", ";", "}", "public", "ArrayList", "<", "Compra", ">", "loadCompras", "(", ")", "{", "ArrayList", "<", "Compra", ">", "compras", "=", "new", "ArrayList", "<", "Compra", ">", "(", ")", ";", "Compra", "objPro", "=", "null", ";", "String", "url", "=", "objLoa", ".", "getClass", "(", ")", ".", "getResource", "(", "\"\"", ")", ".", "getFile", "(", ")", ";", "ArrayList", "<", "String", "[", "]", ">", "lisPro", "=", "objLoa", ".", "getDataTxt", "(", "url", ")", ";", "for", "(", "String", "[", "]", "row", ":", "lisPro", ")", "{", "objPro", "=", "new", "Compra", "(", ")", ";", "objPro", ".", "setConcepto", "(", "row", "[", "0", "]", ")", ";", "objPro", ".", "setNumero", "(", "Integer", ".", "parseInt", "(", "row", "[", "1", "]", ")", ")", ";", "objPro", ".", "setFecEmision", "(", "row", "[", "2", "]", ")", ";", "objPro", ".", "setNomEmpresa", "(", "row", "[", "3", "]", ")", ";", "objPro", ".", "setMonSubtot", "(", "Double", ".", "parseDouble", "(", "row", "[", "4", "]", ")", ")", ";", "objPro", ".", "setMonIGV", "(", "Double", ".", "parseDouble", "(", "row", "[", "5", "]", ")", ")", ";", "objPro", ".", "setMonTotal", "(", "Double", ".", "parseDouble", "(", "row", "[", "6", "]", ")", ")", ";", "objPro", ".", "setMoneda", "(", "row", "[", "7", "]", ")", ";", "objPro", ".", "setFecVencim", "(", "row", "[", "8", "]", ")", ";", "objPro", ".", "setEstado", "(", "row", "[", "9", "]", ")", ";", "objPro", ".", "setFecPago", "(", "row", "[", "10", "]", ")", ";", "objPro", ".", "setObservacion", "(", "row", "[", "11", "]", ")", ";", "compras", ".", "add", "(", "objPro", ")", ";", "}", "return", "compras", ";", "}", "public", "ArrayList", "<", "Usuario", ">", "loadUsuarios", "(", ")", "{", "ArrayList", "<", "Usuario", ">", "usuarios", "=", "new", "ArrayList", "<", "Usuario", ">", "(", ")", ";", "Usuario", "objPro", "=", "null", ";", "String", "url", "=", "objLoa", ".", "getClass", "(", ")", ".", "getResource", "(", "\"\"", ")", ".", "getFile", "(", ")", ";", "ArrayList", "<", "String", "[", "]", ">", "lisPro", "=", "objLoa", ".", "getDataTxt", "(", "url", ")", ";", "for", "(", "String", "[", "]", "row", ":", "lisPro", ")", "{", "objPro", "=", "new", "Usuario", "(", ")", ";", "objPro", ".", "setUsuario", "(", "row", "[", "0", "]", ")", ";", "objPro", ".", "setPassword", "(", "row", "[", "1", "]", ")", ";", "objPro", ".", "setNombre", "(", "row", "[", "2", "]", ")", ";", "objPro", ".", "setApellidoPaterno", "(", "row", "[", "3", "]", ")", ";", "objPro", ".", "setApellidoMaterno", "(", "row", "[", "4", "]", ")", ";", "objPro", ".", "setF_ingreso", "(", "row", "[", "5", "]", ")", ";", "String", "roles", "=", "row", "[", "6", "]", ";", "for", "(", "String", "rol", ":", "roles", ".", "split", "(", "\"/\"", ")", ")", "{", "for", "(", "Rol", "usr_rol", ":", "dataRoles", ")", "{", "if", "(", "usr_rol", ".", "getNombre", "(", ")", ".", "equalsIgnoreCase", "(", "rol", ")", ")", "{", "objPro", ".", "getRoles", "(", ")", ".", "add", "(", "usr_rol", ")", ";", "}", "}", "}", "objPro", ".", "setCargo", "(", "row", "[", "7", "]", ")", ";", "objPro", ".", "setDni", "(", "row", "[", "8", "]", ")", ";", "objPro", ".", "setStatus", "(", "row", "[", "9", "]", ")", ";", "usuarios", ".", "add", "(", "objPro", ")", ";", "}", "return", "usuarios", ";", "}", "public", "ArrayList", "<", "Cliente", ">", "getDataCliente", "(", ")", "{", "ArrayList", "<", "Cliente", ">", "clientes", "=", "new", "ArrayList", "<", "Cliente", ">", "(", ")", ";", "Cliente", "objPro", "=", "null", ";", "String", "url", "=", "objLoa", ".", "getClass", "(", ")", ".", "getResource", "(", "\"\"", ")", ".", "getFile", "(", ")", ";", "ArrayList", "<", "String", "[", "]", ">", "lisPro", "=", "objLoa", ".", "getDataTxt", "(", "url", ")", ";", "for", "(", "String", "[", "]", "row", ":", "lisPro", ")", "{", "objPro", "=", "new", "Cliente", "(", ")", ";", "objPro", ".", "setCodCliente", "(", "row", "[", "0", "]", ")", ";", "objPro", ".", "setFecConCliente", "(", "row", "[", "1", "]", ")", ";", "objPro", ".", "setApePatCliente", "(", "row", "[", "2", "]", ")", ";", "objPro", ".", "setApeMatCliente", "(", "row", "[", "3", "]", ")", ";", "objPro", ".", "setNomCliente", "(", "row", "[", "4", "]", ")", ";", "objPro", ".", "setEmaCliente", "(", "row", "[", "5", "]", ")", ";", "objPro", ".", "setDniCliente", "(", "row", "[", "6", "]", ")", ";", "objPro", ".", "setFonCliente", "(", "row", "[", "7", "]", ")", ";", "objPro", ".", "setEstCliente", "(", "row", "[", "8", "]", ")", ";", "clientes", ".", "add", "(", "objPro", ")", ";", "}", "return", "clientes", ";", "}", "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "DataBD", "bd", "=", "new", "DataBD", "(", ")", ";", "}", "}", "</s>" ]
10,424
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "datatest", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "junit", ".", "framework", ".", "Assert", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "GrupoEstudio", ";", "public", "class", "GrupoEstudioTest", "{", "@", "Test", "public", "void", "testDataGrupoEstudio", "(", ")", "{", "GrupoEstudio", "objGrp", "=", "new", "GrupoEstudio", "(", ")", ";", "objGrp", ".", "setNomGrupo", "(", "\"\"", ")", ";", "objGrp", ".", "setNomAcademia", "(", "\"\"", ")", ";", "objGrp", ".", "setNomCurso", "(", "\"Estadistica\"", ")", ";", "objGrp", ".", "setFecInicio", "(", "\"01/01/2012\"", ")", ";", "objGrp", ".", "setFecFin", "(", "\"31/05/2012\"", ")", ";", "objGrp", ".", "setEstado", "(", "\"En", "Curso\"", ")", ";", "Assert", ".", "assertEquals", "(", "\"\"", ",", "objGrp", ".", "getNomGrupo", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"\"", ",", "objGrp", ".", "getNomAcademia", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"Estadistica\"", ",", "objGrp", ".", "getNomCurso", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"01/01/2012\"", ",", "objGrp", ".", "getFecInicio", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"31/05/2012\"", ",", "objGrp", ".", "getFecFin", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"En", "Curso\"", ",", "objGrp", ".", "getEstado", "(", ")", ")", ";", "}", "}", "</s>" ]
10,425
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "datatest", ";", "import", "org", ".", "junit", ".", "Assert", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Compra", ";", "public", "class", "CompraTest", "{", "@", "Test", "public", "void", "testDataCompra", "(", ")", "{", "Compra", "objCom", "=", "new", "Compra", "(", ")", ";", "objCom", ".", "setConcepto", "(", "\"Suministro\"", ")", ";", "objCom", ".", "setNumero", "(", "3545", ")", ";", "objCom", ".", "setFecEmision", "(", "\"01/12/2012\"", ")", ";", "objCom", ".", "setNomEmpresa", "(", "\"\"", ")", ";", "objCom", ".", "setEstado", "(", "\"Nuevo\"", ")", ";", "objCom", ".", "setFecPago", "(", "\"10/12/2012\"", ")", ";", "objCom", ".", "setFecVencim", "(", "\"15/12/2012\"", ")", ";", "objCom", ".", "setMonSubtot", "(", "100.00", ")", ";", "objCom", ".", "setMonIGV", "(", "18.00", ")", ";", "objCom", ".", "setMonTotal", "(", "118.00", ")", ";", "objCom", ".", "setObservacion", "(", "\"\"", ")", ";", "Assert", ".", "assertArrayEquals", "(", "new", "Object", "[", "]", "{", "\"Suministro\"", ",", "3545", ",", "\"01/12/2012\"", ",", "\"\"", ",", "\"Nuevo\"", ",", "\"10/12/2012\"", ",", "\"15/12/2012\"", ",", "100.00", ",", "18.00", ",", "118.00", ",", "\"\"", "}", ",", "new", "Object", "[", "]", "{", "objCom", ".", "getConcepto", "(", ")", ",", "objCom", ".", "getNumero", "(", ")", ",", "objCom", ".", "getFecEmision", "(", ")", ",", "objCom", ".", "getNomEmpresa", "(", ")", ",", "objCom", ".", "getEstado", "(", ")", ",", "objCom", ".", "getFecPago", "(", ")", ",", "objCom", ".", "getFecVencim", "(", ")", ",", "objCom", ".", "getMonSubtot", "(", ")", ",", "objCom", ".", "getMonIGV", "(", ")", ",", "objCom", ".", "getMonTotal", "(", ")", ",", "objCom", ".", "getObservacion", "(", ")", "}", ")", ";", "objCom", "=", "new", "Compra", "(", ")", ";", "objCom", ".", "setConcepto", "(", "\"\"", ")", ";", "objCom", ".", "setNumero", "(", "3546", ")", ";", "objCom", ".", "setFecEmision", "(", "\"01/01/2013\"", ")", ";", "objCom", ".", "setNomEmpresa", "(", "\"\"", ")", ";", "objCom", ".", "setEstado", "(", "\"Cancelada\"", ")", ";", "objCom", ".", "setFecPago", "(", "\"15/01/2013\"", ")", ";", "objCom", ".", "setFecVencim", "(", "\"24/01/2013\"", ")", ";", "objCom", ".", "setMonSubtot", "(", "300.00", ")", ";", "objCom", ".", "setMonIGV", "(", "54.00", ")", ";", "objCom", ".", "setMonTotal", "(", "354.00", ")", ";", "objCom", ".", "setObservacion", "(", "\"\"", ")", ";", "Assert", ".", "assertEquals", "(", "\"\"", ",", "objCom", ".", "getConcepto", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "3546", ",", "objCom", ".", "getNumero", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"01/01/2013\"", ",", "objCom", ".", "getFecEmision", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"\"", ",", "objCom", ".", "getNomEmpresa", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"Cancelada\"", ",", "objCom", ".", "getEstado", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"15/01/2013\"", ",", "objCom", ".", "getFecPago", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"24/01/2013\"", ",", "objCom", ".", "getFecVencim", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "300.00", ",", "objCom", ".", "getMonSubtot", "(", ")", ",", "0", ")", ";", "Assert", ".", "assertEquals", "(", "54.00", ",", "objCom", ".", "getMonIGV", "(", ")", ",", "0", ")", ";", "Assert", ".", "assertEquals", "(", "354.00", ",", "objCom", ".", "getMonTotal", "(", ")", ",", "0", ")", ";", "Assert", ".", "assertEquals", "(", "\"\"", ",", "objCom", ".", "getObservacion", "(", ")", ")", ";", "}", "}", "</s>" ]
10,426
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "datatest", ";", "import", "org", ".", "junit", ".", "Assert", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Prospecto", ";", "public", "class", "ProspectoTest", "{", "@", "Test", "public", "void", "testDataProspecto", "(", ")", "{", "Prospecto", "objPro", "=", "new", "Prospecto", "(", ")", ";", "objPro", ".", "setNumProspecto", "(", "1", ")", ";", "objPro", ".", "setFecProspecto", "(", "\"01/01/2013\"", ")", ";", "objPro", ".", "setNombes", "(", "\"Luis", "Enrique\"", ")", ";", "objPro", ".", "setApePaterno", "(", "\"Olivera\"", ")", ";", "objPro", ".", "setApeMaterno", "(", "\"Aguilar\"", ")", ";", "objPro", ".", "setCorreo", "(", "\"\"", ")", ";", "objPro", ".", "setNroDNI", "(", "\"71033506\"", ")", ";", "objPro", ".", "setTelefono", "(", "\"3533332\"", ")", ";", "objPro", ".", "setCelular", "(", "\"983422323\"", ")", ";", "objPro", ".", "setEstado", "(", "\"\"", ")", ";", "Assert", ".", "assertEquals", "(", "1", ",", "objPro", ".", "getNumProspecto", "(", ")", ",", "0", ")", ";", "Assert", ".", "assertEquals", "(", "\"01/01/2013\"", ",", "objPro", ".", "getFecProspecto", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"Luis", "Enrique\"", ",", "objPro", ".", "getNombes", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"Olivera\"", ",", "objPro", ".", "getApePaterno", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"Aguilar\"", ",", "objPro", ".", "getApeMaterno", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"\"", ",", "objPro", ".", "getCorreo", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"71033506\"", ",", "objPro", ".", "getNroDNI", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"3533332\"", ",", "objPro", ".", "getTelefono", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"983422323\"", ",", "objPro", ".", "getCelular", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"\"", ",", "objPro", ".", "getEstado", "(", ")", ")", ";", "objPro", "=", "new", "Prospecto", "(", ")", ";", "objPro", ".", "setNumProspecto", "(", "2", ")", ";", "objPro", ".", "setFecProspecto", "(", "\"31/12/2012\"", ")", ";", "objPro", ".", "setNombes", "(", "\"Karol\"", ")", ";", "objPro", ".", "setApePaterno", "(", "\"Vargas\"", ")", ";", "objPro", ".", "setApeMaterno", "(", "\"Cancho\"", ")", ";", "objPro", ".", "setCorreo", "(", "\"\"", ")", ";", "objPro", ".", "setNroDNI", "(", "\"54334431\"", ")", ";", "objPro", ".", "setTelefono", "(", "\"5873456\"", ")", ";", "objPro", ".", "setCelular", "(", "\"987183223\"", ")", ";", "objPro", ".", "setEstado", "(", "\"X\"", ")", ";", "Assert", ".", "assertEquals", "(", "2", ",", "objPro", ".", "getNumProspecto", "(", ")", ",", "0", ")", ";", "Assert", ".", "assertEquals", "(", "\"31/12/2012\"", ",", "objPro", ".", "getFecProspecto", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"Karol\"", ",", "objPro", ".", "getNombes", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"Vargas\"", ",", "objPro", ".", "getApePaterno", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"Cancho\"", ",", "objPro", ".", "getApeMaterno", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"\"", ",", "objPro", ".", "getCorreo", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"54334431\"", ",", "objPro", ".", "getNroDNI", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"5873456\"", ",", "objPro", ".", "getTelefono", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"987183223\"", ",", "objPro", ".", "getCelular", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "\"X\"", ",", "objPro", ".", "getEstado", "(", ")", ")", ";", "}", "}", "</s>" ]
10,427
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "data", ";", "public", "abstract", "class", "Movimiento", "{", "String", "Concepto", ";", "int", "Numero", ";", "String", "FecEmision", ";", "String", "NomEmpresa", ";", "String", "FecVencim", ";", "String", "FecPago", ";", "String", "Estado", ";", "String", "Observacion", ";", "Double", "MonSubtot", ";", "Double", "MonIGV", ";", "Double", "MonTotal", ";", "String", "Moneda", ";", "String", "Tipo", ";", "public", "String", "getConcepto", "(", ")", "{", "return", "Concepto", ";", "}", "public", "void", "setConcepto", "(", "String", "concepto", ")", "{", "Concepto", "=", "concepto", ";", "}", "public", "int", "getNumero", "(", ")", "{", "return", "Numero", ";", "}", "public", "void", "setNumero", "(", "int", "numero", ")", "{", "Numero", "=", "numero", ";", "}", "public", "String", "getFecEmision", "(", ")", "{", "return", "FecEmision", ";", "}", "public", "void", "setFecEmision", "(", "String", "fecEmision", ")", "{", "FecEmision", "=", "fecEmision", ";", "}", "public", "String", "getNomEmpresa", "(", ")", "{", "return", "NomEmpresa", ";", "}", "public", "void", "setNomEmpresa", "(", "String", "nomEmpresa", ")", "{", "NomEmpresa", "=", "nomEmpresa", ";", "}", "public", "String", "getFecVencim", "(", ")", "{", "return", "FecVencim", ";", "}", "public", "void", "setFecVencim", "(", "String", "fecVencim", ")", "{", "FecVencim", "=", "fecVencim", ";", "}", "public", "String", "getFecPago", "(", ")", "{", "return", "FecPago", ";", "}", "public", "void", "setFecPago", "(", "String", "fecPago", ")", "{", "FecPago", "=", "fecPago", ";", "}", "public", "String", "getEstado", "(", ")", "{", "return", "Estado", ";", "}", "public", "void", "setEstado", "(", "String", "estado", ")", "{", "Estado", "=", "estado", ";", "}", "public", "String", "getObservacion", "(", ")", "{", "return", "Observacion", ";", "}", "public", "void", "setObservacion", "(", "String", "observacion", ")", "{", "Observacion", "=", "observacion", ";", "}", "public", "Double", "getMonSubtot", "(", ")", "{", "return", "MonSubtot", ";", "}", "public", "void", "setMonSubtot", "(", "Double", "monSubtot", ")", "{", "MonSubtot", "=", "monSubtot", ";", "}", "public", "Double", "getMonIGV", "(", ")", "{", "return", "MonIGV", ";", "}", "public", "void", "setMonIGV", "(", "Double", "monIGV", ")", "{", "MonIGV", "=", "monIGV", ";", "}", "public", "Double", "getMonTotal", "(", ")", "{", "return", "MonTotal", ";", "}", "public", "void", "setMonTotal", "(", "Double", "monTotal", ")", "{", "MonTotal", "=", "monTotal", ";", "}", "public", "String", "getMoneda", "(", ")", "{", "return", "Moneda", ";", "}", "public", "void", "setMoneda", "(", "String", "moneda", ")", "{", "Moneda", "=", "moneda", ";", "}", "public", "String", "getTipo", "(", ")", "{", "return", "Tipo", ";", "}", "public", "void", "setTipo", "(", "String", "tipo", ")", "{", "Tipo", "=", "tipo", ";", "}", "}", "</s>" ]
10,428
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "data", ";", "public", "class", "Prospecto", "{", "int", "NumProspecto", ";", "String", "FecProspecto", ";", "String", "NomProspecto", ";", "String", "ApePaterno", ";", "String", "ApeMaterno", ";", "String", "Nombes", ";", "String", "Correo", ";", "String", "NroDNI", ";", "String", "Telefono", ";", "String", "Celular", ";", "String", "Estado", ";", "public", "Prospecto", "(", ")", "{", "}", "public", "int", "getNumProspecto", "(", ")", "{", "return", "NumProspecto", ";", "}", "public", "void", "setNumProspecto", "(", "int", "numProspecto", ")", "{", "NumProspecto", "=", "numProspecto", ";", "}", "public", "String", "getFecProspecto", "(", ")", "{", "return", "FecProspecto", ";", "}", "public", "void", "setFecProspecto", "(", "String", "fecProspecto", ")", "{", "FecProspecto", "=", "fecProspecto", ";", "}", "public", "String", "getNomProspecto", "(", ")", "{", "return", "NomProspecto", ";", "}", "public", "void", "setNomProspecto", "(", "String", "nomProspecto", ")", "{", "NomProspecto", "=", "nomProspecto", ";", "}", "public", "String", "getApePaterno", "(", ")", "{", "return", "ApePaterno", ";", "}", "public", "void", "setApePaterno", "(", "String", "apePaterno", ")", "{", "ApePaterno", "=", "apePaterno", ";", "}", "public", "String", "getApeMaterno", "(", ")", "{", "return", "ApeMaterno", ";", "}", "public", "void", "setApeMaterno", "(", "String", "apeMaterno", ")", "{", "ApeMaterno", "=", "apeMaterno", ";", "}", "public", "String", "getNombes", "(", ")", "{", "return", "Nombes", ";", "}", "public", "void", "setNombes", "(", "String", "nombes", ")", "{", "Nombes", "=", "nombes", ";", "}", "public", "String", "getCorreo", "(", ")", "{", "return", "Correo", ";", "}", "public", "void", "setCorreo", "(", "String", "correo", ")", "{", "Correo", "=", "correo", ";", "}", "public", "String", "getNroDNI", "(", ")", "{", "return", "NroDNI", ";", "}", "public", "void", "setNroDNI", "(", "String", "nroDNI", ")", "{", "NroDNI", "=", "nroDNI", ";", "}", "public", "String", "getTelefono", "(", ")", "{", "return", "Telefono", ";", "}", "public", "void", "setTelefono", "(", "String", "telefono", ")", "{", "Telefono", "=", "telefono", ";", "}", "public", "String", "getCelular", "(", ")", "{", "return", "Celular", ";", "}", "public", "void", "setCelular", "(", "String", "celular", ")", "{", "Celular", "=", "celular", ";", "}", "public", "String", "getEstado", "(", ")", "{", "return", "Estado", ";", "}", "public", "void", "setEstado", "(", "String", "estado", ")", "{", "Estado", "=", "estado", ";", "}", "}", "</s>" ]
10,429
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "data", ";", "public", "class", "Cliente", "{", "public", "String", "getCodCliente", "(", ")", "{", "return", "codCliente", ";", "}", "public", "void", "setCodCliente", "(", "String", "codCliente", ")", "{", "this", ".", "codCliente", "=", "codCliente", ";", "}", "public", "String", "codCliente", ";", "public", "String", "nomCliente", ";", "public", "String", "apePatCliente", ";", "public", "String", "apeMatCliente", ";", "public", "String", "emaCliente", ";", "public", "String", "dniCliente", ";", "public", "String", "fonCliente", ";", "public", "String", "fecConCliente", ";", "public", "String", "estCliente", ";", "public", "String", "getEstCliente", "(", ")", "{", "return", "estCliente", ";", "}", "public", "void", "setEstCliente", "(", "String", "estCliente", ")", "{", "this", ".", "estCliente", "=", "estCliente", ";", "}", "public", "void", "setDniCliente", "(", "String", "dniCliente", ")", "{", "this", ".", "dniCliente", "=", "dniCliente", ";", "}", "public", "String", "getDniCliente", "(", ")", "{", "return", "dniCliente", ";", "}", "public", "String", "getNomCliente", "(", ")", "{", "return", "nomCliente", ";", "}", "public", "void", "setNomCliente", "(", "String", "nomCliente", ")", "{", "this", ".", "nomCliente", "=", "nomCliente", ";", "}", "public", "String", "getApePatCliente", "(", ")", "{", "return", "apePatCliente", ";", "}", "public", "void", "setApePatCliente", "(", "String", "apePatCliente", ")", "{", "this", ".", "apePatCliente", "=", "apePatCliente", ";", "}", "public", "String", "getApeMatCliente", "(", ")", "{", "return", "apeMatCliente", ";", "}", "public", "void", "setApeMatCliente", "(", "String", "apeMatCliente", ")", "{", "this", ".", "apeMatCliente", "=", "apeMatCliente", ";", "}", "public", "String", "getEmaCliente", "(", ")", "{", "return", "emaCliente", ";", "}", "public", "void", "setEmaCliente", "(", "String", "emaCliente", ")", "{", "this", ".", "emaCliente", "=", "emaCliente", ";", "}", "public", "String", "getFonCliente", "(", ")", "{", "return", "fonCliente", ";", "}", "public", "void", "setFonCliente", "(", "String", "fonCliente", ")", "{", "this", ".", "fonCliente", "=", "fonCliente", ";", "}", "public", "String", "getFecConCliente", "(", ")", "{", "return", "fecConCliente", ";", "}", "public", "void", "setFecConCliente", "(", "String", "fecConCliente", ")", "{", "this", ".", "fecConCliente", "=", "fecConCliente", ";", "}", "}", "</s>" ]
10,430
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "data", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Comparator", ";", "import", "java", ".", "util", ".", "Date", ";", "import", "java", ".", "util", ".", "List", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "Loader", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "ProcessException", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "Validaciones", ";", "public", "class", "Venta", "extends", "Movimiento", "implements", "Comparator", "<", "Venta", ">", "{", "private", "String", "CodAlumno", ";", "private", "String", "NomAlumno", ";", "private", "String", "ApePatAlumno", ";", "private", "String", "ApeMatAlumno", ";", "private", "String", "CodTipoDocumento", ";", "private", "String", "CodCurso", ";", "private", "String", "NomCurso", ";", "private", "double", "PreCurso", ";", "private", "int", "CanCurso", ";", "private", "String", "NomEmpleado", ";", "private", "String", "ApeEmpleado", ";", "private", "String", "CodEmpleado", ";", "private", "String", "CodCliente", ";", "private", "String", "CodTipCliente", ";", "private", "String", "NroRucCliente", ";", "private", "String", "NroDniCliente", ";", "private", "String", "NomCliente", ";", "private", "String", "ApePatCliente", ";", "private", "String", "ApeMatCliente", ";", "private", "int", "NroMovimiento", ";", "private", "String", "TipoComprobante", ";", "private", "String", "NroBoleta", ";", "private", "String", "RUC", ";", "private", "Date", "FechaPago", ";", "private", "Double", "SubTotal", ";", "private", "Double", "Igv", ";", "private", "Double", "Total", ";", "private", "String", "Moneda", ";", "private", "String", "Observacion", ";", "private", "int", "UsuarioRegistro", ";", "private", "Date", "FechaRegistro", ";", "private", "String", "CodCuenta", ";", "private", "String", "DesCuenta", ";", "private", "Double", "MontoTotalCuenta", ";", "private", "String", "MonCuenta", ";", "private", "Double", "SalCuenta", ";", "private", "String", "EstadoCuenta", ";", "private", "int", "NroCuota", ";", "private", "Double", "MontoCronograma", ";", "private", "String", "MonedaCronograma", ";", "private", "Date", "FechaVencimientoCronograma", ";", "private", "Double", "MontoMora", ";", "private", "String", "EstadoCuota", ";", "public", "Venta", "(", ")", "{", "}", "@", "Override", "public", "String", "toString", "(", ")", "{", "String", "tipoDocumento", "=", "\"\"", ";", "if", "(", "CodTipoDocumento", "==", "\"1\"", ")", "{", "tipoDocumento", "=", "\"BOLETA\"", ";", "}", "else", "if", "(", "CodTipoDocumento", "==", "\"2\"", ")", "{", "tipoDocumento", "=", "\"FACTURA\"", ";", "}", "if", "(", "CodCurso", "==", "\"C01\"", ")", "{", "NomCurso", "=", "\"POO\"", ";", "}", "return", "\"\"", "+", "Numero", "+", "\"\"", "+", "tipoDocumento", "+", "\"\"", "+", "NomCurso", "+", "\"\"", "+", "NomCliente", "+", "\"\"", "+", "NroRucCliente", "+", "\",", "Concepto=\"", "+", "Concepto", "+", "\"\"", "+", "FecEmision", "+", "\"\"", "+", "FecVencim", "+", "\",", "FechaPago=\"", "+", "FecPago", "+", "\",", "Estado=\"", "+", "Estado", "+", "\"\"", "+", "Observacion", "+", "\"\"", "+", "MonSubtot", "+", "\",", "MontoIGV=\"", "+", "MonIGV", "+", "\"\"", "+", "MonTotal", "+", "\",", "Moneda=\"", "+", "Moneda", "+", "\"]\"", ";", "}", "Validaciones", "objValidaciones", "=", "new", "Validaciones", "(", ")", ";", "@", "Override", "public", "int", "compare", "(", "Venta", "oVenta1", ",", "Venta", "oVenta2", ")", "{", "if", "(", "objValidaciones", ".", "dateToInt", "(", "oVenta1", ".", "getFecVencim", "(", ")", ")", "==", "objValidaciones", ".", "dateToInt", "(", "oVenta2", ".", "getFecVencim", "(", ")", ")", ")", "{", "return", "0", ";", "}", "else", "if", "(", "objValidaciones", ".", "dateToInt", "(", "oVenta1", ".", "getFecVencim", "(", ")", ")", ">=", "objValidaciones", ".", "dateToInt", "(", "oVenta2", ".", "getFecVencim", "(", ")", ")", ")", "{", "return", "1", ";", "}", "else", "{", "return", "-", "1", ";", "}", "}", "public", "ArrayList", "<", "Venta", ">", "getDataCursos", "(", ")", "{", "Loader", "objLoa", "=", "new", "Loader", "(", ")", ";", "ArrayList", "<", "Venta", ">", "arrVentas", "=", "new", "ArrayList", "<", "Venta", ">", "(", ")", ";", "Venta", "objVenta", "=", "null", ";", "String", "url", "=", "objLoa", ".", "getClass", "(", ")", ".", "getResource", "(", "\"\"", ")", ".", "getFile", "(", ")", ";", "ArrayList", "<", "String", "[", "]", ">", "lisPro", "=", "objLoa", ".", "getDataTxt", "(", "url", ")", ";", "for", "(", "String", "[", "]", "row", ":", "lisPro", ")", "{", "objVenta", "=", "new", "Venta", "(", ")", ";", "objVenta", ".", "setCodCurso", "(", "row", "[", "0", "]", ")", ";", "objVenta", ".", "setNomCurso", "(", "row", "[", "1", "]", ")", ";", "objVenta", ".", "setPreCurso", "(", "Double", ".", "parseDouble", "(", "row", "[", "2", "]", ")", ")", ";", "arrVentas", ".", "add", "(", "objVenta", ")", ";", "}", "return", "arrVentas", ";", "}", "public", "ArrayList", "<", "Venta", ">", "getDataCuentas", "(", ")", "{", "Loader", "objLoa", "=", "new", "Loader", "(", ")", ";", "ArrayList", "<", "Venta", ">", "arrVentas", "=", "new", "ArrayList", "<", "Venta", ">", "(", ")", ";", "Venta", "objVenta", "=", "null", ";", "String", "url", "=", "objLoa", ".", "getClass", "(", ")", ".", "getResource", "(", "\"\"", ")", ".", "getFile", "(", ")", ";", "ArrayList", "<", "String", "[", "]", ">", "lisPro", "=", "objLoa", ".", "getDataTxt", "(", "url", ")", ";", "for", "(", "String", "[", "]", "row", ":", "lisPro", ")", "{", "if", "(", "!", "row", "[", "0", "]", ".", "equalsIgnoreCase", "(", "\"\"", ")", ")", "{", "objVenta", "=", "new", "Venta", "(", ")", ";", "objVenta", ".", "setCodCuenta", "(", "row", "[", "0", "]", ")", ";", "objVenta", ".", "setCodCliente", "(", "row", "[", "1", "]", ")", ";", "objVenta", ".", "setCodCurso", "(", "row", "[", "2", "]", ")", ";", "objVenta", ".", "setMontoTotalCuenta", "(", "Double", ".", "parseDouble", "(", "row", "[", "3", "]", ")", ")", ";", "objVenta", ".", "setMoneda", "(", "row", "[", "4", "]", ")", ";", "objVenta", ".", "setSalCuenta", "(", "Double", ".", "parseDouble", "(", "row", "[", "5", "]", ")", ")", ";", "objVenta", ".", "setEstadoCuenta", "(", "row", "[", "6", "]", ")", ";", "arrVentas", ".", "add", "(", "objVenta", ")", ";", "}", "}", "return", "arrVentas", ";", "}", "public", "ArrayList", "<", "Venta", ">", "getDataCronogramaCuentas", "(", ")", "{", "Validaciones", "oUtil", "=", "new", "Validaciones", "(", ")", ";", "Loader", "objLoa", "=", "new", "Loader", "(", ")", ";", "ArrayList", "<", "Venta", ">", "arrVentas", "=", "new", "ArrayList", "<", "Venta", ">", "(", ")", ";", "Venta", "objVenta", "=", "null", ";", "String", "url", "=", "objLoa", ".", "getClass", "(", ")", ".", "getResource", "(", "\"\"", ")", ".", "getFile", "(", ")", ";", "ArrayList", "<", "String", "[", "]", ">", "lisPro", "=", "objLoa", ".", "getDataTxt", "(", "url", ")", ";", "for", "(", "String", "[", "]", "row", ":", "lisPro", ")", "{", "if", "(", "!", "row", "[", "0", "]", ".", "equalsIgnoreCase", "(", "\"\"", ")", ")", "{", "objVenta", "=", "new", "Venta", "(", ")", ";", "objVenta", ".", "setCodCuenta", "(", "row", "[", "0", "]", ")", ";", "objVenta", ".", "setNroCuota", "(", "Integer", ".", "parseInt", "(", "row", "[", "1", "]", ")", ")", ";", "objVenta", ".", "setMontoCronograma", "(", "Double", ".", "parseDouble", "(", "row", "[", "2", "]", ")", ")", ";", "objVenta", ".", "setMonedaCronograma", "(", "row", "[", "3", "]", ")", ";", "objVenta", ".", "setFechaVencimientoCronograma", "(", "oUtil", ".", "stringToDate", "(", "row", "[", "4", "]", ")", ")", ";", "objVenta", ".", "setEstadoCuota", "(", "row", "[", "6", "]", ")", ";", "arrVentas", ".", "add", "(", "objVenta", ")", ";", "}", "}", "return", "arrVentas", ";", "}", "public", "Venta", "getCursoByCodigo", "(", "String", "CodCurso", ")", "{", "List", "<", "Venta", ">", "arrCursos", "=", "new", "ArrayList", "<", "Venta", ">", "(", ")", ";", "arrCursos", "=", "getDataCursos", "(", ")", ";", "for", "(", "Venta", "oVenCurso", ":", "arrCursos", ")", "{", "if", "(", "oVenCurso", ".", "getCodCurso", "(", ")", ".", "equals", "(", "CodCurso", ")", ")", "{", "return", "oVenCurso", ";", "}", "}", "new", "ProcessException", "(", "\"\"", "+", "CodCuenta", "+", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "null", ";", "}", "public", "Venta", "getCuentaByCodigo", "(", "String", "CodCuenta", ")", "{", "List", "<", "Venta", ">", "arrCuenta", "=", "new", "ArrayList", "<", "Venta", ">", "(", ")", ";", "arrCuenta", "=", "getDataCuentas", "(", ")", ";", "for", "(", "Venta", "oVenCuenta", ":", "arrCuenta", ")", "{", "if", "(", "oVenCuenta", ".", "getCodCuenta", "(", ")", ".", "equals", "(", "CodCuenta", ")", ")", "{", "return", "oVenCuenta", ";", "}", "}", "new", "ProcessException", "(", "\"\"", "+", "CodCuenta", "+", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "null", ";", "}", "public", "List", "<", "Venta", ">", "getCronogramaByCodigoCuenta", "(", "String", "CodCuenta", ")", "{", "List", "<", "Venta", ">", "arrCrono", "=", "new", "ArrayList", "<", "Venta", ">", "(", ")", ";", "List", "<", "Venta", ">", "arrCronograma", "=", "new", "ArrayList", "<", "Venta", ">", "(", ")", ";", "arrCronograma", "=", "getDataCronogramaCuentas", "(", ")", ";", "for", "(", "Venta", "oVenCrono", ":", "arrCronograma", ")", "{", "if", "(", "oVenCrono", ".", "getCodCuenta", "(", ")", ".", "equals", "(", "CodCuenta", ")", ")", "{", "arrCrono", ".", "add", "(", "oVenCrono", ")", ";", "}", "}", "return", "arrCrono", ";", "}", "public", "int", "getNroCuota", "(", ")", "{", "return", "NroCuota", ";", "}", "public", "void", "setNroCuota", "(", "int", "nroCuota", ")", "{", "NroCuota", "=", "nroCuota", ";", "}", "public", "Double", "getMontoCronograma", "(", ")", "{", "return", "MontoCronograma", ";", "}", "public", "void", "setMontoCronograma", "(", "Double", "montoCronograma", ")", "{", "MontoCronograma", "=", "montoCronograma", ";", "}", "public", "String", "getMonedaCronograma", "(", ")", "{", "return", "MonedaCronograma", ";", "}", "public", "void", "setMonedaCronograma", "(", "String", "monedaCronograma", ")", "{", "MonedaCronograma", "=", "monedaCronograma", ";", "}", "public", "Date", "getFechaVencimientoCronograma", "(", ")", "{", "return", "FechaVencimientoCronograma", ";", "}", "public", "void", "setFechaVencimientoCronograma", "(", "Date", "fechaVencimientoCronograma", ")", "{", "FechaVencimientoCronograma", "=", "fechaVencimientoCronograma", ";", "}", "public", "String", "getEstadoCuota", "(", ")", "{", "return", "EstadoCuota", ";", "}", "public", "void", "setEstadoCuota", "(", "String", "estadoCuota", ")", "{", "EstadoCuota", "=", "estadoCuota", ";", "}", "public", "int", "getNroMovimiento", "(", ")", "{", "return", "NroMovimiento", ";", "}", "public", "void", "setNroMovimiento", "(", "int", "nroMovimiento", ")", "{", "NroMovimiento", "=", "nroMovimiento", ";", "}", "public", "String", "getTipoComprobante", "(", ")", "{", "return", "TipoComprobante", ";", "}", "public", "void", "setTipoComprobante", "(", "String", "tipoComprobante", ")", "{", "TipoComprobante", "=", "tipoComprobante", ";", "}", "public", "String", "getNroBoleta", "(", ")", "{", "return", "NroBoleta", ";", "}", "public", "void", "setNroBoleta", "(", "String", "nroBoleta", ")", "{", "NroBoleta", "=", "nroBoleta", ";", "}", "public", "String", "getRUC", "(", ")", "{", "return", "RUC", ";", "}", "public", "void", "setRUC", "(", "String", "rUC", ")", "{", "RUC", "=", "rUC", ";", "}", "public", "Date", "getFechaPago", "(", ")", "{", "return", "FechaPago", ";", "}", "public", "void", "setFechaPago", "(", "Date", "fechaPago", ")", "{", "FechaPago", "=", "fechaPago", ";", "}", "public", "Double", "getSubTotal", "(", ")", "{", "return", "SubTotal", ";", "}", "public", "void", "setSubTotal", "(", "Double", "subTotal", ")", "{", "SubTotal", "=", "subTotal", ";", "}", "public", "Double", "getIgv", "(", ")", "{", "return", "Igv", ";", "}", "public", "void", "setIgv", "(", "Double", "igv", ")", "{", "Igv", "=", "igv", ";", "}", "public", "Double", "getTotal", "(", ")", "{", "return", "Total", ";", "}", "public", "void", "setTotal", "(", "Double", "total", ")", "{", "Total", "=", "total", ";", "}", "public", "String", "getMoneda", "(", ")", "{", "return", "Moneda", ";", "}", "public", "void", "setMoneda", "(", "String", "moneda", ")", "{", "Moneda", "=", "moneda", ";", "}", "public", "String", "getObservacion", "(", ")", "{", "return", "Observacion", ";", "}", "public", "void", "setObservacion", "(", "String", "observacion", ")", "{", "Observacion", "=", "observacion", ";", "}", "public", "int", "getUsuarioRegistro", "(", ")", "{", "return", "UsuarioRegistro", ";", "}", "public", "void", "setUsuarioRegistro", "(", "int", "usuarioRegistro", ")", "{", "UsuarioRegistro", "=", "usuarioRegistro", ";", "}", "public", "Date", "getFechaRegistro", "(", ")", "{", "return", "FechaRegistro", ";", "}", "public", "void", "setFechaRegistro", "(", "Date", "fechaRegistro", ")", "{", "FechaRegistro", "=", "fechaRegistro", ";", "}", "public", "String", "getCodCuenta", "(", ")", "{", "return", "CodCuenta", ";", "}", "public", "void", "setCodCuenta", "(", "String", "codCuenta", ")", "{", "CodCuenta", "=", "codCuenta", ";", "}", "public", "String", "getDesCuenta", "(", ")", "{", "return", "DesCuenta", ";", "}", "public", "void", "setDesCuenta", "(", "String", "desCuenta", ")", "{", "DesCuenta", "=", "desCuenta", ";", "}", "public", "Double", "getMontoTotalCuenta", "(", ")", "{", "return", "MontoTotalCuenta", ";", "}", "public", "void", "setMontoTotalCuenta", "(", "Double", "montoTotalCuenta", ")", "{", "MontoTotalCuenta", "=", "montoTotalCuenta", ";", "}", "public", "String", "getMonCuenta", "(", ")", "{", "return", "MonCuenta", ";", "}", "public", "void", "setMonCuenta", "(", "String", "monCuenta", ")", "{", "MonCuenta", "=", "monCuenta", ";", "}", "public", "Double", "getSalCuenta", "(", ")", "{", "return", "SalCuenta", ";", "}", "public", "void", "setSalCuenta", "(", "Double", "salCuenta", ")", "{", "SalCuenta", "=", "salCuenta", ";", "}", "public", "String", "getEstadoCuenta", "(", ")", "{", "return", "EstadoCuenta", ";", "}", "public", "void", "setEstadoCuenta", "(", "String", "estadoCuenta", ")", "{", "EstadoCuenta", "=", "estadoCuenta", ";", "}", "public", "String", "getNomAlumno", "(", ")", "{", "return", "NomAlumno", ";", "}", "public", "void", "setNomAlumno", "(", "String", "nomAlumno", ")", "{", "NomAlumno", "=", "nomAlumno", ";", "}", "public", "String", "getApePatAlumno", "(", ")", "{", "return", "ApePatAlumno", ";", "}", "public", "void", "setApePatAlumno", "(", "String", "apePatAlumno", ")", "{", "ApePatAlumno", "=", "apePatAlumno", ";", "}", "public", "String", "getApeMatAlumno", "(", ")", "{", "return", "ApeMatAlumno", ";", "}", "public", "void", "setApeMatAlumno", "(", "String", "apeMatAlumno", ")", "{", "ApeMatAlumno", "=", "apeMatAlumno", ";", "}", "public", "String", "getCodTipoDocumento", "(", ")", "{", "return", "CodTipoDocumento", ";", "}", "public", "void", "setCodTipoDocumento", "(", "String", "codTipoDocumento", ")", "{", "CodTipoDocumento", "=", "codTipoDocumento", ";", "}", "public", "String", "getCodCurso", "(", ")", "{", "return", "CodCurso", ";", "}", "public", "void", "setCodCurso", "(", "String", "codCurso", ")", "{", "CodCurso", "=", "codCurso", ";", "}", "public", "String", "getNomCurso", "(", ")", "{", "return", "NomCurso", ";", "}", "public", "void", "setNomCurso", "(", "String", "nomCurso", ")", "{", "NomCurso", "=", "nomCurso", ";", "}", "public", "double", "getPreCurso", "(", ")", "{", "return", "PreCurso", ";", "}", "public", "void", "setPreCurso", "(", "double", "preCurso", ")", "{", "PreCurso", "=", "preCurso", ";", "}", "public", "int", "getCanCurso", "(", ")", "{", "return", "CanCurso", ";", "}", "public", "void", "setCanCurso", "(", "int", "canCurso", ")", "{", "CanCurso", "=", "canCurso", ";", "}", "public", "String", "getNomEmpleado", "(", ")", "{", "return", "NomEmpleado", ";", "}", "public", "void", "setNomEmpleado", "(", "String", "nomEmpleado", ")", "{", "NomEmpleado", "=", "nomEmpleado", ";", "}", "public", "String", "getApeEmpleado", "(", ")", "{", "return", "ApeEmpleado", ";", "}", "public", "void", "setApeEmpleado", "(", "String", "apeEmpleado", ")", "{", "ApeEmpleado", "=", "apeEmpleado", ";", "}", "public", "String", "getCodEmpleado", "(", ")", "{", "return", "CodEmpleado", ";", "}", "public", "void", "setCodEmpleado", "(", "String", "codEmpleado", ")", "{", "CodEmpleado", "=", "codEmpleado", ";", "}", "public", "String", "getCodAlumno", "(", ")", "{", "return", "CodAlumno", ";", "}", "public", "void", "setCodAlumno", "(", "String", "codAlumno", ")", "{", "CodAlumno", "=", "codAlumno", ";", "}", "public", "String", "getCodCliente", "(", ")", "{", "return", "CodCliente", ";", "}", "public", "void", "setCodCliente", "(", "String", "codCliente", ")", "{", "CodCliente", "=", "codCliente", ";", "}", "public", "String", "getCodTipCliente", "(", ")", "{", "return", "CodTipCliente", ";", "}", "public", "void", "setCodTipCliente", "(", "String", "codTipCliente", ")", "{", "CodTipCliente", "=", "codTipCliente", ";", "}", "public", "String", "getNomCliente", "(", ")", "{", "return", "NomCliente", ";", "}", "public", "void", "setNomCliente", "(", "String", "nomCliente", ")", "{", "NomCliente", "=", "nomCliente", ";", "}", "public", "String", "getApePatCliente", "(", ")", "{", "return", "ApePatCliente", ";", "}", "public", "void", "setApePatCliente", "(", "String", "apePatCliente", ")", "{", "ApePatCliente", "=", "apePatCliente", ";", "}", "public", "String", "getApeMatCliente", "(", ")", "{", "return", "ApeMatCliente", ";", "}", "public", "void", "setApeMatCliente", "(", "String", "apeMatCliente", ")", "{", "ApeMatCliente", "=", "apeMatCliente", ";", "}", "public", "String", "getNroRucCliente", "(", ")", "{", "return", "NroRucCliente", ";", "}", "public", "void", "setNroRucCliente", "(", "String", "nroRucCliente", ")", "{", "NroRucCliente", "=", "nroRucCliente", ";", "}", "private", "String", "getNroDniCliente", "(", ")", "{", "return", "NroDniCliente", ";", "}", "private", "void", "setNroDniCliente", "(", "String", "nroDniCliente", ")", "{", "NroDniCliente", "=", "nroDniCliente", ";", "}", "private", "Double", "getMontoMora", "(", ")", "{", "return", "MontoMora", ";", "}", "private", "void", "setMontoMora", "(", "Double", "montoMora", ")", "{", "MontoMora", "=", "montoMora", ";", "}", "}", "</s>" ]
10,431
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "data", ";", "public", "class", "Permisos", "{", "private", "boolean", "Acceso", ";", "private", "boolean", "Adicionar", ";", "private", "boolean", "Editar", ";", "private", "boolean", "Eliminar", ";", "private", "Modulo", "modulo", ";", "public", "Permisos", "(", "boolean", "acceso", ",", "boolean", "adicionar", ",", "boolean", "editar", ",", "boolean", "eliminar", ",", "Modulo", "modulo", ")", "{", "this", ".", "Acceso", "=", "acceso", ";", "this", ".", "Adicionar", "=", "adicionar", ";", "this", ".", "Editar", "=", "editar", ";", "this", ".", "Eliminar", "=", "eliminar", ";", "this", ".", "modulo", "=", "modulo", ";", "}", "public", "boolean", "isAcceso", "(", ")", "{", "return", "Acceso", ";", "}", "public", "void", "setAcceso", "(", "boolean", "acceso", ")", "{", "Acceso", "=", "acceso", ";", "}", "public", "boolean", "isAdicionar", "(", ")", "{", "return", "Adicionar", ";", "}", "public", "void", "setAdicionar", "(", "boolean", "adicionar", ")", "{", "Adicionar", "=", "adicionar", ";", "}", "public", "boolean", "isEditar", "(", ")", "{", "return", "Editar", ";", "}", "public", "void", "setEditar", "(", "boolean", "editar", ")", "{", "Editar", "=", "editar", ";", "}", "public", "boolean", "isEliminar", "(", ")", "{", "return", "Eliminar", ";", "}", "public", "void", "setEliminar", "(", "boolean", "eliminar", ")", "{", "Eliminar", "=", "eliminar", ";", "}", "public", "Modulo", "getModulo", "(", ")", "{", "return", "modulo", ";", "}", "public", "void", "setModulo", "(", "Modulo", "modulo", ")", "{", "this", ".", "modulo", "=", "modulo", ";", "}", "}", "</s>" ]
10,432
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "data", ";", "import", "java", ".", "lang", ".", "annotation", ".", "Documented", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "public", "class", "Usuario", "{", "private", "String", "dni", ";", "private", "String", "nombre", ";", "private", "String", "apellidoPaterno", ";", "private", "String", "apellidoMaterno", ";", "private", "String", "usuario", ";", "private", "String", "password", ";", "private", "String", "correo", ";", "private", "String", "f_ingreso", ";", "private", "String", "cargo", ";", "private", "String", "status", ";", "private", "int", "num_intentos", ";", "public", "int", "getNum_intentos", "(", ")", "{", "return", "num_intentos", ";", "}", "public", "void", "intentoFallido", "(", ")", "{", "setNum_intentos", "(", "getNum_intentos", "(", ")", "+", "1", ")", ";", "}", "public", "void", "setNum_intentos", "(", "int", "num_intentos", ")", "{", "this", ".", "num_intentos", "=", "num_intentos", ";", "}", "public", "String", "getStatus", "(", ")", "{", "return", "status", ";", "}", "public", "boolean", "isActive", "(", ")", "{", "if", "(", "this", ".", "getStatus", "(", ")", ".", "equalsIgnoreCase", "(", "\"A\"", ")", ")", "{", "return", "true", ";", "}", "return", "false", ";", "}", "public", "void", "setStatus", "(", "String", "status", ")", "{", "this", ".", "status", "=", "status", ";", "}", "private", "ArrayList", "<", "Rol", ">", "roles", "=", "new", "ArrayList", "<", "Rol", ">", "(", ")", ";", "public", "ArrayList", "<", "Rol", ">", "getRoles", "(", ")", "{", "return", "roles", ";", "}", "public", "void", "setRoles", "(", "ArrayList", "<", "Rol", ">", "roles", ")", "{", "this", ".", "roles", "=", "roles", ";", "}", "public", "Usuario", "(", "String", "dni", ",", "String", "nombre", ",", "String", "apellidoPaterno", ",", "String", "apellidoMaterno", ",", "String", "usuario", ",", "String", "password", ",", "String", "correo", ",", "String", "f_ingreso", ",", "String", "cargo", ",", "Rol", "rol_actual", ")", "{", "this", ".", "dni", "=", "dni", ";", "this", ".", "nombre", "=", "nombre", ";", "this", ".", "apellidoPaterno", "=", "apellidoPaterno", ";", "this", ".", "apellidoMaterno", "=", "apellidoMaterno", ";", "this", ".", "usuario", "=", "usuario", ";", "this", ".", "password", "=", "password", ";", "this", ".", "correo", "=", "correo", ";", "this", ".", "f_ingreso", "=", "f_ingreso", ";", "this", ".", "cargo", "=", "cargo", ";", "}", "public", "Usuario", "(", ")", "{", "}", "public", "String", "getDni", "(", ")", "{", "return", "dni", ";", "}", "public", "void", "setDni", "(", "String", "dni", ")", "{", "this", ".", "dni", "=", "dni", ";", "}", "public", "String", "getNombre", "(", ")", "{", "return", "nombre", ";", "}", "public", "void", "setNombre", "(", "String", "nombre", ")", "{", "this", ".", "nombre", "=", "nombre", ";", "}", "public", "String", "getApellidoPaterno", "(", ")", "{", "return", "apellidoPaterno", ";", "}", "public", "void", "setApellidoPaterno", "(", "String", "apellidoPaterno", ")", "{", "this", ".", "apellidoPaterno", "=", "apellidoPaterno", ";", "}", "public", "String", "getApellidoMaterno", "(", ")", "{", "return", "apellidoMaterno", ";", "}", "public", "void", "setApellidoMaterno", "(", "String", "apellidoMaterno", ")", "{", "this", ".", "apellidoMaterno", "=", "apellidoMaterno", ";", "}", "public", "String", "getUsuario", "(", ")", "{", "return", "usuario", ";", "}", "public", "void", "setUsuario", "(", "String", "usuario", ")", "{", "this", ".", "usuario", "=", "usuario", ";", "}", "public", "String", "getPassword", "(", ")", "{", "return", "password", ";", "}", "public", "void", "setPassword", "(", "String", "password", ")", "{", "this", ".", "password", "=", "password", ";", "}", "public", "String", "getCorreo", "(", ")", "{", "return", "correo", ";", "}", "public", "void", "setCorreo", "(", "String", "correo", ")", "{", "this", ".", "correo", "=", "correo", ";", "}", "public", "String", "getF_ingreso", "(", ")", "{", "return", "f_ingreso", ";", "}", "public", "void", "setF_ingreso", "(", "String", "f_ingreso", ")", "{", "this", ".", "f_ingreso", "=", "f_ingreso", ";", "}", "public", "String", "getCargo", "(", ")", "{", "return", "cargo", ";", "}", "public", "void", "setCargo", "(", "String", "cargo", ")", "{", "this", ".", "cargo", "=", "cargo", ";", "}", "}", "</s>" ]
10,433
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "data", ";", "public", "class", "Modulo", "{", "private", "String", "nombre", ";", "private", "String", "Descripcion", ";", "private", "Boolean", "acceso", ";", "public", "String", "getDescripcion", "(", ")", "{", "return", "Descripcion", ";", "}", "public", "void", "setDescripcion", "(", "String", "descripcion", ")", "{", "Descripcion", "=", "descripcion", ";", "}", "public", "Modulo", "(", ")", "{", "}", "private", "Boolean", "adicionar", ";", "private", "Boolean", "editar", ";", "private", "Boolean", "eliminar", ";", "public", "Modulo", "(", "String", "nom_mod", ")", "{", "this", ".", "nombre", "=", "nom_mod", ";", "}", "public", "Modulo", "(", "String", "nombre", ",", "Boolean", "acceso", ",", "Boolean", "adicionar", ",", "Boolean", "editar", ",", "Boolean", "eliminar", ")", "{", "this", ".", "nombre", "=", "nombre", ";", "this", ".", "acceso", "=", "acceso", ";", "this", ".", "adicionar", "=", "adicionar", ";", "this", ".", "editar", "=", "editar", ";", "this", ".", "eliminar", "=", "eliminar", ";", "}", "public", "String", "getNombre", "(", ")", "{", "return", "nombre", ";", "}", "public", "void", "setNombre", "(", "String", "nombre", ")", "{", "this", ".", "nombre", "=", "nombre", ";", "}", "public", "Boolean", "getAcceso", "(", ")", "{", "return", "acceso", ";", "}", "public", "void", "setAcceso", "(", "Boolean", "acceso", ")", "{", "this", ".", "acceso", "=", "acceso", ";", "}", "public", "Boolean", "getAdicionar", "(", ")", "{", "return", "adicionar", ";", "}", "public", "void", "setAdicionar", "(", "Boolean", "adicionar", ")", "{", "this", ".", "adicionar", "=", "adicionar", ";", "}", "public", "Boolean", "getEditar", "(", ")", "{", "return", "editar", ";", "}", "public", "void", "setEditar", "(", "Boolean", "editar", ")", "{", "this", ".", "editar", "=", "editar", ";", "}", "public", "Boolean", "getEliminar", "(", ")", "{", "return", "eliminar", ";", "}", "public", "void", "setEliminar", "(", "Boolean", "eliminar", ")", "{", "this", ".", "eliminar", "=", "eliminar", ";", "}", "}", "</s>" ]
10,434
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "data", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "public", "class", "Rol", "{", "private", "String", "nombre", ";", "private", "String", "descrip", ";", "private", "ArrayList", "<", "Modulo", ">", "Modulo", "=", "new", "ArrayList", "<", "Modulo", ">", "(", ")", ";", "public", "Rol", "(", "String", "nombre", ",", "String", "descrip", ",", "ArrayList", "<", "benedictoxvi", ".", "pe", ".", "data", ".", "Modulo", ">", "modulo", ")", "{", "this", ".", "nombre", "=", "nombre", ";", "this", ".", "descrip", "=", "descrip", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "modulo", ".", "size", "(", ")", ";", "i", "++", ")", "{", "this", ".", "Modulo", ".", "add", "(", "modulo", ".", "get", "(", "i", ")", ")", ";", "}", "}", "public", "Rol", "(", ")", "{", "}", "public", "String", "getNombre", "(", ")", "{", "return", "nombre", ";", "}", "public", "void", "setNombre", "(", "String", "nombre", ")", "{", "this", ".", "nombre", "=", "nombre", ";", "}", "public", "String", "getDescrip", "(", ")", "{", "return", "descrip", ";", "}", "public", "void", "setDescrip", "(", "String", "descrip", ")", "{", "this", ".", "descrip", "=", "descrip", ";", "}", "public", "ArrayList", "<", "Modulo", ">", "getModulo", "(", ")", "{", "return", "Modulo", ";", "}", "public", "void", "setModulo", "(", "ArrayList", "<", "Modulo", ">", "modulo", ")", "{", "this", ".", "Modulo", "=", "modulo", ";", "}", "}", "</s>" ]
10,435
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "data", ";", "public", "class", "Compra", "extends", "Movimiento", "{", "public", "boolean", "isAnulada", "(", ")", "{", "if", "(", "getEstado", "(", ")", ".", "equals", "(", "\"ANULADA\"", ")", ")", "return", "true", ";", "return", "false", ";", "}", "public", "boolean", "isNueva", "(", ")", "{", "if", "(", "getEstado", "(", ")", ".", "equals", "(", "\"NUEVA\"", ")", ")", "return", "true", ";", "return", "false", ";", "}", "public", "boolean", "isCancelada", "(", ")", "{", "if", "(", "getEstado", "(", ")", ".", "equals", "(", "\"CANCELADA\"", ")", ")", "return", "true", ";", "return", "false", ";", "}", "public", "void", "pagar", "(", ")", "{", "setEstado", "(", "\"CANCELADA\"", ")", ";", "}", "public", "void", "anular", "(", ")", "{", "setEstado", "(", "\"ANULADA\"", ")", ";", "}", "}", "</s>" ]
10,436
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "data", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "public", "class", "GrupoEstudio", "{", "String", "CodGrupo", ";", "String", "NomGrupo", ";", "String", "Descripcion", ";", "String", "NomAcademia", ";", "String", "NomCurso", ";", "String", "FecInicio", ";", "String", "FecFin", ";", "public", "String", "getCodGrupo", "(", ")", "{", "return", "CodGrupo", ";", "}", "public", "int", "getNumAlumnos", "(", ")", "{", "return", "getInscritos", "(", ")", ".", "size", "(", ")", ";", "}", "public", "void", "setCodGrupo", "(", "String", "codGrupo", ")", "{", "CodGrupo", "=", "codGrupo", ";", "}", "String", "Estado", ";", "String", "[", "]", "Instructor", ";", "String", "LinkSylabus", ";", "String", "Local", ";", "int", "Aula", ";", "Double", "CLatitud", ";", "Double", "CAltitud", ";", "int", "Vacantes", ";", "int", "Aforo", ";", "ArrayList", "<", "Cliente", ">", "Inscritos", "=", "new", "ArrayList", "<", "Cliente", ">", "(", ")", ";", "public", "boolean", "existsCliente", "(", "String", "cod_cliente", ")", "{", "for", "(", "Cliente", "cli", ":", "getInscritos", "(", ")", ")", "{", "if", "(", "cli", ".", "getCodCliente", "(", ")", ".", "equals", "(", "cod_cliente", ")", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}", "public", "int", "getVacantes", "(", ")", "{", "return", "Vacantes", ";", "}", "public", "void", "setVacantes", "(", "int", "vacantes", ")", "{", "Vacantes", "=", "vacantes", ";", "}", "public", "int", "getAforo", "(", ")", "{", "return", "Aforo", ";", "}", "public", "void", "setAforo", "(", "int", "aforo", ")", "{", "Aforo", "=", "aforo", ";", "}", "public", "String", "getInstructorStr", "(", ")", "{", "String", "list", "=", "\"\"", ";", "for", "(", "String", "ins", ":", "getInstructor", "(", ")", ")", "{", "list", "=", "ins", "+", "\"/\"", ";", "}", "return", "list", ";", "}", "public", "String", "[", "]", "getInstructor", "(", ")", "{", "return", "Instructor", ";", "}", "public", "void", "setInstructor", "(", "String", "[", "]", "instructor", ")", "{", "Instructor", "=", "instructor", ";", "}", "public", "String", "getLinkSylabus", "(", ")", "{", "return", "LinkSylabus", ";", "}", "public", "void", "setLinkSylabus", "(", "String", "linkSylabus", ")", "{", "LinkSylabus", "=", "linkSylabus", ";", "}", "public", "String", "getLocal", "(", ")", "{", "return", "Local", ";", "}", "public", "void", "setLocal", "(", "String", "local", ")", "{", "Local", "=", "local", ";", "}", "public", "int", "getAula", "(", ")", "{", "return", "Aula", ";", "}", "public", "void", "setAula", "(", "int", "aula", ")", "{", "Aula", "=", "aula", ";", "}", "public", "Double", "getCLatitud", "(", ")", "{", "return", "CLatitud", ";", "}", "public", "void", "setCLatitud", "(", "Double", "cLatitud", ")", "{", "CLatitud", "=", "cLatitud", ";", "}", "public", "Double", "getCAltitud", "(", ")", "{", "return", "CAltitud", ";", "}", "public", "void", "setCAltitud", "(", "Double", "cAltitud", ")", "{", "CAltitud", "=", "cAltitud", ";", "}", "public", "String", "getNomGrupo", "(", ")", "{", "return", "NomGrupo", ";", "}", "public", "void", "setNomGrupo", "(", "String", "nomGrupo", ")", "{", "NomGrupo", "=", "nomGrupo", ";", "}", "public", "String", "getNomAcademia", "(", ")", "{", "return", "NomAcademia", ";", "}", "public", "void", "setNomAcademia", "(", "String", "nomAcademia", ")", "{", "NomAcademia", "=", "nomAcademia", ";", "}", "public", "String", "getNomCurso", "(", ")", "{", "return", "NomCurso", ";", "}", "public", "void", "setNomCurso", "(", "String", "nomCurso", ")", "{", "NomCurso", "=", "nomCurso", ";", "}", "public", "String", "getFecInicio", "(", ")", "{", "return", "FecInicio", ";", "}", "public", "void", "setFecInicio", "(", "String", "fecInicio", ")", "{", "FecInicio", "=", "fecInicio", ";", "}", "public", "String", "getFecFin", "(", ")", "{", "return", "FecFin", ";", "}", "public", "void", "setFecFin", "(", "String", "fecFin", ")", "{", "FecFin", "=", "fecFin", ";", "}", "public", "String", "getEstado", "(", ")", "{", "return", "Estado", ";", "}", "public", "void", "setEstado", "(", "String", "estado", ")", "{", "Estado", "=", "estado", ";", "}", "public", "String", "getDescripcion", "(", ")", "{", "return", "Descripcion", ";", "}", "public", "void", "setDescripcion", "(", "String", "descripcion", ")", "{", "Descripcion", "=", "descripcion", ";", "}", "public", "ArrayList", "<", "Cliente", ">", "getInscritos", "(", ")", "{", "return", "Inscritos", ";", "}", "public", "void", "setInscritos", "(", "ArrayList", "<", "Cliente", ">", "inscritos", ")", "{", "Inscritos", "=", "inscritos", ";", "}", "}", "</s>" ]
10,437
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "business", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Usuario", ";", "import", "benedictoxvi", ".", "pe", ".", "datatest", ".", "DataBD", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "ProcessException", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "Validaciones", ";", "public", "class", "AdmLoginUsuario", "{", "ArrayList", "<", "Usuario", ">", "arrUsr", "=", "new", "ArrayList", "<", "Usuario", ">", "(", ")", ";", "DataBD", "bd", "=", "new", "DataBD", "(", ")", ";", "Validaciones", "objVal", "=", "new", "Validaciones", "(", ")", ";", "public", "AdmLoginUsuario", "(", ")", "{", "arrUsr", "=", "bd", ".", "getDataUsuarios", "(", ")", ";", "}", "public", "Usuario", "getUserByName", "(", "String", "nom_usr", ")", "{", "Usuario", "usr_end", "=", "null", ";", "for", "(", "Usuario", "usr", ":", "arrUsr", ")", "{", "if", "(", "usr", ".", "getUsuario", "(", ")", ".", "equals", "(", "nom_usr", ")", ")", "{", "usr_end", "=", "usr", ";", "break", ";", "}", "}", "if", "(", "usr_end", "==", "null", ")", "{", "new", "ProcessException", "(", "\"El", "Usuario", "'\"", "+", "nom_usr", "+", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "}", "return", "usr_end", ";", "}", "public", "boolean", "loginUsuario", "(", "String", "usuario", ",", "String", "clave", ")", "{", "String", "msg_err", "=", "null", ";", "if", "(", "!", "objVal", ".", "isSet", "(", "usuario", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "clave", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "if", "(", "objVal", ".", "isSet", "(", "msg_err", ")", ")", "{", "new", "ProcessException", "(", "msg_err", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "Usuario", "usr", "=", "getUserByName", "(", "usuario", ")", ";", "if", "(", "usr", "!=", "null", ")", "{", "if", "(", "!", "usr", ".", "isActive", "(", ")", ")", "{", "new", "ProcessException", "(", "\"El", "[\"", "+", "usuario", "+", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "if", "(", "usr", ".", "getPassword", "(", ")", ".", "equals", "(", "clave", ")", ")", "{", "usr", ".", "setNum_intentos", "(", "0", ")", ";", "objVal", ".", "messageOk", "(", "\"\"", "+", "usuario", "+", "\"\"", ")", ";", "return", "true", ";", "}", "else", "{", "usr", ".", "intentoFallido", "(", ")", ";", "if", "(", "usr", ".", "getNum_intentos", "(", ")", "==", "5", ")", "{", "usr", ".", "setStatus", "(", "\"B\"", ")", ";", "new", "ProcessException", "(", "\"\"", "+", "usuario", "+", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "new", "ProcessException", "(", "\"\"", "+", "usuario", "+", "\"].\"", ")", ".", "printStackTrace", "(", ")", ";", "}", "}", "return", "false", ";", "}", "}", "</s>" ]
10,438
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "business", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "Comparator", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Modulo", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Rol", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Usuario", ";", "import", "benedictoxvi", ".", "pe", ".", "datatest", ".", "DataBD", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "ProcessException", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "Validaciones", ";", "public", "class", "AdmAccesosUser", "{", "ArrayList", "<", "Usuario", ">", "arrUsr", "=", "new", "ArrayList", "<", "Usuario", ">", "(", ")", ";", "Validaciones", "objVal", "=", "new", "Validaciones", "(", ")", ";", "DataBD", "myBD", "=", "new", "DataBD", "(", ")", ";", "public", "AdmAccesosUser", "(", ")", "{", "arrUsr", "=", "myBD", ".", "getDataUsuarios", "(", ")", ";", "}", "public", "Modulo", "getModuloInUser", "(", "String", "nom_user", ",", "String", "nom_modulo", ")", "{", "Modulo", "mod_usr", "=", "new", "Modulo", "(", "\"NONE\"", ",", "false", ",", "false", ",", "false", ",", "false", ")", ";", "boolean", "find", "=", "false", ";", "boolean", "find_usr", "=", "false", ";", "int", "index", "=", "0", ";", "for", "(", "Usuario", "usr", ":", "myBD", ".", "getDataUsuarios", "(", ")", ")", "{", "if", "(", "usr", ".", "getUsuario", "(", ")", ".", "equalsIgnoreCase", "(", "nom_user", ")", ")", "{", "find_usr", "=", "true", ";", "for", "(", "Rol", "user_rol", ":", "usr", ".", "getRoles", "(", ")", ")", "{", "for", "(", "Modulo", "mod", ":", "user_rol", ".", "getModulo", "(", ")", ")", "{", "if", "(", "mod", ".", "getNombre", "(", ")", ".", "equalsIgnoreCase", "(", "nom_modulo", ")", ")", "{", "objVal", ".", "messageOk", "(", "\"\"", "+", "nom_modulo", "+", "\"\"", "+", "nom_user", "+", "\"'\"", ")", ";", "return", "mod", ";", "}", "}", "}", "return", "null", ";", "}", "}", "if", "(", "find_usr", "==", "false", ")", "{", "new", "ProcessException", "(", "\"El", "Usuario", "'\"", "+", "nom_user", "+", "\"'", "no", "existe.\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "null", ";", "}", "else", "if", "(", "find", "==", "false", ")", "{", "new", "ProcessException", "(", "\"\"", "+", "nom_modulo", "+", "\"\"", "+", "nom_user", "+", "\"'.\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "null", ";", "}", "return", "null", ";", "}", "public", "Usuario", "getUserByName", "(", "String", "nom_usr", ")", "{", "Usuario", "usr_end", "=", "null", ";", "for", "(", "Usuario", "usr", ":", "arrUsr", ")", "{", "if", "(", "usr", ".", "getUsuario", "(", ")", ".", "equals", "(", "nom_usr", ")", ")", "{", "usr_end", "=", "usr", ";", "break", ";", "}", "}", "if", "(", "usr_end", "==", "null", ")", "{", "new", "ProcessException", "(", "\"El", "Usuario", "'\"", "+", "nom_usr", "+", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "}", "return", "usr_end", ";", "}", "public", "ArrayList", "<", "Rol", ">", "rolesByUser", "(", "String", "nom_user", ")", "{", "Usuario", "usr", "=", "getUserByName", "(", "nom_user", ")", ";", "if", "(", "usr", "==", "null", ")", "{", "return", "null", ";", "}", "return", "usr", ".", "getRoles", "(", ")", ";", "}", "public", "ArrayList", "<", "Modulo", ">", "modulosByRol", "(", "String", "nom_rol", ")", "{", "return", "new", "AdmRoles", "(", ")", ".", "findRol", "(", "nom_rol", ")", ".", "getModulo", "(", ")", ";", "}", "public", "boolean", "addRolUser", "(", "String", "nom_user", ",", "String", "nom_rol", ")", "{", "Usuario", "usr_rol", "=", "getUserByName", "(", "nom_user", ")", ";", "if", "(", "usr_rol", "!=", "null", ")", "{", "for", "(", "Rol", "xrol", ":", "usr_rol", ".", "getRoles", "(", ")", ")", "{", "if", "(", "xrol", ".", "getNombre", "(", ")", ".", "equals", "(", "nom_rol", ")", ")", "{", "new", "ProcessException", "(", "\"El", "Usuario", "'\"", "+", "nom_user", "+", "\"\"", "+", "nom_rol", "+", "\"'\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "}", "Rol", "new_rol", "=", "new", "AdmRoles", "(", ")", ".", "findRol", "(", "nom_rol", ")", ";", "if", "(", "new_rol", "!=", "null", ")", "{", "usr_rol", ".", "getRoles", "(", ")", ".", "add", "(", "new_rol", ")", ";", "objVal", ".", "messageOk", "(", "\"\"", "+", "nom_rol", "+", "\"\"", "+", "nom_user", "+", "\"].\"", ")", ";", "return", "true", ";", "}", "}", "return", "false", ";", "}", "public", "boolean", "removeRolUser", "(", "String", "nom_usr", ",", "String", "nom_rol", ")", "{", "Usuario", "usr", "=", "getUserByName", "(", "nom_usr", ")", ";", "if", "(", "usr", "!=", "null", ")", "{", "for", "(", "Rol", "xrol", ":", "usr", ".", "getRoles", "(", ")", ")", "{", "if", "(", "xrol", ".", "getNombre", "(", ")", ".", "equals", "(", "nom_rol", ")", ")", "{", "usr", ".", "getRoles", "(", ")", ".", "remove", "(", "xrol", ")", ";", "objVal", ".", "messageOk", "(", "\"\"", "+", "nom_usr", "+", "\"'", "del", "rol", "[\"", "+", "nom_rol", "+", "\"].\"", ")", ";", "return", "true", ";", "}", "}", "new", "ProcessException", "(", "\"El", "Usuario", "'\"", "+", "nom_usr", "+", "\"\"", "+", "nom_rol", "+", "\"'\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "return", "false", ";", "}", "public", "boolean", "requestAcceso", "(", "String", "nom_user", ",", "String", "nom_modulo", ")", "{", "Modulo", "mod_usr", "=", "getModuloInUser", "(", "nom_user", ",", "nom_modulo", ")", ";", "if", "(", "mod_usr", "!=", "null", ")", "{", "return", "mod_usr", ".", "getAcceso", "(", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "requestAdicion", "(", "String", "nom_user", ",", "String", "nom_modulo", ")", "{", "Modulo", "mod_usr", "=", "getModuloInUser", "(", "nom_user", ",", "nom_modulo", ")", ";", "if", "(", "mod_usr", "!=", "null", ")", "{", "return", "mod_usr", ".", "getAdicionar", "(", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "requestModificacion", "(", "String", "nom_user", ",", "String", "nom_modulo", ")", "{", "Modulo", "mod_usr", "=", "getModuloInUser", "(", "nom_user", ",", "nom_modulo", ")", ";", "if", "(", "mod_usr", "!=", "null", ")", "{", "return", "mod_usr", ".", "getEditar", "(", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "requestEliminacion", "(", "String", "nom_user", ",", "String", "nom_modulo", ")", "{", "Modulo", "mod_usr", "=", "getModuloInUser", "(", "nom_user", ",", "nom_modulo", ")", ";", "if", "(", "mod_usr", "!=", "null", ")", "{", "return", "mod_usr", ".", "getEliminar", "(", ")", ";", "}", "return", "false", ";", "}", "}", "</s>" ]
10,439
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "business", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "Comparator", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Modulo", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Rol", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Usuario", ";", "import", "benedictoxvi", ".", "pe", ".", "datatest", ".", "DataBD", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "ProcessException", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "Validaciones", ";", "public", "class", "AdmRoles", "{", "ArrayList", "<", "Rol", ">", "arrRols", "=", "new", "ArrayList", "<", "Rol", ">", "(", ")", ";", "ArrayList", "<", "Usuario", ">", "arrUsr", "=", "new", "ArrayList", "<", "Usuario", ">", "(", ")", ";", "Validaciones", "objVal", "=", "new", "Validaciones", "(", ")", ";", "ArrayList", "<", "Modulo", ">", "arrMods", "=", "new", "ArrayList", "<", "Modulo", ">", "(", ")", ";", "DataBD", "bd", "=", "new", "DataBD", "(", ")", ";", "public", "Modulo", "getNewModulo", "(", "String", "cod_mod", ",", "boolean", "acceso", ",", "boolean", "adicion", ",", "boolean", "actualiza", ",", "boolean", "suprimir", ")", "{", "if", "(", "findModuloByIdent", "(", "cod_mod", ")", "!=", "null", ")", "{", "return", "new", "Modulo", "(", "cod_mod", ",", "acceso", ",", "adicion", ",", "actualiza", ",", "suprimir", ")", ";", "}", "new", "ProcessException", "(", "\"\"", "+", "cod_mod", "+", "\"'.\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "null", ";", "}", "public", "Modulo", "findModuloByIdent", "(", "String", "cod_mod", ")", "{", "Modulo", "new_mod", "=", "null", ";", "try", "{", "new_mod", "=", "arrMods", ".", "get", "(", "Collections", ".", "binarySearch", "(", "arrMods", ",", "new", "Modulo", "(", "cod_mod", ")", ",", "new", "Comparator", "<", "Modulo", ">", "(", ")", "{", "@", "Override", "public", "int", "compare", "(", "Modulo", "o1", ",", "Modulo", "o2", ")", "{", "return", "o1", ".", "getNombre", "(", ")", ".", "compareTo", "(", "o2", ".", "getNombre", "(", ")", ")", ";", "}", "}", ")", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "new_mod", "=", "null", ";", "}", "return", "new_mod", ";", "}", "public", "AdmRoles", "(", ")", "{", "arrMods", "=", "bd", ".", "getDataModulos", "(", ")", ";", "arrRols", "=", "bd", ".", "getDataRoles", "(", ")", ";", "arrUsr", "=", "bd", ".", "getDataUsuarios", "(", ")", ";", "}", "public", "ArrayList", "<", "Rol", ">", "getRoles", "(", ")", "{", "return", "arrRols", ";", "}", "public", "boolean", "validaNombreRol", "(", "Rol", "unRol", ")", "{", "boolean", "Ok", "=", "true", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "unRol", ".", "getModulo", "(", ")", ".", "size", "(", ")", ";", "i", "++", ")", "{", "if", "(", "unRol", ".", "getModulo", "(", ")", ".", "get", "(", "i", ")", ".", "getNombre", "(", ")", "==", "null", "||", "unRol", ".", "getModulo", "(", ")", ".", "get", "(", "i", ")", ".", "getNombre", "(", ")", ".", "equals", "(", "\"\"", ")", ")", "{", "Ok", "=", "false", ";", "}", "}", "return", "Ok", ";", "}", "public", "boolean", "validaEstadoRol", "(", "Rol", "unRol", ")", "{", "boolean", "Ok", "=", "true", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "unRol", ".", "getModulo", "(", ")", ".", "size", "(", ")", ";", "i", "++", ")", "{", "if", "(", "unRol", ".", "getModulo", "(", ")", ".", "get", "(", "i", ")", ".", "getAcceso", "(", ")", "==", "null", ")", "{", "Ok", "=", "false", ";", "}", "else", "if", "(", "unRol", ".", "getModulo", "(", ")", ".", "get", "(", "i", ")", ".", "getAdicionar", "(", ")", "==", "null", ")", "{", "Ok", "=", "false", ";", "}", "else", "if", "(", "unRol", ".", "getModulo", "(", ")", ".", "get", "(", "i", ")", ".", "getEditar", "(", ")", "==", "null", ")", "{", "Ok", "=", "false", ";", "}", "else", "if", "(", "unRol", ".", "getModulo", "(", ")", ".", "get", "(", "i", ")", ".", "getEliminar", "(", ")", "==", "null", ")", "{", "Ok", "=", "false", ";", "}", "}", "return", "Ok", ";", "}", "public", "boolean", "validaDescripcionRol", "(", "Rol", "unRol", ")", "{", "boolean", "Ok", "=", "true", ";", "if", "(", "unRol", ".", "getDescrip", "(", ")", "==", "null", "||", "unRol", ".", "getDescrip", "(", ")", ".", "equals", "(", "\"\"", ")", ")", "{", "Ok", "=", "false", ";", "}", "return", "Ok", ";", "}", "public", "boolean", "buscaRol", "(", "String", "rol", ")", "{", "boolean", "encuentra", "=", "false", ";", "for", "(", "int", "x", "=", "0", ";", "x", "<", "arrRols", ".", "size", "(", ")", ";", "x", "++", ")", "{", "if", "(", "arrRols", ".", "get", "(", "x", ")", ".", "getNombre", "(", ")", ".", "equals", "(", "rol", ")", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "arrRols", ".", "get", "(", "x", ")", ".", "getNombre", "(", ")", "+", "\"", "\"", "+", "arrRols", ".", "get", "(", "x", ")", ".", "getDescrip", "(", ")", ")", ";", "encuentra", "=", "true", ";", "break", ";", "}", "}", "return", "encuentra", ";", "}", "public", "Rol", "findRol", "(", "String", "nom_rol", ")", "{", "for", "(", "Rol", "xrol", ":", "arrRols", ")", "{", "if", "(", "xrol", ".", "getNombre", "(", ")", ".", "equals", "(", "nom_rol", ")", ")", "{", "return", "xrol", ";", "}", "}", "new", "ProcessException", "(", "\"El", "Rol", "'\"", "+", "nom_rol", "+", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "null", ";", "}", "public", "void", "eliminaRol", "(", "String", "rol", ")", "{", "boolean", "encontrado", "=", "false", ";", "for", "(", "int", "x", "=", "0", ";", "x", "<", "arrRols", ".", "size", "(", ")", ";", "x", "++", ")", "{", "if", "(", "arrRols", ".", "get", "(", "x", ")", ".", "getNombre", "(", ")", ".", "equals", "(", "rol", ")", ")", "{", "encontrado", "=", "true", ";", "System", ".", "out", ".", "println", "(", "\"\"", "+", "arrRols", ".", "get", "(", "x", ")", ".", "getNombre", "(", ")", "+", "\"", "\"", "+", "arrRols", ".", "get", "(", "x", ")", ".", "getDescrip", "(", ")", ")", ";", "arrRols", ".", "remove", "(", "x", ")", ";", "break", ";", "}", "}", "if", "(", "encontrado", "==", "false", ")", "{", "System", ".", "out", ".", "println", "(", "\"Rol", "\"", "+", "rol", "+", "\"\"", ")", ";", "}", "}", "public", "boolean", "registrarRol", "(", "String", "cod_rol", ",", "String", "nom_rol", ",", "ArrayList", "<", "Modulo", ">", "mods", ")", "{", "Rol", "new_rol", "=", "new", "Rol", "(", ")", ";", "String", "msg_err", "=", "null", ";", "if", "(", "!", "objVal", ".", "isSet", "(", "cod_rol", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "cod_rol", ".", "trim", "(", ")", ".", "length", "(", ")", "<", "6", ")", "{", "msg_err", "=", "\"\"", "+", "cod_rol", "+", "\"]\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "nom_rol", ")", ")", "{", "msg_err", "=", "\"\"", "+", "cod_rol", "+", "\"'\"", ";", "}", "else", "if", "(", "mods", "!=", "null", ")", "{", "for", "(", "Modulo", "mod", ":", "mods", ")", "{", "if", "(", "findModuloByIdent", "(", "mod", ".", "getNombre", "(", ")", ")", "==", "null", ")", "{", "msg_err", "=", "(", "\"El", "Modulo", "'\"", "+", "mod", ".", "getNombre", "(", ")", "+", "\"\"", ")", ";", "break", ";", "}", "}", "}", "if", "(", "mods", "==", "null", ")", "{", "mods", "=", "new", "ArrayList", "<", "Modulo", ">", "(", ")", ";", "}", "if", "(", "objVal", ".", "isSet", "(", "msg_err", ")", ")", "{", "new", "ProcessException", "(", "msg_err", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "new_rol", ".", "setNombre", "(", "cod_rol", ")", ";", "new_rol", ".", "setDescrip", "(", "nom_rol", ")", ";", "new_rol", ".", "setModulo", "(", "mods", ")", ";", "arrRols", ".", "add", "(", "new_rol", ")", ";", "objVal", ".", "messageOk", "(", "\"\"", "+", "cod_rol", "+", "\"]", "[\"", "+", "nom_rol", "+", "\"].\"", ")", ";", "if", "(", "new_rol", ".", "getModulo", "(", ")", ".", "size", "(", ")", "==", "0", ")", "{", "objVal", ".", "messageWar", "(", "\"\"", ")", ";", "}", "return", "true", ";", "}", "public", "boolean", "suprimirRol", "(", "String", "cod_rol", ")", "{", "Rol", "del_rol", "=", "findRol", "(", "cod_rol", ")", ";", "if", "(", "del_rol", "!=", "null", ")", "{", "for", "(", "Usuario", "usr", ":", "arrUsr", ")", "{", "for", "(", "Rol", "rol_usr", ":", "usr", ".", "getRoles", "(", ")", ")", "{", "if", "(", "rol_usr", ".", "getNombre", "(", ")", ".", "equals", "(", "cod_rol", ")", ")", "{", "new", "ProcessException", "(", "\"\"", "+", "usr", ".", "getUsuario", "(", ")", "+", "\").\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "}", "}", "arrRols", ".", "remove", "(", "del_rol", ")", ";", "objVal", ".", "messageOk", "(", "\"\"", "+", "cod_rol", "+", "\"].\"", ")", ";", "return", "true", ";", "}", "return", "false", ";", "}", "public", "boolean", "modificarRol", "(", "String", "cod_rol", ",", "String", "nom_rol", ",", "ArrayList", "<", "Modulo", ">", "mods", ")", "{", "Rol", "mod_rol", "=", "findRol", "(", "cod_rol", ")", ";", "String", "msg_err", "=", "\"\"", ";", "if", "(", "nom_rol", "!=", "null", "&&", "!", "objVal", ".", "isSet", "(", "nom_rol", ")", ")", "{", "msg_err", "=", "\"\"", "+", "cod_rol", "+", "\"'\"", ";", "}", "if", "(", "objVal", ".", "isSet", "(", "msg_err", ")", ")", "{", "new", "ProcessException", "(", "msg_err", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "if", "(", "mods", "==", "null", ")", "{", "mods", "=", "new", "ArrayList", "<", "Modulo", ">", "(", ")", ";", "}", "mod_rol", ".", "setDescrip", "(", "nom_rol", ")", ";", "mod_rol", ".", "setModulo", "(", "mods", ")", ";", "objVal", ".", "messageOk", "(", "\"\"", "+", "cod_rol", "+", "\"].\"", ")", ";", "return", "true", ";", "}", "}", "</s>" ]
10,440
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "business", ";", "import", "java", ".", "text", ".", "DateFormat", ";", "import", "java", ".", "text", ".", "ParseException", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Date", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Rol", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Usuario", ";", "import", "benedictoxvi", ".", "pe", ".", "datatest", ".", "DataBD", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "ProcessException", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "Validaciones", ";", "public", "class", "AdmUsuarios", "{", "Validaciones", "objVal", "=", "new", "Validaciones", "(", ")", ";", "AdmRoles", "admRol", "=", "new", "AdmRoles", "(", ")", ";", "ArrayList", "<", "Usuario", ">", "arrUsr", "=", "new", "ArrayList", "<", "Usuario", ">", "(", ")", ";", "DataBD", "bd", "=", "new", "DataBD", "(", ")", ";", "public", "AdmUsuarios", "(", ")", "{", "arrUsr", "=", "bd", ".", "getDataUsuarios", "(", ")", ";", "}", "public", "ArrayList", "<", "Usuario", ">", "getarrUsr", "(", ")", "{", "return", "arrUsr", ";", "}", "Usuario", "objUsuarioEncontrado", ";", "public", "Usuario", "getObjUsuarioEncontrado", "(", ")", "{", "return", "objUsuarioEncontrado", ";", "}", "public", "void", "agregarUsuario", "(", "Usuario", "user", ")", "{", "arrUsr", ".", "add", "(", "user", ")", ";", "}", "public", "Usuario", "getUser_name", "(", "String", "nombre", ")", "{", "Usuario", "temp", "=", "null", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "arrUsr", ".", "size", "(", ")", ";", "i", "++", ")", "{", "if", "(", "nombre", ".", "equals", "(", "arrUsr", ".", "get", "(", "i", ")", ".", "getNombre", "(", ")", ")", ")", "temp", "=", "arrUsr", ".", "get", "(", "i", ")", ";", "break", ";", "}", "return", "temp", ";", "}", "public", "Date", "convertirFecha", "(", "String", "fecha", ")", "throws", "ParseException", "{", "DateFormat", "df", "=", "DateFormat", ".", "getDateInstance", "(", "DateFormat", ".", "MEDIUM", ")", ";", "Date", "d1", "=", "df", ".", "parse", "(", "fecha", ")", ";", "return", "d1", ";", "}", "public", "Usuario", "getUserByName", "(", "String", "usuario", ")", "{", "for", "(", "Usuario", "usr", ":", "arrUsr", ")", "{", "if", "(", "usr", ".", "getUsuario", "(", ")", ".", "equals", "(", "usuario", ")", ")", "{", "return", "usr", ";", "}", "}", "new", "ProcessException", "(", "\"El", "usuario", "'\"", "+", "usuario", "+", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "null", ";", "}", "public", "static", "void", "DatosUsuarioBuscado", "(", "String", "usuario", ",", "ArrayList", "<", "Usuario", ">", "dbArray", ")", "{", "for", "(", "int", "x", "=", "0", ";", "x", "<", "dbArray", ".", "size", "(", ")", ";", "x", "++", ")", "{", "if", "(", "dbArray", ".", "get", "(", "x", ")", ".", "getUsuario", "(", ")", ".", "equals", "(", "usuario", ")", ")", "{", "System", ".", "out", ".", "println", "(", "\"Nombre:", "\"", "+", "dbArray", ".", "get", "(", "x", ")", ".", "getNombre", "(", ")", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", "+", "dbArray", ".", "get", "(", "x", ")", ".", "getApellidoPaterno", "(", ")", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", "+", "dbArray", ".", "get", "(", "x", ")", ".", "getApellidoMaterno", "(", ")", ")", ";", "System", ".", "out", ".", "println", "(", "\"Usuario:", "\"", "+", "dbArray", ".", "get", "(", "x", ")", ".", "getUsuario", "(", ")", ")", ";", "System", ".", "out", ".", "println", "(", "\"Contrasea:", "\"", "+", "dbArray", ".", "get", "(", "x", ")", ".", "getPassword", "(", ")", ")", ";", "System", ".", "out", ".", "println", "(", "\"Correo:", "\"", "+", "dbArray", ".", "get", "(", "x", ")", ".", "getCorreo", "(", ")", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", "+", "dbArray", ".", "get", "(", "x", ")", ".", "getF_ingreso", "(", ")", ")", ";", "System", ".", "out", ".", "println", "(", "\"Cargo:", "\"", "+", "dbArray", ".", "get", "(", "x", ")", ".", "getCargo", "(", ")", ")", ";", "}", "}", "}", "public", "static", "boolean", "eliminarUsuario", "(", "String", "usuario", ",", "ArrayList", "<", "Usuario", ">", "dbArray", ")", "{", "return", "false", ";", "}", "public", "boolean", "createUsuario", "(", "String", "nom_usr", ",", "String", "pwd1", ",", "String", "pwd2", ",", "String", "nombs", ",", "String", "apat", ",", "String", "amat", ",", "String", "fing", ",", "String", "[", "]", "rols", ",", "String", "cargo", ",", "String", "dni", ")", "{", "String", "msg_err", "=", "null", ";", "if", "(", "!", "objVal", ".", "isSet", "(", "nom_usr", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "new", "String", "[", "]", "{", "pwd1", ",", "pwd2", "}", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "pwd1", ".", "equals", "(", "pwd2", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "nombs", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "apat", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "fing", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isDate", "(", "fing", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "dni", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isDNI", "(", "dni", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "if", "(", "objVal", ".", "isSet", "(", "msg_err", ")", ")", "{", "new", "ProcessException", "(", "msg_err", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "Rol", "add_rol", "=", "null", ";", "ArrayList", "<", "Rol", ">", "roles", "=", "new", "ArrayList", "<", "Rol", ">", "(", ")", ";", "for", "(", "String", "nom_rol", ":", "rols", ")", "{", "add_rol", "=", "admRol", ".", "findRol", "(", "nom_rol", ")", ";", "if", "(", "add_rol", "==", "null", ")", "{", "new", "ProcessException", "(", "\"El", "Rol", "'\"", "+", "nom_rol", "+", "\"\"", ")", ";", "return", "false", ";", "}", "roles", ".", "add", "(", "add_rol", ")", ";", "}", "Usuario", "new_usr", "=", "new", "Usuario", "(", ")", ";", "new_usr", ".", "setRoles", "(", "roles", ")", ";", "new_usr", ".", "setPassword", "(", "pwd1", ")", ";", "new_usr", ".", "setUsuario", "(", "nom_usr", ")", ";", "new_usr", ".", "setApellidoPaterno", "(", "apat", ")", ";", "new_usr", ".", "setApellidoMaterno", "(", "amat", ")", ";", "new_usr", ".", "setNombre", "(", "nombs", ")", ";", "new_usr", ".", "setF_ingreso", "(", "fing", ")", ";", "new_usr", ".", "setCargo", "(", "cargo", ")", ";", "new_usr", ".", "setDni", "(", "dni", ")", ";", "arrUsr", ".", "add", "(", "new_usr", ")", ";", "objVal", ".", "messageOk", "(", "\"\"", "+", "nom_usr", "+", "\"].\"", ")", ";", "return", "true", ";", "}", "public", "boolean", "loginUser", "(", "String", "nom_usr", ",", "String", "clave", ")", "{", "Usuario", "usr", "=", "getUserByName", "(", "nom_usr", ")", ";", "if", "(", "usr", "!=", "null", ")", "{", "if", "(", "usr", ".", "getPassword", "(", ")", ".", "equals", "(", "clave", ")", ")", "{", "if", "(", "!", "usr", ".", "isActive", "(", ")", ")", "{", "new", "ProcessException", "(", "\"El", "usuario", "'\"", "+", "nom_usr", "+", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "objVal", ".", "messageOk", "(", "\"\"", "+", "nom_usr", "+", "\"]\"", ")", ";", "return", "true", ";", "}", "else", "{", "new", "ProcessException", "(", "\"\"", "+", "nom_usr", "+", "\"'\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "}", "return", "false", ";", "}", "public", "boolean", "cambiarClaveUsuario", "(", "String", "nom_usr", ",", "String", "clave_actual", ",", "String", "newpwd1", ",", "String", "newpwd2", ")", "{", "if", "(", "loginUser", "(", "nom_usr", ",", "clave_actual", ")", ")", "{", "if", "(", "!", "objVal", ".", "isValidKey", "(", "newpwd1", ")", ")", "{", "new", "ProcessException", "(", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "if", "(", "!", "newpwd2", ".", "equals", "(", "newpwd2", ")", ")", "{", "new", "ProcessException", "(", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "objVal", ".", "messageOk", "(", "\"\"", "+", "nom_usr", "+", "\"].\"", ")", ";", "return", "true", ";", "}", "return", "false", ";", "}", "public", "boolean", "quitarUsuario", "(", "String", "nom_usr", ")", "{", "Usuario", "usr", "=", "getUserByName", "(", "nom_usr", ")", ";", "if", "(", "usr", "!=", "null", ")", "{", "arrUsr", ".", "remove", "(", "usr", ")", ";", "objVal", ".", "messageOk", "(", "\"\"", "+", "nom_usr", "+", "\"]\"", ")", ";", "return", "true", ";", "}", "return", "false", ";", "}", "public", "boolean", "modificarUsuario", "(", "String", "nom_usr", ",", "String", "nombs", ",", "String", "apat", ",", "String", "amat", ",", "String", "fing", ",", "String", "[", "]", "rols", ",", "String", "cargo", ",", "String", "dni", ")", "{", "String", "msg_err", "=", "\"\"", ";", "if", "(", "!", "objVal", ".", "isSet", "(", "nom_usr", ")", ")", "{", "new", "ProcessException", "(", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "Usuario", "upd_usr", "=", "getUserByName", "(", "nom_usr", ")", ";", "if", "(", "upd_usr", "==", "null", ")", "{", "return", "false", ";", "}", "if", "(", "nombs", "!=", "null", "&&", "!", "objVal", ".", "isSet", "(", "nombs", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "apat", "!=", "null", "&&", "!", "objVal", ".", "isSet", "(", "apat", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "fing", "!=", "null", "&&", "!", "objVal", ".", "isSet", "(", "fing", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "fing", "!=", "null", "&&", "!", "objVal", ".", "isDate", "(", "fing", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "dni", "!=", "null", "&&", "!", "objVal", ".", "isSet", "(", "dni", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "dni", "!=", "null", "&&", "!", "objVal", ".", "isDNI", "(", "dni", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "if", "(", "objVal", ".", "isSet", "(", "msg_err", ")", ")", "{", "new", "ProcessException", "(", "msg_err", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "if", "(", "rols", "!=", "null", ")", "{", "ArrayList", "<", "Rol", ">", "roles", "=", "new", "ArrayList", "<", "Rol", ">", "(", ")", ";", "for", "(", "String", "nom_rol", ":", "rols", ")", "{", "Rol", "add_rol", "=", "admRol", ".", "findRol", "(", "nom_rol", ")", ";", "if", "(", "add_rol", "==", "null", ")", "{", "new", "ProcessException", "(", "\"El", "Rol", "'\"", "+", "nom_rol", "+", "\"\"", ")", ";", "return", "false", ";", "}", "roles", ".", "add", "(", "add_rol", ")", ";", "}", "upd_usr", ".", "setRoles", "(", "roles", ")", ";", "}", "upd_usr", ".", "setNombre", "(", "nombs", ")", ";", "upd_usr", ".", "setApellidoMaterno", "(", "amat", ")", ";", "upd_usr", ".", "setApellidoPaterno", "(", "apat", ")", ";", "upd_usr", ".", "setDni", "(", "dni", ")", ";", "if", "(", "cargo", "!=", "null", ")", "{", "upd_usr", ".", "setCargo", "(", "cargo", ")", ";", "}", "upd_usr", ".", "setF_ingreso", "(", "fing", ")", ";", "objVal", ".", "messageOk", "(", "\"\"", "+", "nom_usr", "+", "\"]\"", ")", ";", "return", "true", ";", "}", "public", "boolean", "bloquearUsuario", "(", "String", "nom_usr", ")", "{", "Usuario", "usr", "=", "getUserByName", "(", "nom_usr", ")", ";", "if", "(", "!", "(", "usr", "==", "null", ")", ")", "{", "if", "(", "usr", ".", "getStatus", "(", ")", "==", "\"X\"", ")", "{", "objVal", ".", "messageOk", "(", "\"\"", ")", ";", "}", "usr", ".", "setStatus", "(", "\"X\"", ")", ";", "objVal", ".", "messageOk", "(", "\"\"", "+", "nom_usr", "+", "\"]\"", ")", ";", "return", "true", ";", "}", "return", "false", ";", "}", "public", "boolean", "desbloquearUsuario", "(", "String", "nom_usr", ")", "{", "Usuario", "usr", "=", "getUserByName", "(", "nom_usr", ")", ";", "if", "(", "!", "(", "usr", "==", "null", ")", ")", "{", "if", "(", "usr", ".", "getStatus", "(", ")", "==", "\"X\"", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "}", "usr", ".", "setStatus", "(", "\"A\"", ")", ";", "objVal", ".", "messageOk", "(", "\"\"", "+", "nom_usr", "+", "\"]\"", ")", ";", "return", "true", ";", "}", "return", "false", ";", "}", "}", "</s>" ]
10,441
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "business", ";", "import", "java", ".", "text", ".", "SimpleDateFormat", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Collection", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "Date", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "List", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Cliente", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Venta", ";", "import", "benedictoxvi", ".", "pe", ".", "datatest", ".", "DataBD", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "FormatException", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "ProcessException", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "Validaciones", ";", "public", "class", "AdmVenta", "{", "Venta", "objVenta", "=", "new", "Venta", "(", ")", ";", "Validaciones", "objVal", "=", "new", "Validaciones", "(", ")", ";", "public", "Boolean", "registrarPagoConBoleta", "(", "List", "<", "Venta", ">", "arrVenta", ",", "int", "nroMovimiento", ",", "String", "codTipoDocumento", ",", "String", "codCurso", ",", "String", "codCliente", ",", "String", "nomCliente", ",", "String", "concepto", ",", "String", "fecEmision", ",", "Double", "subtot", ",", "Double", "monIGV", ",", "Double", "monTot", ",", "String", "moneda", ",", "String", "fecVencim", ",", "String", "estado", ",", "String", "fecPagoReal", ",", "String", "observ", ")", "{", "String", "msg_err", "=", "\"\"", ";", "if", "(", "!", "objVal", ".", "isSet", "(", "codTipoDocumento", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "codCurso", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "codCliente", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "concepto", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isDate", "(", "fecEmision", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "subtot", "<=", "0", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "monIGV", "<=", "0", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "monIGV", ">=", "subtot", "||", "monIGV", "<", "0", ")", "{", "msg_err", "=", "\"\"", "+", "subtot", ";", "}", "else", "if", "(", "monTot", "<=", "0", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "moneda", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "fecVencim", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isDate", "(", "fecVencim", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "objVal", ".", "isSet", "(", "fecPagoReal", ")", "&&", "!", "objVal", ".", "isDate", "(", "fecPagoReal", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "if", "(", "objVal", ".", "isSet", "(", "msg_err", ")", ")", "{", "new", "FormatException", "(", "msg_err", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "objVenta", ".", "setNumero", "(", "nroMovimiento", ")", ";", "objVenta", ".", "setCodTipoDocumento", "(", "codTipoDocumento", ")", ";", "objVenta", ".", "setCodCurso", "(", "codCurso", ")", ";", "objVenta", ".", "setCodCliente", "(", "codCliente", ")", ";", "objVenta", ".", "setNomCliente", "(", "nomCliente", ")", ";", "objVenta", ".", "setConcepto", "(", "concepto", ")", ";", "objVenta", ".", "setFecEmision", "(", "fecEmision", ")", ";", "objVenta", ".", "setMonSubtot", "(", "subtot", ")", ";", "objVenta", ".", "setMonIGV", "(", "monIGV", ")", ";", "objVenta", ".", "setMonTotal", "(", "monTot", ")", ";", "objVenta", ".", "setMoneda", "(", "moneda", ")", ";", "objVenta", ".", "setFecVencim", "(", "fecVencim", ")", ";", "objVenta", ".", "setEstado", "(", "estado", ")", ";", "objVenta", ".", "setFecPago", "(", "fecPagoReal", ")", ";", "objVenta", ".", "setObservacion", "(", "observ", ")", ";", "arrVenta", ".", "add", "(", "objVenta", ")", ";", "return", "true", ";", "}", "public", "Boolean", "registrarPagoConFactura", "(", "ArrayList", "<", "Venta", ">", "arrVenta", ",", "int", "nroMovimiento", ",", "String", "codTipoDocumento", ",", "String", "codCurso", ",", "String", "codCliente", ",", "String", "nomCliente", ",", "String", "nroRucCliente", ",", "String", "concepto", ",", "String", "fecEmision", ",", "Double", "subtot", ",", "Double", "monIGV", ",", "Double", "monTot", ",", "String", "moneda", ",", "String", "fecVencim", ",", "String", "estado", ",", "String", "fecPagoReal", ",", "String", "observ", ")", "{", "String", "msg_err", "=", "\"\"", ";", "if", "(", "!", "objVal", ".", "isSet", "(", "codTipoDocumento", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "codCurso", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "codCliente", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isRUC", "(", "nroRucCliente", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "concepto", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isDate", "(", "fecEmision", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "fecVencim", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isDate", "(", "fecVencim", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "subtot", "<=", "0", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "monIGV", "<=", "0", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "monIGV", ">=", "subtot", "||", "monIGV", "<", "0", ")", "{", "msg_err", "=", "\"\"", "+", "subtot", ";", "}", "else", "if", "(", "monTot", "<=", "0", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "objVal", ".", "isSet", "(", "fecPagoReal", ")", "&&", "!", "objVal", ".", "isDate", "(", "fecPagoReal", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "if", "(", "objVal", ".", "isSet", "(", "msg_err", ")", ")", "{", "new", "FormatException", "(", "msg_err", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "objVenta", ".", "setNumero", "(", "nroMovimiento", ")", ";", "objVenta", ".", "setCodTipoDocumento", "(", "codTipoDocumento", ")", ";", "objVenta", ".", "setCodCurso", "(", "codCurso", ")", ";", "objVenta", ".", "setCodCliente", "(", "codCliente", ")", ";", "objVenta", ".", "setNomCliente", "(", "nomCliente", ")", ";", "objVenta", ".", "setNroRucCliente", "(", "nroRucCliente", ")", ";", "objVenta", ".", "setConcepto", "(", "concepto", ")", ";", "objVenta", ".", "setFecEmision", "(", "fecEmision", ")", ";", "objVenta", ".", "setMonSubtot", "(", "subtot", ")", ";", "objVenta", ".", "setMonIGV", "(", "monIGV", ")", ";", "objVenta", ".", "setMonTotal", "(", "monTot", ")", ";", "objVenta", ".", "setMoneda", "(", "moneda", ")", ";", "objVenta", ".", "setFecVencim", "(", "fecVencim", ")", ";", "objVenta", ".", "setEstado", "(", "estado", ")", ";", "objVenta", ".", "setFecPago", "(", "fecPagoReal", ")", ";", "objVenta", ".", "setObservacion", "(", "observ", ")", ";", "arrVenta", ".", "add", "(", "objVenta", ")", ";", "return", "true", ";", "}", "public", "ArrayList", "<", "Venta", ">", "listarMovimientos", "(", "ArrayList", "<", "Venta", ">", "arrMovimiento", ")", "{", "Collections", ".", "sort", "(", "arrMovimiento", ",", "new", "Venta", "(", ")", ")", ";", "Iterator", "<", "Venta", ">", "iMovimientos", "=", "arrMovimiento", ".", "iterator", "(", ")", ";", "while", "(", "iMovimientos", ".", "hasNext", "(", ")", ")", "{", "System", ".", "out", ".", "println", "(", "iMovimientos", ".", "next", "(", ")", ".", "toString", "(", ")", ")", ";", "}", "return", "arrMovimiento", ";", "}", "public", "ArrayList", "<", "Venta", ">", "listarMovimientosTipoDocumento", "(", "ArrayList", "<", "Venta", ">", "arrMovimiento", ",", "String", "codTipoDocumento", ")", "{", "ArrayList", "<", "Venta", ">", "olstMovimiento", "=", "new", "ArrayList", "<", "Venta", ">", "(", ")", ";", "Iterator", "<", "Venta", ">", "iMovimientos", "=", "arrMovimiento", ".", "iterator", "(", ")", ";", "Venta", "oVenta", ";", "while", "(", "iMovimientos", ".", "hasNext", "(", ")", ")", "{", "oVenta", "=", "iMovimientos", ".", "next", "(", ")", ";", "if", "(", "oVenta", ".", "getCodTipoDocumento", "(", ")", "==", "codTipoDocumento", ")", "{", "olstMovimiento", ".", "add", "(", "oVenta", ")", ";", "System", ".", "out", ".", "println", "(", "oVenta", ".", "toString", "(", ")", ")", ";", "}", "}", "if", "(", "olstMovimiento", ".", "size", "(", ")", "==", "0", ")", "{", "System", ".", "err", ".", "println", "(", "\"\"", ")", ";", "}", "else", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "olstMovimiento", ".", "size", "(", ")", "+", "\"\"", ")", ";", "}", "return", "olstMovimiento", ";", "}", "public", "ArrayList", "<", "Venta", ">", "listarDetalleMovimiento", "(", "ArrayList", "<", "Venta", ">", "arrMovimiento", ",", "int", "nroMovimiento", ")", "{", "ArrayList", "<", "Venta", ">", "olstMovimiento", "=", "new", "ArrayList", "<", "Venta", ">", "(", ")", ";", "Iterator", "<", "Venta", ">", "iMovimientos", "=", "arrMovimiento", ".", "iterator", "(", ")", ";", "Venta", "oVenta", ";", "while", "(", "iMovimientos", ".", "hasNext", "(", ")", ")", "{", "oVenta", "=", "iMovimientos", ".", "next", "(", ")", ";", "if", "(", "oVenta", ".", "getNumero", "(", ")", "==", "nroMovimiento", ")", "{", "olstMovimiento", ".", "add", "(", "oVenta", ")", ";", "System", ".", "out", ".", "println", "(", "oVenta", ".", "toString", "(", ")", ")", ";", "}", "}", "if", "(", "olstMovimiento", ".", "size", "(", ")", "==", "0", ")", "{", "System", ".", "err", ".", "println", "(", "\"\"", ")", ";", "}", "else", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "olstMovimiento", ".", "size", "(", ")", "+", "\"\"", ")", ";", "}", "return", "olstMovimiento", ";", "}", "public", "boolean", "anularDocumento", "(", "ArrayList", "<", "Venta", ">", "arrMovimiento", ",", "int", "nroMovimiento", ")", "{", "for", "(", "Venta", "oVenta", ":", "arrMovimiento", ")", "{", "if", "(", "oVenta", ".", "getNumero", "(", ")", "==", "nroMovimiento", ")", "{", "return", "arrMovimiento", ".", "remove", "(", "oVenta", ")", ";", "}", "}", "return", "false", ";", "}", "public", "boolean", "registraPagoBoletaFactura", "(", "ArrayList", "<", "Venta", ">", "arrVenta", ",", "int", "nroMovimiento", ",", "String", "tipoComprobante", ",", "String", "nroBoleta", ",", "String", "RUC", ",", "String", "CodCliente", ",", "String", "CodCuenta", ",", "List", "<", "Venta", ">", "arrNroCuota", ",", "String", "usuarioRegistro", ")", "{", "String", "Comprobante", "=", "\"\"", ";", "String", "msg_err", "=", "\"\"", ";", "if", "(", "!", "objVal", ".", "isSet", "(", "tipoComprobante", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "CodCuenta", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "CodCliente", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "usuarioRegistro", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "if", "(", "validaciones", "(", "CodCliente", ",", "CodCuenta", ")", "!=", "true", ")", "{", "msg_err", "=", "\"\"", ";", "}", "if", "(", "tipoComprobante", ".", "equalsIgnoreCase", "(", "\"1\"", ")", ")", "{", "Comprobante", "=", "\"BOLETA\"", ";", "}", "else", "{", "Comprobante", "=", "\"FACTURA\"", ";", "}", "if", "(", "objVal", ".", "isSet", "(", "msg_err", ")", ")", "{", "new", "FormatException", "(", "msg_err", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "Venta", "objVenCronograma", "=", "new", "Venta", "(", ")", ";", "List", "<", "Venta", ">", "arrCrono", "=", "new", "ArrayList", "<", "Venta", ">", "(", ")", ";", "arrCrono", "=", "objVenCronograma", ".", "getCronogramaByCodigoCuenta", "(", "CodCuenta", ")", ";", "Venta", "oCuenta", "=", "new", "Venta", "(", ")", ";", "oCuenta", "=", "objVenCronograma", ".", "getCuentaByCodigo", "(", "CodCuenta", ")", ";", "Venta", "oCurso", "=", "new", "Venta", "(", ")", ";", "oCurso", "=", "objVenCronograma", ".", "getCursoByCodigo", "(", "oCuenta", ".", "getCodCurso", "(", ")", ")", ";", "Cliente", "objCliente", "=", "new", "Cliente", "(", ")", ";", "objCliente", "=", "getClienteByCodigo", "(", "CodCliente", ")", ";", "Date", "FechaActual", "=", "new", "Date", "(", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", "+", "nroMovimiento", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", "+", "Comprobante", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", "+", "nroBoleta", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", "+", "fechaToString", "(", "FechaActual", ")", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", "+", "objCliente", ".", "getNomCliente", "(", ")", "+", "\"", "\"", "+", "objCliente", ".", "getApePatCliente", "(", ")", "+", "\"", "\"", "+", "objCliente", ".", "getApeMatCliente", "(", ")", ")", ";", "System", ".", "out", ".", "println", "(", "\"--Items", "\"", ")", ";", "String", "fecha", "=", "\"\"", ";", "int", "n", "=", "0", ";", "Double", "MontoTotal", "=", "0.0", ";", "Double", "Mora", "=", "0.0", ";", "Double", "TotalMora", "=", "0.0", ";", "for", "(", "Venta", "oCuota", ":", "arrNroCuota", ")", "{", "for", "(", "Venta", "oCuota2", ":", "arrCrono", ")", "{", "if", "(", "oCuota2", ".", "getNroCuota", "(", ")", "==", "oCuota", ".", "getNroCuota", "(", ")", "&&", "oCuota2", ".", "getEstadoCuota", "(", ")", ".", "equals", "(", "\"P\"", ")", ")", "{", "Mora", "=", "0.0", ";", "n", "=", "n", "+", "1", ";", "long", "difDias", "=", "difDiasEntre2fechas", "(", "oCuota2", ".", "getFechaVencimientoCronograma", "(", ")", ",", "FechaActual", ")", ";", "if", "(", "difDias", ">", "0", ")", "{", "Mora", "=", "difDias", "*", "0.01", "*", "oCuota2", ".", "getMontoCronograma", "(", ")", ";", "}", "System", ".", "out", ".", "println", "(", "\"--\"", "+", "n", "+", "\".", "Cuota", "\"", "+", "oCuota2", ".", "getNroCuota", "(", ")", "+", "\"", "\"", "+", "oCurso", ".", "getNomCurso", "(", ")", "+", "\"", "-->", "\"", "+", "oCuota2", ".", "getMontoCronograma", "(", ")", "+", "\"\"", "+", "fechaToString", "(", "oCuota2", ".", "getFechaVencimientoCronograma", "(", ")", ")", "+", "\"", "Mora", ":", "\"", "+", "Mora", ")", ";", "fecha", "=", "fechaToString", "(", "oCuota2", ".", "getFechaVencimientoCronograma", "(", ")", ")", ";", "TotalMora", "=", "TotalMora", "+", "Mora", ";", "MontoTotal", "=", "MontoTotal", "+", "oCuota2", ".", "getMontoCronograma", "(", ")", ";", "}", "}", "}", "System", ".", "out", ".", "println", "(", "\"--\"", ")", ";", "Double", "Igv", "=", "0.0", ";", "if", "(", "tipoComprobante", ".", "equalsIgnoreCase", "(", "\"2\"", ")", ")", "{", "Igv", "=", "(", "0.18", ")", "*", "MontoTotal", ";", "System", ".", "out", ".", "println", "(", "\"\"", "+", "MontoTotal", ")", ";", "System", ".", "out", ".", "println", "(", "\"IGVttt:", "\"", "+", "Igv", ")", ";", "}", "Double", "ImporteTotal", "=", "(", "Igv", "+", "MontoTotal", "+", "TotalMora", ")", ";", "System", ".", "out", ".", "println", "(", "\"Totalttt:", "\"", "+", "ImporteTotal", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "objVenta", ".", "setNumero", "(", "nroMovimiento", ")", ";", "objVenta", ".", "setCodTipoDocumento", "(", "tipoComprobante", ")", ";", "objVenta", ".", "setCodCurso", "(", "oCurso", ".", "getCodCurso", "(", ")", ")", ";", "objVenta", ".", "setNomCurso", "(", "oCurso", ".", "getNomCurso", "(", ")", ")", ";", "objVenta", ".", "setCodCliente", "(", "CodCliente", ")", ";", "objVenta", ".", "setNomCliente", "(", "objCliente", ".", "getNomCliente", "(", ")", ")", ";", "objVenta", ".", "setNroRucCliente", "(", "RUC", ")", ";", "objVenta", ".", "setConcepto", "(", "oCurso", ".", "getNomCurso", "(", ")", ")", ";", "objVenta", ".", "setFecEmision", "(", "fechaToString", "(", "FechaActual", ")", ")", ";", "objVenta", ".", "setMonSubtot", "(", "MontoTotal", ")", ";", "objVenta", ".", "setMonIGV", "(", "Igv", ")", ";", "objVenta", ".", "setMonTotal", "(", "ImporteTotal", ")", ";", "objVenta", ".", "setMoneda", "(", "oCuenta", ".", "getMoneda", "(", ")", ")", ";", "objVenta", ".", "setFecVencim", "(", "fecha", ")", ";", "objVenta", ".", "setEstado", "(", "\"A\"", ")", ";", "objVenta", ".", "setFecPago", "(", "fechaToString", "(", "FechaActual", ")", ")", ";", "objVenta", ".", "setObservacion", "(", "\"Pago", "cuota\"", ")", ";", "arrVenta", ".", "add", "(", "objVenta", ")", ";", "return", "true", ";", "}", "public", "Cliente", "getClienteByCodigo", "(", "String", "CodCliente", ")", "{", "DataBD", "bd", "=", "new", "DataBD", "(", ")", ";", "List", "<", "Cliente", ">", "arrCli", "=", "new", "ArrayList", "<", "Cliente", ">", "(", ")", ";", "arrCli", "=", "bd", ".", "getDataCliente", "(", ")", ";", "for", "(", "Cliente", "cli", ":", "arrCli", ")", "{", "if", "(", "cli", ".", "getCodCliente", "(", ")", ".", "equals", "(", "CodCliente", ")", ")", "{", "return", "cli", ";", "}", "}", "new", "ProcessException", "(", "\"\"", "+", "CodCliente", "+", "\"'", "no", "existe.\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "null", ";", "}", "public", "Boolean", "validaciones", "(", "String", "CodCliente", ",", "String", "CodCuenta", ")", "{", "Boolean", "res", "=", "true", ";", "Cliente", "objCliente", "=", "new", "Cliente", "(", ")", ";", "objCliente", "=", "getClienteByCodigo", "(", "CodCliente", ")", ";", "if", "(", "objCliente", "==", "null", ")", "{", "res", "=", "false", ";", "}", "Venta", "oVenCuenta", "=", "new", "Venta", "(", ")", ";", "oVenCuenta", "=", "oVenCuenta", ".", "getCuentaByCodigo", "(", "CodCuenta", ")", ";", "if", "(", "oVenCuenta", "==", "null", ")", "{", "res", "=", "false", ";", "}", "Venta", "oVenCronograma", "=", "new", "Venta", "(", ")", ";", "List", "<", "Venta", ">", "arrCrono", "=", "new", "ArrayList", "<", "Venta", ">", "(", ")", ";", "arrCrono", "=", "oVenCronograma", ".", "getCronogramaByCodigoCuenta", "(", "CodCuenta", ")", ";", "if", "(", "arrCrono", "==", "null", ")", "{", "res", "=", "false", ";", "}", "return", "res", ";", "}", "String", "fechaToString", "(", "Date", "pFecha", ")", "{", "String", "Fecha", "=", "\"\"", ";", "SimpleDateFormat", "Forma", "=", "new", "SimpleDateFormat", "(", "\"dd/MM/yyyy\"", ")", ";", "Fecha", "=", "Forma", ".", "format", "(", "pFecha", ")", ";", "return", "Fecha", ";", "}", "public", "long", "difDiasEntre2fechas", "(", "Date", "pFecha1", ",", "Date", "pFecha2", ")", "{", "String", "Fecha1", "=", "fechaToString", "(", "pFecha1", ")", ";", "String", "Fecha2", "=", "fechaToString", "(", "pFecha2", ")", ";", "String", "[", "]", "parts", ";", "int", "val", "=", "0", ";", "parts", "=", "Fecha1", ".", "split", "(", "\"/\"", ")", ";", "if", "(", "parts", ".", "length", "==", "3", ")", "{", "val", "=", "Integer", ".", "parseInt", "(", "parts", "[", "2", "]", "+", "parts", "[", "1", "]", "+", "parts", "[", "0", "]", ")", ";", "}", "String", "[", "]", "parts2", ";", "int", "val2", "=", "0", ";", "parts2", "=", "Fecha2", ".", "split", "(", "\"/\"", ")", ";", "if", "(", "parts", ".", "length", "==", "3", ")", "{", "val", "=", "Integer", ".", "parseInt", "(", "parts2", "[", "2", "]", "+", "parts2", "[", "1", "]", "+", "parts2", "[", "0", "]", ")", ";", "}", "int", "D1", "=", "Integer", ".", "parseInt", "(", "parts", "[", "0", "]", ")", ";", "int", "M1", "=", "Integer", ".", "parseInt", "(", "parts", "[", "1", "]", ")", ";", "int", "Y1", "=", "Integer", ".", "parseInt", "(", "parts", "[", "2", "]", ")", ";", "int", "D2", "=", "Integer", ".", "parseInt", "(", "parts2", "[", "0", "]", ")", ";", "int", "M2", "=", "Integer", ".", "parseInt", "(", "parts2", "[", "1", "]", ")", ";", "int", "Y2", "=", "Integer", ".", "parseInt", "(", "parts2", "[", "2", "]", ")", ";", "java", ".", "util", ".", "GregorianCalendar", "date", "=", "new", "java", ".", "util", ".", "GregorianCalendar", "(", "Y1", ",", "M1", ",", "D1", ")", ";", "java", ".", "util", ".", "GregorianCalendar", "date2", "=", "new", "java", ".", "util", ".", "GregorianCalendar", "(", "Y2", ",", "M2", ",", "D2", ")", ";", "long", "difms", "=", "date2", ".", "getTimeInMillis", "(", ")", "-", "date", ".", "getTimeInMillis", "(", ")", ";", "long", "difd", "=", "difms", "/", "(", "1000", "*", "60", "*", "60", "*", "24", ")", ";", "return", "difd", ";", "}", "}", "</s>" ]
10,442
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "business", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "Comparator", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Compra", ";", "import", "benedictoxvi", ".", "pe", ".", "datatest", ".", "DataBD", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "CompraComparator", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "FormatException", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "ProcessException", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "Validaciones", ";", "public", "class", "AdmCompra", "{", "Validaciones", "objVal", "=", "new", "Validaciones", "(", ")", ";", "ArrayList", "<", "Compra", ">", "arrCom", ";", "DataBD", "bd", "=", "new", "DataBD", "(", ")", ";", "public", "AdmCompra", "(", ")", "{", "arrCom", "=", "bd", ".", "getDataCompras", "(", ")", ";", "}", "public", "int", "listaCompras", "(", ")", "{", "int", "i", "=", "0", ";", "i", "=", "arrCom", ".", "size", "(", ")", ";", "if", "(", "i", "==", "0", ")", "return", "i", ";", "i", "=", "0", ";", "objVal", ".", "printMsg", "(", "\"\"", ")", ";", "for", "(", "Compra", "objCom", ":", "arrCom", ")", "{", "i", "+=", "1", ";", "System", ".", "out", ".", "println", "(", "i", "+", "\".t\"", "+", "objCom", ".", "getConcepto", "(", ")", "+", "\"t\"", "+", "objCom", ".", "getNumero", "(", ")", "+", "\"t\"", "+", "objCom", ".", "getFecEmision", "(", ")", "+", "\"t\"", "+", "objCom", ".", "getNomEmpresa", "(", ")", "+", "\"t\"", "+", "objCom", ".", "getMonSubtot", "(", ")", "+", "\"t\"", "+", "objCom", ".", "getMonIGV", "(", ")", "+", "\"t\"", "+", "objCom", ".", "getMonTotal", "(", ")", "+", "\"t\"", "+", "objCom", ".", "getMoneda", "(", ")", "+", "\"t\"", "+", "objCom", ".", "getFecVencim", "(", ")", "+", "\"t\"", "+", "objCom", ".", "getEstado", "(", ")", "+", "\"t\"", "+", "objCom", ".", "getFecPago", "(", ")", "+", "\"t\"", "+", "objCom", ".", "getObservacion", "(", ")", ")", ";", "}", "System", ".", "out", ".", "println", "(", ")", ";", "return", "i", ";", "}", "public", "Compra", "getCompraByNum", "(", "int", "num", ")", "{", "for", "(", "Compra", "objCom", ":", "arrCom", ")", "{", "if", "(", "objCom", ".", "getNumero", "(", ")", "==", "num", ")", "{", "return", "objCom", ";", "}", "}", "new", "ProcessException", "(", "\"\"", "+", "num", "+", "\"", "no", "existe.\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "null", ";", "}", "public", "boolean", "findCompraByNum", "(", "int", "num", ")", "{", "return", "(", "(", "getCompraByNum", "(", "num", ")", "==", "null", ")", "?", "false", ":", "true", ")", ";", "}", "public", "boolean", "darAltaCompra", "(", "String", "concepto", ",", "int", "numero", ",", "String", "fecEmision", ",", "String", "nomEmpresa", ",", "Double", "subtot", ",", "Double", "monIGV", ",", "Double", "monTot", ",", "String", "moneda", ",", "String", "fecVencim", ",", "String", "estado", ",", "String", "fecPagoReal", ",", "String", "observ", ")", "{", "if", "(", "findCompraByNum", "(", "numero", ")", ")", "{", "new", "ProcessException", "(", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "String", "msg_err", "=", "\"\"", ";", "if", "(", "!", "objVal", ".", "isSet", "(", "concepto", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "fecEmision", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isDate", "(", "fecEmision", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "fecVencim", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isDate", "(", "fecVencim", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "objVal", ".", "isSet", "(", "fecPagoReal", ")", "&&", "!", "objVal", ".", "isDate", "(", "fecPagoReal", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "subtot", "<=", "0", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "monIGV", "<=", "0", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "monIGV", ">=", "subtot", ")", "{", "msg_err", "=", "\"\"", "+", "subtot", ";", "}", "else", "if", "(", "monTot", "<=", "0", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "objVal", ".", "isSet", "(", "new", "String", "[", "]", "{", "fecEmision", ",", "fecPagoReal", "}", ")", ")", "{", "if", "(", "objVal", ".", "dateToInt", "(", "fecEmision", ")", ">", "objVal", ".", "dateToInt", "(", "fecPagoReal", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "}", "else", "if", "(", "objVal", ".", "isSet", "(", "new", "String", "[", "]", "{", "fecEmision", ",", "fecVencim", "}", ")", ")", "{", "if", "(", "objVal", ".", "dateToInt", "(", "fecEmision", ")", ">", "objVal", ".", "dateToInt", "(", "fecVencim", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "}", "if", "(", "objVal", ".", "isSet", "(", "msg_err", ")", ")", "{", "new", "FormatException", "(", "msg_err", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "Compra", "objCom", "=", "new", "Compra", "(", ")", ";", "objCom", ".", "setConcepto", "(", "concepto", ")", ";", "objCom", ".", "setNumero", "(", "numero", ")", ";", "objCom", ".", "setFecEmision", "(", "fecEmision", ")", ";", "objCom", ".", "setNomEmpresa", "(", "nomEmpresa", ")", ";", "objCom", ".", "setEstado", "(", "estado", ")", ";", "objCom", ".", "setFecPago", "(", "fecPagoReal", ")", ";", "objCom", ".", "setFecVencim", "(", "fecVencim", ")", ";", "objCom", ".", "setMonSubtot", "(", "subtot", ")", ";", "objCom", ".", "setMonIGV", "(", "monIGV", ")", ";", "objCom", ".", "setMonTotal", "(", "monTot", ")", ";", "objCom", ".", "setObservacion", "(", "observ", ")", ";", "objVal", ".", "messageOk", "(", "\"\"", "+", "numero", ")", ";", "arrCom", ".", "add", "(", "objCom", ")", ";", "return", "true", ";", "}", "public", "ArrayList", "<", "Compra", ">", "encontrarCompras", "(", "String", "concepto", ",", "int", "numero", ",", "String", "fec_emision", ",", "String", "nom_empresa", ",", "String", "fec_venc", ",", "String", "fec_pago", ",", "String", "estado", ")", "{", "ArrayList", "<", "Compra", ">", "filCom", "=", "new", "ArrayList", "<", "Compra", ">", "(", ")", ";", "boolean", "comparar", "=", "false", ";", "for", "(", "Compra", "objCom", ":", "arrCom", ")", "{", "comparar", "=", "objCom", ".", "getConcepto", "(", ")", ".", "contains", "(", "concepto", ")", "&&", "objCom", ".", "getFecEmision", "(", ")", ".", "contains", "(", "fec_emision", ")", "&&", "objCom", ".", "getNomEmpresa", "(", ")", ".", "contains", "(", "nom_empresa", ")", "&&", "objCom", ".", "getFecVencim", "(", ")", ".", "contains", "(", "fec_venc", ")", "&&", "objCom", ".", "getFecPago", "(", ")", ".", "contains", "(", "fec_pago", ")", "&&", "objCom", ".", "getEstado", "(", ")", ".", "contains", "(", "estado", ")", ";", "if", "(", "numero", "!=", "0", ")", "{", "if", "(", "objCom", ".", "getNumero", "(", ")", "==", "numero", "&&", "comparar", ")", "{", "filCom", ".", "add", "(", "objCom", ")", ";", "}", "}", "else", "if", "(", "comparar", ")", "{", "filCom", ".", "add", "(", "objCom", ")", ";", "}", "}", "if", "(", "filCom", ".", "size", "(", ")", "==", "0", ")", "{", "new", "ProcessException", "(", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "}", "else", "{", "Collections", ".", "sort", "(", "filCom", ",", "new", "CompraComparator", "(", ")", ")", ";", "objVal", ".", "messageOk", "(", "\"\"", "+", "filCom", ".", "size", "(", ")", "+", "\"\"", ")", ";", "}", "return", "filCom", ";", "}", "public", "boolean", "pagarCompra", "(", "int", "num_com", ")", "{", "Compra", "objcom", "=", "getCompraByNum", "(", "num_com", ")", ";", "if", "(", "objcom", "!=", "null", ")", "{", "if", "(", "objcom", ".", "isCancelada", "(", ")", ")", "{", "new", "ProcessException", "(", "\"\"", "+", "num_com", "+", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "else", "if", "(", "objcom", ".", "isAnulada", "(", ")", ")", "{", "new", "ProcessException", "(", "\"\"", "+", "num_com", "+", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "objcom", ".", "pagar", "(", ")", ";", "}", "else", "{", "return", "false", ";", "}", "objVal", ".", "messageOk", "(", "\"\"", "+", "num_com", ")", ";", "return", "true", ";", "}", "public", "boolean", "anularCompra", "(", "int", "num_com", ")", "{", "Compra", "objcom", "=", "getCompraByNum", "(", "num_com", ")", ";", "if", "(", "objcom", "!=", "null", ")", "{", "if", "(", "objcom", ".", "isCancelada", "(", ")", ")", "{", "new", "ProcessException", "(", "\"\"", "+", "num_com", "+", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "else", "if", "(", "objcom", ".", "isAnulada", "(", ")", ")", "{", "new", "ProcessException", "(", "\"\"", "+", "num_com", "+", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "objcom", ".", "anular", "(", ")", ";", "}", "else", "{", "return", "false", ";", "}", "objVal", ".", "messageOk", "(", "\"\"", "+", "num_com", ")", ";", "return", "true", ";", "}", "}", "</s>" ]
10,443
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "business", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Prospecto", ";", "import", "benedictoxvi", ".", "pe", ".", "datatest", ".", "DataBD", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "FormatException", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "ProcessException", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "Validaciones", ";", "public", "class", "AdmProspecto", "{", "Validaciones", "objVal", "=", "new", "Validaciones", "(", ")", ";", "ArrayList", "<", "Prospecto", ">", "arrPro", "=", "new", "ArrayList", "<", "Prospecto", ">", "(", ")", ";", "DataBD", "bd", "=", "new", "DataBD", "(", ")", ";", "public", "ArrayList", "<", "Prospecto", ">", "getArrPro", "(", ")", "{", "return", "arrPro", ";", "}", "public", "void", "setArrPro", "(", "ArrayList", "<", "Prospecto", ">", "arrPro", ")", "{", "this", ".", "arrPro", "=", "arrPro", ";", "}", "public", "AdmProspecto", "(", ")", "{", "arrPro", "=", "bd", ".", "getDataProspecto", "(", ")", ";", "}", "public", "int", "listaProspectos", "(", ")", "{", "int", "i", "=", "arrPro", ".", "size", "(", ")", ";", "if", "(", "i", "==", "0", ")", "return", "0", ";", "i", "=", "0", ";", "for", "(", "Prospecto", "objPro", ":", "arrPro", ")", "{", "i", "+=", "1", ";", "System", ".", "out", ".", "println", "(", "i", "+", "\".t\"", "+", "objPro", ".", "getNumProspecto", "(", ")", "+", "\"t\"", "+", "objPro", ".", "getFecProspecto", "(", ")", "+", "\"t\"", "+", "objPro", ".", "getNombes", "(", ")", "+", "\"t\"", "+", "objPro", ".", "getApePaterno", "(", ")", "+", "\"t\"", "+", "objPro", ".", "getApeMaterno", "(", ")", "+", "\"t\"", "+", "objPro", ".", "getCorreo", "(", ")", "+", "\"t\"", "+", "objPro", ".", "getTelefono", "(", ")", "+", "\"t\"", "+", "objPro", ".", "getCelular", "(", ")", "+", "\"t\"", "+", "objPro", ".", "getNroDNI", "(", ")", "+", "\"t\"", "+", "objPro", ".", "getEstado", "(", ")", ")", ";", "}", "return", "i", ";", "}", "public", "ArrayList", "<", "Prospecto", ">", "findProspecto", "(", "String", "nombs", ",", "String", "apepat", ",", "String", "apemat", ",", "String", "mail", ",", "String", "dni", ",", "String", "tel_cel", ",", "String", "fecha", ",", "String", "estado", ")", "{", "ArrayList", "<", "Prospecto", ">", "filtro", "=", "new", "ArrayList", "<", "Prospecto", ">", "(", ")", ";", "for", "(", "Prospecto", "objPro", ":", "arrPro", ")", "{", "if", "(", "objPro", ".", "getNombes", "(", ")", ".", "contains", "(", "nombs", ")", "&&", "objPro", ".", "getApePaterno", "(", ")", ".", "contains", "(", "apepat", ")", "&&", "objPro", ".", "getApeMaterno", "(", ")", ".", "contains", "(", "apemat", ")", "&&", "objPro", ".", "getCorreo", "(", ")", ".", "contains", "(", "mail", ")", "&&", "objPro", ".", "getNroDNI", "(", ")", ".", "contains", "(", "dni", ")", "&&", "(", "objPro", ".", "getTelefono", "(", ")", ".", "contains", "(", "tel_cel", ")", "||", "objPro", ".", "getCelular", "(", ")", ".", "contains", "(", "tel_cel", ")", ")", "&&", "objPro", ".", "getFecProspecto", "(", ")", ".", "contains", "(", "fecha", ")", "&&", "objPro", ".", "getEstado", "(", ")", ".", "contains", "(", "estado", ")", ")", "{", "filtro", ".", "add", "(", "objPro", ")", ";", "}", "}", "if", "(", "filtro", ".", "size", "(", ")", "==", "0", ")", "{", "new", "ProcessException", "(", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "}", "else", "{", "objVal", ".", "messageOk", "(", "\"\"", "+", "filtro", ".", "size", "(", ")", "+", "\"\"", ")", ";", "}", "return", "filtro", ";", "}", "public", "boolean", "registrarProspecto", "(", "int", "num_pro", ",", "String", "fecha", ",", "String", "nombs", ",", "String", "apepat", ",", "String", "apemat", ",", "String", "mail", ",", "String", "dni", ",", "String", "telefono", ",", "String", "celular", ",", "String", "estado", ")", "{", "Prospecto", "objPro", "=", "new", "Prospecto", "(", ")", ";", "String", "msg_err", "=", "\"\"", ";", "if", "(", "!", "objVal", ".", "isSet", "(", "nombs", ")", ")", "msg_err", "=", "\"\"", ";", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "apepat", ")", ")", "msg_err", "=", "\"\"", ";", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "mail", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isEmail", "(", "mail", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isDate", "(", "fecha", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "objVal", ".", "isSet", "(", "dni", ")", "&&", "!", "objVal", ".", "isDNI", "(", "dni", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "objVal", ".", "isSet", "(", "telefono", ")", "&&", "!", "objVal", ".", "isDigits", "(", "telefono", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "objVal", ".", "isSet", "(", "celular", ")", "&&", "!", "objVal", ".", "isDigits", "(", "celular", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "if", "(", "objVal", ".", "isSet", "(", "msg_err", ")", ")", "{", "new", "FormatException", "(", "msg_err", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "objPro", ".", "setNumProspecto", "(", "num_pro", ")", ";", "objPro", ".", "setFecProspecto", "(", "fecha", ")", ";", "objPro", ".", "setNombes", "(", "nombs", ")", ";", "objPro", ".", "setApePaterno", "(", "apepat", ")", ";", "objPro", ".", "setApeMaterno", "(", "apemat", ")", ";", "objPro", ".", "setCorreo", "(", "mail", ")", ";", "objPro", ".", "setNroDNI", "(", "dni", ")", ";", "objPro", ".", "setTelefono", "(", "telefono", ")", ";", "objPro", ".", "setCelular", "(", "celular", ")", ";", "objPro", ".", "setEstado", "(", "estado", ")", ";", "arrPro", ".", "add", "(", "objPro", ")", ";", "objVal", ".", "messageOk", "(", "\"\"", "+", "num_pro", ")", ";", "return", "true", ";", "}", "public", "Prospecto", "getProspectoByNum", "(", "int", "num_pro", ")", "{", "for", "(", "Prospecto", "xpro", ":", "arrPro", ")", "{", "if", "(", "xpro", ".", "getNumProspecto", "(", ")", "==", "num_pro", ")", "{", "return", "xpro", ";", "}", "}", "new", "ProcessException", "(", "\"\"", "+", "num_pro", "+", "\"'", "no", "existe.\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "null", ";", "}", "public", "boolean", "deProspectoToCliente", "(", "int", "num_pro", ")", "{", "boolean", "res", "=", "modifcarProspecto", "(", "num_pro", ",", "null", ",", "null", ",", "null", ",", "null", ",", "null", ",", "null", ",", "null", ",", "null", ",", "\"C\"", ")", ";", "if", "(", "res", ")", "{", "objVal", ".", "messageOk", "(", "\"\"", "+", "num_pro", ")", ";", "}", "return", "res", ";", "}", "public", "boolean", "deClientetoProspecto", "(", "int", "num_pro", ")", "{", "boolean", "res", "=", "modifcarProspecto", "(", "num_pro", ",", "null", ",", "null", ",", "null", ",", "null", ",", "null", ",", "null", ",", "null", ",", "null", ",", "\"", "\"", ")", ";", "if", "(", "res", ")", "{", "objVal", ".", "messageOk", "(", "\"\"", "+", "num_pro", ")", ";", "}", "return", "res", ";", "}", "public", "boolean", "eliminarProspecto", "(", "int", "i", ")", "{", "for", "(", "Prospecto", "objPro", ":", "arrPro", ")", "{", "if", "(", "objPro", ".", "getNumProspecto", "(", ")", "==", "(", "i", ")", ")", "{", "objVal", ".", "messageOk", "(", "\"\"", "+", "i", ")", ";", "return", "arrPro", ".", "remove", "(", "objPro", ")", ";", "}", "}", "return", "false", ";", "}", "public", "boolean", "modifcarProspecto", "(", "int", "num_pro", ",", "String", "fecha", ",", "String", "nombs", ",", "String", "apepat", ",", "String", "apemat", ",", "String", "mail", ",", "String", "dni", ",", "String", "telefono", ",", "String", "celular", ",", "String", "estado", ")", "{", "boolean", "ret", "=", "false", ";", "boolean", "cambio", "=", "false", ";", "for", "(", "int", "x", "=", "0", ";", "x", "<", "arrPro", ".", "size", "(", ")", ";", "x", "++", ")", "{", "Prospecto", "objPro", "=", "arrPro", ".", "get", "(", "x", ")", ";", "if", "(", "objPro", ".", "getNumProspecto", "(", ")", "==", "num_pro", ")", "{", "if", "(", "fecha", "!=", "null", ")", "{", "objPro", ".", "setFecProspecto", "(", "fecha", ")", ";", "cambio", "=", "true", ";", "}", "if", "(", "nombs", "!=", "null", ")", "{", "objPro", ".", "setNombes", "(", "nombs", ")", ";", "cambio", "=", "true", ";", "}", "if", "(", "apepat", "!=", "null", ")", "{", "objPro", ".", "setApePaterno", "(", "apepat", ")", ";", "cambio", "=", "true", ";", "}", "if", "(", "apemat", "!=", "null", ")", "{", "objPro", ".", "setApeMaterno", "(", "apemat", ")", ";", "cambio", "=", "true", ";", "}", "if", "(", "mail", "!=", "null", ")", "{", "objPro", ".", "setCorreo", "(", "mail", ")", ";", "cambio", "=", "true", ";", "}", "if", "(", "dni", "!=", "null", ")", "{", "objPro", ".", "setNroDNI", "(", "dni", ")", ";", "cambio", "=", "true", ";", "}", "if", "(", "telefono", "!=", "null", ")", "{", "objPro", ".", "setTelefono", "(", "telefono", ")", ";", "cambio", "=", "true", ";", "}", "if", "(", "celular", "!=", "null", ")", "{", "objPro", ".", "setCelular", "(", "celular", ")", ";", "cambio", "=", "true", ";", "}", "if", "(", "estado", "!=", "null", ")", "{", "if", "(", "estado", ".", "equalsIgnoreCase", "(", "\"C\"", ")", "&&", "objPro", ".", "getEstado", "(", ")", ".", "trim", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "if", "(", "findProspecto", "(", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "objPro", ".", "getNroDNI", "(", ")", ",", "\"\"", ",", "\"\"", ",", "\"C\"", ")", ".", "size", "(", ")", ">", "0", ")", "{", "new", "ProcessException", "(", "\"\"", "+", "objPro", ".", "getNroDNI", "(", ")", "+", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "}", "else", "if", "(", "estado", ".", "equalsIgnoreCase", "(", "\"C\"", ")", "&&", "objPro", ".", "getEstado", "(", ")", ".", "equalsIgnoreCase", "(", "\"C\"", ")", ")", "{", "new", "ProcessException", "(", "\"\"", "+", "num_pro", "+", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "objPro", ".", "setEstado", "(", "estado", ")", ";", "cambio", "=", "true", ";", "}", "if", "(", "cambio", ")", "{", "arrPro", ".", "set", "(", "x", ",", "objPro", ")", ";", "if", "(", "estado", "==", "null", ")", "{", "objVal", ".", "messageOk", "(", "\"\"", "+", "num_pro", ")", ";", "}", "}", "ret", "=", "true", ";", "return", "ret", ";", "}", "}", "new", "ProcessException", "(", "\"\"", "+", "num_pro", "+", "\"'\"", ")", ";", "return", "ret", ";", "}", "}", "</s>" ]
10,444
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "business", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "benedictoxvi", ".", "pe", ".", "businesstest", ".", "AdmClienteTest", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Cliente", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "GrupoEstudio", ";", "import", "benedictoxvi", ".", "pe", ".", "datatest", ".", "DataBD", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "ProcessException", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "Validaciones", ";", "public", "class", "AdmGrupoEstudio", "{", "ArrayList", "<", "GrupoEstudio", ">", "arrGrupos", "=", "new", "ArrayList", "<", "GrupoEstudio", ">", "(", ")", ";", "AdmCliente", "admCli", "=", "new", "AdmCliente", "(", ")", ";", "Validaciones", "objVal", "=", "new", "Validaciones", "(", ")", ";", "DataBD", "bd", "=", "new", "DataBD", "(", ")", ";", "public", "AdmGrupoEstudio", "(", ")", "{", "arrGrupos", "=", "bd", ".", "getDataGrupoEstudio", "(", ")", ";", "}", "public", "ArrayList", "<", "GrupoEstudio", ">", "getArrGrupos", "(", ")", "{", "return", "arrGrupos", ";", "}", "public", "int", "listarGruposEstudio", "(", ")", "{", "if", "(", "this", ".", "getArrGrupos", "(", ")", ".", "size", "(", ")", "==", "0", ")", "return", "0", ";", "int", "i", "=", "0", ";", "for", "(", "GrupoEstudio", "objGru", ":", "getArrGrupos", "(", ")", ")", "{", "i", "+=", "1", ";", "System", ".", "out", ".", "println", "(", "i", "+", "\".t\"", "+", "objGru", ".", "getNomGrupo", "(", ")", "+", "\"t\"", "+", "objGru", ".", "getDescripcion", "(", ")", "+", "\"t\"", "+", "objGru", ".", "getNomAcademia", "(", ")", "+", "\"t\"", "+", "objGru", ".", "getFecInicio", "(", ")", "+", "\"t\"", "+", "objGru", ".", "getFecFin", "(", ")", "+", "\"t\"", "+", "objGru", ".", "getInstructorStr", "(", ")", "+", "\"t\"", "+", "\"t\"", "+", "objGru", ".", "getLocal", "(", ")", "+", "\"t\"", "+", "objGru", ".", "getAula", "(", ")", "+", "\"t\"", "+", "objGru", ".", "getCAltitud", "(", ")", "+", "\"t\"", "+", "objGru", ".", "getCLatitud", "(", ")", ")", ";", "}", "return", "i", ";", "}", "public", "void", "setArrGrupos", "(", "ArrayList", "<", "GrupoEstudio", ">", "arrGrupos", ")", "{", "this", ".", "arrGrupos", "=", "arrGrupos", ";", "}", "public", "boolean", "registraGrupoEstudio", "(", "String", "cod_grupo", ",", "String", "nom_grupo", ",", "String", "descripcion", ",", "String", "nom_academia", ",", "String", "nom_curso", ",", "String", "fec_inicio", ",", "String", "fec_final", ",", "String", "[", "]", "instructores", ",", "String", "link", ",", "String", "local", ",", "int", "aula", ",", "double", "latitud", ",", "double", "altitud", ")", "{", "String", "msg_err", "=", "null", ";", "if", "(", "!", "objVal", ".", "isSet", "(", "cod_grupo", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "nom_grupo", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "fec_inicio", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isDate", "(", "fec_inicio", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "fec_final", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isDate", "(", "fec_final", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "objVal", ".", "dateToInt", "(", "fec_final", ")", "<", "objVal", ".", "dateToInt", "(", "fec_inicio", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "if", "(", "objVal", ".", "isSet", "(", "msg_err", ")", ")", "{", "new", "ProcessException", "(", "msg_err", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "GrupoEstudio", "objGru", "=", "new", "GrupoEstudio", "(", ")", ";", "objGru", ".", "setCodGrupo", "(", "cod_grupo", ")", ";", "objGru", ".", "setNomGrupo", "(", "nom_grupo", ")", ";", "objGru", ".", "setDescripcion", "(", "descripcion", ")", ";", "objGru", ".", "setNomAcademia", "(", "nom_academia", ")", ";", "objGru", ".", "setFecInicio", "(", "fec_inicio", ")", ";", "objGru", ".", "setFecFin", "(", "fec_final", ")", ";", "objGru", ".", "setInstructor", "(", "instructores", ")", ";", "objGru", ".", "setLinkSylabus", "(", "link", ")", ";", "objGru", ".", "setLocal", "(", "local", ")", ";", "objGru", ".", "setAula", "(", "aula", ")", ";", "objGru", ".", "setEstado", "(", "\"\"", ")", ";", "objGru", ".", "setCLatitud", "(", "latitud", ")", ";", "objGru", ".", "setCAltitud", "(", "altitud", ")", ";", "arrGrupos", ".", "add", "(", "objGru", ")", ";", "objVal", ".", "messageOk", "(", "\"\"", "+", "cod_grupo", ")", ";", "return", "true", ";", "}", "public", "ArrayList", "<", "GrupoEstudio", ">", "encontrarGrupoEstudio", "(", "String", "nom_grupo", ",", "String", "nom_acade", ",", "String", "curso", ",", "String", "fec_ini", ",", "String", "fec_fin", ",", "String", "estado", ")", "{", "ArrayList", "<", "GrupoEstudio", ">", "filGru", "=", "new", "ArrayList", "<", "GrupoEstudio", ">", "(", ")", ";", "for", "(", "GrupoEstudio", "objGru", ":", "getArrGrupos", "(", ")", ")", "{", "if", "(", "objGru", ".", "getNomGrupo", "(", ")", ".", "contains", "(", "nom_grupo", ")", "&&", "objGru", ".", "getNomAcademia", "(", ")", ".", "contains", "(", "nom_acade", ")", "&&", "objGru", ".", "getNomCurso", "(", ")", ".", "contains", "(", "curso", ")", "&&", "objGru", ".", "getFecInicio", "(", ")", ".", "contains", "(", "fec_ini", ")", "&&", "objGru", ".", "getFecFin", "(", ")", ".", "contains", "(", "fec_fin", ")", "&&", "objGru", ".", "getEstado", "(", ")", ".", "contains", "(", "estado", ")", ")", "{", "filGru", ".", "add", "(", "objGru", ")", ";", "}", "}", "return", "filGru", ";", "}", "public", "GrupoEstudio", "getGrupoById", "(", "String", "cod_grupo", ")", "{", "for", "(", "GrupoEstudio", "objGru", ":", "getArrGrupos", "(", ")", ")", "{", "if", "(", "objGru", ".", "getCodGrupo", "(", ")", ".", "equals", "(", "cod_grupo", ")", ")", "{", "return", "objGru", ";", "}", "}", "new", "ProcessException", "(", "\"\"", "+", "cod_grupo", "+", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "null", ";", "}", "public", "boolean", "addAlumnoGrupoEstudio", "(", "String", "codGrupo", ",", "String", "codCliente", ")", "{", "GrupoEstudio", "add_grupo", "=", "getGrupoById", "(", "codGrupo", ")", ";", "if", "(", "add_grupo", "==", "null", ")", "{", "return", "false", ";", "}", "if", "(", "add_grupo", ".", "getAforo", "(", ")", "==", "add_grupo", ".", "getNumAlumnos", "(", ")", ")", "{", "new", "ProcessException", "(", "\"El", "Grupo", "[\"", "+", "codGrupo", "+", "\"][\"", "+", "add_grupo", ".", "getNomGrupo", "(", ")", "+", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "if", "(", "add_grupo", ".", "existsCliente", "(", "codCliente", ")", ")", "{", "new", "ProcessException", "(", "\"\"", "+", "codCliente", "+", "\"\"", "+", "codGrupo", "+", "\"]", "\"", "+", "add_grupo", ".", "getNomGrupo", "(", ")", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "Cliente", "add_cli", "=", "admCli", ".", "getClienteByCod", "(", "codCliente", ")", ";", "if", "(", "add_cli", "!=", "null", ")", "{", "add_grupo", ".", "getInscritos", "(", ")", ".", "add", "(", "add_cli", ")", ";", "objVal", ".", "messageOk", "(", "\"\"", "+", "codCliente", "+", "\"\"", "+", "codGrupo", ")", ";", "return", "true", ";", "}", "return", "false", ";", "}", "public", "boolean", "verificarAlumnoEnGrupo", "(", "String", "cod_grupo", ",", "String", "cod_cli", ")", "{", "GrupoEstudio", "grupo", "=", "getGrupoById", "(", "cod_grupo", ")", ";", "if", "(", "grupo", "!=", "null", ")", "{", "if", "(", "!", "grupo", ".", "existsCliente", "(", "cod_cli", ")", ")", "{", "new", "ProcessException", "(", "\"El", "Cliente", "[\"", "+", "cod_cli", "+", "\"\"", "+", "cod_grupo", "+", "\"].\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "for", "(", "Cliente", "objCli", ":", "grupo", ".", "getInscritos", "(", ")", ")", "{", "if", "(", "objCli", ".", "getCodCliente", "(", ")", ".", "equals", "(", "cod_cli", ")", ")", "{", "objVal", ".", "messageOk", "(", "\"\"", "+", "cod_cli", "+", "\"\"", "+", "cod_grupo", "+", "\"].\"", ")", ";", "return", "true", ";", "}", "}", "}", "return", "false", ";", "}", "}", "</s>" ]
10,445
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "business", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Cliente", ";", "import", "benedictoxvi", ".", "pe", ".", "datatest", ".", "DataBD", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "FormatException", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "ProcessException", ";", "import", "benedictoxvi", ".", "pe", ".", "util", ".", "Validaciones", ";", "public", "class", "AdmCliente", "{", "ArrayList", "<", "Cliente", ">", "arrCli", "=", "new", "ArrayList", "<", "Cliente", ">", "(", ")", ";", "Validaciones", "objVal", "=", "new", "Validaciones", "(", ")", ";", "DataBD", "bd", "=", "new", "DataBD", "(", ")", ";", "public", "AdmCliente", "(", ")", "{", "arrCli", "=", "bd", ".", "getDataCliente", "(", ")", ";", "}", "public", "Cliente", "getClienteByCod", "(", "String", "numCli", ")", "{", "for", "(", "Cliente", "cli", ":", "arrCli", ")", "{", "if", "(", "cli", ".", "getCodCliente", "(", ")", ".", "equals", "(", "numCli", ")", ")", "{", "return", "cli", ";", "}", "}", "new", "ProcessException", "(", "\"\"", "+", "numCli", "+", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "null", ";", "}", "public", "Cliente", "getClienteByNum", "(", "String", "numCli", ")", "{", "for", "(", "Cliente", "cli", ":", "arrCli", ")", "{", "if", "(", "cli", ".", "getCodCliente", "(", ")", ".", "equals", "(", "numCli", ")", ")", "{", "return", "cli", ";", "}", "}", "new", "ProcessException", "(", "\"\"", "+", "numCli", "+", "\"'", "no", "existe.\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "null", ";", "}", "public", "ArrayList", "<", "Cliente", ">", "findCliente", "(", "String", "nombs", ",", "String", "apepat", ",", "String", "apemat", ",", "String", "mail", ",", "String", "dni", ",", "String", "tel_cel", ",", "String", "fecha", ",", "String", "estado", ")", "{", "ArrayList", "<", "Cliente", ">", "filtro", "=", "new", "ArrayList", "<", "Cliente", ">", "(", ")", ";", "try", "{", "for", "(", "Cliente", "objCli", ":", "arrCli", ")", "{", "if", "(", "objCli", ".", "getNomCliente", "(", ")", ".", "contains", "(", "nombs", ")", "&&", "objCli", ".", "getApePatCliente", "(", ")", ".", "contains", "(", "apepat", ")", "&&", "objCli", ".", "getApeMatCliente", "(", ")", ".", "contains", "(", "apemat", ")", "&&", "objCli", ".", "getEmaCliente", "(", ")", ".", "contains", "(", "mail", ")", "&&", "objCli", ".", "getDniCliente", "(", ")", ".", "contains", "(", "dni", ")", "&&", "objCli", ".", "getFonCliente", "(", ")", ".", "contains", "(", "tel_cel", ")", "&&", "objCli", ".", "getFecConCliente", "(", ")", ".", "contains", "(", "fecha", ")", "&&", "objCli", ".", "getEstCliente", "(", ")", ".", "contains", "(", "estado", ")", ")", "{", "filtro", ".", "add", "(", "objCli", ")", ";", "}", "}", "if", "(", "filtro", ".", "size", "(", ")", "==", "0", ")", "{", "new", "ProcessException", "(", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "}", "else", "{", "objVal", ".", "messageOk", "(", "\"\"", "+", "filtro", ".", "size", "(", ")", "+", "\"\"", ")", ";", "}", "}", "catch", "(", "Exception", "ex", ")", "{", "ex", ".", "printStackTrace", "(", ")", ";", "}", "return", "filtro", ";", "}", "public", "boolean", "modifcarCliente", "(", "String", "cod_cli", ",", "String", "fecha", ",", "String", "nombs", ",", "String", "apepat", ",", "String", "apemat", ",", "String", "mail", ",", "String", "dni", ",", "String", "telefono", ",", "String", "celular", ",", "String", "estado", ")", "{", "boolean", "ret", "=", "false", ";", "boolean", "cambio", "=", "false", ";", "for", "(", "int", "x", "=", "0", ";", "x", "<", "arrCli", ".", "size", "(", ")", ";", "x", "++", ")", "{", "Cliente", "objCli", "=", "arrCli", ".", "get", "(", "x", ")", ";", "if", "(", "objCli", ".", "getCodCliente", "(", ")", ".", "equals", "(", "cod_cli", ")", ")", "{", "if", "(", "fecha", "!=", "null", ")", "{", "objCli", ".", "setFecConCliente", "(", "fecha", ")", ";", "cambio", "=", "true", ";", "}", "if", "(", "nombs", "!=", "null", ")", "{", "objCli", ".", "setNomCliente", "(", "nombs", ")", ";", "cambio", "=", "true", ";", "}", "if", "(", "apepat", "!=", "null", ")", "{", "objCli", ".", "setApePatCliente", "(", "apepat", ")", ";", "cambio", "=", "true", ";", "}", "if", "(", "apemat", "!=", "null", ")", "{", "objCli", ".", "setApeMatCliente", "(", "apemat", ")", ";", "cambio", "=", "true", ";", "}", "if", "(", "mail", "!=", "null", ")", "{", "objCli", ".", "setEmaCliente", "(", "mail", ")", ";", "cambio", "=", "true", ";", "}", "if", "(", "dni", "!=", "null", ")", "{", "objCli", ".", "setDniCliente", "(", "dni", ")", ";", "cambio", "=", "true", ";", "}", "if", "(", "telefono", "!=", "null", ")", "{", "objCli", ".", "setFonCliente", "(", "telefono", ")", ";", "cambio", "=", "true", ";", "}", "if", "(", "estado", "!=", "null", ")", "{", "if", "(", "estado", ".", "equalsIgnoreCase", "(", "\"C\"", ")", "&&", "objCli", ".", "getEstCliente", "(", ")", ".", "trim", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "if", "(", "findCliente", "(", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "objCli", ".", "getDniCliente", "(", ")", ",", "\"\"", ",", "\"\"", ",", "\"C\"", ")", ".", "size", "(", ")", ">", "0", ")", "{", "new", "ProcessException", "(", "\"\"", "+", "objCli", ".", "getDniCliente", "(", ")", "+", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "}", "else", "if", "(", "estado", ".", "equalsIgnoreCase", "(", "\"C\"", ")", "&&", "objCli", ".", "getEstCliente", "(", ")", ".", "equalsIgnoreCase", "(", "\"C\"", ")", ")", "{", "new", "ProcessException", "(", "\"El", "Cliente", "'\"", "+", "cod_cli", "+", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "objCli", ".", "setEstCliente", "(", "estado", ")", ";", "cambio", "=", "true", ";", "}", "if", "(", "cambio", ")", "{", "arrCli", ".", "set", "(", "x", ",", "objCli", ")", ";", "if", "(", "estado", "==", "null", ")", "{", "objVal", ".", "messageOk", "(", "\"\"", "+", "cod_cli", ")", ";", "}", "}", "ret", "=", "true", ";", "return", "ret", ";", "}", "}", "new", "ProcessException", "(", "\"\"", "+", "cod_cli", "+", "\"'\"", ")", ";", "return", "ret", ";", "}", "public", "boolean", "deClienteToProspecto", "(", "String", "cod_cli", ")", "{", "boolean", "res", "=", "modifcarCliente", "(", "cod_cli", ",", "null", ",", "null", ",", "null", ",", "null", ",", "null", ",", "null", ",", "null", ",", "null", ",", "\"C\"", ")", ";", "if", "(", "res", ")", "{", "objVal", ".", "messageOk", "(", "\"\"", "+", "cod_cli", ")", ";", "}", "return", "res", ";", "}", "public", "boolean", "registrarCliente", "(", "String", "cod_cli", ",", "String", "fecha", ",", "String", "nombs", ",", "String", "apepat", ",", "String", "apemat", ",", "String", "mail", ",", "String", "dni", ",", "String", "telefono", ",", "String", "celular", ",", "String", "estado", ")", "{", "Cliente", "objCli", "=", "new", "Cliente", "(", ")", ";", "String", "msg_err", "=", "\"\"", ";", "if", "(", "!", "objVal", ".", "isSet", "(", "nombs", ")", ")", "msg_err", "=", "\"\"", ";", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "apepat", ")", ")", "msg_err", "=", "\"\"", ";", "else", "if", "(", "!", "objVal", ".", "isSet", "(", "mail", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isEmail", "(", "mail", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "!", "objVal", ".", "isDate", "(", "fecha", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "objVal", ".", "isSet", "(", "dni", ")", "&&", "!", "objVal", ".", "isDNI", "(", "dni", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "objVal", ".", "isSet", "(", "telefono", ")", "&&", "!", "objVal", ".", "isDigits", "(", "telefono", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "else", "if", "(", "objVal", ".", "isSet", "(", "celular", ")", "&&", "!", "objVal", ".", "isDigits", "(", "celular", ")", ")", "{", "msg_err", "=", "\"\"", ";", "}", "if", "(", "objVal", ".", "isSet", "(", "msg_err", ")", ")", "{", "new", "FormatException", "(", "msg_err", ")", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "objCli", ".", "setCodCliente", "(", "cod_cli", ")", ";", "objCli", ".", "setFecConCliente", "(", "fecha", ")", ";", "objCli", ".", "setNomCliente", "(", "nombs", ")", ";", "objCli", ".", "setApePatCliente", "(", "apepat", ")", ";", "objCli", ".", "setApeMatCliente", "(", "apemat", ")", ";", "objCli", ".", "setEmaCliente", "(", "mail", ")", ";", "objCli", ".", "setDniCliente", "(", "dni", ")", ";", "objCli", ".", "setFonCliente", "(", "telefono", ")", ";", "objCli", ".", "setEstCliente", "(", "estado", ")", ";", "arrCli", ".", "add", "(", "objCli", ")", ";", "objVal", ".", "messageOk", "(", "\"\"", "+", "cod_cli", ")", ";", "return", "true", ";", "}", "public", "boolean", "eliminarCliente", "(", "String", "cod_cli", ")", "{", "for", "(", "Cliente", "objCli", ":", "arrCli", ")", "{", "if", "(", "objCli", ".", "getCodCliente", "(", ")", ".", "equals", "(", "cod_cli", ")", ")", "{", "objVal", ".", "messageOk", "(", "\"\"", "+", "cod_cli", ")", ";", "return", "arrCli", ".", "remove", "(", "objCli", ")", ";", "}", "}", "return", "false", ";", "}", "}", "</s>" ]
10,446
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "util", ";", "import", "java", ".", "text", ".", "SimpleDateFormat", ";", "import", "java", ".", "util", ".", "Date", ";", "import", "java", ".", "util", ".", "regex", ".", "Matcher", ";", "import", "java", ".", "util", ".", "regex", ".", "Pattern", ";", "public", "class", "Validaciones", "{", "public", "void", "printMsg", "(", "String", "msg", ",", "String", "prev", ")", "{", "StackTraceElement", "[", "]", "trace", "=", "(", "StackTraceElement", "[", "]", ")", "Thread", ".", "currentThread", "(", ")", ".", "getStackTrace", "(", ")", ";", "String", "method1", "=", "trace", "[", "4", "]", ".", "getMethodName", "(", ")", ";", "String", "method2", "=", "trace", "[", "3", "]", ".", "getMethodName", "(", ")", ";", "System", ".", "out", ".", "println", "(", "\"n", "\"", "+", "prev", "+", "method2", "+", "\"[\"", "+", "method1", "+", "\"]\"", "+", "\"", ":", "\"", "+", "msg", ")", ";", "}", "public", "void", "messageOk", "(", "String", "msg", ")", "{", "StackTraceElement", "[", "]", "trace", "=", "(", "StackTraceElement", "[", "]", ")", "Thread", ".", "currentThread", "(", ")", ".", "getStackTrace", "(", ")", ";", "String", "method1", "=", "trace", "[", "2", "]", ".", "getMethodName", "(", ")", ";", "String", "method2", "=", "trace", "[", "3", "]", ".", "getMethodName", "(", ")", ";", "System", ".", "out", ".", "println", "(", "\"n", "\"", "+", "method2", "+", "\"[\"", "+", "method1", "+", "\"]\"", "+", "\"", ":", "\"", "+", "msg", ")", ";", "}", "public", "void", "messageWar", "(", "String", "msg", ")", "{", "StackTraceElement", "[", "]", "trace", "=", "(", "StackTraceElement", "[", "]", ")", "Thread", ".", "currentThread", "(", ")", ".", "getStackTrace", "(", ")", ";", "String", "method1", "=", "trace", "[", "2", "]", ".", "getMethodName", "(", ")", ";", "String", "method2", "=", "trace", "[", "3", "]", ".", "getMethodName", "(", ")", ";", "System", ".", "out", ".", "println", "(", "\"n", "\"", "+", "method2", "+", "\"[\"", "+", "method1", "+", "\"]\"", "+", "\"", ":", "\"", "+", "msg", ")", ";", "}", "public", "void", "printMsg", "(", "String", "msg", ")", "{", "printMsg", "(", "\"", "\"", "+", "msg", ",", "\"\"", ")", ";", "}", "public", "boolean", "isSet", "(", "String", "cad", ")", "{", "boolean", "ret", "=", "true", ";", "if", "(", "cad", "==", "null", ")", "{", "return", "false", ";", "}", "if", "(", "cad", ".", "trim", "(", ")", ".", "isEmpty", "(", ")", ")", "ret", "=", "false", ";", "else", "ret", "=", "true", ";", "return", "ret", ";", "}", "public", "boolean", "isValidKey", "(", "String", "key", ")", "{", "if", "(", "!", "isSet", "(", "key", ")", ")", "return", "false", ";", "if", "(", "key", ".", "trim", "(", ")", ".", "length", "(", ")", "<", "8", ")", "{", "return", "false", ";", "}", "return", "true", ";", "}", "public", "boolean", "isSet", "(", "String", "[", "]", "a_objs", ")", "{", "boolean", "ret", "=", "true", ";", "for", "(", "String", "obj", ":", "a_objs", ")", "{", "if", "(", "!", "isSet", "(", "obj", ")", ")", "{", "ret", "=", "false", ";", "break", ";", "}", "}", "return", "ret", ";", "}", "public", "boolean", "isDigits", "(", "String", "digs", ")", "{", "digs", "=", "digs", ".", "trim", "(", ")", ";", "for", "(", "char", "a", ":", "digs", ".", "toCharArray", "(", ")", ")", "{", "if", "(", "!", "Character", ".", "isDigit", "(", "a", ")", ")", "return", "false", ";", "}", "return", "true", ";", "}", "public", "boolean", "isDNI", "(", "String", "dni", ")", "{", "if", "(", "!", "isDigits", "(", "dni", ")", ")", "return", "false", ";", "if", "(", "dni", ".", "trim", "(", ")", ".", "length", "(", ")", "==", "8", ")", "{", "return", "true", ";", "}", "else", "{", "return", "false", ";", "}", "}", "public", "boolean", "isEmail", "(", "String", "correo", ")", "{", "Pattern", "pat", "=", "null", ";", "Matcher", "mat", "=", "null", ";", "pat", "=", "Pattern", ".", "compile", "(", "\"\"", ")", ";", "mat", "=", "pat", ".", "matcher", "(", "correo", ")", ";", "if", "(", "mat", ".", "find", "(", ")", ")", "{", "return", "true", ";", "}", "else", "{", "return", "false", ";", "}", "}", "public", "boolean", "isDate", "(", "String", "date", ")", "{", "try", "{", "String", "[", "]", "parts", ";", "parts", "=", "date", ".", "split", "(", "\"/\"", ")", ";", "int", "year", "=", "Integer", ".", "parseInt", "(", "parts", "[", "2", "]", ")", ";", "int", "mes", "=", "Integer", ".", "parseInt", "(", "parts", "[", "1", "]", ")", ";", "int", "dia", "=", "Integer", ".", "parseInt", "(", "parts", "[", "0", "]", ")", ";", "if", "(", "!", "(", "dia", ">=", "1", "&&", "dia", "<=", "31", ")", ")", "return", "false", ";", "if", "(", "!", "(", "mes", ">=", "1", "&&", "mes", "<=", "12", ")", ")", "return", "false", ";", "if", "(", "!", "(", "year", ">=", "1000", "&&", "year", "<=", "9999", ")", ")", "return", "false", ";", "SimpleDateFormat", "formatoFecha", "=", "new", "SimpleDateFormat", "(", "\"dd/MM/yyyy\"", ")", ";", "Date", "fecha", "=", "formatoFecha", ".", "parse", "(", "date", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "return", "false", ";", "}", "return", "true", ";", "}", "public", "Date", "stringToDate", "(", "String", "s_fecha", ")", "{", "Date", "fecha", "=", "null", ";", "try", "{", "SimpleDateFormat", "formatoFecha", "=", "new", "SimpleDateFormat", "(", "\"dd/MM/yyyy\"", ")", ";", "fecha", "=", "formatoFecha", ".", "parse", "(", "s_fecha", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "fecha", "=", "null", ";", "}", "return", "fecha", ";", "}", "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "System", ".", "out", ".", "println", "(", "\"holan\"", ")", ";", "System", ".", "out", ".", "println", "(", "\"rhola\"", ")", ";", "}", "public", "int", "dateToInt", "(", "String", "fecha", ")", "{", "String", "[", "]", "parts", ";", "int", "val", "=", "0", ";", "if", "(", "isDate", "(", "fecha", ")", ")", "{", "parts", "=", "fecha", ".", "split", "(", "\"/\"", ")", ";", "if", "(", "parts", ".", "length", "==", "3", ")", "{", "val", "=", "Integer", ".", "parseInt", "(", "parts", "[", "2", "]", "+", "parts", "[", "1", "]", "+", "parts", "[", "0", "]", ")", ";", "}", "else", "{", "new", "FormatException", "(", "\"\"", "+", "fecha", "+", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "}", "}", "else", "{", "new", "FormatException", "(", "\"\"", "+", "fecha", "+", "\"\"", ")", ".", "printStackTrace", "(", ")", ";", "}", "return", "val", ";", "}", "public", "boolean", "isRUC", "(", "String", "pRuc", ")", "{", "if", "(", "!", "isDigits", "(", "pRuc", ")", ")", "return", "false", ";", "if", "(", "pRuc", ".", "trim", "(", ")", ".", "length", "(", ")", "==", "11", ")", "{", "return", "true", ";", "}", "else", "{", "return", "false", ";", "}", "}", "}", "</s>" ]
10,447
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "util", ";", "import", "sun", ".", "misc", ".", "BASE64Decoder", ";", "import", "sun", ".", "misc", ".", "BASE64Encoder", ";", "public", "class", "Security", "{", "BASE64Encoder", "enc", "=", "new", "BASE64Encoder", "(", ")", ";", "BASE64Decoder", "dec", "=", "new", "BASE64Decoder", "(", ")", ";", "public", "final", "String", "DEFAULT_ENCODING", "=", "\"UTF-8\"", ";", "public", "String", "base64encode", "(", "String", "text", ")", "{", "try", "{", "String", "rez", "=", "enc", ".", "encode", "(", "text", ".", "getBytes", "(", "DEFAULT_ENCODING", ")", ")", ";", "return", "rez", ";", "}", "catch", "(", "Exception", "e", ")", "{", "return", "null", ";", "}", "}", "public", "String", "base64decode", "(", "String", "text", ")", "{", "try", "{", "return", "new", "String", "(", "dec", ".", "decodeBuffer", "(", "text", ")", ",", "DEFAULT_ENCODING", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "return", "null", ";", "}", "}", "}", "</s>" ]
10,448
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "util", ";", "public", "class", "ProcessException", "extends", "Exception", "{", "private", "static", "final", "long", "serialVersionUID", "=", "7086572473114990528L", ";", "public", "ProcessException", "(", ")", "{", "super", "(", ")", ";", "}", "public", "ProcessException", "(", "String", "message", ",", "Throwable", "cause", ",", "boolean", "enableSuppression", ",", "boolean", "writableStackTrace", ")", "{", "}", "public", "ProcessException", "(", "String", "message", ",", "Throwable", "cause", ")", "{", "super", "(", "message", ",", "cause", ")", ";", "}", "public", "ProcessException", "(", "String", "message", ")", "{", "super", "(", "message", ")", ";", "}", "public", "ProcessException", "(", "Throwable", "cause", ")", "{", "super", "(", "cause", ")", ";", "}", "@", "Override", "public", "void", "printStackTrace", "(", ")", "{", "String", "method1", "=", "(", "(", "StackTraceElement", ")", "this", ".", "getStackTrace", "(", ")", "[", "0", "]", ")", ".", "getMethodName", "(", ")", ";", "String", "method2", "=", "(", "(", "StackTraceElement", ")", "this", ".", "getStackTrace", "(", ")", "[", "1", "]", ")", ".", "getMethodName", "(", ")", ";", "System", ".", "err", ".", "println", "(", "\"n", "\"", "+", "method2", "+", "\"[\"", "+", "method1", "+", "\"]\"", "+", "\"", ":", "\"", "+", "this", ".", "getMessage", "(", ")", ")", ";", "}", "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "System", ".", "out", ".", "println", "(", ")", ";", "}", "}", "</s>" ]
10,449
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "util", ";", "public", "class", "UserComparator", "{", "}", "</s>" ]
10,450
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "util", ";", "import", "java", ".", "util", ".", "Comparator", ";", "import", "benedictoxvi", ".", "pe", ".", "data", ".", "Compra", ";", "public", "class", "CompraComparator", "implements", "Comparator", "<", "Compra", ">", "{", "Validaciones", "objValidaciones", "=", "new", "Validaciones", "(", ")", ";", "@", "Override", "public", "int", "compare", "(", "Compra", "o1", ",", "Compra", "o2", ")", "{", "return", "(", "-", "1", "*", "(", "objValidaciones", ".", "dateToInt", "(", "o1", ".", "getFecVencim", "(", ")", ")", "-", "objValidaciones", ".", "dateToInt", "(", "o2", ".", "getFecVencim", "(", ")", ")", ")", ")", ";", "}", "}", "</s>" ]
10,451
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "util", ";", "public", "interface", "Checker", "<", "T", ">", "{", "public", "boolean", "check", "(", "T", "obj", ")", ";", "}", "</s>" ]
10,452
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "util", ";", "public", "class", "FormatException", "extends", "Exception", "{", "private", "static", "final", "long", "serialVersionUID", "=", "7086572473114990528L", ";", "public", "FormatException", "(", ")", "{", "super", "(", ")", ";", "}", "public", "FormatException", "(", "String", "message", ",", "Throwable", "cause", ",", "boolean", "enableSuppression", ",", "boolean", "writableStackTrace", ")", "{", "}", "public", "FormatException", "(", "String", "message", ",", "Throwable", "cause", ")", "{", "super", "(", "message", ",", "cause", ")", ";", "System", ".", "out", ".", "println", "(", "\"-----\"", ")", ";", "}", "public", "FormatException", "(", "String", "message", ")", "{", "super", "(", "message", ")", ";", "}", "public", "FormatException", "(", "Throwable", "cause", ")", "{", "super", "(", "cause", ")", ";", "}", "@", "Override", "public", "void", "printStackTrace", "(", ")", "{", "String", "method1", "=", "(", "(", "StackTraceElement", ")", "this", ".", "getStackTrace", "(", ")", "[", "0", "]", ")", ".", "getMethodName", "(", ")", ";", "String", "method2", "=", "(", "(", "StackTraceElement", ")", "this", ".", "getStackTrace", "(", ")", "[", "1", "]", ")", ".", "getMethodName", "(", ")", ";", "System", ".", "err", ".", "println", "(", "\"n\"", "+", "method2", "+", "\"[\"", "+", "method1", "+", "\"]\"", "+", "\"", ":", "\"", "+", "this", ".", "getMessage", "(", ")", ")", ";", "}", "}", "</s>" ]
10,453
[ "<s>", "package", "benedictoxvi", ".", "pe", ".", "util", ";", "import", "java", ".", "io", ".", "BufferedReader", ";", "import", "java", ".", "io", ".", "DataInputStream", ";", "import", "java", ".", "io", ".", "FileInputStream", ";", "import", "java", ".", "io", ".", "InputStreamReader", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "public", "class", "Loader", "{", "public", "ArrayList", "<", "String", "[", "]", ">", "getDataTxt", "(", "String", "path", ")", "{", "ArrayList", "<", "String", "[", "]", ">", "c_file", "=", "new", "ArrayList", "<", "String", "[", "]", ">", "(", ")", ";", "try", "{", "FileInputStream", "fstream", "=", "new", "FileInputStream", "(", "path", ".", "replaceAll", "(", "\"%20\"", ",", "\"", "\"", ")", ")", ";", "DataInputStream", "in", "=", "new", "DataInputStream", "(", "fstream", ")", ";", "BufferedReader", "br", "=", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "in", ")", ")", ";", "String", "strLine", ";", "while", "(", "(", "strLine", "=", "br", ".", "readLine", "(", ")", ")", "!=", "null", ")", "{", "c_file", ".", "add", "(", "strLine", ".", "split", "(", "\"t\"", ")", ")", ";", "}", "in", ".", "close", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "return", "c_file", ";", "}", "}", "</s>" ]
10,454
[ "<s>", "package", "org", ".", "gildedrose", ".", "qualitycontrol", ";", "import", "static", "org", ".", "gildedrose", ".", "builder", ".", "ItemBuilder", ".", "anItem", ";", "import", "static", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "QualityControlFactory", ".", "BACKSTAGE_PASS_ITEM_NAME", ";", "import", "static", "org", ".", "hamcrest", ".", "core", ".", "Is", ".", "is", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "org", ".", "gildedrose", ".", "Item", ";", "import", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "BackstagePassQualityControl", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "public", "class", "BackstagePassQualityControlTest", "{", "private", "static", "final", "int", "TWENTY_DAYS", "=", "20", ";", "private", "static", "final", "int", "TEN_DAYS", "=", "10", ";", "private", "static", "final", "int", "FIVE_DAYS", "=", "5", ";", "private", "static", "final", "int", "ZERO_DAYS", "=", "0", ";", "private", "BackstagePassQualityControl", "qualityControl", ";", "private", "Item", "backstagePass", ";", "@", "Before", "public", "void", "initialise", "(", ")", "{", "qualityControl", "=", "new", "BackstagePassQualityControl", "(", ")", ";", "backstagePass", "=", "anItem", "(", ")", ".", "withName", "(", "BACKSTAGE_PASS_ITEM_NAME", ")", ".", "build", "(", ")", ";", "}", "@", "Test", "public", "void", "shouldIncreaseQualityAsDaysGoBy", "(", ")", "{", "backstagePass", ".", "setSellIn", "(", "TWENTY_DAYS", ")", ";", "backstagePass", ".", "setQuality", "(", "10", ")", ";", "qualityControl", ".", "updateQualityFor", "(", "backstagePass", ")", ";", "assertThat", "(", "backstagePass", ".", "getQuality", "(", ")", ",", "is", "(", "11", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldIncreaseQualityByTwoWhenNeedsToBeSoldInTenDaysOrLess", "(", ")", "{", "backstagePass", ".", "setSellIn", "(", "TEN_DAYS", ")", ";", "backstagePass", ".", "setQuality", "(", "10", ")", ";", "qualityControl", ".", "updateQualityFor", "(", "backstagePass", ")", ";", "assertThat", "(", "backstagePass", ".", "getQuality", "(", ")", ",", "is", "(", "12", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldIncreaseQualityByThreeWhenNeedsToBeSoldInFiveDaysOrLess", "(", ")", "{", "backstagePass", ".", "setSellIn", "(", "FIVE_DAYS", ")", ";", "backstagePass", ".", "setQuality", "(", "10", ")", ";", "qualityControl", ".", "updateQualityFor", "(", "backstagePass", ")", ";", "assertThat", "(", "backstagePass", ".", "getQuality", "(", ")", ",", "is", "(", "13", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldSetQualityToZeroAfterConcert", "(", ")", "{", "backstagePass", ".", "setSellIn", "(", "ZERO_DAYS", ")", ";", "backstagePass", ".", "setQuality", "(", "10", ")", ";", "qualityControl", ".", "updateQualityFor", "(", "backstagePass", ")", ";", "assertThat", "(", "backstagePass", ".", "getQuality", "(", ")", ",", "is", "(", "0", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldNeverIncreaseQualityToMoreThanFifty", "(", ")", "{", "backstagePass", ".", "setSellIn", "(", "FIVE_DAYS", ")", ";", "backstagePass", ".", "setQuality", "(", "50", ")", ";", "qualityControl", ".", "updateQualityFor", "(", "backstagePass", ")", ";", "assertThat", "(", "backstagePass", ".", "getQuality", "(", ")", ",", "is", "(", "50", ")", ")", ";", "}", "}", "</s>" ]
10,455
[ "<s>", "package", "org", ".", "gildedrose", ".", "qualitycontrol", ";", "import", "static", "org", ".", "gildedrose", ".", "builder", ".", "ItemBuilder", ".", "anItem", ";", "import", "static", "org", ".", "hamcrest", ".", "core", ".", "Is", ".", "is", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "org", ".", "gildedrose", ".", "Item", ";", "import", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "SulfurasQualityControl", ";", "import", "org", ".", "junit", ".", "Test", ";", "public", "class", "SulfurasQualityControlTest", "{", "private", "SulfurasQualityControl", "sulfurasQualityControl", "=", "new", "SulfurasQualityControl", "(", ")", ";", "@", "Test", "public", "void", "shouldNeverChangeQuality", "(", ")", "{", "Item", "sulfuras", "=", "anItem", "(", ")", ".", "withName", "(", "\"\"", ")", ".", "withQuality", "(", "20", ")", ".", "withSellIn", "(", "10", ")", ".", "build", "(", ")", ";", "sulfurasQualityControl", ".", "updateQualityFor", "(", "sulfuras", ")", ";", "assertThat", "(", "sulfuras", ".", "getQuality", "(", ")", ",", "is", "(", "20", ")", ")", ";", "}", "}", "</s>" ]
10,456
[ "<s>", "package", "org", ".", "gildedrose", ".", "qualitycontrol", ";", "import", "static", "org", ".", "gildedrose", ".", "builder", ".", "ItemBuilder", ".", "anItem", ";", "import", "static", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "QualityControlFactory", ".", "AGED_BRIE_ITEM_NAME", ";", "import", "static", "org", ".", "hamcrest", ".", "core", ".", "Is", ".", "is", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "org", ".", "gildedrose", ".", "Item", ";", "import", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "AgedBrieQualityControl", ";", "import", "org", ".", "junit", ".", "Test", ";", "public", "class", "AgedBrieQualityControlTest", "{", "private", "static", "final", "String", "AGED_BRIE", "=", "AGED_BRIE_ITEM_NAME", ";", "private", "AgedBrieQualityControl", "agedBrieQualityControl", "=", "new", "AgedBrieQualityControl", "(", ")", ";", "@", "Test", "public", "void", "shouldIncreaseAgedBrieWheverItGetsOlder", "(", ")", "{", "Item", "agedBrie", "=", "anItem", "(", ")", ".", "withName", "(", "AGED_BRIE", ")", ".", "withQuality", "(", "10", ")", ".", "build", "(", ")", ";", "agedBrieQualityControl", ".", "updateQualityFor", "(", "agedBrie", ")", ";", "assertThat", "(", "agedBrie", ".", "getQuality", "(", ")", ",", "is", "(", "11", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldNeverIncreaseTheQualityToMoreThanFifty", "(", ")", "{", "Item", "agedBrie", "=", "anItem", "(", ")", ".", "withName", "(", "\"Aged", "Brie\"", ")", ".", "withQuality", "(", "50", ")", ".", "build", "(", ")", ";", "agedBrieQualityControl", ".", "updateQualityFor", "(", "agedBrie", ")", ";", "assertThat", "(", "agedBrie", ".", "getQuality", "(", ")", ",", "is", "(", "50", ")", ")", ";", "}", "}", "</s>" ]
10,457
[ "<s>", "package", "org", ".", "gildedrose", ".", "qualitycontrol", ";", "import", "static", "org", ".", "gildedrose", ".", "builder", ".", "ItemBuilder", ".", "anItem", ";", "import", "static", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "QualityControlFactory", ".", "CONJURED_ITEM_NAME", ";", "import", "static", "org", ".", "hamcrest", ".", "core", ".", "Is", ".", "is", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "org", ".", "gildedrose", ".", "Item", ";", "import", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "ConjuredQualityControl", ";", "import", "org", ".", "junit", ".", "Test", ";", "public", "class", "ConjuredQualityControlTest", "{", "private", "ConjuredQualityControl", "conjuredQualityControl", "=", "new", "ConjuredQualityControl", "(", ")", ";", "@", "Test", "public", "void", "shouldDecreaseQualityByTwoForAllConjuredItems", "(", ")", "{", "Item", "conjured", "=", "anItem", "(", ")", ".", "withName", "(", "CONJURED_ITEM_NAME", ")", ".", "withQuality", "(", "20", ")", ".", "withSellIn", "(", "10", ")", ".", "build", "(", ")", ";", "conjuredQualityControl", ".", "updateQualityFor", "(", "conjured", ")", ";", "assertThat", "(", "conjured", ".", "getQuality", "(", ")", ",", "is", "(", "18", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldNeverSetQualityForLessThanZero", "(", ")", "{", "Item", "conjured", "=", "anItem", "(", ")", ".", "withName", "(", "CONJURED_ITEM_NAME", ")", ".", "withQuality", "(", "0", ")", ".", "withSellIn", "(", "10", ")", ".", "build", "(", ")", ";", "conjuredQualityControl", ".", "updateQualityFor", "(", "conjured", ")", ";", "assertThat", "(", "conjured", ".", "getQuality", "(", ")", ",", "is", "(", "0", ")", ")", ";", "}", "}", "</s>" ]
10,458
[ "<s>", "package", "org", ".", "gildedrose", ".", "qualitycontrol", ";", "import", "static", "org", ".", "gildedrose", ".", "builder", ".", "ItemBuilder", ".", "anItem", ";", "import", "static", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "QualityControlFactory", ".", "AGED_BRIE_ITEM_NAME", ";", "import", "static", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "QualityControlFactory", ".", "BACKSTAGE_PASS_ITEM_NAME", ";", "import", "static", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "QualityControlFactory", ".", "CONJURED_ITEM_NAME", ";", "import", "static", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "QualityControlFactory", ".", "SULFURAS_ITEM_NAME", ";", "import", "static", "org", ".", "hamcrest", ".", "Matchers", ".", "instanceOf", ";", "import", "static", "org", ".", "hamcrest", ".", "core", ".", "Is", ".", "is", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "AgedBrieQualityControl", ";", "import", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "BackstagePassQualityControl", ";", "import", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "ConjuredQualityControl", ";", "import", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "DefaultQualityControl", ";", "import", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "QualityControl", ";", "import", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "QualityControlFactory", ";", "import", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "SulfurasQualityControl", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "public", "class", "QualityControlFactoryTest", "{", "private", "QualityControlFactory", "factory", ";", "@", "Before", "public", "void", "initialise", "(", ")", "{", "factory", "=", "new", "QualityControlFactory", "(", ")", ";", "}", "@", "Test", "public", "void", "shouldReturnDefaultQualityControlStrategy", "(", ")", "{", "QualityControl", "qualityControl", "=", "factory", ".", "qualityControlFor", "(", "anItem", "(", ")", ".", "build", "(", ")", ")", ";", "assertThat", "(", "qualityControl", ",", "is", "(", "instanceOf", "(", "DefaultQualityControl", ".", "class", ")", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldReturnBackstageQualityControlWhenItemIsABackstatePass", "(", ")", "{", "QualityControl", "qualityControl", "=", "factory", ".", "qualityControlFor", "(", "anItem", "(", ")", ".", "withName", "(", "BACKSTAGE_PASS_ITEM_NAME", ")", ".", "build", "(", ")", ")", ";", "assertThat", "(", "qualityControl", ",", "is", "(", "instanceOf", "(", "BackstagePassQualityControl", ".", "class", ")", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldReturnSulfurasQualityControlWhenItemIsASulfuras", "(", ")", "{", "QualityControl", "qualityControl", "=", "factory", ".", "qualityControlFor", "(", "anItem", "(", ")", ".", "withName", "(", "SULFURAS_ITEM_NAME", ")", ".", "build", "(", ")", ")", ";", "assertThat", "(", "qualityControl", ",", "is", "(", "instanceOf", "(", "SulfurasQualityControl", ".", "class", ")", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldReturnAgedBrieQualityControlWhenItemIsAgedBrie", "(", ")", "{", "QualityControl", "qualityControl", "=", "factory", ".", "qualityControlFor", "(", "anItem", "(", ")", ".", "withName", "(", "AGED_BRIE_ITEM_NAME", ")", ".", "build", "(", ")", ")", ";", "assertThat", "(", "qualityControl", ",", "is", "(", "instanceOf", "(", "AgedBrieQualityControl", ".", "class", ")", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldReturnConjuredQualityControlWhenItemIsConjured", "(", ")", "{", "QualityControl", "qualityControl", "=", "factory", ".", "qualityControlFor", "(", "anItem", "(", ")", ".", "withName", "(", "CONJURED_ITEM_NAME", ")", ".", "build", "(", ")", ")", ";", "assertThat", "(", "qualityControl", ",", "is", "(", "instanceOf", "(", "ConjuredQualityControl", ".", "class", ")", ")", ")", ";", "}", "}", "</s>" ]
10,459
[ "<s>", "package", "org", ".", "gildedrose", ";", "import", "static", "org", ".", "gildedrose", ".", "builder", ".", "ItemBuilder", ".", "anItem", ";", "import", "static", "org", ".", "mockito", ".", "Mockito", ".", "verify", ";", "import", "static", "org", ".", "mockito", ".", "Mockito", ".", "when", ";", "import", "java", ".", "util", ".", "Arrays", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "DefaultQualityControl", ";", "import", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "QualityControlFactory", ";", "import", "org", ".", "gildedrose", ".", "sellincontrol", ".", "SellInControl", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "junit", ".", "runner", ".", "RunWith", ";", "import", "org", ".", "mockito", ".", "Mock", ";", "import", "org", ".", "mockito", ".", "Mockito", ";", "import", "org", ".", "mockito", ".", "runners", ".", "MockitoJUnitRunner", ";", "@", "RunWith", "(", "MockitoJUnitRunner", ".", "class", ")", "public", "class", "GildedRoseTest", "{", "@", "Mock", "private", "QualityControlFactory", "qualityControlFactory", ";", "@", "Mock", "private", "DefaultQualityControl", "qualityControl", ";", "@", "Mock", "private", "SellInControl", "sellInControl", ";", "private", "GildedRose", "gildedRose", ";", "private", "Item", "item2", ";", "private", "Item", "item1", ";", "@", "Before", "public", "void", "initialise", "(", ")", "{", "when", "(", "qualityControlFactory", ".", "qualityControlFor", "(", "Mockito", ".", "any", "(", "Item", ".", "class", ")", ")", ")", ".", "thenReturn", "(", "qualityControl", ")", ";", "gildedRose", "=", "new", "GildedRose", "(", "qualityControlFactory", ",", "sellInControl", ")", ";", "item1", "=", "anItem", "(", ")", ".", "build", "(", ")", ";", "item2", "=", "anItem", "(", ")", ".", "build", "(", ")", ";", "}", "@", "Test", "public", "void", "shouldUpdateItemsQuality", "(", ")", "{", "gildedRose", ".", "updateQualityFor", "(", "listContaining", "(", "item1", ",", "item2", ")", ")", ";", "verifyIfQualityWasUpdatedFor", "(", "item1", ",", "item2", ")", ";", "}", "@", "Test", "public", "void", "shouldUpdateItemsSellIn", "(", ")", "{", "gildedRose", ".", "updateQualityFor", "(", "listContaining", "(", "item1", ",", "item2", ")", ")", ";", "verifyIfSellInWasUpdatedFor", "(", "item1", ",", "item2", ")", ";", "}", "private", "void", "verifyIfSellInWasUpdatedFor", "(", "Item", "...", "items", ")", "{", "for", "(", "Item", "item", ":", "items", ")", "{", "verify", "(", "sellInControl", ")", ".", "updateSellInFor", "(", "item", ")", ";", "}", "}", "private", "void", "verifyIfQualityWasUpdatedFor", "(", "Item", "...", "items", ")", "{", "for", "(", "Item", "item", ":", "items", ")", "{", "verify", "(", "qualityControl", ")", ".", "updateQualityFor", "(", "item", ")", ";", "}", "}", "private", "List", "<", "Item", ">", "listContaining", "(", "Item", "...", "items", ")", "{", "return", "Arrays", ".", "asList", "(", "items", ")", ";", "}", "}", "</s>" ]
10,460
[ "<s>", "package", "org", ".", "gildedrose", ".", "sellincontrol", ";", "import", "static", "org", ".", "gildedrose", ".", "builder", ".", "ItemBuilder", ".", "anItem", ";", "import", "static", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "QualityControlFactory", ".", "SULFURAS_ITEM_NAME", ";", "import", "static", "org", ".", "hamcrest", ".", "core", ".", "Is", ".", "is", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "org", ".", "gildedrose", ".", "Item", ";", "import", "org", ".", "gildedrose", ".", "sellincontrol", ".", "SellInControl", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "public", "class", "SellInControlTest", "{", "private", "SellInControl", "sellInControl", ";", "@", "Before", "public", "void", "initialise", "(", ")", "{", "sellInControl", "=", "new", "SellInControl", "(", ")", ";", "}", "@", "Test", "public", "void", "shouldDecreaseSellInInOne", "(", ")", "{", "Item", "item", "=", "anItem", "(", ")", ".", "withName", "(", "\"\"", ")", ".", "withSellIn", "(", "10", ")", ".", "build", "(", ")", ";", "sellInControl", ".", "updateSellInFor", "(", "item", ")", ";", "assertThat", "(", "item", ".", "getSellIn", "(", ")", ",", "is", "(", "9", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldNotDecreaseSellInForSulfuras", "(", ")", "{", "Item", "item", "=", "anItem", "(", ")", ".", "withName", "(", "SULFURAS_ITEM_NAME", ")", ".", "withSellIn", "(", "10", ")", ".", "build", "(", ")", ";", "sellInControl", ".", "updateSellInFor", "(", "item", ")", ";", "assertThat", "(", "item", ".", "getSellIn", "(", ")", ",", "is", "(", "10", ")", ")", ";", "}", "}", "</s>" ]
10,461
[ "<s>", "package", "org", ".", "gildedrose", ".", "qualitycontrol", ";", "import", "org", ".", "gildedrose", ".", "Item", ";", "public", "class", "QualityControlFactory", "{", "public", "static", "final", "String", "BACKSTAGE_PASS_ITEM_NAME", "=", "\"\"", ";", "public", "static", "final", "String", "SULFURAS_ITEM_NAME", "=", "\"\"", ";", "public", "static", "final", "String", "AGED_BRIE_ITEM_NAME", "=", "\"Aged", "Brie\"", ";", "public", "static", "final", "String", "CONJURED_ITEM_NAME", "=", "\"\"", ";", "private", "static", "enum", "ItemQualityControl", "{", "AGED_BRIE", "(", "AGED_BRIE_ITEM_NAME", ",", "new", "AgedBrieQualityControl", "(", ")", ")", ",", "CONJURED", "(", "CONJURED_ITEM_NAME", ",", "new", "ConjuredQualityControl", "(", ")", ")", ",", "BACKSTAGE_PASS", "(", "BACKSTAGE_PASS_ITEM_NAME", ",", "new", "BackstagePassQualityControl", "(", ")", ")", ",", "SULFURAS", "(", "SULFURAS_ITEM_NAME", ",", "new", "SulfurasQualityControl", "(", ")", ")", ";", "private", "String", "itemName", ";", "private", "QualityControl", "qualityControl", ";", "private", "ItemQualityControl", "(", "String", "itemName", ",", "QualityControl", "qualityControl", ")", "{", "this", ".", "itemName", "=", "itemName", ";", "this", ".", "qualityControl", "=", "qualityControl", ";", "}", "public", "static", "QualityControl", "qualityControlFor", "(", "Item", "item", ")", "{", "for", "(", "ItemQualityControl", "itemQualityControl", ":", "ItemQualityControl", ".", "values", "(", ")", ")", "{", "if", "(", "itemQualityControl", ".", "itemName", ".", "equals", "(", "item", ".", "getName", "(", ")", ")", ")", "{", "return", "itemQualityControl", ".", "qualityControl", ";", "}", "}", "return", "new", "DefaultQualityControl", "(", ")", ";", "}", "}", "public", "QualityControl", "qualityControlFor", "(", "Item", "item", ")", "{", "return", "ItemQualityControl", ".", "qualityControlFor", "(", "item", ")", ";", "}", "}", "</s>" ]
10,462
[ "<s>", "package", "org", ".", "gildedrose", ".", "qualitycontrol", ";", "import", "org", ".", "gildedrose", ".", "Item", ";", "public", "class", "DefaultQualityControl", "implements", "QualityControl", "{", "public", "void", "updateQualityFor", "(", "Item", "item", ")", "{", "item", ".", "setQuality", "(", "item", ".", "getQuality", "(", ")", "-", "qualityDropFor", "(", "item", ")", ")", ";", "}", "private", "int", "qualityDropFor", "(", "Item", "item", ")", "{", "int", "defaultQualityDrop", "=", "defaultQualityDropFor", "(", "item", ")", ";", "return", "item", ".", "getQuality", "(", ")", "-", "defaultQualityDrop", ">=", "0", "?", "defaultQualityDrop", ":", "item", ".", "getQuality", "(", ")", ";", "}", "private", "int", "defaultQualityDropFor", "(", "Item", "item", ")", "{", "return", "item", ".", "getSellIn", "(", ")", "<", "0", "?", "DEFAULT_QUALITY_DROP", "*", "2", ":", "DEFAULT_QUALITY_DROP", ";", "}", "}", "</s>" ]
10,463
[ "<s>", "package", "org", ".", "gildedrose", ".", "qualitycontrol", ";", "import", "static", "java", ".", "lang", ".", "Math", ".", "min", ";", "import", "org", ".", "gildedrose", ".", "Item", ";", "public", "class", "BackstagePassQualityControl", "implements", "QualityControl", "{", "private", "static", "final", "int", "ELEVE_DAYS", "=", "11", ";", "private", "static", "final", "int", "FIVE_DAYS", "=", "5", ";", "private", "static", "final", "int", "NO_EXTRA_QUALITY_HIKE", "=", "0", ";", "private", "static", "final", "int", "DOUBLE_EXTRA_QUALITY_HIKE", "=", "2", ";", "private", "static", "final", "int", "EXTRA_QUALITY_HIKE", "=", "1", ";", "public", "void", "updateQualityFor", "(", "Item", "backstagePass", ")", "{", "backstagePass", ".", "setQuality", "(", "newQualityFor", "(", "backstagePass", ")", ")", ";", "}", "private", "int", "newQualityFor", "(", "Item", "backstagePass", ")", "{", "return", "backstagePass", ".", "getSellIn", "(", ")", ">", "0", "?", "min", "(", "backstagePass", ".", "getQuality", "(", ")", "+", "qualityHikeFor", "(", "backstagePass", ")", ",", "MAX_QUALITY_ALLOWED", ")", ":", "0", ";", "}", "private", "int", "qualityHikeFor", "(", "Item", "backstagePass", ")", "{", "return", "DEFAULT_QUALITY_HIKE", "+", "extraQualityFor", "(", "backstagePass", ")", ";", "}", "private", "int", "extraQualityFor", "(", "Item", "backstagePass", ")", "{", "if", "(", "concertIsWithinSixAndTenDays", "(", "backstagePass", ")", ")", "{", "return", "EXTRA_QUALITY_HIKE", ";", "}", "else", "if", "(", "concertIsInFiveOrLessDays", "(", "backstagePass", ")", ")", "{", "return", "DOUBLE_EXTRA_QUALITY_HIKE", ";", "}", "return", "NO_EXTRA_QUALITY_HIKE", ";", "}", "private", "boolean", "concertIsInFiveOrLessDays", "(", "Item", "backstagePass", ")", "{", "return", "backstagePass", ".", "getSellIn", "(", ")", "<=", "FIVE_DAYS", ";", "}", "private", "boolean", "concertIsWithinSixAndTenDays", "(", "Item", "backstagePass", ")", "{", "return", "backstagePass", ".", "getSellIn", "(", ")", ">", "FIVE_DAYS", "&&", "backstagePass", ".", "getSellIn", "(", ")", "<", "ELEVE_DAYS", ";", "}", "}", "</s>" ]
10,464
[ "<s>", "package", "org", ".", "gildedrose", ".", "qualitycontrol", ";", "import", "org", ".", "gildedrose", ".", "Item", ";", "public", "class", "SulfurasQualityControl", "implements", "QualityControl", "{", "public", "void", "updateQualityFor", "(", "Item", "item", ")", "{", "}", "}", "</s>" ]
10,465
[ "<s>", "package", "org", ".", "gildedrose", ".", "qualitycontrol", ";", "import", "org", ".", "gildedrose", ".", "Item", ";", "public", "class", "ConjuredQualityControl", "implements", "QualityControl", "{", "private", "static", "final", "int", "CONJURED_QUALITY_DROP", "=", "DEFAULT_QUALITY_DROP", "*", "2", ";", "public", "void", "updateQualityFor", "(", "Item", "item", ")", "{", "item", ".", "setQuality", "(", "item", ".", "getQuality", "(", ")", "-", "qualityDropFor", "(", "item", ")", ")", ";", "}", "private", "int", "qualityDropFor", "(", "Item", "item", ")", "{", "return", "item", ".", "getQuality", "(", ")", "-", "CONJURED_QUALITY_DROP", ">", "0", "?", "CONJURED_QUALITY_DROP", ":", "item", ".", "getQuality", "(", ")", ";", "}", "}", "</s>" ]
10,466
[ "<s>", "package", "org", ".", "gildedrose", ".", "qualitycontrol", ";", "import", "org", ".", "gildedrose", ".", "Item", ";", "public", "interface", "QualityControl", "{", "int", "MAX_QUALITY_ALLOWED", "=", "50", ";", "int", "DEFAULT_QUALITY_HIKE", "=", "1", ";", "int", "DEFAULT_QUALITY_DROP", "=", "1", ";", "void", "updateQualityFor", "(", "Item", "item", ")", ";", "}", "</s>" ]
10,467
[ "<s>", "package", "org", ".", "gildedrose", ".", "qualitycontrol", ";", "import", "static", "java", ".", "lang", ".", "Math", ".", "min", ";", "import", "org", ".", "gildedrose", ".", "Item", ";", "public", "class", "AgedBrieQualityControl", "implements", "QualityControl", "{", "public", "void", "updateQualityFor", "(", "Item", "item", ")", "{", "item", ".", "setQuality", "(", "newQualityFor", "(", "item", ")", ")", ";", "}", "private", "int", "newQualityFor", "(", "Item", "item", ")", "{", "return", "min", "(", "item", ".", "getQuality", "(", ")", "+", "DEFAULT_QUALITY_HIKE", ",", "MAX_QUALITY_ALLOWED", ")", ";", "}", "}", "</s>" ]
10,468
[ "<s>", "package", "org", ".", "gildedrose", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "QualityControl", ";", "import", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "QualityControlFactory", ";", "import", "org", ".", "gildedrose", ".", "sellincontrol", ".", "SellInControl", ";", "public", "class", "GildedRose", "{", "private", "QualityControlFactory", "qualityControlFactory", ";", "private", "SellInControl", "sellInControl", ";", "public", "GildedRose", "(", "QualityControlFactory", "qualityControl", ",", "SellInControl", "sellInControl", ")", "{", "this", ".", "qualityControlFactory", "=", "qualityControl", ";", "this", ".", "sellInControl", "=", "sellInControl", ";", "}", "public", "void", "updateQualityFor", "(", "List", "<", "Item", ">", "items", ")", "{", "for", "(", "Item", "item", ":", "items", ")", "{", "udpateSellInFor", "(", "item", ")", ";", "updateQualityFor", "(", "item", ")", ";", "}", "}", "private", "void", "updateQualityFor", "(", "Item", "item", ")", "{", "QualityControl", "qualityControl", "=", "qualityControlFactory", ".", "qualityControlFor", "(", "item", ")", ";", "qualityControl", ".", "updateQualityFor", "(", "item", ")", ";", "}", "private", "void", "udpateSellInFor", "(", "Item", "item", ")", "{", "sellInControl", ".", "updateSellInFor", "(", "item", ")", ";", "}", "}", "</s>" ]
10,469
[ "<s>", "package", "org", ".", "gildedrose", ".", "sellincontrol", ";", "import", "static", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "QualityControlFactory", ".", "SULFURAS_ITEM_NAME", ";", "import", "org", ".", "gildedrose", ".", "Item", ";", "public", "class", "SellInControl", "{", "private", "static", "final", "int", "DEFAULT_DECREASE", "=", "1", ";", "private", "static", "final", "int", "NO_DECREASE", "=", "0", ";", "public", "void", "updateSellInFor", "(", "Item", "item", ")", "{", "item", ".", "setSellIn", "(", "item", ".", "getSellIn", "(", ")", "-", "sellInDecreaseFor", "(", "item", ")", ")", ";", "}", "private", "int", "sellInDecreaseFor", "(", "Item", "item", ")", "{", "return", "SULFURAS_ITEM_NAME", ".", "equals", "(", "item", ".", "getName", "(", ")", ")", "?", "NO_DECREASE", ":", "DEFAULT_DECREASE", ";", "}", "}", "</s>" ]
10,470
[ "<s>", "package", "org", ".", "gildedrose", ".", "builder", ";", "import", "org", ".", "gildedrose", ".", "Item", ";", "public", "class", "ItemBuilder", "{", "private", "String", "name", ";", "private", "int", "sellIn", "=", "1", ";", "private", "int", "quality", "=", "1", ";", "public", "static", "ItemBuilder", "anItem", "(", ")", "{", "return", "new", "ItemBuilder", "(", ")", ";", "}", "public", "ItemBuilder", "withQuality", "(", "int", "quality", ")", "{", "this", ".", "quality", "=", "quality", ";", "return", "this", ";", "}", "public", "ItemBuilder", "withSellIn", "(", "int", "sellIn", ")", "{", "this", ".", "sellIn", "=", "sellIn", ";", "return", "this", ";", "}", "public", "ItemBuilder", "withName", "(", "String", "name", ")", "{", "this", ".", "name", "=", "name", ";", "return", "this", ";", "}", "public", "Item", "build", "(", ")", "{", "return", "new", "Item", "(", "name", ",", "sellIn", ",", "quality", ")", ";", "}", "}", "</s>" ]
10,471
[ "<s>", "package", "org", ".", "gildedrose", ".", "jbehave", ";", "import", "static", "java", ".", "util", ".", "Arrays", ".", "asList", ";", "import", "static", "org", ".", "jbehave", ".", "core", ".", "io", ".", "CodeLocations", ".", "codeLocationFromClass", ";", "import", "static", "org", ".", "jbehave", ".", "core", ".", "reporters", ".", "Format", ".", "CONSOLE", ";", "import", "static", "org", ".", "jbehave", ".", "core", ".", "reporters", ".", "Format", ".", "TXT", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "gildedrose", ".", "jbehave", ".", "steps", ".", "UpdateItemsQualitySteps", ";", "import", "org", ".", "jbehave", ".", "core", ".", "configuration", ".", "Configuration", ";", "import", "org", ".", "jbehave", ".", "core", ".", "configuration", ".", "MostUsefulConfiguration", ";", "import", "org", ".", "jbehave", ".", "core", ".", "io", ".", "LoadFromClasspath", ";", "import", "org", ".", "jbehave", ".", "core", ".", "io", ".", "StoryFinder", ";", "import", "org", ".", "jbehave", ".", "core", ".", "junit", ".", "JUnitStories", ";", "import", "org", ".", "jbehave", ".", "core", ".", "reporters", ".", "StoryReporterBuilder", ";", "import", "org", ".", "jbehave", ".", "core", ".", "steps", ".", "CandidateSteps", ";", "import", "org", ".", "jbehave", ".", "core", ".", "steps", ".", "InstanceStepsFactory", ";", "public", "class", "GildedRoseStories", "extends", "JUnitStories", "{", "public", "GildedRoseStories", "(", ")", "{", "}", "@", "Override", "public", "Configuration", "configuration", "(", ")", "{", "return", "new", "MostUsefulConfiguration", "(", ")", ".", "useStoryLoader", "(", "new", "LoadFromClasspath", "(", "this", ".", "getClass", "(", ")", ")", ")", ".", "useStoryReporterBuilder", "(", "new", "StoryReporterBuilder", "(", ")", ".", "withDefaultFormats", "(", ")", ".", "withFormats", "(", "CONSOLE", ",", "TXT", ")", ")", ";", "}", "@", "Override", "protected", "List", "<", "String", ">", "storyPaths", "(", ")", "{", "return", "new", "StoryFinder", "(", ")", ".", "findPaths", "(", "codeLocationFromClass", "(", "this", ".", "getClass", "(", ")", ")", ".", "getFile", "(", ")", ",", "asList", "(", "\"**/\"", "+", "System", ".", "getProperty", "(", "\"storyFilter\"", ",", "\"*\"", ")", "+", "\".story\"", ")", ",", "null", ")", ";", "}", "@", "Override", "public", "List", "<", "CandidateSteps", ">", "candidateSteps", "(", ")", "{", "return", "new", "InstanceStepsFactory", "(", "configuration", "(", ")", ",", "new", "UpdateItemsQualitySteps", "(", ")", ")", ".", "createCandidateSteps", "(", ")", ";", "}", "}", "</s>" ]
10,472
[ "<s>", "package", "org", ".", "gildedrose", ".", "jbehave", ".", "steps", ";", "import", "static", "java", ".", "util", ".", "Arrays", ".", "asList", ";", "import", "static", "org", ".", "gildedrose", ".", "builder", ".", "ItemBuilder", ".", "anItem", ";", "import", "static", "org", ".", "hamcrest", ".", "core", ".", "Is", ".", "is", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "org", ".", "gildedrose", ".", "GildedRose", ";", "import", "org", ".", "gildedrose", ".", "Item", ";", "import", "org", ".", "gildedrose", ".", "qualitycontrol", ".", "QualityControlFactory", ";", "import", "org", ".", "gildedrose", ".", "sellincontrol", ".", "SellInControl", ";", "import", "org", ".", "jbehave", ".", "core", ".", "annotations", ".", "BeforeStory", ";", "import", "org", ".", "jbehave", ".", "core", ".", "annotations", ".", "Given", ";", "import", "org", ".", "jbehave", ".", "core", ".", "annotations", ".", "Named", ";", "import", "org", ".", "jbehave", ".", "core", ".", "annotations", ".", "Then", ";", "import", "org", ".", "jbehave", ".", "core", ".", "annotations", ".", "When", ";", "public", "class", "UpdateItemsQualitySteps", "{", "private", "Item", "item", ";", "private", "GildedRose", "gildedRose", ";", "@", "BeforeStory", "public", "void", "beforeStoryDo", "(", ")", "{", "gildedRose", "=", "new", "GildedRose", "(", "new", "QualityControlFactory", "(", ")", ",", "new", "SellInControl", "(", ")", ")", ";", "}", "@", "Given", "(", "\"\"", ")", "public", "void", "givenAnItemWithNameSellInAndQualitySetTo", "(", "@", "Named", "(", "\"name\"", ")", "String", "name", ",", "@", "Named", "(", "\"sellIn\"", ")", "int", "sellIn", ",", "@", "Named", "(", "\"quality\"", ")", "int", "quality", ")", "{", "this", ".", "item", "=", "anItem", "(", ")", ".", "withName", "(", "name", ")", ".", "withSellIn", "(", "sellIn", ")", ".", "withQuality", "(", "quality", ")", ".", "build", "(", ")", ";", "}", "@", "When", "(", "\"\"", ")", "public", "void", "whenTheQualityOfTheItemIsUpdatedAfterOneDay", "(", ")", "{", "gildedRose", ".", "updateQualityFor", "(", "asList", "(", "item", ")", ")", ";", "}", "@", "Then", "(", "\"\"", ")", "public", "void", "thenSellInShouldBe", "(", "@", "Named", "(", "\"newSellIn\"", ")", "int", "newSellIn", ")", "{", "assertThat", "(", "item", ".", "getSellIn", "(", ")", ",", "is", "(", "newSellIn", ")", ")", ";", "}", "@", "Then", "(", "\"\"", ")", "public", "void", "thenQualityShouldBe", "(", "@", "Named", "(", "\"newQuality\"", ")", "int", "newQuality", ")", "{", "assertThat", "(", "item", ".", "getQuality", "(", ")", ",", "is", "(", "newQuality", ")", ")", ";", "}", "}", "</s>" ]
10,473
[ "<s>", "package", "org", ".", "gildedrose", ";", "public", "class", "Item", "{", "public", "String", "name", ";", "public", "int", "sellIn", ";", "public", "int", "quality", ";", "public", "Item", "(", "String", "name", ",", "int", "sellIn", ",", "int", "quality", ")", "{", "this", ".", "setName", "(", "name", ")", ";", "this", ".", "setSellIn", "(", "sellIn", ")", ";", "this", ".", "setQuality", "(", "quality", ")", ";", "}", "public", "String", "getName", "(", ")", "{", "return", "name", ";", "}", "public", "void", "setName", "(", "String", "name", ")", "{", "this", ".", "name", "=", "name", ";", "}", "public", "int", "getSellIn", "(", ")", "{", "return", "sellIn", ";", "}", "public", "void", "setSellIn", "(", "int", "sellIn", ")", "{", "this", ".", "sellIn", "=", "sellIn", ";", "}", "public", "int", "getQuality", "(", ")", "{", "return", "quality", ";", "}", "public", "void", "setQuality", "(", "int", "quality", ")", "{", "this", ".", "quality", "=", "quality", ";", "}", "}", "</s>" ]
10,474
[ "<s>", "package", "org", ".", "apache", ".", "thrift", ".", "maven", ";", "import", "com", ".", "google", ".", "common", ".", "collect", ".", "ImmutableList", ";", "import", "org", ".", "apache", ".", "maven", ".", "artifact", ".", "Artifact", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "util", ".", "List", ";", "public", "final", "class", "ThriftTestCompileMojo", "extends", "AbstractThriftMojo", "{", "private", "File", "thriftTestSourceRoot", ";", "private", "File", "outputDirectory", ";", "@", "Override", "protected", "void", "attachFiles", "(", ")", "{", "project", ".", "addTestCompileSourceRoot", "(", "outputDirectory", ".", "getAbsolutePath", "(", ")", ")", ";", "projectHelper", ".", "addTestResource", "(", "project", ",", "thriftTestSourceRoot", ".", "getAbsolutePath", "(", ")", ",", "ImmutableList", ".", "of", "(", "\"**/*.thrift\"", ")", ",", "ImmutableList", ".", "of", "(", ")", ")", ";", "}", "@", "Override", "protected", "List", "<", "Artifact", ">", "getDependencyArtifacts", "(", ")", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "List", "<", "Artifact", ">", "testArtifacts", "=", "project", ".", "getTestArtifacts", "(", ")", ";", "return", "testArtifacts", ";", "}", "@", "Override", "protected", "File", "getOutputDirectory", "(", ")", "{", "return", "outputDirectory", ";", "}", "@", "Override", "protected", "File", "getThriftSourceRoot", "(", ")", "{", "return", "thriftTestSourceRoot", ";", "}", "}", "</s>" ]
10,475
[ "<s>", "package", "org", ".", "apache", ".", "thrift", ".", "maven", ";", "import", "com", ".", "google", ".", "common", ".", "collect", ".", "ImmutableList", ";", "import", "org", ".", "apache", ".", "maven", ".", "artifact", ".", "Artifact", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "util", ".", "List", ";", "public", "final", "class", "ThriftCompileMojo", "extends", "AbstractThriftMojo", "{", "private", "File", "thriftSourceRoot", ";", "private", "File", "outputDirectory", ";", "@", "Override", "protected", "List", "<", "Artifact", ">", "getDependencyArtifacts", "(", ")", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "List", "<", "Artifact", ">", "compileArtifacts", "=", "project", ".", "getCompileArtifacts", "(", ")", ";", "return", "compileArtifacts", ";", "}", "@", "Override", "protected", "File", "getOutputDirectory", "(", ")", "{", "return", "outputDirectory", ";", "}", "@", "Override", "protected", "File", "getThriftSourceRoot", "(", ")", "{", "return", "thriftSourceRoot", ";", "}", "@", "Override", "protected", "void", "attachFiles", "(", ")", "{", "project", ".", "addCompileSourceRoot", "(", "outputDirectory", ".", "getAbsolutePath", "(", ")", ")", ";", "projectHelper", ".", "addResource", "(", "project", ",", "thriftSourceRoot", ".", "getAbsolutePath", "(", ")", ",", "ImmutableList", ".", "of", "(", "\"**/*.thrift\"", ")", ",", "ImmutableList", ".", "of", "(", ")", ")", ";", "}", "}", "</s>" ]
10,476
[ "<s>", "package", "org", ".", "apache", ".", "thrift", ".", "maven", ";", "import", "com", ".", "google", ".", "common", ".", "collect", ".", "ImmutableSet", ";", "import", "org", ".", "apache", ".", "maven", ".", "artifact", ".", "Artifact", ";", "import", "org", ".", "apache", ".", "maven", ".", "artifact", ".", "repository", ".", "ArtifactRepository", ";", "import", "org", ".", "apache", ".", "maven", ".", "plugin", ".", "AbstractMojo", ";", "import", "org", ".", "apache", ".", "maven", ".", "plugin", ".", "MojoExecutionException", ";", "import", "org", ".", "apache", ".", "maven", ".", "plugin", ".", "MojoFailureException", ";", "import", "org", ".", "apache", ".", "maven", ".", "project", ".", "MavenProject", ";", "import", "org", ".", "apache", ".", "maven", ".", "project", ".", "MavenProjectHelper", ";", "import", "org", ".", "codehaus", ".", "plexus", ".", "util", ".", "cli", ".", "CommandLineException", ";", "import", "org", ".", "codehaus", ".", "plexus", ".", "util", ".", "io", ".", "RawInputStreamFacade", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "FilenameFilter", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "security", ".", "MessageDigest", ";", "import", "java", ".", "security", ".", "NoSuchAlgorithmException", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "java", ".", "util", ".", "jar", ".", "JarEntry", ";", "import", "java", ".", "util", ".", "jar", ".", "JarFile", ";", "import", "static", "com", ".", "google", ".", "common", ".", "base", ".", "Join", ".", "join", ";", "import", "static", "com", ".", "google", ".", "common", ".", "base", ".", "Preconditions", ".", "checkArgument", ";", "import", "static", "com", ".", "google", ".", "common", ".", "base", ".", "Preconditions", ".", "checkNotNull", ";", "import", "static", "com", ".", "google", ".", "common", ".", "base", ".", "Preconditions", ".", "checkState", ";", "import", "static", "com", ".", "google", ".", "common", ".", "collect", ".", "Sets", ".", "newHashSet", ";", "import", "static", "java", ".", "lang", ".", "String", ".", "format", ";", "import", "static", "java", ".", "util", ".", "Arrays", ".", "asList", ";", "import", "static", "java", ".", "util", ".", "Collections", ".", "list", ";", "import", "static", "org", ".", "codehaus", ".", "plexus", ".", "util", ".", "FileUtils", ".", "cleanDirectory", ";", "import", "static", "org", ".", "codehaus", ".", "plexus", ".", "util", ".", "FileUtils", ".", "copyStreamToFile", ";", "import", "static", "org", ".", "codehaus", ".", "plexus", ".", "util", ".", "FileUtils", ".", "getFiles", ";", "abstract", "class", "AbstractThriftMojo", "extends", "AbstractMojo", "{", "private", "static", "final", "String", "THRIFT_FILE_SUFFIX", "=", "\".thrift\"", ";", "private", "static", "final", "String", "DEFAULT_INCLUDES", "=", "\"**/*\"", "+", "THRIFT_FILE_SUFFIX", ";", "protected", "MavenProject", "project", ";", "protected", "MavenProjectHelper", "projectHelper", ";", "private", "String", "thriftExecutable", ";", "private", "String", "generator", ";", "private", "File", "[", "]", "additionalThriftPathElements", "=", "new", "File", "[", "]", "{", "}", ";", "private", "File", "temporaryThriftFileDirectory", ";", "private", "ArtifactRepository", "localRepository", ";", "private", "boolean", "hashDependentPaths", ";", "private", "Set", "<", "String", ">", "includes", "=", "ImmutableSet", ".", "of", "(", "DEFAULT_INCLUDES", ")", ";", "private", "Set", "<", "String", ">", "excludes", "=", "ImmutableSet", ".", "of", "(", ")", ";", "private", "long", "staleMillis", "=", "0", ";", "private", "boolean", "checkStaleness", "=", "false", ";", "public", "void", "execute", "(", ")", "throws", "MojoExecutionException", ",", "MojoFailureException", "{", "checkParameters", "(", ")", ";", "final", "File", "thriftSourceRoot", "=", "getThriftSourceRoot", "(", ")", ";", "if", "(", "thriftSourceRoot", ".", "exists", "(", ")", ")", "{", "try", "{", "ImmutableSet", "<", "File", ">", "thriftFiles", "=", "findThriftFilesInDirectory", "(", "thriftSourceRoot", ")", ";", "final", "File", "outputDirectory", "=", "getOutputDirectory", "(", ")", ";", "ImmutableSet", "<", "File", ">", "outputFiles", "=", "findGeneratedFilesInDirectory", "(", "getOutputDirectory", "(", ")", ")", ";", "if", "(", "thriftFiles", ".", "isEmpty", "(", ")", ")", "{", "getLog", "(", ")", ".", "info", "(", "\"\"", ")", ";", "}", "else", "if", "(", "checkStaleness", "&&", "(", "(", "lastModified", "(", "thriftFiles", ")", "+", "staleMillis", ")", "<", "lastModified", "(", "outputFiles", ")", ")", ")", "{", "getLog", "(", ")", ".", "info", "(", "\"\"", ")", ";", "attachFiles", "(", ")", ";", "}", "else", "{", "ImmutableSet", "<", "File", ">", "derivedThriftPathElements", "=", "makeThriftPathFromJars", "(", "temporaryThriftFileDirectory", ",", "getDependencyArtifactFiles", "(", ")", ")", ";", "outputDirectory", ".", "mkdirs", "(", ")", ";", "cleanDirectory", "(", "outputDirectory", ")", ";", "Thrift", "thrift", "=", "new", "Thrift", ".", "Builder", "(", "thriftExecutable", ",", "outputDirectory", ")", ".", "setGenerator", "(", "generator", ")", ".", "addThriftPathElement", "(", "thriftSourceRoot", ")", ".", "addThriftPathElements", "(", "derivedThriftPathElements", ")", ".", "addThriftPathElements", "(", "asList", "(", "additionalThriftPathElements", ")", ")", ".", "addThriftFiles", "(", "thriftFiles", ")", ".", "build", "(", ")", ";", "final", "int", "exitStatus", "=", "thrift", ".", "compile", "(", ")", ";", "if", "(", "exitStatus", "!=", "0", ")", "{", "getLog", "(", ")", ".", "error", "(", "\"\"", "+", "thrift", ".", "getOutput", "(", ")", ")", ";", "getLog", "(", ")", ".", "error", "(", "\"\"", "+", "thrift", ".", "getError", "(", ")", ")", ";", "throw", "new", "MojoFailureException", "(", "\"\"", ")", ";", "}", "attachFiles", "(", ")", ";", "}", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "MojoExecutionException", "(", "\"\"", ",", "e", ")", ";", "}", "catch", "(", "IllegalArgumentException", "e", ")", "{", "throw", "new", "MojoFailureException", "(", "\"\"", "+", "e", ".", "getMessage", "(", ")", ",", "e", ")", ";", "}", "catch", "(", "CommandLineException", "e", ")", "{", "throw", "new", "MojoExecutionException", "(", "\"\"", ",", "e", ")", ";", "}", "}", "else", "{", "getLog", "(", ")", ".", "info", "(", "format", "(", "\"\"", ",", "thriftSourceRoot", ")", ")", ";", "}", "}", "ImmutableSet", "<", "File", ">", "findGeneratedFilesInDirectory", "(", "File", "directory", ")", "throws", "IOException", "{", "if", "(", "directory", "==", "null", "||", "!", "directory", ".", "isDirectory", "(", ")", ")", "return", "ImmutableSet", ".", "of", "(", ")", ";", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "List", "<", "File", ">", "javaFilesInDirectory", "=", "getFiles", "(", "directory", ",", "\"**/*.java\"", ",", "null", ")", ";", "return", "ImmutableSet", ".", "copyOf", "(", "javaFilesInDirectory", ")", ";", "}", "private", "long", "lastModified", "(", "ImmutableSet", "<", "File", ">", "files", ")", "{", "long", "result", "=", "0", ";", "for", "(", "File", "file", ":", "files", ")", "{", "if", "(", "file", ".", "lastModified", "(", ")", ">", "result", ")", "result", "=", "file", ".", "lastModified", "(", ")", ";", "}", "return", "result", ";", "}", "private", "void", "checkParameters", "(", ")", "{", "checkNotNull", "(", "project", ",", "\"project\"", ")", ";", "checkNotNull", "(", "projectHelper", ",", "\"\"", ")", ";", "checkNotNull", "(", "thriftExecutable", ",", "\"\"", ")", ";", "checkNotNull", "(", "generator", ",", "\"generator\"", ")", ";", "final", "File", "thriftSourceRoot", "=", "getThriftSourceRoot", "(", ")", ";", "checkNotNull", "(", "thriftSourceRoot", ")", ";", "checkArgument", "(", "!", "thriftSourceRoot", ".", "isFile", "(", ")", ",", "\"\"", ")", ";", "checkNotNull", "(", "temporaryThriftFileDirectory", ",", "\"\"", ")", ";", "checkState", "(", "!", "temporaryThriftFileDirectory", ".", "isFile", "(", ")", ",", "\"\"", ")", ";", "final", "File", "outputDirectory", "=", "getOutputDirectory", "(", ")", ";", "checkNotNull", "(", "outputDirectory", ")", ";", "checkState", "(", "!", "outputDirectory", ".", "isFile", "(", ")", ",", "\"\"", ")", ";", "}", "protected", "abstract", "File", "getThriftSourceRoot", "(", ")", ";", "protected", "abstract", "List", "<", "Artifact", ">", "getDependencyArtifacts", "(", ")", ";", "protected", "abstract", "File", "getOutputDirectory", "(", ")", ";", "protected", "abstract", "void", "attachFiles", "(", ")", ";", "private", "ImmutableSet", "<", "File", ">", "getDependencyArtifactFiles", "(", ")", "{", "Set", "<", "File", ">", "dependencyArtifactFiles", "=", "newHashSet", "(", ")", ";", "for", "(", "Artifact", "artifact", ":", "getDependencyArtifacts", "(", ")", ")", "{", "dependencyArtifactFiles", ".", "add", "(", "artifact", ".", "getFile", "(", ")", ")", ";", "}", "return", "ImmutableSet", ".", "copyOf", "(", "dependencyArtifactFiles", ")", ";", "}", "ImmutableSet", "<", "File", ">", "makeThriftPathFromJars", "(", "File", "temporaryThriftFileDirectory", ",", "Iterable", "<", "File", ">", "classpathElementFiles", ")", "throws", "IOException", ",", "MojoExecutionException", "{", "checkNotNull", "(", "classpathElementFiles", ",", "\"\"", ")", ";", "if", "(", "temporaryThriftFileDirectory", ".", "exists", "(", ")", ")", "{", "cleanDirectory", "(", "temporaryThriftFileDirectory", ")", ";", "}", "Set", "<", "File", ">", "thriftDirectories", "=", "newHashSet", "(", ")", ";", "for", "(", "File", "classpathElementFile", ":", "classpathElementFiles", ")", "{", "if", "(", "classpathElementFile", ".", "isFile", "(", ")", "&&", "classpathElementFile", ".", "canRead", "(", ")", "&&", "!", "classpathElementFile", ".", "getName", "(", ")", ".", "endsWith", "(", "\".xml\"", ")", ")", "{", "JarFile", "classpathJar", ";", "try", "{", "classpathJar", "=", "new", "JarFile", "(", "classpathElementFile", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "IllegalArgumentException", "(", "format", "(", "\"\"", ",", "classpathElementFile", ")", ")", ";", "}", "for", "(", "JarEntry", "jarEntry", ":", "list", "(", "classpathJar", ".", "entries", "(", ")", ")", ")", "{", "final", "String", "jarEntryName", "=", "jarEntry", ".", "getName", "(", ")", ";", "if", "(", "jarEntry", ".", "getName", "(", ")", ".", "endsWith", "(", "THRIFT_FILE_SUFFIX", ")", ")", "{", "final", "File", "uncompressedCopy", "=", "new", "File", "(", "new", "File", "(", "temporaryThriftFileDirectory", ",", "truncatePath", "(", "classpathJar", ".", "getName", "(", ")", ")", ")", ",", "jarEntryName", ")", ";", "uncompressedCopy", ".", "getParentFile", "(", ")", ".", "mkdirs", "(", ")", ";", "copyStreamToFile", "(", "new", "RawInputStreamFacade", "(", "classpathJar", ".", "getInputStream", "(", "jarEntry", ")", ")", ",", "uncompressedCopy", ")", ";", "thriftDirectories", ".", "add", "(", "uncompressedCopy", ".", "getParentFile", "(", ")", ")", ";", "}", "}", "}", "else", "if", "(", "classpathElementFile", ".", "isDirectory", "(", ")", ")", "{", "File", "[", "]", "thriftFiles", "=", "classpathElementFile", ".", "listFiles", "(", "new", "FilenameFilter", "(", ")", "{", "public", "boolean", "accept", "(", "File", "dir", ",", "String", "name", ")", "{", "return", "name", ".", "endsWith", "(", "THRIFT_FILE_SUFFIX", ")", ";", "}", "}", ")", ";", "if", "(", "thriftFiles", ".", "length", ">", "0", ")", "{", "thriftDirectories", ".", "add", "(", "classpathElementFile", ")", ";", "}", "}", "}", "return", "ImmutableSet", ".", "copyOf", "(", "thriftDirectories", ")", ";", "}", "ImmutableSet", "<", "File", ">", "findThriftFilesInDirectory", "(", "File", "directory", ")", "throws", "IOException", "{", "checkNotNull", "(", "directory", ")", ";", "checkArgument", "(", "directory", ".", "isDirectory", "(", ")", ",", "\"\"", ",", "directory", ")", ";", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "List", "<", "File", ">", "thriftFilesInDirectory", "=", "getFiles", "(", "directory", ",", "join", "(", "\",\"", ",", "includes", ")", ",", "join", "(", "\",\"", ",", "excludes", ")", ")", ";", "return", "ImmutableSet", ".", "copyOf", "(", "thriftFilesInDirectory", ")", ";", "}", "ImmutableSet", "<", "File", ">", "findThriftFilesInDirectories", "(", "Iterable", "<", "File", ">", "directories", ")", "throws", "IOException", "{", "checkNotNull", "(", "directories", ")", ";", "Set", "<", "File", ">", "thriftFiles", "=", "newHashSet", "(", ")", ";", "for", "(", "File", "directory", ":", "directories", ")", "{", "thriftFiles", ".", "addAll", "(", "findThriftFilesInDirectory", "(", "directory", ")", ")", ";", "}", "return", "ImmutableSet", ".", "copyOf", "(", "thriftFiles", ")", ";", "}", "String", "truncatePath", "(", "final", "String", "jarPath", ")", "throws", "MojoExecutionException", "{", "if", "(", "hashDependentPaths", ")", "{", "try", "{", "return", "toHexString", "(", "MessageDigest", ".", "getInstance", "(", "\"MD5\"", ")", ".", "digest", "(", "jarPath", ".", "getBytes", "(", ")", ")", ")", ";", "}", "catch", "(", "NoSuchAlgorithmException", "e", ")", "{", "throw", "new", "MojoExecutionException", "(", "\"\"", ",", "e", ")", ";", "}", "}", "String", "repository", "=", "localRepository", ".", "getBasedir", "(", ")", ".", "replace", "(", "'\\\\'", ",", "'/'", ")", ";", "if", "(", "!", "repository", ".", "endsWith", "(", "\"/\"", ")", ")", "{", "repository", "+=", "\"/\"", ";", "}", "String", "path", "=", "jarPath", ".", "replace", "(", "'\\\\'", ",", "'/'", ")", ";", "int", "repositoryIndex", "=", "path", ".", "indexOf", "(", "repository", ")", ";", "if", "(", "repositoryIndex", "!=", "-", "1", ")", "{", "path", "=", "path", ".", "substring", "(", "repositoryIndex", "+", "repository", ".", "length", "(", ")", ")", ";", "}", "int", "colonIndex", "=", "path", ".", "indexOf", "(", "':'", ")", ";", "if", "(", "colonIndex", "!=", "-", "1", ")", "{", "path", "=", "path", ".", "substring", "(", "colonIndex", "+", "2", ")", ";", "}", "return", "path", ";", "}", "private", "static", "final", "char", "[", "]", "HEX_CHARS", "=", "\"\"", ".", "toCharArray", "(", ")", ";", "public", "static", "String", "toHexString", "(", "byte", "[", "]", "byteArray", ")", "{", "final", "StringBuilder", "hexString", "=", "new", "StringBuilder", "(", "2", "*", "byteArray", ".", "length", ")", ";", "for", "(", "final", "byte", "b", ":", "byteArray", ")", "{", "hexString", ".", "append", "(", "HEX_CHARS", "[", "(", "b", "&", "0xF0", ")", ">>", "4", "]", ")", ".", "append", "(", "HEX_CHARS", "[", "b", "&", "0x0F", "]", ")", ";", "}", "return", "hexString", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
10,477
[ "<s>", "package", "org", ".", "apache", ".", "thrift", ".", "maven", ";", "import", "com", ".", "google", ".", "common", ".", "collect", ".", "ImmutableList", ";", "import", "com", ".", "google", ".", "common", ".", "collect", ".", "ImmutableSet", ";", "import", "org", ".", "codehaus", ".", "plexus", ".", "util", ".", "cli", ".", "CommandLineException", ";", "import", "org", ".", "codehaus", ".", "plexus", ".", "util", ".", "cli", ".", "CommandLineUtils", ";", "import", "org", ".", "codehaus", ".", "plexus", ".", "util", ".", "cli", ".", "Commandline", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "static", "com", ".", "google", ".", "common", ".", "base", ".", "Preconditions", ".", "checkArgument", ";", "import", "static", "com", ".", "google", ".", "common", ".", "base", ".", "Preconditions", ".", "checkNotNull", ";", "import", "static", "com", ".", "google", ".", "common", ".", "base", ".", "Preconditions", ".", "checkState", ";", "import", "static", "com", ".", "google", ".", "common", ".", "collect", ".", "Lists", ".", "newLinkedList", ";", "import", "static", "com", ".", "google", ".", "common", ".", "collect", ".", "Sets", ".", "newHashSet", ";", "final", "class", "Thrift", "{", "final", "static", "String", "GENERATED_JAVA", "=", "\"gen-java\"", ";", "private", "final", "String", "executable", ";", "private", "final", "String", "generator", ";", "private", "final", "ImmutableSet", "<", "File", ">", "thriftPathElements", ";", "private", "final", "ImmutableSet", "<", "File", ">", "thriftFiles", ";", "private", "final", "File", "javaOutputDirectory", ";", "private", "final", "CommandLineUtils", ".", "StringStreamConsumer", "output", ";", "private", "final", "CommandLineUtils", ".", "StringStreamConsumer", "error", ";", "private", "Thrift", "(", "String", "executable", ",", "String", "generator", ",", "ImmutableSet", "<", "File", ">", "thriftPath", ",", "ImmutableSet", "<", "File", ">", "thriftFiles", ",", "File", "javaOutputDirectory", ")", "{", "this", ".", "executable", "=", "checkNotNull", "(", "executable", ",", "\"executable\"", ")", ";", "this", ".", "generator", "=", "checkNotNull", "(", "generator", ",", "\"generator\"", ")", ";", "this", ".", "thriftPathElements", "=", "checkNotNull", "(", "thriftPath", ",", "\"thriftPath\"", ")", ";", "this", ".", "thriftFiles", "=", "checkNotNull", "(", "thriftFiles", ",", "\"thriftFiles\"", ")", ";", "this", ".", "javaOutputDirectory", "=", "checkNotNull", "(", "javaOutputDirectory", ",", "\"\"", ")", ";", "this", ".", "error", "=", "new", "CommandLineUtils", ".", "StringStreamConsumer", "(", ")", ";", "this", ".", "output", "=", "new", "CommandLineUtils", ".", "StringStreamConsumer", "(", ")", ";", "}", "public", "int", "compile", "(", ")", "throws", "CommandLineException", "{", "for", "(", "File", "thriftFile", ":", "thriftFiles", ")", "{", "Commandline", "cl", "=", "new", "Commandline", "(", ")", ";", "cl", ".", "setExecutable", "(", "executable", ")", ";", "cl", ".", "addArguments", "(", "buildThriftCommand", "(", "thriftFile", ")", ".", "toArray", "(", "new", "String", "[", "]", "{", "}", ")", ")", ";", "final", "int", "result", "=", "CommandLineUtils", ".", "executeCommandLine", "(", "cl", ",", "null", ",", "output", ",", "error", ")", ";", "if", "(", "result", "!=", "0", ")", "{", "return", "result", ";", "}", "}", "return", "0", ";", "}", "ImmutableList", "<", "String", ">", "buildThriftCommand", "(", "final", "File", "thriftFile", ")", "{", "final", "List", "<", "String", ">", "command", "=", "newLinkedList", "(", ")", ";", "for", "(", "File", "thriftPathElement", ":", "thriftPathElements", ")", "{", "command", ".", "add", "(", "\"-I\"", ")", ";", "command", ".", "add", "(", "thriftPathElement", ".", "toString", "(", ")", ")", ";", "}", "command", ".", "add", "(", "\"-out\"", ")", ";", "command", ".", "add", "(", "javaOutputDirectory", ".", "toString", "(", ")", ")", ";", "command", ".", "add", "(", "\"--gen\"", ")", ";", "command", ".", "add", "(", "generator", ")", ";", "command", ".", "add", "(", "thriftFile", ".", "toString", "(", ")", ")", ";", "return", "ImmutableList", ".", "copyOf", "(", "command", ")", ";", "}", "public", "String", "getOutput", "(", ")", "{", "return", "output", ".", "getOutput", "(", ")", ";", "}", "public", "String", "getError", "(", ")", "{", "return", "error", ".", "getOutput", "(", ")", ";", "}", "static", "final", "class", "Builder", "{", "private", "final", "String", "executable", ";", "private", "final", "File", "javaOutputDirectory", ";", "private", "Set", "<", "File", ">", "thriftPathElements", ";", "private", "Set", "<", "File", ">", "thriftFiles", ";", "private", "String", "generator", ";", "public", "Builder", "(", "String", "executable", ",", "File", "javaOutputDirectory", ")", "{", "this", ".", "executable", "=", "checkNotNull", "(", "executable", ",", "\"executable\"", ")", ";", "this", ".", "javaOutputDirectory", "=", "checkNotNull", "(", "javaOutputDirectory", ")", ";", "checkArgument", "(", "javaOutputDirectory", ".", "isDirectory", "(", ")", ")", ";", "this", ".", "thriftFiles", "=", "newHashSet", "(", ")", ";", "this", ".", "thriftPathElements", "=", "newHashSet", "(", ")", ";", "}", "public", "Builder", "addThriftFile", "(", "File", "thriftFile", ")", "{", "checkNotNull", "(", "thriftFile", ")", ";", "checkArgument", "(", "thriftFile", ".", "isFile", "(", ")", ")", ";", "checkArgument", "(", "thriftFile", ".", "getName", "(", ")", ".", "endsWith", "(", "\".thrift\"", ")", ")", ";", "checkThriftFileIsInThriftPath", "(", "thriftFile", ")", ";", "thriftFiles", ".", "add", "(", "thriftFile", ")", ";", "return", "this", ";", "}", "public", "Builder", "setGenerator", "(", "String", "generator", ")", "{", "checkNotNull", "(", "generator", ")", ";", "this", ".", "generator", "=", "generator", ";", "return", "this", ";", "}", "private", "void", "checkThriftFileIsInThriftPath", "(", "File", "thriftFile", ")", "{", "assert", "thriftFile", ".", "isFile", "(", ")", ";", "checkState", "(", "checkThriftFileIsInThriftPathHelper", "(", "thriftFile", ".", "getParentFile", "(", ")", ")", ")", ";", "}", "private", "boolean", "checkThriftFileIsInThriftPathHelper", "(", "File", "directory", ")", "{", "assert", "directory", ".", "isDirectory", "(", ")", ";", "if", "(", "thriftPathElements", ".", "contains", "(", "directory", ")", ")", "{", "return", "true", ";", "}", "else", "{", "final", "File", "parentDirectory", "=", "directory", ".", "getParentFile", "(", ")", ";", "return", "(", "parentDirectory", "==", "null", ")", "?", "false", ":", "checkThriftFileIsInThriftPathHelper", "(", "parentDirectory", ")", ";", "}", "}", "public", "Builder", "addThriftFiles", "(", "Iterable", "<", "File", ">", "thriftFiles", ")", "{", "for", "(", "File", "thriftFile", ":", "thriftFiles", ")", "{", "addThriftFile", "(", "thriftFile", ")", ";", "}", "return", "this", ";", "}", "public", "Builder", "addThriftPathElement", "(", "File", "thriftPathElement", ")", "{", "checkNotNull", "(", "thriftPathElement", ")", ";", "checkArgument", "(", "thriftPathElement", ".", "isDirectory", "(", ")", ")", ";", "thriftPathElements", ".", "add", "(", "thriftPathElement", ")", ";", "return", "this", ";", "}", "public", "Builder", "addThriftPathElements", "(", "Iterable", "<", "File", ">", "thriftPathElements", ")", "{", "for", "(", "File", "thriftPathElement", ":", "thriftPathElements", ")", "{", "addThriftPathElement", "(", "thriftPathElement", ")", ";", "}", "return", "this", ";", "}", "public", "Thrift", "build", "(", ")", "{", "checkState", "(", "!", "thriftFiles", ".", "isEmpty", "(", ")", ")", ";", "return", "new", "Thrift", "(", "executable", ",", "generator", ",", "ImmutableSet", ".", "copyOf", "(", "thriftPathElements", ")", ",", "ImmutableSet", ".", "copyOf", "(", "thriftFiles", ")", ",", "javaOutputDirectory", ")", ";", "}", "}", "}", "</s>" ]
10,478
[ "<s>", "package", "org", ".", "apache", ".", "thrift", ".", "maven", ";", "import", "org", ".", "codehaus", ".", "plexus", ".", "util", ".", "FileUtils", ";", "import", "org", ".", "codehaus", ".", "plexus", ".", "util", ".", "cli", ".", "CommandLineException", ";", "import", "org", ".", "junit", ".", "After", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "java", ".", "io", ".", "File", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertEquals", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertFalse", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertTrue", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "fail", ";", "public", "class", "TestThrift", "{", "private", "File", "testRootDir", ";", "private", "File", "idlDir", ";", "private", "File", "genJavaDir", ";", "private", "Thrift", ".", "Builder", "builder", ";", "@", "Before", "public", "void", "setup", "(", ")", "throws", "Exception", "{", "final", "File", "tmpDir", "=", "new", "File", "(", "System", ".", "getProperty", "(", "\"\"", ")", ")", ";", "testRootDir", "=", "new", "File", "(", "tmpDir", ",", "\"thrift-test\"", ")", ";", "if", "(", "testRootDir", ".", "exists", "(", ")", ")", "{", "FileUtils", ".", "cleanDirectory", "(", "testRootDir", ")", ";", "}", "else", "{", "assertTrue", "(", "\"\"", "+", "testRootDir", ".", "getPath", "(", ")", ",", "testRootDir", ".", "mkdir", "(", ")", ")", ";", "}", "File", "testResourceDir", "=", "new", "File", "(", "\"\"", ")", ";", "assertTrue", "(", "\"\"", ",", "testRootDir", ".", "exists", "(", ")", ")", ";", "idlDir", "=", "new", "File", "(", "testResourceDir", ",", "\"idl\"", ")", ";", "genJavaDir", "=", "new", "File", "(", "testRootDir", ",", "Thrift", ".", "GENERATED_JAVA", ")", ";", "builder", "=", "new", "Thrift", ".", "Builder", "(", "\"thrift\"", ",", "testRootDir", ")", ";", "builder", ".", "setGenerator", "(", "\"java\"", ")", ".", "addThriftPathElement", "(", "idlDir", ")", ";", "}", "@", "Test", "public", "void", "testThriftCompile", "(", ")", "throws", "Exception", "{", "executeThriftCompile", "(", ")", ";", "}", "@", "Test", "public", "void", "testThriftCompileWithGeneratorOption", "(", ")", "throws", "Exception", "{", "builder", ".", "setGenerator", "(", "\"\"", ")", ";", "executeThriftCompile", "(", ")", ";", "}", "private", "void", "executeThriftCompile", "(", ")", "throws", "CommandLineException", "{", "final", "File", "thriftFile", "=", "new", "File", "(", "idlDir", ",", "\"\"", ")", ";", "builder", ".", "addThriftFile", "(", "thriftFile", ")", ";", "final", "Thrift", "thrift", "=", "builder", ".", "build", "(", ")", ";", "assertTrue", "(", "\"\"", ",", "thriftFile", ".", "exists", "(", ")", ")", ";", "assertFalse", "(", "\"\"", ",", "genJavaDir", ".", "exists", "(", ")", ")", ";", "final", "int", "result", "=", "thrift", ".", "compile", "(", ")", ";", "assertEquals", "(", "0", ",", "result", ")", ";", "assertFalse", "(", "\"\"", ",", "genJavaDir", ".", "exists", "(", ")", ")", ";", "assertTrue", "(", "\"\"", ",", "new", "File", "(", "testRootDir", ",", "\"\"", ")", ".", "exists", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "testThriftMultipleFileCompile", "(", ")", "throws", "Exception", "{", "final", "File", "sharedThrift", "=", "new", "File", "(", "idlDir", ",", "\"\"", ")", ";", "final", "File", "tutorialThrift", "=", "new", "File", "(", "idlDir", ",", "\"\"", ")", ";", "builder", ".", "addThriftFile", "(", "sharedThrift", ")", ";", "builder", ".", "addThriftFile", "(", "tutorialThrift", ")", ";", "final", "Thrift", "thrift", "=", "builder", ".", "build", "(", ")", ";", "assertTrue", "(", "\"\"", ",", "sharedThrift", ".", "exists", "(", ")", ")", ";", "assertFalse", "(", "\"\"", ",", "genJavaDir", ".", "exists", "(", ")", ")", ";", "final", "int", "result", "=", "thrift", ".", "compile", "(", ")", ";", "assertEquals", "(", "0", ",", "result", ")", ";", "assertFalse", "(", "\"\"", ",", "genJavaDir", ".", "exists", "(", ")", ")", ";", "assertTrue", "(", "\"\"", ",", "new", "File", "(", "testRootDir", ",", "\"\"", ")", ".", "exists", "(", ")", ")", ";", "assertTrue", "(", "\"\"", ",", "new", "File", "(", "testRootDir", ",", "\"\"", ")", ".", "exists", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "testBadCompile", "(", ")", "throws", "Exception", "{", "final", "File", "thriftFile", "=", "new", "File", "(", "testRootDir", ",", "\"\"", ")", ";", "builder", ".", "addThriftPathElement", "(", "testRootDir", ")", ";", "assertTrue", "(", "thriftFile", ".", "createNewFile", "(", ")", ")", ";", "builder", ".", "addThriftFile", "(", "thriftFile", ")", ";", "assertTrue", "(", "thriftFile", ".", "delete", "(", ")", ")", ";", "final", "Thrift", "thrift", "=", "builder", ".", "build", "(", ")", ";", "assertTrue", "(", "!", "thriftFile", ".", "exists", "(", ")", ")", ";", "assertFalse", "(", "\"\"", ",", "genJavaDir", ".", "exists", "(", ")", ")", ";", "final", "int", "result", "=", "thrift", ".", "compile", "(", ")", ";", "assertEquals", "(", "1", ",", "result", ")", ";", "}", "@", "Test", "public", "void", "testFileInPathPreCondition", "(", ")", "throws", "Exception", "{", "final", "File", "thriftFile", "=", "new", "File", "(", "testRootDir", ",", "\"\"", ")", ";", "assertTrue", "(", "thriftFile", ".", "createNewFile", "(", ")", ")", ";", "try", "{", "builder", ".", "addThriftFile", "(", "thriftFile", ")", ";", "fail", "(", "\"\"", ")", ";", "}", "catch", "(", "IllegalStateException", "e", ")", "{", "}", "}", "@", "After", "public", "void", "cleanup", "(", ")", "throws", "Exception", "{", "if", "(", "testRootDir", ".", "exists", "(", ")", ")", "{", "FileUtils", ".", "cleanDirectory", "(", "testRootDir", ")", ";", "assertTrue", "(", "\"\"", "+", "testRootDir", ".", "getPath", "(", ")", ",", "testRootDir", ".", "delete", "(", ")", ")", ";", "}", "}", "}", "</s>" ]
10,479
[ "<s>", "package", "com", ".", "iminurnetz", ".", "bukkit", ".", "plugin", ".", "creativestick", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "bukkit", ".", "Material", ";", "import", "org", ".", "bukkit", ".", "configuration", ".", "file", ".", "FileConfiguration", ";", "import", "com", ".", "iminurnetz", ".", "bukkit", ".", "plugin", ".", "BukkitPlugin", ";", "import", "com", ".", "iminurnetz", ".", "bukkit", ".", "plugin", ".", "util", ".", "ConfigurationService", ";", "import", "com", ".", "iminurnetz", ".", "bukkit", ".", "util", ".", "MaterialUtils", ";", "public", "class", "CSConfigurationService", "extends", "ConfigurationService", "{", "private", "FileConfiguration", "config", ";", "private", "BukkitPlugin", "plugin", ";", "public", "static", "final", "double", "LAST_CHANGED_IN_VERSION", "=", "0.8", ";", "public", "static", "final", "String", "SETTINGS_TAG", "=", "\"settings\"", ";", "public", "static", "final", "boolean", "ALLOW_OPS", "=", "true", ";", "public", "static", "final", "boolean", "IS_ENABLED", "=", "false", ";", "public", "static", "final", "boolean", "DOES_DROP", "=", "true", ";", "public", "static", "final", "String", "USER_SETTINGS_TAG", "=", "SETTINGS_TAG", "+", "\".user\"", ";", "public", "static", "final", "int", "UNDO_AMOUNT", "=", "5", ";", "public", "static", "final", "int", "MAX_UNDOS", "=", "500", ";", "public", "static", "final", "int", "DISTANCE", "=", "100", ";", "public", "static", "final", "Material", "TOOL", "=", "Material", ".", "STICK", ";", "public", "static", "final", "boolean", "PROTECT_BOTTOM", "=", "true", ";", "public", "static", "final", "boolean", "RIGHT_CLICK_SWITCH", "=", "false", ";", "public", "static", "final", "boolean", "RIGHT_CLICK_MODES", "=", "false", ";", "public", "static", "final", "boolean", "DEBUG", "=", "false", ";", "public", "static", "final", "boolean", "NATURAL_DROPS", "=", "false", ";", "public", "static", "final", "boolean", "ANNOUNCE", "=", "false", ";", "public", "static", "final", "boolean", "THROW_BUILD", "=", "false", ";", "public", "static", "final", "String", "PERMISSIONS_TAG", "=", "\"permissions\"", ";", "public", "CSConfigurationService", "(", "BukkitPlugin", "plugin", ")", "{", "super", "(", "plugin", ",", "LAST_CHANGED_IN_VERSION", ")", ";", "this", ".", "config", "=", "getConfiguration", "(", ")", ";", "this", ".", "plugin", "=", "plugin", ";", "}", "public", "CSPermissionHandler", "getPermissionHandler", "(", ")", "{", "return", "new", "CSPermissionHandler", "(", "plugin", ",", "config", ".", "getBoolean", "(", "SETTINGS_TAG", "+", "\".allow-ops\"", ",", "ALLOW_OPS", ")", ")", ";", "}", "public", "boolean", "isEnabled", "(", ")", "{", "return", "config", ".", "getBoolean", "(", "SETTINGS_TAG", "+", "\".enabled\"", ",", "IS_ENABLED", ")", ";", "}", "public", "boolean", "doesDrop", "(", ")", "{", "return", "config", ".", "getBoolean", "(", "SETTINGS_TAG", "+", "\".drops\"", ",", "DOES_DROP", ")", ";", "}", "public", "int", "getUndoAmount", "(", ")", "{", "return", "config", ".", "getInt", "(", "USER_SETTINGS_TAG", "+", "\".undo\"", ",", "UNDO_AMOUNT", ")", ";", "}", "public", "int", "getDistance", "(", ")", "{", "return", "config", ".", "getInt", "(", "USER_SETTINGS_TAG", "+", "\".distance\"", ",", "DISTANCE", ")", ";", "}", "public", "Material", "getTool", "(", ")", "{", "return", "MaterialUtils", ".", "getMaterial", "(", "config", ".", "getString", "(", "USER_SETTINGS_TAG", "+", "\".tool\"", ",", "TOOL", ".", "name", "(", ")", ")", ")", ";", "}", "public", "boolean", "doProtectBottom", "(", ")", "{", "return", "config", ".", "getBoolean", "(", "USER_SETTINGS_TAG", "+", "\"\"", ",", "PROTECT_BOTTOM", ")", ";", "}", "public", "boolean", "doRightClickSwitch", "(", ")", "{", "return", "config", ".", "getBoolean", "(", "USER_SETTINGS_TAG", "+", "\"\"", ",", "RIGHT_CLICK_SWITCH", ")", ";", "}", "public", "boolean", "doRightClickModes", "(", ")", "{", "return", "config", ".", "getBoolean", "(", "USER_SETTINGS_TAG", "+", "\"\"", ",", "RIGHT_CLICK_MODES", ")", ";", "}", "public", "boolean", "isDebug", "(", ")", "{", "return", "config", ".", "getBoolean", "(", "USER_SETTINGS_TAG", "+", "\".debug-mode\"", ",", "DEBUG", ")", ";", "}", "public", "boolean", "doesNaturalDrops", "(", ")", "{", "return", "config", ".", "getBoolean", "(", "USER_SETTINGS_TAG", "+", "\"\"", ",", "NATURAL_DROPS", ")", ";", "}", "public", "boolean", "doAnnounce", "(", ")", "{", "return", "config", ".", "getBoolean", "(", "USER_SETTINGS_TAG", "+", "\".announce\"", ",", "ANNOUNCE", ")", ";", "}", "public", "HashSet", "<", "Byte", ">", "getIgnored", "(", ")", "{", "List", "<", "String", ">", "names", "=", "config", ".", "getStringList", "(", "SETTINGS_TAG", "+", "\".ignore\"", ")", ";", "HashSet", "<", "Material", ">", "materials", "=", "new", "HashSet", "<", "Material", ">", "(", ")", ";", "for", "(", "String", "name", ":", "names", ")", "{", "Material", "m", "=", "MaterialUtils", ".", "getMaterial", "(", "name", ")", ";", "if", "(", "m", "!=", "null", ")", "materials", ".", "add", "(", "m", ")", ";", "}", "HashSet", "<", "Byte", ">", "returnSet", "=", "new", "HashSet", "<", "Byte", ">", "(", ")", ";", "for", "(", "Material", "m", ":", "materials", ")", "{", "returnSet", ".", "add", "(", "(", "byte", ")", "m", ".", "getId", "(", ")", ")", ";", "}", "returnSet", ".", "add", "(", "(", "byte", ")", "Material", ".", "AIR", ".", "getId", "(", ")", ")", ";", "return", "returnSet", ";", "}", "public", "int", "getMaxUndos", "(", ")", "{", "return", "config", ".", "getInt", "(", "USER_SETTINGS_TAG", "+", "\".max-undos\"", ",", "MAX_UNDOS", ")", ";", "}", "public", "boolean", "useBlockSpawnPermission", "(", ")", "{", "return", "config", ".", "getBoolean", "(", "SETTINGS_TAG", "+", "\"\"", ",", "false", ")", ";", "}", "public", "boolean", "isThrowBuild", "(", ")", "{", "return", "config", ".", "getBoolean", "(", "USER_SETTINGS_TAG", "+", "\".throw-build\"", ",", "THROW_BUILD", ")", ";", "}", "}", "</s>" ]
10,480
[ "<s>", "package", "com", ".", "iminurnetz", ".", "bukkit", ".", "plugin", ".", "creativestick", ";", "import", "java", ".", "util", ".", "Date", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "concurrent", ".", "Executors", ";", "import", "java", ".", "util", ".", "concurrent", ".", "ScheduledExecutorService", ";", "import", "java", ".", "util", ".", "concurrent", ".", "ScheduledFuture", ";", "import", "java", ".", "util", ".", "concurrent", ".", "TimeUnit", ";", "import", "java", ".", "util", ".", "logging", ".", "Level", ";", "import", "org", ".", "bukkit", ".", "ChatColor", ";", "import", "org", ".", "bukkit", ".", "GameMode", ";", "import", "org", ".", "bukkit", ".", "Material", ";", "import", "org", ".", "bukkit", ".", "block", ".", "Block", ";", "import", "org", ".", "bukkit", ".", "block", ".", "BlockFace", ";", "import", "org", ".", "bukkit", ".", "block", ".", "BlockState", ";", "import", "org", ".", "bukkit", ".", "entity", ".", "Player", ";", "import", "org", ".", "bukkit", ".", "event", ".", "Cancellable", ";", "import", "org", ".", "bukkit", ".", "event", ".", "EventHandler", ";", "import", "org", ".", "bukkit", ".", "event", ".", "EventPriority", ";", "import", "org", ".", "bukkit", ".", "event", ".", "block", ".", "Action", ";", "import", "org", ".", "bukkit", ".", "event", ".", "block", ".", "BlockBreakEvent", ";", "import", "org", ".", "bukkit", ".", "event", ".", "block", ".", "BlockEvent", ";", "import", "org", ".", "bukkit", ".", "event", ".", "block", ".", "BlockIgniteEvent", ";", "import", "org", ".", "bukkit", ".", "event", ".", "block", ".", "BlockIgniteEvent", ".", "IgniteCause", ";", "import", "org", ".", "bukkit", ".", "event", ".", "block", ".", "BlockPlaceEvent", ";", "import", "org", ".", "bukkit", ".", "event", ".", "player", ".", "PlayerAnimationEvent", ";", "import", "org", ".", "bukkit", ".", "event", ".", "player", ".", "PlayerInteractEvent", ";", "import", "org", ".", "bukkit", ".", "event", ".", "player", ".", "PlayerItemHeldEvent", ";", "import", "org", ".", "bukkit", ".", "event", ".", "player", ".", "PlayerJoinEvent", ";", "import", "org", ".", "bukkit", ".", "event", ".", "Listener", ";", "import", "org", ".", "bukkit", ".", "inventory", ".", "ItemStack", ";", "import", "org", ".", "bukkit", ".", "material", ".", "Ladder", ";", "import", "org", ".", "bukkit", ".", "material", ".", "MaterialData", ";", "import", "com", ".", "iminurnetz", ".", "bukkit", ".", "plugin", ".", "util", ".", "MessageUtils", ";", "import", "com", ".", "iminurnetz", ".", "bukkit", ".", "util", ".", "Item", ";", "import", "com", ".", "iminurnetz", ".", "bukkit", ".", "util", ".", "LocationUtil", ";", "import", "com", ".", "iminurnetz", ".", "bukkit", ".", "util", ".", "MaterialUtils", ";", "public", "class", "CSPlayerListener", "implements", "Listener", "{", "public", "static", "CSPlugin", "plugin", ";", "public", "CSPlayerListener", "(", "CSPlugin", "instance", ")", "{", "plugin", "=", "instance", ";", "}", "@", "EventHandler", "(", "priority", "=", "EventPriority", ".", "MONITOR", ")", "public", "void", "onPlayerJoin", "(", "PlayerJoinEvent", "event", ")", "{", "checkStatus", "(", "event", ".", "getPlayer", "(", ")", ")", ";", "}", "private", "final", "ScheduledExecutorService", "scheduler", "=", "Executors", ".", "newScheduledThreadPool", "(", "1", ")", ";", "private", "static", "ScheduledFuture", "<", "?", ">", "checkerHandle", "=", "null", ";", "@", "EventHandler", "(", "priority", "=", "EventPriority", ".", "MONITOR", ")", "public", "void", "onItemHeldChange", "(", "PlayerItemHeldEvent", "event", ")", "{", "final", "Player", "p", "=", "event", ".", "getPlayer", "(", ")", ";", "final", "Runnable", "checker", "=", "new", "Runnable", "(", ")", "{", "public", "void", "run", "(", ")", "{", "checkStatus", "(", "p", ")", ";", "}", "}", ";", "if", "(", "checkerHandle", "!=", "null", ")", "{", "checkerHandle", ".", "cancel", "(", "true", ")", ";", "}", "checkerHandle", "=", "scheduler", ".", "schedule", "(", "checker", ",", "200", ",", "TimeUnit", ".", "MILLISECONDS", ")", ";", "}", "private", "void", "checkStatus", "(", "Player", "player", ")", "{", "Stick", "stick", "=", "plugin", ".", "getStick", "(", "player", ")", ";", "if", "(", "plugin", ".", "canUse", "(", "player", ",", "stick", ")", "&&", "(", "stick", ".", "doAnnounce", "(", ")", "||", "stick", ".", "isDebug", "(", ")", ")", ")", "{", "MessageUtils", ".", "send", "(", "player", ",", "ChatColor", ".", "GREEN", ",", "\"\"", "+", "plugin", ".", "getName", "(", ")", ")", ";", "}", "}", "@", "EventHandler", "(", "priority", "=", "EventPriority", ".", "HIGHEST", ")", "public", "void", "onPlayerInteract", "(", "PlayerInteractEvent", "event", ")", "{", "if", "(", "event", ".", "getAction", "(", ")", "==", "Action", ".", "PHYSICAL", ")", "{", "return", ";", "}", "int", "mode", "=", "0", ";", "Player", "player", "=", "event", ".", "getPlayer", "(", ")", ";", "Stick", "stick", "=", "null", ";", "stick", "=", "plugin", ".", "getStick", "(", "player", ")", ";", "mode", "=", "stick", ".", "getMode", "(", ")", ";", "if", "(", "event", ".", "getAction", "(", ")", "==", "Action", ".", "LEFT_CLICK_BLOCK", ")", "{", "if", "(", "player", ".", "getGameMode", "(", ")", "==", "GameMode", ".", "CREATIVE", "&&", "stick", ".", "isEnabled", "(", ")", ")", "{", "event", ".", "setCancelled", "(", "true", ")", ";", "}", "return", ";", "}", "if", "(", "event", ".", "getAction", "(", ")", "==", "Action", ".", "RIGHT_CLICK_BLOCK", "&&", "stick", ".", "isThrowBuild", "(", ")", "&&", "player", ".", "getItemInHand", "(", ")", ".", "getType", "(", ")", "!=", "stick", ".", "getTool", "(", ")", ")", "{", "return", ";", "}", "if", "(", "!", "stick", ".", "doRightClickModes", "(", ")", "&&", "(", "event", ".", "getAction", "(", ")", "==", "Action", ".", "RIGHT_CLICK_AIR", "||", "event", ".", "getAction", "(", ")", "==", "Action", ".", "RIGHT_CLICK_BLOCK", ")", ")", "{", "mode", "=", "Stick", ".", "REMOVE_MODE", ";", "}", "if", "(", "plugin", ".", "canUse", "(", "player", ",", "stick", ",", "mode", ")", ")", "{", "event", ".", "setCancelled", "(", "true", ")", ";", "List", "<", "Block", ">", "targetBlocks", "=", "player", ".", "getLastTwoTargetBlocks", "(", "stick", ".", "getIgnore", "(", ")", ",", "stick", ".", "getDistance", "(", ")", ")", ";", "if", "(", "targetBlocks", ".", "size", "(", ")", "!=", "2", ")", "{", "plugin", ".", "log", "(", "Level", ".", "WARNING", ",", "\"\"", ")", ";", "return", ";", "}", "Block", "targetedBlock", "=", "null", ";", "Block", "placedAgainstBlock", "=", "null", ";", "Item", "item", "=", "stick", ".", "getItem", "(", ")", ";", "if", "(", "!", "item", ".", "isBlock", "(", ")", ")", "{", "item", "=", "MaterialUtils", ".", "getPlaceableMaterial", "(", "item", ")", ";", "if", "(", "!", "item", ".", "isBlock", "(", ")", ")", "{", "if", "(", "!", "stick", ".", "isThrowBuild", "(", ")", ")", "{", "MessageUtils", ".", "send", "(", "player", ",", "ChatColor", ".", "RED", ",", "\"\"", ")", ";", "}", "else", "{", "event", ".", "setCancelled", "(", "false", ")", ";", "}", "return", ";", "}", "}", "BlockEvent", "actionEvent", "=", "null", ";", "if", "(", "mode", "==", "Stick", ".", "REPLACE_MODE", "||", "mode", "==", "Stick", ".", "REMOVE_MODE", ")", "{", "targetedBlock", "=", "targetBlocks", ".", "get", "(", "1", ")", ";", "placedAgainstBlock", "=", "targetBlocks", ".", "get", "(", "0", ")", ";", "}", "else", "if", "(", "mode", "==", "Stick", ".", "BUILD_MODE", ")", "{", "targetedBlock", "=", "targetBlocks", ".", "get", "(", "0", ")", ";", "placedAgainstBlock", "=", "targetBlocks", ".", "get", "(", "1", ")", ";", "}", "if", "(", "targetedBlock", ".", "getLocation", "(", ")", ".", "getBlockY", "(", ")", "==", "0", "&&", "stick", ".", "doProtectBottom", "(", ")", ")", "{", "plugin", ".", "log", "(", "Level", ".", "WARNING", ",", "\"Player", "\"", "+", "player", ".", "getDisplayName", "(", ")", "+", "\"\"", ")", ";", "return", ";", "}", "if", "(", "LocationUtil", ".", "isSameLocation", "(", "player", ",", "targetedBlock", ")", ")", "{", "if", "(", "stick", ".", "isDebug", "(", ")", ")", "{", "MessageUtils", ".", "send", "(", "player", ",", "\"**", "boink", "**\"", ")", ";", "}", "return", ";", "}", "BlockState", "after", "=", "targetedBlock", ".", "getState", "(", ")", ";", "after", ".", "setType", "(", "mode", "==", "Stick", ".", "REMOVE_MODE", "?", "Material", ".", "AIR", ":", "item", ".", "getMaterial", "(", ")", ")", ";", "MaterialData", "data", "=", "null", ";", "if", "(", "mode", "==", "Stick", ".", "REMOVE_MODE", ")", "{", "data", "=", "Material", ".", "AIR", ".", "getNewData", "(", "(", "byte", ")", "0", ")", ";", "}", "else", "if", "(", "MaterialUtils", ".", "isSameMaterial", "(", "item", ".", "getMaterial", "(", ")", ",", "Material", ".", "LADDER", ")", ")", "{", "BlockFace", "face", "=", "LocationUtil", ".", "getFace", "(", "player", ",", "targetedBlock", ")", ";", "if", "(", "stick", ".", "isDebug", "(", ")", ")", "{", "MessageUtils", ".", "send", "(", "player", ",", "\"clicked", "\"", "+", "face", "+", "\"", "face!", "(\"", "+", "player", ".", "getEyeLocation", "(", ")", "+", "\")\"", ")", ";", "}", "Ladder", "ladder", "=", "new", "Ladder", "(", ")", ";", "ladder", ".", "setFacingDirection", "(", "face", ")", ";", "data", "=", "ladder", ";", "}", "else", "{", "data", "=", "item", ".", "getData", "(", ")", ";", "}", "if", "(", "data", "!=", "null", ")", "after", ".", "setData", "(", "data", ")", ";", "BlockState", "before", "=", "targetedBlock", ".", "getState", "(", ")", ";", "if", "(", "mode", "==", "Stick", ".", "REMOVE_MODE", ")", "{", "stick", ".", "setDoItemSwitch", "(", "true", ")", ";", "actionEvent", "=", "new", "BlockBreakEvent", "(", "targetedBlock", ",", "player", ")", ";", "}", "else", "if", "(", "MaterialUtils", ".", "isSameMaterial", "(", "item", ".", "getMaterial", "(", ")", ",", "Material", ".", "FIRE", ")", ")", "{", "actionEvent", "=", "new", "BlockIgniteEvent", "(", "targetedBlock", ",", "IgniteCause", ".", "FLINT_AND_STEEL", ",", "player", ")", ";", "}", "else", "{", "actionEvent", "=", "new", "BlockPlaceEvent", "(", "after", ".", "getBlock", "(", ")", ",", "before", ",", "placedAgainstBlock", ",", "new", "ItemStack", "(", "stick", ".", "getTool", "(", ")", ")", ",", "player", ",", "true", ")", ";", "}", "plugin", ".", "getServer", "(", ")", ".", "getPluginManager", "(", ")", ".", "callEvent", "(", "actionEvent", ")", ";", "if", "(", "!", "(", "(", "Cancellable", ")", "actionEvent", ")", ".", "isCancelled", "(", ")", ")", "{", "plugin", ".", "takeAction", "(", "before", ",", "after", ",", "player", ")", ";", "}", "}", "}", "@", "EventHandler", "(", "priority", "=", "EventPriority", ".", "HIGHEST", ")", "public", "void", "onPlayerAnimation", "(", "PlayerAnimationEvent", "event", ")", "{", "final", "Player", "player", "=", "event", ".", "getPlayer", "(", ")", ";", "final", "Stick", "stick", "=", "plugin", ".", "getStick", "(", "player", ")", ";", "if", "(", "plugin", ".", "canUse", "(", "player", ",", "stick", ")", ")", "{", "Thread", "t", "=", "new", "Thread", "(", "new", "Runnable", "(", ")", "{", "public", "void", "run", "(", ")", "{", "try", "{", "Thread", ".", "sleep", "(", "10", ")", ";", "}", "catch", "(", "InterruptedException", "e", ")", "{", "return", ";", "}", "long", "now", "=", "new", "Date", "(", ")", ".", "getTime", "(", ")", ";", "if", "(", "now", "-", "stick", ".", "getLastActionTakenAt", "(", ")", ">", "40", ")", "{", "Block", "target", "=", "player", ".", "getTargetBlock", "(", "null", ",", "500", ")", ";", "PlayerInteractEvent", "pie", "=", "new", "PlayerInteractEvent", "(", "player", ",", "target", ".", "getType", "(", ")", "==", "Material", ".", "AIR", "?", "Action", ".", "LEFT_CLICK_AIR", ":", "Action", ".", "LEFT_CLICK_BLOCK", ",", "player", ".", "getItemInHand", "(", ")", ",", "target", ",", "target", ".", "getFace", "(", "player", ".", "getEyeLocation", "(", ")", ".", "getBlock", "(", ")", ")", ")", ";", "onPlayerInteract", "(", "pie", ")", ";", "}", "}", "}", ")", ";", "t", ".", "setDaemon", "(", "true", ")", ";", "t", ".", "start", "(", ")", ";", "}", "}", "}", "</s>" ]
10,481
[ "<s>", "package", "com", ".", "iminurnetz", ".", "bukkit", ".", "plugin", ".", "creativestick", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "IOException", ";", "public", "class", "Misc", "{", "public", "static", "Boolean", "arguments", "(", "String", "[", "]", "array", ",", "int", "amount", ")", "{", "return", "Boolean", ".", "valueOf", "(", "array", ".", "length", "<", "amount", "+", "2", ")", ";", "}", "public", "static", "Boolean", "is", "(", "String", "text", ",", "String", "against", ")", "{", "return", "Boolean", ".", "valueOf", "(", "text", ".", "equalsIgnoreCase", "(", "against", ")", ")", ";", "}", "public", "static", "Boolean", "isEither", "(", "String", "text", ",", "String", "against", ",", "String", "or", ")", "{", "return", "Boolean", ".", "valueOf", "(", "(", "text", ".", "equalsIgnoreCase", "(", "against", ")", ")", "||", "(", "text", ".", "equalsIgnoreCase", "(", "or", ")", ")", ")", ";", "}", "public", "static", "String", "formatCurrency", "(", "int", "Balance", ",", "String", "currency", ")", "{", "return", "insertCommas", "(", "String", ".", "valueOf", "(", "Balance", ")", ")", "+", "\"", "\"", "+", "currency", ";", "}", "public", "static", "String", "insertCommas", "(", "String", "str", ")", "{", "if", "(", "str", ".", "length", "(", ")", "<", "4", ")", "{", "return", "str", ";", "}", "return", "insertCommas", "(", "str", ".", "substring", "(", "0", ",", "str", ".", "length", "(", ")", "-", "3", ")", ")", "+", "\",\"", "+", "str", ".", "substring", "(", "str", ".", "length", "(", ")", "-", "3", ",", "str", ".", "length", "(", ")", ")", ";", "}", "public", "static", "String", "string", "(", "int", "i", ")", "{", "return", "String", ".", "valueOf", "(", "i", ")", ";", "}", "public", "static", "boolean", "validate", "(", "String", "name", ")", "{", "return", "name", ".", "matches", "(", "\"\"", ")", ";", "}", "public", "static", "String", "repeat", "(", "char", "c", ",", "int", "i", ")", "{", "String", "tst", "=", "\"\"", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "i", ";", "j", "++", ")", "{", "tst", "=", "tst", "+", "c", ";", "}", "return", "tst", ";", "}", "public", "static", "void", "touch", "(", "File", "directory", ",", "String", "name", ")", "{", "try", "{", "new", "File", "(", "directory", ",", "name", ")", ".", "createNewFile", "(", ")", ";", "}", "catch", "(", "IOException", "ex", ")", "{", "}", "}", "public", "static", "void", "touch", "(", "String", "name", ")", "{", "try", "{", "new", "File", "(", "name", ")", ".", "createNewFile", "(", ")", ";", "}", "catch", "(", "IOException", "ex", ")", "{", "}", "}", "public", "static", "class", "string", "{", "public", "static", "String", "combine", "(", "int", "startIndex", ",", "String", "[", "]", "string", ",", "String", "seperator", ")", "{", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "startIndex", ";", "i", "<", "string", ".", "length", ";", "i", "++", ")", "{", "builder", ".", "append", "(", "string", "[", "i", "]", ")", ";", "builder", ".", "append", "(", "seperator", ")", ";", "}", "builder", ".", "deleteCharAt", "(", "builder", ".", "length", "(", ")", "-", "seperator", ".", "length", "(", ")", ")", ";", "return", "builder", ".", "toString", "(", ")", ";", "}", "public", "static", "String", "capitalize", "(", "String", "s", ")", "{", "return", "s", ".", "toUpperCase", "(", ")", ".", "charAt", "(", "0", ")", "+", "s", ".", "toLowerCase", "(", ")", ".", "substring", "(", "1", ")", ";", "}", "public", "static", "String", "camelToPhrase", "(", "String", "str", ")", "{", "String", "newStr", "=", "\"\"", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "str", ".", "length", "(", ")", ";", "i", "++", ")", "{", "if", "(", "(", "i", ">", "0", ")", "&&", "(", "Character", ".", "isUpperCase", "(", "str", ".", "charAt", "(", "i", ")", ")", ")", "&&", "(", "!", "Character", ".", "isUpperCase", "(", "str", ".", "charAt", "(", "i", "-", "1", ")", ")", ")", ")", "{", "newStr", "=", "newStr", "+", "'", "'", ";", "}", "newStr", "=", "newStr", "+", "str", ".", "charAt", "(", "i", ")", ";", "}", "return", "newStr", ";", "}", "}", "}", "</s>" ]
10,482
[ "<s>", "package", "com", ".", "iminurnetz", ".", "bukkit", ".", "plugin", ".", "creativestick", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Vector", ";", "import", "org", ".", "bukkit", ".", "ChatColor", ";", "import", "org", ".", "bukkit", ".", "GameMode", ";", "import", "org", ".", "bukkit", ".", "Material", ";", "import", "org", ".", "bukkit", ".", "Server", ";", "import", "org", ".", "bukkit", ".", "block", ".", "Block", ";", "import", "org", ".", "bukkit", ".", "block", ".", "BlockState", ";", "import", "org", ".", "bukkit", ".", "command", ".", "Command", ";", "import", "org", ".", "bukkit", ".", "command", ".", "CommandSender", ";", "import", "org", ".", "bukkit", ".", "entity", ".", "Player", ";", "import", "org", ".", "bukkit", ".", "event", ".", "Event", ";", "import", "org", ".", "bukkit", ".", "event", ".", "Listener", ";", "import", "org", ".", "bukkit", ".", "inventory", ".", "ItemStack", ";", "import", "org", ".", "bukkit", ".", "material", ".", "MaterialData", ";", "import", "org", ".", "bukkit", ".", "plugin", ".", "PluginManager", ";", "import", "com", ".", "iminurnetz", ".", "bukkit", ".", "plugin", ".", "BukkitPlugin", ";", "import", "com", ".", "iminurnetz", ".", "bukkit", ".", "plugin", ".", "util", ".", "MessageUtils", ";", "import", "com", ".", "iminurnetz", ".", "bukkit", ".", "util", ".", "InventoryUtil", ";", "import", "com", ".", "iminurnetz", ".", "bukkit", ".", "util", ".", "Item", ";", "import", "com", ".", "iminurnetz", ".", "bukkit", ".", "util", ".", "MaterialUtils", ";", "import", "com", ".", "iminurnetz", ".", "util", ".", "PersistentProperty", ";", "import", "com", ".", "iminurnetz", ".", "util", ".", "StringUtils", ";", "public", "class", "CSPlugin", "extends", "BukkitPlugin", "{", "public", "static", "ArrayList", "<", "Player", ">", "drop", "=", "new", "ArrayList", "<", "Player", ">", "(", ")", ";", "public", "static", "CSPermissionHandler", "permissionHandler", ";", "protected", "static", "Server", "server", ";", "public", "static", "PersistentProperty", "settings", ";", "private", "static", "HashMap", "<", "Player", ",", "Stick", ">", "sticks", "=", "new", "HashMap", "<", "Player", ",", "Stick", ">", "(", ")", ";", "protected", "CSConfigurationService", "configLoader", ";", "private", "final", "Listener", "playerListener", "=", "new", "CSPlayerListener", "(", "this", ")", ";", "public", "int", "MIN_SERVER_VERSION", "=", "556", ";", "public", "int", "getMinimumServerVersion", "(", ")", "{", "return", "this", ".", "MIN_SERVER_VERSION", ";", "}", "public", "int", "getMaximumServerVersion", "(", ")", "{", "return", "this", ".", "MAX_SERVER_VERSION", ";", "}", "public", "boolean", "canUse", "(", "Player", "player", ",", "Stick", "stick", ")", "{", "return", "canUse", "(", "player", ",", "stick", ",", "stick", ".", "getMode", "(", ")", ")", ";", "}", "public", "boolean", "canUse", "(", "Player", "player", ",", "Stick", "stick", ",", "int", "mode", ")", "{", "if", "(", "configLoader", ".", "useBlockSpawnPermission", "(", ")", "&&", "!", "permissionHandler", ".", "canSpawnBlocks", "(", "player", ")", "&&", "mode", "!=", "Stick", ".", "REMOVE_MODE", "&&", "!", "InventoryUtil", ".", "hasItem", "(", "player", ",", "stick", ".", "getItem", "(", ")", ")", ")", "{", "return", "false", ";", "}", "return", "(", "(", "player", ".", "getItemInHand", "(", ")", ".", "getType", "(", ")", "==", "stick", ".", "getTool", "(", ")", "||", "stick", ".", "isThrowBuild", "(", ")", ")", "&&", "stick", ".", "isEnabled", "(", ")", "&&", "permissionHandler", ".", "canUse", "(", "player", ")", ")", ";", "}", "private", "void", "checkForTool", "(", "Player", "player", ",", "Stick", "stick", ")", "{", "if", "(", "stick", ".", "isEnabled", "(", ")", "&&", "permissionHandler", ".", "canUse", "(", "player", ")", "&&", "!", "stick", ".", "isThrowBuild", "(", ")", ")", "{", "if", "(", "!", "player", ".", "getInventory", "(", ")", ".", "contains", "(", "stick", ".", "getTool", "(", ")", ")", ")", "{", "InventoryUtil", ".", "giveItems", "(", "player", ",", "stick", ".", "getTool", "(", ")", ",", "player", ".", "getInventory", "(", ")", ".", "getHeldItemSlot", "(", ")", ")", ";", "if", "(", "stick", ".", "isDebug", "(", ")", ")", "{", "MessageUtils", ".", "send", "(", "player", ",", "\"\"", "+", "MaterialUtils", ".", "getFormattedName", "(", "stick", ".", "getTool", "(", ")", ")", "+", "\"\"", "+", "getName", "(", ")", ")", ";", "}", "}", "InventoryUtil", ".", "switchToItems", "(", "player", ",", "stick", ".", "getTool", "(", ")", ")", ";", "}", "}", "private", "boolean", "checkOptionalItemSwitch", "(", "Player", "player", ",", "String", "item", ",", "Stick", "stick", ")", "{", "if", "(", "StringUtils", ".", "isEmpty", "(", "item", ")", ")", "{", "return", "true", ";", "}", "Item", "i", "=", "null", ";", "try", "{", "i", "=", "new", "Item", "(", "item", ")", ";", "stick", ".", "setItem", "(", "i", ")", ";", "return", "true", ";", "}", "catch", "(", "InstantiationException", "e", ")", "{", "}", "MessageUtils", ".", "send", "(", "player", ",", "ChatColor", ".", "RED", ",", "\"\"", ")", ";", "String", "match", ";", "List", "<", "Material", ">", "items", "=", "MaterialUtils", ".", "getMatchingMaterials", "(", "item", ")", ";", "if", "(", "items", ".", "size", "(", ")", ">", "1", ")", "match", "=", "MaterialUtils", ".", "getFormattedNameList", "(", "items", ")", ".", "toString", "(", ")", ";", "else", "match", "=", "\"\"", ";", "MessageUtils", ".", "send", "(", "player", ",", "\"'\"", "+", "item", "+", "\"'", "matches", "\"", "+", "match", ")", ";", "return", "false", ";", "}", "public", "boolean", "doConfig", "(", "Player", "player", ",", "Stick", "stick", ",", "String", "[", "]", "originalArgs", ")", "{", "if", "(", "originalArgs", ".", "length", "<", "2", ")", "{", "MessageUtils", ".", "send", "(", "player", ",", "stick", ".", "showSettings", "(", ")", ")", ";", "return", "true", ";", "}", "String", "param", "=", "originalArgs", "[", "1", "]", ";", "if", "(", "!", "permissionHandler", ".", "canConfigure", "(", "player", ",", "param", ")", ")", "{", "MessageUtils", ".", "send", "(", "player", ",", "CreativeStickCommand", ".", "CONFIG", ".", "showAccessDenied", "(", ")", ")", ";", "return", "true", ";", "}", "String", "value", "=", "StringUtils", ".", "join", "(", "\"", "\"", ",", "originalArgs", ",", "2", ")", ";", "if", "(", "stick", ".", "isDebug", "(", ")", ")", "{", "MessageUtils", ".", "send", "(", "player", ",", "\"value", "is", "\"", "+", "value", ")", ";", "}", "if", "(", "commandEquals", "(", "param", ",", "\"distance\"", ")", ")", "{", "int", "distance", "=", "stick", ".", "getDistance", "(", ")", ";", "try", "{", "distance", "=", "Integer", ".", "valueOf", "(", "value", ")", ".", "intValue", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "MessageUtils", ".", "send", "(", "player", ",", "ChatColor", ".", "RED", ",", "\"\"", ")", ";", "return", "false", ";", "}", "if", "(", "distance", "!=", "stick", ".", "getDistance", "(", ")", ")", "{", "stick", ".", "setDistance", "(", "distance", ")", ";", "MessageUtils", ".", "send", "(", "player", ",", "\"\"", "+", "distance", "+", "\".\"", ")", ";", "}", "return", "true", ";", "}", "if", "(", "commandEquals", "(", "param", ",", "\"tool\"", ")", ")", "{", "if", "(", "!", "stick", ".", "setTool", "(", "value", ")", ")", "{", "MessageUtils", ".", "send", "(", "player", ",", "ChatColor", ".", "RED", ",", "\"\"", ")", ";", "return", "false", ";", "}", "MessageUtils", ".", "send", "(", "player", ",", "\"\"", "+", "stick", ".", "getToolName", "(", ")", "+", "\".\"", ")", ";", "return", "true", ";", "}", "if", "(", "commandEquals", "(", "param", ",", "\"\"", ")", ")", "{", "boolean", "protectBottom", "=", "StringUtils", ".", "isTrue", "(", "value", ")", ";", "stick", ".", "doProtectBottom", "(", "protectBottom", ")", ";", "if", "(", "protectBottom", ")", "MessageUtils", ".", "send", "(", "player", ",", "\"\"", ")", ";", "else", "MessageUtils", ".", "send", "(", "player", ",", "\"\"", ")", ";", "return", "true", ";", "}", "if", "(", "commandEquals", "(", "param", ",", "\"\"", ")", ")", "{", "boolean", "naturalDrops", "=", "StringUtils", ".", "isTrue", "(", "value", ")", ";", "stick", ".", "setNaturalDrops", "(", "naturalDrops", ")", ";", "if", "(", "naturalDrops", ")", "MessageUtils", ".", "send", "(", "player", ",", "\"\"", ")", ";", "else", "MessageUtils", ".", "send", "(", "player", ",", "\"\"", ")", ";", "return", "true", ";", "}", "if", "(", "commandEquals", "(", "param", ",", "\"\"", ")", ")", "{", "boolean", "doRightClickModes", "=", "StringUtils", ".", "isTrue", "(", "value", ")", ";", "stick", ".", "setRightClickModes", "(", "doRightClickModes", ")", ";", "if", "(", "doRightClickModes", ")", "MessageUtils", ".", "send", "(", "player", ",", "\"\"", ")", ";", "else", "MessageUtils", ".", "send", "(", "player", ",", "\"\"", ")", ";", "return", "true", ";", "}", "if", "(", "commandEquals", "(", "param", ",", "\"\"", ")", ")", "{", "boolean", "doRightClickSwitch", "=", "StringUtils", ".", "isTrue", "(", "value", ")", ";", "stick", ".", "setRightClickSwitch", "(", "doRightClickSwitch", ")", ";", "if", "(", "doRightClickSwitch", ")", "MessageUtils", ".", "send", "(", "player", ",", "\"\"", ")", ";", "else", "MessageUtils", ".", "send", "(", "player", ",", "\"\"", ")", ";", "return", "true", ";", "}", "if", "(", "commandEquals", "(", "param", ",", "\"undo\"", ")", ")", "{", "int", "undo", ";", "try", "{", "undo", "=", "Integer", ".", "valueOf", "(", "value", ")", ".", "intValue", "(", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "MessageUtils", ".", "send", "(", "player", ",", "ChatColor", ".", "RED", ",", "\"\"", ")", ";", "return", "false", ";", "}", "stick", ".", "setUndoAmount", "(", "undo", ")", ";", "MessageUtils", ".", "send", "(", "player", ",", "\"\"", "+", "undo", ")", ";", "return", "true", ";", "}", "if", "(", "commandEquals", "(", "param", ",", "\"debug-mode\"", ")", ")", "{", "boolean", "doDebug", "=", "StringUtils", ".", "isTrue", "(", "value", ")", ";", "stick", ".", "setDebug", "(", "doDebug", ")", ";", "if", "(", "doDebug", ")", "MessageUtils", ".", "send", "(", "player", ",", "\"\"", ")", ";", "else", "MessageUtils", ".", "send", "(", "player", ",", "\"\"", ")", ";", "return", "true", ";", "}", "if", "(", "commandEquals", "(", "param", ",", "\"announce\"", ")", ")", "{", "boolean", "announce", "=", "StringUtils", ".", "isTrue", "(", "value", ")", ";", "stick", ".", "setAnnounce", "(", "announce", ")", ";", "if", "(", "announce", ")", "MessageUtils", ".", "send", "(", "player", ",", "\"\"", ")", ";", "else", "MessageUtils", ".", "send", "(", "player", ",", "\"\"", ")", ";", "return", "true", ";", "}", "if", "(", "commandEquals", "(", "param", ",", "\"throw-build\"", ")", ")", "{", "boolean", "throwBuild", "=", "StringUtils", ".", "isTrue", "(", "value", ")", ";", "stick", ".", "setThrowBuild", "(", "throwBuild", ")", ";", "if", "(", "throwBuild", ")", "{", "MessageUtils", ".", "send", "(", "player", ",", "\"\"", ")", ";", "}", "else", "{", "MessageUtils", ".", "send", "(", "player", ",", "\"\"", ")", ";", "}", "return", "true", ";", "}", "return", "false", ";", "}", "private", "boolean", "commandEquals", "(", "String", "param", ",", "String", "string", ")", "{", "if", "(", "(", "param", "==", "null", "&&", "string", "!=", "null", ")", "||", "(", "param", "!=", "null", "&&", "string", "==", "null", ")", ")", "{", "return", "false", ";", "}", "else", "if", "(", "param", "==", "null", ")", "{", "return", "true", ";", "}", "String", "cmd", "=", "string", ".", "toLowerCase", "(", ")", ";", "String", "abbr", "=", "cmd", ".", "substring", "(", "0", ",", "1", ")", ";", "int", "n", "=", "cmd", ".", "indexOf", "(", "'-'", ")", ";", "while", "(", "n", "!=", "-", "1", ")", "{", "abbr", "+=", "cmd", ".", "substring", "(", "n", "+", "1", ",", "n", "+", "2", ")", ";", "n", "=", "cmd", ".", "indexOf", "(", "'-'", ",", "n", "+", "1", ")", ";", "}", "return", "(", "param", ".", "equalsIgnoreCase", "(", "cmd", ")", "||", "param", ".", "equalsIgnoreCase", "(", "abbr", ")", ")", ";", "}", "public", "void", "doIgnore", "(", "Player", "player", ",", "Stick", "stick", ",", "String", "[", "]", "originalArgs", ")", "{", "if", "(", "originalArgs", ".", "length", "==", "1", ")", "{", "MessageUtils", ".", "send", "(", "player", ",", "ChatColor", ".", "RED", ",", "\"Usage:", "/cs", "\"", "+", "CreativeStickCommand", ".", "IGNORE", ".", "toString", "(", ")", ")", ";", "return", ";", "}", "String", "value", "=", "StringUtils", ".", "join", "(", "\"", "\"", ",", "originalArgs", ",", "1", ")", ";", "String", "[", "]", "args", "=", "value", ".", "split", "(", "\",\"", ")", ";", "for", "(", "String", "arg", ":", "args", ")", "{", "if", "(", "arg", ".", "startsWith", "(", "\"+\"", ")", ")", "{", "stick", ".", "ignore", "(", "MaterialUtils", ".", "getMaterial", "(", "arg", ".", "substring", "(", "1", ")", ")", ")", ";", "}", "else", "if", "(", "arg", ".", "startsWith", "(", "\"-\"", ")", ")", "{", "stick", ".", "unignore", "(", "MaterialUtils", ".", "getMaterial", "(", "arg", ".", "substring", "(", "1", ")", ")", ")", ";", "}", "else", "{", "stick", ".", "onlyIgnore", "(", "MaterialUtils", ".", "getMaterial", "(", "arg", ")", ")", ";", "}", "}", "MessageUtils", ".", "send", "(", "player", ",", "\"\"", "+", "MaterialUtils", ".", "getFormattedNameList", "(", "stick", ".", "getIgnore", "(", ")", ")", ")", ";", "}", "public", "int", "doUndo", "(", "Player", "player", ",", "Stick", "stick", ",", "int", "amount", ")", "{", "if", "(", "!", "permissionHandler", ".", "hasPermission", "(", "player", ",", "CreativeStickCommand", ".", "UNDO", ".", "getPermission", "(", ")", ")", ")", "return", "-", "1", ";", "Vector", "<", "BlockState", ">", "blocks", "=", "stick", ".", "getBlocks", "(", ")", ";", "int", "blocksRemoved", "=", "0", ";", "int", "lastIndex", "=", "blocks", ".", "size", "(", ")", ";", "int", "currentIndex", "=", "lastIndex", "-", "1", ";", "for", "(", "blocksRemoved", "=", "0", ";", "blocksRemoved", "<", "(", "lastIndex", ">", "amount", "?", "amount", ":", "lastIndex", ")", ";", "blocksRemoved", "++", ")", "{", "BlockState", "blockState", "=", "blocks", ".", "remove", "(", "currentIndex", "--", ")", ";", "Block", "block", "=", "player", ".", "getWorld", "(", ")", ".", "getBlockAt", "(", "blockState", ".", "getX", "(", ")", ",", "blockState", ".", "getY", "(", ")", ",", "blockState", ".", "getZ", "(", ")", ")", ";", "if", "(", "configLoader", ".", "useBlockSpawnPermission", "(", ")", "&&", "!", "permissionHandler", ".", "canSpawnBlocks", "(", "player", ")", ")", "{", "InventoryUtil", ".", "giveItems", "(", "player", ",", "new", "ItemStack", "(", "block", ".", "getType", "(", ")", ",", "1", ",", "(", "short", ")", "0", ",", "block", ".", "getData", "(", ")", ")", ")", ";", "}", "block", ".", "setTypeId", "(", "blockState", ".", "getTypeId", "(", ")", ")", ";", "block", ".", "setData", "(", "blockState", ".", "getRawData", "(", ")", ")", ";", "}", "player", ".", "updateInventory", "(", ")", ";", "blocks", ".", "trimToSize", "(", ")", ";", "return", "blocksRemoved", ";", "}", "public", "void", "doUndo", "(", "Player", "player", ",", "Stick", "stick", ",", "String", "what", ")", "{", "int", "amount", "=", "stick", ".", "getUndoAmount", "(", ")", ";", "boolean", "all", "=", "false", ";", "if", "(", "what", "!=", "\"\"", ")", "{", "if", "(", "what", ".", "equalsIgnoreCase", "(", "\"all\"", ")", ")", "all", "=", "true", ";", "else", "{", "try", "{", "amount", "=", "Integer", ".", "valueOf", "(", "what", ")", ".", "intValue", "(", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "MessageUtils", ".", "send", "(", "player", ",", "ChatColor", ".", "RED", ",", "\"\"", "+", "amount", "+", "\"!\"", ")", ";", "}", "if", "(", "amount", "<=", "0", ")", "return", ";", "}", "}", "if", "(", "all", ")", "amount", "=", "stick", ".", "getBlocks", "(", ")", ".", "size", "(", ")", ";", "if", "(", "amount", "==", "0", ")", "{", "MessageUtils", ".", "send", "(", "player", ",", "\"\"", ")", ";", "}", "else", "{", "int", "blocksRemoved", "=", "doUndo", "(", "player", ",", "stick", ",", "amount", ")", ";", "if", "(", "blocksRemoved", ">", "0", ")", "{", "if", "(", "all", ")", "MessageUtils", ".", "send", "(", "player", ",", "\"\"", ")", ";", "else", "MessageUtils", ".", "send", "(", "player", ",", "\"Last", "\"", "+", "blocksRemoved", "+", "\"\"", ")", ";", "}", "else", "if", "(", "blocksRemoved", "<", "0", ")", "{", "MessageUtils", ".", "send", "(", "player", ",", "ChatColor", ".", "RED", ",", "\"\"", ")", ";", "}", "}", "}", "private", "String", "getItemFromArgs", "(", "String", "[", "]", "args", ")", "{", "if", "(", "args", ".", "length", "<=", "1", ")", "{", "return", "\"\"", ";", "}", "StringBuilder", "name", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "n", "=", "1", ";", "n", "<", "args", ".", "length", ";", "n", "++", ")", "{", "int", "i", "=", "args", "[", "n", "]", ".", "indexOf", "(", "','", ")", ";", "if", "(", "i", "!=", "-", "1", ")", "{", "}", "else", "{", "name", ".", "append", "(", "args", "[", "n", "]", ")", ";", "name", ".", "append", "(", "\"", "\"", ")", ";", "}", "}", "return", "name", ".", "toString", "(", ")", ".", "trim", "(", ")", ";", "}", "public", "Stick", "getStick", "(", "Player", "player", ")", "{", "Stick", "stick", ";", "if", "(", "!", "sticks", ".", "containsKey", "(", "player", ")", ")", "{", "stick", "=", "new", "Stick", "(", "configLoader", ")", ";", "sticks", ".", "put", "(", "player", ",", "stick", ")", ";", "checkForTool", "(", "player", ",", "stick", ")", ";", "}", "stick", "=", "sticks", ".", "get", "(", "player", ")", ";", "if", "(", "stick", ".", "isThrowBuild", "(", ")", ")", "{", "stick", ".", "setItem", "(", "new", "Item", "(", "player", ".", "getItemInHand", "(", ")", ")", ")", ";", "}", "return", "stick", ";", "}", "private", "void", "giveItems", "(", "Player", "player", ",", "BlockState", "state", ")", "{", "Stick", "stick", "=", "getStick", "(", "player", ")", ";", "List", "<", "ItemStack", ">", "items", ";", "if", "(", "stick", ".", "isDrops", "(", ")", ")", "{", "if", "(", "stick", ".", "doesNaturalDrops", "(", ")", ")", "{", "items", "=", "MaterialUtils", ".", "getDroppedMaterial", "(", "state", ")", ";", "}", "else", "{", "items", "=", "new", "ArrayList", "<", "ItemStack", ">", "(", ")", ";", "items", ".", "add", "(", "new", "ItemStack", "(", "state", ".", "getTypeId", "(", ")", ",", "1", ",", "(", "short", ")", "0", ",", "state", ".", "getRawData", "(", ")", ")", ")", ";", "}", "InventoryUtil", ".", "giveItems", "(", "player", ",", "items", ")", ";", "for", "(", "ItemStack", "is", ":", "items", ")", "{", "if", "(", "isDebug", "(", "player", ")", ")", "{", "log", "(", "player", ".", "getName", "(", ")", "+", "\"", "received", "\"", "+", "is", ".", "getAmount", "(", ")", "+", "\"", "\"", "+", "MaterialUtils", ".", "getFormattedName", "(", "is", ")", ")", ";", "}", "}", "}", "}", "public", "boolean", "isDebug", "(", "Player", "player", ")", "{", "return", "getStick", "(", "player", ")", ".", "isDebug", "(", ")", ";", "}", "@", "Override", "public", "boolean", "onCommand", "(", "CommandSender", "sender", ",", "Command", "command", ",", "String", "commandLabel", ",", "String", "[", "]", "args", ")", "{", "Player", "player", "=", "null", ";", "if", "(", "sender", "instanceof", "Player", ")", "{", "player", "=", "(", "Player", ")", "sender", ";", "}", "else", "{", "sender", ".", "sendMessage", "(", "\"\"", ")", ";", "return", "false", ";", "}", "Stick", "stick", "=", "null", ";", "String", "c", "=", "args", ".", "length", ">=", "1", "?", "args", "[", "0", "]", ":", "\"help\"", ";", "CreativeStickCommand", "cmd", "=", "CreativeStickCommand", ".", "getCommand", "(", "c", ")", ";", "if", "(", "!", "permissionHandler", ".", "hasPermission", "(", "player", ",", "cmd", ".", "getPermission", "(", ")", ")", ")", "{", "MessageUtils", ".", "send", "(", "player", ",", "cmd", ".", "showAccessDenied", "(", ")", ")", ";", "return", "true", ";", "}", "stick", "=", "getStick", "(", "player", ")", ";", "boolean", "success", "=", "true", ";", "switch", "(", "cmd", ")", "{", "case", "HELP", ":", "MessageUtils", ".", "send", "(", "player", ",", "CreativeStickCommand", ".", "getHelp", "(", "player", ",", "command", ")", ")", ";", "break", ";", "case", "VERSION", ":", "StringBuilder", "msg", "=", "new", "StringBuilder", "(", "getName", "(", ")", ")", ";", "msg", ".", "append", "(", "\"", "v\"", ")", ";", "msg", ".", "append", "(", "getVersion", "(", ")", ")", ";", "msg", ".", "append", "(", "\"nWebsite:", "\"", ")", ";", "msg", ".", "append", "(", "getDescription", "(", ")", ".", "getWebsite", "(", ")", ")", ";", "msg", ".", "append", "(", "\"nAuthors:", "\"", ")", ";", "for", "(", "String", "author", ":", "getDescription", "(", ")", ".", "getAuthors", "(", ")", ")", "{", "msg", ".", "append", "(", "author", ")", ";", "msg", ".", "append", "(", "\",", "\"", ")", ";", "}", "MessageUtils", ".", "send", "(", "player", ",", "msg", ".", "substring", "(", "0", ",", "msg", ".", "length", "(", ")", "-", "2", ")", ")", ";", "break", ";", "case", "TOGGLE_DROPS", ":", "stick", ".", "toggleDrops", "(", ")", ";", "MessageUtils", ".", "send", "(", "player", ",", "\"\"", "+", "(", "stick", ".", "isDrops", "(", ")", "?", "\"enabled\"", ":", "\"disabled\"", ")", "+", "\".\"", ")", ";", "break", ";", "case", "TOGGLE", ":", "toggle", "(", "player", ",", "stick", ")", ";", "break", ";", "case", "TOGGLE_MODE", ":", "if", "(", "!", "stick", ".", "isEnabled", "(", ")", ")", "{", "toggle", "(", "player", ",", "stick", ")", ";", "}", "success", "=", "toggleMode", "(", "player", ",", "stick", ",", "getItemFromArgs", "(", "args", ")", ")", ";", "break", ";", "case", "BUILD", ":", "if", "(", "!", "stick", ".", "isEnabled", "(", ")", ")", "{", "toggle", "(", "player", ",", "stick", ")", ";", "}", "success", "=", "toggleBuild", "(", "player", ",", "stick", ",", "getItemFromArgs", "(", "args", ")", ")", ";", "break", ";", "case", "REPLACE", ":", "if", "(", "!", "stick", ".", "isEnabled", "(", ")", ")", "{", "toggle", "(", "player", ",", "stick", ")", ";", "}", "success", "=", "toggleReplace", "(", "player", ",", "stick", ",", "getItemFromArgs", "(", "args", ")", ")", ";", "break", ";", "case", "IGNORE", ":", "doIgnore", "(", "player", ",", "stick", ",", "args", ")", ";", "break", ";", "case", "UNDO", ":", "doUndo", "(", "player", ",", "stick", ",", "args", ".", "length", ">", "1", "?", "args", "[", "1", "]", ":", "\"\"", ")", ";", "break", ";", "case", "CONFIG", ":", "success", "=", "doConfig", "(", "player", ",", "stick", ",", "args", ")", ";", "break", ";", "default", ":", "success", "=", "false", ";", "}", "if", "(", "!", "success", ")", "MessageUtils", ".", "send", "(", "player", ",", "ChatColor", ".", "RED", "+", "\"Usage:", "/\"", "+", "CreativeStickCommand", ".", "CREATIVE_STICK_COMMAND", "+", "\"", "\"", "+", "cmd", ")", ";", "return", "true", ";", "}", "@", "Override", "public", "void", "enablePlugin", "(", ")", "{", "setup", "(", ")", ";", "registerEvents", "(", ")", ";", "}", "private", "void", "registerEvents", "(", ")", "{", "PluginManager", "pm", "=", "server", ".", "getPluginManager", "(", ")", ";", "pm", ".", "registerEvents", "(", "playerListener", ",", "this", ")", ";", "}", "public", "void", "sendToggleMessage", "(", "Player", "player", ",", "Stick", "stick", ")", "{", "StringBuilder", "msg", "=", "new", "StringBuilder", "(", ")", ".", "append", "(", "\"You", "are", "now", "\"", ")", ".", "append", "(", "ChatColor", ".", "RED", ")", ";", "msg", ".", "append", "(", "stick", ".", "getModeAsString", "(", ")", ")", ".", "append", "(", "ChatColor", ".", "WHITE", ")", ";", "if", "(", "stick", ".", "getMode", "(", ")", "!=", "Stick", ".", "REMOVE_MODE", ")", "msg", ".", "append", "(", "\"", "with", "\"", ")", ".", "append", "(", "stick", ".", "getItemName", "(", ")", ")", ".", "append", "(", "\".\"", ")", ";", "MessageUtils", ".", "send", "(", "player", ",", "msg", ".", "toString", "(", ")", ")", ";", "}", "public", "void", "setup", "(", ")", "{", "server", "=", "getServer", "(", ")", ";", "configLoader", "=", "new", "CSConfigurationService", "(", "this", ")", ";", "permissionHandler", "=", "configLoader", ".", "getPermissionHandler", "(", ")", ";", "}", "public", "void", "takeAction", "(", "BlockState", "before", ",", "BlockState", "after", ",", "Player", "player", ")", "{", "Stick", "stick", "=", "getStick", "(", "player", ")", ";", "if", "(", "stick", ".", "doItemSwitch", "(", ")", "&&", "stick", ".", "setItem", "(", "before", ".", "getType", "(", ")", ",", "before", ".", "getData", "(", ")", ")", ")", "{", "MessageUtils", ".", "send", "(", "player", ",", "\"\"", "+", "MaterialUtils", ".", "getFormattedName", "(", "stick", ".", "getItem", "(", ")", ")", ")", ";", "}", "Block", "target", "=", "after", ".", "getBlock", "(", ")", ";", "synchronized", "(", "target", ")", "{", "target", ".", "setType", "(", "Material", ".", "AIR", ")", ";", "target", ".", "setData", "(", "(", "byte", ")", "0", ")", ";", "target", ".", "setType", "(", "after", ".", "getType", "(", ")", ")", ";", "if", "(", "configLoader", ".", "useBlockSpawnPermission", "(", ")", "&&", "target", ".", "getType", "(", ")", "!=", "Material", ".", "AIR", "&&", "!", "permissionHandler", ".", "canSpawnBlocks", "(", "player", ")", ")", "{", "InventoryUtil", ".", "remove", "(", "player", ",", "stick", ".", "getItem", "(", ")", ".", "getStack", "(", ")", ")", ";", "}", "MaterialData", "data", "=", "after", ".", "getData", "(", ")", ";", "if", "(", "data", "!=", "null", ")", "{", "target", ".", "setData", "(", "data", ".", "getData", "(", ")", ")", ";", "}", "}", "if", "(", "stick", ".", "isDebug", "(", ")", ")", "{", "log", "(", "player", ".", "getDisplayName", "(", ")", "+", "\"\"", "+", "MaterialUtils", ".", "getFormattedName", "(", "before", ".", "getType", "(", ")", ")", "+", "\"", "to", "\"", "+", "MaterialUtils", ".", "getFormattedName", "(", "after", ".", "getType", "(", ")", ")", ")", ";", "}", "stick", ".", "addBlock", "(", "before", ")", ";", "if", "(", "!", "MaterialUtils", ".", "isSameMaterial", "(", "before", ".", "getType", "(", ")", ",", "Material", ".", "AIR", ")", "&&", "player", ".", "getGameMode", "(", ")", "!=", "GameMode", ".", "CREATIVE", ")", "{", "giveItems", "(", "player", ",", "before", ")", ";", "}", "}", "public", "void", "toggle", "(", "Player", "player", ",", "Stick", "stick", ")", "{", "stick", ".", "toggle", "(", ")", ";", "MessageUtils", ".", "send", "(", "player", ",", "getName", "(", ")", "+", "\"", "has", "been", "\"", "+", "(", "stick", ".", "isEnabled", "(", ")", "?", "\"enabled\"", ":", "\"disabled\"", ")", "+", "\".\"", ")", ";", "checkForTool", "(", "player", ",", "stick", ")", ";", "}", "public", "boolean", "toggleBuild", "(", "Player", "player", ",", "Stick", "stick", ",", "String", "item", ")", "{", "if", "(", "!", "permissionHandler", ".", "hasPermission", "(", "player", ",", "CreativeStickCommand", ".", "BUILD", ".", "getPermission", "(", ")", ")", ")", "return", "false", ";", "if", "(", "!", "checkOptionalItemSwitch", "(", "player", ",", "item", ",", "stick", ")", ")", "return", "false", ";", "if", "(", "stick", ".", "getItem", "(", ")", "==", "null", ")", "{", "MessageUtils", ".", "send", "(", "player", ",", "\"\"", ")", ";", "return", "false", ";", "}", "else", "{", "stick", ".", "setMode", "(", "2", ")", ";", "sendToggleMessage", "(", "player", ",", "stick", ")", ";", "}", "return", "true", ";", "}", "public", "boolean", "toggleMode", "(", "Player", "player", ",", "Stick", "stick", ",", "String", "item", ")", "{", "if", "(", "!", "permissionHandler", ".", "hasPermission", "(", "player", ",", "CreativeStickCommand", ".", "TOGGLE_MODE", ".", "getPermission", "(", ")", ")", ")", "return", "false", ";", "if", "(", "!", "checkOptionalItemSwitch", "(", "player", ",", "item", ",", "stick", ")", ")", "return", "false", ";", "if", "(", "!", "stick", ".", "isEnabled", "(", ")", ")", "{", "stick", ".", "toggle", "(", ")", ";", "sendToggleMessage", "(", "player", ",", "stick", ")", ";", "return", "true", ";", "}", "else", "if", "(", "stick", ".", "getMode", "(", ")", "==", "Stick", ".", "REMOVE_MODE", ")", "{", "stick", ".", "setMode", "(", "Stick", ".", "REPLACE_MODE", ")", ";", "}", "else", "if", "(", "stick", ".", "getMode", "(", ")", "==", "Stick", ".", "REPLACE_MODE", ")", "{", "stick", ".", "setMode", "(", "Stick", ".", "BUILD_MODE", ")", ";", "}", "else", "{", "stick", ".", "setMode", "(", "Stick", ".", "REMOVE_MODE", ")", ";", "}", "sendToggleMessage", "(", "player", ",", "stick", ")", ";", "return", "true", ";", "}", "public", "boolean", "toggleReplace", "(", "Player", "player", ",", "Stick", "stick", ",", "String", "item", ")", "{", "if", "(", "!", "permissionHandler", ".", "hasPermission", "(", "player", ",", "CreativeStickCommand", ".", "REPLACE", ".", "getPermission", "(", ")", ")", ")", "return", "false", ";", "if", "(", "!", "checkOptionalItemSwitch", "(", "player", ",", "item", ",", "stick", ")", ")", "return", "false", ";", "stick", ".", "setMode", "(", "1", ")", ";", "sendToggleMessage", "(", "player", ",", "stick", ")", ";", "return", "true", ";", "}", "}", "</s>" ]
10,483
[ "<s>", "package", "com", ".", "iminurnetz", ".", "bukkit", ".", "plugin", ".", "creativestick", ";", "import", "java", ".", "util", ".", "Date", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "Vector", ";", "import", "org", ".", "bukkit", ".", "Material", ";", "import", "org", ".", "bukkit", ".", "block", ".", "BlockState", ";", "import", "org", ".", "bukkit", ".", "material", ".", "MaterialData", ";", "import", "com", ".", "iminurnetz", ".", "bukkit", ".", "util", ".", "Item", ";", "import", "com", ".", "iminurnetz", ".", "bukkit", ".", "util", ".", "MaterialUtils", ";", "public", "class", "Stick", "{", "public", "static", "final", "int", "REMOVE_MODE", "=", "0", ";", "public", "static", "final", "int", "REPLACE_MODE", "=", "1", ";", "public", "static", "final", "int", "BUILD_MODE", "=", "2", ";", "private", "int", "amount", "=", "1", ";", "private", "int", "area", "=", "0", ";", "private", "Vector", "<", "BlockState", ">", "blocks", "=", "new", "Vector", "<", "BlockState", ">", "(", ")", ";", "private", "int", "distance", ";", "private", "boolean", "drops", ";", "private", "boolean", "enabled", ";", "private", "HashSet", "<", "Byte", ">", "ignore", "=", "new", "HashSet", "<", "Byte", ">", "(", ")", ";", "private", "Item", "item", "=", "new", "Item", "(", "Material", ".", "AIR", ")", ";", "private", "int", "mode", "=", "REMOVE_MODE", ";", "private", "boolean", "protectBottom", ";", "private", "boolean", "rightClickSwitch", ";", "private", "boolean", "rightClickModes", ";", "private", "boolean", "debug", ";", "private", "Material", "tool", ";", "private", "int", "undoAmount", ";", "private", "boolean", "naturalDrops", ";", "private", "boolean", "announce", ";", "private", "int", "maxUndos", ";", "private", "long", "lastActionTakenAt", ";", "private", "boolean", "isThrowBuild", ";", "public", "Stick", "(", "CSConfigurationService", "configService", ")", "{", "this", ".", "ignore", "=", "configService", ".", "getIgnored", "(", ")", ";", "this", ".", "enabled", "=", "configService", ".", "isEnabled", "(", ")", ";", "this", ".", "drops", "=", "configService", ".", "doesDrop", "(", ")", ";", "this", ".", "undoAmount", "=", "configService", ".", "getUndoAmount", "(", ")", ";", "this", ".", "distance", "=", "configService", ".", "getDistance", "(", ")", ";", "this", ".", "protectBottom", "=", "configService", ".", "doProtectBottom", "(", ")", ";", "this", ".", "rightClickSwitch", "=", "configService", ".", "doRightClickSwitch", "(", ")", ";", "this", ".", "rightClickModes", "=", "configService", ".", "doRightClickModes", "(", ")", ";", "this", ".", "naturalDrops", "=", "configService", ".", "doesNaturalDrops", "(", ")", ";", "this", ".", "announce", "=", "configService", ".", "doAnnounce", "(", ")", ";", "this", ".", "setDebug", "(", "configService", ".", "isDebug", "(", ")", ")", ";", "this", ".", "tool", "=", "configService", ".", "getTool", "(", ")", ";", "this", ".", "maxUndos", "=", "configService", ".", "getMaxUndos", "(", ")", ";", "this", ".", "lastActionTakenAt", "=", "new", "Date", "(", ")", ".", "getTime", "(", ")", ";", "this", ".", "isThrowBuild", "=", "configService", ".", "isThrowBuild", "(", ")", ";", "}", "public", "void", "addBlock", "(", "BlockState", "blockState", ")", "{", "this", ".", "lastActionTakenAt", "=", "new", "Date", "(", ")", ".", "getTime", "(", ")", ";", "this", ".", "blocks", ".", "add", "(", "blockState", ")", ";", "if", "(", "blocks", ".", "size", "(", ")", ">", "maxUndos", ")", "{", "blocks", ".", "remove", "(", "0", ")", ";", "}", "}", "public", "boolean", "doAnnounce", "(", ")", "{", "return", "announce", ";", "}", "public", "boolean", "doProtectBottom", "(", ")", "{", "return", "protectBottom", ";", "}", "public", "void", "doProtectBottom", "(", "boolean", "protectBottom", ")", "{", "this", ".", "protectBottom", "=", "protectBottom", ";", "}", "public", "int", "getAmount", "(", ")", "{", "return", "this", ".", "amount", ";", "}", "public", "int", "getArea", "(", ")", "{", "return", "this", ".", "area", ";", "}", "public", "Vector", "<", "BlockState", ">", "getBlocks", "(", ")", "{", "return", "this", ".", "blocks", ";", "}", "public", "int", "getDistance", "(", ")", "{", "return", "this", ".", "distance", ";", "}", "public", "HashSet", "<", "Byte", ">", "getIgnore", "(", ")", "{", "return", "this", ".", "ignore", ";", "}", "public", "Item", "getItem", "(", ")", "{", "return", "this", ".", "item", ";", "}", "public", "int", "getMode", "(", ")", "{", "return", "this", ".", "mode", ";", "}", "public", "String", "getModeAsString", "(", ")", "{", "if", "(", "getItem", "(", ")", ".", "equals", "(", "Material", ".", "FLINT_AND_STEEL", ")", "&&", "getMode", "(", ")", "!=", "REMOVE_MODE", ")", "{", "return", "\"\"", ";", "}", "return", "(", "getMode", "(", ")", "==", "REMOVE_MODE", "?", "\"removing\"", ":", "(", "getMode", "(", ")", "==", "REPLACE_MODE", "?", "\"replacing\"", ":", "\"building\"", ")", ")", ";", "}", "public", "Material", "getTool", "(", ")", "{", "return", "this", ".", "tool", ";", "}", "public", "int", "getUndoAmount", "(", ")", "{", "return", "undoAmount", ";", "}", "public", "void", "ignore", "(", "Material", "m", ")", "{", "if", "(", "m", "==", "null", ")", "return", ";", "this", ".", "ignore", ".", "add", "(", "(", "byte", ")", "m", ".", "getId", "(", ")", ")", ";", "}", "public", "boolean", "isDrops", "(", ")", "{", "return", "this", ".", "drops", ";", "}", "public", "boolean", "isEnabled", "(", ")", "{", "return", "this", ".", "enabled", ";", "}", "public", "boolean", "doRightClickSwitch", "(", ")", "{", "return", "rightClickSwitch", ";", "}", "public", "boolean", "doRightClickModes", "(", ")", "{", "return", "rightClickModes", ";", "}", "public", "void", "setAmount", "(", "int", "amount", ")", "{", "this", ".", "amount", "=", "amount", ";", "}", "public", "void", "setAnnounce", "(", "boolean", "bool", ")", "{", "this", ".", "announce", "=", "bool", ";", "}", "public", "void", "setArea", "(", "int", "area", ")", "{", "this", ".", "area", "=", "area", ";", "}", "public", "void", "setDistance", "(", "int", "distance", ")", "{", "this", ".", "distance", "=", "distance", ";", "}", "public", "void", "setDrops", "(", "boolean", "drops", ")", "{", "this", ".", "drops", "=", "drops", ";", "}", "public", "void", "setEnabled", "(", "boolean", "enabled", ")", "{", "this", ".", "enabled", "=", "enabled", ";", "}", "public", "boolean", "setItem", "(", "Material", "material", ")", "{", "return", "setItem", "(", "material", ",", "material", ".", "getNewData", "(", "(", "byte", ")", "0", ")", ")", ";", "}", "public", "boolean", "setItem", "(", "Material", "material", ",", "MaterialData", "data", ")", "{", "return", "setItem", "(", "new", "Item", "(", "material", ",", "data", ")", ")", ";", "}", "public", "boolean", "setItem", "(", "Item", "item", ")", "{", "doItemSwitch", "=", "false", ";", "if", "(", "!", "MaterialUtils", ".", "isSameItem", "(", "getItem", "(", ")", ",", "item", ")", ")", "{", "this", ".", "item", "=", "item", ";", "return", "true", ";", "}", "return", "false", ";", "}", "public", "void", "setMode", "(", "int", "mode", ")", "{", "this", ".", "mode", "=", "mode", ";", "}", "public", "void", "setRightClickSwitch", "(", "boolean", "rightClickSwitch", ")", "{", "this", ".", "rightClickSwitch", "=", "rightClickSwitch", ";", "}", "public", "void", "setRightClickModes", "(", "boolean", "rightClickModes", ")", "{", "this", ".", "rightClickModes", "=", "rightClickModes", ";", "}", "public", "boolean", "setTool", "(", "String", "item", ")", "{", "Material", "m", "=", "MaterialUtils", ".", "getMaterial", "(", "item", ")", ";", "if", "(", "m", "==", "null", ")", "{", "return", "false", ";", "}", "this", ".", "tool", "=", "m", ";", "return", "true", ";", "}", "public", "void", "setUndoAmount", "(", "int", "n", ")", "{", "undoAmount", "=", "n", ";", "}", "public", "long", "getLastActionTakenAt", "(", ")", "{", "return", "lastActionTakenAt", ";", "}", "public", "String", "showSettings", "(", ")", "{", "StringBuilder", "s", "=", "new", "StringBuilder", "(", ")", ";", "s", ".", "append", "(", "\"\"", ")", ";", "s", ".", "append", "(", "(", "isEnabled", "(", ")", "?", "\"enabled\"", ":", "\"disabled\"", ")", ")", ";", "s", ".", "append", "(", "\"\"", ")", ";", "s", ".", "append", "(", "\"Tool:", "\"", ")", ";", "s", ".", "append", "(", "getToolName", "(", ")", ")", ";", "s", ".", "append", "(", "\"", "|", "\"", ")", ";", "s", ".", "append", "(", "\"Mode:", "\"", ")", ";", "s", ".", "append", "(", "getModeAsString", "(", ")", ")", ";", "s", ".", "append", "(", "\"n\"", ")", ";", "s", ".", "append", "(", "\"Drops:", "\"", ")", ";", "s", ".", "append", "(", "isDrops", "(", ")", ")", ";", "s", ".", "append", "(", "\"", "(dropping", "\"", ")", ";", "s", ".", "append", "(", "doesNaturalDrops", "(", ")", "?", "\"naturally)\"", ":", "\"anything)\"", ")", ";", "s", ".", "append", "(", "\"n\"", ")", ";", "s", ".", "append", "(", "\"\"", ")", ";", "s", ".", "append", "(", "getUndoAmount", "(", ")", ")", ";", "s", ".", "append", "(", "\"\"", ")", ";", "s", ".", "append", "(", "getBlocks", "(", ")", ".", "size", "(", ")", ")", ";", "s", ".", "append", "(", "\")n\"", ")", ";", "s", ".", "append", "(", "\"\"", ")", ";", "s", ".", "append", "(", "doProtectBottom", "(", ")", ")", ";", "s", ".", "append", "(", "\"n\"", ")", ";", "s", ".", "append", "(", "\"Distance:", "\"", ")", ";", "s", ".", "append", "(", "getDistance", "(", ")", ")", ";", "s", ".", "append", "(", "\"n\"", ")", ";", "s", ".", "append", "(", "\"\"", ")", ";", "s", ".", "append", "(", "doRightClickSwitch", "(", ")", ")", ";", "s", ".", "append", "(", "\"n\"", ")", ";", "s", ".", "append", "(", "\"\"", ")", ";", "s", ".", "append", "(", "doRightClickModes", "(", ")", ")", ";", "s", ".", "append", "(", "\"n\"", ")", ";", "s", ".", "append", "(", "\"\"", ")", ";", "s", ".", "append", "(", "doAnnounce", "(", ")", ")", ";", "s", ".", "append", "(", "\"n\"", ")", ";", "s", ".", "append", "(", "\"Debug", "mode:", "\"", ")", ";", "s", ".", "append", "(", "isDebug", "(", ")", ")", ";", "s", ".", "append", "(", "\"n\"", ")", ";", "s", ".", "append", "(", "\"\"", ")", ";", "s", ".", "append", "(", "MaterialUtils", ".", "getFormattedNameList", "(", "getIgnore", "(", ")", ")", ")", ";", "s", ".", "append", "(", "\"n\"", ")", ";", "return", "s", ".", "toString", "(", ")", ";", "}", "public", "void", "toggle", "(", ")", "{", "this", ".", "enabled", "=", "(", "!", "isEnabled", "(", ")", ")", ";", "}", "public", "void", "toggleDrops", "(", ")", "{", "this", ".", "drops", "=", "(", "!", "isDrops", "(", ")", ")", ";", "}", "public", "void", "unignore", "(", "Material", "material", ")", "{", "if", "(", "material", "==", "null", ")", "return", ";", "this", ".", "ignore", ".", "remove", "(", "(", "byte", ")", "material", ".", "getId", "(", ")", ")", ";", "}", "public", "String", "getItemName", "(", ")", "{", "return", "MaterialUtils", ".", "getFormattedName", "(", "getItem", "(", ")", ")", ";", "}", "public", "String", "getToolName", "(", ")", "{", "return", "MaterialUtils", ".", "getFormattedName", "(", "getTool", "(", ")", ")", ";", "}", "public", "void", "setDebug", "(", "boolean", "debug", ")", "{", "this", ".", "debug", "=", "debug", ";", "}", "public", "boolean", "isDebug", "(", ")", "{", "return", "debug", ";", "}", "public", "void", "setNaturalDrops", "(", "boolean", "b", ")", "{", "this", ".", "naturalDrops", "=", "b", ";", "}", "public", "boolean", "doesNaturalDrops", "(", ")", "{", "return", "naturalDrops", ";", "}", "private", "boolean", "doItemSwitch", "=", "false", ";", "public", "void", "setDoItemSwitch", "(", "boolean", "b", ")", "{", "doItemSwitch", "=", "b", "&&", "doRightClickSwitch", "(", ")", ";", "}", "public", "boolean", "doItemSwitch", "(", ")", "{", "return", "doItemSwitch", ";", "}", "public", "void", "onlyIgnore", "(", "Material", "material", ")", "{", "if", "(", "material", "==", "null", ")", "return", ";", "this", ".", "ignore", "=", "new", "HashSet", "<", "Byte", ">", "(", ")", ";", "ignore", "(", "Material", ".", "AIR", ")", ";", "ignore", "(", "material", ")", ";", "}", "public", "void", "setThrowBuild", "(", "boolean", "isThrowBuild", ")", "{", "this", ".", "isThrowBuild", "=", "isThrowBuild", ";", "}", "public", "boolean", "isThrowBuild", "(", ")", "{", "return", "isThrowBuild", ";", "}", "}", "</s>" ]
10,484
[ "<s>", "package", "com", ".", "iminurnetz", ".", "bukkit", ".", "plugin", ".", "creativestick", ";", "import", "org", ".", "bukkit", ".", "ChatColor", ";", "import", "org", ".", "bukkit", ".", "command", ".", "Command", ";", "import", "org", ".", "bukkit", ".", "entity", ".", "Player", ";", "import", "com", ".", "iminurnetz", ".", "util", ".", "EnumUtil", ";", "public", "enum", "CreativeStickCommand", "{", "HELP", "(", "\"-h\"", ",", "\"\"", ",", "\"[command]\"", ",", "CSPermissionHandler", ".", "CAN_USE_PERMISSION", ")", ",", "TOGGLE", "(", "\"-t\"", ",", "\"\"", ",", "\"\"", ",", "CSPermissionHandler", ".", "CAN_USE_PERMISSION", ")", ",", "TOGGLE_MODE", "(", "\"-tm\"", ",", "\"\"", ",", "\"<item>\"", ",", "CSPermissionHandler", ".", "CAN_USE_PERMISSION", ")", ",", "BUILD", "(", "\"-b\"", ",", "\"\"", ",", "\"<item>\"", ",", "CSPermissionHandler", ".", "CAN_USE_PERMISSION", ")", ",", "REPLACE", "(", "\"-r\"", ",", "\"\"", ",", "\"<item>\"", ",", "CSPermissionHandler", ".", "CAN_USE_PERMISSION", ")", ",", "IGNORE", "(", "\"-i\"", ",", "\"\"", ",", "\"\"", ",", "CSPermissionHandler", ".", "CAN_USE_PERMISSION", ")", ",", "TOGGLE_DROPS", "(", "\"-td\"", ",", "\"\"", ",", "\"\"", ",", "CSPermissionHandler", ".", "CAN_USE_PERMISSION", ")", ",", "UNDO", "(", "\"-u\"", ",", "\"\"", ",", "\"<n>|'all'\"", ",", "CSPermissionHandler", ".", "CAN_USE_PERMISSION", ")", ",", "CONFIG", "(", "\"-c\"", ",", "\"\"", ",", "\"\"", ",", "CSPermissionHandler", ".", "CAN_USE_PERMISSION", ")", ",", "VERSION", "(", "\"-v\"", ",", "\"\"", ",", "\"\"", ",", "CSPermissionHandler", ".", "CAN_USE_PERMISSION", ")", ";", "public", "static", "final", "String", "CREATIVE_STICK_COMMAND", "=", "\"cs\"", ";", "private", "String", "synonym", ";", "private", "String", "helpText", ";", "private", "String", "parameters", ";", "private", "String", "permission", ";", "private", "CreativeStickCommand", "(", "String", "synonym", ",", "String", "helpText", ",", "String", "parameters", ",", "String", "permission", ")", "{", "this", ".", "synonym", "=", "synonym", ";", "this", ".", "helpText", "=", "helpText", ";", "this", ".", "parameters", "=", "parameters", ";", "this", ".", "permission", "=", "permission", ";", "}", "private", "static", "int", "longestCmd", "=", "0", ";", "static", "{", "for", "(", "CreativeStickCommand", "cmd", ":", "CreativeStickCommand", ".", "values", "(", ")", ")", "CreativeStickCommand", ".", "longestCmd", "=", "Math", ".", "max", "(", "CreativeStickCommand", ".", "longestCmd", ",", "cmd", ".", "name", "(", ")", ".", "length", "(", ")", "+", "cmd", ".", "getParameters", "(", ")", ".", "length", "(", ")", "+", "4", ")", ";", "}", "public", "String", "getSynonym", "(", ")", "{", "return", "synonym", ";", "}", "public", "String", "getHelpText", "(", ")", "{", "return", "helpText", ";", "}", "public", "String", "getParameters", "(", ")", "{", "return", "parameters", ";", "}", "public", "String", "getPermission", "(", ")", "{", "return", "permission", ";", "}", "@", "Override", "public", "String", "toString", "(", ")", "{", "String", "param", "=", "\"", "\"", "+", "getParameters", "(", ")", ";", "if", "(", "param", ".", "length", "(", ")", "==", "1", ")", "param", "=", "\"\"", ";", "String", "cmd", "=", "getSynonym", "(", ")", "+", "\"|\"", "+", "EnumUtil", ".", "getSerializationName", "(", "this", ")", "+", "param", ";", "return", "cmd", "+", "\"", "-", "\"", "+", "getHelpText", "(", ")", ";", "}", "public", "static", "CreativeStickCommand", "getCommand", "(", "String", "command", ")", "{", "for", "(", "CreativeStickCommand", "cmd", ":", "CreativeStickCommand", ".", "values", "(", ")", ")", "{", "if", "(", "EnumUtil", ".", "getSerializationName", "(", "cmd", ")", ".", "equalsIgnoreCase", "(", "command", ")", "||", "cmd", ".", "getSynonym", "(", ")", ".", "equalsIgnoreCase", "(", "command", ")", ")", "return", "cmd", ";", "}", "return", "CreativeStickCommand", ".", "HELP", ";", "}", "public", "static", "String", "getHelp", "(", "Player", "player", ",", "Command", "command", ")", "{", "StringBuilder", "help", "=", "new", "StringBuilder", "(", ")", ";", "help", ".", "append", "(", "\"Usage:", "/\"", ")", ";", "help", ".", "append", "(", "command", ".", "getName", "(", ")", ")", ";", "for", "(", "String", "alias", ":", "command", ".", "getAliases", "(", ")", ")", "{", "help", ".", "append", "(", "\"|\"", ")", ";", "help", ".", "append", "(", "alias", ")", ";", "}", "help", ".", "append", "(", "\"\"", ")", ";", "for", "(", "CreativeStickCommand", "cmd", ":", "CreativeStickCommand", ".", "values", "(", ")", ")", "{", "if", "(", "CSPlugin", ".", "permissionHandler", ".", "hasPermission", "(", "player", ",", "cmd", ".", "getPermission", "(", ")", ")", ")", "{", "help", ".", "append", "(", "\"", "\"", "+", "cmd", ")", ";", "help", ".", "append", "(", "\"n\"", ")", ";", "}", "}", "if", "(", "help", ".", "length", "(", ")", "==", "0", ")", "help", ".", "append", "(", "\"\"", ")", ";", "return", "help", ".", "toString", "(", ")", ";", "}", "public", "String", "showAccessDenied", "(", ")", "{", "return", "ChatColor", ".", "RED", "+", "\"/\"", "+", "CREATIVE_STICK_COMMAND", "+", "\"", "\"", "+", "EnumUtil", ".", "getSerializationName", "(", "this", ")", "+", "\"\"", ";", "}", "}", "</s>" ]
10,485
[ "<s>", "package", "com", ".", "iminurnetz", ".", "bukkit", ".", "plugin", ".", "creativestick", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "org", ".", "bukkit", ".", "GameMode", ";", "import", "org", ".", "bukkit", ".", "entity", ".", "Player", ";", "import", "com", ".", "iminurnetz", ".", "bukkit", ".", "permissions", ".", "DefaultPermissions", ";", "import", "com", ".", "iminurnetz", ".", "bukkit", ".", "permissions", ".", "PermissionHandler", ";", "import", "com", ".", "iminurnetz", ".", "bukkit", ".", "permissions", ".", "PermissionHandlerService", ";", "import", "com", ".", "iminurnetz", ".", "bukkit", ".", "plugin", ".", "BukkitPlugin", ";", "public", "class", "CSPermissionHandler", "implements", "PermissionHandler", "{", "public", "static", "final", "String", "CAN_USE_PERMISSION", "=", "\"\"", ";", "public", "static", "final", "String", "CAN_CONFIGURE_PERMISSION", "=", "\"\"", ";", "public", "static", "final", "String", "CAN_DO_EVERYTHING", "=", "\"\"", ";", "private", "static", "final", "String", "CAN_SPAWN_BLOCKS", "=", "\"\"", ";", "private", "static", "HashMap", "<", "String", ",", "ArrayList", "<", "String", ">", ">", "permissions", "=", "new", "HashMap", "<", "String", ",", "ArrayList", "<", "String", ">", ">", "(", ")", ";", "private", "PermissionHandler", "permissionHandler", ";", "private", "boolean", "useOwnPermissions", "=", "false", ";", "private", "boolean", "enableOps", "=", "CSConfigurationService", ".", "ALLOW_OPS", ";", "protected", "CSPermissionHandler", "(", "BukkitPlugin", "plugin", ",", "boolean", "enableOps", ")", "{", "permissionHandler", "=", "PermissionHandlerService", ".", "getHandler", "(", "plugin", ")", ";", "if", "(", "permissionHandler", "instanceof", "DefaultPermissions", ")", "{", "(", "(", "DefaultPermissions", ")", "permissionHandler", ")", ".", "enableOps", "(", "enableOps", ")", ";", "useOwnPermissions", "=", "true", ";", "}", "}", "protected", "boolean", "usesOwnPermissions", "(", ")", "{", "return", "useOwnPermissions", ";", "}", "protected", "void", "addPermission", "(", "String", "player", ",", "String", "permission", ")", "{", "ArrayList", "<", "String", ">", "perms", "=", "permissions", ".", "get", "(", "player", ")", ";", "if", "(", "perms", "==", "null", ")", "perms", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "if", "(", "permission", ".", "equals", "(", "CAN_DO_EVERYTHING", ")", ")", "perms", ".", "removeAll", "(", "null", ")", ";", "if", "(", "!", "perms", ".", "contains", "(", "permission", ")", "&&", "!", "perms", ".", "contains", "(", "CAN_DO_EVERYTHING", ")", ")", "perms", ".", "add", "(", "permission", ")", ";", "permissions", ".", "put", "(", "player", ",", "perms", ")", ";", "}", "public", "boolean", "permission", "(", "Player", "player", ",", "String", "permission", ")", "{", "String", "name", "=", "player", ".", "getName", "(", ")", ";", "if", "(", "!", "permissions", ".", "containsKey", "(", "name", ")", ")", "{", "return", "false", ";", "}", "return", "permissions", ".", "get", "(", "name", ")", ".", "contains", "(", "permission", ")", "||", "permissions", ".", "get", "(", "name", ")", ".", "contains", "(", "CAN_DO_EVERYTHING", ")", ";", "}", "public", "boolean", "hasPermission", "(", "Player", "player", ",", "String", "permission", ")", "{", "if", "(", "enableOps", "&&", "player", ".", "isOp", "(", ")", ")", "return", "true", ";", "return", "usesOwnPermissions", "(", ")", "?", "permission", "(", "player", ",", "permission", ")", ":", "permissionHandler", ".", "hasPermission", "(", "player", ",", "permission", ")", ";", "}", "public", "boolean", "canUse", "(", "Player", "player", ")", "{", "return", "hasPermission", "(", "player", ",", "CAN_USE_PERMISSION", ")", ";", "}", "public", "boolean", "canUse", "(", "Player", "player", ",", "CreativeStickCommand", "command", ")", "{", "return", "hasPermission", "(", "player", ",", "command", ".", "getPermission", "(", ")", ")", ";", "}", "public", "boolean", "canConfigureAll", "(", "Player", "player", ")", "{", "return", "(", "hasPermission", "(", "player", ",", "CAN_CONFIGURE_PERMISSION", ")", "||", "hasPermission", "(", "player", ",", "CAN_CONFIGURE_PERMISSION", "+", "\".*\"", ")", ")", ";", "}", "public", "boolean", "canDoEverything", "(", "Player", "player", ")", "{", "return", "hasPermission", "(", "player", ",", "CAN_DO_EVERYTHING", ")", ";", "}", "public", "boolean", "canConfigure", "(", "Player", "player", ",", "String", "param", ")", "{", "return", "canConfigureAll", "(", "player", ")", "||", "hasPermission", "(", "player", ",", "CAN_CONFIGURE_PERMISSION", "+", "\".\"", "+", "param", ".", "toLowerCase", "(", ")", ")", ";", "}", "@", "Override", "public", "String", "getGroup", "(", "Player", "player", ")", "{", "return", "permissionHandler", ".", "getGroup", "(", "player", ")", ";", "}", "@", "Override", "public", "boolean", "parentGroupsInclude", "(", "Player", "player", ",", "String", "group", ")", "{", "return", "permissionHandler", ".", "parentGroupsInclude", "(", "player", ",", "group", ")", ";", "}", "public", "boolean", "canSpawnBlocks", "(", "Player", "player", ")", "{", "return", "(", "hasPermission", "(", "player", ",", "CAN_SPAWN_BLOCKS", ")", "||", "player", ".", "getGameMode", "(", ")", "==", "GameMode", ".", "CREATIVE", ")", ";", "}", "}", "</s>" ]
10,486
[ "<s>", "package", "com", ".", "iminurnetz", ".", "bukkit", ".", "plugin", ".", "creativestick", ".", "tests", ";", "import", "junit", ".", "framework", ".", "TestCase", ";", "import", "com", ".", "iminurnetz", ".", "bukkit", ".", "plugin", ".", "creativestick", ".", "CreativeStickCommand", ";", "public", "class", "CreativeStickCommandTest", "extends", "TestCase", "{", "public", "void", "testToString", "(", ")", "{", "assertEquals", "(", "\"\"", ",", "CreativeStickCommand", ".", "VERSION", ".", "toString", "(", ")", ".", "replaceAll", "(", "\"\\\\s+\"", ",", "\"", "\"", ")", ")", ";", "}", "}", "</s>" ]
10,487
[ "<s>", "package", "com", ".", "iminurnetz", ".", "bukkit", ".", "plugin", ".", "creativestick", ".", "tests", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "FileNotFoundException", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "net", ".", "URISyntaxException", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "junit", ".", "framework", ".", "TestCase", ";", "import", "org", ".", "bukkit", ".", "configuration", ".", "InvalidConfigurationException", ";", "import", "org", ".", "bukkit", ".", "configuration", ".", "file", ".", "YamlConfiguration", ";", "import", "com", ".", "iminurnetz", ".", "bukkit", ".", "plugin", ".", "creativestick", ".", "CSConfigurationService", ";", "public", "class", "CSConfigurationServiceTest", "extends", "TestCase", "{", "public", "void", "testVersion", "(", ")", "throws", "FileNotFoundException", ",", "IOException", ",", "InvalidConfigurationException", ",", "URISyntaxException", "{", "URL", "topDir", "=", "getClass", "(", ")", ".", "getResource", "(", "\"/\"", ")", ";", "File", "configFile", "=", "new", "File", "(", "new", "File", "(", "topDir", ".", "toURI", "(", ")", ")", ",", "\"\"", ")", ";", "YamlConfiguration", "config", "=", "new", "YamlConfiguration", "(", ")", ";", "config", ".", "load", "(", "configFile", ")", ";", "assertEquals", "(", "config", ".", "getDouble", "(", "\"\"", ",", "-", "1", ")", ",", "CSConfigurationService", ".", "LAST_CHANGED_IN_VERSION", ")", ";", "}", "}", "</s>" ]
10,488
[ "<s>", "package", "haveric", ".", "woolTrees", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "org", ".", "bukkit", ".", "configuration", ".", "file", ".", "FileConfiguration", ";", "import", "org", ".", "bukkit", ".", "configuration", ".", "file", ".", "YamlConfiguration", ";", "public", "class", "Config", "{", "private", "static", "WoolTrees", "plugin", ";", "private", "static", "FileConfiguration", "config", ";", "private", "static", "File", "configFile", ";", "private", "static", "FileConfiguration", "patternConfig", ";", "private", "static", "File", "patternConfigFile", ";", "private", "static", "String", "cfgTree", "=", "\"Tree", "Spawn", "%\"", ";", "private", "static", "String", "cfgWool", "=", "\"Wool", "Spawn", "%\"", ";", "private", "static", "String", "cfgBig", "=", "\"\"", ";", "private", "static", "String", "cfgCost", "=", "\"\"", ";", "private", "static", "String", "cfgHeight", "=", "\"Height", "Check\"", ";", "private", "static", "String", "cfgLight", "=", "\"Light", "Level\"", ";", "private", "static", "String", "cfgPattern", "=", "\"\"", ";", "private", "static", "String", "cfgWoolTrunk", "=", "\"Wool", "Trunks\"", ";", "private", "static", "final", "double", "TREE_DEFAULT", "=", "20.0", ";", "private", "static", "final", "double", "WOOL_DEFAULT", "=", "90.0", ";", "private", "static", "final", "double", "BIG_DEFAULT", "=", "10.0", ";", "private", "static", "final", "double", "COST_DEFAULT", "=", "1000.0", ";", "private", "static", "final", "boolean", "HEIGHT_CHECK_DEFAULT", "=", "true", ";", "private", "static", "final", "int", "LIGHT_LEVEL_DEFAULT", "=", "9", ";", "private", "static", "final", "boolean", "PATTERN_TREES_DEFAULT", "=", "true", ";", "private", "static", "final", "boolean", "WOOL_TRUNKS_DEFAULT", "=", "true", ";", "public", "static", "void", "init", "(", "WoolTrees", "wt", ")", "{", "plugin", "=", "wt", ";", "configFile", "=", "new", "File", "(", "plugin", ".", "getDataFolder", "(", ")", "+", "\"/config.yml\"", ")", ";", "patternConfigFile", "=", "new", "File", "(", "plugin", ".", "getDataFolder", "(", ")", "+", "\"\"", ")", ";", "}", "public", "static", "void", "setupConfig", "(", ")", "{", "config", "=", "YamlConfiguration", ".", "loadConfiguration", "(", "configFile", ")", ";", "String", "warn", "=", "String", ".", "format", "(", "\"\"", ",", "plugin", ".", "getDescription", "(", ")", ".", "getName", "(", ")", ")", ";", "double", "treeSpawnPercentage", "=", "config", ".", "getDouble", "(", "cfgTree", ",", "TREE_DEFAULT", ")", ";", "if", "(", "treeSpawnPercentage", "<", "0", ")", "{", "config", ".", "set", "(", "cfgTree", ",", "0.0", ")", ";", "WoolTrees", ".", "log", ".", "info", "(", "warn", "+", "\"\"", ")", ";", "}", "else", "if", "(", "treeSpawnPercentage", ">", "100", ")", "{", "config", ".", "set", "(", "cfgTree", ",", "100.0", ")", ";", "WoolTrees", ".", "log", ".", "info", "(", "warn", "+", "\"\"", ")", ";", "}", "else", "{", "config", ".", "set", "(", "cfgTree", ",", "treeSpawnPercentage", ")", ";", "}", "double", "woolSpawnPercentage", "=", "config", ".", "getDouble", "(", "cfgWool", ",", "WOOL_DEFAULT", ")", ";", "if", "(", "woolSpawnPercentage", "<", "0", ")", "{", "config", ".", "set", "(", "cfgWool", ",", "0.0", ")", ";", "WoolTrees", ".", "log", ".", "info", "(", "warn", "+", "\"\"", ")", ";", "}", "else", "if", "(", "woolSpawnPercentage", ">", "100", ")", "{", "config", ".", "set", "(", "cfgWool", ",", "100.0", ")", ";", "WoolTrees", ".", "log", ".", "info", "(", "warn", "+", "\"\"", ")", ";", "}", "else", "{", "config", ".", "set", "(", "cfgWool", ",", "woolSpawnPercentage", ")", ";", "}", "double", "bigChance", "=", "config", ".", "getDouble", "(", "cfgBig", ",", "BIG_DEFAULT", ")", ";", "if", "(", "bigChance", "<", "0", ")", "{", "config", ".", "set", "(", "cfgBig", ",", "0.0", ")", ";", "WoolTrees", ".", "log", ".", "info", "(", "warn", "+", "\"\"", ")", ";", "}", "else", "if", "(", "bigChance", ">", "100", ")", "{", "config", ".", "set", "(", "cfgBig", ",", "100.0", ")", ";", "WoolTrees", ".", "log", ".", "info", "(", "warn", "+", "\"\"", ")", ";", "}", "else", "{", "config", ".", "set", "(", "cfgBig", ",", "bigChance", ")", ";", "}", "double", "cost", "=", "config", ".", "getDouble", "(", "cfgCost", ",", "COST_DEFAULT", ")", ";", "if", "(", "cost", "<", "0", ")", "{", "config", ".", "set", "(", "cfgCost", ",", "0.0", ")", ";", "WoolTrees", ".", "log", ".", "info", "(", "warn", "+", "\"\"", ")", ";", "}", "else", "{", "config", ".", "set", "(", "cfgCost", ",", "cost", ")", ";", "}", "if", "(", "!", "config", ".", "isSet", "(", "cfgHeight", ")", ")", "{", "config", ".", "set", "(", "cfgHeight", ",", "HEIGHT_CHECK_DEFAULT", ")", ";", "}", "int", "lightLevel", "=", "config", ".", "getInt", "(", "cfgLight", ",", "LIGHT_LEVEL_DEFAULT", ")", ";", "if", "(", "lightLevel", "<", "0", ")", "{", "config", ".", "set", "(", "cfgLight", ",", "0", ")", ";", "WoolTrees", ".", "log", ".", "info", "(", "warn", "+", "\"\"", ")", ";", "}", "else", "if", "(", "lightLevel", ">", "15", ")", "{", "config", ".", "set", "(", "cfgLight", ",", "15", ")", ";", "WoolTrees", ".", "log", ".", "info", "(", "warn", "+", "\"\"", ")", ";", "}", "else", "{", "config", ".", "set", "(", "cfgLight", ",", "lightLevel", ")", ";", "}", "if", "(", "!", "config", ".", "isSet", "(", "cfgPattern", ")", ")", "{", "config", ".", "set", "(", "cfgPattern", ",", "PATTERN_TREES_DEFAULT", ")", ";", "}", "if", "(", "!", "config", ".", "isSet", "(", "cfgWoolTrunk", ")", ")", "{", "config", ".", "set", "(", "cfgWoolTrunk", ",", "WOOL_TRUNKS_DEFAULT", ")", ";", "}", "saveConfig", "(", ")", ";", "}", "public", "static", "void", "saveConfig", "(", ")", "{", "try", "{", "config", ".", "save", "(", "configFile", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "}", "public", "static", "void", "setupPatternConfig", "(", ")", "{", "patternConfig", "=", "YamlConfiguration", ".", "loadConfiguration", "(", "patternConfigFile", ")", ";", "try", "{", "patternConfig", ".", "save", "(", "patternConfigFile", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "}", "public", "static", "void", "setPattern", "(", "String", "loc", ",", "String", "colors", ")", "{", "patternConfig", ".", "set", "(", "loc", ",", "colors", ")", ";", "try", "{", "patternConfig", ".", "save", "(", "patternConfigFile", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "}", "public", "static", "String", "getPattern", "(", "String", "loc", ")", "{", "return", "patternConfig", ".", "getString", "(", "loc", ")", ";", "}", "public", "static", "double", "getTree", "(", ")", "{", "return", "config", ".", "getDouble", "(", "cfgTree", ")", ";", "}", "public", "static", "double", "getWool", "(", ")", "{", "return", "config", ".", "getDouble", "(", "cfgWool", ")", ";", "}", "public", "static", "double", "getBig", "(", ")", "{", "return", "config", ".", "getDouble", "(", "cfgBig", ")", ";", "}", "public", "static", "double", "getCost", "(", ")", "{", "return", "config", ".", "getDouble", "(", "cfgCost", ")", ";", "}", "public", "static", "boolean", "isHeightEnabled", "(", ")", "{", "return", "config", ".", "getBoolean", "(", "cfgHeight", ")", ";", "}", "public", "static", "int", "getLight", "(", ")", "{", "return", "config", ".", "getInt", "(", "cfgLight", ")", ";", "}", "public", "static", "boolean", "isPatternEnabled", "(", ")", "{", "return", "config", ".", "getBoolean", "(", "cfgPattern", ")", ";", "}", "public", "static", "boolean", "isWoolTrunksEnabled", "(", ")", "{", "return", "config", ".", "getBoolean", "(", "cfgWoolTrunk", ")", ";", "}", "public", "static", "void", "setHeight", "(", "String", "height", ")", "{", "config", ".", "set", "(", "cfgHeight", ",", "height", ")", ";", "}", "public", "static", "void", "setPatternEnabled", "(", "boolean", "enabled", ")", "{", "config", ".", "set", "(", "cfgPattern", ",", "enabled", ")", ";", "}", "public", "static", "void", "setWoolTrunk", "(", "String", "woolTrunk", ")", "{", "config", ".", "set", "(", "cfgWoolTrunk", ",", "woolTrunk", ")", ";", "}", "public", "static", "void", "setTree", "(", "Double", "tree", ")", "{", "config", ".", "set", "(", "cfgTree", ",", "tree", ")", ";", "}", "public", "static", "void", "setWool", "(", "Double", "wool", ")", "{", "config", ".", "set", "(", "cfgWool", ",", "wool", ")", ";", "}", "public", "static", "void", "setBig", "(", "Double", "big", ")", "{", "config", ".", "set", "(", "cfgBig", ",", "big", ")", ";", "}", "public", "static", "void", "setCost", "(", "Double", "cost", ")", "{", "config", ".", "set", "(", "cfgCost", ",", "cost", ")", ";", "}", "public", "static", "void", "setLight", "(", "int", "light", ")", "{", "config", ".", "set", "(", "cfgLight", ",", "light", ")", ";", "}", "}", "</s>" ]
10,489
[ "<s>", "package", "haveric", ".", "woolTrees", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "org", ".", "bukkit", ".", "ChatColor", ";", "import", "org", ".", "bukkit", ".", "Material", ";", "import", "org", ".", "bukkit", ".", "block", ".", "Block", ";", "import", "org", ".", "bukkit", ".", "command", ".", "Command", ";", "import", "org", ".", "bukkit", ".", "command", ".", "CommandExecutor", ";", "import", "org", ".", "bukkit", ".", "command", ".", "CommandSender", ";", "import", "org", ".", "bukkit", ".", "entity", ".", "Player", ";", "public", "class", "Commands", "implements", "CommandExecutor", "{", "private", "static", "String", "cmdMain", "=", "\"wooltrees\"", ";", "private", "String", "cmdMainAlt", "=", "\"wt\"", ";", "private", "String", "cmdHelp", "=", "\"help\"", ";", "private", "String", "cmdTree", "=", "\"tree\"", ";", "private", "String", "cmdWool", "=", "\"wool\"", ";", "private", "String", "cmdBig", "=", "\"big\"", ";", "private", "String", "cmdCost", "=", "\"cost\"", ";", "private", "String", "cmdCheck", "=", "\"check\"", ";", "private", "String", "cmdLight", "=", "\"light\"", ";", "private", "String", "cmdPattern", "=", "\"pattern\"", ";", "private", "String", "cmdWoolTrunk", "=", "\"trunk\"", ";", "private", "String", "cmdHere", "=", "\"here\"", ";", "private", "WoolTrees", "plugin", ";", "public", "Commands", "(", "WoolTrees", "wt", ")", "{", "plugin", "=", "wt", ";", "}", "public", "boolean", "onCommand", "(", "CommandSender", "sender", ",", "Command", "cmd", ",", "String", "commandLabel", ",", "String", "[", "]", "args", ")", "{", "ChatColor", "msgColor", "=", "ChatColor", ".", "DARK_AQUA", ";", "ChatColor", "valColor", "=", "ChatColor", ".", "GOLD", ";", "ChatColor", "defColor", "=", "ChatColor", ".", "WHITE", ";", "String", "wtTitle", "=", "msgColor", "+", "\"[\"", "+", "ChatColor", ".", "GRAY", "+", "\"WoolTrees\"", "+", "msgColor", "+", "\"]", "\"", ";", "if", "(", "sender", ".", "isOp", "(", ")", "||", "Perms", ".", "hasAdjust", "(", "(", "Player", ")", "sender", ")", ")", "{", "if", "(", "commandLabel", ".", "equalsIgnoreCase", "(", "cmdMain", ")", "||", "commandLabel", ".", "equalsIgnoreCase", "(", "cmdMainAlt", ")", ")", "{", "if", "(", "args", ".", "length", "==", "0", "||", "(", "args", ".", "length", "==", "1", "&&", "args", "[", "0", "]", ".", "equalsIgnoreCase", "(", "cmdHelp", ")", ")", ")", "{", "sender", ".", "sendMessage", "(", "wtTitle", "+", "\"\"", "+", "plugin", ".", "getDescription", "(", ")", ".", "getVersion", "(", ")", ")", ";", "sender", ".", "sendMessage", "(", "\"/\"", "+", "cmdMain", "+", "\"", "\"", "+", "cmdTree", "+", "\"", "<0-100>", "(\"", "+", "valColor", "+", "Config", ".", "getTree", "(", ")", "+", "defColor", "+", "\")", "-", "\"", "+", "msgColor", "+", "\"\"", ")", ";", "sender", ".", "sendMessage", "(", "\"/\"", "+", "cmdMain", "+", "\"", "\"", "+", "cmdWool", "+", "\"", "<0-100>", "(\"", "+", "valColor", "+", "Config", ".", "getWool", "(", ")", "+", "defColor", "+", "\")", "-", "\"", "+", "msgColor", "+", "\"\"", ")", ";", "sender", ".", "sendMessage", "(", "\"/\"", "+", "cmdMain", "+", "\"", "\"", "+", "cmdBig", "+", "\"", "<0-100>", "(\"", "+", "valColor", "+", "Config", ".", "getBig", "(", ")", "+", "defColor", "+", "\")", "-", "\"", "+", "msgColor", "+", "\"%", "big", "trees.\"", ")", ";", "sender", ".", "sendMessage", "(", "\"/\"", "+", "cmdMain", "+", "\"", "\"", "+", "cmdCost", "+", "\"", "<0+>", "(\"", "+", "valColor", "+", "Config", ".", "getCost", "(", ")", "+", "defColor", "+", "\")", "-", "\"", "+", "msgColor", "+", "\"\"", ")", ";", "sender", ".", "sendMessage", "(", "\"/\"", "+", "cmdMain", "+", "\"", "\"", "+", "cmdCheck", "+", "\"\"", "+", "valColor", "+", "Config", ".", "isHeightEnabled", "(", ")", "+", "defColor", "+", "\")", "-", "\"", "+", "msgColor", "+", "\"\"", ")", ";", "sender", ".", "sendMessage", "(", "\"/\"", "+", "cmdMain", "+", "\"", "\"", "+", "cmdLight", "+", "\"", "<0-15>", "(\"", "+", "valColor", "+", "Config", ".", "getLight", "(", ")", "+", "defColor", "+", "\")", "-", "\"", "+", "msgColor", "+", "\"Light", "Level.\"", ")", ";", "sender", ".", "sendMessage", "(", "\"/\"", "+", "cmdMain", "+", "\"", "\"", "+", "cmdPattern", "+", "\"\"", "+", "valColor", "+", "Config", ".", "isPatternEnabled", "(", ")", "+", "defColor", "+", "\")", "-", "\"", "+", "msgColor", "+", "\"\"", ")", ";", "sender", ".", "sendMessage", "(", "\"/\"", "+", "cmdMain", "+", "\"", "\"", "+", "cmdWoolTrunk", "+", "\"\"", "+", "valColor", "+", "Config", ".", "isWoolTrunksEnabled", "(", ")", "+", "defColor", "+", "\")", "-", "\"", "+", "msgColor", "+", "\"Wool", "Trunks.\"", ")", ";", "sender", ".", "sendMessage", "(", "\"/\"", "+", "cmdMain", "+", "\"", "\"", "+", "cmdHere", "+", "\"\"", "+", "defColor", "+", "\"", "-", "\"", "+", "msgColor", "+", "\"\"", ")", ";", "}", "else", "if", "(", "args", ".", "length", ">=", "1", "&&", "args", "[", "0", "]", ".", "equalsIgnoreCase", "(", "cmdHere", ")", ")", "{", "boolean", "big", "=", "false", ";", "ArrayList", "<", "Integer", ">", "colorArray", "=", "new", "ArrayList", "<", "Integer", ">", "(", ")", ";", "Double", "val", "=", "100.0", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "args", ".", "length", ";", "i", "++", ")", "{", "if", "(", "args", "[", "i", "]", ".", "equalsIgnoreCase", "(", "\"big\"", ")", ")", "{", "big", "=", "true", ";", "}", "else", "if", "(", "args", "[", "i", "]", ".", "equalsIgnoreCase", "(", "\"white\"", ")", ")", "{", "colorArray", ".", "add", "(", "0", ")", ";", "}", "else", "if", "(", "args", "[", "i", "]", ".", "equalsIgnoreCase", "(", "\"orange\"", ")", ")", "{", "colorArray", ".", "add", "(", "1", ")", ";", "}", "else", "if", "(", "args", "[", "i", "]", ".", "equalsIgnoreCase", "(", "\"magenta\"", ")", ")", "{", "colorArray", ".", "add", "(", "2", ")", ";", "}", "else", "if", "(", "args", "[", "i", "]", ".", "equalsIgnoreCase", "(", "\"lightblue\"", ")", ")", "{", "colorArray", ".", "add", "(", "3", ")", ";", "}", "else", "if", "(", "args", "[", "i", "]", ".", "equalsIgnoreCase", "(", "\"yellow\"", ")", ")", "{", "colorArray", ".", "add", "(", "4", ")", ";", "}", "else", "if", "(", "args", "[", "i", "]", ".", "equalsIgnoreCase", "(", "\"lightgreen\"", ")", ")", "{", "colorArray", ".", "add", "(", "5", ")", ";", "}", "else", "if", "(", "args", "[", "i", "]", ".", "equalsIgnoreCase", "(", "\"pink\"", ")", ")", "{", "colorArray", ".", "add", "(", "6", ")", ";", "}", "else", "if", "(", "args", "[", "i", "]", ".", "equalsIgnoreCase", "(", "\"gray\"", ")", "||", "args", "[", "i", "]", ".", "equalsIgnoreCase", "(", "\"grey\"", ")", ")", "{", "colorArray", ".", "add", "(", "7", ")", ";", "}", "else", "if", "(", "args", "[", "i", "]", ".", "equalsIgnoreCase", "(", "\"lightgray\"", ")", "||", "args", "[", "i", "]", ".", "equalsIgnoreCase", "(", "\"lightgrey\"", ")", ")", "{", "colorArray", ".", "add", "(", "8", ")", ";", "}", "else", "if", "(", "args", "[", "i", "]", ".", "equalsIgnoreCase", "(", "\"cyan\"", ")", ")", "{", "colorArray", ".", "add", "(", "9", ")", ";", "}", "else", "if", "(", "args", "[", "i", "]", ".", "equalsIgnoreCase", "(", "\"purple\"", ")", ")", "{", "colorArray", ".", "add", "(", "10", ")", ";", "}", "else", "if", "(", "args", "[", "i", "]", ".", "equalsIgnoreCase", "(", "\"blue\"", ")", ")", "{", "colorArray", ".", "add", "(", "11", ")", ";", "}", "else", "if", "(", "args", "[", "i", "]", ".", "equalsIgnoreCase", "(", "\"brown\"", ")", ")", "{", "colorArray", ".", "add", "(", "12", ")", ";", "}", "else", "if", "(", "args", "[", "i", "]", ".", "equalsIgnoreCase", "(", "\"green\"", ")", "||", "args", "[", "i", "]", ".", "equalsIgnoreCase", "(", "\"darkgreen\"", ")", ")", "{", "colorArray", ".", "add", "(", "13", ")", ";", "}", "else", "if", "(", "args", "[", "i", "]", ".", "equalsIgnoreCase", "(", "\"red\"", ")", ")", "{", "colorArray", ".", "add", "(", "14", ")", ";", "}", "else", "if", "(", "args", "[", "i", "]", ".", "equalsIgnoreCase", "(", "\"black\"", ")", ")", "{", "colorArray", ".", "add", "(", "15", ")", ";", "}", "else", "{", "try", "{", "val", "=", "Double", ".", "parseDouble", "(", "args", "[", "i", "]", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "val", "=", "100.0", ";", "}", "if", "(", "val", "<", "0", "||", "val", ">", "100", ")", "{", "val", "=", "100.0", ";", "}", "}", "}", "if", "(", "colorArray", ".", "isEmpty", "(", ")", ")", "{", "colorArray", ".", "add", "(", "0", ")", ";", "}", "Block", "b", "=", "(", "(", "Player", ")", "sender", ")", ".", "getTargetBlock", "(", "null", ",", "100", ")", ";", "if", "(", "b", ".", "getType", "(", ")", "==", "Material", ".", "AIR", ")", "{", "sender", ".", "sendMessage", "(", "wtTitle", "+", "\"\"", ")", ";", "}", "else", "{", "if", "(", "big", ")", "{", "WTPlayerInteract", ".", "makeBigTree", "(", "(", "(", "Player", ")", "sender", ")", ".", "getWorld", "(", ")", ",", "0", ",", "0", ",", "b", ".", "getX", "(", ")", ",", "b", ".", "getY", "(", ")", ",", "b", ".", "getZ", "(", ")", ",", "colorArray", ",", "val", ")", ";", "}", "else", "{", "WTPlayerInteract", ".", "makeNormalTree", "(", "(", "(", "Player", ")", "sender", ")", ".", "getWorld", "(", ")", ",", "0", ",", "0", ",", "b", ".", "getX", "(", ")", ",", "b", ".", "getY", "(", ")", ",", "b", ".", "getZ", "(", ")", ",", "colorArray", ",", "val", ")", ";", "}", "}", "}", "else", "if", "(", "args", ".", "length", "==", "2", ")", "{", "Double", "val", ";", "String", "msg", "=", "\"\"", ";", "String", "err", "=", "\"\"", ";", "if", "(", "args", "[", "1", "]", ".", "equalsIgnoreCase", "(", "\"true\"", ")", "||", "args", "[", "1", "]", ".", "equalsIgnoreCase", "(", "\"false\"", ")", ")", "{", "val", "=", "-", "1.0", ";", "}", "else", "{", "try", "{", "val", "=", "Double", ".", "parseDouble", "(", "args", "[", "1", "]", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "val", "=", "0.0", ";", "}", "}", "if", "(", "val", "<", "0", ")", "{", "if", "(", "val", "==", "-", "1.0", "&&", "args", "[", "0", "]", ".", "equalsIgnoreCase", "(", "cmdCheck", ")", ")", "{", "if", "(", "args", "[", "1", "]", ".", "equalsIgnoreCase", "(", "\"true\"", ")", ")", "{", "Config", ".", "setHeight", "(", "args", "[", "1", "]", ")", ";", "msg", "=", "\"\"", ";", "}", "else", "if", "(", "args", "[", "1", "]", ".", "equalsIgnoreCase", "(", "\"false\"", ")", ")", "{", "Config", ".", "setHeight", "(", "args", "[", "1", "]", ")", ";", "msg", "=", "\"\"", ";", "}", "else", "{", "err", "=", "\"\"", ";", "}", "}", "else", "if", "(", "val", "==", "-", "1.0", "&&", "args", "[", "0", "]", ".", "equalsIgnoreCase", "(", "cmdPattern", ")", ")", "{", "if", "(", "args", "[", "1", "]", ".", "equalsIgnoreCase", "(", "\"true\"", ")", ")", "{", "Config", ".", "setPatternEnabled", "(", "true", ")", ";", "msg", "=", "\"\"", ";", "}", "else", "if", "(", "args", "[", "1", "]", ".", "equalsIgnoreCase", "(", "\"false\"", ")", ")", "{", "Config", ".", "setPatternEnabled", "(", "false", ")", ";", "msg", "=", "\"\"", ";", "}", "else", "{", "err", "=", "\"\"", ";", "}", "}", "else", "if", "(", "val", "==", "-", "1.0", "&&", "args", "[", "0", "]", ".", "equalsIgnoreCase", "(", "cmdWoolTrunk", ")", ")", "{", "if", "(", "args", "[", "1", "]", ".", "equalsIgnoreCase", "(", "\"true\"", ")", ")", "{", "Config", ".", "setWoolTrunk", "(", "args", "[", "1", "]", ")", ";", "msg", "=", "\"\"", ";", "}", "else", "if", "(", "args", "[", "1", "]", ".", "equalsIgnoreCase", "(", "\"false\"", ")", ")", "{", "Config", ".", "setWoolTrunk", "(", "args", "[", "1", "]", ")", ";", "msg", "=", "\"\"", ";", "}", "else", "{", "err", "=", "\"\"", ";", "}", "}", "else", "{", "err", "=", "\"\"", ";", "}", "}", "else", "if", "(", "args", "[", "0", "]", ".", "equalsIgnoreCase", "(", "cmdTree", ")", ")", "{", "if", "(", "val", "<=", "100", ")", "{", "Config", ".", "setTree", "(", "val", ")", ";", "msg", "=", "\"\"", ";", "}", "else", "{", "err", "=", "\"\"", ";", "}", "}", "else", "if", "(", "args", "[", "0", "]", ".", "equalsIgnoreCase", "(", "cmdWool", ")", ")", "{", "if", "(", "val", "<=", "100", ")", "{", "Config", ".", "setWool", "(", "val", ")", ";", "msg", "=", "\"\"", ";", "}", "else", "{", "err", "=", "\"\"", ";", "}", "}", "else", "if", "(", "args", "[", "0", "]", ".", "equalsIgnoreCase", "(", "cmdBig", ")", ")", "{", "if", "(", "val", "<=", "100", ")", "{", "Config", ".", "setBig", "(", "val", ")", ";", "msg", "=", "\"\"", ";", "}", "else", "{", "err", "=", "\"\"", ";", "}", "}", "else", "if", "(", "args", "[", "0", "]", ".", "equalsIgnoreCase", "(", "cmdCost", ")", ")", "{", "Config", ".", "setCost", "(", "val", ")", ";", "msg", "=", "\"\"", ";", "}", "else", "if", "(", "args", "[", "0", "]", ".", "equalsIgnoreCase", "(", "cmdLight", ")", ")", "{", "if", "(", "val", ">=", "0", "&&", "val", "<=", "15", ")", "{", "Config", ".", "setLight", "(", "val", ".", "intValue", "(", ")", ")", ";", "msg", "=", "\"\"", ";", "}", "else", "{", "err", "=", "\"\"", ";", "}", "}", "Config", ".", "saveConfig", "(", ")", ";", "if", "(", "msg", "!=", "\"\"", ")", "{", "if", "(", "val", "!=", "-", "1.0", ")", "{", "sender", ".", "sendMessage", "(", "wtTitle", "+", "ChatColor", ".", "WHITE", "+", "msg", "+", "msgColor", "+", "val", ")", ";", "}", "else", "{", "sender", ".", "sendMessage", "(", "wtTitle", "+", "ChatColor", ".", "WHITE", "+", "msg", ")", ";", "}", "}", "else", "if", "(", "err", "!=", "\"\"", ")", "{", "sender", ".", "sendMessage", "(", "wtTitle", "+", "ChatColor", ".", "RED", "+", "err", ")", ";", "}", "}", "}", "}", "else", "{", "if", "(", "args", ".", "length", "==", "0", "||", "(", "args", ".", "length", "==", "1", "&&", "args", "[", "0", "]", ".", "equalsIgnoreCase", "(", "cmdHelp", ")", ")", ")", "{", "sender", ".", "sendMessage", "(", "wtTitle", "+", "\"\"", "+", "plugin", ".", "getDescription", "(", ")", ".", "getVersion", "(", ")", ")", ";", "sender", ".", "sendMessage", "(", "\"\"", ")", ";", "sender", ".", "sendMessage", "(", "\"\"", "+", "valColor", "+", "Config", ".", "getTree", "(", ")", "+", "\"%", "\"", "+", "defColor", "+", "\"\"", ")", ";", "sender", ".", "sendMessage", "(", "\"\"", "+", "valColor", "+", "Config", ".", "getWool", "(", ")", "+", "\"%", "\"", "+", "defColor", "+", "\"wool", "leaves\"", ")", ";", "if", "(", "plugin", ".", "getEcon", "(", ")", "!=", "null", ")", "{", "if", "(", "Perms", ".", "hasIC", "(", "(", "Player", ")", "sender", ")", ")", "{", "sender", ".", "sendMessage", "(", "\"\"", "+", "valColor", "+", "\"nothing!\"", ")", ";", "}", "else", "{", "sender", ".", "sendMessage", "(", "\"\"", "+", "valColor", "+", "Config", ".", "getCost", "(", ")", ")", ";", "}", "}", "}", "else", "{", "sender", ".", "sendMessage", "(", "wtTitle", "+", "ChatColor", ".", "RED", "+", "\"\"", ")", ";", "}", "}", "return", "false", ";", "}", "public", "static", "String", "getMain", "(", ")", "{", "return", "cmdMain", ";", "}", "}", "</s>" ]
10,490
[ "<s>", "package", "haveric", ".", "woolTrees", ";", "import", "org", ".", "bukkit", ".", "Material", ";", "import", "org", ".", "bukkit", ".", "block", ".", "Block", ";", "import", "org", ".", "bukkit", ".", "event", ".", "EventHandler", ";", "import", "org", ".", "bukkit", ".", "event", ".", "Listener", ";", "import", "org", ".", "bukkit", ".", "event", ".", "block", ".", "BlockBreakEvent", ";", "public", "class", "WTBlockBreak", "implements", "Listener", "{", "public", "WTBlockBreak", "(", "WoolTrees", "wt", ")", "{", "}", "@", "EventHandler", "public", "void", "onBlockBreak", "(", "BlockBreakEvent", "event", ")", "{", "Block", "block", "=", "event", ".", "getBlock", "(", ")", ";", "if", "(", "block", ".", "getType", "(", ")", "==", "Material", ".", "SAPLING", ")", "{", "String", "patternConfig", "=", "block", ".", "getWorld", "(", ")", ".", "getName", "(", ")", "+", "\":\"", "+", "block", ".", "getX", "(", ")", "+", "\",\"", "+", "block", ".", "getY", "(", ")", "+", "\",\"", "+", "block", ".", "getZ", "(", ")", ";", "if", "(", "Config", ".", "getPattern", "(", "patternConfig", ")", "!=", "null", ")", "{", "Config", ".", "setPattern", "(", "patternConfig", ",", "null", ")", ";", "}", "}", "}", "}", "</s>" ]
10,491
[ "<s>", "package", "haveric", ".", "woolTrees", ";", "import", "net", ".", "milkbowl", ".", "vault", ".", "permission", ".", "Permission", ";", "import", "org", ".", "bukkit", ".", "entity", ".", "Player", ";", "public", "class", "Perms", "{", "private", "static", "Permission", "perm", "=", "null", ";", "private", "static", "String", "permAdjust", "=", "\"\"", ";", "private", "static", "String", "permAdjustAlt", "=", "\"\"", ";", "private", "static", "String", "permPlant", "=", "\"\"", ";", "private", "static", "String", "permPlantAlt", "=", "\"\"", ";", "private", "static", "String", "permIC", "=", "\"\"", ";", "private", "static", "String", "permICAlt1", "=", "\"\"", ";", "private", "static", "String", "permICAlt2", "=", "\"\"", ";", "private", "static", "String", "permICAlt3", "=", "\"\"", ";", "public", "static", "void", "setPerm", "(", "Permission", "newPerm", ")", "{", "perm", "=", "newPerm", ";", "}", "public", "static", "Permission", "getPerm", "(", ")", "{", "return", "perm", ";", "}", "public", "static", "boolean", "permEnabled", "(", ")", "{", "return", "(", "perm", "!=", "null", ")", ";", "}", "public", "static", "boolean", "hasAdjust", "(", "Player", "player", ")", "{", "if", "(", "permEnabled", "(", ")", ")", "{", "return", "perm", ".", "has", "(", "player", ",", "permAdjust", ")", "||", "perm", ".", "has", "(", "player", ",", "permAdjustAlt", ")", ";", "}", "return", "false", ";", "}", "public", "static", "boolean", "hasPlant", "(", "Player", "player", ")", "{", "if", "(", "permEnabled", "(", ")", ")", "{", "return", "perm", ".", "has", "(", "player", ",", "permPlant", ")", "||", "perm", ".", "has", "(", "player", ",", "permPlantAlt", ")", ";", "}", "return", "false", ";", "}", "public", "static", "boolean", "hasIC", "(", "Player", "player", ")", "{", "if", "(", "permEnabled", "(", ")", ")", "{", "return", "perm", ".", "has", "(", "player", ",", "permIC", ")", "||", "perm", ".", "has", "(", "player", ",", "permICAlt1", ")", "||", "perm", ".", "has", "(", "player", ",", "permICAlt2", ")", "||", "perm", ".", "has", "(", "player", ",", "permICAlt3", ")", ";", "}", "return", "false", ";", "}", "}", "</s>" ]
10,492
[ "<s>", "package", "haveric", ".", "woolTrees", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "net", ".", "milkbowl", ".", "vault", ".", "economy", ".", "Economy", ";", "import", "org", ".", "bukkit", ".", "ChatColor", ";", "import", "org", ".", "bukkit", ".", "GameMode", ";", "import", "org", ".", "bukkit", ".", "Material", ";", "import", "org", ".", "bukkit", ".", "World", ";", "import", "org", ".", "bukkit", ".", "block", ".", "Block", ";", "import", "org", ".", "bukkit", ".", "entity", ".", "Player", ";", "import", "org", ".", "bukkit", ".", "event", ".", "EventHandler", ";", "import", "org", ".", "bukkit", ".", "event", ".", "Listener", ";", "import", "org", ".", "bukkit", ".", "event", ".", "block", ".", "Action", ";", "import", "org", ".", "bukkit", ".", "event", ".", "player", ".", "PlayerInteractEvent", ";", "import", "org", ".", "bukkit", ".", "inventory", ".", "ItemStack", ";", "import", "org", ".", "bukkit", ".", "inventory", ".", "PlayerInventory", ";", "public", "class", "WTPlayerInteract", "implements", "Listener", "{", "private", "static", "WoolTrees", "plugin", ";", "public", "WTPlayerInteract", "(", "WoolTrees", "wt", ")", "{", "plugin", "=", "wt", ";", "}", "@", "EventHandler", "public", "void", "onPlayerInteract", "(", "PlayerInteractEvent", "event", ")", "{", "Economy", "econ", "=", "plugin", ".", "getEcon", "(", ")", ";", "Player", "player", "=", "event", ".", "getPlayer", "(", ")", ";", "PlayerInventory", "inventory", "=", "player", ".", "getInventory", "(", ")", ";", "World", "world", "=", "player", ".", "getWorld", "(", ")", ";", "Block", "block", "=", "event", ".", "getClickedBlock", "(", ")", ";", "ItemStack", "holding", "=", "player", ".", "getItemInHand", "(", ")", ";", "boolean", "currencyEnabled", "=", "true", ";", "boolean", "patternsEnabled", "=", "Config", ".", "isPatternEnabled", "(", ")", ";", "if", "(", "!", "Perms", ".", "permEnabled", "(", ")", "||", "Perms", ".", "hasPlant", "(", "player", ")", ")", "{", "if", "(", "event", ".", "getAction", "(", ")", "==", "Action", ".", "RIGHT_CLICK_BLOCK", "&&", "event", ".", "getClickedBlock", "(", ")", ".", "getType", "(", ")", "==", "Material", ".", "SAPLING", ")", "{", "int", "blockX", "=", "block", ".", "getX", "(", ")", ";", "int", "blockY", "=", "block", ".", "getY", "(", ")", ";", "int", "blockZ", "=", "block", ".", "getZ", "(", ")", ";", "if", "(", "world", ".", "getBlockAt", "(", "blockX", ",", "blockY", "+", "1", ",", "blockZ", ")", ".", "getLightLevel", "(", ")", "<", "Config", ".", "getLight", "(", ")", ")", "{", "player", ".", "sendMessage", "(", "ChatColor", ".", "RED", "+", "\"\"", ")", ";", "return", ";", "}", "if", "(", "econ", "==", "null", "||", "Perms", ".", "hasIC", "(", "player", ")", ")", "{", "currencyEnabled", "=", "false", ";", "}", "else", "if", "(", "!", "econ", ".", "has", "(", "player", ".", "getName", "(", ")", ",", "Config", ".", "getCost", "(", ")", ")", ")", "{", "player", ".", "sendMessage", "(", "ChatColor", ".", "RED", "+", "\"\"", "+", "Config", ".", "getCost", "(", ")", ")", ";", "return", ";", "}", "int", "color", "=", "0", ";", "if", "(", "holding", ".", "getType", "(", ")", "==", "Material", ".", "INK_SACK", ")", "{", "int", "dur", "=", "holding", ".", "getDurability", "(", ")", ";", "if", "(", "dur", "==", "15", ")", "{", "return", ";", "}", "color", "=", "15", "-", "dur", ";", "}", "else", "if", "(", "holding", ".", "getType", "(", ")", "==", "Material", ".", "SUGAR", ")", "{", "color", "=", "0", ";", "}", "else", "{", "return", ";", "}", "boolean", "bigTree", "=", "(", "random", "(", "100", ")", "<=", "Config", ".", "getBig", "(", ")", ")", ";", "if", "(", "!", "Config", ".", "isHeightEnabled", "(", ")", "||", "(", "bigTree", "&&", "!", "treeBlocked", "(", "world", ",", "player", ",", "blockX", ",", "blockY", ",", "blockZ", ",", "10", ")", ")", "||", "(", "!", "bigTree", "&&", "!", "treeBlocked", "(", "world", ",", "player", ",", "blockX", ",", "blockY", ",", "blockZ", ",", "6", ")", ")", ")", "{", "if", "(", "random", "(", "100", ")", "<=", "Config", ".", "getTree", "(", ")", ")", "{", "int", "woodType", "=", "event", ".", "getClickedBlock", "(", ")", ".", "getData", "(", ")", ";", "if", "(", "patternsEnabled", ")", "{", "addPattern", "(", "world", ",", "color", ",", "blockX", ",", "blockY", ",", "blockZ", ")", ";", "}", "if", "(", "bigTree", ")", "{", "makeBigTree", "(", "world", ",", "woodType", ",", "color", ",", "blockX", ",", "blockY", ",", "blockZ", ",", "null", ",", "-", "1", ")", ";", "}", "else", "{", "makeNormalTree", "(", "world", ",", "woodType", ",", "color", ",", "blockX", ",", "blockY", ",", "blockZ", ",", "null", ",", "-", "1", ")", ";", "}", "if", "(", "patternsEnabled", ")", "{", "Config", ".", "setPattern", "(", "world", ".", "getName", "(", ")", "+", "\":\"", "+", "blockX", "+", "\",\"", "+", "blockY", "+", "\",\"", "+", "blockZ", ",", "null", ")", ";", "}", "if", "(", "currencyEnabled", ")", "{", "econ", ".", "withdrawPlayer", "(", "player", ".", "getName", "(", ")", ",", "Config", ".", "getCost", "(", ")", ")", ";", "}", "if", "(", "player", ".", "getGameMode", "(", ")", "==", "GameMode", ".", "SURVIVAL", ")", "{", "int", "amt", "=", "holding", ".", "getAmount", "(", ")", ";", "if", "(", "amt", ">", "1", ")", "{", "holding", ".", "setAmount", "(", "--", "amt", ")", ";", "}", "else", "{", "inventory", ".", "setItemInHand", "(", "null", ")", ";", "}", "}", "}", "else", "{", "addPattern", "(", "world", ",", "color", ",", "blockX", ",", "blockY", ",", "blockZ", ")", ";", "if", "(", "player", ".", "getGameMode", "(", ")", "==", "GameMode", ".", "SURVIVAL", ")", "{", "int", "amt", "=", "holding", ".", "getAmount", "(", ")", ";", "if", "(", "amt", ">", "1", ")", "{", "holding", ".", "setAmount", "(", "--", "amt", ")", ";", "}", "else", "{", "inventory", ".", "setItemInHand", "(", "null", ")", ";", "}", "}", "}", "}", "}", "}", "}", "private", "void", "addPattern", "(", "World", "w", ",", "int", "color", ",", "int", "blockX", ",", "int", "blockY", ",", "int", "blockZ", ")", "{", "String", "colors", "=", "Config", ".", "getPattern", "(", "w", ".", "getName", "(", ")", "+", "\":\"", "+", "blockX", "+", "\",\"", "+", "blockY", "+", "\",\"", "+", "blockZ", ")", ";", "if", "(", "colors", "!=", "null", "&&", "!", "colors", ".", "contains", "(", "\"(\"", "+", "color", "+", "\")\"", ")", ")", "{", "colors", "+=", "\"(\"", "+", "color", "+", "\")\"", ";", "Config", ".", "setPattern", "(", "w", ".", "getName", "(", ")", "+", "\":\"", "+", "blockX", "+", "\",\"", "+", "blockY", "+", "\",\"", "+", "blockZ", ",", "colors", ")", ";", "}", "else", "if", "(", "colors", "==", "null", ")", "{", "colors", "=", "\"(\"", "+", "color", "+", "\")\"", ";", "Config", ".", "setPattern", "(", "w", ".", "getName", "(", ")", "+", "\":\"", "+", "blockX", "+", "\",\"", "+", "blockY", "+", "\",\"", "+", "blockZ", ",", "colors", ")", ";", "}", "}", "private", "boolean", "treeBlocked", "(", "World", "w", ",", "Player", "p", ",", "int", "x", ",", "int", "y", ",", "int", "z", ",", "int", "height", ")", "{", "boolean", "blocked", "=", "false", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "height", "&&", "!", "blocked", ";", "i", "++", ")", "{", "if", "(", "w", ".", "getBlockAt", "(", "x", ",", "y", "+", "i", ",", "z", ")", ".", "getType", "(", ")", "!=", "Material", ".", "AIR", ")", "{", "p", ".", "sendMessage", "(", "ChatColor", ".", "RED", "+", "\"\"", "+", "i", "+", "\"\"", ")", ";", "blocked", "=", "true", ";", "}", "}", "return", "blocked", ";", "}", "public", "static", "void", "makeNormalTree", "(", "World", "w", ",", "int", "wood", ",", "int", "color", ",", "int", "x", ",", "int", "y", ",", "int", "z", ",", "ArrayList", "<", "Integer", ">", "colorArray", ",", "double", "leaves", ")", "{", "if", "(", "colorArray", "==", "null", ")", "{", "colorArray", "=", "new", "ArrayList", "<", "Integer", ">", "(", ")", ";", "if", "(", "Config", ".", "isPatternEnabled", "(", ")", ")", "{", "String", "colors", "=", "Config", ".", "getPattern", "(", "w", ".", "getName", "(", ")", "+", "\":\"", "+", "x", "+", "\",\"", "+", "y", "+", "\",\"", "+", "z", ")", ";", "for", "(", "int", "i", "=", "-", "2", ";", "i", "<=", "15", ";", "i", "++", ")", "{", "if", "(", "colors", ".", "contains", "(", "\"(\"", "+", "i", "+", "\")\"", ")", ")", "{", "colorArray", ".", "add", "(", "i", ")", ";", "}", "}", "}", "else", "{", "colorArray", ".", "add", "(", "color", ")", ";", "}", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "6", ";", "i", "++", ")", "{", "setLog", "(", "w", ".", "getBlockAt", "(", "x", ",", "y", "+", "i", ",", "z", ")", ",", "wood", ")", ";", "}", "for", "(", "int", "i", "=", "-", "2", ";", "i", "<=", "2", ";", "i", "++", ")", "{", "for", "(", "int", "j", "=", "-", "2", ";", "j", "<=", "2", ";", "j", "++", ")", "{", "if", "(", "i", "==", "0", "&&", "j", "==", "0", ")", "{", "}", "else", "{", "setColoredBlock", "(", "w", ".", "getBlockAt", "(", "x", "+", "i", ",", "y", "+", "3", ",", "z", "+", "j", ")", ",", "getRandomColor", "(", "colorArray", ")", ",", "leaves", ")", ";", "setColoredBlock", "(", "w", ".", "getBlockAt", "(", "x", "+", "i", ",", "y", "+", "4", ",", "z", "+", "j", ")", ",", "getRandomColor", "(", "colorArray", ")", ",", "leaves", ")", ";", "if", "(", "i", "!=", "2", "&&", "i", "!=", "-", "2", "&&", "j", "!=", "2", "&&", "j", "!=", "-", "2", ")", "{", "setColoredBlock", "(", "w", ".", "getBlockAt", "(", "x", "+", "i", ",", "y", "+", "5", ",", "z", "+", "j", ")", ",", "getRandomColor", "(", "colorArray", ")", ",", "leaves", ")", ";", "}", "}", "}", "}", "setColoredBlock", "(", "w", ".", "getBlockAt", "(", "x", ",", "y", "+", "6", ",", "z", ")", ",", "getRandomColor", "(", "colorArray", ")", ",", "leaves", ")", ";", "}", "public", "static", "void", "makeBigTree", "(", "World", "w", ",", "int", "wood", ",", "int", "color", ",", "int", "x", ",", "int", "y", ",", "int", "z", ",", "ArrayList", "<", "Integer", ">", "colorArray", ",", "double", "leaves", ")", "{", "if", "(", "colorArray", "==", "null", ")", "{", "colorArray", "=", "new", "ArrayList", "<", "Integer", ">", "(", ")", ";", "if", "(", "Config", ".", "isPatternEnabled", "(", ")", ")", "{", "String", "colors", "=", "Config", ".", "getPattern", "(", "w", ".", "getName", "(", ")", "+", "\":\"", "+", "x", "+", "\",\"", "+", "y", "+", "\",\"", "+", "z", ")", ";", "for", "(", "int", "i", "=", "-", "2", ";", "i", "<=", "15", ";", "i", "++", ")", "{", "if", "(", "colors", ".", "contains", "(", "\"(\"", "+", "i", "+", "\")\"", ")", ")", "{", "colorArray", ".", "add", "(", "i", ")", ";", "}", "}", "}", "else", "{", "colorArray", ".", "add", "(", "color", ")", ";", "}", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "10", ";", "i", "++", ")", "{", "setLog", "(", "w", ".", "getBlockAt", "(", "x", ",", "y", "+", "i", ",", "z", ")", ",", "wood", ")", ";", "}", "for", "(", "int", "i", "=", "-", "2", ";", "i", "<=", "2", ";", "i", "++", ")", "{", "for", "(", "int", "j", "=", "-", "2", ";", "j", "<=", "2", ";", "j", "++", ")", "{", "if", "(", "i", "==", "0", "&&", "j", "==", "0", ")", "{", "}", "else", "{", "setColoredBlock", "(", "w", ".", "getBlockAt", "(", "x", "+", "i", ",", "y", "+", "6", ",", "z", "+", "j", ")", ",", "getRandomColor", "(", "colorArray", ")", ",", "leaves", ")", ";", "setColoredBlock", "(", "w", ".", "getBlockAt", "(", "x", "+", "i", ",", "y", "+", "7", ",", "z", "+", "j", ")", ",", "getRandomColor", "(", "colorArray", ")", ",", "leaves", ")", ";", "setColoredBlock", "(", "w", ".", "getBlockAt", "(", "x", "+", "i", ",", "y", "+", "8", ",", "z", "+", "j", ")", ",", "getRandomColor", "(", "colorArray", ")", ",", "leaves", ")", ";", "if", "(", "(", "i", "==", "2", "&&", "j", "==", "2", ")", "||", "(", "i", "==", "2", "&&", "j", "==", "-", "2", ")", "||", "(", "i", "==", "-", "2", "&&", "j", "==", "2", ")", "||", "(", "i", "==", "-", "2", "&&", "j", "==", "-", "2", ")", ")", "{", "}", "else", "{", "setColoredBlock", "(", "w", ".", "getBlockAt", "(", "x", "+", "i", ",", "y", "+", "5", ",", "z", "+", "j", ")", ",", "getRandomColor", "(", "colorArray", ")", ",", "leaves", ")", ";", "setColoredBlock", "(", "w", ".", "getBlockAt", "(", "x", "+", "i", ",", "y", "+", "9", ",", "z", "+", "j", ")", ",", "getRandomColor", "(", "colorArray", ")", ",", "leaves", ")", ";", "}", "if", "(", "i", "!=", "2", "&&", "i", "!=", "-", "2", "&&", "j", "!=", "2", "&&", "j", "!=", "-", "2", ")", "{", "setColoredBlock", "(", "w", ".", "getBlockAt", "(", "x", "+", "i", ",", "y", "+", "4", ",", "z", "+", "j", ")", ",", "getRandomColor", "(", "colorArray", ")", ",", "leaves", ")", ";", "setColoredBlock", "(", "w", ".", "getBlockAt", "(", "x", "+", "i", ",", "y", "+", "10", ",", "z", "+", "j", ")", ",", "getRandomColor", "(", "colorArray", ")", ",", "leaves", ")", ";", "}", "}", "}", "}", "}", "private", "static", "void", "setColoredBlock", "(", "Block", "block", ",", "int", "color", ",", "double", "leaves", ")", "{", "int", "wool", "=", "random", "(", "100", ")", ";", "if", "(", "leaves", "==", "-", "1", ")", "{", "if", "(", "wool", "<", "Config", ".", "getWool", "(", ")", "&&", "block", ".", "getType", "(", ")", "==", "Material", ".", "AIR", ")", "{", "if", "(", "color", "==", "-", "1", ")", "{", "color", "=", "(", "int", ")", "(", "Math", ".", "random", "(", ")", "*", "16", ")", ";", "}", "block", ".", "setType", "(", "Material", ".", "WOOL", ")", ";", "block", ".", "setData", "(", "(", "byte", ")", "color", ")", ";", "}", "}", "else", "if", "(", "wool", "<", "leaves", "&&", "block", ".", "getType", "(", ")", "==", "Material", ".", "AIR", ")", "{", "if", "(", "color", "==", "-", "1", ")", "{", "color", "=", "(", "int", ")", "(", "Math", ".", "random", "(", ")", "*", "16", ")", ";", "}", "block", ".", "setType", "(", "Material", ".", "WOOL", ")", ";", "block", ".", "setData", "(", "(", "byte", ")", "color", ")", ";", "}", "}", "private", "static", "void", "setLog", "(", "Block", "block", ",", "int", "type", ")", "{", "if", "(", "block", ".", "getType", "(", ")", "==", "Material", ".", "AIR", "||", "block", ".", "getType", "(", ")", "==", "Material", ".", "SAPLING", ")", "{", "if", "(", "Config", ".", "isWoolTrunksEnabled", "(", ")", ")", "{", "block", ".", "setType", "(", "Material", ".", "WOOL", ")", ";", "block", ".", "setData", "(", "(", "byte", ")", "12", ")", ";", "}", "else", "{", "block", ".", "setType", "(", "Material", ".", "LOG", ")", ";", "block", ".", "setData", "(", "(", "byte", ")", "type", ")", ";", "}", "}", "}", "private", "static", "int", "random", "(", "int", "num", ")", "{", "return", "1", "+", "(", "int", ")", "(", "Math", ".", "random", "(", ")", "*", "num", ")", ";", "}", "private", "static", "int", "getRandomColor", "(", "ArrayList", "<", "Integer", ">", "array", ")", "{", "int", "color", "=", "0", ";", "if", "(", "array", ".", "contains", "(", "0", ")", "&&", "array", ".", "contains", "(", "15", ")", "&&", "array", ".", "contains", "(", "7", ")", ")", "{", "color", "=", "-", "1", ";", "}", "else", "{", "color", "=", "array", ".", "get", "(", "(", "int", ")", "(", "Math", ".", "random", "(", ")", "*", "array", ".", "size", "(", ")", ")", ")", ";", "}", "return", "color", ";", "}", "}", "</s>" ]
10,493
[ "<s>", "package", "haveric", ".", "woolTrees", ";", "import", "org", ".", "bukkit", ".", "Location", ";", "import", "org", ".", "bukkit", ".", "event", ".", "EventHandler", ";", "import", "org", ".", "bukkit", ".", "event", ".", "Listener", ";", "import", "org", ".", "bukkit", ".", "event", ".", "world", ".", "StructureGrowEvent", ";", "public", "class", "WTStructureGrow", "implements", "Listener", "{", "public", "WTStructureGrow", "(", "WoolTrees", "wt", ")", "{", "}", "@", "EventHandler", "public", "void", "onTreeGrowth", "(", "StructureGrowEvent", "event", ")", "{", "Location", "l", "=", "event", ".", "getLocation", "(", ")", ";", "String", "patternConfig", "=", "event", ".", "getWorld", "(", ")", ".", "getName", "(", ")", "+", "\":\"", "+", "l", ".", "getBlockX", "(", ")", "+", "\",\"", "+", "l", ".", "getBlockY", "(", ")", "+", "\",\"", "+", "l", ".", "getBlockZ", "(", ")", ";", "if", "(", "Config", ".", "getPattern", "(", "patternConfig", ")", "!=", "null", ")", "{", "Config", ".", "setPattern", "(", "patternConfig", ",", "null", ")", ";", "}", "}", "}", "</s>" ]
10,494
[ "<s>", "package", "haveric", ".", "woolTrees", ";", "import", "java", ".", "util", ".", "logging", ".", "Logger", ";", "import", "net", ".", "milkbowl", ".", "vault", ".", "economy", ".", "Economy", ";", "import", "net", ".", "milkbowl", ".", "vault", ".", "permission", ".", "Permission", ";", "import", "org", ".", "bukkit", ".", "plugin", ".", "PluginManager", ";", "import", "org", ".", "bukkit", ".", "plugin", ".", "RegisteredServiceProvider", ";", "import", "org", ".", "bukkit", ".", "plugin", ".", "java", ".", "JavaPlugin", ";", "public", "class", "WoolTrees", "extends", "JavaPlugin", "{", "static", "final", "Logger", "log", "=", "Logger", ".", "getLogger", "(", "\"Minecraft\"", ")", ";", "private", "Commands", "commands", "=", "new", "Commands", "(", "this", ")", ";", "private", "final", "WTPlayerInteract", "playerInteract", "=", "new", "WTPlayerInteract", "(", "this", ")", ";", "private", "final", "WTBlockBreak", "blockBreak", "=", "new", "WTBlockBreak", "(", "this", ")", ";", "private", "final", "WTStructureGrow", "structureGrow", "=", "new", "WTStructureGrow", "(", "this", ")", ";", "private", "Economy", "econ", "=", "null", ";", "@", "Override", "public", "void", "onEnable", "(", ")", "{", "PluginManager", "pm", "=", "getServer", "(", ")", ".", "getPluginManager", "(", ")", ";", "pm", ".", "registerEvents", "(", "playerInteract", ",", "this", ")", ";", "pm", ".", "registerEvents", "(", "blockBreak", ",", "this", ")", ";", "pm", ".", "registerEvents", "(", "structureGrow", ",", "this", ")", ";", "Config", ".", "init", "(", "this", ")", ";", "setupVault", "(", ")", ";", "Config", ".", "setupConfig", "(", ")", ";", "Config", ".", "setupPatternConfig", "(", ")", ";", "getCommand", "(", "Commands", ".", "getMain", "(", ")", ")", ".", "setExecutor", "(", "commands", ")", ";", "}", "@", "Override", "public", "void", "onDisable", "(", ")", "{", "}", "private", "void", "setupVault", "(", ")", "{", "if", "(", "getServer", "(", ")", ".", "getPluginManager", "(", ")", ".", "getPlugin", "(", "\"Vault\"", ")", "==", "null", ")", "{", "log", ".", "info", "(", "String", ".", "format", "(", "\"\"", ",", "getDescription", "(", ")", ".", "getName", "(", ")", ")", ")", ";", "return", ";", "}", "RegisteredServiceProvider", "<", "Permission", ">", "permProvider", "=", "getServer", "(", ")", ".", "getServicesManager", "(", ")", ".", "getRegistration", "(", "net", ".", "milkbowl", ".", "vault", ".", "permission", ".", "Permission", ".", "class", ")", ";", "if", "(", "permProvider", "!=", "null", ")", "{", "Perms", ".", "setPerm", "(", "permProvider", ".", "getProvider", "(", ")", ")", ";", "}", "RegisteredServiceProvider", "<", "Economy", ">", "econProvider", "=", "getServer", "(", ")", ".", "getServicesManager", "(", ")", ".", "getRegistration", "(", "net", ".", "milkbowl", ".", "vault", ".", "economy", ".", "Economy", ".", "class", ")", ";", "if", "(", "econProvider", "!=", "null", ")", "{", "econ", "=", "econProvider", ".", "getProvider", "(", ")", ";", "}", "}", "public", "Economy", "getEcon", "(", ")", "{", "return", "econ", ";", "}", "}", "</s>" ]
10,495
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "maven", ".", "natives", ";", "import", "org", ".", "codehaus", ".", "mojo", ".", "natives", ".", "NativeBuildException", ";", "import", "org", ".", "codehaus", ".", "mojo", ".", "natives", ".", "msvc", ".", "AbstractMSVCEnvFactory", ";", "import", "org", ".", "codehaus", ".", "mojo", ".", "natives", ".", "msvc", ".", "RegQuery", ";", "import", "org", ".", "codehaus", ".", "mojo", ".", "natives", ".", "util", ".", "EnvUtil", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "logging", ".", "Level", ";", "import", "java", ".", "util", ".", "logging", ".", "Logger", ";", "public", "abstract", "class", "AbstractMSVC2010EnvFactory", "extends", "AbstractMSVCEnvFactory", "{", "private", "static", "final", "String", "VS100COMNTOOLS_ENV_KEY", "=", "\"\"", ";", "private", "Logger", "log", "=", "Logger", ".", "getLogger", "(", "AbstractMSVC2010EnvFactory", ".", "class", ".", "getName", "(", ")", ")", ";", "@", "Override", "public", "Map", "getEnvironmentVariables", "(", ")", "throws", "NativeBuildException", "{", "return", "createEnvs", "(", ")", ";", "}", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "protected", "Map", "createEnvs", "(", ")", "throws", "NativeBuildException", "{", "Map", "envs", "=", "new", "HashMap", "(", ")", ";", "File", "vsCommonToolDir", "=", "getCommonToolsDirectory", "(", ")", ";", "File", "vsInstallDir", "=", "getVisualStudioInstallDirectory", "(", "vsCommonToolDir", ")", ";", "if", "(", "!", "vsInstallDir", ".", "isDirectory", "(", ")", ")", "{", "throw", "new", "NativeBuildException", "(", "vsInstallDir", ".", "getPath", "(", ")", "+", "\"\"", ")", ";", "}", "if", "(", "log", ".", "isLoggable", "(", "Level", ".", "INFO", ")", ")", "{", "log", ".", "info", "(", "\"\"", "+", "vsInstallDir", ")", ";", "}", "File", "vcInstallDir", "=", "getVCInstallDir", "(", "vsInstallDir", ")", ";", "if", "(", "!", "vcInstallDir", ".", "isDirectory", "(", ")", ")", "{", "throw", "new", "NativeBuildException", "(", "vcInstallDir", ".", "getPath", "(", ")", "+", "\"\"", ")", ";", "}", "if", "(", "log", ".", "isLoggable", "(", "Level", ".", "INFO", ")", ")", "{", "log", ".", "info", "(", "\"\"", "+", "vcInstallDir", ")", ";", "}", "File", "frameworkDir", "=", "getFrameworkDir", "(", ")", ";", "File", "windowsSDKDir", "=", "getWindowsSDKDir", "(", ")", ";", "String", "[", "]", "frameworkVersion", "=", "getFrameworkVersion", "(", ")", ";", "String", "currentPathEnv", "=", "System", ".", "getProperty", "(", "\"\"", ")", ";", "String", "newPathEnv", "=", "getPath", "(", "frameworkDir", ",", "frameworkVersion", ",", "vsCommonToolDir", ",", "vcInstallDir", ",", "windowsSDKDir", ")", ";", "newPathEnv", "+=", "\";\"", "+", "currentPathEnv", ";", "envs", ".", "put", "(", "\"Path\"", ",", "newPathEnv", ")", ";", "String", "currentIncludeEnv", "=", "EnvUtil", ".", "getEnv", "(", "\"INCLUDE\"", ")", ";", "String", "newIncludeEnv", "=", "vcInstallDir", ".", "getPath", "(", ")", "+", "\"\"", "+", "vcInstallDir", ".", "getPath", "(", ")", "+", "\"\\\\INCLUDE;\"", "+", "windowsSDKDir", ".", "getPath", "(", ")", "+", "\"\\\\INCLUDE;\"", "+", "currentIncludeEnv", ";", "envs", ".", "put", "(", "\"INCLUDE\"", ",", "newIncludeEnv", ")", ";", "String", "currentLibEnv", "=", "EnvUtil", ".", "getEnv", "(", "\"LIB\"", ")", ";", "String", "newLibEnv", "=", "getLibEnv", "(", "vcInstallDir", ",", "windowsSDKDir", ")", "+", "\";\"", "+", "currentLibEnv", ";", "envs", ".", "put", "(", "\"LIB\"", ",", "newLibEnv", ")", ";", "String", "currentLibPathEnv", "=", "EnvUtil", ".", "getEnv", "(", "\"LIBPATH\"", ")", ";", "String", "newLibPathEnv", "=", "getLibPathEnv", "(", "frameworkDir", ",", "frameworkVersion", ",", "vcInstallDir", ",", "windowsSDKDir", ")", "+", "\";\"", "+", "currentLibPathEnv", ";", "envs", ".", "put", "(", "\"LIBPATH\"", ",", "newLibPathEnv", ")", ";", "if", "(", "log", ".", "isLoggable", "(", "Level", ".", "INFO", ")", ")", "{", "for", "(", "Object", "key", ":", "envs", ".", "keySet", "(", ")", ")", "{", "log", ".", "log", "(", "Level", ".", "INFO", ",", "\"\"", "+", "key", "+", "\"", "=", "\"", "+", "envs", ".", "get", "(", "key", ")", ")", ";", "}", "}", "return", "envs", ";", "}", "protected", "String", "getPath", "(", "File", "frameworkDir", ",", "String", "[", "]", "frameworkVersions", ",", "File", "vsCommonToolDir", ",", "File", "vcInstallDir", ",", "File", "windowsSDKDir", ")", "{", "StringBuilder", "result", "=", "new", "StringBuilder", "(", ")", ";", "result", ".", "append", "(", "getFrameworkPaths", "(", "frameworkDir", ",", "frameworkVersions", ")", ")", ";", "result", ".", "append", "(", "vsCommonToolDir", ")", ".", "append", "(", "\"\\\\..\\\\IDE;\"", ")", ";", "result", ".", "append", "(", "vsCommonToolDir", ")", ".", "append", "(", "';'", ")", ";", "result", ".", "append", "(", "getVCBinDir", "(", "vcInstallDir", ")", ")", ".", "append", "(", "';'", ")", ";", "result", ".", "append", "(", "vcInstallDir", ")", ".", "append", "(", "\"\\\\Bin\\\\\"", ")", ".", "append", "(", "\"VCPackages;\"", ")", ";", "result", ".", "append", "(", "windowsSDKDir", ")", ".", "append", "(", "\"\\\\Bin;\"", ")", ";", "return", "result", ".", "toString", "(", ")", ";", "}", "protected", "String", "[", "]", "getFrameworkVersion", "(", ")", "{", "return", "new", "String", "[", "]", "{", "\"v4.0.30319\"", ",", "\"v3.5\"", "}", ";", "}", "protected", "File", "getWindowsSDKDir", "(", ")", "{", "File", "windowsSDKDir", "=", "new", "File", "(", "getProgramFiles", "(", ")", ",", "\"\"", ")", ";", "if", "(", "!", "windowsSDKDir", ".", "exists", "(", ")", ")", "{", "String", "value", "=", "RegQuery", ".", "getValue", "(", "\"REG_SZ\"", ",", "\"\"", ",", "\"\"", ")", ";", "if", "(", "value", "!=", "null", ")", "{", "windowsSDKDir", "=", "new", "File", "(", "value", ")", ";", "}", "}", "return", "windowsSDKDir", ";", "}", "protected", "File", "getCommonToolsDirectory", "(", ")", "throws", "NativeBuildException", "{", "String", "envValue", "=", "System", ".", "getenv", "(", "VS100COMNTOOLS_ENV_KEY", ")", ";", "if", "(", "envValue", "==", "null", ")", "{", "throw", "new", "NativeBuildException", "(", "\"\"", "+", "VS100COMNTOOLS_ENV_KEY", "+", "\"\"", ")", ";", "}", "return", "new", "File", "(", "envValue", ")", ";", "}", "protected", "File", "getVisualStudioInstallDirectory", "(", "File", "commonToolsDir", ")", "throws", "NativeBuildException", "{", "try", "{", "return", "new", "File", "(", "commonToolsDir", ",", "\"../..\"", ")", ".", "getCanonicalFile", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "NativeBuildException", "(", "\"\"", "+", "commonToolsDir", ",", "e", ")", ";", "}", "}", "protected", "File", "getFrameworkDir", "(", ")", "{", "return", "new", "File", "(", "getSystemRoot", "(", ")", "+", "\"\"", ")", ";", "}", "protected", "File", "getVCInstallDir", "(", "File", "vsInstallDir", ")", "{", "return", "new", "File", "(", "vsInstallDir", ".", "getPath", "(", ")", "+", "\"\\\\VC\"", ")", ";", "}", "protected", "String", "getVCBinDir", "(", "File", "vcInstallDir", ")", "{", "return", "vcInstallDir", ".", "getPath", "(", ")", "+", "\"\\\\bin\"", ";", "}", "protected", "String", "getLibEnv", "(", "File", "vcInstallDir", ",", "File", "windowsSDKDir", ")", "{", "return", "vcInstallDir", ".", "getPath", "(", ")", "+", "\"\\\\ATLMFC\\\\lib;\"", "+", "vcInstallDir", ".", "getPath", "(", ")", "+", "\"\\\\lib;\"", "+", "windowsSDKDir", ".", "getPath", "(", ")", "+", "\"\\\\lib\"", ";", "}", "protected", "String", "getLibPathEnv", "(", "File", "frameworkDir", ",", "String", "[", "]", "frameworkVersions", ",", "File", "vcInstallDir", ",", "File", "windowsSDKDir", ")", "{", "StringBuilder", "result", "=", "new", "StringBuilder", "(", ")", ";", "result", ".", "append", "(", "getFrameworkPaths", "(", "frameworkDir", ",", "frameworkVersions", ")", ")", ";", "result", ".", "append", "(", "vcInstallDir", ".", "getPath", "(", ")", ")", ".", "append", "(", "\"\\\\ATLMFC\\\\lib;\"", ")", ";", "result", ".", "append", "(", "vcInstallDir", ".", "getPath", "(", ")", ")", ".", "append", "(", "\"\\\\lib\"", ")", ";", "return", "result", ".", "toString", "(", ")", ";", "}", "protected", "String", "getFrameworkPaths", "(", "File", "frameworkDir", ",", "String", "[", "]", "frameworkVersions", ")", "{", "StringBuilder", "result", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "String", "version", ":", "frameworkVersions", ")", "{", "result", ".", "append", "(", "frameworkDir", ")", ".", "append", "(", "'\\\\'", ")", ".", "append", "(", "version", ")", ".", "append", "(", "';'", ")", ";", "}", "return", "result", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
10,496
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "maven", ".", "natives", ";", "public", "class", "MSVC2010x86EnvFactory", "extends", "AbstractMSVC2010EnvFactory", "{", "}", "</s>" ]
10,497
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "maven", ".", "natives", ";", "import", "java", ".", "io", ".", "File", ";", "public", "class", "MSVC2010x64EnvFactory", "extends", "AbstractMSVC2010EnvFactory", "{", "@", "Override", "protected", "File", "getWindowsSDKDir", "(", ")", "{", "File", "windowsSDKDir", "=", "super", ".", "getWindowsSDKDir", "(", ")", ";", "String", "path", "=", "windowsSDKDir", ".", "getPath", "(", ")", ";", "String", "x86", "=", "getProgramFilesX86", "(", ")", ";", "if", "(", "path", ".", "startsWith", "(", "x86", ")", ")", "{", "path", "=", "path", ".", "substring", "(", "x86", ".", "length", "(", ")", ")", ";", "}", "File", "result", "=", "new", "File", "(", "getProgramFiles", "(", ")", ",", "path", ")", ";", "if", "(", "!", "result", ".", "exists", "(", ")", ")", "{", "result", "=", "windowsSDKDir", ";", "}", "return", "result", ";", "}", "@", "Override", "protected", "String", "getLibEnv", "(", "File", "vcInstallDir", ",", "File", "windowsSDKDir", ")", "{", "return", "vcInstallDir", ".", "getPath", "(", ")", "+", "\"\"", "+", "vcInstallDir", ".", "getPath", "(", ")", "+", "\"\\\\LIB\\\\amd64;\"", "+", "windowsSDKDir", ".", "getPath", "(", ")", "+", "\"\\\\LIB\\\\x64\"", ";", "}", "@", "Override", "protected", "String", "getLibPathEnv", "(", "File", "frameworkDir", ",", "String", "[", "]", "frameworkVersions", ",", "File", "vcInstallDir", ",", "File", "windowsSDKDir", ")", "{", "StringBuilder", "result", "=", "new", "StringBuilder", "(", ")", ";", "result", ".", "append", "(", "getFrameworkPaths", "(", "frameworkDir", ",", "frameworkVersions", ")", ")", ";", "result", ".", "append", "(", "vcInstallDir", ".", "getPath", "(", ")", ")", ".", "append", "(", "\"\"", ")", ";", "result", ".", "append", "(", "vcInstallDir", ".", "getPath", "(", ")", ")", ".", "append", "(", "\"\\\\lib\\\\amd64;\"", ")", ";", "result", ".", "append", "(", "windowsSDKDir", ".", "getPath", "(", ")", ")", ".", "append", "(", "\"\\\\lib\\\\amd64;\"", ")", ";", "return", "result", ".", "toString", "(", ")", ";", "}", "@", "Override", "protected", "String", "getFrameworkPaths", "(", "File", "frameworkDir", ",", "String", "[", "]", "frameworkVersions", ")", "{", "StringBuilder", "result", "=", "new", "StringBuilder", "(", ")", ";", "String", "framework64Dir", "=", "frameworkDir", "+", "\"64\"", ";", "for", "(", "String", "version", ":", "frameworkVersions", ")", "{", "result", ".", "append", "(", "framework64Dir", ")", ".", "append", "(", "'\\\\'", ")", ".", "append", "(", "version", ")", ".", "append", "(", "';'", ")", ";", "result", ".", "append", "(", "frameworkDir", ")", ".", "append", "(", "'\\\\'", ")", ".", "append", "(", "version", ")", ".", "append", "(", "';'", ")", ";", "}", "return", "result", ".", "toString", "(", ")", ";", "}", "@", "Override", "protected", "String", "getVCBinDir", "(", "File", "vcInstallDir", ")", "{", "return", "vcInstallDir", ".", "getPath", "(", ")", "+", "\"\\\\Bin\\\\amd64;\"", ";", "}", "}", "</s>" ]
10,498
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "ant", ";", "import", "java", ".", "util", ".", "Enumeration", ";", "import", "java", ".", "util", ".", "Hashtable", ";", "import", "java", ".", "util", ".", "Properties", ";", "import", "org", ".", "apache", ".", "tools", ".", "ant", ".", "BuildException", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "CompilerConfig", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "container", ".", "CompilerContainer", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "data", ".", "CompilerData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "data", ".", "PropertyManager", ";", "public", "class", "IzpackAntRunnable", "implements", "Runnable", "{", "private", "final", "CompilerData", "compilerData", ";", "private", "final", "String", "input", ";", "private", "final", "Properties", "properties", ";", "private", "final", "Boolean", "inheritAll", ";", "private", "Hashtable", "projectProps", ";", "public", "IzpackAntRunnable", "(", "String", "compression", ",", "String", "kind", ",", "String", "input", ",", "String", "configText", ",", "String", "basedir", ",", "String", "output", ",", "boolean", "mkdirs", ",", "int", "compressionLevel", ",", "Properties", "properties", ",", "Boolean", "inheritAll", ",", "Hashtable", "antProjectProperties", ",", "String", "izPackDir", ")", "{", "this", ".", "compilerData", "=", "new", "CompilerData", "(", "compression", ",", "kind", ",", "input", ",", "configText", ",", "basedir", ",", "output", ",", "mkdirs", ",", "compressionLevel", ")", ";", "this", ".", "input", "=", "input", ";", "this", ".", "properties", "=", "properties", ";", "this", ".", "inheritAll", "=", "inheritAll", ";", "this", ".", "projectProps", "=", "antProjectProperties", ";", "CompilerData", ".", "setIzpackHome", "(", "izPackDir", ")", ";", "}", "@", "Override", "public", "void", "run", "(", ")", "{", "CompilerContainer", "compilerContainer", "=", "new", "CompilerContainer", "(", ")", ";", "compilerContainer", ".", "addConfig", "(", "\"installFile\"", ",", "input", ")", ";", "compilerContainer", ".", "addComponent", "(", "CompilerData", ".", "class", ",", "compilerData", ")", ";", "CompilerConfig", "compilerConfig", "=", "compilerContainer", ".", "getComponent", "(", "CompilerConfig", ".", "class", ")", ";", "PropertyManager", "propertyManager", "=", "compilerContainer", ".", "getComponent", "(", "PropertyManager", ".", "class", ")", ";", "if", "(", "properties", "!=", "null", ")", "{", "Enumeration", "e", "=", "properties", ".", "keys", "(", ")", ";", "while", "(", "e", ".", "hasMoreElements", "(", ")", ")", "{", "String", "name", "=", "(", "String", ")", "e", ".", "nextElement", "(", ")", ";", "String", "value", "=", "properties", ".", "getProperty", "(", "name", ")", ";", "value", "=", "fixPathString", "(", "value", ")", ";", "propertyManager", ".", "addProperty", "(", "name", ",", "value", ")", ";", "}", "}", "if", "(", "inheritAll", ")", "{", "Enumeration", "e", "=", "projectProps", ".", "keys", "(", ")", ";", "while", "(", "e", ".", "hasMoreElements", "(", ")", ")", "{", "String", "name", "=", "(", "String", ")", "e", ".", "nextElement", "(", ")", ";", "String", "value", "=", "(", "String", ")", "projectProps", ".", "get", "(", "name", ")", ";", "value", "=", "fixPathString", "(", "value", ")", ";", "propertyManager", ".", "addProperty", "(", "name", ",", "value", ")", ";", "}", "}", "try", "{", "compilerConfig", ".", "executeCompiler", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "throw", "new", "BuildException", "(", "e", ")", ";", "}", "}", "private", "static", "String", "fixPathString", "(", "String", "path", ")", "{", "StringBuffer", "fixpath", "=", "new", "StringBuffer", "(", "path", ")", ";", "for", "(", "int", "q", "=", "0", ";", "q", "<", "fixpath", ".", "length", "(", ")", ";", "q", "++", ")", "{", "if", "(", "fixpath", ".", "charAt", "(", "q", ")", "==", "'\\\\'", ")", "{", "fixpath", ".", "setCharAt", "(", "q", ",", "'/'", ")", ";", "}", "}", "return", "fixpath", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
10,499
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "ant", ";", "import", "org", ".", "apache", ".", "tools", ".", "ant", ".", "Project", ";", "import", "java", ".", "util", ".", "Properties", ";", "public", "class", "Property", "extends", "org", ".", "apache", ".", "tools", ".", "ant", ".", "taskdefs", ".", "Property", "{", "protected", "Properties", "props", "=", "new", "Properties", "(", ")", ";", "public", "Property", "(", ")", "{", "super", "(", "false", ")", ";", "}", "public", "Properties", "getProperties", "(", ")", "{", "return", "props", ";", "}", "protected", "void", "addProperty", "(", "String", "name", ",", "String", "value", ")", "{", "if", "(", "props", ".", "get", "(", "name", ")", "==", "null", ")", "{", "props", ".", "put", "(", "name", ",", "value", ")", ";", "}", "else", "{", "log", "(", "\"\"", "+", "name", ",", "Project", ".", "MSG_VERBOSE", ")", ";", "}", "}", "}", "</s>" ]