method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
cd04c22d-d740-4345-8bad-0069d9c2e8d5 | 4 | public void giveStick(Player player, String[] args, String p, String user) {
ItemStack[] hotBarInvent = player.getInventory().getContents();
ItemStack stickToGive = new ItemStack(Material.STICK);
List<String> stickLore = new ArrayList<String>();
stickLore.add("Bonk!");
ItemMeta s... |
a772ff7d-9f76-4131-8b50-024e28fb906f | 4 | private static boolean foundInfo(
final Vert3D orig,
final Vert3D axis,
final Vert3D corn
) {
//
// First, we establish (and normalise) the 'V' axis.
line.set(axis.x - orig.x, axis.y - orig.y) ;
if ((lineL = line.length()) <= 0) return false ;
line.x /= lineL ;
line.y /= lin... |
ed21c02f-f5ba-49e7-a05c-08ebf9e24571 | 9 | public void prolog(ASTNode n) {
if(n instanceof VarDeclList || n instanceof StmtList){
return;
}
//create a unique id for each node
String unique = "\"" + n.toString() +i+"\"";
try {
File file = null;
name = name.replace(".e","");
if(index != -1) {
file = new File("./" + name + index + ".dot")... |
dbb01f0a-04b4-4438-a05b-194c1cf5aafe | 5 | private void updateDeleteDragObject(String name) {
CategoryType actCategory = guiBuilder.getDragObjectByName(name)
.getCategory();
if (actCategory == CategoryType.BASS) {
this.animationCountArray[0] -= 1;
this.animationArray[0] = checkDragObjectCount(0);
} else if (actCategory == CategoryType.BEATS) {
... |
520cd786-f6ca-42e8-aa35-6b8e90c711b2 | 3 | @Override
public void setColumnAt(int columnIndex, Object value) throws ColumnFormatException, IndexOutOfBoundsException {
if (value == null || value == JsonNull.INSTANCE) {
value = null;
}
checkBounds(columnIndex);
value = castTypes(types.get(columnIndex), value);
... |
6df673d2-7e41-4587-b5ce-2f8a0bee2c11 | 3 | public String lireFichier(String path) {
BufferedReader lect;
String tmp = "";
try {
lect = new BufferedReader(new FileReader(path));
while (lect.ready() == true) {
tmp += lect.readLine();
}// while
}// try
catch (NullPointerException a) {
System.out.println("Erreur : pointeur null");
} catc... |
6f1b20d2-a582-481c-8eb5-66ba95a6deaa | 4 | public MetadataParser(final String uri, final HashMap<String, String> namespaces) throws ApplicationException {
if (uri == null || uri.isEmpty()) {
throw new IllegalArgumentException(
"The value for the parameter uri in the constructor of ModsMetadataParser mustn't be empty.");
}
this.uri = ... |
9df6cb08-d83f-47ad-9371-821693dc2009 | 0 | public final String name() {
return "Clock";
} // end name() |
26dbeb97-0cef-43f1-b971-2c539097c87a | 5 | private void flushPart() throws IOException {
int size = (_streamPos >= _pos) ? (_bufferSize - _streamPos) : (_pos - _streamPos);
if (_stream != null) {
_stream.write(_buffer, _streamPos, size);
}
_streamPos += size;
if (_streamPos == _bufferSize)
_stream... |
5d8b0130-fe30-4b67-8890-eea0806bef33 | 9 | public Task[] extractPDF(Task aTask)
{
Task task = aTask;
task.setType(AtlasJob.J_EXPORT_HTML);
String filename = task.getFilename();
String folderPath = task.getFolderPath();
if (!JLogger.checkForSize(filename, folderPath, org.Setup.FILE_SIZE_LIMIT_HTML)){
//parserCTRL.println_Doc("@@@ Doc... |
fc40063c-3eb6-4f0b-af30-5957eb46a712 | 9 | private void addToResults(Iterable<?> objects, Set<Class<?>> entityClasses) {
if (objects == null) {
return;
}
final Schema schema = context.getSchema();
assert(schema != null);
for (Class<?> entityClass : entityClasses) {
final EntityDescriptor entityDescriptor = schema.getEntityDescriptor(entityClas... |
db749389-6070-451f-bedc-92381e65f6d0 | 0 | String getId(Description description) {
return String.valueOf(TestLinkId.fromDescription(description));
} |
c81a8b34-f275-4fb5-890d-a9f339ecd970 | 0 | @Override
public void documentAdded(DocumentRepositoryEvent e) {} |
b47290ae-0ca2-41cd-98eb-ff0d86a247fa | 5 | public void reconfigure() throws ResourceConfigurationException {
super.reconfigure();
// extract configuration parameter settings
String oPath = (String) getUimaContext().getConfigParameterValue("outputFile");
File oFile = new File(oPath.trim());
// if output file has changed, close exiting file an... |
183d2774-14a2-48d2-a362-be7b422c0e81 | 2 | public void setComfortPercent(double comfortPercent) throws OutOfRangeException {
if (( comfortPercent < 0)||( comfortPercent > MAX_COMFORT_PERCENT )){
logger.error( "incorrect comfortability percent argument "+comfortPercent+"%" );
throw new OutOfRangeException();
}
this.comfortPercent = comfortPercent;
} |
0f3b6829-6435-44ed-b552-fa35a6f4f483 | 0 | public void disable() {
super.disable();
_accelerator.setEnabled(false);
} |
b22f6d68-2ca9-431c-98ce-4d308a8a47ad | 6 | public void attack(){
if(isAlive){
for(int i = 0; i < Driver.spawner.getEnemies().size(); i++){
if((Driver.spawner.getEnemies().get(i).getX() > getX()) && (Driver.spawner.getEnemies().get(i).getX() < getX()+current.getRange()+80) && (Driver.spawner.getEnemies().get(i).getY() == getY())){
Driver.spawner.ge... |
c636fd2e-e07a-4199-9af5-ca3d8d9e7f3d | 1 | @Override
public FieldContent getData() {
if (data == null) {
data = new FieldContent();
}
return data;
} |
93a86540-9ecb-44e4-8645-a37c835768fe | 9 | public void createPopupMenu() {
if (popupMenu != null)
return;
popupMenu = new JPopupMenu();
popupMenu.setInvoker(this);
String s = Modeler.getInternationalText("CustomizeThisSpectrometer");
miCustom = new JMenuItem((s != null ? s : "Customize This "
+ (getType() == PhotonSpectrometer.EMISSION ? "Em... |
90d531e8-33a6-468d-8c3b-e816b59a8de7 | 5 | int kthToLastNode(int k) {
if(k == 0) {
throw new IllegalArgumentException("k must be > 0.");
}
Node current = this;
int count = 0;
while(current != null) {
count++;
current = current.next;
}
if(k > co... |
08cd42f6-f38e-4409-aa9b-0dc93804f27b | 7 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Apply other = (Apply) obj;
if (!Arrays.equals(ci, other.ci))
return false;
if (times == null) {
if (other.times != null)
return false... |
65801a8b-b9e8-4711-a69d-ed1e741eafb4 | 9 | public void manage() {
super.manage();
if (this.simul.getDateSimulation() == 1) this.allFires = new ArrayList<Incendie>(this.donnees.getIncendies());
List<Incendie> incendies = this.donnees.getIncendies();
List<Robot> robots = this.donnees.getRobots();
long dateSimulation = this.simul.getDateSimulation();
... |
2eb08f55-cd11-41a0-9105-c52123270cbc | 7 | public static int scaleUpTableColumn(double[][] table, int t,
int scaleupFactor) {
double minPos = Double.MAX_VALUE;
for (int i = 0; i < table.length; i++) {
if (table[i][t] < minPos
&& table[i][t] * Math.pow(10, scaleupFactor) > 0) {
minPos = table[i][t];
}
}
if (minPos == 0) {
return 0;
... |
15bfc935-addf-4780-806d-ccc667982e4f | 5 | static final boolean method3196(int i, int i_2_) {
if (i_2_ >= -39)
return false;
anInt9546++;
if ((i ^ 0xffffffff) != -4 && (i ^ 0xffffffff) != -5 && i != 5
&& i != 6)
return false;
return true;
} |
e46aaf04-d408-4958-896a-35131cf73eb0 | 4 | private static void wait_writers_dead(Actor[] array_rw){
int fin_write=0;
while(fin_write!=nbWriters){
fin_write=0;
for(Actor acteur:array_rw){
if(acteur.getClass().getSimpleName().equalsIgnoreCase("Writer") && !acteur.isAlive()){
/* Si le thread associe au writer est "terminé" */
fin_write++... |
cd1ea837-54c7-4f41-86f0-c08185126312 | 4 | @SuppressWarnings("unchecked")
public V[] toArray() {
if (root == null)
return null;
V[] array = (V[]) Array.newInstance(root.mValue.getClass(), size);
Stack<Node> stack = new Stack<Node>();
Node node = root;
int index = 0;
while (true) {
if (node != null) {
stack.push(node);
node = node... |
0ab969e8-b475-4a76-9398-c3930bea896b | 0 | public SubCategory(int id, String naam, int datatype, float weight, int red, int green, int blue, boolean selected)
{
this.id = id;
this.naam = naam;
this.datatype = datatype;
this.weight = weight;
this.selected = selected;
this.red = red;
this.green = green;
this.blue = blue;
this... |
cfb483b5-32fe-43d0-aab4-bcacb07ae409 | 0 | private void inputFieldActionPerformedTEST(ActionEvent e) {
// TODO add your code here
} |
604a5be7-e2c5-4f38-878b-4d1f61447c9c | 0 | public PrimitiveScheduler() {
currentRound = -1;
nextScheduledRound = -1;
} |
272c117c-ccff-4641-a053-332f04bc64ab | 6 | private void definePackageForFindClass(final String name, final String packageName) {
try {
AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
@Override
public Object run() throws ClassNotFoundException {
String path = name.replace('.', '/').concat(".class");
for (URL url : g... |
2099c7d9-5510-461b-8d8d-b771cbf379db | 6 | public void varitaPelilauta(JButton[][] ruudukko) {
for (int k = 0; k <= 7; k++) {
for (int j = 0; j <= 7; j++) {
if ((j % 2 == 1 && k % 2 == 1) || (j % 2 == 0 && k % 2 == 0)) {
ruudukko[k][j].setBackground(Color.WHITE);
} else {
... |
8e3af625-97a6-4787-8f2b-2ed6d6bc3efd | 7 | private Set<Class<?>> resolveAllCapabilityType(AnnotatedType<? extends Provider> type) {
Set<Class<?>> res = new HashSet<Class<?>>();
/*for (Class<?> c = type.getJavaClass(); c != Object.class && c != null; c = c.getSuperclass()) {
if (Provider.class.isAssignableFrom(c))
res... |
24eb6ba8-072e-46ee-8a6f-a984a20d6a00 | 7 | private boolean scanSeparator() {
switch(currentChar) {
case '/':
divStart = sourceFile.getCurrentLine();
takeIt();
divFinish = sourceFile.getCurrentLine();
if(currentChar == '/')
singleLineComment();
else if(currentChar == '*')... |
f028aa3d-7402-4944-a0c3-3d8a8144beb5 | 6 | @Override
protected void onSubmitAction(ActionRequest request, ActionResponse response, Object command, BindException errors) throws Exception {
final String targetParentPath = StringUtils.defaultIfEmpty(request.getParameter("folderPath"), null);
final String targetEntryPath = StringUtils.defaultIfE... |
cac6ca5d-a794-4525-bfea-1c86506acf8e | 2 | public static void main(String[] args) {
File file = new File("D:/eclipse");
String[] names = file.list();
for(String name : names)
{
System.out.println(name);
System.out.println(file.getParent());
}
File[] files = file.listFiles();
for(File f : files)
{
System.out.println(f);
Sy... |
6cfa20ed-0862-46af-9596-76e7bde0bf1a | 2 | public void addHardwareSetIfNotPresent(List<HardwareSet> sequenceHardwareSets, HardwareSet hardwareSet) {
for (HardwareSet hws : sequenceHardwareSets)
if (hws.getId().equals(hardwareSet.getId()))
return;
sequenceHardwareSets.add(hardwareSet);
} |
28a2eafd-912e-4e33-8dfb-6680f00008aa | 1 | public String diffsToString(LinkedHashMap<Path, Patch> diffHashMap){
String s = "";
for(Path p : diffHashMap.keySet()){
s += patchToString(p, diffHashMap.get(p));
}
return s;
} |
71d75e48-099a-4622-a719-800a17d4dec4 | 3 | public static void pipeAndClose(InputStream istream, OutputStream ostream) throws IOException {
if(ostream != null && istream != null) {
try {
/*
* This is the fastest method I know for reading from an
* indeterminate stream. So fast in fact, that it pars fairly
* well with FileChannel stuff in ... |
80c06daa-c948-45ea-a9ca-b91a36b509de | 8 | public void compExecTime() {
double newExeTime;
double newCost;
dEval = 0;
dTime = 0;
dCost = 0;
for (int i = 0; i < iClass; i++) {
newExeTime = 0;
// System.out.print("Cost[" + i + "]");
for (int j = 0; j < iSite; j++) {
if (dmAlloc[i][j] != -1) {
if (dmAlloc[i][j] < 1) {
newExeTime... |
dd0bb5d3-eb32-4019-9fcd-392b77e43b13 | 6 | protected char[] build_keyed_alphabet(String k,int total,int offset)
{
char[] result=new char[total];
String k_u=k.toUpperCase();
boolean[] filled=new boolean[total];
int cur_pos=0;
for(int i=0;i<k_u.length();i++)
{
char cur_c=k_u.charAt(i);
int pos=cur_c-'A';
if(filled[pos])
continue;
fill... |
cba68247-e02f-4d9c-81a9-1348d06ef562 | 0 | public static void main(String[] args) throws Exception {
BasicConfigurator.configure(new ConsoleAppender(new PatternLayout("%d> %m%n")));
org.apache.log4j.Logger.getRootLogger().setLevel(Level.DEBUG);
GenericXmlApplicationContext applicationContext = new GenericXmlApplicationContext();
... |
825441f1-6674-4228-aa8c-bcf8615efa0f | 2 | public static String[] searchTicket(Integer ID) {
Database db = dbconnect();
String [] Array = null;
try {
String query = ("SELECT * FROM ticket WHERE TID = ?");
db.prepare(query);
db.bind_param(1, ID.toString());
ResultSet rs = db.executeQuery();
... |
3e995d42-853a-48c8-9faf-98946d2945aa | 6 | @EventHandler
public void CreeperSlow(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.getCreeperConfig().getDouble("Creeper.Slow.Do... |
d56726aa-86c4-4a8e-ba4b-6ad05920bec3 | 2 | public Pfad updateLand(Land c) {
Land first = first_land;
Land second = second_land;
if (first_land.getID() == c.getID()) {
first = c;
} else if (second_land.getID() == c.getID()) {
second = c;
}
return new Pfad(first, second);
} |
86117fea-15b3-4023-9de2-5670e4b85ebd | 0 | public Map<String, Long> getStatistics() {
final Map<String, Long> stat = new HashMap<String, Long>(6);
stat.put("bytes_in", bytes_in);
stat.put("bytes_out", bytes_out);
stat.put("read_ms", read_ms);
stat.put("write_ms", write_ms);
stat.put("read_count", read_coun... |
ec586bce-9077-42d0-92ee-a73c2aa6dbc8 | 9 | public static void main(String[] args) throws IOException {
if(args.length >= 1) {
if(args[0].equals("map")) {
long startTime = System.nanoTime();
generateMap(args);
long endTime = System.nanoTime();
long duration = endTime - startTime;
long nanoseconds = duration % 1000; duration /= 1000;
... |
37e7b2a2-83d3-45d1-b7a6-051154e2f441 | 5 | public int firstMissingPositive1(int[] A) {
int[] array = new int[A.length+1];
for(int i = 0; i < A.length; i++){
int index = A[i];
if(index >=1 && index <= A.length){
array[index] = 1;
}
}
int i=1;
for( i=1; i<= A.length;i++){
... |
179b89ac-cec8-4b26-91ef-c1a0c41abf0c | 6 | @Override
public void run() {
while (!stop) {
if ((activeMode && connections.size() < Options.getInstance().getInt("network.activeMode.maxConnections"))
|| (!activeMode && connections.size() < Options.getInstance().getInt(
"network.passiveMode.maxConnections"))) {
NetworkAddressMessage m = datasto... |
5b0f0b64-62e7-4b80-86d7-775cd8df3498 | 0 | @Override
public ArrayList<Excel> getColoredExes() {
return coloredEx;
} |
7b2a02b4-b136-484f-bcf8-7c200f33b29d | 4 | public static List<Flight> getDepArrivalFlights(String DepArrKey)
throws NewCustomException {
List<Flight> SearchedFlights = null;
Location arrLoc = getLocation(DepArrKey.substring(0, 3));
Location depLoc = getLocation(DepArrKey.substring(3));
if ((arrLoc != null) && (depLoc != null)) {
SearchedFlights ... |
23a30304-78fc-47b0-88d3-0aa1ea485c45 | 0 | @Basic
@Column(name = "employee_id")
public int getEmployeeId() {
return employeeId;
} |
05bfb17d-bf0d-4eac-86fa-c0f1da2da957 | 2 | public void menuCadastrarDisciplina(String nomeDisc, String codDisc) {
try {
sistemaFrontEnd.adicionaDisciplina(nomeDisc, codDisc);
front.exibirMsg("Disciplina " + nomeDisc
+ " Cadastrado com Sucesso!!");
} catch (DisciplinaJaExisteException e) {
front.exibirMsg("Disciplina já Cadastrada!!");
}
t... |
88fe13f1-c061-429c-baab-5d13ace197be | 5 | public boolean checkBox(int row, int col) {
int count = 0;
for(int k = 1; k < 10; k++) {
for(int i = row; i < row + 3; i++) {
for(int j = col; j < col + 3; j++) {
count = 0;
if(k == Integer.parseInt(entries[i][j].getText())) {
count++;
}
if(count >= 2) {
System.out.println("ch... |
65efe22f-14b5-4caa-9c5e-7c185a0fac19 | 9 | protected void _socketReceivingMessage(ByteBuffer _buf)
{
//将数据放入缓冲中
try
{
_m_bByteBuffer.put(_buf);
}
catch (BufferOverflowException e)
{
ALServerLog.Error("_socketReceivingMessage length is too long, Socket Buffer need more!");
_m... |
48c39394-4629-4122-b9e2-317a0a8fc8b5 | 1 | public void setListDataOut(ListDataOut data){
listDataOut = data;
//add rows to result table;
for(int i = 0; i<listDataOut.getLength(); i++){
addResultToTable(listDataOut.getData(i).getAlgoName(), listDataOut.getData(i).getMaxTime(),
listDataOut.getData(i).getMa... |
ea32127b-80ed-4473-9b21-b7313e8f93b6 | 3 | @Override
public GameState[] allActions(GameState state, Card card, int time) {
GameState[] states = new GameState[1];
states[0] = state;
if(time == Time.DAY)
{
states = dayActionWithPhrases(new GameState(state), card).keySet().toArray(new GameState[0]);
}
else if(time == Time.DUSK)
{
PickTreasu... |
e4c3d688-de3d-46aa-8307-1eb99a718571 | 1 | public void draw(Graphics2D g) {
if (needsRefresh)
refreshCurve();
drawText(g);
} |
fffe6582-f823-4f2e-b1a9-0a43fcf30455 | 5 | public void outputBarChart() {
System.out.println("Overall grade distribution :");
int[] frequency = new int[11];
for(int[] studentGrades : grades) {
for(int grade : studentGrades) {
++frequency[grade/10];
}
}
... |
758bf36e-7267-47b0-b056-7b7f9836abc2 | 7 | private final boolean cons(int i)
{ switch (b[i])
{ case 'a': case 'e': case 'i': case 'o': case 'u': return false;
case 'y': return (i==0) ? true : !cons(i-1);
default: return true;
}
} |
0d00fa5e-e7f2-4b8d-9eed-086b160d8586 | 4 | public boolean contains( T x )
{
nullNode.element = x;
current = header.right;
for( ; ; )
{
if( x.compareTo( current.element ) < 0 )
current = current.left;
else if( x.compareTo( current.element ) > 0 )
current = current.right;
else if( current... |
9f1c2172-bc66-4125-bf4c-16b6c1085da6 | 1 | int DeleteUserTemplates()
{
for (int i = Templates.size()-NumTemplates; i > 0; i--)
{
Templates.removeElementAt(Templates.size()-1);
}
return Templates.size();
} |
2e1e6a68-29b9-4952-9dc7-ca9667ca1889 | 7 | private void initListeners() {
ToolsTableListener listener = new ToolsTableListener(toolsTable, toolsTableModel, this);
toolsTable.getSelectionModel().addListSelectionListener(listener);
toolsTable.addMouseListener(listener);
toolsTable.addMouseMotionListener(listener);
server... |
c7b1cbfe-36f4-41e3-b227-c963181dd8af | 7 | @Override
public void tick(MainGame game, Person person) {
if(targetTree != null && game.world.getTile(targetTree.x, targetTree.y).getID() != World.tree.getID())
targetTree = null;
//Locate the tree
if(targetTree == null)
locateTree(game, person);
//Move to the tree
if(targetTree != null) {
per... |
09c87caf-b25a-46b3-a7a3-b44cb808ab7c | 6 | public boolean isTwoOperatorType(String str) {
if (str.equals("+") || str.equals("-") || str.equals("*")
|| str.equals("/") || str.equals("^") || str.equals("E")) {
return true;
}
return false;
} |
e42994e2-bb69-45c4-87b3-4bfca33548bd | 9 | public Card chooseCard(Deck deck, PlayerCPU playerCPU) {
String input;
Scanner sc = new Scanner(System.in);
Card card;
boolean pull = true; // if true, user can pull a card
while (true) {
System.out.print("Choose a card: ");
input = sc.nextLine().toLowerCase().trim().
replaceAll("\\s... |
c6f43ccb-e38f-4b09-a601-c7e82af2b151 | 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... |
ef984d8a-e68d-45a6-b8e3-9060835026ac | 2 | private void inv4ActionPerformed(java.awt.event.ActionEvent evt)
{
if(!game.getInBattle())
{
outputText.setText(game.useItem(3) + "\n" + game.getCurrentRoom().getExitString());
if(game.itemRemoved())
inv4.setText... |
5bc83098-835c-418b-994e-c36d6338bd55 | 3 | @Override
public void create(Book book) throws IllegalArgumentException, DAOException {
Object[] values = {
book.getReference(),
book.getType(),
book.getTitle(),
book.getAuthor(),
book.getStatus().getId()
};
Connection connection= ... |
733abb96-c5f4-4e9c-8d39-36528d2a3ae5 | 0 | @Override
public ArrayList<Excel> getColoredExes() {
// TODO Auto-generated method stub
return coloredEx;
} |
bdd92bb5-8c54-45cf-b2f9-445076919413 | 6 | public float getFluidHeight(int par1, int par2, int par3, Material par4Material)
{
int var5 = 0;
float var6 = 0.0F;
for (int var7 = 0; var7 < 4; ++var7)
{
int var8 = par1 - (var7 & 1);
int var9 = par3 - (var7 >> 1 & 1);
if (this.blockAccess.getBl... |
72fd4485-3538-4c70-909a-4ae4d068d2ae | 1 | public void visitLocalVariable(final String name, final String desc,
final String signature, final Label start, final Label end,
final int index) {
if (signature != null) {
cp.newUTF8("LocalVariableTypeTable");
cp.newUTF8(name);
cp.newUTF8(signature);
}
cp.newUTF8("LocalVariableTable");
cp.newUTF... |
14599ea2-b50d-41fe-a44a-e3d7661eedae | 8 | private static void checkDay(int day, int month, int year) {
if (notFebruary(month)) {
if (day >= 1 && day <= DAYS_IN_MONTHS[month]) {
return;
}
throw new IllegalArgumentException("day out of range");
}
if (isLeapYear(year)) {
if (day >= 1 && day <= 29) {
return;
}
throw new IllegalArgu... |
61984656-e175-4d3d-b7f7-b5e2d8f9ce41 | 9 | @Override
public int hashCode() {
int hash = 5;
hash = 17 * hash + (this.id != null ? this.id.hashCode() : 0);
hash = 17 * hash + (this.nome != null ? this.nome.hashCode() : 0);
hash = 17 * hash + (this.sobrenome != null ? this.sobrenome.hashCode() : 0);
hash = 17 * hash + (t... |
d8f48765-62fe-43bf-8775-1f653343bc45 | 2 | public static Properties toProperties(JSONObject jo) throws JSONException {
Properties properties = new Properties();
if (jo != null) {
Iterator keys = jo.keys();
while (keys.hasNext()) {
String name = keys.next().toString();
properties.put(name... |
3f9aa46e-bc8d-4fe0-8c02-bf8f8c3a403f | 4 | public boolean containsPoint(float x2, float y2) {
if (x2 > getX() && x2 < getX() + getWidth()) {
if (y2 > getY() && y2 < getY() + getHeight()) {
return true;
}
}
return false;
} |
45600db8-b509-4dce-9f19-1567acff7581 | 7 | public String toString() {
final StringBuilder sb = new StringBuilder();
SortedSet<Option> union = new TreeSet<Option>(savedOptionMap.keySet());
union.addAll(dependenciesResolvedOptionMap.keySet());
union.addAll(commandLineOptionMap.keySet());
union.addAll(optionFileOptionMap.keySet());
for (Option option :... |
84e7bb17-2c55-4ecb-a936-f6ed4ea78217 | 2 | public GameActor getActorAtLoc(double x, double y) {
Iterator<GameActor> it = actors.values().iterator();
while(it.hasNext()) {
GameActor actor = it.next();
if(actor.locationWithinActor(x, y)) {
return actor;
}
}
retur... |
7a9e9f8d-5e52-494d-a07a-3331174c4561 | 0 | public String toString()
{
return "[name=" + name + ", salary=" + salary + "]";
} |
9be41408-3b2d-45cc-ba4c-8b197c2a623b | 8 | public static void main(String[] args) throws UnsupportedEncodingException, XMLStreamException, ClientHandlerException, UniformInterfaceException, InterruptedException {
if (args.length < 1) {
usage();
}
//user input arguments
String xmlFileInput;
String fileName = null;
... |
a354542b-e3fa-4f29-ae3e-e7fc6e69eced | 4 | public synchronized void startBatch() {
if (isEnabled()) {
if (++mBatchLevel == 1) {
if (!mBatchTargets.isEmpty()) {
mCurrentBatch = mBatchTargets.toArray(new BatchNotifierTarget[mBatchTargets.size()]);
for (BatchNotifierTarget target : mCurrentBatch) {
target.enterBatchMode();
}
}
... |
9f9d8c90-a074-4fe6-883c-e1054ce17b87 | 4 | public void remove(T item){
ListNode<T> currentNode = head;
ListNode<T> previousNode = null;
while((currentNode!=null) && !item.equals(currentNode.getData())){
previousNode=currentNode;
currentNode=previousNode.getNext();
}
if(currentNode!=null){
setLlLenght(getLlLenght()-1);
if(currentNode==he... |
f7e708d7-375b-4d2a-920f-2d78c6ec004f | 1 | @Override
public void removeAll() throws Exception {
try {
session = HibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
//Query q = session.getNamedQuery("count.all");
Query q = session.getNamedQuery(getNamedQueryToRemoveAll());
... |
b85e0b89-9929-4add-8bc5-ac0b309b46f1 | 8 | public static void ajouterRep (String numS, String dateRep, String zone, String qt) throws BDException {
String[] infos = BDRequetesTest.testAjoutCaddie(numS, dateRep, zone);
boolean incr = false;
int ID = 1;
for (int i=0;i<list.size();i++){
if ((list.get(i).getNumS()+"").compareTo(numS) == 0
&& list.g... |
41a7250a-bee3-45d6-ba13-c191778673e9 | 2 | public EditionBorne(Borne borne) {
this.borne = borne;
// Pour récupérer à quelle station est attachée cette borne
for (Station s : ConfigGlobale.stations) {
if(s.getId_station()==this.borne.getFk_id_station()){
this.station = s;
break;
... |
51a94e89-5b48-4711-91b1-bbb596d77341 | 5 | public Fractal() {
super("Fractal");
controlJPanel = new JPanel();
controlJPanel.setLayout(new FlowLayout());
changeColorJButton = new JButton("Color");
controlJPanel.add(changeColorJButton);
changeColorJButton.addActionListene... |
39df1517-97e1-4b41-8f49-6fbe14c3f90b | 6 | public void run() {
running = tryToConnect(new InetSocketAddress(uri.getHost(), getPort()));
while (this.running) {
SelectionKey key = null;
try {
selector.select();
Set<SelectionKey> keys = selector.selectedKeys();
Iterator<SelectionKey> i = keys.iterator();
while (i.hasNext()) {
key =... |
21b97db9-ac36-44cf-bf3e-54d6e55615df | 9 | public static final boolean has(Inventory inventory, ItemStack item) {
ItemStack itemClone = clone(item);
ItemStack[] items = inventory.getContents();
for (ItemStack t : items) {
if (t == null)
continue;
if (t.getTypeId() == itemClone.getTypeId()
... |
602fceff-0c6f-4ebd-85cd-2fe6f0608be2 | 9 | public String triggerjcl () {
System.out.println("in triger gcl" +instance + employeememo.size());
boolean b = false;
if (instance.equalsIgnoreCase("america")) {
for (String o : employeememo) {
System.out.println("empmemo is " + o);
if (o.equalsIgnoreCase("employee")) {
b = triggerJCL(ftpServer.ge... |
08c1ab53-3951-4143-b5b7-a317f99d3f5b | 1 | private boolean greater(Key i, Key j)
{
if (i.compareTo(j) > 0)
return true;
return false;
} |
6520e100-ba69-4948-a24c-45475912d630 | 3 | protected boolean isElementoEnHechosInicio(String elemento) {
if (null != hechosDeInicio) {
for (String s : hechosDeInicio) {
if (elemento.equals(s)) {
return true;
}
}
}
return false;
} |
60736e0c-9f16-4dbf-9f23-b72dd90ca41d | 8 | protected void updateCapabilitiesFilter(Capabilities filter) {
Instances tempInst;
Capabilities filterClass;
if (filter == null) {
m_AttributeEvaluatorEditor.setCapabilitiesFilter(new Capabilities(null));
m_AttributeSearchEditor.setCapabilitiesFilter(new Capabilities(null));
return;
... |
e23eef2c-1dd1-48bb-830f-e0fc4e473726 | 4 | private int decideSlotReinf(Range target, int cardDrawn){
int slot = 0;
if (target.getHighEnd() - cardDrawn <= 5)
slot = target.getStartSlot() + target.getNumSlots() - 1;
else if (cardDrawn - target.getLowEnd() <= 5)
slot = target.getStartSlot();
else{
int highCount = 0;
for (int i = target.getStart... |
6ffd8d17-6c9b-4f73-8261-932495adf805 | 5 | public static double[] tangents_between_circles(double cx0, double cy0, double r0, double cx1, double cy1, double r1) {
double[] result = NONE;
double dxySQ = (cx0 - cx1) * (cx0 - cx1) + (cy0 - cy1) * (cy0 - cy1);
if (dxySQ <= (r0-r1)*(r0-r1)) return result;
double d = Math.sqrt(dxySQ);
double vx = (cx1 - c... |
4624dc37-17fb-408c-80f7-f754a447bd74 | 5 | @Override
public final BEXList attributes() {
final int key = this._key_;
final BEXFileLoader owner = this._owner_;
switch (BEXLoader._typeOf_(key)) {
case BEX_ELEM_NODE: {
final int ref = BEXLoader._refOf_(key);
return new BEXListLoader(BEXLoader._keyOf_(BEXLoader.BEX_ATTR_LIST, ref), owner._c... |
26612d8f-889c-4f3d-b986-a68aba9d19c6 | 9 | public void makeSkeletonFrom(Room R, DeadBody body, MOB mob, int level)
{
String race="a";
if((body.charStats()!=null)&&(body.charStats().getMyRace()!=null))
race=CMLib.english().startWithAorAn(body.charStats().getMyRace().name()).toLowerCase();
String description=body.getMobDescription();
if(description.tr... |
b90dd0a2-8037-4003-9427-04a1a5d7a92f | 0 | public float getTipoInteres() {
return tipoInteres;
} |
a063ed95-f5bb-4041-8d89-aa93ac5910cd | 1 | public byte[] getImage() {
ByteArrayOutputStream image=new ByteArrayOutputStream();
try {
finishMethod(); // finish the last method
// patch methods count
int otsize=tsize;
tsize=nMethodsPatch;
writeShort(nMethods);
tsize=otsize;
// assemble the method bytecode
... |
4ff38245-fcf7-4bcf-85bb-e1a29b56362e | 8 | public static int createRing(int itemid, final MapleCharacter partner1, final MapleCharacter partner2, String message) {
if (partner1 == null) {
System.err.println("Partner Number 1 is not on the same channel.");
return -2; //
} else if (partner2 == null) {
System.er... |
efcf4614-5a19-4f4a-8f63-c6c2987188c7 | 0 | public void setPhoneType(String phoneType) {
this.phoneType.set(phoneType);
} |
6694001b-6963-4f16-9f9d-5523b17a6083 | 7 | public void update(long elapsedTime) {
// select the correct Animation
Animation newAnim = anim;
if (state == STATE_DYING && iLado==1) {
newAnim = left;
}
else if (state == STATE_DYING && iLado == 2) {
newAnim = right;
}
// update t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.