method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
04a36339-6145-4b0b-b264-0e74459c9346 | 5 | @Override
public Object getValueAt(int rowIndex, int columnIndex) {
RaavareLagerKompDTOView raavareLagerKomp = raavareLagerKompList.get(rowIndex);
Object value = null;
switch (columnIndex) {
case 0:
value = raavareLagerKomp.getRaavareId();
break;
case 1:
value = raavareLagerKomp.getRaavareNavn();
... |
9dc7d623-f5d4-4804-ab24-09d40d0c5b40 | 1 | public AnnotationVisitor visitAnnotation(final String desc,
final boolean visible) {
return new SAXAnnotationAdapter(getContentHandler(), "annotation",
visible ? 1 : -1, null, desc);
} |
929933d9-d0ba-4fca-bcb2-2838cc436727 | 8 | public void removePlayer(Player player) {
this.logger.info("Jugador " + player.getUser().getUsername()
+ " solicita salir de sala " + this.roomName );
// se elimina del equipo correspondiente
if( player.getTeam().getType() != Team.NONE ){
if( player.getTeam().getType() == Team.RED ){
this.teamRed.rem... |
a179e603-f2f2-4c07-802e-b9d5f596bcec | 0 | protected boolean isFinished() {
return false;
} |
17054dc9-ae1e-4f58-b919-0895fb7bc890 | 6 | public ShowEmployeePanel() {
super(null); // Declares as a null layout
model = new EmployeeTableModel();
sorter = new TableRowSorter<EmployeeTableModel>(model);
employeeTable = new JTable(model);
employeeTable.setPreferredScrollableViewportSize(new Dimension(500, 70));
employeeTable.setFillsViewpor... |
3a9d64f8-192e-44f6-9746-ce1585bc103d | 7 | @Override
public ContainerRequest filter(ContainerRequest request) {
final String accessToken = request.getHeaderValue("Authorization");
Session session = null;
TokenWrapper response = null;
if (accessToken != null && accessToken.length() > 0) {
try {
PhiAuthClient.setHostname("http://evergreenalu... |
b9e5077d-1c79-4ef4-a976-13e2c5748915 | 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... |
53e36e56-cd12-47a3-9edb-a3bff8fd6294 | 5 | public void print() {
String nullString = "null";
if (root != null) {
int treeDepth = root.height();
List[] levels = new List[treeDepth];
for(int i = 0; i < levels.length; i++){
levels[i] = new ArrayList<Node>();
}
levels = getLevelsList(levels);
//Actually print everything.
for(int i =... |
901a0e95-f2f7-4a6d-bb6f-5eb57d3a3bdf | 8 | public void update(ChiVertex<Integer, Integer> vertex, GraphChiContext context) {
final int iteration = context.getIteration();
final int numEdges = vertex.numEdges();
/* On first iteration, each vertex chooses a label equalling its id */
if (iteration == 0) {
vertex.setValu... |
39711c49-c513-4902-b59e-92d1cb394017 | 7 | public static void startupOptimize() {
{ Object old$Module$000 = Stella.$MODULE$.get();
Object old$Context$000 = Stella.$CONTEXT$.get();
try {
Native.setSpecial(Stella.$MODULE$, Stella.getStellaModule("/LOGIC", Stella.$STARTUP_TIME_PHASE$ > 1));
Native.setSpecial(Stella.$CONTEXT$, ((Mod... |
c2e7c627-fedf-413a-8958-e620330a499e | 2 | public void doubleAster(String single) throws IOException {
int i = 0;
for (String double_block : single.split("<br />:?\\*\\* ")) {
double_block = double_block.replaceAll("<br />", "");
status[5] = double_block;
if (i > 0)
status[4] = "laka前に倣うslk";
addToArray(status);
i++;
}
} |
5b9699f6-9407-494d-8bda-e68799e1ab7f | 0 | @Override
public void setAddress(Address address) {
super.setAddress(address);
} |
38572e13-cf9a-47af-9280-8eca3c3d3b41 | 9 | public static void main(String[] args) {
ArrayList<Integer> primes = new ArrayList<Integer>();
for (int i = 0; i < isPrime.length; i++)
if (isPrime[i])
primes.add(i);
int[] primeSumTerms = new int[1000000];
for (int i = 0; i < primes.size(); i++) {
int terms = 1;
int sum = primes.get(i);
for (i... |
e24248c0-2f8a-41ab-944d-23e355144cf9 | 5 | @Override
public void doAction(String value) {
char choice = value.toUpperCase().charAt(0);
do {
switch (choice) {
case 'R': //return to game
return; //displays main menu
case 'S': //save the game by storing data away, and quit by ca... |
70fb7a11-2674-42ee-a1d5-64a936a26c5f | 3 | public TraverseMode getNonTransitMode() {
if (contains(TraverseMode.CAR)) {
return TraverseMode.CAR;
}
if (contains(TraverseMode.BICYCLE)) {
return TraverseMode.BICYCLE;
}
if (contains(TraverseMode.WALK)) {
return TraverseMode.WALK;
}
... |
c14dbdd2-b9b9-4779-8886-ef3c92dcade5 | 2 | public ImageIcon getImage() {
System.out.println("Getting image");
if (image == null) {
if (imagePath != null) {
System.out.println(imagePath);
image = new ImageIcon(getClass().getResource("images/" + imagePath));
} else {
image = n... |
554acfd1-3ca6-4c39-a011-7da9d0c7fb00 | 6 | public static void main(String args[]) {
try {
System.out.println("RS2 user client - release #" + 317);
if (args.length != 5) {
System.out
.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
return;
}
localWorldId = Integer.parseInt(args[0]);
portOffset = ... |
4be341aa-b440-4615-b5c8-1ad2610a4797 | 6 | public int sarLookback( double optInAcceleration,
double optInMaximum )
{
if( optInAcceleration == (-4e+37) )
optInAcceleration = 2.000000e-2;
else if( (optInAcceleration < 0.000000e+0) || (optInAcceleration > 3.000000e+37) )
return -1;
if( optInMaximum == (-4e+37) )
... |
5a147e6b-d0a9-47ec-8b7b-394eacc752d8 | 7 | */
public static void help(Cons commands) {
{ Cons thecommands = commands;
if (thecommands == Stella.NIL) {
{
System.out.println("The following commands are available (type `(help <command>+)'");
System.out.println("to get command-specific documentation):");
System.out... |
de384596-1d25-4cea-91f0-e4ebfa39284a | 5 | @Override
public void run() {
while(true){
try {
Thread.sleep(Delta);
} catch (InterruptedException e) {
e.printStackTrace();
}
// go through the list of timeStamps
Double[] ts = timestamps.toArray(new Double[timestamps.size()]);
for(int i = 0; i< ts.length; i... |
7b89a57a-8529-49d2-a093-44d66bfe8368 | 6 | public void eatFood() {
if (isCheap() && getHousingRole().getHouse() != null){
//DAVID I'm trying this out to see what happens...
print("Going to market to buy food to eat at home");
goToMarket();
print("Going to eat at home");
getHousingRole().msgEatAtHome();
mCommuterRole.mActive = true;
mCommu... |
ec3e9d86-cb79-4b1b-8846-410f0a7a6c11 | 3 | @Override
public void run() {
while(true){
try {
ArrayList<ChatMessage> messageCopy = new ArrayList<>(writtenMessages);
writtenMessages.clear();
for (ChatMessage chatMessage : messageCopy) {
dbCon.addMessage(chatMessage);
}
writtenMessages.clear();
loadMessages();
loadU... |
5287962c-f3b5-488b-8416-0f35c02177c1 | 1 | public MainMenu() {
Random rand = new Random();
menu = new OptionsMenu();
config.loadConfig("settings", ".xml");
sound = Config.songs.get(rand.nextInt(Config.songs.size()));
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exce... |
ec1eb1bd-3874-4c74-b95c-34cb17bcdb02 | 2 | public void persistTransactionSet(TransactionSet transactionSet) {
String sqlStatement;
dao.connect();
sqlStatement = generateInsertStmt(transactionSet);
if(dao.getErrorLogs().getErrorMsgs().size() == 0){
dao.executeUpdate(sqlStatement);
}
if(dao.getErrorLogs().getErrorMsgs().size() == 0){
dao.disconnec... |
f1443e42-5e8c-43fa-8eb3-933958553ee7 | 8 | public Matrix solve (Matrix B) {
if (B.getRowDimension() != n) {
throw new IllegalArgumentException("Matrix row dimensions must agree.");
}
if (!isspd) {
throw new RuntimeException("Matrix is not symmetric positive definite.");
}
// Copy right hand side.
double[][]... |
531963ae-6926-4d88-b337-2058872abac5 | 6 | private void saveFile() {
byte[] data = new byte[this.torrentInfo.file_length];
System.out.println("building file...");
for(int i : this.pieces.keySet()){
Piece p = pieces.get(i);
int pind = p.getIndex();
byte[] pdata = p.getData();
int dataOffset = pind * this.torrentInfo.piece_length;
if(pind < ... |
1bda4133-828d-4d2d-9490-b42b5db0a1ad | 4 | public static Object[] getSinkVertices(mxAnalysisGraph aGraph) throws StructuralException
{
if (!mxGraphProperties.isDirected(aGraph.getProperties(), mxGraphProperties.DEFAULT_DIRECTED))
{
throw new StructuralException("The graph is undirected, so it can't have sink vertices.");
}
ArrayList<Object> sourceL... |
7c096898-27ef-451b-934f-99372601ab38 | 2 | @Override
public boolean equals(Object obj) {
if (obj instanceof Piece) {
Piece otherPiece = (Piece)obj;
return this.name.equals(otherPiece.name) &&
this.color == otherPiece.color;
}
return false;
} |
84449caa-855e-4cf3-b584-083db4c41e28 | 2 | public void begin(){
while(true){
partida.mover();
repaint();
try{
Thread.sleep(18);
}catch(InterruptedException e){}
}
} |
378387e5-ab49-4121-a021-aeb16327861b | 2 | public void run()
{
try
{
PrintWriter out =
new PrintWriter(socket.getOutputStream(),true);
BufferedReader in =
new BufferedReader(
new InputStreamReader(socket.getInputStream()));
String userInput;
while ((userInput = in.readLine()) != null)
{
out.println("Echo " +u... |
50e198f5-312e-41e7-98f0-f03ff01f5bac | 8 | public double[][] createLattice(int rows, int cols, double rate,
double up, double down, double q)
{
double[][] lattice = new double[rows][cols];
for(int row = 0; row < rows; ++row)
{
for(int col = 0; col < cols; ++col)
{
/*
... |
0966e4a1-5500-4cc2-a757-46cd6be475e3 | 5 | public void compareSignaturesFromFile(String inputfile, String outputfile)
{
try {
BufferedReader br = new BufferedReader(new FileReader(inputfile));
File output = new File(outputfile);
FileWriter writer = new FileWriter(output);
String line;
while ((line = br.readLine()) != null) {
String[] toke... |
cc55e81e-3898-4c6e-b101-5618e04d4259 | 0 | public void setSeatType(long value) {
this._seatType = value;
} |
f9562c64-d7b3-4e75-9d69-faecd61fc995 | 3 | public static Object getDirectedLeaf(mxAnalysisGraph aGraph, Object parent)
{
Object[] vertices = aGraph.getChildVertices(parent);
int vertexNum = vertices.length;
Object currVertex;
for (int i = 0; i < vertexNum; i++)
{
currVertex = vertices[i];
int inEdgeCount = aGraph.getEdges(currVertex, parent, t... |
21e40681-0db9-4a8a-b139-03755e4d9b14 | 4 | public static boolean line_line(double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3){
double f1 = (x1 - x0);
double g1 = (y1 - y0);
double f2 = (x3 - x2);
double g2 = (y3 - y2);
double f1g2 = f1 * g2;
double f2g1 = f2 * g1;
double det = f2g1 - f1g2;
if(Math.abs(det) > ... |
405da865-46a9-4da3-ace3-24ba761b74dd | 0 | public String getName ()
{
return name;
} |
196e3ca4-20a9-42a4-9139-6bdb1df48d92 | 6 | public void updateCondition(
float newCondition, boolean normalState, boolean burning
) {
//
// Firstly, make any necessary state transitions-
final float oldCondition = condition ;
condition = newCondition ;
if (scaffolding == null && ! normalState) {
clearAllAttachments() ;
scaf... |
465b2fd9-b95c-45fe-b434-66405dfb1f3e | 7 | @Override
protected void process() {
super.process();
Monster actor = (Monster) ai.getActor();
Player player = getPlayerToAttack(actor);
if (actor == null || player == null) {
terminate();
return;
}
if (actor.isFeared() && actor.getFearedSou... |
0dee82e4-6a10-4a3f-bc87-89bf475c5798 | 3 | public List<POWMessage> getObjects(List<InventoryVectorMessage> inventoryVectors) {
List<POWMessage> objects = new ArrayList<>(inventoryVectors.size());
for (InventoryVectorMessage m : inventoryVectors) {
POWMessage p = objectCache.get(m);
if (p != null) {
objects.add(p);
} else {
p = database.ge... |
06a88a90-5d6a-4f8f-9664-e8884c2fbb34 | 9 | public static void main(String[] args) throws Exception {
bytes = new byte[800000000];
urlmap = new HashMap<String, ArrayList<Integer>>(4500000);
HashMap<Long, Integer> map = readHashMap("UsersMapping");
File dir = new File(inDirectory);
int cnt = 0;
long t1 = System.currentTimeMillis();
int totalUsers = ... |
162b0d31-d831-446d-8aec-c0b3ba1ccc90 | 3 | private void editParamCell() {
int row = table.getSelectedRow();
if (row >= 0) {
ParameterEditor pe = new ParameterEditor(model.getParameter(row));
if (pe.isOk()) {
try {
model.update(row, pe.getFormula());
} catch (Exception e1) {
JOptionPane.showMessageDialog(null, e1.getMessage());
}
... |
269d3685-c39f-4c9f-b838-a8c0b45d61c5 | 4 | public static SelectItem[] getSelectItems(List<?> entities, boolean selectOne) {
int size = selectOne ? entities.size() + 1 : entities.size();
SelectItem[] items = new SelectItem[size];
int i = 0;
if (selectOne) {
items[0] = new SelectItem("", "---");
i++;
... |
b32ebd78-179a-4a71-992a-bb0ba86f1b51 | 3 | * @return boolean whether the two decks contain the same order of cards
*/
public boolean equalsInOrder(Deck d) {
if (this.cardArray.length != d.cardArray.length)
return false;
for (int i = 0; i < cardArray.length; i++) {
if (cardArray[i].compareTo(d.cardArray[... |
0d24eb32-f443-4a81-acb9-c22e46e3ef57 | 7 | protected void genDoorsNLocks(MOB mob, CloseableLockable E, String doorName, int showNumber, int showFlag)
throws IOException
{
if((showFlag>0)&&(showFlag!=showNumber))
return;
boolean HasDoor=E.hasADoor();
boolean Open=E.isOpen();
boolean DefaultsClosed=E.defaultsClosed();
boolean HasLock=E.hasALock();... |
f2b44562-04d1-4468-89d3-6a376632b4bc | 0 | public void pulse() {
DCPackage pulsePackage = new DCPackage(currentRound, new byte[DCPackage.PAYLOAD_SIZE]);
currentRound = (currentRound+1) % pulsePackage.getNumberRange();
resetRound();
broadcast(pulsePackage);
} |
26edc6e1-c5fb-4075-b90e-9a9e351f4a88 | 2 | public void bornAgain()
{
if (getParent() != null)
{
if (getParent().getParent() != null)
{
getParent().getParent().repaint();
}
}
} |
367d8f0c-2e65-4136-9eb9-fdc7657dcfc5 | 6 | public void update(Observable o, Object arg) {
String name, str, text, textFinal, requete;
List<String> keywords = sqlCommand.getKeywords();
List<String> types = sqlCommand.getTypes();
//textFinal = "<html><body style=\"font-family:Geneva,Arial,Helvetica,sans-serif;font-size:11px;\">";
textFinal = "<html><b... |
eb49a55e-0362-4cc0-885d-1d86d97e5cd0 | 4 | public static byte[] dumpElement(TypeModel tm) {
ClassWriter cw = new ClassWriter(0);
FieldVisitor fv;
MethodVisitor mv;
String name = tm.bcType();
cw.visit(V1_5, ACC_PUBLIC + ACC_SUPER, name + "Element", "L" + collections + "impl/AbstractHugeElement<L" + name + "Allocation;>;L" + name + ";Ljava/... |
7ab4658f-e8dc-487e-871c-03c076968e97 | 8 | public long FindSumOfPandigitalNumbersWithAscendingPrimeSubStringDivisibilityProperty() {
Permutizer permutizer = new Permutizer();
long toReturn = 0;
String currentPandigitalNumber = "0123456789";
do{
int twothreefour = Integer.parseInt(
currentPandigita... |
c4c3ca66-fd20-40b6-ad73-2cb5bbcb2a65 | 5 | public LedString(int x, int y, String s) {
this.x = x;
this.y = y;
stringShapes = new LedShape[s.length()];
int xOffset = x;
for(int i = 0; i < s.length(); i++) {
stringShapes[i] = charToShape(s.charAt(i));
stringShapes[i].setXY(xOffset, y);
if(stringShapes[i].width == 0)
stringShapes[i].moveX(4)... |
411a833d-7061-47c3-a1ac-f88f62403e48 | 7 | public List<Subset> filterSubset(List<Subset> subsetList, int preferredSize){
if(subsetList.size () <=preferredSize && preferredSize !=-1)return subsetList;
for (int i =0; i <subsetList.size ()-1; i ++) {
for (int j =i+1; j <subsetList.size (); j ++) {
Subset focus =subsetList.get (i);
... |
b98854cf-8dc7-440e-88c4-6602fcc6faa4 | 8 | private void jTree1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTree1MouseClicked
Component node = (Component) jTree1.getLastSelectedPathComponent();
//System.out.println(node.getClass());
String description = null;
if (node != null) {
... |
8632b17c-0096-4817-afac-de5f9f87a7e9 | 3 | @SuppressWarnings("unused")
public static void main(String[] args) {
if (args.length < 1) {
System.out
.println("Argumentos insuficientes para ejecutar la aplicación.");
} else {
if (args[0].toLowerCase().equals(MODO_CLIENTE)) {
ControladorCliente c = new ControladorCliente();
} else if (args[0].... |
33daeb42-0de5-4a83-ae1c-e1176f2b2f49 | 0 | public String getAlertDescription() {
return alertDescription;
} |
d9d36180-c469-484f-829f-90a857b1231c | 4 | private void chooseNewPlaylist() {
if(!LockedPlaylistValueAccess.lockedPlaylist) {
newFilePath = fileChooser.getNewFilePath();
String[] options = {};
// Only change the playlist if the new path is different from the old one.
if((currentFilePath != newFilePath) &... |
c5065a50-284c-44bb-97dd-201cef6bc1f0 | 9 | public boolean addTile(int x, int y, Tile tile)
{
Tile old = getLowestTile(x, y);
if(old == null)
return false;
if(old.height == tile.height)
{
tile.next = old.next;
tiles.set(getPos(x, y, this.width, this.height), tile);
return true;
}
do
{
if(old.height == tile.height)
{
old.data ... |
ce7a4d3b-f30d-41e1-9ebf-805cc867e12d | 7 | public void doCommand(int command) {
switch (command) {
case P2:
case P3:
case P4:
main.newGame(selection + 2);
break;
case CONTROL_SETUP:
new BomberConfigDialog(main);
break;
case EXI... |
ffddff1c-86d2-4487-83b0-537c4bda23b8 | 6 | private String getMime(String extension) {
String mime = "";
switch (extension) {
case ".pdf":
mime = "application/pdf";
break;
case ".png":
mime = "image/png";
case ".css":
... |
0a44ac0e-b2c1-43fc-ad1b-54e86c27e414 | 0 | protected Field getField()
{
return field;
} |
e4b8a9cc-adec-4efc-99f9-c76c30b49961 | 1 | protected Token jjFillToken()
{
final Token t;
final String curTokenImage;
final int beginLine;
final int endLine;
final int beginColumn;
final int endColumn;
String im = jjstrLiteralImages[jjmatchedKind];
curTokenImage = (im == null) ? input_stream.GetImage() : im;
beginLine = input_stream.g... |
68f1fffc-45b6-4f44-8c16-5c75f0a9a576 | 7 | public static void main(String[] args) {
try {
Integer max = 0;
Integer min = 0;
Integer maxGoal = 0;
Integer minGoal = 0;
String maxName = "";
String minName = "";
String teamName="";
Scanner scanner = new Scanner(new File("file_Location/football.dat"));
while (scanner.hasNext()) {
S... |
657df89a-758d-4c5a-b518-c2719ccdba0d | 1 | private String _parseMessage(String ... array) {
String error = "";
for (String temp : array) {
error += temp + " ";
}
return error;
} |
18db7034-6de5-438a-a663-4c65009e3f9f | 0 | public String getEventName() {
return eventName;
} |
56432700-feee-4a72-a70a-b9a7a2ed7700 | 6 | private void bonoPuntaje(){
if(nivel.equals("Basico") && intentos == 6){
bono = 30;
puntuacion += 30;
}
if(nivel.equals("Intermedio") && intentos == 4){
bono = 50;
puntuacion += 50;
}
if(nivel.equals("Avanzado") && intentos == 2){
bono = 100;
puntuacion += 100;
}
} |
d19e999d-c1a7-4d9b-8e8e-63b7cbdefca5 | 8 | public LinkedNode removeDuplicates(LinkedNode head){
if(head==null){
return null;
}
if(head.getNext()==null){
return head;
}
Set<Integer> existingValues = new HashSet<Integer>();
List<Integer> nonDuplicateValues = new ArrayList<Integer>();
... |
cdaae256-d960-421e-893f-627fcbf65bfe | 2 | private void resaveParamsShowTour(SessionRequestContent request) {
Direction direction = (Direction) request.getSessionAttribute(JSP_CURRENT_DIRECTION);
if (direction != null) {
Integer idDirection = direction.getIdDirection();
if (idDirection != null) {
request.s... |
9ae62641-9c65-414c-8930-e92e9a0c5f97 | 5 | private static DisplayMode getBestDisplayMode(GraphicsDevice device) {
for (DisplayMode bestDisplayMode : BEST_DISPLAY_MODES) {
DisplayMode[] modes = device.getDisplayModes();
for (DisplayMode mode : modes) {
if (mode.getWidth() == bestDisplayMode.getWidth()
&& mode.getHeight() == bestDisplayMode.getH... |
991cc82f-a6e1-4e8b-b55e-eb4478597a58 | 4 | private static int copyGapBytes(byte[] newcode, int j, byte[] code, int i, int iEnd) {
switch (iEnd - i) {
case 4:
newcode[j++] = code[i++];
case 3:
newcode[j++] = code[i++];
case 2:
newcode[j++] = code[i++];
case 1:
newcode[j++] = ... |
a257ef55-75a0-4102-b621-cd6fcfac071a | 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... |
63d0d3b0-1331-42d6-9bfa-eb3da9e09ffc | 1 | public Dimension getMinimumSize() {
if (image != null) {
return new Dimension(image.getWidth(), image.getHeight());
}
return super.getMinimumSize();
} |
0cad830c-e795-400a-b74f-3410d0bd4a46 | 6 | public boolean memberP(Stella_Object value) {
{ Iterator self = this;
if ((value == null) ||
value.standardObjectP()) {
{ Stella_Object m = null;
Iterator iter000 = self;
while (iter000.nextP()) {
m = iter000.value;
if (m == value) {
... |
551b708f-0851-4479-85f8-433094648fdc | 5 | public static void newStartMenu(Game game, Screen parent) {
try {
startMenuClass.getConstructors()[0].newInstance(game, parent);
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (IllegalArgumentException e) {
e.printStackTrac... |
eff99548-01ca-4966-836e-c355fe4459e5 | 0 | public Company getCompany() {
return company;
} |
1604207c-82d8-4286-a480-89b8cd4693d1 | 8 | public void actionPerformed(ActionEvent e)
{
String command = e.getActionCommand();
if(command.equals("About..."))
{
JFrame aboutFrame = new JFrame("About SChemP");
aboutFrame.setLocation(frame.getX()+250,frame.getY()+150);
aboutFrame.setSize(300,300);
aboutFrame.setVisible(true);
}
else if(co... |
bfb5be30-8d67-4001-be6b-2b015a007653 | 3 | private String convertAddressToString (byte[] ipAddress, int port) {
StringBuilder str = new StringBuilder();
for (int i = 0; i < 4; i++) {
if (ipAddress[i] < 0) {
str.append(ipAddress[i] + 256);
}
else {
str.append(ipAddress[i]);
... |
e0f95b54-0da8-42d4-9718-06662487c115 | 1 | public void makeSelection() {
if(!list.getSelectedValue().startsWith("-1")) {
selection = list.getSelectedValue().substring(0, list.getSelectedValue().indexOf(";"));
dispose();
}
} |
77b5a865-6705-4621-bcc4-e428540454d2 | 2 | public void close() throws IOException {
if (inStream != null) inStream.close();
if (inReader != null) inReader.close();
} |
1caf12f4-7db6-4dbb-b6be-fe2acae3484d | 5 | public boolean removeWarpUser(CommandSender cs, Command cmd, String string,
String[] args) {
Player player = (Player) cs;
if (player.hasPermission("warspandports.user.remove") || player.isOp()) {
if (args.length != 4) {
player.sendMessage(ChatColor.RED + "Proper use is "
+ ChatColor.AQUA
+ "/w... |
c534d2ee-d080-449c-821d-86dc4bad5415 | 1 | final void checkForComodification() {
if (modCount != expectedModCount)
throw new ConcurrentModificationException();
} |
ba980901-02e1-469e-b818-24dc62ad5d71 | 1 | private void miSelPlayer2MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_miSelPlayer2MousePressed
Object[] profileNames = Manager.getInstance().getProfileNames().toArray();
String selectedProfile = (String) JOptionPane.showInputDialog(this,
"Select a player.",
"Profil... |
b73f1c14-eb1f-4aff-823f-95b0369b263b | 3 | public void preload(String root) {
File file = new File(root);
File[] files = file.listFiles();
for(File f : files) {
if(f.isDirectory()) {
preload(f.getPath());
}
else if(f.isFile()) {
getSound(f.getPath());
}
... |
71bd95c2-935b-4e6f-ab1c-4e035ef9444d | 4 | private Boolean connectToServer(String serverName) {
String rmiSerName = "rmi://localhost/" + serverName + "/";
try{
serverConnected = (ServerInterface)Naming.lookup(rmiSerName);
if(!serverConnected.connect(this,getName()))
gui.addLogArea("Impossibile connettersi\nNome già " +
"presente nella lista ... |
ca66f730-5e74-40a8-be38-98444eafe2a3 | 0 | public void clickTutorial() {
System.out.println("You have chosen your characters so please equip him with items next.");
} |
f1e9f843-9bc6-40a4-bffd-ab69bbedaadc | 9 | public static String getColor(int i)
{
switch(i)
{
case 0:
return "black";
case 1:
return "red";
case 2:
return "blue";
case 3:
return "green";
case 4:
return "grey";
case 5:
return "purple";
case 6:
return "yellow";
case 7:
return "brown";
case 8:
return "orange";
}
... |
a1d63eb1-f2ca-4cac-bd3c-14bbef9ab53e | 9 | protected String[] flatten(Options options, String[] arguments, boolean stopAtNonOption)
{
init();
this.options = options;
// an iterator for the command line tokens
Iterator iter = Arrays.asList(arguments).iterator();
// process each command line token
while (iter.... |
df683ae0-2442-4a67-85b3-6751ac777dd5 | 3 | @Override
public void caseAAvalieExpSenaoComando(AAvalieExpSenaoComando node)
{
inAAvalieExpSenaoComando(node);
{
List<PComando> copy = new ArrayList<PComando>(node.getSenao());
Collections.reverse(copy);
for(PComando e : copy)
{
e.... |
ba1606da-badc-4927-b20a-efeb38a42a3e | 3 | public List getEncoders(Serializable structure) {
if (structure == null)
return Collections.unmodifiableList(encoders);
List validEncoders = new ArrayList();
Iterator it = encoders.iterator();
while (it.hasNext()) {
Codec enc = (Codec) it.next();
if (enc.canEncode(structure))
validEncoders.add(enc)... |
67a67c66-0daf-43c7-b267-d1148be7e2b4 | 8 | public boolean wordPatternMatch(String pattern, String str) {
if (pattern.isEmpty()) {
return str.isEmpty();
}
if (map.containsKey(pattern.charAt(0))) {
String value = map.get(pattern.charAt(0));
if (str.length() < value.length() || !str.substring(0, value.length()).equals(value)) {
return false;
... |
888d6f06-b52d-4105-b615-2b5205cacfe3 | 6 | public boolean growNetherWart(Player player, String[] args, int radius) {
Block playerCenter = player.getLocation().getBlock(); // Get Centrepoint (Player)
int netherWarts = 0;
for (int x = -radius; x < radius; x++) {
for (int y = -radius; y < radius; y++) {
for (int z = -radius; z < ... |
fbf67d75-42bd-486b-bcfe-44c92d8e7806 | 8 | @Override
public boolean setBelt(Wearable belt) throws NoSuchItemException, WrongItemTypeException {
if (belt != null) {
if (belt instanceof Belt) {
if (belt.getLevelRequirement() > level || belt.getStrengthRequirement() > stats[0]
|| belt.getDexterityRequirement() > stats[1] || belt.getMagicRequirement... |
c451e0e4-b800-4ca6-8eee-b73969bf2edb | 9 | private void setCapacity(int capacity) {
if (capacity < _n) {
capacity = _n;
}
double factor = (_factor < 0.01) ? 0.01 : (_factor > 0.99) ? 0.99 : _factor;
int nbit, nmax;
for (nbit = 1, nmax = 2; nmax * factor < capacity && nmax < NMAX; ++nbit, nmax *= 2) {
... |
2893f490-16e1-4376-80cc-c23a29b7d8a9 | 2 | public static void main(String[] args) throws IOException
{
decodeCustom decoder = new decodeCustom();
BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(args[0])));
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(args[1])));
String recieved;... |
a52eabb5-a373-4e3b-88c7-4cad1cf818b8 | 5 | public static void registerQueryRowVTIs( String className, String connectionURL )
throws Exception
{
// find public static methods which return ResultSet
Class theClass = Class.forName( className );
Method[] methods = theClass.getMethods();
int ... |
927024f4-15f9-4dd0-8b2b-4672a3f06fe3 | 4 | public static void process(String text) throws Exception {
System.out.println(text);
String[] args = StringUtil.tokenize(text);
ModelCommand command = getCommand(args[0]);
if (command == null) {
Logger.log("\n" + "Comando '");
Logger.log(args[0]);
... |
d09d090e-1516-4bd8-b4eb-e78d2c23449e | 2 | public void levelNode(List<List<Integer>> result,TreeNode node,int level){
if(node == null)
return ;
if(level == result.size())
result.add(new ArrayList());
result.get(level).add(node.val);
levelNode(result,node.left,level+1);
levelNode(result,node.right,l... |
8e7de6df-15b8-4d46-80a7-6e542223bc1f | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GeneratorState other = (GeneratorState) obj;
if (rootUrl == null) {
if (other.rootUrl != null)
return false;
} else if (!rootUrl.equals(... |
e562cb21-3c37-4e24-a5d7-282b8ed38992 | 4 | @Override
public STAFResult execute(RequestInfo reqInfo) {
STAFResult result = super.execute(reqInfo);
if (result.rc == STAFResult.Ok) {
CommandAction command = null;
String parsedCommandName = (parseResult.numInstances() >= 2) ? parseResult.instanceName(2).toUpperCase() : null;
LOG.info("Looking for com... |
592c4df0-4e58-4945-98af-06c645cbf0cf | 2 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jButton1ActionPerformed
LoginWorker loginWorker = new LoginWorker();
loginWorker.execute();
while (!loginWorker.isDone()) {
}
if (Client.getUser() != null) {
this.setVisible(f... |
0e7b9d48-d39a-4703-bc8b-21cdd5a622f3 | 1 | public void changePassword(String username, String password) throws UserExistsException {
User user = getUserByUsername(username);
user.setPassword(password);
try {
saveUser(user);
} catch (UserExistsException e) {
throw new UserExistsException("Tne new password e... |
bc43c993-0940-4aff-87a9-0e70db36c321 | 9 | public void getMessage() {
try {
JSONObject params = new JSONObject();
JSONObject meta = new JSONObject();
meta.put("client_version", PANDA_CLIENT_VERSION);
meta.put("session_id", this.sessionId);
params.put("meta", meta);
JSONObject resul... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.