method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
05df4152-e517-4507-a802-261f1befeccd | 4 | public static Inventory deserialize(String s) {
String size = s.substring(0,s.indexOf("!")-1);
Inventory inv = Bukkit.getServer().createInventory(null, Integer.parseInt(size));
String[] istacks = s.split("&");
for(int i=0;i<istacks.length;i++) {
ItemStack is = deserializeBasicSection(istacks[i]);
if(istac... |
b9fb9ad3-e20c-4e65-be92-01718fa24551 | 9 | private Comparison comparison() {
ArrayList<Expr> exprlist = new ArrayList<Expr>();
ArrayList<CompOp> compopList = new ArrayList<CompOp>();
Expr fisrtExpr = expr();
while (lexer.token == Symbol.EQ
|| lexer.token == Symbol.NEQ || lexer.token == Symbol.NOT
|... |
0d41c981-82cd-4f1f-8766-255bea8e98e5 | 9 | public int[] render(int xOffset, int yOffset, int w, int h)
{
if(isBlankTiles)
{
return null;
}
if(!APIMain.getAPI().renderMapOnce || pix == null || update)
{
pix = new int[w * h];
MapManager mm = MapManager.instance;
Tile tilevoid = mm.getTileFromID(0);
Tile currentTile = tilevoid;
int[] c... |
32919f50-0e81-449b-bfe7-08edd2e80410 | 3 | @Override
public void run(CommandArgs arg0) {
CommandLine c = arg0.getCommandline();
String[] args = arg0.getRawArgs().split(" ");
if (args.length > 1 && args[0].equals("site")) {
Integer id = Integer.parseInt(args[1]);
// Get the site
Site site = WebSe... |
21fc1c0f-5df3-4ae4-ab8e-4deed6f42852 | 2 | public static void main(String[] args) {
// TODO Auto-generated method stub
double gallons, liters;
int counter;
counter = 0;
for(gallons = 1; gallons <= 100; gallons++)
{
liters = gallons * 3.7854;
System.out.println(gallons + " gallons is " +
liters + " liters.");
counter++;
if (c... |
4c92c163-595f-42b3-97f9-701b2830e2c6 | 0 | public void setTableName(String tableName) {
this.tableName = tableName;
} |
457672b0-ec9a-4992-a080-25d8b4212c03 | 1 | private String calc(String input) {
String reversed = "";
for(int i = input.length(); i > 0; i --){
reversed = reversed + input.charAt(i-1);
}
return reversed;
} |
e191d38d-9311-472c-acab-073fae2f0888 | 5 | public static void main(String[] args) {
Jsaper jsaper = new Jsaper();
Path file = null;
Path targetDirectory = null;
Map<String, Object[]> map = jsaper.getParamList(args);
if(map.get("one")[0].equals(true)) {
file = initAchiveFile(map.get("other")[0].toString());
UnZipper zipper;
try {
zipper ... |
fed36f9c-9579-4b19-9b47-cfe0ff76e554 | 4 | public Connection getConnection()
{
if (_connection == null)
{
try
{
_connection = ConnectionContext.getConnection();
if (!_connection.isConnected())
{
_connection.connect("USER","_SYSTEM","DATA");
... |
a959a861-68e4-4ca9-a810-dc744f396919 | 7 | public void init() {
String serverConnectStr = "Enter server: ";
while (true) {
String hostStr = JOptionPane.showInputDialog(serverConnectStr, Connection.DEFAULT_HOST + ":" + String.valueOf(Connection.DEFAULT_PORT));
if (hostStr == null) {
return;
}
try {
this.conn = new Connection(hostStr);
... |
15cb18ca-16cb-4567-b03c-5df045ae56a2 | 7 | public void traverseRayTopDown(OctreeHitResult hit_result){
if( hit_result == null ){
return ;
}
IDX_SHFT = 0;
DwRay3D ray_mod = hit_result.ray.copy(); // copy ray
if( mirrorComponent(root.aabb, ray_mod, 0) ) IDX_SHFT |= 4;
if( mirrorComponent(root.aabb, ray_mod, 1) ) IDX_SHFT |= 2;... |
279d73bf-9360-4fac-86c7-00a9f5a16b19 | 8 | @Override
public HashMap<String,ClassNode> refactor(){
//if (!Updater.useOutput)
// Deob.deobOutput.add("* Starting Arithmetic Deob*"+System.getProperty("line.separator"));
System.out.println("* Starting Arithmetic Deob*");
List<InsnWrapper> replace = getInstructions();
... |
13f5419b-8394-4072-819b-1bc5d1c1c1a4 | 5 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Hospedagem other = (Hospedagem) obj;
if (this.IdHospedagem != other.IdHospedagem && (this.IdHospedagem ==... |
97e6e737-9dd2-499f-99ca-d418d7236612 | 9 | public static String getFormattedTime(int time) { // throws Exception{
if (time < 10 && time >= 0) {
return String.format("0%d00", time);
} else if (time <= 24 && time >= 0) {
return String.format("%d00", time);
} else if (time >= 100 && time <= 2400) {
if (time % 100 < 60 && time % 100 >= 0) {
if (t... |
0a0e5e9b-8a95-422d-ad42-1bea1c29bfb3 | 0 | public DefaultTempFile(String tempdir) throws IOException {
file = File.createTempFile("NanoHTTPD-", "", new File(tempdir));
fstream = new FileOutputStream(file);
} |
53c00164-e675-4996-be49-f83e9e822db7 | 8 | void shutdown() {
if (preferences != null && owner != null) {
Rectangle bounds = owner.getBounds();
preferences.putInt("Upper-left x", bounds.x);
preferences.putInt("Upper-left y", bounds.y);
MenuBar menuBar = (MenuBar) owner.getJMenuBar();
preferences.put("Latest E2D Path", menuBar.getLatestPath("e2d"... |
0b5c5e57-f11c-4b26-a024-af623852b174 | 7 | public void handle(String target, Request serverRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
if (!target.equals("/shutdown") || !request.getMethod().equals("POST") || !secret.equals(request.getParameter("secret")))
return;
try {
... |
5c810209-4eda-4c94-9a6f-1dcde9dbf4d0 | 6 | void createColorAndFontGroup () {
super.createColorAndFontGroup();
TableItem item = new TableItem(colorAndFontTable, SWT.None);
item.setText(ControlExample.getResourceString ("Item_Foreground_Color"));
item = new TableItem(colorAndFontTable, SWT.None);
item.setText(ControlExample.getResourceString ("Item_B... |
9dc385d2-6cf2-4e7d-a9d6-4620dadb3081 | 1 | public synchronized boolean remover(int i)
{
try
{
new PesquisaDAO().remover(list.get(i));
list = new PesquisaDAO().listar("");
preencherTabela();
}
catch (Exception e)
{
return false;
}
return true;
} |
0dbe3098-dd56-489a-a02e-fd17cce9d3cb | 5 | private void calculateSimilarities() {
for (Integer user1 : userRatedMovies.keySet()) {
for (Integer user2 : userRatedMovies.keySet()) {
if (user1 > user2) {
double sim = computeSimilarity(user1, user2);
if (similarities.containsKey(user1)) {
similarities.get(user1).put(user2, sim);
} el... |
e8842ada-bc0c-45ff-bc9f-aa2cf90ddcee | 3 | public ParseTree optimise(ParseTree root) {
//This is the root that will replace the unoptimised root
ParseTree optimisedTree = new ParseTree();
//Copy the root's data into the optimised tree
optimisedTree.value = root.value;
optimisedTree.attribute = root.attribute;
//Optimise all children
if (root... |
22746874-154c-49b3-8bae-5424e55de785 | 4 | private void guardarNuevo(){
if(partida.getInvasores() != null){
final String nombre = JOptionPane.showInputDialog( this,
"El nombre del juego debe estar\ncomprendido entre 3 y 15 caracteres "
,"¿Con qué nombre quieres guardar el juego?",
... |
b8ffc3ac-0c6a-4ae7-ab38-2fedfc34424c | 4 | public int getItemRankLevel(String rank){
String r = rank;
if(r.equalsIgnoreCase("*")){
return 1;
}else if(r.equalsIgnoreCase("**")){
return 2;
}else if(r.equalsIgnoreCase("***")){
return 3;
}else if(r.equalsIgnoreCase("****")){
return 4;
}else{
return 0;
}
} |
bde07cd1-d973-45f0-aa69-848ac273b828 | 9 | private boolean formulaOK(Stock stock, ArrayList<EconomicIndicator> indicatorsTest,
ArrayList<Double> formula) {
//Will all indicators very high result in an unusable price?
double calcPrice = 0;
for (int i = 0; i < indicators.size(); i++){
calcPrice += indicatorsMin.get(i) * fo... |
050c4559-f8c2-434b-9af5-c8f3e6db5f0c | 8 | private Map<Integer, Integer> dijkstra(Integer start, Integer stop) {
for (Integer inte : graph.getEdges()) {
PonderatePoint pp;
if(inte.equals(start)) {
pp = new PonderatePoint(inte,0);
}
else{
pp = new PonderatePoint(inte,INFINITE);
}
predecessors.put(inte, -1);
vertex.add(pp);
dis... |
5f17a3a3-af25-4a6d-8f19-2dd143879ed5 | 3 | public AnimExplosion(float width, float height) {
SpriteSheet explosion = null;
try {
explosion = new SpriteSheet("resources/explosion.png", 256, 256);
} catch (SlickException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
explode = new Animation();
for (int i... |
9cc88786-5f6b-44dd-8b62-3e10672fcc01 | 9 | public static void evalPrecision(Dataset dataset)
{
double trainTotal = 0, trainCorrect = 0;
double testTotal = 0, testCorrect = 0;
double quizTotal = 0, quizCorrect = 0;
for(Instance inst : dataset.data)
{
if(inst.type == InstanceType.Train)
{
trainTotal++;
if(inst.target == inst.predict)
... |
2a0ed7f1-62a1-4951-b6a7-3b5375f3e854 | 9 | private void writeEscaped(final char[] buffer, final int offset, final int len) throws IOException {
final int maxi = offset + len;
for (int i = offset; i < maxi; i++) {
final char c = buffer[i];
if (c == '\n') {
this.writer.write("<br />");
... |
71a72678-7b2b-4836-966f-130b3c1223bc | 8 | public void updateLatestWrite(ReadIncOperation riop)
{
ReadIncOperation riop_var_wriop = null;
for (String var : GlobalData.VARSET) // variable by variable
{
riop_var_wriop = riop.getLatestWriteMap().getLatestWrite(var);
if (riop_var_wriop != null)
if (this.getLatestWrite(var) == null || this.getLatest... |
ad73381d-f100-40e6-ab2d-0ae71bb60e42 | 6 | public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... |
bbb26636-3ef7-477e-9021-4a9e41b610f4 | 6 | public final void setMeso(final int meso) {
if (locked || partner == null || meso <= 0 || this.meso + meso <= 0) {
return;
}
if (chr.getMeso() >= meso) {
chr.gainMeso(-meso, false, true, false);
this.meso += meso;
chr.getClient().getSession().write(MaplePacketCreator.getTradeMesoSet((byte) 0, thi... |
49ad98ab-084d-417a-99fa-41fc0a7f2dfd | 4 | public ServerListen(Socket connection) {
try {
ObjectInputStream oInputStream;
ObjectOutputStream oOutputStream;
this.connection = connection;
oInputStream = new ObjectInputStream(connection.getInputStream());
client = (Player) oInputStream.readObject();
clientIp = connection.getInetAddress().g... |
b4f04c52-632a-4c7b-bcdd-e3ba7e018a20 | 3 | int getOrderIndex () {
CTableColumn[] orderedColumns = parent.orderedColumns;
if (orderedColumns == null) return getIndex ();
for (int i = 0; i < orderedColumns.length; i++) {
if (orderedColumns [i] == this) return i;
}
return -1;
} |
4678cadc-e0c4-4803-8371-6d9d5974d625 | 5 | public void edit(Employee employee) throws NonexistentEntityException, Exception {
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
employee = em.merge(employee);
em.getTransaction().commit();
} catch (Exception ... |
8ec4b657-ce55-4c53-949c-01d223488fa0 | 1 | protected int Seek(long offset)
{
int rc;
try
{
file.seek(offset);
rc = DDC_SUCCESS;
} catch (IOException ioe)
{
rc = DDC_FILE_ERROR;
}
return rc;
} |
ed63b0aa-4c7a-48c6-b834-a570843a0b85 | 6 | private int getFirstIdenticalVertexId(Model model, int vertex) {
int vertexId = -1;
int x = model.verticesX[vertex];
int y = model.verticesY[vertex];
int z = model.verticesZ[vertex];
for (int v = 0; v < vertexCount; v++) {
if (x != verticesX[v] || y != verticesY[v] || z != verticesZ[v])
continue;
ve... |
a5fde65d-88e1-409a-a857-7132754d794b | 7 | public void expandNode(final Node n) {
new Thread() {
public void run() {
synchronized (LocalityUtils.this) {
if (!locality.getCompleteEltSet().contains(n)) return;
tgPanel.stopDamper();
for(int... |
6a40c5a4-1105-454d-aae3-2f591652f6e6 | 1 | @Override
public boolean checkCanPlace() {
boolean canPlace = super.checkCanPlace();
String group = registry.getBlockManager().getBlockGroup(mapX, mapY);
if(group.equals("Town")) {
canPlace = false;
}
return canPlace;
} |
46585ec0-335a-42ba-9a72-ef93bab6449d | 0 | protected void _reallocate(int newCapacity) {
buf = Arrays.copyOf(buf, newCapacity);
} |
5760a260-4d0a-495a-9d0d-ebb28672e594 | 6 | @Override
public void mouseMoved(MouseEvent event) {
JFrame frame = Game.get().display.getFrame();
float zoomX = (frame.getWidth()-frame.getInsets().left-frame.getInsets().right)/800f;
float zoomY = (frame.getHeight()-frame.getInsets().top-frame.getInsets().bottom)/800f;
int mouseX = (int) (event.getX()/zoo... |
6d7f657f-3f56-4afc-9ed0-bb77463e2ced | 4 | public void testConstructor_int_int_Chronology() throws Throwable {
TimeOfDay test = new TimeOfDay(10, 20, JulianChronology.getInstance());
assertEquals(JulianChronology.getInstanceUTC(), test.getChronology());
assertEquals(10, test.getHourOfDay());
assertEquals(20, test.getMinuteOfHour(... |
a8032f93-7b6c-465d-a6b6-dd36e232b74d | 6 | private void actionListener(){
mntmClientes.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
new AddCliente();
}
});
mntmFuncionarios.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
new Add... |
e3295c08-9cdb-446a-955b-644911d34a25 | 3 | private String getFileChecksum()
throws IOException, NoSuchAlgorithmException
{ InputStream in = new FileInputStream(file.getAbsolutePath());
byte[] buffer = new byte[1024];
int bytes_read;
MessageDigest complete = MessageDigest.getInstance("MD5");
do
{ bytes_read = in.read(buffer);
if(bytes_rea... |
f12795d5-718c-4122-b01d-b952e9b0d1fa | 9 | private void addButtonSet(JPanel panel, String[] buttons, int rows, int leftPadding) {
int row = 0;
int column = 1;
for (String numButton : buttons) {
String[] sizeText = numButton.split(",");
int width = SMALL_BUTTON_WIDTH;
int sep = SMALL_BUTTON_SEP;
... |
fb9f0fae-ad71-4211-8c7a-b982c4e72668 | 1 | @Override
public BigDecimal getPrice(String sku) throws SkuNotFoundException {
final BigDecimal price = this.dataAccess.getPriceBySku(sku);
if (price == null) {
throw new SkuNotFoundException();
}
return price.add(price);
} |
ce243002-b89d-4ae9-8107-080157293e28 | 1 | private boolean jj_3R_74() {
if (jj_3R_72()) return true;
return false;
} |
ded7b4d6-583b-4640-8a1d-d453cbfb83bd | 8 | public void keyReleased(KeyEvent e) {
int keyCode = e.getKeyCode();
//System.out.println("Release: " + e.getKeyText(e.getKeyCode()));
KeyBoard mInstance = KeyBoard.getInstance();
switch (keyCode) {
case KeyEvent.VK_UP :
mInstance.Release(KeyBoard.KEY_CODE.KEY_UP);
break;
case KeyEvent.VK... |
0f2d3dc1-efab-4a8b-acb5-b474f8d7aac6 | 1 | @Override
public boolean equals(final Object obj) {
final ComparableNumber num;
try {
num = (ComparableNumber) obj;
} catch (ClassCastException c) {
return false;
}
return number.equals(num.getNumber());
} |
0b7e00f0-58e4-4b6b-b4ec-d89dc1189088 | 7 | static final public void sum() throws ParseException {
term();
label_1:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case PLUS:
case MINUS:
;
break;
default:
jj_la1[1] = jj_gen;
break label_1;
}
switch ((jj_ntk==-1)?jj_ntk():jj_nt... |
40d757b4-fc27-4b8f-8142-2ffa0e9b005e | 6 | public void generateHardwareSetAlternatives() {
generateDummyHardwareAlternatives();
for (HardwareAlternative cpuAlternative : cpuAlternatives)
for (HardwareAlternative hddAlternative : hddAlternatives)
for (HardwareAlternative memoryAlternative : memoryAlternatives)
for (HardwareAlternative networkAlte... |
27c331ad-c905-4580-adea-b20d909a9f0a | 8 | @Override
public void collides(Entity... en) {
for (Bullet B : b) {
if (B == null || B.getBounds() == null || B == null || B.cull()) {
continue;
}
for (Entity e : en) {
if (e == B)
continue;
Polygon p = e.getBounds();
if (B.shape.intersects(e.getBounds())) {
B.takeDamage(e.doDamage... |
a938eef0-7907-45dc-b610-25bf551caab6 | 9 | @Override
protected boolean isSubTypeOf(final BasicValue value,
final BasicValue expected) {
Type expectedType = expected.getType();
Type type = value.getType();
switch (expectedType.getSort()) {
case Type.INT:
case Type.FLOAT:
case Type.LONG:
case... |
5f4626ce-0582-45d6-9519-a196bfe2c66a | 6 | @Override
public Choice getChoice(List<Choice> choices) {
while (true) {
for (int i = 0; i < choices.size(); i++) {
Choice mc = choices.get(i);
System.out.print((i+1) + ". ");
System.out.println(mc.getDescription());
}
// ask for input
String input = console.nextLine();
try {
i... |
c1dc978e-a15f-4b5e-b1cb-7f7c62290eb2 | 9 | static void initiateParameters() throws IOException {
InputParams inputParams = new InputParams();
while (!inputParams.isFinised) {
sikuli.wait(1);
}
rowNum = inputParams.getRowNum();
cowNum = inputParams.getCowNum();
cards = new Card[rowNum + 2][cowNum + 2];
isScaned = new boolean[rowNum + 2][cowNum ... |
7161301b-df8a-4e0e-93a5-36096d22d1f2 | 0 | @Override
public String toString() {
return this.value;
} |
d31363b2-8ded-4594-bb2b-1427cf136d06 | 6 | public static void save(double[] input, String filename) {
// assumes 44,100 samples per second
// use 16-bit audio, mono, signed PCM, little Endian
AudioFormat format = new AudioFormat(SAMPLE_RATE, 16, 1, true, false);
byte[] data = new byte[2 * input.length];
for (int i = 0; i... |
b28ef7c7-06d9-4f1e-b91e-a0127c0f9df4 | 7 | @Override
public void preUpdate() {
if(destruction) destroy();
if(x<=16 || x>=map.getMapWidth()-16 ) hspeed=-hspeed;
if( y<=16 || y>=map.getMapHeight()-16) vspeed=-vspeed;
if(!activated && placeFree() ) {
activated=true;
}
// TODO Auto-gene rated method stub
} |
98d08793-de1e-4607-b30e-1565d8fdac55 | 4 | public void render(GameObject object)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
forwardAmbient.bind();
object.renderAll(forwardAmbient, this);
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE);
glDepthMask(false);
glDepthFunc(GL_EQUAL);
for(BaseLight light : lights)
{
act... |
80ce47e8-d504-439b-b845-200ecf36b993 | 5 | public CheckResultMessage checkF08(int day) {
int r1 = get(20, 5);
int c1 = get(21, 5);
int r2 = get(47, 5);
int c2 = get(48, 5);
if (checkVersion(file).equals("2003")) {
try {
in = new FileInputStream(file);
hWorkbook = new HSSFWorkbook(in);
if (0 != getValue(r1 + 8, c1 + day, 5).compareTo(
... |
e1e05aba-7d8c-429b-8320-5d79b81fd3cd | 0 | public String getName() {
return this._name;
} |
eb8d6367-af7f-4a82-bf1b-92603639de21 | 3 | public static void keyDown(long delta, int key) {
switch (key) {
case Keyboard.KEY_UP:
Game.player.jump(delta);
break;
case Keyboard.KEY_LEFT:
Game.player.move(delta, "left");
break;
case Keyboard.KEY_RIGHT:
Game.player.move(delta, "right");
break;
default:
System.err.println(Keyboard.get... |
2a68e56d-fcad-4a51-9ff4-5b9f2b9d6d5d | 4 | private PreparedStatement statement(Object[] args, Sql annotation, Connection c) throws SQLException {
logger.info("Start prepare statement");
Map<String, Object> queryParams = new HashMap<String, Object>();
int argNr = 1;
if (args != null) {
for (Object arg: args) {
... |
59159659-949e-4a6b-be6f-315574f3c77d | 6 | public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int l = Integer.parseInt(br.readLine());
String[] in = br.readLine().split(" ");
int[] r = new int[l];
int max_all = 0;
for (int i = 0; i < l; i++) {
int max = Integer.MIN... |
7b5d3e9a-432d-42db-a69e-654c64b2fc1d | 0 | public void setSkillName(String skillName) {
this.skillName = skillName;
} |
4aa651a3-3d37-450f-9c51-5352044250a8 | 6 | public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... |
61c54f5f-6394-49a5-8c16-81a63e1f0d13 | 7 | @Override
public void mouseExited(MouseEvent e) {
Virucide.moving = true;
try {
Robot r = new Robot();
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
if (game && !Virucide.menu && !Virucide.pause && !clickedAgain && !Virucide.loose && !Virucide.win) ... |
e96b8d25-e4f3-4b0d-ae67-a2b080588d16 | 1 | private void toggleSpareElement(boolean direction) {
final String SPARE_FILE = baseTestNoteRepository + SPARE_TESTFILE_UUID;
File spareFile = new File(SPARE_FILE + ".spare");
File jsonFile = new File(SPARE_FILE + ".json");
if (direction == SPARE2JSON) {
assertTrue(spareFile.... |
b78a1569-1dfd-4fdd-a4ae-9b5935675a31 | 8 | @Override
public char getIndicator() {
final int len = source.length();
char ind = (len > 0) ? source.charAt(0) : ' ';
switch (ind) {
case '*':
case '/':
case '$': break;
case 'D': // Debugging line is marked by a 'D'/'d' followed
... |
c1c0f068-b2dd-4418-afb1-6e987d431b5a | 0 | public final synchronized void disconnect() {
this.quitServer();
} |
44235c2c-b623-4a10-9867-1bc31db2206b | 5 | public void inactivaItem(PosListaPrecio itemOracle,
int idPos){
// PREGUNTO SI EL ID DEL ITEM VIENE EN NULO
if (itemOracle.getPcaIdElemento() != null) {
//TRAIGO EL ITEM POS SEGUN EL PCIDELEMENTO DE ORACLE
PhpposItemsEntity itemPos = getItemPos(itemOr... |
5f56ff51-b245-4fab-bc4f-81945798bbc1 | 8 | private int isNextSequenceCard(Card prev_card, Card this_card, int jokers_inbetween)
{
int ret = -1;
if ((prev_card == null) || (this_card == null))
return ret;
if (prev_card.getSuite().compareTo(this_card.getSuite()) != 0)
return ret;
int pval = Rummy.this.cardValue(prev_card, false);
int tva... |
60d201a3-b247-4b3a-ace6-6558e0c9fc03 | 1 | public StatusModel(String ipaddress) {
ip = ipaddress;
try {
a = (Inet4Address) InetAddress.getByName(ip);
} catch (UnknownHostException e) {
}
} |
48c9a354-6139-45be-9589-65e9e3109835 | 7 | public static void testValidity(Object o) throws JSONException {
if (o != null) {
if (o instanceof Double) {
if (((Double)o).isInfinite() || ((Double)o).isNaN()) {
throw new JSONException(
"JSON does not allow non-finite numbers.");
... |
d6dc5c29-fefd-4362-b44e-c8634391265e | 9 | public void Checkwhile(String cond){
if(new_flag==2){
current_register--;
}
new_flag=0;
current_label++;
TypeTable.put(current_register,current_element.E_type);
if(cond.equals("TRUE")){
AddOperation("STOR... |
7c566153-a7dc-4e50-8312-1ebf80435eed | 1 | *
* @throws IOException if a communications error occurs
* @throws UnknownHostException if the Cyc server cannot be found
* @throws CycApiException if the Cyc server returns an error
*/
public CycList getApplicableBinaryPredicates(CycList kbSubsetCollections)
throws UnknownHostException, IOExcep... |
063beac0-5130-4c19-96d4-b72c705eef31 | 4 | public int comparer(NextTickListEntry var1) {
return this.scheduledTime < var1.scheduledTime?-1:(this.scheduledTime > var1.scheduledTime?1:(this.tickEntryID < var1.tickEntryID?-1:(this.tickEntryID > var1.tickEntryID?1:0)));
} |
1b1baf77-cacb-4183-bd74-df5b60119d61 | 5 | @Override
public boolean tableExists(String table) {
ResultSet res = null;
table = table.replace("#__", prefix);
try {
DatabaseMetaData data = this.con.getMetaData();
res = data.getTables(null, null, table, null);
return res.next();
} catch (SQLException e) {
if (this.dbg) {
e.printStackTra... |
c0afd7fb-81e6-4b51-919b-af53bfd17f70 | 6 | public void removeTime(Node v, int t) {
ArrayList<Edge> toRemove = new ArrayList<Edge>();
for (Edge edge : adj){
Schedule s = edge.getSchedule();
if (edge.getV() == v)
s.remove(t, t+1);
else
s.remove(t-1,t+2);
if (s.isEmpty())
toRemove.add(edge);
Edge inv = edge.getInv();
if (inv ... |
b3029778-6416-4c75-9ec5-82effd761279 | 2 | public static ParticleEffect fromName(String name) {
for (Entry<String, ParticleEffect> entry : NAME_MAP.entrySet()) {
if (!entry.getKey().equalsIgnoreCase(name)) {
continue;
}
return entry.getValue();
}
return null;
} |
3304460e-8959-4f84-bd92-7551bb797bc8 | 8 | @EventHandler
public void handleBlockPlacements(BlockPlaceEvent event) {
Player player = event.getPlayer();
User user = EdgeCoreAPI.userAPI().getUser(player.getName());
if (user != null) {
Cuboid cuboid = Cuboid.getCuboid(player.getLocation());
if (cuboid == null) {
if (!WorldManager... |
dc8c4e91-62b2-4de8-a065-3c236e325385 | 2 | public void adicionarAula(Aula aula) {
if(aula == null){
throw new IllegalStateException("Aula inválida.");
}
if(grade.contains(aula)){
throw new IllegalStateException("Professor já contem esta aula em sua grade");
}
grade.add(aula);
... |
589835df-16c6-4b82-82fc-24a54fd3ed6c | 3 | @Override
public void fill(Parameter parameter, Type type, Annotation[] annotations)
{
for (Annotation annotation : annotations)
{
if (annotation instanceof Default)
{
Class value = ((Default)annotation).value();
if (value == DefaultValue.c... |
de06283b-467e-4015-bc73-6d5146b620db | 2 | public static String[] removeEmptyStrings(String[] data)
{
ArrayList<String> result = new ArrayList<String>();
for (int i = 0; i < data.length; i++)
{
if (!data[i].equals(""))
{
result.add(data[i]);
}
}
String[] res = new ... |
f66eeca0-9062-4af7-bf81-734ac77c2b72 | 6 | public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... |
16d97615-b545-4791-abe4-661d27f4f855 | 1 | public static boolean isAlNum(int c) {
return isAlpha(c) || isDigit(c);
} |
f00fd9db-d780-43a3-8a3b-54b86a1c3b86 | 4 | public void play()
{
finishedExecuting = false;
Thread t = new Thread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
result = engine.setUpGame();
finishedExecuting = true;
}
});
t.start();
try {
t.join(3600000);
if(finishedExecuting = false)
... |
47003ca3-4232-4143-a988-d3582fb3588f | 1 | public boolean add(List<String> args) throws InvalidTableRowException {
if (args.size() != columnNames.size()) {
throw new InvalidTableRowException("args massive size doesn't map table column size");
}
String key = args.get(0);
Row row = new Row(args);
rows.put(key,... |
7e51d964-1c5d-4e02-86d2-0c239b8525e6 | 4 | @SuppressWarnings("unchecked")
private void fridayCheckActionPerformed(java.awt.event.ActionEvent evt) {
if(this.dayChecks[5].isSelected()) {
this.numSelected++;
if(this.firstSelection) {
stretch();
}
thi... |
a9199cf9-e245-4815-bfad-245b066564de | 5 | public String toString() {
StringBuilder sb = new StringBuilder();
List<String> ruleStrings = new ArrayList<String>();
for (String parent : binaryRulesByParent.keySet()) {
for (BinaryRule binaryRule : getBinaryRulesByParent(parent)) {
ruleStrings.add(binaryRule.toString());
}... |
2eff5639-757f-4063-801e-309822f8cd7e | 9 | @Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
if(this.SceneManager.getMapBuffer() != null)
{
// declare the selected scene
Scene SelectedScene = this.SceneManager.getCurrentScene();
// create the game image and get the gr... |
6f840aec-8827-41c6-b312-d1d725803f09 | 0 | public FileNameTooLongException(Exception ex, String name)
{
super(ex, name);
} |
38101cad-ad7c-4d94-a3d3-136effc14b10 | 6 | public HistoricoResponse validaIngresoParametros(CriterioRequest criterio) {
HistoricoResponse historicoResponse = new HistoricoResponse();
if (criterio.getAgencia().equalsIgnoreCase("") && criterio.getCanal().equalsIgnoreCase("") && criterio.getCodigoVendedor() == 0
&& criterio.getEsta... |
f2283f7f-bc05-4ee5-b017-32198ba7fbac | 9 | @Override
public boolean visitTree(VisitContext context,
VisitCallback callback) {
// First check to see whether we are visitable. If not
// short-circuit out of this subtree, though allow the
// visit to proceed through to other subtrees.
if (!isVisit... |
0bc602fc-3629-4df9-8232-497705290569 | 1 | public void save()
{
if (isConfirmPassword())
{
user.setPassword(DigestUtils.md5Hex(getPassword()));
IndexedEntityService.save(getUser());
goToLogin();
}
} |
dd0d08b0-e3ed-4d3e-9d5c-78091520e473 | 1 | @Override
public void mouseExited( MouseEvent e ) {
for( MouseListener listener : listeners( MouseListener.class )){
listener.mouseExited( e );
}
} |
2f570827-f437-44a8-ba79-5d87c5ab32f1 | 9 | private static boolean interpretLine(DatabaseUtil databaseUtil, String line) {
boolean result;
String command;
List<?> objects;
int affected;
result = false;
try {
command = StringUtils.substringBefore(line, " ");
switch (command) {
case "quit":
result = true;
break;
... |
6559c740-904b-486d-b32e-54cd478423ca | 9 | public static boolean isValid(List<TableEntity> tables) {
if (tables == null || tables.size() == 0) {
logger.error("input table information is empty");
return false;
}
for (TableEntity table : tables) {
if (!(Argument.isDeleteAction() && table.isOfCheckSheet()... |
13209c6b-93c2-4441-adce-ad6ca3fe9116 | 5 | @Test(expected = DAIllegalArgumentException.class)
public void testInfixToPostfix14() throws DAIllegalArgumentException,
DAIndexOutOfBoundsException, ShouldNotBeHereException,
BadNextValueException, UnmatchingParenthesisException {
try {
infix.addLast("/");
infix.addLast("0");
QueueInterface<String> p... |
c04bddf1-537e-4963-a785-7a8aa53ed433 | 3 | @Override
public String skip_spaces(String str){
String[] split = str.split(" ");
if(split.length > 0){
String output = split[0];
for(int index = 1; index < split.length; index++){
if(split[index].length() > 0) output += " " + split[index];
}
return output;
}
else return "";
} |
c457b19e-80f7-492e-9b3f-132231e14c1f | 6 | @Override
public String solve(Cube cube){
String movements = "";
for (int f = 1; f < 6; f = f == 2 ? f + 2 : f + 1) {
TileColor c1 = TileColor.get(f);
if (c1.getInt() != 0 && c1.getInt() != 3) {
TileColor c2 = c1.getInt() == 2 ? TileColor.get(4) : c1.getInt() == 5 ? TileColor.get(1) : TileColor.get(c1.ge... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.