method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
5923ebd3-fbc4-46bf-acca-ddd5a4e2c1ed | 6 | public void sendData(ObjectOutputStream[] streams, double time){
for(int i=0;i<streams.length;i++){
if(streams[i] == null) continue;
try {
streams[i].writeDouble(time);
streams[i].writeInt(GameState.period);
streams[i].writeInt(GameState.state);
streams[i].writeObject(playerArray);
//write ... |
ddb68d25-02a4-4839-b52a-09a73de748e2 | 9 | @Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final MOB target=this.getTarget(mob,commands,givenTarget);
if(target==null)
return false;
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
final boolean success=pro... |
ba409f45-fd45-4c25-8dfd-8f78c6d05a67 | 3 | public void CraftRunesRift(String runeName, int lvlReq, int XPamount, int rune, int runeAmount, int delay, int emote) {
if(RCTimer == 0) {
if(playerLevel[20] >= lvlReq) {
setAnimation(emote);
sendMessage("You craft "+runeAmount+" "+runeName+" runes.");
addSkillXP(XPamount, 20);
addItem(rune, runeAmount);
... |
18c8c6b2-b28d-41fa-bc54-0a60c7391f8b | 8 | private void convertInstanceNumeric(Instance instance) {
double [] vals = new double [outputFormatPeek().numAttributes()];
int attSoFar = 0;
for(int j = 0; j < getInputFormat().numAttributes(); j++) {
Attribute att = getInputFormat().attribute(j);
if ((!att.isNominal()) || (j == getInputFormat... |
13727aab-b99c-4984-bd2d-7a15be0980e5 | 1 | private VideoListVO addActionMessageToVO(VideoListVO videoListVO, Locale locale, String actionMessageKey, Object[] args){
if(StringUtils.isEmpty(actionMessageKey)){
return videoListVO;
}
videoListVO.setActionMessage(messageSource.getMessage(actionMessageKey, args, null, locale));
return videoListVO;
... |
d8094b82-c1c6-4870-a6cb-8a7456eda870 | 9 | public int yOf(int x) throws IllegalArgumentException {
//trivial rejections
if (x < this.lefterVertex().centerX()
|| x > this.righterVertex().centerX()) {
throw new IllegalArgumentException("x out of range: "
+ x);
}
if (this.isVertical())... |
acfa7d94-582e-40d6-bb9c-fccbc8211873 | 3 | public void send ()
{
int nbytes = 0;
ByteBuffer dummy = ByteBuffer.allocate(1);
dummy.limit(1);
while (true) {
try {
nbytes = w.write(dummy);
} catch (IOException e) {
throw new ZError.IOException(e);
}
... |
03e49004-9b21-4a11-a01f-699feff81fb9 | 4 | public String getHighlightMode() {
Object possibleName = getObject(HIGHLIGHT_MODE_KEY);
if (possibleName instanceof Name) {
Name name = (Name) possibleName;
if (name.getName().equalsIgnoreCase(HIGHLIGHT_NONE)) {
return HIGHLIGHT_NONE;
} else if (name.g... |
c0a902f4-ef6e-47b6-89f1-469922d80624 | 0 | public void assign(String parameter, String expression) {
parametersToNumbers.put(parameter, valueOf(expression));
} |
f0e8f992-0d3b-4671-b730-21059151aea6 | 0 | public static Algorithm getAlgorithm() {
return algorithm;
} |
58b41f1a-07a0-4b4f-af10-8ef235bf3699 | 1 | public void testPlus_int() {
Days test2 = Days.days(2);
Days result = test2.plus(3);
assertEquals(2, test2.getDays());
assertEquals(5, result.getDays());
assertEquals(1, Days.ONE.plus(0).getDays());
try {
Days.MAX_VALUE.plus(1);
f... |
8f5e8ebb-9b9c-4e90-b4e8-d7da49d1d27e | 7 | public void getReporter() {
networkController.SendMessage("getPromotion#" + clientId + "," + clientType + "," + userBugReporter + "," + userName);
clientType = userBugReporter;
reporter = true;
cleanLabels();
if(observer)
getObserver.setVisible(true);
if(contributor)
getContributor.setVisible(tru... |
e3472029-0aba-4baf-9e7f-363bf4259b63 | 7 | public void checkSideCollision(Rectangle rleft, Rectangle rright,
Rectangle leftfoot, Rectangle rightfoot) {
if (type != 5 && type != 2 && type !=0){
if (rleft.intersects(r)) {
robot.setCenterX(tileX + 102);
robot.setSpeedX(0);
} else if (leftfoot.intersects(r)){
robot.setCenterX(tileX+85);
r... |
1e06323e-5898-49d0-b071-57efaf024454 | 1 | public void afficherCompteRendu(RapportVisite leRapportViste){
this.vue.getjTextFieldNumRapport().setText(leRapportViste.getNumero_rap()+"");
this.vue.getjComboBoxPraticien().setSelectedItem(leRapportViste.getNumero().getNom()+" "+leRapportViste.getNumero().getPrenom());
// on crée l'ob... |
5ecbf509-6c96-493f-8e32-68f5cef1501d | 1 | public void writeTODB(String CallingPeerAddress, String CalledPeerAddress,
String SetupTime, String STMS, String ConnectTime, String CTMS,
String DisconnectTime, String DTMS, boolean IsMissed, int TypeAppel) throws Exception {
try {
// this will load the MySQL driver, each DB... |
02fd1387-35dd-4710-8b41-5813ae3135b1 | 8 | private static int add() {
int index; // contient l'index d'un élève
int matricule; // contient la matricule du nouvelle élève
String input; // contient la valeur renvoyé par la fonction getNumber()
// trouver de la place libre dans le tableau
index = getStudent(999, false)... |
823f1227-2d06-4a88-8637-f59538c768fa | 8 | @Override
public boolean isAnsweredCorrectly() {
if(answer1RadioButton.isSelected() && choices[0].getIsCorrect())
return true;
if(answer2RadioButton.isSelected() && choices[1].getIsCorrect())
return true;
if(answer3RadioButton.isSelected() && choices... |
5140a13f-398c-4252-b48b-6ef5bc5d47b9 | 0 | @Override
public IAttemptClientConnect getAttemptClientConnect() {
return this.attemptClientConnect;
} |
471297ac-6d39-44db-897a-1f6d3ff55289 | 8 | private JPanel setupSourceImageControlsPanel() {
JPanel panel = new JPanel();
panel.setLayout(new FlowLayout(FlowLayout.LEFT));
panel.setBorder(new TitledBorder("Source Image Layout"));
JPanel scalePanel = new JPanel();
scalePanel.setLayout(new GridLayout(2, 2));
scalePanel.setBorder(new TitledBorder("Scal... |
924320e6-fa81-40ea-b29a-2227efdb1bc9 | 1 | public static ConnectionManager getInstance() {
if (instance == null) {
instance = new ConnectionManager();
}
return instance;
} |
306c0b5f-b1c2-4521-8942-73fdb547dd81 | 8 | @Override
public void draw(Graphics g) {
Color tileTypeColor = Color.black;
for (int i = 0; i < tile.length; i++) {
for (int j = 0; j < tile[i].length; j++) {
if (tile[i][j] != null) {
switch (tile[i][j]) {
case CLOISTER:
tileTypeColor = red;
break;
case CITY:
tileTypeC... |
22410648-3ace-4900-83a1-a86c725ba2ca | 2 | public void testFactory_Zone_long_int() {
GJChronology chrono = GJChronology.getInstance(TOKYO, 0L, 2);
assertEquals(TOKYO, chrono.getZone());
assertEquals(new Instant(0L), chrono.getGregorianCutover());
assertEquals(2, chrono.getMinimumDaysInFirstWeek());
assertSame(GJChronology... |
c0a31316-57dd-4f4f-97bf-9cd470f86bd6 | 0 | public UserControlParseAction(GrammarEnvironment environment) {
super("User Control Parse", null);
this.environment = environment;
this.frame = Universe.frameForEnvironment(environment);
} |
095e4639-3028-4ea3-aee3-574e1e830b95 | 2 | protected void mark(int originPosition,int positionToMark,Cell[] cellBoard)
throws IllegalMark{
if (cellBoard[positionToMark] == Cell.DEFAULT_EMPTY_CELL){
cellBoard[positionToMark] = Cell.DEFAULT_TAKEN_CELL;
}
else{
if(cellBoard[positionToMark] == Cell.DEFAULT... |
65be0e0e-a0b1-414f-bc4a-19540e8369bf | 8 | public void process()
{
Parser.Events event = Parser.Events.ev_TAG;
try {
outXmlFd.write("<mediawiki>");
} catch (IOException e) {
e.printStackTrace();
}
while (Parser.Events.ev_NONE != event)
{
event = this.p.parse();
... |
50c5f125-8241-4e7f-99cf-bbffdb060882 | 2 | public static void main(String[] args) {
Queue<Integer> queue = new LinkedList<Integer>();
Random rand = new Random(47);
for (int i = 0; i < 10; i++)
queue.offer(rand.nextInt(i + 10));
printQ(queue);
Queue<Character> qc = new LinkedList<Character>();
for (char c : "Brontosaurus".toCharArray())
qc.offe... |
f54354da-9dd0-4362-85ab-61398624603e | 1 | public DockHeader(DockContainer dc) {
super.setLayout(this);
setOpaque(true);
setBackground(DockColors.BACKGROUND);
setBorder(new CompoundBorder(new SelectiveLineBorder(DockColors.SHADOW, 0, 0, 1, 0), new EmptyBorder(0, 4, 0, 4)));
for (Dockable dockable : dc.getDockables()) {
add(new DockTab(dockable));
... |
4fbe60e6-bfd8-4c13-a2a0-cab1261758e2 | 2 | public void testPropertyCompareToDayOfWeek() {
DateTime test1 = new DateTime(TEST_TIME1);
DateTime test2 = new DateTime(TEST_TIME2);
assertEquals(true, test2.dayOfWeek().compareTo(test1) < 0);
assertEquals(true, test1.dayOfWeek().compareTo(test2) > 0);
assertEquals(true, test1.da... |
64f7d3d1-eb1d-4aea-9689-83c5aaf3a54d | 2 | public void newfocusable(Widget w) {
if (focusctl) {
if (focused == null)
setfocus(w);
} else {
parent.newfocusable(w);
}
} |
c2353ef0-10b8-4a4c-b17c-ad917f855ae8 | 8 | public ArrayList<ArrayList<Integer>> fourSum(int[] num, int target) {
ArrayList<ArrayList<Integer>> results = new ArrayList<ArrayList<Integer>>();
Arrays.sort(num);
for(int i=0; i<num.length-3; i++)
{
int a = num[i];
for (int j=i+1; j<num.length-2; j++)
... |
0f2f4bba-4f95-4068-a401-af4293dbe7c7 | 5 | public void print(){
System.out.println("GAMEBOARD ::: ");
for (int i = 0; i < 8; i++){
for(int j = 0; j < 8; j++){
if(gameBoard[i][j] == PieceType.WHITE){
System.out.print("("+i+","+j+")"+"W ");
}else if(gameBoard[i][j] == PieceType.BLACK){
System.out.print("("+i+","+j+")"+"B ");... |
28a8f9e7-686b-4a70-912f-152a6e9b9f98 | 6 | private ServerSideJob pickJob(final Communicator comm) {
ServerSideJob result = null;
// traverse job, check complexity and cancel time
List<JobAction> actionList;
Calendar cal;
synchronized (jobQueue) {
for (ServerSideJob job : jobQueue) {
final int ... |
b15a174c-e9f1-4377-a156-01ab8c31ced4 | 4 | public void handle(final IRCChannel c, final Player player,
final String message) {
if (c.getChatType() == ChatType.TOWNYCHAT) {
if (Bukkit.getServer().getPluginManager().getPlugin("mcMMO") != null) {
if (Users.getProfile(player.getName()).getAdminChatMode()) {
... |
67753259-4d44-4f49-a8a4-79d201ac0879 | 7 | public List<Runway> getRecentRunway()
{
try{
List<Runway> runways = DatabaseDataObjectUtilities.getRunways();
List<Runway> recentRunwayList = new ArrayList<Runway>();
if(instance == null)
{
return null;
}
else
... |
fb4bb37a-4e56-4796-ace5-8776fd63d795 | 4 | public void execute(String message) throws Exception {
while (true) {
try {
this.currency = CurrencySet.getInstance().search(readCurrency(reader, message));
break;
} catch (CurrencySet.CurrencyNotFoundException ex) {
System.out.println(ex.g... |
1e3f7d79-77d3-4c3d-8cd7-e416123ac97f | 5 | public void runSimulation() throws VehicleException, SimulationException,
IOException {
this.log.initialEntry(this.carPark, this.sim);
for (int time = 0; time <= Constants.CLOSING_TIME; time++) {
// queue elements exceed max waiting time
if (!this.carPark.queueEmpty()) {
this.carPark.archiveQueueFailur... |
2eb34331-5de9-48f3-848a-af4bb34f3d58 | 6 | public Object getInstance(Class<?> clazz) {
try {
Constructor<?> ctr = clazz.getConstructor(argClasses);
ctr.setAccessible(true);
return ctr.newInstance(args);
} catch (NoSuchMethodException e) {
logger.severe("Error initializing commands class " + clazz + ": ");
e.printSta... |
9f820e9f-fddd-49ef-a17f-e769c58945d0 | 6 | @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (!(npc instanceof L2Attackable))
return null;
if (event.equalsIgnoreCase("skill"))
{
int playableCounter = 0;
for (L2Playable playable : npc.getKnownList().getKnownTypeInRadius(L2Playable.class, npc.getAggroRange()... |
8239ba05-bc67-41a7-94f1-2585926e87b5 | 2 | public static void teleportPlayerToLocation( BSPlayer p, Location t ) {
ByteArrayOutputStream b = new ByteArrayOutputStream();
DataOutputStream out = new DataOutputStream( b );
try {
out.writeUTF( "TeleportToLocation" );
out.writeUTF( p.getName() );
out.write... |
fb3c4d61-3c25-4b5e-936f-b51cf8b04f05 | 6 | public static void calculateDistanceToBorder(BotState state) {
Map visibleMap = state.getVisibleMap();
for (Region region : visibleMap.getRegions()) {
if (region.getPlayerName().equals(state.getMyPlayerName())) {
// 1000 as initialization
region.setDistanceToBorder(1000);
} else {
region.setDistan... |
7c87fa11-fdac-408f-8122-d7fd9afc1c5d | 1 | @Test
public void shouldSortElement() throws Exception {
Integer[] array = new Integer[]{81, 94, 11, 96, 12, 35, 17, 95, 28, 58, 41, 75, 15};
sort.sort(array);
for(int i:array){
System.out.println(i);
}
} |
7bef8a53-4149-463a-93f0-dc8b49da1156 | 0 | public void setBounds(int x, int y, int w, int h)
{
this.x = x;
this.y = y;
this.w = w;
this.h = h;
} |
c9eb5825-c7d1-492d-9ad2-86c40149c73a | 0 | public void setChargeTermid(String chargeTermid) {
ChargeTermid = chargeTermid;
} |
9450884f-6c92-488e-8d96-855f5145f720 | 8 | public static void dealWithAmPm(Stella_Object formValue, DecodedDateTime parsedValues) {
{ int hour = parsedValues.dateTimeHour;
if (formValue == Stella.SYM_STELLA_AM) {
if (hour == 12) {
parsedValues.dateTimeHour = 0;
}
else if (!((0 <= hour) &&
(hour <= 12))) {... |
01f80ae4-5829-4e52-85de-192f7ff33049 | 0 | public Genre getGenre() {
return genre;
} |
8c2d46c6-2e4b-449f-88a3-9ce4a56db11f | 4 | public Player findPlayer() {
for (Cell[] c : grid) {
for (Cell cell : c) {
if (cell.contains(Player.class)) {
try {
return (Player)cell.getOccupant();
} catch (Exception e) {
System.err.println("Player not found.");
}
}
}
}
return null;
} |
dd5b7926-9bbd-42c7-8378-952ec489e1ad | 8 | public static ModInstance convertString(String line)
{
String[] modString = line.split(";");
fileType type = fileType.General;
downloadType dType = downloadType.URL;
try
{
int var2 = Integer.parseInt(modString[1]);
type = fileType.values()[var2];
... |
b7776c36-7bf4-4e33-bd83-14571759a84e | 9 | public int checkCOS()
{
if(cornerMap.get("C").equals("C")
&& cornerMap.get("O").equals("O")
&& cornerMap.get("S").equals("S"))
{
return SOLVED;
}
if(cornerMap.get("C").equals("O")
&& cornerMap.get("O").equals("S")
&& cornerMap.get("S").equals("C"))
{
return CW;
}
if(cornerMap.get("C... |
83a91aea-38f9-43cc-a280-f888c1f04d4c | 4 | public boolean accept(File file) {
if (file.isDirectory()) {
return true;
}
int count = extensions.length;
String path = file.getAbsolutePath();
for (int i = 0; i < count; i++) {
String ext = extensions[i];
if (path.endsWith(ext)
&& (path.charAt(path.len... |
be204523-7a1a-4820-bfad-604f2f8a4f3b | 8 | static final boolean method1089(int i, char c) {
anInt1807++;
if (i >= -107)
aBooleanArray1806 = null;
if ((c ^ 0xffffffff) < -1 && c < 128
|| (c ^ 0xffffffff) <= -161 && (c ^ 0xffffffff) >= -256)
return true;
if ((c ^ 0xffffffff) != -1) {
char[] cs = Class44.aCharArray625;
for (int i_11_ =... |
6188885e-0219-4e58-b8d9-c5a1ba0e2672 | 1 | public void testIsConditionalSentence() {
System.out.println("\n*** testIsConditionalSentence ***");
try {
CycFormulaSentence sentence = getCyc().makeCycSentence("(#$likesAsFriend ?X ?Y)");
boolean conditional = sentence.isConditionalSentence();
assertEquals(conditional, false);
sentence... |
6905f89c-9b10-433f-9ad7-f78b30aff399 | 6 | public void run() {
try {
ObjectOutputStream out = new ObjectOutputStream(server.getOutputStream());
ObjectInputStream in = new ObjectInputStream(server.getInputStream());
// --Mutil User but can't parallel
String [] arr= (String[]) in.readObject();
System.out.println(arr[0]+arr[1]);
switch (arr[0])... |
9adaae9b-6df2-4edc-b91f-24980c0c96dc | 2 | private void fileIOOrError(File file, boolean result, boolean create) {
if (!result) {
plugin.getLogger().severe("The updater could not " + (create ? "create" : "delete") + " file at: " + file.getAbsolutePath());
}
} |
47a2b998-ba54-4dcb-b8b8-2c7d52ad1734 | 4 | private boolean save() {
if (dic == null) {
return false;
}
File f;
if (defaultFile == null) {
CostumFileChooser chooser = new CostumFileChooser();
FileNameExtensionFilter filter = new FileNameExtensionFilter(Localization.getInstance().get("dictionaryFiletypeFilterName"), "dict");
chooser.setFileFil... |
ee34a6a7-aa6d-45be-a8e6-f36f25a165b1 | 5 | public synchronized boolean updateCheck ()
{
Scanner s = null;
try
{
s = new Scanner(versionUrl.openStream());
remoteVersion = s.nextLine();
if (this.compareVersions())
{
upToDate.set(false);
s.close();
... |
5b3d1311-7f3f-4353-9699-c59cb5902b2a | 8 | public void map(LongWritable lineid, Text nodetxt,
OutputCollector<Text, Text> output, Reporter reporter)
throws IOException
{
Node node = new Node();
node.fromNodeMsg(nodetxt.toString());
output.collect(new Text(node.getNodeId()), new Text(node.toNodeMsg()));
reporter.incrCounter("Brush", "nodes",... |
0735249d-bd11-4aa9-901d-ede9faf563ad | 5 | public void okButtonActionPerformed(java.awt.event.ActionEvent e)
{
try
{
if(rotateRadio.isSelected())
{
float degrees = Float.parseFloat(rotateTextField.getText());
if(radianRadio.isSelected())
{
... |
12f187f6-6f89-473b-a92c-97d193ac19b7 | 8 | public boolean equals(Object o) {
SignatureKey target = (SignatureKey) o;
if (types == null)
return target.types == null;
if (clas != target.clas)
return false;
if (!methodName.equals(target.methodName))
return false;
if (types.length != target.types.length)
return false;
for (int i = ... |
3107d958-39c7-4a16-acde-fdf5923b0099 | 0 | public void setPort(int port){ this.Port = port; } |
8bdf41ff-2de8-478f-9c93-2d48ffcc560c | 7 | public int canCompleteCircuit(int[] gas, int[] cost) {
if(gas.length==1) return gas[0]>=cost[0]?0:-1;
this.gas = gas;
this.cost = cost;
N = gas.length;
int i = 0;
int c= 0;
while(c<N)
{
remain = 0;
first = true;
int temp = T(i,i);
if(!first && temp==i) return i;
if(temp<i) ... |
bf5a7c33-91df-469b-b4e0-d1eb313ab254 | 6 | public static void useLands(Deck d, double r){
if(!d.repeated){
System.out.println("Uselands does not support decks without repetition");
return;
}
int cards = 0;
int lands = 0;
int uniqueBasics = 0;
for(int i=0; i<d.cards.size(); i++){
cards += d.quantity.get(i);
String s = d.cards.get(i);
... |
3facc289-d9c1-441c-9a22-14df70e84f06 | 2 | @SuppressWarnings("unchecked")
public static float[][] restore2D(String findFromFile) {
float[][] dataSet = null;
try {
FileInputStream filein = new FileInputStream(findFromFile);
ObjectInputStream objin = new ObjectInputStream(filein);
try {
dataSet = ( float[][]) objin.readObject();
} catch... |
1506a379-3ef8-4981-a4e0-a7d70474d987 | 6 | private void fetchCluster(Direction direction) {
BoundingBox boundingBox;
if (direction == Direction.CENTER) {
// only called once at initialization!
if (initialized) {
throw new RuntimeException("fetchCluster for " + direction
+ " called twice. this should never happen!");
}
initialized = tru... |
9a7e1968-d493-40b7-bc82-073a37dbd313 | 9 | @ManagedOperation
public V get(K key) {
if(l1_cache != null) {
V val=l1_cache.get(key);
if(val != null) {
if(log.isTraceEnabled())
log.trace("returned value " + val + " for " + key + " from L1 cache");
return val;
}
... |
ecc3e4da-a358-4792-bb14-85c5b65e4c0f | 7 | public static String Hirschberg(int m, int n, String A, String B) {
String result = "";
if (n == 0 || m == 0)
return result;
if (m == 1) {
char zero_index = A.charAt(0);
for (int i = 0; i < n; i++) {
if (zero_index == B.charAt(i)) {
result = String.valueOf(zero_index);
break;
}
}
... |
a936d39b-0dc7-4189-98b5-ea7ffb7a2f6e | 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... |
19d0b566-a5ff-4868-97be-d14859707b71 | 7 | public MusicFileLoader() {
File home = new File(START_DIR);
for (File dir : home.listFiles()) {
if (dir.isDirectory()) {
if (!categories.contains(dir.getName()))
categories.add(dir.getName());
for (File music : dir.listFiles()) {
if (music.isFile()
&& music_type.contains(new MimetypesFil... |
2f49bc3b-67de-403a-ba7a-9131f5f022ba | 9 | public int getmin(String[] colormap){
int n = colormap.length;
int[][] d = new int[n][n];
for(int i=0; i<n; i++){
int count=0;
for(int j=0; j<n; j++){
if(colormap[i].charAt(j) == 'Y'){
d[i][j]=count;
count++;
... |
090c602d-1dff-41f3-8011-074ce3ebb9fd | 6 | AbstractNode statement() {
AbstractNode node = null;
if (test(IF)) {
node = ifStatement();
} else if (test(PRINT)) {
read(PRINT, "PRINT");
node = new PrintNode(expr());
} else if (test(WHILE)) {
node = whileStatement();
} else if (test(REPEAT)) {
node = repeatStatement();
} else if (test(IDE... |
dbacf0d0-708e-45fc-a5b1-f8a2e30db701 | 3 | public String onPump(BufferedReader rdr, Server server) throws IOException {
String url = "";
String line = "";
try {
while (line != null) {
line = rdr.readLine();
if (line != null)
url = line;
}
} catch (Exception e) {
e.printStackTrace();
} finally {
rdr.close();
}
return url;
... |
d2b464a6-5418-4dad-9f3c-a7c125a04f79 | 1 | @Override
public Color getForeground() {
if (foregroundColor == null) {
return super.getForeground();
}
return foregroundColor;
} |
ccb771d1-e37c-40ce-84ab-5400d2f5b228 | 3 | public LauncherDestroyer findDestroyerById(int destroyerId) {
LauncherDestroyer user_destroyer = null;
for (LauncherDestroyer launcher_destroyer : getWarLauncherDestroyer()) {
if (launcher_destroyer.getLauncherId() == destroyerId) {
user_destroyer = launcher_destroyer;
break;
}
}
if (user_destroye... |
fae0dde0-2b3b-44d2-b07e-efb6833d7bd5 | 0 | public Boolean getIsSelected() {
return isSelected;
} |
98ad0297-6658-4b7a-8568-871f3441a0dd | 2 | public static void loadPlayer(Registry registry) {
Player p = (Player) getPlayers().get(player);
if (p != null) {
p.setTransient(registry);
}
GameController gc = registry.getGameController();
registry.getPlayerManager().clearPlayers();
registry.getPlayerManag... |
05ffd40d-07da-44f2-87c2-ec8e5543562a | 5 | @Override
public void actionOffered() {
while(Actions.hasActions()) {
Action a = Actions.take();
String aMsg = "[" + a.getType().toString() + " => t :: 0x" + Long.toHexString(a.getTime()) + " => aId :: 0x" + Integer.toHexString(a.getId()) + "]" +
" " + a.getMessage();
if(a.getType() == Actions.ActionTy... |
48e2aed2-fa60-444d-a0ef-2cb795f6bcc2 | 3 | public static boolean deleteSpawnPoint(String name) {
if (FearTheReaper.SpawnPointList.containsKey(name)) {
Spawn point = FearTheReaper.SpawnPointList.remove(name);
if (FearTheReaper.markers != null) {
ReaperMarkers.deleteMarker(point);
}
File poin... |
e9c7d519-e524-421c-ad48-7c1150589467 | 4 | public void checkObject () {
Object object = (Object)getOneIntersectingObject(Object.class);
if( object != null ) {
if ( object instanceof CharPlayer ) {
CharBot.setSlowSpeed(4);
destroy();
}
else if ( object instanceof CharBot ) {
... |
b7769770-8f9c-49fa-879a-114af19574c2 | 8 | @Override
public boolean execute(final CommandSender sender, final String[] split) {
if (sender instanceof Player) {
if (MonsterIRC.getHandleManager().getPermissionsHandler() != null) {
if (!MonsterIRC.getHandleManager().getPermissionsHandler()
.hasCommand... |
319bd18c-8379-42aa-9c9a-35e0bb2fba27 | 2 | public URI rewrite(URI uri) throws URISyntaxException {
if (editor.matches(uri)) {
try {
return new URI(editor.populate(uri));
}
catch (IllegalArgumentException e)
{
throw new URISyntaxException( uri.toString(), e.getMessage() );
}
}
return uri;
} |
4c80298b-0600-4855-9566-a0391f5f5d1b | 7 | public void handle(Callback[] callbacks)
throws IOException, UnsupportedCallbackException {
for (int i = 0; i < callbacks.length; i++) {
if (callbacks[i] instanceof TextOutputCallback) {
// display the message according to the specified type
TextOutputCallback toc = (TextOutputCallback)callb... |
e04226a3-e41d-42a6-8cc5-e04475850896 | 1 | @Override
public final Configuration readConfiguration() throws ReaderException {
try {
Configuration config = new Configuration();
File configFile = new File(this.filePath);
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder;
dBuilder = dbFactory.newDocu... |
680f0884-0d6e-455e-97ab-de22e5704381 | 7 | public GeneralPath getGrid(int states) {
int[] bars = new int[2];
for (int count = states; count < 51; count++) {
if (layout[count][0] > 0) {
bars = layout[count];
break;
}
}
int maxCols = Math.max(bars[0], bars[1]);
int rows = 2;
int sum = bars[0] + bars[1];
while (su... |
be4d7f83-f9eb-40cc-b37a-7315d4621494 | 5 | @Override
public void keyReleased(KeyEvent arg0) {
int keyCode = arg0.getKeyCode();
if(keyCode == 65 || keyCode == 68 || keyCode == 83 || keyCode == 87){
if(getPressedMovementKeys().contains(keyCode) == true){
this.pressedMovementKeys.remove((Integer)keyCode);
}
}
eventsProccessed++;
} |
1bc1f5a8-be6f-4a23-b86f-56475d3b62d7 | 7 | public EditInfo getEditInfo(int n) {
if (n == 0) {
return new EditInfo("Inductance (H)", inductance, 0, 0);
}
if (n == 1) {
return new EditInfo("On Resistance (ohms)", r_on, 0, 0);
}
if (n == 2) {
return new EditInfo("Off Resistance (ohms)", r_... |
96f49b5e-31ea-4bfc-971e-b52441c0cc9f | 0 | public NodeDrawer getNodeDrawer() {
return nodeDrawer;
} |
00bdc16d-6a4e-41c9-ba4d-b4571654cb06 | 3 | @Test
public void testRemoveCard(){
Pile pile = new Pile();
Card card = new Card(Card.CARD_SUIT.SPADES, Card.FACE_VALUE.KING);
pile.addCard(card);
assertEquals("Asserting the card was removed", card, pile.removeCard(0));
Pile pile2 = new Pile();
Card card2 = new Card(Card.CARD_SUIT.DIAMONDS, Card.FACE_V... |
eb0f7661-6029-4f56-a875-9df471744712 | 2 | public void moveTowards(Cockroach target) {
m += Math.round(Math.signum(target.m - m) * random.nextFloat() * swarmStepSize);
if (m < 1) {
m = 1;
} else if (m > N) {
m = N;
}
} |
a7d67f09-6181-4c7b-9cee-8961d4cbe2cb | 5 | @Override
public void mouseDragged(MouseEvent e) {
System.out.println("Mouse dragged");
int currX = e.getX();
int currY = e.getY();
System.out.println("Start X: " + startX + "CurrX: " + e.getX());
System.out.println("startX - currX = " + (startX-e... |
83e3abbf-3b35-4148-bb7d-44c1e707f72b | 1 | public void dropInfo(int howMuch) {
if ((howMuch & KNOWNATTRIBS) != 0) {
lvt = null;
lnt = null;
}
super.dropInfo(howMuch);
} |
c9af2ba2-abb0-434e-93fc-e9ad20d622bb | 7 | public static void main(String[] args) throws Exception
{
Client client = new Client("146.232.50.251", 3003 );
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
SendHandler sf = new SendHandler(client);
Message msg = new Message();
while (true) {
String userName = br.read... |
717730d4-f8d0-459b-ad84-666c39a8f402 | 3 | private boolean isAlphabet(char chr) {
int asciiChar = chr;
return (asciiChar >= 65 && asciiChar <= 90)
|| (asciiChar >= 97 && asciiChar <= 122);
} |
13946894-d748-4565-8809-edb2329cdc3c | 3 | public static void openURI(String URIString) {
Logger.getLogger(OSBasics.class.getName()).entering(OSBasics.class.getName(), "openURI", URIString);
if (Desktop.isDesktopSupported()) {
Desktop desktop = Desktop.getDesktop();
if (desktop.isSupported(Desktop.Action.BROWSE)) {
... |
4b8734ed-7529-409b-a5a8-7be5948ee931 | 2 | public ArrayList<EntradaBean> getPage(int intRegsPerPag, int intPage, ArrayList<FilterBean> alFilter, HashMap<String, String> hmOrder) throws Exception {
ArrayList<Integer> arrId;
ArrayList<EntradaBean> arrEntrada = new ArrayList<>();
try {
oMysql.conexion(enumTipoConexion);
... |
582ad2f8-575b-4fba-a5ea-ea92aa2d3a8a | 4 | private void continueSpawnLogic1(final Player p, final PlayerData data){
System.out.println("PLAYER " + p.getName() + " LOADED SPAWN LOGIC 1");
final TeamPref teamPref = data.getTeamPref();
if(teamPref == TeamPref.NOTCHOSEN || teamPref == null){
SchedulerManager.registerSingleTicks(1, new Runnable(){
publi... |
9c354bf3-0332-463f-b5db-cad9577c769f | 2 | public static int getTotalUsers() {
int totalUsers = 0;
try {
String statement = new String("SELECT COUNT(userid) FROM " + DBTable);
PreparedStatement stmt = DBConnection.con.prepareStatement(statement);
ResultSet rs = stmt.executeQuery();
if (rs.next())
totalUsers = rs.getInt("COUNT(userid)");
r... |
3d0bc27c-2d72-4561-8f10-f64506432831 | 7 | public static String qnameFor(Resource resource) {
Graph graph = resource.getModel().getGraph();
if(graph instanceof MultiUnion) {
String uri = resource.getURI();
int split = Util.splitNamespace(uri);
String local = uri.substring(split);
if (local.length() == 0) {
return null... |
6c0542b6-d9b7-4988-9fe0-a913e64178ce | 0 | public void restart()
{
timer.stop();
timeManager.setTime(0);
warnPlayed = false;
} |
384fd55a-e767-44c0-b07c-515e92901a4e | 7 | public void update(ByteBuffer buffer) {
length += buffer.remaining();
//Save current position to leave given buffer unchanged
int position = buffer.position();
//Complete the final buffer if needed
completeFinalBuffer(buffer);
if(!buffer.hasArray() || buffer.isDirect())
{
if(cacheBlock == null) // on... |
29b5249c-43fe-4206-b185-43368bd856a5 | 7 | public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page ... |
5fa2633c-8a37-4c16-bbfb-fa3352dd3745 | 4 | private void stepStars(Graphics2D graphics) {
for (Star star : stars) {
if (paused || quitRequested) {
star.draw(graphics);
continue;
}
star.step();
if (star.y >= screen.getHeight()) {
star.y = 0;
sta... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.