method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
f86adfd3-59bb-4207-b63c-6a3a8a726b66 | 9 | public MainSimplePanel(String fileName) throws IOException {
ToolTipManager.sharedInstance().setInitialDelay(5);
backgroundImage = ImageIO.read(new File(fileName));
this.setLayout(null);
// Creat Icons & Hints
icons = new String[3 * nbrButton];
for (i = 0; i < 3 * nbrBu... |
5b6d2c16-33bb-4387-bb1f-96de0dd6ef0e | 0 | @Test
public void tasoKuuluukoPiste() {
t.lisaaEste(e);
assertTrue("onkoPisteessaEste() antoi väärän arvon olisi pitänyt olla true",
t.onkoPisteessaEste(p) != null);
p.siirra(20, 0);
assertTrue("onkoPisteessaEste() antoi väärän arvon",
t.onkoPisteess... |
9bc01ef4-a37c-4e79-9830-da8d94d03486 | 7 | private static final boolean exchange(L2PcInstance player, int objectId)
{
L2ItemInstance item = player.getInventory().getItemByObjectId(objectId);
if (item == null)
return false;
// check enchant level
if (item.getEnchantLevel() < 10)
return false;
// check grade
if (item.getItem().getCrystalT... |
618f8f69-8167-435f-acd0-c50999cbbe6e | 7 | public static Rule_interfaceMode parse(ParserContext context)
{
context.push("interfaceMode");
boolean parsed = true;
int s0 = context.index;
ArrayList<Rule> e0 = new ArrayList<Rule>();
Rule rule;
parsed = false;
if (!parsed)
{
{
ArrayList<Rule> e1 = new ArrayList<Rule>... |
46be5137-6a1e-4891-be18-7634f3f77b60 | 3 | public void draw(Graphics g, int x, int y, int width, int height){
if(img == null)
return;
at = new AffineTransform();
at.translate(x, y);
if (img.getWidth() != width) {
at.scale((double)width/(double)img.getWidth(), 1);
}
if (img.getHeight() != height) {
at.scale(1, height/(double)img.getHeight())... |
eb8547a2-8aab-4798-9ed1-5e93eed39b5e | 2 | public K getMin(){
K minKey = null;
Integer minValue = Integer.MAX_VALUE;
for (Map.Entry<K, Integer> entry : map.entrySet()){
if (entry.getValue() < minValue){
minKey = entry.getKey();
minValue = entry.getValue();
}
}
return... |
1c20308a-27e4-493c-a641-1a24f2386aff | 6 | private String[] createFileString(String listData, String[] rfmFileFields) {
//Crea el arreglo con los datos que se escribiran en el archivo .frm
String[] data = new String[rfmFileFields.length + 2];
int index = 0;
for (String string : rfmFileFields) {
if (index == 1... |
62f69f6e-b027-4655-b64a-55ca4fd781f0 | 4 | public static void tick(){
while(Keyboard.next()){
if(Keyboard.getEventKeyState()){
if(Keyboard.getEventKey() == Keyboard.KEY_U){
if(Rainbow == false){
Rainbow = true;
}else{
Rainbow = false;
}
//System.out.println(Rainbow);
}
}
}
} |
1ef00210-f2ad-4942-90f4-c7acb7e15f7a | 7 | @Override
public void addMeetingNotes(int id, String text) {
Calendar now = Calendar.getInstance();
Meeting convertedToPastMeeting = null;
Meeting updatedPastMeeting = null;
if (text == null) {
throw new NullPointerException("Please specify notes for the meeting");
... |
44805f69-8a91-47c2-a35b-ba472e2fca98 | 2 | public void startServer() {
GameSession gameSession = null;
try {
this.remotePlayer = new ServerPlayer();
localPlayer = new Player("X", this.nextMove);
ServerPlayer _remotePlayer = (ServerPlayer) this.remotePlayer;
// TODO Ask the user for the dimensions... |
0d8bad8f-9aad-454c-908a-112bfc481a23 | 2 | private boolean isPair()
{
return compareCardFigures(0, 1) || compareCardFigures(1, 2) || compareCardFigures(2, 3);
} |
247eac5c-55bd-4eae-ad26-9872aef6037f | 4 | public static byte[] getBytesFromFile(String filename) throws IOException
{
File file = new File( filename );
InputStream is = new FileInputStream(file);
// Get the size of the file
long length = file.length();
// You cannot create an array using a long type.
... |
c71fc7d6-71a0-41ff-89c0-39ecbedc4799 | 0 | public static void main(String args[])
{
_view=new View();
a=new ActionDispatch(_view);
c=new Controller(_view,a);
_view.show();
} |
f498c3c2-b796-41f8-aa1b-433584ac6c16 | 9 | public String getAnswer() throws Exception {
long prime = getNextPrime(56003);
while (prime < 200000) {
String primeStr = Long.toString(prime);
for (int i = 0;i<2;i++) {
int numPrimes = 1;
if (primeStr.contains(Integer.toString(i))) {
... |
db2e86e9-9450-4aac-8118-88a83a7ea00c | 1 | public void testIsBefore_MD() {
MonthDay test1 = new MonthDay(6, 6);
MonthDay test1a = new MonthDay(6, 6);
assertEquals(false, test1.isBefore(test1a));
assertEquals(false, test1a.isBefore(test1));
assertEquals(false, test1.isBefore(test1));
assertEquals(false, test1a.isBe... |
1a01cc65-4a5f-4c38-847b-41eb393c0708 | 1 | private void sendAddonOutput(Addon addon, Message message) {
List<String> reaction = addon.generateReaction(message);
if ( addon.errorOccurred() ) {
displayAddonFailureIfIsSet( addon.getError() );
sendListOfNotices(message.author, reaction);
} else {
sendListO... |
08c4af26-075b-4fef-87eb-67f0dc6948a4 | 6 | @EventHandler
public void EnderDragonWither(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getEnderDragonConfig().getDouble("Ender... |
3bd8f1aa-762b-4aa0-b2fc-ec9976fcfeeb | 5 | public synchronized void close() throws IOException {
if (socket != null) {
if (this.connected) {
this.closing = true;
// try to send outgoing data for at most 10ms
if (writeThread != null) {
try {
writeThread.join(10);
} catch (InterruptedException e) {
e.printStackTrace();
... |
fb7cc211-eafa-4b5d-bbd3-14267c6f3392 | 9 | private void checkScoutValidity(StrategyBoard gameBoard, PlayerColor currentTurn, PieceType movePiece,
Location moveFromLocation, Location moveToLocation) throws StrategyException
{
final int distance = moveFromLocation.distanceTo(moveToLocation);
if (gameBoard.getPieceAt(moveToLocation) != null && distance... |
ba3e619b-9566-4923-b208-458ccf43c841 | 9 | public void run() {
FileRootEnumeration list = (FileRootEnumeration)FileSystemRegistry.listRoots();
while(list.hasMoreElements()){
String element = (String)list.nextElement();
roots.put(element, element);
}
while (FileSystemRegistry.fslistener != null) {
list = (FileRootEnumeration)FileSys... |
678e2eb6-21f7-4ed1-b317-988be455b93f | 3 | public void setHmac(Key key){
Mac hmac = null;
try {
hmac = Mac.getInstance("HmacSHA256");
} catch (NoSuchAlgorithmException e) {
System.err.println("NoSuchAlgorithmException (HmacSHA256 not valid): " + e.getMessage());
}
try {
hmac.init(key);
} catch (InvalidKeyException e) {
System.err.println... |
6d584cda-d504-41d3-9cfd-1f19c4aace30 | 3 | public void realAllSensorEx(){
String output = null;
try {
URL url = new URL("http://localhost:8080/WeatherBase/rest/sensor/sensors");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("Accept", "application/json");
if (conn.getR... |
ce8f3aad-e3d1-4987-9c91-9cf8aff8b289 | 9 | public static void main(String[] args) throws IOException, ParseException {
Options opt = new Options();
opt.addOption("", "db", true, "The File used for Training");
opt.addOption("", "method", true, "The method used for Training");
opt.addOption("", "probabilities", false, "Print Probabilities?");
opt.addOpt... |
39341bfd-e663-40e0-9a64-e5fbac6989f6 | 7 | public static Vector findPackages() {
Vector result;
StringTokenizer tok;
String part;
File file;
JarFile jar;
JarEntry entry;
Enumeration enm;
HashSet set;
result = new Vector();
set = new HashSet();
// check all parts of the classpath, to include additional ... |
22862bcf-9d0f-4ded-aab9-b2c46644fa26 | 2 | public void set_cdx_order( String tag )
{
if(Cdx!=null)
{
Cdx.setOrdByTag(tag);
if(Cdx.I>=0) order = Cdx.TagNames[Cdx.I];
Cdx.recno = recno;
updateseek();
}
} |
798992ad-a6c6-4b71-8223-44039d6bff91 | 0 | public void addValue(Variable x, Integer y) {
valueMap.put(x, y);
} |
d95a4a42-4519-474a-965e-b02678e99629 | 1 | public void fillDeclarables(Collection used) {
for (int j = 0; j < methods.length; j++)
methods[j].fillDeclarables(used);
} |
09e6816f-def0-4409-9841-c28131372c04 | 8 | public static void main(String args[]) throws Throwable {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
for (StringTokenizer st;(st=new StringTokenizer(in.readLine()))!=null;) {
int D=parseInt(st.nextToken()),A=parseInt(st.nextToken()),B=parseInt(st.nextToken()),C=parseInt(st.nextToke... |
440fb8fe-c5c6-4de9-9045-edbe867c6cd2 | 2 | private void fillBuffer() throws IOException{
buffer = buffer.substring(offset);
offset = 0;
while(buffer.length() < bufferSize){
String nextLine = input.readLine();
if(nextLine != null){
buffer = buffer.concat(nextLine).concat(String.format("%n"));
}
else{
break;
}
}
} |
ec1fb77f-bcd9-4c9c-8e3b-f8fd88b880f2 | 6 | @Override
public int onReadFile(String fileName, ByteBuffer buffer, long offset, DokanFileInfo arg3) throws DokanOperationException {
FileHandle handle;
synchronized (handles)
{
handle = handles.get(arg3.handle);
}
if (handle == null)
{
if (DEBUG)
System.out.println("Invalid handle");
thro... |
7ef431ba-25a4-4d77-8cd8-bf8382f67fc3 | 3 | public ResGridlet get(int gridletId, int userId) {
ResGridlet gl = null;
Iterator<ResGridlet> iter = super.iterator();
while (iter.hasNext()){
gl = iter.next();
if (gl.getGridletID()==gridletId && gl.getUserID()==userId) {
return gl;
}
}
... |
c32d35d7-238f-4169-9c66-3d086f635ba4 | 1 | public boolean mouseup(Coord c, int button) {
if (dm) {
ui.grabmouse(null);
dm = false;
return true;
} else {
return super.mouseup(c, button);
}
} |
7ba5a91a-f2fb-484a-ad29-3c11530bcd4d | 5 | public void cargarEmpleadoEnLista(Empleado empleado)
{
DefaultTableModel dtm = new DefaultTableModel(0, 0){
@Override
public boolean isCellEditable(int row, int column) {
if(column==8 || column==0 || column==9){
return false;
}
... |
4104c99b-b1ae-4b35-877c-cd717191e589 | 9 | public List<String> allFriends(String username) {
PreparedStatement stmt = null;
Connection conn = null;
ResultSet rs = null;
int user_id = 0;
List<String> friends = new ArrayList<String>();
try {
conn = DbConnection.getConnection();
stmt = conn.prepareStatement(GET_USERID_STMT);
stmt.setStr... |
dddc6150-35bb-48df-ac9a-f426eeea4b85 | 3 | private void doUpdateUser(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String userId = StringUtil.toString(request.getParameter("userId"));
if(!StringUtil.isEmpty(userId)) {
ObjectMapper mapper = new ObjectMapper();
Map result ... |
3e08ac36-d9b8-47f5-b71d-49cfa3c244bf | 8 | public int getShortestDistance(String word1, String word2, String text)
{
// initialized at the length of the full text, every distance found will be less
int minDinstance = text.length();
if(minDinstance == 0){
// text is empty
return -1;
}
String tempWord = "";
String lastFoundWord = "";
int count... |
f37fbe3d-d0f2-4b8f-a5b9-38bce99d69f0 | 7 | public void handle() {
Player player = World.getPlayer(username);
if (player == null)
return;
player.setClientAddress(address);
player.setClientPort(port);
if (location != null)
player.setLocation(location);
if (health > -1)
player.setHealth(health);
if (toggleAdmin)
player.setAdmin(!player.is... |
d278467c-660f-4097-a876-6b903cf38dee | 9 | private boolean inBounds(Position d){
switch(state){
case INVENTORY:
return(d.x >= 0 && d.x < WIDTH && d.y>=0 && d.y< HEIGHT);
case MAIN_MENU:
return (d.y >= 0 && d.y <1 && d.x == 0);
case PICKUP_MENU:
return(d.y>=0 && d.y<entityManager.getMap().get(mov.getPos()).getItems()... |
b42b210e-5a55-4828-ba70-b0a4552deee6 | 2 | public void test_convertText() {
OffsetDateTimeField field = new MockOffsetDateTimeField();
assertEquals(0, field.convertText("0", null));
assertEquals(29, field.convertText("29", null));
try {
field.convertText("2A", null);
fail();
} catch (IllegalArgumen... |
18a009b6-e719-4451-89ab-15904e0ecc5c | 9 | @Override
protected void parse() {
boolean parseOptions = true;
parsed = new LinkedList<String>(tokens);
String token;
while (!parsed.isEmpty()) {
token = parsed.remove(0);
if (parseOptions && EMPTY.equals(token)) {
parseArgument(token);
... |
b84f5865-200a-4af9-b6ac-a4ecee48d09f | 3 | protected int updateCreeperColorMultiplier(EntityCreeper var1, float var2, float var3) {
float var5 = var1.setCreeperFlashTime(var3);
if((int)(var5 * 10.0F) % 2 == 0) {
return 0;
} else {
int var6 = (int)(var5 * 0.2F * 255.0F);
if(var6 < 0) {
var6 = 0;
}... |
3909fee7-4ae1-42e9-b820-23e4ace41675 | 2 | public boolean equals(Object o) {
if (o instanceof Map.Entry) {
Map.Entry e = (Map.Entry) o;
return key.equals(e.getKey()) && value.equals(e.getValue());
}
return false;
} |
b14fbd7d-5010-4856-bbe3-46a64fc11a8f | 9 | public void migrated(){
this.id = ProcessManager.getInstance().generateID();
Field f[] = this.getClass().getDeclaredFields();
for (int i = 0; i < f.length; i++) {
if(f[i].getType().getSimpleName().equals("TransactionalFileInputStream"))
{
f[i].setAccessible(true);
... |
321d8078-2f99-49c5-be2c-35b9fa961e0a | 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... |
34601d6f-57e3-41a5-b41b-4676eeb5c748 | 9 | private void buildGamePlateau(String dataFilename)
{
HashMap<CouleurPropriete,Groupe> groups = new HashMap<>();
groups.put(CouleurPropriete.bleuCiel,new Groupe(CouleurPropriete.bleuCiel,50));
groups.put(CouleurPropriete.bleuFonce,new Groupe(CouleurPropriete.bleuFonce,200));
... |
1d6b1d8f-f655-4365-be26-07862f77e2f6 | 2 | public VariableStack mapStackToLocal(VariableStack stack) {
if (stack == null)
jode.GlobalOptions.err
.println("map stack to local called with null: " + this
+ " in " + this.flowBlock);
VariableStack middle = subBlocks[0].mapStackToLocal(stack);
if (middle != null)
// Otherwise the second block ... |
7ac0d558-a730-4d60-91fb-21029cdf70ad | 4 | private void afficheChoixClassePersonnage()
{
/**
* On affiche d'abord la liste des classes de personnages
*/
//S'il y a des plugins déjà chargées, on les met dans la liste
if(modelClasse.isEmpty() && fenetre.getPluginClasse().size() != 0)
{
ArraylisteC... |
18ee9942-913b-40c4-97b9-b0cf06848fb8 | 8 | public PrimitiveOperator combineMidNRightOnLeft(PrimitiveOperator other) {
boolean[] newTruthTable = new boolean[8];
// the other gate is on the left side - on the MSB
newTruthTable[0] = truthTable[((other.truthTable[0]) ? 4 : 0) | 0]; //000
newTruthTable[1] = truthTable[((other.truthTable[0]) ? 4 : 0)... |
d9b77a13-5d07-4ae6-bc93-d70f53b6bfe7 | 8 | public int transform(CtClass clazz, int pos, CodeIterator iterator,
ConstPool cp) throws CannotCompileException
{
int index;
int c = iterator.byteAt(pos);
if (c == NEW) {
index = iterator.u16bitAt(pos + 1);
if (cp.getClassInfo(index).equals(cl... |
2b59469e-1f96-4b77-8135-e3d72a1400ba | 2 | public void king()// kings piece.kk+ is
{
k = true;
if (piece == '@')
{
mid = String.format("%1s %1c %1s", "|", '#', "|");
} else if (piece == '$')
{
mid = String.format("%1s %1c %1s", "|", '&', "|");
}
} |
395821da-134d-4f53-aa47-e164c1fd0650 | 8 | public static void testBarrier() throws QueueClosedException {
RemoveOneItem[] removers=new RemoveOneItem[10];
final Queue queue=new Queue();
int num_dead=0;
for(int i=0; i < removers.length; i++) {
removers[i]=new RemoveOneItem(i, queue);
removers[i].start();
... |
d098e72b-7f4b-4a37-b03d-9b4fb0759301 | 4 | public ArrayList<Cliente> Consultar(String id){
//("") - Pesquisa sem precisar de id.
ArrayList<Cliente> clientes = new ArrayList();
try {
if(id.equals("")){
String sql = "SELECT id,nome,email,telefone,cod FROM tb_cliente";
ConsultarSQL(sq... |
98c6903d-42ab-4fa3-b78e-0f1974a9974c | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
AssignmentNode other = (AssignmentNode) obj;
if (value == null) {
if (other.value != null)
return false;
} else if (!value.equals(other.... |
f55efcc8-a9bd-4aa5-b5b7-12ea64fcef8f | 1 | private void checkEmpty() {
if (isEmpty()) {
throw new NoSuchElementException("Priority queue empty");
}
} |
a093f6dc-b325-40a1-854a-1630af1ce2be | 7 | public EnumMap<RatChromosomes, ArrayList<Deletion>> readBreakdancerSVCalls() throws IOException {
// Map<String, ArrayList<Deletion>> chromPiclSVCallsMap = new HashMap<String, ArrayList<Deletion>>();
//initialize map to store list of deletions per ratchromosome
EnumMap<RatChromo... |
98825ae3-4ed0-44e3-b949-b72a05d20dfa | 2 | public StageFlipper init(StageFlipper nothing) {
String firstcall;
LobbyServerMessage LM = null;
try {
firstcall = network.receiveMessage();
LM = enc.lobbyServerMessageDecode(firstcall);
} catch (IOException | JSONException e) {
e.printStackTrace();
}
if (LM != null) {
lg = new LobbyGUI... |
09d403f2-9063-4ad9-9644-323337c709d1 | 8 | public void showUnit(String[] parts){
int current = 1;
//go through the parts accordingly, starting with parts[1] which is unitType
int type = Integer.parseInt(parts[current]);
current++;
//if the unitType hasnt been initialized yet, initialize it, otherwise just create a new unit w... |
5c96af9b-0902-44c8-ac2c-4302b05a0b9e | 6 | @Override
public void run() {
try {
if (this.ss != null) {
this.socket = this.ss.accept();
this.gm.startTimer();
this.update(gm, null);
}
while (this.active) {
try {
InputStream is = socket.getInputStream();
if (is.available() > 0) {
DataInputStream dis = new DataInputStream(... |
02147e59-7f7d-45bd-9bee-b7048c7ce726 | 2 | @Override
public void fire() {
if(receiver != null){
//NAO IMPLEMENTADO
return;
}else if(process){
((RoutingNode) this.node).processBroadcastMsg(m);
}else{
((RoutingNode) this.node).forwardMsg(m);
}
} |
02b97365-c99f-42c3-affc-89ca7d144ae7 | 2 | public void run()
{
while(true)
{
runEnemy();
updateGame();
try{Thread.sleep(1);}catch(Exception ignored){}
repaint();
}
} |
3279242f-d156-4f70-8127-a9730fe37cf3 | 5 | public JSONObject increment(String key) throws JSONException {
Object value = this.opt(key);
if (value == null) {
this.put(key, 1);
} else if (value instanceof Integer) {
this.put(key, ((Integer)value).intValue() + 1);
} else if (value instanceof Long) {
... |
dc006f69-29aa-49a6-a971-2574c46ea663 | 6 | private static Method getMethod(Class<?> clazz, String name) {
name = name.substring(0, 1).toUpperCase() + name.substring(1);
Method method = null;
try {
method = clazz.getMethod("get" + name);
} catch (NoSuchMethodException e) {
// skip
} catch (Exception... |
72a84a3d-8d8e-497e-9719-ce7c4ddda408 | 9 | public List<Integer> allAlbums(String username) {
PreparedStatement stmt = null;
Connection conn = null;
ResultSet rs = null;
List<Integer> albumIds = new ArrayList<Integer>();
try {
conn = DbConnection.getConnection();
stmt = conn.prepareStatement(GET_USERID_STMT);
stmt.setString(1, usernam... |
0b3b2ddd-c4dc-4ff6-ba9a-240ef6c63029 | 6 | public int code(byte[] buf, int off, int len) {
int end = off + len - 4;
int i;
for (i = off; i <= end; i += 4) {
if ((buf[i] == 0x40 && (buf[i + 1] & 0xC0) == 0x00)
|| (buf[i] == 0x7F && (buf[i + 1] & 0xC0) == 0xC0)) {
int src = ((buf[i] & 0xFF) ... |
c8a57d4a-fa9c-4c6a-ae12-cd77479d6048 | 0 | public void doSomething() {
state.greeting(this);
} |
2a371b5a-dc68-4d37-a386-a5eb01698f02 | 4 | @Override
public List<ItemSet<V>> aprioriGen( List<ItemSet<V>> frequentCandidatesKMinus1) {
Collections.sort(frequentCandidatesKMinus1);
int allGeneratedCandidatesCounter = 0;
Set<ItemSet<V>> frequentCandidateSet = new HashSet<ItemSet<V>>();
// we iterate both itemsets and generate new candidates base on th... |
1f7a6f2d-0877-40a6-b47e-c78c007ec9e9 | 5 | JComponent getHouseTab() {
JPanel inner = new JPanel(new GridBagLayout());
GridBagConstraints innerConstraints = new GridBagConstraints();
innerConstraints.fill = GridBagConstraints.BOTH;
innerConstraints.gridx = 0;
innerConstraints.gridy = 0;
innerConstraints.weightx = 1;
innerConstraints.weighty = 1;
... |
5f5daca4-69de-4d69-a5ca-7894c2a411a7 | 0 | public int getRumblerCount() {
return rumblers.length;
} |
ac555643-0b88-4cd4-ad7b-11ffcb6baad2 | 9 | protected void doPadding(byte[] output, int outputOffset)
{
int ptr = flush();
int bitLen = ptr << 3;
int th = t1;
int tl = t0 + bitLen;
tmpBuf[ptr] = (byte)0x80;
if (ptr == 0) {
t0 = (int)0xFFFFFE00;
t1 = (int)0xFFFFFFFF;
} else if (t0 == 0) {
t0 = (int)0xFFFFFE00 + bitLen;
t1 --;
} else {... |
846c772e-1ecf-472c-af9d-f835f98b6593 | 8 | public String search(String name, String criteria)
{
String result = "";
//loop over entire table from start
for(int i = 0 ; i < hashTableSize -1 ; i ++)
{
//if current data is not null, and equals to search add to result and break out of loop
if(hashtable[i]!= null)
{
if(criteria.equals("First Na... |
1fe489c7-04ee-4dc9-8bbe-cc7add46cc84 | 6 | private final void method1989(Node class348, boolean bool,
Deque class262_1_) {
do {
try {
anInt3325++;
Node class348_2_
= (((Node) ((Deque) this).parent)
.nodeChild);
((Node) ((Deque) this).parent).nodeChild
= ((Node) class348).nodeChild;
((Node) ((Node) class348).nodeChild)
... |
811fba89-55f2-45bd-94ac-6de65f0b04ed | 7 | public static int FindPosition (String word) throws FileAlreadyExistsException, IOException{
BufferedReader reader = new BufferedReader( new InputStreamReader( new FileInputStream("input.txt")));
boolean b = false;
int[] mas = new int [10];
int c;
c = reader.read();
int i... |
7f14f1ea-03d9-4dc0-bf10-6af37904290b | 8 | public void nextTaken() throws ParseException {
while (isBlank()) {
nextChar();
}
if (isOperand()) {
operand = 0;
while (isOperand()) {
if (operand > Integer.MAX_VALUE / 10) {
throw new ParseException("Too mach value of ope... |
f150c3d2-ecb5-450f-90d0-ed403b6d5dd3 | 4 | public static void main(String[] args)
{
int index;
String handle, host;
InetAddress address = null;
WhoisClient whois;
if (args.length != 1)
{
System.err.println("usage: fwhois handle[@<server>]");
System.exit(1);
}
index = a... |
618bb41a-19ad-49fc-85d8-c6dbc4b0bdd0 | 4 | public void generate(PropertiesConverter parser, String sourcePath, String targetPath) {
File dir = new File(sourcePath);
File[] files = dir.listFiles();
if (files != null) {
for (File file : files) {
Matcher matcher = propertiesFilesMatcher.getMatcher(file.getName());
while (matcher.find()) {
... |
4f571d4d-c2fa-442a-a0a8-6afa99f17933 | 6 | private ArrayList<String> compileDeclaration(String type, String varname) throws MCCDeclareException {
if (vars.containsKey(varname)) throw new MCCDeclareException();
String varnameL = varname.toLowerCase();
if (varnameL.equals("true") || varnameL.equals("false") || varnameL.equals("if") || varnameL.equals("for")... |
b2ffa472-88c7-4a55-9a2f-c5334a012ca6 | 7 | public static void main(String[] args) {
int portNum;
if (args.length < 1) {
System.out.println("Using default port:9371");
portNum = 9371;
}
else {
System.out.println("Configuring to use port: " + args[0]);
portNum = Integer.parseInt(args[0]);
}
if (args.length < 2) {
System.out.printl... |
5406ba04-d2e6-49e8-90d2-9af8e40b8b89 | 4 | private void loadPlattformar() {
DefaultListModel<Plattform> dlm = (DefaultListModel<Plattform>) listPlattformar.getModel();
ArrayList<String> tempal = new ArrayList<>();
ArrayList<Plattform> al = new ArrayList<>();
try {
String query = "select pid from innefattar where sid... |
9b5218fa-f271-4579-acfc-a72c64bc0cac | 0 | @Test
public void getScoreTest(){
assertEquals(city_graph.getScore(Owner.Rom), 6);
} |
ec3b008c-3532-4ba9-9e96-a36ad9286ebb | 4 | public String validaFormulario() {
String strMsg = "";
if (jrbDocAnalise.isSelected() == false && jrbDocProjeto.isSelected() == false && jrbTestes.isSelected() == false && jrbCodigo.isSelected() == false) {
jrbDocAnalise.setForeground(Color.red);
jrbDocProjeto.setForeground(Color... |
f4fa3df6-efe1-4c4a-b310-aa32d4bb0c3f | 4 | public static void main(String[] args) {
port = 8080;
try {
server = new ServerSocket(port);
System.out.println(server.getLocalPort());
while (true) {
//Jede Verbindung wird angenommen und der String an den GameHandler weitergegeben
connection = server.accept();
System.out.println("N... |
c90b409a-44da-49b9-8663-4af185f0c858 | 8 | public boolean matchesTypeAndContent(final MarkupTraceEvent event) {
if (this == event) {
return true;
}
if (event == null) {
return false;
}
if (this.eventType == null) {
if (event.eventType != null) {
return false;
... |
1bd267e0-039c-4498-b7e9-f310d7a3435c | 5 | public static boolean isValidName(String name) {
if(name == null)
return false;
if(name.length() < 2)
return false;
if(!Character.isUpperCase(name.charAt(0)))
return false;
for(Character ch : name.toCharArray()) {
if(!(Character.isLetter(ch)))
return false;
}
return true;
} |
ac395bf1-1225-49cc-bb1b-fb7262c4d065 | 1 | public void priseTerritoire() {
if (this.occupant != null) {
occupant.perteTerritoire(this);
occupant = null;
}
nbUnite = 0;
} |
807f44dd-2be2-4cd1-951f-597a2a938bfe | 6 | private void GenerateEnemies(){
int ns = RandomEngine.randInt(2,width*height/4);
Enemies = new ArrayList();
int t;
int rand;
Enemy e;
float x,y;
float unitScale = constant.getFloatConstant("unitScale");
for(int i=0;i<ns;++i){
rand = RandomEngin... |
b4dc5ca0-8682-4f81-865d-273757e6aa8e | 4 | public void render(GOut g, Coord c, Coord ul, Coord br, Coord sz) {
GL gl = g.gl;
synchronized (idmon) {
if ((id != -1) && (mygl != gl)) {
dispose(mygl, id);
id = -1;
}
if (id < 0)
create(g);
g.texsel(id);
}
Color amb = blend(g, setenv(gl));
if (!disableall) {
gl.glBegin(GL.GL_QUADS... |
e4275289-d6b7-4ebc-abbf-1c3d897b9d21 | 8 | protected BigInteger coerceToBigInteger(Object value) {
if (value == null || "".equals(value)) {
return BigInteger.valueOf(0l);
}
if (value instanceof BigInteger) {
return (BigInteger)value;
}
if (value instanceof BigDecimal) {
return ((BigDecimal)value).toBigInteger();
}
if (value instanceof Num... |
363a15b9-8cf1-4791-a4b4-ee984802f010 | 7 | public synchronized List<KeyRegistrationRecord> getNearestPeers( final String inBase64Key, final int inNumber, boolean updateRefreshTime ) {
if( isRegistered(inBase64Key) == false ) {
return null;
}
if( updateRefreshTime ) {
updateRefreshTime(inBase64Key);
}
Set<KeyRegistrationRecord> out = new... |
b3eca753-6787-4ee0-bad1-cd0f106abc52 | 5 | public static <GItem> Comparable<GItem> chainedComparable(final Comparable<? super GItem> comparable1, final Comparable<? super GItem> comparable2)
throws NullPointerException {
if (comparable1 == null) throw new NullPointerException("comparable1 = null");
if (comparable2 == null) throw new NullPointerException("... |
d297f73c-3d06-4ecb-b6bd-e9088a2b6e47 | 7 | public Bank getMainBank() {
if (!Constants.Banking) {
return null;
}
Connection conn = null;
ResultSet rs = null;
PreparedStatement ps = null;
Bank bank = null;
try
{
conn = iConomy.getiCoDatabase().getConnection();
ps = conn.prepareStatement("SELECT * FROM " + Constan... |
47c0992d-e14f-426c-b752-8c64af0176fc | 8 | public IndexedModel toIndexedModel()
{
IndexedModel result = new IndexedModel();
IndexedModel normalModel = new IndexedModel();
HashMap<OBJIndex, Integer> resultIndexMap = new HashMap<OBJIndex, Integer>();
HashMap<Integer, Integer> normalIndexMap = new HashMap<Integer, Integer>();
HashMap<Integer, Integer> i... |
0a55cee7-e091-444d-a7d3-5247fda79850 | 5 | final public void train(StringWrapperIterator i)
{
Set seenTokens = new HashSet();
while (i.hasNext()) {
StringWrapper s = (StringWrapper)i.next();
BagOfTokens bag = asBagOfTokens(i.nextStringWrapper());
for (Iterator j=bag.tokenIterator(); j.hasNext(); ) {
Token tokj = (Token)j.next();
totalToke... |
14a34512-7286-484f-b317-c527551cc6e0 | 8 | public int moore(int i, int j, int r ) {
int sum = 0;
int imax = this.length;
int jmax = this.width;
for (int n = 0; n <= 2*r; n++){
for (int m = 0; m <= 2*r; m++){
int ii = topo.idI(i - r + n, j - r + m, imax, jmax);
int jj = topo.idJ(i, j - r + m, imax, jmax);
if ( (!(ii < 0) && !(ii >= imax)) ... |
73871350-5692-4774-979f-2ac6007845d1 | 7 | public boolean checkStop(MOB mob, List<String> commands)
{
if((commands!=null)
&&(commands.size()==1)
&&(commands.get(0).equalsIgnoreCase("stop")))
{
final Ability A=mob.fetchEffect(ID());
if((A!=null)&&(!A.isNowAnAutoEffect())&&(A.canBeUninvoked()))
{
if(A instanceof CommonSkill)
((CommonSki... |
e9b22cb9-5ed8-4fa4-9268-0445bb0e5899 | 1 | public void testFormatParse_textYear_UK() {
DateTimeFormatter dateFormatter = new DateTimeFormatterBuilder()
.appendLiteral('$')
.appendText(DateTimeFieldType.year())
.toFormatter()
.withLocale(Locale.UK).withZoneUTC();
String str = new DateTime(2... |
72c91e4e-3ad0-4e0b-9574-72370fd614bb | 8 | private boolean jj_3R_70() {
Token xsp;
xsp = jj_scanpos;
if (jj_3R_104()) jj_scanpos = xsp;
xsp = jj_scanpos;
if (jj_3R_105()) {
jj_scanpos = xsp;
if (jj_3R_106()) return true;
}
xsp = jj_scanpos;
if (jj_3R_107()) jj_scanpos = xsp;
if (jj_scan_token(91)) return true;
xsp... |
a141a0e2-5d27-4adf-9525-e01c0ae31f9d | 7 | private void jList2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jList2MouseClicked
jList2 = (JList) evt.getSource();
if (evt.getClickCount() == 2) {
int index = jList2.locationToIndex(evt.getPoint());
if (index >= 0) {
String s = (String) jList2.getModel().g... |
b2f23f69-3e8d-472b-8ab8-d90f08bb490b | 4 | public static void addToTeam(Teams team, Player player) {
switch (team) {
case GREEN:
greenMembers = (player);
greenFriends.add(player);
break;
case BLUE:
blueMembers = (player);
blueFriends.add(player);
break;
case RED:
redMembers = (player);
redFriends.add(player);
break;
case ORA... |
c0f25bd0-87dd-49f8-b5a0-6bba50915329 | 3 | public boolean registerOriginalFile(FileAttribute fAttr, int sourceID)
{
if (fAttr == null || sourceID == -1) {
return false;
}
ArrayList list = (ArrayList) catalogueHash_.get( fAttr.getName() );
if (list != null) {
list.add( new Integer(sourceID) );
... |
7a35e2d0-24fc-420f-ae6f-847015d5a742 | 0 | public int getS1() {
return this.state1;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.