method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
4772d511-8c56-4c0f-9326-c6329cdc08c3 | 6 | private void readPartDec(StructureFile structure, Element element) throws SyntaxException {
DOMHelper.checkedAllAttributes(element, new String[] { "name", "center", "size" });
String partName = element.getAttribute("name");
Vector3 originCoord = ValueHelper.vectorFromString(element.getAttribute("center"));
Dime... |
e7d5cc0c-bf88-4606-a0f5-296957abce78 | 2 | private String nodeString(IntervalNode node, int level) {
if (node == null) return "";
StringBuffer sb = new StringBuffer();
for (int i = 0; i < level; i++)
sb.append("\t");
sb.append(node + "\n");
sb.append(nodeString(node.getLeft(), level + 1));
sb.append(nodeString(node.getRight(), level + 1));
ret... |
77efaa16-cd0a-4f46-9f4e-14f106a0121e | 6 | @Override
public void mutate() {
Population offspring = new Population();
for (int i = 0; i < population.getSize(); i += 2){
HiffIndividual ancestorOne = getAncestor();
HiffIndividual ancestorTwo = getAncestor();
int a;
int b;
synchronized ... |
c6644147-3bcf-4277-adba-3ce36802b246 | 0 | @Test
public void singleDeleteSizeAndContent() {
a.insert(v);
a.delete(v);
assertNull(a.get(0));
assertEquals(0, a.getSize());
} |
20670b0a-b13c-49f9-b95c-6d6970126cae | 6 | private boolean filter(long a, long b) {
boolean x = a >= 0;
boolean y = b >= 0;
if(x && y) {
return a < b;
}
if(!x && y) {
return a > b;
}
if(x && !y) {
return a + b < 0;
}
... |
ced6be4e-cd30-4f74-80ae-935be109e549 | 1 | public void printlnSalidas(){
for(Nodo<Rama_Hoja> iterador = _salidasDelArbol.getHead(); iterador != null; iterador = iterador.getSiguiente()){
System.out.println(iterador.getDato().getIdentificador());
}
} |
8ebdf9ce-fa9f-4500-be37-da4800cd2bf4 | 5 | protected void actionPerformed(GuiButton var1) {
if(var1.enabled) {
if(var1.id == 0) {
this.mc.displayGuiScreen(this.parentGui);
} else if(var1.id == 1) {
this.selectedSlot = this.slotGeneral;
} else if(var1.id == 3) {
this.selectedSlot = this.slotIte... |
505918f7-5f81-4392-b210-1a53123309f0 | 4 | public void connect(){
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/ftp?characterEncoding=latin2","root","");
}
catch(ClassNotFoundException e){
System.out.println("ClassNorFo... |
9f8d66db-d451-4b98-b788-68122a80829e | 7 | private void verifica(int numOperatori,int numCasseFaiDaTe,double paramArrivi,
double paramOperatore,double paramFaiDaTe,double tempoSimulazione, int numProveRipetute) throws LimiteCasse,LimiteValori{
if(numOperatori>23||numCasseFaiDaTe>11){
throw new LimiteCasse();
}
... |
3c1a2f68-c460-430b-8b56-f9567ddeeef8 | 3 | @Override
protected void _processWalks(WalkArray walkArray, int[] atVertices) {
int[] walks = ((IntWalkArray)walkArray).getArray();
long t1 = System.currentTimeMillis();
for(int i=0; i < walks.length; i++) {
int w = walks[i];
int atVertex = atVertices[i];
... |
d280197e-e59f-4b08-91db-78e54e0a213d | 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... |
6b44d7a2-81bc-4768-80c0-802c7eafd56f | 1 | private void createMainPanel() {
userList = new JList<>(usersModel);
userList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
userList.setSelectedIndex(0);
userList.setLayoutOrientation(JList.VERTICAL);
userList.setSelectionBackground( new Color(102, 153, 255) );
u... |
3b558553-94be-46a0-83ad-5a02f0ce2d92 | 1 | public Set<BankAccount> getReplacingAccounts(BiFunction<BigInteger,BigInteger,BankAccount> generator) {
Set<BankAccount> result = new HashSet<>();
for (BankAccount account: accounts)
result.add(generator.apply(account.getBalance().add(BigInteger.TEN),account.getCreditLimit()));
retur... |
ec74b097-ea9c-4633-802a-61ba4500eb5b | 8 | int matchbalance(int soff, int poff) {
final int plen = p.length();
if (poff == plen || poff + 1 == plen) {
error("unbalanced pattern");
}
final int slen = s.length();
if (soff >= slen)
return -1;
final int b = p.luaByte(poff);
if (s.luaByte(soff) != b)
return -1;
final int e = p.lua... |
b5254429-3bb4-4e7f-9497-640654e90b2b | 6 | private <T> Method findMethod(T object, String method,
Class<?>[] parameters) {
Method[] allMethods = findAllMethods(object.getClass());
ArrayList<Method> allNamed = new ArrayList<Method>();
// make a list of all methods with the given name
for (Method elt : allMethods)
if (elt.getName().equals(method))... |
761178a6-2059-4017-a409-a3e038b4f8e4 | 3 | private static Vertex create(double x, double y) {
if (Double.isNaN(x) || Double.isNaN(y)) {
return VERTEX_AT_INFINITY;
}
if (_pool.size() > 0) {
return _pool.pop().init(x, y);
} else {
return new Vertex(x, y);
}
} |
a565487d-9950-46ac-a186-adfc6dfad7fe | 0 | public File getOldFile() {
return oldFile;
} |
24fd1447-60fd-4e75-b0c2-d2eced6e95c6 | 3 | private void drawBricks() {
byte[][] board = game.getBoard();
for (int r = 0; r < row - 1; r++) {
for (int c = 0; c < col - 1; c++) {
if (board[r][c] != 0) {
byte type = board[r][c];
typeColor(type);
g2.fillRect(c * square + square + 1, r * square + square
+ 1, square - 1, square - 1);... |
7c24d9d0-b284-4a4a-b34a-487e0ef73199 | 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... |
df69aedc-41a9-4c03-a447-414849543cee | 4 | @Override
public void run() {
if (bots.isEmpty()) {
throw new IllegalStateException("At least one bot is necessary");
}
while (running()) {
Bot b = bots.poll();
try {
lastMessage = b.getNextMessage(lastMessage).trim();
... |
874755fd-3735-461e-9284-4323ccfedb70 | 1 | public void visitTableSwitchInsn(
final int min,
final int max,
final Label dflt,
final Label[] labels)
{
mv.visitTableSwitchInsn(min, max, dflt, labels);
if (constructor) {
popValue();
addBranches(dflt, labels);
}
} |
fe9a62f7-0961-471a-93fa-0d17fafbede4 | 2 | @Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + ((dir == null) ? 0 : dir.hashCode());
result = prime * result + ((hexLoc == null) ? 0 : hexLoc.hashCode());
return result;
} |
2d7c3581-49b3-4b1e-95c0-77e347205b59 | 2 | protected void update(final Object arg, final int n) {
if (arg instanceof Throwable) {
((Throwable) arg).printStackTrace();
} else {
if (n % 100 == 0) {
System.err.println(n + " " + arg);
}
}
} |
bcdbe101-3176-4f14-b1a7-748931488f85 | 5 | public synchronized long getEditDelayMillis() {
removeExpiredReversions();
if (currentDelayCached)
return currentDelayMillis;
else {
long result = MAX_DELAY_MILLIS;
if (!recentReversionDelaysMillis.isEmpty()) {
long reversionDelayTotal = 0L;
int n = 0;
for (Long l : recentReversio... |
e8e31287-af85-40b7-98ce-d661d7279f8a | 4 | protected void insertHandled(Handled h, int index)
{
// Handled must be of the supported class
if (!getSupportedClass().isInstance(h))
return;
if (h != null && !this.handleds.contains(h))
{
// Removes all of the handleds after the index to another list
List<Handled> sublist = this.handleds.subList(... |
52df6dab-de38-4322-8e3d-081e654516d3 | 0 | public void newNarration()
{
comboBoxNarration.removeAllItems();
comboBoxNarration.setModel(new DefaultComboBoxModel(listNarration.toArray()));
} |
5a6a2d10-b87b-4684-b29c-d8ea7eee70a7 | 8 | @Override
protected void checkingNorms()
{
for ( Action action : getAllActions().values() )
action.setNormType(null);
if( makeTransformNorms == true )
{
transformNorms();
for( Norm norm : equivalentNorms.values() )
{
getPlayer().addRestrictNorm(norm.getName(), norm);
Action action = norm.... |
6d317325-9e76-4ce8-89d2-821971e35ddb | 8 | public static void computePsz()
{
for(int i = 0; i < DataInfo.numItems; i++)
{
int numrate = DataInfo.itemInfo[i].length;
double[] temp1 = new double[DataInfo.hidVariables];
double[] temp2 = new double[DataInfo.hidVariables];
double[] temp3 = new double[DataInfo.hidVariables];
for(int k = 0; k <... |
cfe95c00-01ae-4b8b-b666-dcc5b301d25f | 9 | @Override
public void action()
{
Agent ag = getAgent();
if( ag instanceof ReflexAgent )
{
ReflexAgent ra = (ReflexAgent)ag;
Norm norm = ra.containsNorm(this, NormType.OBLIGATION);
if( norm != null )
{
setNormType(NormType.OBLIGATION);
execute();
if( !isCyclic )
done = true;
... |
a66f6668-f427-4799-9c96-e6d1db7257b2 | 9 | public static void writeCollection(BusinessObject businessObject, File parentFolder, int depth){
String businessObjectName = businessObject.getName();
String businessObjectType = businessObject.getBusinessObjectType();
parentFolder.mkdirs();
File childFolder = null;
try{
... |
4ab37762-206b-44b9-9ffc-5d9afc587d08 | 7 | @Override
public SchlegelCompound transformResultString() {
// splitting result string into two. One contains the points, the other
// the edges.
int numberOfPoints = 0;
String pointsString;
String edgesString;
String facesString = "";
try {
String[] pointsAndEdges = resultString.s... |
1f758fa2-bf93-4f2a-8757-5888ea1c63d7 | 2 | public void addItemToInventory(Item item) {
if (item == null)
throw new IllegalArgumentException("Item can't be null!");
if (inventory.size() >= 6)
throw new IllegalArgumentException("The inventory is already full!");
// Checken of item niet in inventory van andere speler reeds voorkomt?
inventory.add(... |
830b64b3-6b42-4b42-9caa-7f0898b34d7f | 0 | public String getCity() {
return city;
} |
c205268a-2407-4266-a04a-17336ab9a38b | 3 | @Override
public double []calcArray(double a1[], double []a2)
{
switch(op)
{
case '+':
return calcArrayAdd(a1,a2);
case '-':
return calcArraySub(a1,a2);
case '*':
return calcArrayMul(a1,a2);
default:
break;
}
return null;
} |
11f03087-5193-47b7-93cb-5a51344871ac | 4 | public boolean matchesSub(Identifier ident, String subident) {
String prefix = ident.getFullName();
if (prefix.length() > 0)
prefix += ".";
if (subident != null)
prefix += subident;
if (firstStar == -1 || firstStar >= prefix.length())
return wildcard.startsWith(prefix);
return prefix.startsWith(wildc... |
9c8bbcf6-9c3e-449e-8b4c-d95b985e535d | 4 | public void actionPerformed(ActionEvent e)
{
for(int i = 0; i < Main.list.size(); i++)
{
//Main.list.get(i)
tempBall = Main.list.get(i);
if(tempBall.getStatic() == false)
{
if((tempBall.getVectorX() / Math.abs(tempBall.getVectorX())) * Math.abs(tempBall.getVectorX() - Ball.FRICTION) == 0)
... |
317df51a-023c-4991-b676-6abe6ce6a9a9 | 0 | Marker(double lat, double lon)
{
idTrigger++;
id=idTrigger;
latitude = lat;
longtitude = lon;
} |
9f12729a-59c6-4738-a280-3498d890c0ba | 8 | private static void diffImages(BufferedImage goodImage,
PixImage studentPixImage) {
BufferedImage studentImage = ImageUtils
.pixImage2buffer(studentPixImage);
int diffCount = 0;
System.out.println("The difference is:");
if (studentImage.getWidth() != goodImage.getWidth()) {
System.out.println("The wid... |
2aaac08c-6d7f-4929-b2b8-c9139d007f8a | 8 | private void initDataSource(Configuration configuration) throws TorqueException {
log.debug("Starting initDataSource");
try {
Object dataSource = null;
Configuration c = configuration.subset(DATASOURCE_KEY);
if (c != null) {
for (Iterator i = c.getKeys(); i.hasNext();) {
Str... |
17b11439-467e-454e-8334-d4b73ec94414 | 3 | private Shape mLineStringShapeParser(Shape shape){
// Anadimos todos los nodos
Coordinate[] coor = shape.getCoordenadas(0);
for (int x = 0; x < coor.length; x++){
List<String> l = new ArrayList<String>();
l.add(shape.getShapeId());
shape.addNode(0,utils.generateNodeId(shape.getCodigoMasa(), coor[x], nu... |
a5646ab2-698e-4b29-a629-06215eb59822 | 0 | public static void main(String[] args) {
Tank t1 = new Tank();
t1.level = 9;
System.out.println("1: t1.level: " + t1.level);
changeLevel(t1);
System.out.println("2: t1.level: " + t1.level);
} |
c5fce896-3328-402a-9fe1-7aa9dcabfdb8 | 4 | public void getNext(CAS aCAS) throws IOException, CollectionException {
JCas jcas;
try {
jcas = aCAS.getJCas();
} catch (CASException e) {
throw new CollectionException(e);
}
String doc;
// Removes everything in the order we added
doc = docsArray.remove(0);
jcas.setDocu... |
173be46c-2594-4989-9cb1-a5ba9c54783a | 0 | public void sayHello() {
System.out.println();
} |
dc4b6555-5375-41f8-995c-a5d72a5fcd3f | 5 | protected double generateAmplitude(double time, double amplitude) {
double amp = amplitude;
if (time < this.attackTime) {
//the rate of growth of amplitude per sample
double deltaAmp = this.amplitude/(getSampleRate()*this.attackTime);
return amplitude + deltaAmp;
} else if (time < this.attackTime + de... |
977928b8-0ee8-427a-8c33-31e71cae09ca | 9 | @Override
public RsObject process(RsPlan plan, String objectName) throws RsParsingException {
boolean level = false;
RsToken token;
System.out.println("Processing unimplemented statement "+keyword);
while(true){
token=reader.nextToken();
if(token.endOfFile())
... |
942211b2-33f7-4f56-968e-bfec46af63b4 | 2 | @Override
public int hashCode() {
int result = idThreads;
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (description != null ? description.hashCode() : 0);
return result;
} |
d3e85b02-685a-4280-a127-fec610b68d9a | 3 | public ArrayList<Course> getAllCoursesOn(Day day) {
ArrayList<Course> crs = new ArrayList<Course>();
for (Course c : COURSES) {
for (int i = 0; i <= c.getTimeDayHolder().getDays().size() - 1; i++) {
if (c.getTimeDayHolder().getDays().get(i).getString().equals(day.getString())) crs.add(c);
}
}
... |
962be5cf-9184-49a5-b9ba-399af7493edb | 5 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Coordinate2D other = (Coordinate2D) obj;
if (x != other.x)
return false;
if (y != other.y)
return false;
return true;
} |
a4071f2c-d256-4297-a68b-a0bbd140baa2 | 0 | public Dysk produkujemyDysk(){
return new DyskDlaPC();
} |
82380aaa-c2b7-45e8-b471-2284bfb6bc38 | 6 | private double setteBello(ICard card) {
// La carta che esamino è il sette bello
if (Rules.isSetteBello(card)) {
if (Rules.existPresa(card, table.cardsOnTable()))
;
return 1.0;
}
for (ICard tcard : table.cardsOnTable()) {
// Il settebello è tra le carte in gioco (sul tavolo)
if (Rules.isSetteBel... |
26eda144-f823-442d-a18b-d19946e12c47 | 0 | public BodyArmorSlots() {
this.armorItem = (BodyArmor) ItemFactory.create().buyItem(Constants.BASIC_BODY_ARMOR);
} |
31b80b5b-b7a7-44cd-95bb-f036a958f648 | 1 | @Override
public void update() {
if (Engine.getMainCamera().changed()){
recreateMesh();
}
} |
23d69ce0-1723-4de2-9dd4-269352b8c624 | 1 | public Homework_database_add() {
initComponents();
Member_details_add.readarray();
Member_details default1 = Member_details_array.getMembers()[Member_loggedin.getNumber()];
Subject.removeAllItems();
Subject.insertItemAt(default1.getSubject1(), 0);
Subj... |
5399c993-6bce-49da-93eb-2aa28992b184 | 6 | public int[] find(String name){
int mas = 0;
for (int i = 0; i < book.length; i++) {
if (book[i] != null && book[i].name.equals(name)) mas++;
}
int[] newmas = new int[mas];
for (int i = 0, j= 0; i < book.length; i++) {
if (book[i] != null && book[i].name.e... |
1aed76d8-9b5e-4748-8f76-f23f067ae717 | 7 | public static final double expectation(double ruleCount, int premiseCount,double[] midPoints, Hashtable priors){
double numerator = 0, denominator = 0;
for(int i = 0;i < midPoints.length; i++){
Double actualPrior = (Double)priors.get(new Double(midPoints[i]));
if(actualPrior != null){
if(actualPri... |
36cc1b87-c7d8-43ad-979b-d23bae417e9a | 1 | protected HttpClient createHttpClient(String aProxyUrl) throws MalformedURLException {
HttpClient client = super.createHttpClient();
// Set up the proxy. If there's anything wrong with the URL, throw the Exception.
HttpHost proxyHttpHost = null;
if (UtilityMethods.isValidString(aProxyUr... |
b061cd3c-3440-41ad-b5a6-2c4debfe6e08 | 7 | private ListNode merge(ListNode left, ListNode right) {
if (left == null) {
return right;
}
if (right == null) {
return left;
}
ListNode temp = new ListNode(0);
ListNode move = temp;
/**
* cause merge sort, every divided minimum... |
f4e7192c-0c85-4fdd-8d1e-d7e9ee895d17 | 4 | public static void loadDataFromFile(String fileName) {
Scanner previoustickers = null;
try {
previoustickers = new Scanner(new File(fileName));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String key = "";
String value = "";
while (previousticke... |
27d60555-49a6-4445-b077-027bf0095704 | 4 | public int hash(String item) {
final byte[] data = item.getBytes();
final int length = data.length;
final int seed = 0x9747b28c;
// 'm' and 'r' are mixing constants generated offline.
// They're not really 'magic', they just happen to work well.
final int m = 0x5bd1e995;
fi... |
c446d953-2b25-47c9-b6cf-7c9c6ecb790c | 9 | public static void main(String[] args) {
InputStream in;
OutputStream out;
leer_parametros(args);
if (archivo.equals("-"))
{
in = System.in;
out = System.out;
}
else
{
FileInputStream inFile;
FileOutputStream outFile;
try
{
inFile = new FileInputStream(archivo);
}
... |
783cde1d-82ef-4ea7-99cc-50241faddd4e | 2 | public String getSimpleCode(){
String str = "";
if(statement.toString()!=null)
str = statement.getSimpleCode();
if(statements.toString()!=null){
str += statements.getSimpleCode();
}
return str;
} |
babdee83-3fc4-4df7-ab0a-6cc234130461 | 1 | @Override
public boolean equals(Object o) {
if (!(o instanceof ID)) {
return false;
}
return name.equals(((ID) o).name);
} |
93b451dd-4647-44a9-8a4a-4d9c70ac3f89 | 1 | public boolean validateMessage(String message){
return (message.length() > 0 && !message.equals(lastMessage));
} |
67db877f-3781-4293-8d01-721b00f98613 | 8 | private static Constructor<?> getConstructor(Class<?> clazz) {
Constructor<?> res;
Constructor<?>[] constructors = clazz.getDeclaredConstructors();
if ( constructors.length == 0 ) {
throw new ITestInitializationException(clazz, null);
}
res = constructors[0];
... |
ceee14b3-5280-424b-8326-471c01b1bf65 | 8 | @Override
public double calculateJuliaWithoutPeriodicity(Complex pixel) {
iterations = 0;
Complex[] complex = new Complex[2];
complex[0] = new Complex(pixel);//z
complex[1] = new Complex(seed);//c
Complex zold = new Complex();
if(parser.foundS()) {
pars... |
caea7ac1-813e-4317-90ba-65fb324c9c67 | 0 | public String getOutput()
{
return myOutput;
} |
ae766113-d075-4504-8737-8b508a87d46d | 3 | public static void startRemote2D(Remote2DGame game) {
if(System.getProperty("os.name").toLowerCase().indexOf("mac") != -1)
{
System.setProperty("apple.laf.useScreenMenuBar", "true");
System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Remote2D");
System.setProperty("apple.awt.UIElemen... |
5390d8fc-679b-4cf1-a299-94650eb22f4a | 8 | private TableColumn<S, ?> getNextColumn(boolean forward) {
List<TableColumn<S, ?>> columns = new ArrayList<>();
for (TableColumn<S, ?> column : getTableView().getColumns()) {
columns.addAll(getLeaves(column));
}
//There is no other column that supports editing.
if (co... |
7568dd5d-b4d4-4815-aa0a-c3773c19e614 | 6 | private static void startCfResourceCalculator(String sampleDir, String sampleName, int size, int neighborSize,
boolean userBased, boolean resBased, boolean allResources, boolean bll, Features features) {
BookmarkReader reader = null;
String suffix = "cf_";
if (!userBased) {
suffix = "rescf_";
} else if (... |
5a34ccf7-1ede-491a-93b8-bfe67747e5e6 | 9 | public String nextToken() throws JSONException {
char c;
char q;
StringBuilder sb = new StringBuilder();
do {
c = next();
} while (Character.isWhitespace(c));
if (c == '"' || c == '\'') {
q = c;
for (;;) {
c = next();
... |
bacba450-ecb2-49c1-bab8-eb6fec6e6c51 | 1 | public void initPage(String req) {
search = req;
search.replaceAll(" ", "_");
try {
url = new URL(wiki+"/wiki/"+search);
} catch (MalformedURLException e) {}
} |
00afcfc1-cfcc-4e31-9d21-aa48b89f2e45 | 4 | public void actionPerformed(java.awt.event.ActionEvent evt) {
if (evt.getSource() == saveButton) {
RegistroLaboratorios.this.saveButtonActionPerformed(evt);
}
else if (evt.getSource() == limpiarButton) {
RegistroLaboratorios.this.limpiarButtonActionPer... |
49e2ac00-afd2-40f7-a114-a97e18bfe937 | 2 | @Override
public void Insertar(Object value) {
Session session = null;
try {
Liga liga = (Liga) value;
session = NewHibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
session.save(liga);
session.getTransaction().co... |
9b2e7f42-77d1-4882-95d5-68d7c8466d40 | 8 | public synchronized void dopaint (Graphics g)
{ if (ShowLast)
{ Top=V.size()-PageSize+1;
if (Top<0) Top=0;
ShowLast=false;
}
if (ListingBackground!=null) g.setColor(ListingBackground);
else g.setColor(getBackground());
g.fillRect(0,0,W,H);
g.setColor(Color.black);
int h=Leading+Ascent;
... |
922a3d13-fbe5-4bf2-8c30-7b30a4b8172a | 9 | public Updater(Plugin plugin, int id, File file, UpdateType type, boolean announce) {
this.plugin = plugin;
this.type = type;
this.announce = announce;
this.file = file;
this.id = id;
this.updateFolder = plugin.getServer().getUpdateFolder();
final File pluginFile... |
1d6dfb8b-c449-49d5-966b-71a1a312183f | 6 | private YiTouGS initGS(ResultSet rs) throws SQLException {
YiTouGS yiTouGS = new YiTouGS();
yiTouGS.setId(rs.getString("id") == null ? "" : rs.getString("id"));
yiTouGS.setName(rs.getString("name") == null ? "" : rs.getString("name"));
yiTouGS.setEnname(rs.getString("enname") == null ? "... |
1d7837f3-f60a-4a71-86c7-0bfff61eb743 | 7 | public static String pickupUniqueWords(CompositeText document) {
Set<String> words = new TreeSet<String>();
Iterator<?> iterator = document.createIterator();
while (iterator.hasNext()) {
TextComponent token = (TextComponent) iterator.next();
if (token.getName().equals(TextComponentName.TOKEN)) {
if (tok... |
68bcf114-6724-4b43-bb75-eccc262a71b8 | 7 | public static List<Interval> insert(List<Interval> intervals, Interval newInterval) {
intervals.add(0, newInterval);
int index = 0;
for (int i = 1; i < intervals.size(); i++) {
Interval idx = intervals.get(index);
Interval cur = intervals.get(i);
if (idx.end < cur.start) continue;
... |
838aedfc-466d-483f-8a42-b71fbc3206ab | 3 | public CSVExporterDialog(Dictionary dictionary) {
dic = dictionary;
exported = false;
setBounds(100, 100, 450, 300);
getContentPane().setLayout(new BorderLayout());
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel, BorderLayout.CENTER);
contentPanel.setLayout(ne... |
1c328af4-e4a2-46a1-81fb-7abc63dc061e | 5 | private void jTextField3KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField3KeyPressed
// TODO add your handling code here:
if(evt.getKeyCode()==10){
if(modo.equals("Baja")){
if(jTextField3.getText().equals(""))
JOptionPane.showMessageDia... |
630c5623-45dc-4216-aa64-ac300cf555a3 | 1 | public void movePlayerXNegative(int PlayerID)
{
if(checkNoPlayerBoundsCollisionNegative(PlayerID) == true) players.get(PlayerID).moveBatNegative();
} |
d4bd0258-29af-487d-9f3f-2e0fe4ea069c | 5 | @SuppressWarnings("unchecked")
@Override
public boolean equals(Object o) {
if (!(o instanceof BinaryTree)) {
return false;
}
if (o == this) {
return true;
}
BinaryTree<T> btr = (BinaryTree<T>) o;
if (size() != btr.size()) {
return false;
}
Iterator<Node<T>> it1 = iterator();
Iterator<Node<T... |
59b7cab7-1e8f-4142-8206-35dcfcf03e80 | 0 | public void setReferRequestWrappers(
List<RequestWrapper> referRequestWrappers) {
this.referRequestWrappers = referRequestWrappers;
} |
e6c2ae80-7cb0-4e98-8a78-0fc9166dda0c | 1 | public iXportSMS() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, URISyntaxException {
loadLib();
initialize();
bs = bm.getBackups();
for (Backup b : bs){
modelBackup.addElement(b.getName()+" ("+b.getDate()+")");
}
modelBackup.addElement("Custom sms dat... |
8f343e7d-3562-4fde-bbfb-0e4db128b652 | 7 | public ListNode deleteDuplicates(ListNode head) {
if( head == null || head.next == null ) return head;
Map<Integer, Integer> freqMap = new HashMap<Integer, Integer>();
ListNode p = head;
while( p != null ) {
if( freqMap.containsKey( p.val ) ) {
freqMap.put( p... |
4cdc3476-3260-4cd1-95de-3ea6bba52d24 | 4 | public Backtracking(int taille, boolean allSolution,Gestion g){
//lancement du compteur
start=System.currentTimeMillis();
plat=new Plateau(taille);
this.taille=taille;
this.allSolution=allSolution;
this.g=g;
listePolyo=new ArrayList<Polyominos>();
listeSolution=new HashSet<Plateau>();
//ajout... |
472fe190-5bb3-4e6c-92b9-0799eb6f1464 | 8 | public long doUpdate(Master master, UpdateRequest updateRequest) {
incrementAccessAndMaybeRecalibrate(master);
File f = updateRequest.getFile();
Location accessLoc = updateRequest.getLocation();
MasterMeta fm = master.map.get(f.getId());
boolean allSucceeded = true;
long maxDelay = -1;
Set<C... |
1d90264d-7eb6-4165-9237-7beeb1b781b9 | 3 | public static BLWorld get(World world){
if(world!=null){
for(BLWorld blworld:blworlds){
if(blworld.world.equals(world)){
return blworld;
}
}
}
return null;
} |
8a1ec13d-18f4-4d8e-aed0-bed788aece1d | 6 | @EventHandler
public void BlazeHeal(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.getBlazeConfig().getDouble("Blaze.Heal.DodgeCha... |
00fd74b9-121f-4c05-9878-6235b441391a | 8 | public void generate() {
this.elements = new ArrayList<Element>();
int size = this.cols * this.rows;
for (int i = 0; i < size; i++) {
Element element = null;
if (i <= this.rows || i % this.rows == 0 || (i + 1) % this.rows == 0 || size - this.rows < i) {
... |
7f060ebc-0f15-4599-8ac0-311d38cd82fc | 6 | private void updateStateDelete(List<Keyword> keywords, List<String> terms) {
//We should have come here by a keyword jump and the recipe shouldve been passed or set
if (keywords != null && !keywords.isEmpty()) {
for (Keyword kw : keywords) {
if (kw.getKeywordData().getType() == KeywordType.RECIPE) {
curr... |
1b779a9e-2060-4833-89b2-4bb53ad4d6c8 | 7 | private boolean invokeEvents(boolean valid)
{
E event = null;
// Take all events from the event queue and process them.
for (;;)
{
// Clear event, very important!
event = null;
// Enter blocking section with caution!
if (release.enter()) {
try {
event = eventQueue.poll();
}
f... |
342a17b0-f349-4c46-8956-3244cdb45c7e | 9 | public ECPoint decodePoint(byte[] encoded)
{
ECPoint p = null;
int expectedLength = (getFieldSize() + 7) / 8;
switch (encoded[0])
{
case 0x00: // infinity
{
if (encoded.length != 1)
{
throw new IllegalArgumentException("Incorre... |
f30f0bb8-0a9c-463a-b446-f14efa69f779 | 4 | public OutputNode parse() {
OutputNode outputNode = new OutputNode();
String ss;
while ( true ) {
ss = this.xp.getNextString();
if ( ss.equals("/Output")) {
return outputNode;
}
else if ( ss.equals("Name")) {
outputNode.setName(this.xp.getNextString());
this.xp.getNextString();
}
els... |
393498fb-aebf-4db3-ae90-947fcbbea061 | 0 | public Procesor produkujemyProcesor(){
return new ProcesorDlaLaptopa();
} |
8784be16-4944-426e-bf3a-64291c77fffb | 9 | public static String getSpell(String cnStr, boolean onlyFirstSpell) {
if (cnStr == null) {
return "";
}
char[] chars = cnStr.trim().toCharArray();
StringBuffer sb = new StringBuffer();
for (int i = 0, len = chars.length; i < len; i++) {
int ascii = getCnAscii(chars[i]);
if (ascii == 0){ //如果获取汉字的A... |
cd3384a1-094a-4c4e-8bf8-399fe963f847 | 2 | @Override
public void mark(int boardPosition, Cell[] cellBoard, int rows, int columns) throws IllegalMark {
//Find the row.
int boardPositionRow = boardPosition / columns ;
//Find the column.
int boardPositionColumn = boardPosition % columns;
if (boardPositi... |
8e577f79-bf72-4861-85bd-d22b6be58229 | 3 | public static PacketPlayOutEntityMetadata getMetadataPacket(DataWatcher watcher) {
PacketPlayOutEntityMetadata metaPacket = new PacketPlayOutEntityMetadata();
Field a = ReflectionUtil.getDeclaredField(metaPacket.getClass(), "a");
a.setAccessible(true);
try {
a.set(metaPacket... |
e7485f5e-d423-477c-9249-12aa2f0f9d71 | 3 | public void addRanges(int partId, PERangeList list) {
if (partId < 0 || partId >= rangesParts.length) {
throw new IndexOutOfBoundsException("Partition " +
partId + " does not exist");
}
if(rangesParts[partId] == null) {
rangesParts[partId] = new PERangeList();
}
rangesParts[partId].addAll(list);
... |
d972b8fc-0260-4a3d-be08-27aa64135a00 | 7 | private void handleRecordsBatch(Map<String, Map<String, Object>> primaryKeysHashMap)
throws SQLException, ConfigurationException, ScriptException, InterruptedException
{
for (Pair<String, Map<String, Object>> pair : nameValuesBuffer)
{
Map<String, Object> nameValues = pair.ge... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.