method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
b4248664-61a3-46e4-ab0f-d8dbca2353c3 | 4 | public void basicSetCardio(Cardio myCardio) {
if (this.cardio != myCardio) {
if (myCardio != null) {
if (this.cardio != myCardio) {
Cardio oldcardio = this.cardio;
this.cardio = myCardio;
if (oldcardio != null)
oldcardio.unsetWorkout();
}
}
}
} |
1b74e9c7-4ae3-4cf6-9292-5cf2c0bb2d49 | 0 | public void setURI(String value) {
this.uri = value;
} |
4abd22f2-25a2-47ca-9042-1cab8b62dbf5 | 7 | public static String doubleToString(double d) {
if (Double.isInfinite(d) || Double.isNaN(d)) {
return "null";
}
// Shave off trailing zeros and decimal point, if possible.
String string = Double.toString(d);
if (string.indexOf('.') > 0 && string.indexOf('e') < 0
... |
85ff45b1-cf07-4d3a-885d-817392588ec7 | 7 | protected void setTeamRep() {
User[] userArray = null;
String[][] teamMember = debateSelected.getTeam();
int teamNub = 0, teamNub2 = 0;
for (int i = 0; i < teamMember.length; i++) {
for (int j = 0; j < teamMember[i].length; j++) {
if (teamMember[i][j].equals(userLogin.getName())) {
teamNub = i;
... |
656efe90-c6d6-48c2-965c-bcf2a199517a | 2 | public int[] update() {
int[] pos = new int[6];
if(oldx != -1) {pos[0] = Math.round(oldx); oldx = -1;}
else {pos[0] = Math.round(x);}
if(oldy != -1) {pos[1] = Math.round(oldy); oldy = -1;}
else {pos[1] = Math.round(y);}
timePassed = System.currentTimeMillis() - lastUpdate;
... |
3076569a-0b4f-4717-911f-bc9ddff936d3 | 4 | public static Boolean locationEqualsXYZW(Location l, Integer x, Integer y, Integer z,String w) {
if(l.getX() == x && l.getY() == y && l.getZ() == z && l.getWorld().getName() == w) return true;
return false;
} |
70eb9a42-d2f0-4d05-a49b-446b579a2ee8 | 1 | private void loadPreviousFonts() {
this.previousFonts = new ArrayList<Font>();
for (int i = this.startFrom; i <= this.endAt; i++) {
this.previousFonts
.add(this.document.getChildren().get(i).getFont());
}
} |
4b18b154-bfdd-4952-896f-5321b871b1a0 | 9 | private static void read(String filePath) {
Scanner s = null;
double[] maxima = null;
boolean isMax = false;
double[][] table = null;
boolean[] onlyPositive = null;
BufferedReader in;
try {
int cols;
int rows;
in = new BufferedReader(new FileReader(filePath));
int correction = getCorrectio... |
6a7d0617-e069-45c7-bed1-52e737f17e7c | 3 | private void acao141(Token token) throws SemanticError {
try{
idAtual = tabela.get(token.getLexeme(), nivelAtual);
if (idAtual instanceof IdentificadorVariavelCampoRegistro) {
if (regAtual.getListaCampos().contains(idAtual)) {
tipoLadoEsquerdo = ((IdentificadorVariavel) idAtual).getTipo();
} else {
... |
00f6fd6c-d863-4466-9a9b-dfb4ee14eb38 | 6 | @Override
public Component getListCellRendererComponent(
JList<? extends State> list,
State value,
int index,
boolean isSelected,
boolean cellHasFocus) {
State state = value;
this.setFont(fFont);
... |
7005a661-a454-4c78-9dfc-e509569c2db1 | 5 | void testHyperlinks()
{
WorkBookHandle tbo = new WorkBookHandle();
String sheetname = "Sheet1";
WorkSheetHandle sheet1 = null;
try
{
sheet1 = tbo.getWorkSheet( sheetname );
}
catch( WorkSheetNotFoundException e )
{
System.out.println( "couldn't find worksheet" + e );
}
try
{
tbo.copyWo... |
f26dedf4-72b8-40bb-b809-3cca2880f7a7 | 1 | public ArrayList<String> getNeighbours()
{
ArrayList<String> neighbours = new ArrayList<String>();
for (Edge e : this.startingEdges)
{
neighbours.add(e.getDestination().getName());
}
return neighbours;
} |
fdb4596d-edea-42b6-a827-daffbad79004 | 0 | public static byte[] hash(byte[] data) throws NoSuchAlgorithmException {
MessageDigest md = MessageDigest.getInstance("SHA-1");
md.update(data);
return md.digest();
} |
05cff970-6af2-4c99-8fb7-f0747e41ffe9 | 7 | public void write(OutputStream os, int tempo, int sps) throws IOException
{
int ndur = (int) ((60.0 / (double) tempo) * sps * beats);
if (name == ' ')
{
for (int x = 0; x < ndur; x++)
os.write(0);
return;
}
String noteName = String.format("%c%c%s",scale < 10 ? scale + '0' : scale,name,sharp ? "#" :... |
1922e5e0-b427-4480-975f-23bc9d6753c9 | 4 | public static String getBanReason(String playerName){
String reason = "Not Banned";
if(isBanned(playerName)){
try {
SQL_STATEMENT = SQL_CONNECTION.createStatement();
SQL_RESULTSET = SQL_STATEMENT.executeQuery("SELECT * FROM bans WHERE username='" + playerName + "'");
// This loop che... |
cb5fa203-cfcc-4ce7-b98d-09fdb7e6b5ac | 8 | private void jbtnCreerThemeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnCreerThemeActionPerformed
try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
} catch (ClassNotFoundException ex) {
JOptionPane.showMessageDialog(this, "Driver non t... |
5de8cc43-527a-4bf5-a2a9-85ab137c5df3 | 7 | final public Column Column() throws ParseException {
String name1 = null;
String name2 = null;
String name3 = null;
// [schema.][tabella.]colonna
name1 = RelObjectName();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case 93:
jj_consume_token(93);
name2 = RelObjectName(... |
c4837341-36ee-4a5a-881d-36d504af7c49 | 5 | public static BufferedImage toBufferedImage(Image image) {
if (image instanceof BufferedImage) {
return (BufferedImage) image;
}
// This code ensures that all the pixels in the image are loaded
image = new ImageIcon(image).getImage();
// Determine if the image has transparent pixels; for this method's
... |
71408b03-fb24-42d0-b356-f5824605778a | 1 | @Override
public boolean supports(Class<?> arg0) {
return Image.class.equals(arg0);
} |
8424f325-fef4-41f2-bb1b-8c376cb1e527 | 2 | public boolean isIon()
{
for(int i = 0; i < ions.length; i++)
if(this.equals(new MiniCompound(ions[i])))
return true;
return false;
} |
b4d98621-0673-4e47-8c7c-12d77e37499d | 7 | public void paintComponent(Graphics g){
if (mapDrawer != null){
if (mapImage == null ||
this.getWidth() != mapImage.getWidth(this) ||
this.getHeight() != mapImage.getHeight(this) ||
this.repaintMap){
mapImage = new Buffer... |
033e1f66-d44a-4e2e-b8c0-59ec4bd0534b | 5 | public PercSerializationInstantiator(Class type) {
// Find the first unserializable parent class
Class unserializableType = type;
while(Serializable.class.isAssignableFrom(unserializableType)) {
unserializableType = unserializableType.getSuperclass();
}
try {
// Get th... |
95fe254c-3ac6-46ec-8dcd-d8866dc3e150 | 3 | @Test
public void testLipidPercentage() {
MealRepartition mr = new MealRepartition();
try {
mr.setLipidPercentage(0.34);
fail("A BadLipidPercentageException should have been thrown.");
} catch (BadLipidPercentageException e) {}
try {
mr.setLipidPercentage(0.41);
fail("A BadLipidPercentageException ... |
e517fe45-f439-4c25-b99e-3c8ea2275f30 | 8 | public Loc<T> location(final Path... path) {
Loc<T> l = this.root();
for (Path p : path) {
switch (p) {
case DOWN: l = l.down(); break;
case LEFT: l = l.left(); break;
case RIGHT: l = l.right(); break;
case UP: l = l.up(); break;
case LEFT_MOST: l = l.leftMost(); break;
... |
9280efa9-d8f4-4570-93ea-81dd7b8eaa34 | 5 | public PartialMessage read(PartialMessage read) {
try {
int buffLength = 4096 * 2;
int len = 0;
byte[] b = new byte[buffLength];
//rawIn is a Socket.getInputStream();
while(!this.socket.isClosed()){ //Read the first two bytes of the message, the frame type byte - and the payload len... |
ab8b1877-ec80-46c0-b35c-d5544e0fdb7a | 8 | public static void javaOutputForeach(Cons loop) {
{ Stella_Object continuationtest = loop.rest.value;
Cons valueassignments = ((Cons)(loop.rest.rest.value));
Cons nextassignments = ((Cons)(loop.fourth()));
int nofnextassignments = nextassignments.length();
Cons body = ((Cons)(loop.fifth()));... |
de4bf6b2-1048-4292-a7d3-79acdd3fc082 | 8 | private void reDrawList(int x, int y)
{
if(type == 0)
{
//Initialize head
if(head == null)
{
if(myInfo.getHead() != null)
head = new linkedButton(myInfo.getHead(),null);
tail = head;
}
//Inserts new buttons if nesscessary
if(head != null && tail.getInfo() != myInfo.getTail())
{
... |
b301d4b9-c65a-43a2-9d03-50c28ee3933e | 9 | public static List<String> getClassNamesFromPackage(String packageName, ClassLoader classLoader) throws IOException {
URL packageURL;
ArrayList<String> names = new ArrayList<>();
packageName = packageName.replace(".", "/");
packageURL = classLoader.getResource(packageName);
if(... |
c40a489d-1331-43d1-bfa2-80f01b6dba36 | 4 | public void unreadFrame() throws BitstreamException
{
if (wordpointer==-1 && bitindex==-1 && (framesize>0))
{
try
{
source.unread(frame_bytes, 0, framesize);
}
catch (IOException ex)
{
throw newBitstreamException(STREAM_ERROR);
}
}
} |
1503f49a-0700-4948-93bb-29f848bb48d2 | 7 | private void jButtonParcourirINActionPerformed(
final java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
final String mss = "Bouton Parcourir : "
+ "action interdite car";
final int nb = 300;
switch (etat) {
case INIT_JSON_XML:
selct = new SelecteurDeFichier(jsonFilter, this);
... |
84e7eb0b-0a86-4678-bc95-234e784747fe | 4 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final User other = (User) obj;
if (!Objects.equals(this.username, other.username)) {
return false;
... |
5ed530d9-d979-401d-b7b5-37023d3d51c6 | 7 | public static void lagKompaktGrid(Container parent, int rows, int cols, int initialX, int initialY, int xPad, int yPad) {
SpringLayout layout;
try {
layout = (SpringLayout) parent.getLayout();
} catch (ClassCastException exc) {
System.err.println("The first argument to la... |
929fc1a1-0424-4c5e-90b5-5bcb1ebcf3a5 | 3 | private static double[][] generateIdentity(int l){
double[][] T = new double[l][l];
for(int i = 0; i<l; i++){
for(int j = 0; j<l; j++){
if(i == j)
T[i][j] = 1;
else
T[i][j] = 0;
}
}
return T;
} //end generateIdentity |
d533a39d-4100-4fc5-97b4-9cc50a90f3af | 4 | public static void copyTo(File file, String filePath)
{
System.out.println("Copying file "+file.getAbsolutePath()+ " to "+filePath);
//System.exit(0);
try
{
int b;
inputStream = new FileInputStream(file);
outputStream = new FileOutputStream(filePa... |
f5168bf6-1081-405f-a127-f74a4aaf4e91 | 6 | public static double findAccuracy(Set<RepairedCell> truth, Set<RepairedCell> found){
if(found.size()!=0){
HashMap<Integer,HashSet<String>> truthMap = new HashMap<Integer,HashSet<String>>();
for(RepairedCell cell:truth){
HashSet<String> columnIds = null;
if(truthMap.get(cell.getRowId())==null){
colu... |
588940ed-c97f-4a57-b10b-8cc0b322a19f | 1 | private void testReferrers(String[] referrerStrings, Application expectedApplication) {
for (String agentString : referrerStrings) {
assertEquals(expectedApplication, Application.parseReferrerString(agentString));
}
} |
5d7e97a5-e781-4ae0-93dc-c7ac21e9b38b | 4 | public boolean equalsExpr(final Expr other) {
return (other != null) && (other instanceof ArithExpr)
&& (((ArithExpr) other).operation == operation)
&& ((ArithExpr) other).left.equalsExpr(left)
&& ((ArithExpr) other).right.equalsExpr(right);
} |
440fa993-fff8-4f6e-8f45-26d2d3b4efaa | 7 | @EventHandler
public void onClick(InventoryClickEvent event) {
if (event.getSlot() == 999)
event.getWhoClicked().closeInventory();
for (Inventory inv : ClashOfBlocks.getInstance().getInventoryManager().getInventories()) {
if (inv == null) break;
if (inv.isInventory(event.getInventory())) {
event.setCa... |
89acab1e-d4fa-4791-8270-0cc1bba2b9b7 | 1 | public void draw(Graphics2D g) {
for (Entity entity : entities) {
entity.draw(g);
}
super.draw(g);
} |
8674fefb-075d-4efd-8a0b-63073842be7e | 3 | public void create() throws IrodsException {
try {
JargonCollection parent = getParentCollection();
if (parent != null && !parent.exists()) {
parent.create();
}
conn.irodsFileSystem.mkdir(irodsFile, false);
} catch (JargonException ex) {
throw new IrodsException(ex);
}
} |
c5212a87-0768-4865-8817-e9f50c98d21c | 5 | @Override
public String send(String msg) throws ConnectionException {
FileReader fileReader = null;
//DatagramSocket socket = null;
Socket socket = null;
String output = null;
try {
String serverString = "";
String portString = "";
fileRead... |
1f0f1059-bae5-4e41-80f6-60b5fe5949aa | 4 | public static String readPassword(String pPrompt){
if(System.console() == null) {
//Hack for JDev debugging as it doesn't provide a console when running
if("DEV".equals(ScriptRunnerVersion.getVersionNumber())){
return readArg(pPrompt, false);
}
throw new ExFatalError("Could not locat... |
a4d0a15a-21f9-4732-82cd-a7746958f00c | 3 | public final void setMaxMeasuredValueDecimals(final int MAX_MEASURED_VALUE_DECIMALS) {
final int DECIMALS = MAX_MEASURED_VALUE_DECIMALS > 5 ? 5 : (MAX_MEASURED_VALUE_DECIMALS < 0 ? 0 : MAX_MEASURED_VALUE_DECIMALS);
if (null == maxMeasuredValueDecimals) {
_maxMeasuredValueDecimals = MAX_MEASU... |
ba58ac3c-315f-42be-b891-91ed4f5c1206 | 1 | public String getResultRunCompiledPHPCode(String fileSource)
{
if(cekAnnotation(fileSource))
{
return getFilteredPHPSource(fileSource) + " $ob = new " + getClassName(getFilteredPHPSource(fileSource)) + ";$ob -> "
+ getMethodName(getAnnotationClientMethod(fileSource));... |
d5a53539-43ae-4366-b6e4-831826238cbe | 2 | public boolean matches( Class<?> clazz )
{
return Modifier.isInterface( clazz.getModifiers() ) && !clazz.isAnnotation();
} |
3366c336-e1fb-43ce-a14c-0e147710f1ff | 6 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
User other = (User) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
retur... |
82dc78a7-0e4e-4596-93eb-0facaa9c8868 | 0 | public void mouseExited(MouseEvent e) {
//throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
} |
e3f76a20-096d-4e0c-bcca-6a890581acaa | 9 | public void distributeWithOrders() {
logger.info("Starting distributing...");
do {
// 1. get all orders from the container
List<Order> orderList = null;
try {
orderList = sharedWorkspace.getUnfinishedOrders();
// add marked "order" to the end of the order list
// if the for loop reaches this "o... |
d4bacfdf-27c8-4095-a134-be8b7db1cc65 | 7 | public void init() {
System.out.println("###### Applet init() #######");
started = false;
stopping = false;
currentDisk = null;
if (cpu == null) {
SIDMixer.DL_BUFFER_SIZE = 16384;
System.out.println("starting CPU");
cpu = new CPU(imon, getCodeBase().toString(), new SELoader());
... |
075fd622-a6ca-4007-afb2-b3759a321891 | 0 | public long duration() {
return (now()-startTime);
} |
701b9ce2-298b-4458-94b9-4ba968e3ab14 | 2 | public void collides(GameObject source, Collection<GameObject> objects){
for(GameObject object : objects){
if(source.collidesWith(object)){
gameEventListener.handleGameEvent(new CollisionEvent(this, Type.COLLISION, source, object));
}
}
} |
7a3c4316-7421-45ce-8c5d-0f03a71ee36f | 4 | public void createNodesForThisGraph()
{
int paperListLength = Array.getLength(paperList);
System.out.println("NODES CREATION,paperlist hossza: " + paperListLength);
//here we set the attributes for each node from the paperlist
for (int i = 0;i < 3;i++)
{
try
... |
e17a56c5-3d5f-4643-bc97-a0be798cff5d | 5 | private void generateAllDeploymentAlternatives() {
if (project.getDeploymentAlternatives().size() == 0) {
List<HardwareSet> sequenceHardwareSets = new LinkedList<>();
int hardwarePossibilities[] = new int[project.getComponents().size()];
int repetitions[] = new int[project.getComponents().size()];
int k =... |
c6e62ef5-39d6-4cd8-97c4-6019ca856f7d | 1 | public static void main(String[] args)
{
try
{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e)
{
e.printStackTra... |
c3ee46c0-903f-4b17-b65d-424b2e2629d1 | 9 | public static void checkQuizTakingAchievements(String username, int percent, int quizId, int elapsed) {
List<Score> quizzes = UserInfo.getHistory(username);
List<Integer> achs = UserInfo.getAchievements(username);
List<Score> top = UserInfo.getTopTen(quizId);
if (quizzes.size() >= QUIZ_MACHINE_VALUE && !achs.co... |
ffb023d3-bc45-443f-92f5-917d1f7700c7 | 0 | public void removeFileDownloadItem(FileDownloadItem item){
items.remove(item);
} |
800ef023-9f5c-4410-bf01-8a6ec36546a2 | 7 | public void combineFilterSummaries(String folder){
File Folder = new File(folder);
Map<Integer,File> M = new HashMap<>();
General g = new General();
ArrayList<Integer> thresholds = new ArrayList<>();
// first create a map of all files and thresholds found in this folder
... |
7da991ee-9c45-4e49-94c7-6672fda38f25 | 3 | public Object getValueAt(int row, int col) {
if (data == null) {
return null;
}
if (row < 0 || col < 0) {
return null;
}
return data[row][col];
} |
0f0cfb89-53da-47d3-86fe-ead0c2d1c908 | 7 | public static void main(String[] args) {
int[] rat = { 2, 1, 3 };
int[] avg = { 1, 2, 3 };
double[][] cov = new double[3][3];
int row = 0;
for (int i = 0; i < 3; i++) {
int col = 0;
for (int j = 0; j < 3; j++) {
if (i <= j) {
double numerator = 0.0;
System.out.println("numerator = (" + r... |
a1063d52-8a1e-430d-8be7-7e1f01a7e683 | 8 | public int canCompleteCircuit(int[] gas, int[] cost) {
int i = 0,len = gas.length;
if(gas == null || cost == null || len < 0)
return -1;
for(i = 0; i< len; i++){
int k = i;
int myGas = 0;
int j = 0;
for(;j < len;j++)
{
//from i to i;
myGas += gas[k];
if(myGas < cost[k])
break;
... |
90050d2f-f894-4bbb-b432-5e7fbc50caff | 0 | private ClosureTaker() {
} |
700dbbaf-ef26-4c90-ae10-67b294858366 | 2 | public void addProperty() {
DatastoreService datastore = DatastoreServiceFactory
.getDatastoreService();
Entity past_string = null;
try {
Key key = KeyFactory.createKey("past_string", "onlyOne");
past_string = datastore.get(key);
} catch (Throwable t) {
}
past_string.setProperty("past_update", new... |
6fbd2f8f-ccd9-4211-a87d-9afa06e42244 | 0 | protected void onSetChannelLimit(String channel, String sourceNick, String sourceLogin, String sourceHostname, int limit) {} |
aac191df-01e4-4267-9dde-dff81fed2e05 | 0 | public LoadFileProtocolClassCommand(String name) {
super(name);
} |
e43b87e1-15e8-454d-b03e-397a5aa0d829 | 1 | public void writeLine(String line) {
try {
BufferedWriter CSVFile = new BufferedWriter(new FileWriter(fileName));
CSVFile.write(line);
CSVFile.newLine();
CSVFile.close();
} catch (IOException ex) {
System.out.println(ex);
}
... |
035bdda1-9734-42d3-ace0-f1844ca85a4e | 4 | private Path handleImage(Path img, int resnumber) {
assert FileUtil.control(img) && (resnumber > 0);
Path ret = null;
if (FileUtil.control(img)) {
try {
ret = Bitmap.convertToBMP(img, this.imageDir, "" + resnumber);
if (!img.getFileName().toString().e... |
046d0182-e831-4c7c-b74c-963ba9756755 | 6 | private String readField(Field field) {
try {
Class<?> type = field.getType();
if (type.equals(int.class))
return String.valueOf(field.getInt(this));
else if (type.equals(boolean.class))
return String.valueOf(field.getBoolean(this));
else if (type.equals(double.class))
return String.valueOf(... |
b538566b-b9b2-41fb-be22-0fe92fd27339 | 8 | public final void quant(final float[] lsp,
final float[] qlsp,
final int order,
final Bits bits)
{
int i;
float tmp1, tmp2;
int id;
float[] quant_weight = new float[MAX_LSP_SIZE];
for (i = 0; i < order; i++)
qlsp[... |
bf9481ba-a199-4042-9a82-24ea862c419f | 8 | public void check() {
RunIterator itr = iterator();
int[] curr = itr.hasNext() ? itr.next() : null;
if (curr == null)
return;
long sum = (long)curr[0];
while (itr.hasNext()) {
int[] next = itr.next();
if (curr[0] == next[0] && curr[1] == next[1] && curr[2] == next[2]
&& curr[3] == next[3]) {
... |
4622ca01-a4ed-42bc-ae46-c96720d39c28 | 9 | private void processEvents() {
while (true) {
WatchKey key;
try {
key = watcher.take();
} catch (InterruptedException x) {
logger.debug("'WatchDir' thread was interrupted!");
return;
}
Path dir = keys.get(key);
if (dir == null) {
System.err.println("WatchKey not recognized!!");
... |
0baf673b-f801-48ef-a2d8-14f8bbb11376 | 0 | public double elapsedTime() {
long now = System.currentTimeMillis();
return (now - start) / 1000.0;
} |
d4ce5d58-6019-4fce-be52-b113f389a217 | 1 | @Override
public int getSlotSpacingY() {
return isNotPlayerInventory() ? 0 : 18;
} |
b2d0f820-7a98-4e47-b17b-ef37054253c3 | 5 | public static String getJavaMethodParameter(Method var0) {
Class[] var1 = var0.getParameterTypes();
Class[] var2 = var0.getExceptionTypes();
String var3 = "";
String var4 = "";
for (int len = 0; len < var1.length; ++len) {
var3 += var1[len].getName() + (len == var1.le... |
56e205c2-969b-447f-9aa5-3319c9d4809e | 5 | public static Map<Integer, Map<String, Object>> decodeUserPositions() {
Map<Integer, Map<String, Object>> ComputationResponse = new HashMap<Integer, Map<String, Object>>();
String JSONRaw = JSONRawMain[1];
if(JSONRaw.trim().equals("false")){
Util.logC("Warning: There are no users currently online");
ret... |
3fc12ba9-d204-436d-ab5f-a7af1c4e7efe | 6 | @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof Color)) {
return false;
}
Color other = (Color) obj;
if (a != other.a) {
return false;
}
if (b != other.b) {
return false;
}
if (g != other.g) {... |
77168941-f227-46a4-959a-551cc0ec8e51 | 8 | @Override
public String toString() {
StringBuilder s = new StringBuilder("---------------\n");
s.append("Players ("+players.size()+"):\n");
for (Player player : players) {
s.append(player.getNumber()+" "+player.getNickname()+": "+player.getPoints()+"\n");
}
s.append("\nGame state: ready "+isReady()+" run... |
490bdddc-0621-40ac-a49c-6e8e21eb09dd | 0 | public static List<Appointment> findByMonth(long uid, long month)
throws SQLException {
List<Appointment> aAppt = new ArrayList<Appointment>();
long month2 =
DateUtil.getStartOfMonth(month + 32 * DateUtil.DAY_LENGTH);
long endOfMonth = month2 - DateUtil.DAY_LENGTH;
// once
aAppt.addAll(Appointment.fin... |
2673dcf1-e0ec-49d9-8549-3a62496741b0 | 4 | public static float dayValue(World world) {
final float time = worldTime(world) ;
if (time <= morning_end ) return (time + HF) / fade ;
if (time <= evening_start) return 1 ;
if (time <= evening_end ) return (evening_end - time) / fade ;
if (time <= morning_start) return 0 ;
else ... |
b9f2415c-f62a-4319-b021-5c5f6f4e8768 | 1 | private JLabel getJLabel1() {
if (jLabel1 == null) {
jLabel1 = new JLabel();
jLabel1.setText("EXECUTE SUCCESSFUL!");
}
return jLabel1;
} |
6cb0181a-6f5e-42d9-b3e3-4bfdd6e28d73 | 1 | public static Color getBanding(boolean primary) {
return primary ? Color.WHITE : new Color(232, 255, 232);
} |
fa2ba293-c109-49d1-ad32-d18ad62e4423 | 1 | @Test
public void out_a_car_when_it_parking_second_park() {
for(int i = 0; i < 5; i ++) {
parkBoy.in(new Car(String.valueOf(i)));
}
Car car = new Car();
Ticket ticket = parkBoy.in(car);
Assert.assertEquals(parkBoy.getParkSize(1), this.SECOND_PARK_SIZE - 1);
... |
eaf77c1f-1221-46a8-acec-0585f739ce97 | 2 | public boolean checkObjectiveType(UQuest plugin, String type) {
for(Objective objective : this.objectives){
if(objective.getType() == type)
return true;
}
return false;
} |
3c1c7c90-96ef-46e3-b2a8-de43c974e392 | 9 | public static void menu_Eventos() {
do {
System.out.println("********************************************");
System.out.println("* Menu Eventos *");
System.out.println("* *");
System.out.println(... |
c03a0310-407f-4770-a7fd-5a82f7ecea2a | 8 | protected void printTopWord(int k, String topWordFile) {
System.out.println("TopWord FilePath:" + topWordFile);
Arrays.fill(m_sstat, 0);
for (_Doc d : m_trainSet) {
for (int i = 0; i < number_of_topics; i++)
m_sstat[i] += m_logSpace ? Math.exp(d.m_topics[i])
: d.m_topics[i];
}
Utils.L1Normalizat... |
63b5ae8b-c67e-441e-9bbb-b32aac7401db | 9 | private void drawMap(GameMap map) throws GLException {
gl.glPushMatrix();
//gl.glTranslatef(-map.getHeight() / 2, -map.getWidth() / 2, 0.0f);
if (vViewChange == null) {
vViewChange = Vector.O;
gs.cnt = vViewChange;
}
for (int i = 0; i < map.getHeight(); i+... |
52e6cc63-63ca-4d3c-b7bc-d65259a01780 | 0 | public static GeneralValidator isLessEqualsToThan() {
return LESS_THAN_EQUALS_TO_VALIDATOR;
} |
fdbc0be5-4168-468f-8fd8-eddff5ad2a93 | 9 | public Location getAdjacentLocation(int direction) {
// reduce mod 360 and round to closest multiple of 45
int adjustedDirection = (direction + HALF_RIGHT / 2) % FULL_CIRCLE;
if (adjustedDirection < 0)
adjustedDirection += FULL_CIRCLE;
adjustedDirection = (adjustedDirection / HALF_RIGHT) * HALF_RIGHT;
int... |
19dca397-7cf7-4ac4-ae3d-fdf50b49e488 | 4 | public boolean contains(Point point) {
if((point.x > x && point.x < x + sprite.getWidth()) && (point.y > y && point.y < y + sprite.getHeight()))
return true;
return false;
} |
ad0d94d1-8c12-4a3e-b253-a33cf90c3428 | 4 | public void save() {
variable = "@Variable:" + nameField.getText() + ":";
if(stringField.isEnabled()) {
variable += stringField.getText();
} else if(intSpinner.isEnabled()) {
variable += getAdjustType() + ":" + intSpinner.getValue();
} else if(booleanBox.isEnabled()) {
variable += booleanBox.isSelected... |
fa0bf515-141b-4908-b819-689120942a16 | 1 | public void logToFile(String msg){
try {
BufferedWriter writer = new BufferedWriter(new FileWriter(new File(getDataFolder(),"BlacklistCheck.log"),true));
writer.write(msg);
writer.newLine();
writer.close();
}catch (java.io.IOException e) {
logMessage("Unable to write to BlacklistCheck.log: "+e.getMe... |
96978a52-e5c6-4c18-a655-8ee7d0ad4e72 | 8 | @Override
public boolean onCommand(final CommandSender sender, final Command cmd, final String label, final String[] args) {
String subCmd = null;
final String[] newArgs = new String[Constants.GENERAL_ARRAY_SIZE];
ProcessState state = null;
if ( args.length > 1 ) {
subCmd = args[0];
for (int i = 1;... |
571da258-7928-4341-b59e-6c249feb306c | 7 | public void testConstructor_int_int_int_int_int_int_int_DateTimeZone() throws Throwable {
DateTime test = new DateTime(2002, 6, 9, 2, 0, 0, 0, PARIS); // +02:00
assertEquals(ISOChronology.getInstance(PARIS), test.getChronology());
assertEquals(TEST_TIME_NOW, test.getMillis());
try {
... |
462a462b-62bd-4c9d-b229-04638bc62c01 | 2 | @Override
public void actionPerformed(ActionEvent ae) {
Object source = ae.getSource();
if (source == classements.getRetour() ){
this.setVisible(false);
Fenetre topFrame = (Fenetre) SwingUtilities.getWindowAncestor(this);
if (topFrame.getJeu() == null)
... |
c62cc184-aea0-469f-aa88-c05d9c9a619e | 0 | public String getNewValue(){
return newValue.getText();
} |
ec6477de-d608-45b1-b800-176d53c07aaf | 8 | private void processAttack(){
if(!(this.friendVictory)){
if (!(this.enemyVictory)){
if (jList1.getSelectedIndex() != -1){
Attack friendlyAttack = this.character.getAttacks().get(jList1.getSelectedIndex());
int friendlyDamage = this.character.getAttacks().get(jList1.ge... |
1bd829b4-9c32-4c47-a860-3525fa4a04b9 | 0 | @Override
public int getHeight() { return height; } |
bdcee0b0-04d1-4cdc-a8d2-b00ee503bc51 | 4 | public void readFromNBT(NBTTagCompound nbtTagCompound) {
super.readFromNBT(nbtTagCompound);
if (nbtTagCompound.hasKey("teDirection")) {
this.orientation = ForgeDirection.getOrientation(nbtTagCompound
.getByte("teDirection"));
}
if (nbtTagCompound.hasKey("teState")) {
this.state = nbtTagCompound.get... |
4dd62dca-ca6d-4151-99ca-b283d1bd448c | 7 | private void setLocationWithTile(Tile tile, int position) {
int xLocation, yLocation;
if ( position == 1 || position == 4) {
xLocation = tile.getX()+(position == 1?Tile.IMG_WIDTH:-Tile.IMG_WIDTH);
yLocation = tile.getY();
} else {
xLocation = tile.getX()+(position == 0 || position == 2?Tile.IMG_WIDTH/2:-... |
391c68e0-bf20-40e1-be54-cafea6760ab1 | 1 | public void ensureCapacity(int minimumCapacity)
{
int[ ] biggerArray;
if (data.length < minimumCapacity)
{
biggerArray = new int[minimumCapacity];
System.arraycopy(data, 0, biggerArray, 0, manyItems);
data = biggerArray;
}
} |
0ebe1330-3d89-4355-8c71-9cff72c0b87f | 2 | @Test
public void getChildrenIngredients_should_say_chicken_is_poultry(){
List<Ingredient> children = rep.getChildrenIngredients(poultry);
for(Ingredient ingredient : children){
if(ingredient.getName().equalsIgnoreCase("chicken")){
return;
}
}
Assert.fail();
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.