method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
ede3f14c-abb4-4487-9b8a-1a6d8417ca7f | 4 | public void testConstructor_int_int_Chronology() throws Throwable {
YearMonth test = new YearMonth(1970, 6, GREGORIAN_PARIS);
assertEquals(GREGORIAN_UTC, test.getChronology());
assertEquals(1970, test.getYear());
assertEquals(6, test.getMonthOfYear());
try {
new YearM... |
bfb3bf61-e252-4a1b-800e-2254654371e5 | 5 | private boolean hasSameProperties(ObjectRepresentation other)
{
// different size
if (props.size() != other.props.size())
{
return false;
}
for (int x = 0; x < props.size(); x++)
{
String fromProp = props.get(x);
int toIndex = other.props.indexOf(fromProp);
if (toIndex < 0)
{
// other ob... |
94868ad2-6807-4363-ad53-64f1e38b6d74 | 7 | public void act() {
if(!end){
if(state == -1) {
ActionFactory.wait(1000, "", true);
}
else if(state == 0) {
float res = Robot.getInstance().getSonar().getMinDist();
if(res>20 && res<80){
System.out.println("deja la");
stop();
}
else {
Robot.getInstance().getMotion().getPilo... |
62f8e22b-7d4c-46d6-a36c-db6a364060dd | 7 | public void setSubscribed(String newsgroup, boolean flag)
{
if (subs == null)
{
load();
}
if (flag && !groups.contains(newsgroup))
{
groups.add(newsgroup);
}
boolean subscribed = subs.contains(newsgroup);
if (flag && !subscribed)
{
subs.add(newsgro... |
448e5d9b-48d5-40bd-8889-4e866a4f0e97 | 8 | public static String getOption()
{
String option = "gui";
try
{
BufferedReader r = new BufferedReader(new FileReader("config.txt"));
String line = r.readLine();
while (line != null)
{
if (line.startsWith("Option="))
... |
95b87a6e-9b90-451e-a20d-655f80d6e238 | 4 | public PrimevalIsle(String name, String descr)
{
super(name, descr);
for (L2Spawn npc : SpawnTable.getInstance().getSpawnTable())
if (Util.contains(MOBIDS, npc.getNpcId()) && npc.getLastSpawn() != null && npc.getLastSpawn() instanceof L2Attackable)
((L2Attackable) npc.getLastSpawn()).seeThroughSilentMove... |
b5cd27f3-ca3f-48b9-9753-c63a132df365 | 1 | InformGraphPrimitive(int x, int y, int width, int height, int widthDest, int heightDest, String name) {
super(x, y, width, height, widthDest, heightDest, name);
if(name.contains("_"))
setTexture(name.substring(0,name.indexOf("_")) + subName);
else
setTexture(name + subNam... |
4ee01f29-a035-4c7f-948e-c67b7c9199e1 | 0 | public static void main(String args[])
{
new StartScreen();
} |
d42c7891-06fb-4e8a-87c7-f7a59ba60abb | 6 | public static String removeDups(String s)
{
char[] arr = s.toCharArray();
if (arr == null) return null;
if (arr.length < 2) return s;
int end = 1;
for(int i = 0; i<arr.length; i++)
{
int j = 0;
for(; j<end; j++)
{
if(arr[i] == arr[j])
{
break;
}
}
if (j==end)
{
arr... |
d1871051-0af6-4329-8cf6-18a200f83848 | 1 | private static LinkedList<Video> videoListFromResultSet(ResultSet resultSet) throws SQLException {
LinkedList<Video> videos = new LinkedList<Video>();
while (resultSet.next()) {
videos.add(new Video(resultSet.getString(1), resultSet.getString(2), resultSet.getDate(3),
res... |
51ba4aca-f0c9-409f-8f43-491bdf16333f | 7 | public boolean start() {
synchronized (optOutLock) {
// Did we opt out?
if (isOptOut()) {
return false;
}
// Is metrics already running?
if (task != null) {
return true;
}
// Begin hitting the s... |
f8912c4f-5835-48bb-8764-062ba46bde19 | 6 | public static void addPublicationsIntoDatabase(List<Publication> plist) {
try {
if (conn == null || conn.isClosed()) {
init();
}
if (statement == null || statement.isClosed()) {
statement = conn.createStatement();
}
StringBuffer sb = new StringBuffer(
"INSERT INTO soc.publications VALUES")... |
cde0197d-b452-4b7e-b98e-486db675ec03 | 5 | public String toStringAsciiArt() {
char art[] = new char[size()];
for (int i = start, j = 0; i <= end; i++, j++) {
Utr utr = findUtr(i);
if (utr != null) art[j] = utr.isUtr5prime() ? '5' : '3';
else {
Exon exon = findExon(i);
if (exon != null) art[j] = exon.isStrandPlus() ? '>' : '<';
else art[... |
4d3d86a3-b7e0-440c-b4a6-bcd335c31907 | 2 | public String[] getMafiaPlayers() {
ArrayList<String> mafiaPlayer = new ArrayList<String>();
for (Player player : players) {
if (player.getRole().equals(Role.Mafia.toString()))
mafiaPlayer.add(player.getName());
}
return mafiaPlayer.toArray(new String[mafiaPla... |
a32af3b0-8f8a-4671-bce0-c3d6fff183a3 | 3 | public static void deleteDirectory(final File directory) throws IOException {
if (!directory.exists()) {
return;
}
if (!isSymbolicLink(directory.toPath())) {
cleanDirectory(directory);
}
if (!directory.delete()) {
final String message = "Unab... |
9f4fcdcb-192f-4a7c-9394-973718f51d43 | 3 | public static OSMHighwayType fromString(String name) {
if (name != null) {
for (OSMHighwayType h : OSMHighwayType.values()) {
if (name.equalsIgnoreCase(h.name)) {
return h;
}
}
}
return null;
//throw new IllegalArgumentException("No constant with name " + name + " f... |
57a464ca-c70f-44ea-90fb-91b5abfd68b0 | 9 | public final void para() throws RecognitionException {
try {
// fontes/g/CanecaSemantico.g:852:2: ( ^( PARA_ . . . . ) )
// fontes/g/CanecaSemantico.g:852:4: ^( PARA_ . . . . )
{
match(input,PARA_,FOLLOW_PARA__in_para2333); if (state.failed) return ;
... |
402922e2-bae7-4411-a94a-8cc9febb84b3 | 3 | public void draw(Graphics2D g) {
bg.draw(g);
tileMap.draw(g);
player.draw(g);
teleport.draw(g);
// draw ememies
for (int i = 0; i < enemys.size(); i++) {
enemys.get(i).draw(g);
}
teleport.draw(g);
// draw Explostion
for (int i = 0; i < explosions.size(); i++) {
explosions.get(i).setMapPo... |
9f0e07a5-9fde-4d27-964a-c6603f6fd477 | 5 | public static void EM(Instances data, Instances originalData) throws Exception {
// Create EM Clusterer
EM em = new EM();
em.setNumClusters(3);
em.buildClusterer(data);
// evaluate the EM clusterer
ClusterEvaluation emEvaluation = new ClusterEvaluation();
emEvaluation.setClusterer(em);
emEvaluatio... |
559cb80a-96b5-4ca0-aa1b-6e341c62f957 | 8 | protected void setActiveEntryPage(EntryPage page) {
// Have the currently displayed page save its changes
if (activePage != null) {
activePage.apply();
}
if (page == null) {
// No page available to display, so hide the panel container
propertiesPanelContainer.setVisible(false);
} else {
// Show t... |
a9a440e7-d28b-4d6e-8af8-5af59e2af8cf | 7 | private String fixText (String s, DocumentFilter.FilterBypass fb) throws BadLocationException
{
if (s == null) {
return null;
}
int currentLength = fb.getDocument().getLength();
int l = fb.getDocument().getLength();
char prevChar = (l < 1) ? ' ' : fb.getDocument... |
6c94e8c4-a7ec-4c96-b066-ba80971fafd6 | 1 | @Override
public float contains( int x, int y ) {
if( boundaries.contains( x, y ) ){
return 1.f;
}
else{
return 0.f;
}
} |
9ac9909a-481d-405c-bdaf-8d71a3c09900 | 8 | public void kiemTraFileChunk(String tenFile, int soLuongChunkToiDa) {
try {
socket = new DatagramSocket(Bittorrent.portlisten + port);
socket.setSoTimeout(3000);
for (int i = 0; i < Bittorrent.danhSachPeer.size(); i++) {
String duLieuGui = "... |
a7009735-4794-479e-bf2d-9e61396939c5 | 7 | static final CellEditable startEditing(CellRenderer self, Event event, Widget widget, String path, Rectangle backgroundArea, Rectangle cellArea, CellRendererState flags) {
long result;
if (self == null) {
throw new IllegalArgumentException("self can't be null");
}
if (event... |
0ef871e8-f5d1-40f8-8941-72690823afc1 | 7 | public static void main(String[] args) throws Exception {
String host="localhost";
int port=8787;
String user=null;
for(int i=0; i < args.length; i++) {
if(args[i].equals("-host") || args[i].equals("-h")) {
host=args[++i];
continue;
... |
8ab816c2-5f55-4339-b335-d9b325d62fd6 | 6 | public static void addMovie(TravelAgent agent){
System.out.print("Plese enter in movie name: ");
input.nextLine();
String name = input.nextLine();
System.out.print("Please enter in movie running time in minutes: ");
int length = input.nextInt();
// create a movie object that can be added to a flight
Movie... |
11ee44b9-eb81-421f-830e-111a3d17f5e6 | 5 | protected <T> boolean isSameSetPrivate(Set<T> obj1, Set<T> obj2) {
// make sure both sets have the same size number of elements
if (obj1.size() != obj2.size())
return false;
// return obj1.containsAll(obj2);
// the sets have the same size - pick one
for (T item1 : obj1) {
boolean match = false; // did... |
59e21ef8-dfdb-40c8-9b59-41727cce958d | 3 | public boolean deleteTopic(int id) {
Connection connection = ConnectionManager.getConnection();
if (connection == null) {
logger.log(Level.SEVERE, "Couln't establish a connection to database");
return false;
}
MessageManager messageManager = new MessageManager();
... |
9df65ab5-f9e7-462d-9225-f57ed91052ae | 7 | @Override
public String execute(HttpServletRequest request, HttpServletResponse response) throws Exception {
String data;
try {
ArrayList<FilterBean> alFilter = new ArrayList<>();
if (request.getParameter("filter") != null) {
if (request.getParameter("filterop... |
a0db45ac-40df-49e1-b10f-d29b400744d7 | 4 | private String[] parseCoordinates(final JSONObject json) throws NameResolverException {
try {
//final JSONArray jsonArray = json.getJSONArray("data");
final JSONArray jsonArray = json.getJSONArray("features");
final JSONArray coords = jsonArray.getJSONObject(0).getJSONObject("geometry").getJSONAr... |
134f4eae-d672-4f73-a5f9-d982956b2492 | 4 | private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
Notice N = new Notice();
if(!"".equals(TextField_Titulo.getText()) && !"".equals(TextArea_Texto.getText()) && !"".equals(TextFild_Assuntos.getText()))
{
N.... |
1969f964-fa01-4e01-bf39-750a3809e1d3 | 1 | public boolean addVertice(Point p) {
HashSet<Point> adjacent = graph.get(p);
if(adjacent == null) {
adjacent = new HashSet<Point>();
return true;
}
return false;
} |
166ad2f6-1a55-4331-986d-f523af218dd3 | 3 | private boolean jj_3R_22()
{
if (jj_3R_24()) return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3R_25()) { jj_scanpos = xsp; break; }
}
return false;
} |
b1b54900-e97f-470d-874d-56f28b30fb07 | 1 | private static void outOfMemory() {
Vector v = new Vector();
while (true) {
v.add(new Object());
}
} |
360b4d88-0f92-4402-a027-57e6a88523d9 | 3 | public void rotateEditingShip()
{
Ship testShip = new Ship(editingShip);
testShip.rotate();
if(myTurnEditing)
{
if(mySea.shipInBounds(testShip))
editingShip.rotate();
}
else
{
if(theirSea.shipInBounds(testShip))
editingShip.rotate();
}
} |
27fdc9b5-886e-48af-8279-ab5c25303f31 | 7 | public void visitDeclaration(FieldDeclaration decl)
{
// On regarde si la déclaration possède une annotation Note
Note note = decl.getAnnotation(Note.class);
// Et on l'affiche eventuellement :
if(note != null)
printMessage(decl, note);
if(decl instanceof Map<?... |
db171a29-c851-4b01-95e8-a662e7938836 | 8 | public int[][][] getMapData() {
ensureCapacity();
if (mapData != null) {
return mapData;
}
FileInputStream dataStream = null;
try {
dataStream = new FileInputStream(DATA);
mapData = new int[4][64][64];
if (regionData != null) {
... |
396963a6-3564-4287-99d1-de40c23130f2 | 9 | @Override
public int strstr( char[] pattern, char[] string ) {
if( pattern.length > string.length )
return -1;
int ret = -1;
int hashP = 0;
for( int i = 0; i < pattern.length; i++ ) {
hashP += Character.valueOf( pattern[i] ).hashCode();
}
int[] hashS = new int[ string.length - pattern.length... |
7fb8e65b-7483-46c7-86cd-e59cae08f7bb | 1 | public static CommandLineArgs toCommand(String _string)
{
try {
return valueOf(_string);
}
catch (Exception ex) {
return NOVALUE;
}
} |
47675d1f-3fb9-4373-b39c-667e86b469e2 | 5 | public void showMenu()
{
/** Prints "Battleships" in Kick-Ass ASCII Art */
System.out.println(" ____ _______ _______ _ ______ _____ _ _ _____ _____ _____ _ \r\n | _ \\ /\\|__ __|__ __| | | ____|/ ____| | | |_ _| __ \\ / ____| |\r\n | |_) | / \\ | | | | | | | |__ | (___ ... |
ba426fc1-fe26-4b94-9ab2-2c44f0edb476 | 7 | public final BufferedImage extractImageSegment(
BufferedImage sourceImage, int x, int y, int width, int height) {
BufferedImage extractedImage = null;
if (sourceImage == null)
throw new NullPointerException(
"AssetLoader.extractImageSegement: NULL source imag... |
6d509015-be9a-4252-a028-9719f336a153 | 1 | private static byte[] checksumToByteArray(int value) {
byte[] b = new byte[2];
for (int i = 0; i < 2; i++) {
int offset = (b.length - 1 - i) * 8;
b[i] = (byte) ((value >>> offset) & 0xFF);
}
return b;
} |
59874eca-16ca-4879-8aba-4ac51c6df59d | 0 | public String getDescription() {
return description;
} |
3f1af60f-e553-420f-9fc0-c9c21cc9d5b8 | 0 | @Test
public void testSetAnt() throws IOException {
System.out.println("setAnt");
Cell instance = new Cell(0,0);
Ant expResult = null;
Ant result = instance.getAnt();
assertEquals(expResult, result);
AntBrain ab = new AntBrain("cleverbrain1.brain");
... |
f9d69eb5-3bb8-40d4-8f83-8e2a14631016 | 6 | @Override
protected void doAction(int option)
{
switch (option)
{
case 1:
listAllTeams();
break;
case 2:
addTeam();
break;
case 3:
updateTeam();
break;
... |
d40c2162-a586-460c-a697-840084b41be3 | 2 | public String decrypt(byte[] encondeMessage) {
int[] intText = byte2int(encondeMessage);
int i, v0, v1, sum, n;
i = 0;
while (i < intText.length - 1) {
n = numCycles;
v0 = intText[i];
v1 = intText[i + 1];
sum = delta * numCycles;
for (int ind = 0; ind < n; ind++) {
v1 -= ((v0 << 4 ) + key[2... |
fbdd08f0-4636-47e0-a303-4958a67d7c77 | 5 | @SuppressWarnings("unchecked")
private void readFile() {
FileInputStream
sfis = null,
rfis = null;
ObjectInputStream
sois = null,
rois = null;
try {
sfis = new FileInputStream(sendURL);
rfis = new FileInputStream(reportURL);
if(sfis.available() > 0) sois = new ... |
87f5da4a-5fcf-41be-9615-08a8556344e6 | 7 | @Override
public Protein getProteinFromFile(File f)
{
Protein protein = new Protein();
BufferedReader br;
try
{
br = new BufferedReader(new FileReader(f));
String line = null;
try
{
while((line=br.readLine()) != null)
{
... |
7aeb8539-9511-4280-b66f-075cfae72a2e | 9 | public final void setPos(int i, int j, boolean flag)
{
if(anim != -1 && Animation.anims[anim].anInt364 == 1)
anim = -1;
if(!flag)
{
int k = i - smallX[0];
int l = j - smallY[0];
if(k >= -8 && k <= 8 && l >= -8 && l <= 8)
{
if(smallXYIndex < 9)
smallXYIndex++;
for(int i1 = smallXYIndex... |
f9976d8b-5c59-428e-9c0d-f089d287ef22 | 8 | public void testPeutMarquerDame(){
Tablier t1 = new Tablier();
t1.initialiserCase();
assertFalse(t1.peutMarquerDame(CouleurCase.BLANC));
assertFalse(t1.peutMarquerDame(CouleurCase.NOIR));
// deplacement de toute les dames blanches
for (int i=0;i<2;i++)
t1.deplacerDame(t1.getListeCase().get(0), t1.getL... |
2b3a0fa3-f034-4eb6-af4b-005442ed7d63 | 4 | @Override
protected void drawLine(Graphics2D g, AZeit t1, float posPercent,
float sizePercent)
{
if(posPercent>1 || posPercent<0 || sizePercent>1 || sizePercent<0)
throw new IllegalArgumentException();
g.setStroke(new BasicStroke());
final double angle=timeToAngle(t1);
final double sin=Math.sin(angle);
... |
3923e0a6-00ed-4039-881d-89e71e508f1a | 1 | public void test_DateTime_new_Gaza() {
try {
new DateTime(2007, 4, 1, 0, 0, 0, 0, MOCK_GAZA);
fail();
} catch (IllegalInstantException ex) {
assertEquals(true, ex.getMessage().indexOf("Illegal instant due to time zone offset transition") >= 0);
}
} |
b5d2a0d7-bca7-47f6-a5a7-73cf12b3674f | 4 | @Override
public boolean onCommand(CommandSender sender, Command cmd,
String commandLabel, String[] args) {
try {
if (sender instanceof Player) {
Player player = (Player) sender;
if (cmd.getName().equalsIgnoreCase("talk")) {
player.sendMessage(ChatColor.GREEN
+ "Welcome to the Hunger Games... |
dd1bef6f-0f80-4062-91e8-35d7d34cfc77 | 2 | @Override
public void setCredits(double credits) {
if(credits < 0.5 || credits > 4.0) {
JOptionPane.showMessageDialog(null,
"Error: credits must be in the range 0.5 to 4.0");
System.exit(0);
}
this.credits = credits;
} |
3999ccab-e082-4562-aa12-d1d641ba79ad | 8 | private double closest(Point2D[] pointsByX, Point2D[] pointsByY, Point2D[] aux, int lo, int hi) {
if (hi <= lo) return Double.POSITIVE_INFINITY;
int mid = lo + (hi - lo) / 2;
Point2D median = pointsByX[mid];
// compute closest pair with both endpoints in left subarray or both in right ... |
c550de57-b8d7-49b9-9701-e1d85268eae1 | 5 | private void drawols(GOut g, Coord sc) {
synchronized (map.grids) {
for (Coord gc : map.grids.keySet()) {
Grid grid = map.grids.get(gc);
for (Overlay lol : grid.ols) {
int id = getolid(lol.mask);
if (visol[id] < 1) {
continue;
}
Coord c0 = gc.mul(cmaps);
drawol2(g, id, c0.add... |
e9b1eef6-8ad9-45c8-b127-f2e046b21cef | 9 | public void testSentenceParts() throws Exception {
ReadEngine engine = new ReadEngine();
Conversation conversation;
ArrayList<String> predicates = new ArrayList<>();
ArrayList<String> subjects = new ArrayList<>();
for (int i = 0; i < conversationsStory.length; i++) {
... |
ed7f9e38-b19b-4e9c-bb99-ba580b6000ab | 5 | public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
out = new StringBuilder();
boolean noFirst = false;
while ((line = in.readLine()) != null && line.length() != 0) {
int n = Integer.parseInt(line);
if (n... |
987a6d1a-5d6d-4462-a043-09b315fb93ea | 6 | public void checkNeighbours(Map map, ArrayList<Node> openlist, ArrayList<Node> closedlist){
openlist.remove(this);
closedlist.add(this);
if(posX == goal.x && posY == goal.y){
finalNode = this;
return;
}
for(Direction dir: directions){
Point newPosition = dir.nextPoint(posX, posY);
... |
26ff1b7e-4f95-4ad7-b347-995609c860f9 | 4 | private Koordinate getMin(WarMachine warMachine, Koordinate koord,
Ausrichtung ausrichtung) {
switch (ausrichtung) {
case XPLUS:
return koord;
case XMINUS:
return new Koordinate(koord.getX() - warMachine.getLaenge() + 1,
koord.getY() - warMachine.getBreite() + 1);
case YPLUS:
return new Koordin... |
c1f45876-5436-4ef8-b0e4-0b721e4c9a1a | 6 | private static void performStep17(BotState state) {
for (Region opponentBorderingRegion : state.getVisibleMap().getOpponentBorderingRegions(state)) {
List<Region> opponentNeighbors = opponentBorderingRegion.getEnemyNeighbors(state);
List<Region> sortedOpponentNeighbors = RegionValueCalculator.sortRegionsByAttac... |
9a8c3cb8-d87c-491e-83c4-923368ee344a | 5 | void createExampleWidgets () {
/* Compute the widget style */
int style = getDefaultStyle();
if (horizontalButton.getSelection ()) style |= SWT.HORIZONTAL;
if (verticalButton.getSelection ()) style |= SWT.VERTICAL;
if (smoothButton.getSelection ()) style |= SWT.SMOOTH;
if (borderButton.getSelection ()) sty... |
b3f28f8c-8457-4fb6-846c-88537fa3a919 | 2 | private static String[] readFile(String file, int lines, String language) throws IOException
{
String encoding = getEncodingForLanguage(language);
BufferedReader in;
if (encoding == null)
in = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
else
in = new BufferedReader(new InputStr... |
f8de4dc3-0534-49b8-a2a5-5b361df38814 | 3 | public void dealerStand() {
if (player.ifBusted() == true) {
player.playerBust();
} else if (dealerHand.getHandValue() < player.getHand().getHandValue()) {
dealerLost();
} else if (dealerHand.getHandValue() > player.getHand().getHandValue()) {
dealerWon();
} else {
dealerPush();
}
} |
bd7dcf27-4c0d-4c1d-bfc0-fe865d46f863 | 5 | public void heapIncKey(int indeksi, int arvo) {
if (indeksi >= 0 && indeksi < keko.size()) {
if (arvo > keko.get(indeksi)) {
keko.set(indeksi, arvo);
}
while (indeksi > 0 && keko.get(parent(indeksi)) < arvo) {
int apuluku = keko.get(parent(inde... |
813f9d4f-5ef8-4630-a5a0-5bed7c97f624 | 0 | public void alustaIkkuna(int i) {
alustaTaso(i);
SwingUtilities.invokeLater(ikkuna);
} |
35519936-4e64-4275-ae46-1ff20211ba75 | 4 | public LoadImage(String s) {
//img = ImageIO.read(new File(s));
//img = Toolkit.getDefaultToolkit().createImage(s);
img = Toolkit.getDefaultToolkit().createImage(s);
imageTracker = new MediaTracker(this);
imageTracker.addImage(img,0);
if(false == imageTracker.checkID(0))
{
try... |
1555349a-e9e5-47ed-bcd2-ad3f0d5853cd | 3 | @Override
public void setValue (final List<Value<?>> value) {
if (value == null) {
throw new NullPointerException();
}
this.value = new ArrayList<Value<?>>(value);
} |
38852368-405c-4517-b397-79dacb49ce15 | 8 | public void keyPressed(int k) {
if(k == KeyEvent.VK_LEFT) {
player.setLeft(true);
}
if(k == KeyEvent.VK_RIGHT) {
player.setRight(true);
}
if(k == KeyEvent.VK_UP) {
player.setUp(true);
}
if(k == KeyEvent.VK_DOWN) {
player.setDown(true);
}
if(k == KeyEvent.VK_W) {
player.setJumping(true);... |
ad12ce95-bf5d-4a5b-bdcc-5117ff6df7ce | 8 | public final Level loadOnline(String var1, String var2, int var3) {
if(this.progressBar != null) {
this.progressBar.setTitle("Loading level");
}
try {
if(this.progressBar != null) {
this.progressBar.setText("Connecting..");
}
HttpURLConnection var6;
... |
97fb0a7b-8702-4d79-9b70-6d3b71bbefbc | 8 | short addUtf8(String k)
{
int theIndex = itsUtf8Hash.get(k, -1);
if (theIndex == -1) {
int strLen = k.length();
boolean tooBigString;
if (strLen > MAX_UTF_ENCODING_SIZE) {
tooBigString = true;
} else {
tooBigString = fal... |
61fc8040-17a1-4088-a0a0-41286b87505f | 1 | private String buildJsonUsername() {
Iterator<String> iterator = getUserName().iterator();
JsonArrayBuilder jsonArrayBuilder = Json.createArrayBuilder();
while (iterator.hasNext()) {
jsonArrayBuilder.add((String) iterator.next());
}
System.out.println("User Array " + ... |
67b0498d-fee0-4180-a18b-5c564ecf011d | 6 | public ArrayList<ArrayList<ArrayList<String>>> erstelleBlockelementListAll(
ArrayList<Umlaufplan> umlaufplanliste) {
ArrayList<ArrayList<ArrayList<String>>> ListPlaeneGesamt = new ArrayList<ArrayList<ArrayList<String>>>();
int zaehler = 0;
for (int i = 0; i < umlaufplanliste.size(); i++) {
ArrayList<Array... |
3b06cfa2-4cf0-4ac6-961a-5eea7b6abf4e | 5 | public boolean intersectWith(BlockArea ba) {
if (this.l == null || ba.getLocation() == null) return false;
for (BlockPosition bp : blocks) {
BlockPosition bp1 = bp.bind(l);
for (BlockPosition bp2 : ba.blocks) {
if (bp2.bind(ba.l).equals(bp1)) return true;
... |
6a49cec6-fd69-44b1-b000-6391990a0a07 | 1 | public static void apropos() {
if (fenetreApropos != null) {
fenetreApropos.dispose();
}
fenetreApropos = new WindowApropos();
} |
4c78481b-e3c3-4e89-906a-5a31884c020c | 7 | int setHandValue()
{
int handValue = this.handType * 0x100000;
int i = 0;
int n = 0x10000;
ArrayList < PlayingCard > reverseUsedList = this.usedCards;
Collections.sort( reverseUsedList, PlayingCard.Comparators.ACEHIGH );
Collections.reverse( reverseUsedList );
while ( i < reverseUsedList.size() )
{
... |
9aebf881-1684-456e-956c-2520f78ab3e2 | 4 | private void loadText(){
textPane.setText("");
StyledDocument doc = textPane.getStyledDocument();
for ( RecipeSection section: recipe.getSections() ){
try{
String headline = section.getHeadline();
if( headline != null && ! headline.equals("") ){
... |
d154b983-440c-45bd-8bb0-f4d15bbd599d | 4 | private void processOpenFrame(int channelPtr,
int ctype,
int flag,
ByteBuffer data) {
OpenRequest request;
Channel channel;
synchronized (this) {
request = m_pendingOpenRequest;
... |
601cb133-dc70-469b-865c-def10f0370a7 | 0 | @Test
public void simpleWithWanFilter() throws Exception {
final byte[] input = new byte[15];
final byte[] zeroes = new byte[input.length];
Arrays.fill(zeroes, (byte) 0);
final int pipe_buf_size = 20;
new Random().nextBytes(input);
final Properties[] filter_configs = ... |
5ff689a0-f865-4f22-8829-41607334989e | 4 | public Client(String ip,String playerName,String tankName,int tankSpeed,int bulletSpeed,int bulletDamage){
Client.ip = ip;
imageInit();
this.setSize(SCREEN_WIDTH, SCREEN_HEIGHT);
Dimension scrSize=Toolkit.getDefaultToolkit().getScreenSize();
this.setLocation(scrSize.width/2-SCREEN_WIDTH/2, scrSiz... |
bf3fa051-0c35-4d43-8e40-bd79fe884136 | 2 | public static Float parseSpeed(String data) {
String[] lines = data.split("\n");
for (String line : lines) {
String[] parts = line.split(":", 2);
if (parts[0].equals("s")) {
return Float.parseFloat( parts[1].replace(",",".") );
}
}
return null;
} |
0a673e2f-d65d-41fc-bae8-f5823823d415 | 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... |
38aa7d68-fc18-4b05-9022-0166f7c20fea | 8 | public void run() {
try {
InputStream stream = socket.getInputStream();
connected=true;
while(connected){
int byteCount = stream.available();
if(byteCount>0){
logger.debug(byteCount+" bytes are available for reading");
byte[] oldByteBuffer = byteBuffer;
//int oldByteBufferLength = oldB... |
367b68ee-4715-48b2-8d61-0ae79c0bff3e | 4 | @Override
public ReturnStruct parse(String[] lines) throws InterpreterException {
int i = 0;
code_ = lines;
Block b = null;
while (i < lines.length) {
String line = Parser.clean(lines[i]);
String copy[] = new String[lines.length - i];
System.arrayc... |
c83ec210-4650-43c4-a3c4-cc3f2cd6d11b | 1 | public MethodAnalyzer getMethodAnalyzer() {
ClassAnalyzer ana = getClassAnalyzer();
if (ana == null)
return null;
return ana.getMethod(methodName, methodType);
} |
339707e5-20b2-4a21-b4b4-951bccbcbe8c | 3 | @Override
public void run() {
TcpSender packetSender = new TcpSender();
while (true) {
// A spin wait is super resource heavy
// TODO: not this
while (ccl.isEmpty()) {
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace(... |
ade925c4-2c0d-4ac5-a2e0-4d02314c360d | 7 | public File getFile()
{
if (file == null)
{
String searchPath = Util.minecraftDirectory + "/libraries/";
String[] pathSplit = name.split(":");
pathSplit[0] = pathSplit[0].replace('.', '/');
for (int i = 0; i < pathSplit.length; i++)
{
... |
db76e406-6b61-4f35-9f99-79ac4c682806 | 0 | public String GenerateLinkID(){
return DateUtil.GetTimeString() + getTTenNum();
} |
c3dd1786-f59f-4164-b6de-c1e52869f740 | 1 | private void loadDriver()
{
try
{
d = (Driver)Class.forName(driver).newInstance();
DriverManager.registerDriver(d);
}
catch (Exception e)
{
System.out.println("Error loading database driver: " + e.toString());
}
} |
c5d9c2a5-cde9-4d87-905f-f02a9fdcde1c | 8 | @Override
public void paint(Graphics g, RsTransform gt){
int i, j;
int ix, iy, iRadius;
int w, h;
double [] xPlacement = null;
double [] yPlacement = null;
int [] xWall;
int [] yWall;
xWall = new int[6];
yWall = new int[6];
... |
01642dd3-1171-401c-bcb5-0a7ed55c2daa | 0 | private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
System.exit(0);
}//GEN-LAST:event_formWindowClosed |
de654018-7fe6-4849-a58d-824ef5d1c5c4 | 2 | public void testPropertyCompareToHour() {
LocalTime test1 = new LocalTime(TEST_TIME1);
LocalTime test2 = new LocalTime(TEST_TIME2);
assertEquals(true, test1.hourOfDay().compareTo(test2) < 0);
assertEquals(true, test2.hourOfDay().compareTo(test1) > 0);
assertEquals(true, test1.hou... |
f4893961-09bc-406c-8c93-0bfb86996ec5 | 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... |
f5725a7b-4488-42ec-a401-0ccee723813f | 4 | public static void shutdown() {
boolean gotSQLExc = false;
try {
try{
Class.forName(DRIVER_NAME);
}catch (Exception e) {
//Nothing
}
DriverManager.getConnection(SHUTDOWN_URL);
} catch (SQLException se) {
if ... |
ecb08b19-9f58-4779-99e1-c9affa974abd | 5 | public void remove(){
if (current == null)
throw new NoSuchElementException();
if (current == first){
first = first.link;
current = (LinkedListNode<T>) first;
previous = null;
if (first == null)
l... |
c0785abb-7164-49bb-8152-3c4f3f7b936f | 8 | @Override
public Object getValueAt(int rowIndex, int columnIndex) {
switch (columnIndex) {
case 0:
return listpharmacie.get(rowIndex).getId_pharmacie();
case 1:
return listpharmacie.get(rowIndex).getNom_pharmacie();
case 2:
... |
e925ab04-a149-4cea-9f81-287efaeb592b | 3 | public void paintExpBar(Graphics g)
{
g.setColor(Color.CYAN);
//g.drawImage(battleImages[4],415,385,150,12,this);
if(allowedToPaintExp)
{
int prevLev=Battle.getLevel(userSelected)-1;
int nextLev=prevLev+1;
if(nextLev>100)
nextLev=100;
int expOver=Battle.getExp(userSelected)-(prevLev*prevLev*p... |
5726edef-060a-4563-b242-7f9944051095 | 9 | private void saveConnections(){
HashSet<String> roomSet = new HashSet<String>();
ExitDirection dir = null;
String rooms = "";
String connections = "";
String xml = "<?xml version=\"1.0\"?>\n<game name=\"";
xml = xml + name.getText()+"\">\n<description>\n\"";
xml = xml + desc.getText()+"\"\n</description>\... |
5193e5b9-34e8-408e-b616-5129ac9c2823 | 8 | public static String unescapeTokenString(String token, char escapechar, boolean upcaseP) {
{ int nofescapes = 0;
int cursor = 0;
int cursor2 = 0;
int size = token.length();
StringBuffer result = null;
boolean escapeP = false;
while (cursor < size) {
if (token.charAt(curs... |
833e6c55-f6d8-4a90-add1-78fbd52887f6 | 6 | final int method1187(String string, boolean bool, int i,
RasterToolkit[] class105s) {
try {
anInt1984++;
int i_22_
= method1188(string, new int[] { i },
Class186.aStringArray2494, (byte) 87, class105s);
int i_23_ = 0;
if (bool != false)
((BitmapFont) this).anInt1988 = -58;
for ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.