method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
e62804d2-f5ea-4917-9ffb-d806c4d24fbd | 8 | @Override
public boolean execute(MOB mob, List<String> commands, int metaFlags)
throws java.io.IOException
{
String parm = (commands.size() > 1) ? CMParms.combine(commands,1) : "";
if((!mob.isAttributeSet(MOB.Attrib.QUIET) && (parm.length()==0))||(parm.equalsIgnoreCase("ON")))
{
mob.setAttribute(MOB.Attri... |
4a115d44-659b-4c21-bb6a-2eafa9bb039a | 3 | public boolean validNeighbor(Coords start, Direction dir, Player player) {
boolean result = false;
Chip start_chip = this.getChip(start.getCoordsRow(), start.getCoordsCol());
Chip neighbor_chip;
Coords neighbor_coords = nextCoords(start, dir);
if(inBounds(neighbor_coords, dir))
... |
df297c9f-5826-419a-b211-6ee883c64435 | 1 | @Override
public void render() {
super.render();
if(!scoreSent) {
Player player = Application.get().getLogic().getGame().getPlayer();
Renderer.get().drawText("Your score:" + player.getExp(), x+5, y+5);
Renderer.get().drawText("Your initials:" + currentInp... |
46cc1d88-9b36-4cdf-9de3-365015727f52 | 0 | public void init() throws ServletException {
// Put your code here
} |
6af44bf6-cc7c-444f-94b0-4489d823c022 | 2 | private void checkName(final String name) {
if (named && name == null) {
throw new IllegalArgumentException("Annotation value name must not be null");
}
} |
fb26b1e9-ffc7-4fc1-a7a9-b31b1de26145 | 1 | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException, ClassNotFoundException, InstantiationException, SQLException, IllegalAccessException {
DAO dao = new DAO();
response.setContentType("text/html;charset=UTF-8");
... |
7e4628d2-9fbe-4ac2-9e1d-4a9909eda424 | 2 | public static GameType get(String name) {
GameType[] enums = GameType.class.getEnumConstants();
for (GameType enumm : enums) {
if (enumm.getType().equals(name)) {
return enumm;
}
}
return null;
} |
ba976b76-2c00-4afb-81c1-20cfa635ce86 | 8 | private boolean process_commands (int timeout_, boolean throttle_)
{
Command cmd;
boolean ret = true;
if (timeout_ != 0) {
// If we are asked to wait, simply ask mailbox to wait.
cmd = mailbox.recv (timeout_);
}
else {
// If we are aske... |
06579248-0967-493c-bf16-925b0b338fb4 | 2 | @Test
public void testClientWorkersCount() {
List<Map<String, Object>> workers = _clientWorkers.counts();
for (Map<String, Object> worker : workers) {
if (worker.get("name").equals(TEST_WORKER)) {
assertEquals("2", worker.get("jobs").toString());
} else {
assertEquals("1", worker.get("jobs").toStrin... |
487dd8a6-cd82-4709-916c-aa77daf55a69 | 9 | public void minOLBCost() {
sortResources();
sortClass();
calculateWeight();
dmMinminCost = new double[iSite][iCPUMaxNum];
dmMinminTime = new double[iSite][iCPUMaxNum];
double[] daMinminTimeBySite = new double[iSite];
// find the current cheapest site for the acitvities.
int k = 0;
while (getRestLeng... |
de2a56b6-da15-4966-a94b-ffd51aafb065 | 0 | public boolean isDuty() {
return Duty;
} |
11f1e9f9-c250-4ca7-8d2f-e53cb129d9c4 | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
AnonymousCallExecutor other = (AnonymousCallExecutor) obj;
if (proxy == null) {
if (other.proxy != null)
return false;
} else if ... |
6ef17aef-e9d8-4e6f-a349-3dd36fe2f978 | 4 | public void updateNeighbours(int x, int y, TileUpdateType type) {
if(inBounds(x, y+1)) getTile(x, y+1).OnNeighbourUpdate(this, x, y + 1, type);
if(inBounds(x, y-1)) getTile(x, y-1).OnNeighbourUpdate(this, x, y - 1, type);
if(inBounds(x+1, y)) getTile(x+1, y).OnNeighbourUpdate(this, x+1, y, type);
if(inBounds(x-... |
599493c1-d8f1-4784-a613-752e1cfc50ee | 1 | public void stop()
{
if(!isRunning)
return;
isRunning = false;
} |
ad9cb3aa-9837-447d-910d-a95345352bf4 | 1 | public static void swap(Object a, Object b) {
long sizeA = sizeOf(a);
long sizeB = sizeOf(b);
if (sizeA != sizeB)
throw new UnsupportedOperationException("Objects of different dimension can not be swapped.");
long temporaryInstanceLocation = $.allocateMemory(sizeA);
long temporaryInstanceLocation2 = $.allo... |
e7dfcbb9-2d65-4e92-90c4-dd50148c506e | 2 | private void resetCaches() {
if (priorityCache != null) priorityCache.clear();
if (structCache != null) structCache.clear();
} |
b50d4e2c-66cf-4d15-b9af-ae7e55b5a978 | 5 | private Collection idf(final Collection blocks, boolean reverse) {
if (domEdgeModCount != edgeModCount) {
computeDominators();
}
final HashSet idf = new HashSet();
final HashSet inWorklist = new HashSet(blocks);
final LinkedList worklist = new LinkedList(inWorklist);
while (!worklist.isEmpty()) {
f... |
46bee9a3-17b3-495b-804c-c51cba45b640 | 2 | public static String read(String fileName) {
StringBuilder sb = new StringBuilder();
try {
BufferedReader in = new BufferedReader(new FileReader(new File(
fileName).getAbsoluteFile()));
try {
String s;
while ((s = in.readLine()) != null) {
sb.append(s);
sb.append("\n");
}
} final... |
0599a03d-c9fe-4a0a-8560-3bd3a4d4a1e2 | 6 | public void DCT(double[][] input, double[][] output)
{
double total = 0.0;
for(int u = 0; u < 8; u++)
{
for(int v = 0; v < 8; v++)
{
for(int i = 0; i < 8; i++)
{
for(int j = 0; j < 8; j++)
{
total += Math.cos(((2*i + 1) * v * Math.PI)/16.0) * Math.cos(((2*j + 1) * u * Math.PI)/16... |
9b5d0ff5-c7c8-46ba-9114-59074a90a769 | 3 | public String getUserProfileJson() {
DefaultHttpClient httpClient = new DefaultHttpClient();
String output = null;
try {
// HttpGet httpGetRequest = new HttpGet("http://localhost:9090/spring-rest-service/rest/userprofiles");
// HttpGet httpGetRequest = new HttpGet("http://localhost:2020/mule-esb/rest/user... |
934d67cc-d5d2-47ab-8903-97c5e15b1a66 | 9 | public ArrayList<String> union(ArrayList<String> x, ArrayList<String> y) {
ArrayList<String> answer = new ArrayList<String>();
Collections.sort(x);
Collections.sort(y);
String docId1, docId2;
boolean isUndermost;
do {
docId1 = x.get(0);
docId2 = y.get(0);
isUndermost = false;
if (docId1.compareT... |
91064ca3-9482-4b14-b2d2-f9444975e577 | 1 | private void setupNoRandPartC() throws IOException {
if (this.su_j2 < this.su_z) {
int su_ch2Shadow = this.su_ch2;
this.currentChar = su_ch2Shadow;
this.crc.updateCRC(su_ch2Shadow);
this.su_j2++;
this.currentState = NO_RAND_PART_C_STATE;
} else... |
8118fa78-910b-4829-9b6b-871c42b62362 | 2 | private void loadDriver() {
if (driverLoaded)
return;
try {
// The newInstance() call is a work around for some
// broken Java implementations
Class.forName("com.mysql.jdbc.Driver").newInstance();
driverLoaded = true;
} catch (Exception ex) {
// handle the error
ex.printStackTrace();
}
... |
3f42368c-acf0-403a-a559-54512292b616 | 0 | @Override
public void startSetup(Attributes atts) {
// Set the Component
JButton component = new JButton("");
setComponent(component);
super.startSetup(atts);
component.addActionListener(this);
component.setActionCommand(getLabelText());
} |
c3bbf3b2-7038-4beb-885f-f09add9df865 | 1 | public Tile getTile()
{
Atom loc = getLoc();
if(loc == null) return null;
return loc.getTile();
} |
2c1a1149-c19e-42f6-85e4-2e57db412f7d | 2 | public Credit get(int id) {
Credit credit = new Credit();
try {
PreparedStatement statement = getConnection().prepareStatement(idQuery);
statement.setInt(1, id);
ResultSet result = statement.executeQuery();
if (result.next()) {
fillObject(c... |
e5e26dc8-4d1b-428d-b0ca-37432549ed2a | 8 | public static void main(String[] args) throws IOException {
// Load database
System.out.println("Loading database...");
database = DatabaseLoader.load();
if (database == null) {
System.out.println("Error loading database. Exiting.");
return;
}
System.out.println("Load complete. Found " + database.size... |
369298f5-fc5d-4c5a-a905-79545f99695a | 4 | protected boolean prepareAndCheckEOF() throws IOException
{
if (eof)
{
return true;
}
if (buf == null || next >= buf.length)
{
buf = guarded_take();
next = 0;
if (buf.length == 0)
{
eof = true;
... |
c73f7b83-a657-4378-8b8d-2163adea524e | 3 | private void fisica(ServidorCliente cliente, Servidor servidor) {
int x, y, dx, dy;
x = cliente.getPosicao().getX();
y = cliente.getPosicao().getY();
dx = cliente.getPosicao().getDx();
dy = cliente.getPosicao().getDy();
// de velocidade para posicao
x += dx;
//y += dy;
// velocidade
if (dx != 0){
... |
3de77a39-9bee-4ca9-b2a3-10c9457b8fb4 | 7 | void cost(int n, double x[], final double wtable[])
{
int modn, i, k;
double c1, t1, t2;
int kc;
double xi;
int nm1;
double x1h;
int ns2;
double tx2, x1p3, xim2;
nm1=n-1;
ns2=n / 2;
i... |
42cdf65b-23fb-4465-b995-24fd2f04d7c3 | 8 | private void complementoVariaveis(String tipoVar, String nomeVar) {
if (tipoDoToken[1].equals(" =")) {
String tipoValor = posIgualdade(tipoVar, nomeVar);
if(!checaSeExisteConstanteComEsteNome(nomeVar)){
if(varLocal2 == 0){
if(!checaSeExisteVariavelGlobalComEst... |
182eae84-6eee-44eb-8002-061546abf9fb | 6 | public static ArrayList<TestAttempt> getAttempts(Document doc){
File folder = new File(DocIO.SAVE_PATH+doc.getName());
File[] listOfFiles = folder.listFiles();
ArrayList<String> files = new ArrayList<String>();
for (int i = 0; i < listOfFiles.length; i++) {
if (listOfFiles[i].isFile()) {
files.add(listOf... |
8e3e36d4-6b85-4683-90c2-51d56674d927 | 3 | public Parser(File f, IdentifierTable t) throws Exception {
idTable = t;
scan = new Scanner(f, idTable);
env = new Environment();
// add builtin function names
if(inputNum == null) {
inputNum = idTable.addToTable("InputNum");
}
if(outputNum == null) {... |
431bde9c-131a-496a-aac0-0788a901179f | 1 | protected void updateList() {
listmodel.removeAllElements();
Vector<String> admins = database.getAllAdmin();
for (String e : admins)
listmodel.addElement(e);
} |
e507e524-a0ec-4358-9dbb-109b8c1d0b0a | 9 | @Test
public void testIsDeadLock() throws IOException {
FileInputStream fis = new FileInputStream("deadlock-cases.txt");
DataInputStream in = new DataInputStream(fis);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String line;
boolean shouldDeadlock;
Vector<String> lines = new Vector<... |
045509ec-2186-4561-af3d-f2a7b2f99eb3 | 7 | public String timeStampToDayOfWeek(int d) {
String day = "";
if(d == 0)
day = "Sunday";
else if(d == 1)
day = "Monday";
else if(d == 2)
day = "Tuesday";
else if(d == 3)
day = "Wednesday";
else if(d == 4)
... |
7b4e6a95-104f-41b3-836e-8e877f6ea0f1 | 8 | public static ArrayList<Item> getItemByName(String name){
Statement stmt=null;
String searchQuery="SELECT * FROM products WHERE name LIKE '%"+name+"%'";
items = new ArrayList<Item>();
try{
dbManager=DBManager.checkInstance();
con=dbManager.getFreeConnection();
stmt=con.createStatement();
rs=stmt.... |
caa3bad9-c18b-4938-9d19-bab6c31b947b | 9 | private static void GenericGetBucket() throws IOException
{
System.out.println("generic get bucket");
String bucketName="chttest1";
String fileName="apple.jpg";
String fileName2="photos/2006/January/sample.jpg";
String fileName3="photos/2006/February/sample2.jpg";
String fileName4="asset.txt";
String ... |
d5f2df99-e973-4df5-86b9-ac0b655c5717 | 7 | public void compFinalResult() {
do {
iStage++;
compAllocation();
if (compDistribution()) {
/* deadline can not be satisfied */
if (!bDeadline) {
System.out.println("CostMaxMin: THE DEADLINE CAN NOT BE SATISFIED!");
return;
} else {
System.out.println("\nNEW ROUND WITHOUT CHECKING:... |
da844755-c8e6-4db8-868f-73d2efa21bd0 | 9 | public boolean pickAndExecuteAnAction() {
try{
for(int i=0; i<Orders.size(); i++){
if(Orders.get(i).s == OrderState.needToRestock){
OrderFood(i);
return true;
}
}
for(int i=0; i<Orders.size(); i++){
if(Orders.get(i).s == OrderState.pending){
TryToCookIt(Orders.get(i), i);
retu... |
20851b45-cbc5-4d26-bb3b-196f3a09414f | 8 | public static byte[] decodeBase64(byte[] base64Data) {
// RFC 2045 requires that we discard ALL non-Base64 characters
base64Data = discardNonBase64(base64Data);
// handle the edge case, so we don't have to worry about it later
if (base64Data.length == 0) {
return new byte[0]... |
81bbaf9d-286f-4c6f-9644-f50d21748163 | 4 | public void checkcontext(Symtab st) {
SymtabEntry ste = st.lookup(name);
if (ste == null)
Main.error("invalid variable (" + name + ")");
if (ste.getScope() != null)
if (!ste.getScope().equals(scope))
Main.error("variable does not exist in this scope (" + name + ")");
if (ste.getType().startsWith("func... |
1ae59032-e5f8-4025-abf3-79252d6fc2de | 3 | private Long getVerticeInKWithPositiveDegreeUsingOnlyEdgesFrom(
List<Long> k, Set<Long> usableEdges) {
for (Long e : k) {
for (Long v : graph.getSourceTarget(e)) {
countAccess(1);
if (degreeWithinEdges(v, usableEdges) > 0) {
return v;
}
}
}
return NULL_IDX;
} |
65aa4097-16e8-4c48-aadd-eca56c7065d7 | 6 | public static void main(String[] args) throws Exception
{
HashMap<String, List<Holder>> dataMap =
getMap(ConfigReader.getJobinLabRNASeqDir() + File.separator + "12WeeksVs18WeeksPlusAnnotation.txt");
BufferedWriter writer = new BufferedWriter(new FileWriter(ConfigReader.getJobinLabRNASeqDir() + File.sepa... |
1c191fea-71fe-4042-a147-7941707463ee | 0 | private void loadAllCardImagesAndSetUpCardDimensions() {
CardImageLoadUp.loadAndSetUpAllCardImages(this);
Dimension d = CardImageLoadUp.getDimensionOfSingleCard();
cardWidth = d.width;
cardHeight = d.height;
} |
e3f9a54a-715f-4ced-8267-b7ab850f307a | 2 | private String codage(int code)
{
ArrayList<Byte> bytes = new ArrayList<Byte>();
for (ArrayList tab : this.tabBinary) {
if (tab.get(0).equals(code)) {
return tab.get(1).toString();
}
}
return "";
} |
334239b8-b03c-49c9-b894-33aeea38eb45 | 7 | public static void tick() {
ServerData.world.tick();
//NETWORKING STUFF
if(ticktime > 0){
//SENDING SHIP POSITION UPDATES
for(int i = 0; i < Config.maxShips; i ++) {
//IF IT EXISTS
if(ServerData.world.ships[i] != null) {
//SEND IT
ServerFunctions.sendShipPos(ServerData.world.ships[i], i);
}
... |
e02e9b35-3c04-40f6-82af-9c206db5b387 | 8 | public DetailMenu( final Laureate vonnegut) {
initComponents();
closeButton.addActionListener(new CloseListener(this)); //controls the single button on the window.
//set the labels with the Laureate's info
ImageURLLoader loader = new ImageURLLoader(portraitLabe... |
534e8e05-2877-42ad-ae1b-fdcf8ba8d61d | 2 | @Override
public void Consultar() throws SQLException
{
try
{
Conexion.GetInstancia().Conectar();
ResultSet rs = Conexion.GetInstancia().EjecutarConsulta("SELECT Nom_Proveedor,Dir_Proveedor,Tel_Proveedor,Ape_Proveedor,Email_Proveedor,Emp_Proveedor,RucEmp_Proveedor,DirEmp... |
85dcdca6-c469-481e-9d3e-753bbc10b791 | 6 | protected static Ptg calcFactDouble( Ptg[] operands )
{
if( operands.length != 1 )
{
return PtgCalculator.getNAError();
}
long n = PtgCalculator.getLongValue( operands );
if( new Double( n ).isNaN() ) // Not a Num -- possibly PtgErr
{
return PtgCalculator.getError();
}
if( n < 0 )
{
return ... |
d24d77c1-f574-46d7-a592-5193c056672a | 8 | private void positionDescWindow() {
boolean showDescWindow = descWindow!=null && ac.getShowDescWindow();
if (!showDescWindow) {
return;
}
// Don't use getLocationOnScreen() as this throws an exception if
// window isn't visible yet, but getLocation() doesn't, and is in
// screen coordinates!
Point p ... |
13e2bf04-cdb0-43cd-937d-7aad6ee16601 | 2 | public static RegionType toValue(String name) {
RegionType[] enums = RegionType.class.getEnumConstants();
for (RegionType enumm : enums) {
if (enumm.getType().equals(name)) {
return enumm;
}
}
return null;
} |
bf034b3a-fd72-4ef4-b97a-293512b2ebf9 | 8 | public void insert(EventPoint eventpoint) {
if (eventpoint.x > x || eventpoint.x == x && eventpoint.y > y) {
if (next != null) {
next.insert(eventpoint);
return;
}
next = eventpoint;
eventpoint.prev = this;
return;
}
if (eventpoint.x != x || eventpoint.y != y || (eventpoint instanceof C... |
a288e17e-5bb6-410f-8263-6fd89e75fee1 | 6 | public boolean equals(Object aObject) {
if (this == aObject) {
return true;
} else if (aObject instanceof Jornada) {
Jornada lJornadaObject = (Jornada) aObject;
boolean lEquals = true;
lEquals &= ((this.getCod_Jornada() == lJornadaObject.getCod_Jornada())
|| (this.getCod_Jornada() != null && this.ge... |
9d636677-cbd2-48c0-b647-25378fba2ddc | 4 | public static Bag loadDiscs() throws IOException {
LOGGER.log(Level.INFO, "Loading disc catalog..");
Bag allDisks = new Bag();
File[] manufacturers = new File("discs").listFiles();
for (File manufacturer : manufacturers) {
LOGGER.log(Level.INFO, "Reading discs for manufacturer ' " + manufacturer + "'");
... |
cfca3489-13c7-4380-8b61-95a03f468cdf | 3 | public static void writeChat(String args) {
subsubdirectory = subdirectory + File.separator + OKmain.getDate();
new File(subsubdirectory).mkdir();
File file = new File(subsubdirectory + File.separator + OKmain.chatlogname + ".txt");
if (!file.exists()) {
try {
... |
e95cf346-0fc4-4f72-b277-7000a132b55a | 1 | public static void main(final String[] args) {
try {
final Map settings = readSettings();
final String data = (String) settings.get("csvFile");
call(data);
} catch (final Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
... |
0a38debe-8992-457e-8415-8d989fe76813 | 0 | @Override
public Set<String> getGroups() {
return getList(groupYamlConfiguration);
} |
c9bcd2f4-4499-49f7-9bb9-351309a810fb | 6 | @Override
public void run() {
System.out.println(getId() + "# - New Thread at time: " + System.currentTimeMillis());
// zu Beginn werden die IO Streams initialisiert
initReaderPrinter();
// solange der Client noch verbunden ist und noch kein BYE gesendet hat
// werden die ... |
daab6319-608a-4026-a3ac-639ce159eba9 | 0 | public String getName() {
return _name;
} |
8ff3553c-7964-4082-be88-7645237d3b74 | 6 | public static void main(String[] args) {
// create flow network with V vertices and E edges
int V = Integer.parseInt(args[0]);
int E = Integer.parseInt(args[1]);
int s = 0, t = V-1;
FlowNetwork G = new FlowNetwork(V, E);
StdOut.println(G);
// compute maximum flo... |
c0f801c7-cb1b-4384-9f18-c1893eb9abd5 | 3 | public double dameGananciaMedia(Nodo n) {
int ganancia = 0;
int num = 0;
for (Nodo ady : memoria.getAdjacents(n)) {
if (!ady.isEstimacion()) {
ganancia += ady.ganancia;
num++;
}
}
if (num != 0) {
return ganancia / num;
}
return 0;
} |
accd6dd9-d50d-4197-a704-40692507ee6a | 2 | public static String sanityzeName(String fileName) {
String out = fileName.trim().replaceAll("[^0-9_a-zA-Z\\.]", "_");
out = out.replaceAll("_+", "_");
if (out.startsWith("_")) out = out.substring(1);
if (out.endsWith("_")) out = out.substring(0, out.length() - 1);
return out;
} |
10405fd3-8666-4b75-ab51-ef927421d096 | 2 | public static void main(final String[] args) throws Exception {
if (args.length != 1) {
System.err.println("Verifies the given class.");
System.err.println("Usage: CheckClassAdapter "
+ "<fully qualified class name or class file name>");
return;
}
ClassReader cr;
if (args[0].endsWith(".class")) {
... |
906cf94c-9be1-40de-ac7f-a40b8011f9c2 | 8 | public boolean generate(World var1, Random var2, int var3, int var4, int var5) {
for(int var6 = 0; var6 < 20; ++var6) {
int var7 = var3 + var2.nextInt(4) - var2.nextInt(4);
int var8 = var4;
int var9 = var5 + var2.nextInt(4) - var2.nextInt(4);
if(var1.isAirBlock(var7, var4, var9... |
f8cb1b45-7606-4d03-9537-0c9c4c417e0f | 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... |
0c155389-8405-4713-94bf-83ae0771ba9f | 9 | protected static MemberItem[] memberList(MemberItemRoot _root, Class<?> _c,
Class<? extends Annotation>[] annot, MemberItemField MemberOf) {
Vector<MemberItem> x = new Vector<MemberItem>();
int i;
java.lang.reflect.Field f;
java.lang.reflect.Method m;
for (i = 0; i < _c.getFields().length; i++) {
f = _c... |
87c1b653-2998-492f-906b-17141b44fffd | 1 | public Item getFirstItemOnPosition(Position pos) {
if (getGrid().getItemsOnPosition(pos).size() > 0)
return getGrid().getItemsOnPosition(pos).get(0);
return null;
} |
2b795e00-12f3-4d6a-aab4-4f70ae82b050 | 7 | private Map<Position, Tile> createTileMapFromStrings(String[] tileStringArray){
Map<Position, Tile> tileMap = new HashMap<Position, Tile>();
for(int i = 0; i < 16; i++){
String line = tileStringArray[i];
for(int j = 0; j < 16; j++){
char c = line.charAt(j);
... |
e400a623-dd9d-4f60-8712-104c64ca598b | 1 | public boolean isComment() {
return arg.length() > 0 && arg.charAt(0) == '#';
} |
bd84c4cd-0a8a-445a-bca8-69f3a96dc3c9 | 0 | @Override
public String getLastName() {
return super.getLastName();
} |
43d7f51f-a6f0-4f03-a558-2e4f60559732 | 8 | void add(Node<K, V> node) {
node.left = node.parent = node.right = null;
node.height = 1;
// Skip a leaf if necessary.
if (leavesToSkip > 0 && (size & 1) == 0) {
size++;
leavesToSkip--;
leavesSkipped++;
}
node.parent = stack;
stack = node; // Stack pus... |
392b22bc-fdad-4d62-a423-a2ac5bc6e565 | 7 | @EventHandler
public void onPotionSplash(final PotionSplashEvent event) {
if (event.getPotion().getShooter() instanceof Player) {
final WarPlayer thrower = this.war.getHelper().getPlayerExact(((Player) event.getPotion().getShooter()).getName());
for (final LivingEntity entity : even... |
a6c9edcb-a897-4da8-9086-0f33a215e22a | 3 | public static JSONObject toJSONObject(String string) throws JSONException {
String name;
JSONObject jo = new JSONObject();
Object value;
JSONTokener x = new JSONTokener(string);
jo.put("name", x.nextTo('='));
x.next('=');
jo.put("value", x.next... |
3c7f9287-12b2-4841-8dc6-7e445f825d5d | 4 | public MediaPanel( URL mediaURL)
{
setLayout( new BorderLayout() ); // use a BorderLayout
// Use lightweight components for Swing compatibility
Manager.setHint( Manager.LIGHTWEIGHT_RENDERER, true );
try
{
Format[] inFormats = { new VideoFormat ("DIVX") };
Format[] inFormats2 = { new AudioFormat ("mpe... |
459663ee-8047-4e71-8a8f-83ea4d479365 | 5 | private void getBatteryInfo() {
new Thread() {
@Override
public void run() {
setName("Battery Info Thread");
setPriority(Thread.MIN_PRIORITY);
while (getDeviceInfo) {
// if (debug)
// logger.log(Lev... |
4984e95d-888b-452d-a02a-56269efa46ee | 2 | private void shrink() {
if (Math.random() >= 0.5) {
width--;
}
if (Math.random() >= 0.5) {
height--;
}
} |
f7aec6f8-da2d-40ef-a83f-9fc65b8acdd0 | 7 | public SearchCompany() {
setModal(true);
setIconImage(Toolkit.getDefaultToolkit().getImage(SearchPerson.class.getResource("/InterfazGrafica/Images/Search.png")));
setTitle("BUSQUEDA");
setBounds(100, 100, 450, 210);
getContentPane().setLayout(new BorderLayout());
contentPanel.setBorder(new EmptyBorder(5, 5,... |
2b09de9f-1a42-49b7-856d-136502e6d65b | 2 | public void submitNewScore() {
for (Component p : getParent().getComponents()) {
if (p instanceof LeaderboardsPanel) {
((LeaderboardsPanel) p).addScore(name, finalScore[4]);
newHighScore = ((LeaderboardsPanel) p).isNewHighscore(finalScore[4]);
}
}
... |
e5c04499-e2ee-4654-94d4-e56516fb6601 | 2 | @Override
public void layoutContainer(Container parent) {
Insets insets = parent.getInsets();
int height = mHeader.getPreferredSize().height;
int width = parent.getWidth() - (insets.left + insets.right);
mHeader.setBounds(insets.left, insets.top, width, height);
Dockable current = getCurrentDockable();
if ... |
2bb53ca9-963c-4696-adb8-5bea758e2ab5 | 6 | private void censored(int row) {
if (!MyFactory.getResourceService().hasRight(MyFactory.getCurrentUser(), Resource.CENSORED)) {
return;
}
InDetail selectedRow = result == null ? null : result.get(row);
if (selectedRow != null) {
int result = JOptionPane.showConfir... |
5c5ebfd5-79c5-42cd-bef1-519fd72b4472 | 1 | @Override
public void setDirection( Direction direction ) {
if( direction == null ) {
throw new IllegalArgumentException( "direction must not be null" );
}
this.direction = direction;
} |
150c1618-2d39-44db-a474-0afcbc6b7bc3 | 1 | public AnnotationVisitor visitParameterAnnotation(int parameter,
String desc, boolean visible) {
AnnotationVisitor av = mv.visitParameterAnnotation(parameter,
remapper.mapDesc(desc), visible);
return av == null ? av : new RemappingAnnotationAdapter(av, remapper);
} |
d0a5bff4-d41e-4c3f-90aa-cd20f1119be0 | 3 | public static boolean getBoolean(String buffer) {
buffer = normalize(buffer);
return "true".equalsIgnoreCase(buffer) || "yes".equalsIgnoreCase(buffer) || "on".equalsIgnoreCase(buffer) || "1".equals(buffer); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
} |
7644c905-ab48-41d2-ac37-8b12b61c0ed6 | 5 | public void actionPerformed (ActionEvent event){
for(int k=0; k <= usableIndex; k++) {
objects[k].moveX();
objects[k].moveY();
objects[k].updateCenter();
if (objects[k].getX() <= 0 || objects[k].getX() >= WIDTH-objects[k].getImageSize()){
objects[k].changeXDirection();
... |
a7137f60-b6c4-418c-a160-d4c9296071a0 | 8 | @Override
public void doLoopAction() {
if (stageObject.isFall() && !goingUp) {
goingUp = false;
upTeller = 0;
while (stageObject.checkCollisionMap(stageObject.getX(), stageObject.getY() + fallsize) != Collision.NONE && fallsize != 0) {
fallsize--;
... |
85ea48ff-29a9-45cf-92f7-cdfb0660da29 | 7 | public static void testValidity(Object o) throws JSONException {
if (o != null) {
if (o instanceof Double) {
if (((Double)o).isInfinite() || ((Double)o).isNaN()) {
throw new JSONException(
"JSON does not allow non-finite numbers.");
... |
0f06ee77-6a0a-4663-ab8a-956af52ef27b | 5 | public SSLSocketChannel2( SocketChannel channel , SSLEngine sslEngine , ExecutorService exec , SelectionKey key ) throws IOException {
if( channel == null || sslEngine == null || exec == null )
throw new IllegalArgumentException( "parameter must not be null" );
this.socketChannel = channel;
this.sslEngine = s... |
0c29c3b4-b55f-46ba-a625-65a5f2d8bb3e | 6 | public static void printTypes(Type[] types, String pre, String sep, String suf,
boolean isDefinition)
{
if (pre.equals(" extends ") && Arrays.equals(types, new Type[] { Object.class })) return;
if (types.length > 0) System.out.print(pre);
for (int i = 0; i < types.length; i++)
{
... |
8649aee6-b61e-447b-aee4-543e39293946 | 1 | @Override
public int hashCode() {
int hash = 0;
hash += (reportId != null ? reportId.hashCode() : 0);
return hash;
} |
8e43d3d9-7b52-4cf6-ad71-a48a4a4dde2f | 5 | public static int mainHandler(String s, char[] chars, int i) {
ControlWordsHandler controlWordsHandler = new ControlWordsHandler();
if (s.equals("b")) return controlWordsHandler.boldHandler(chars, i);
if (s.equals("i")) return controlWordsHandler.italicHandler(chars, i);
if (s.equals("... |
efb7a884-ee6a-4a0d-a753-cf825def3f18 | 9 | public void add(String sentence) {
sentence = sentence.trim();
String[] parts = sentence.split("(?!^)\\b");
if (parts.length >= 4) {
for (int i = 0; i < parts.length - 3; i++) {
MdBtQuad mdBtQuad = new MdBtQuad(parts[i], parts[i + 1],
parts[i + 2], parts[i + 3]);
mdBtQuad.setCanStart(i == 0);
... |
3a7655ab-cb79-4622-9ba7-7489b7f3c757 | 7 | public void transmitOutputWater(){
InfoPacket info = outputWater();
Double watertemperature = 0.0;
Double totalOutput = 0.0;
Pair<?> currentPair;
Label currentLabel;
Iterator<Pair<?>> pairIt = info.namedValues.iterator();
while (pairIt.hasNext()) {
currentPair = pairIt.next();
currentLabel = current... |
7ac35e29-f06e-4ab4-b685-0167c507f126 | 4 | private Tile[] moveLine(Tile[] oldLine) {
LinkedList<Tile> l = new LinkedList<>();
for (int i : _0123) {
if (!oldLine[i].empty())
l.addLast(oldLine[i]);
}
if (l.size() == 0) {
// list empty, oldLine is empty line.
return oldLine;
... |
19705564-da5d-473f-b398-11ae495091c3 | 0 | public Long getClientId() {
return conn.getCurrentConnectionInfo().getIdConnection();
} |
6739501e-b6ec-4ae7-83cd-75fe13b535ff | 8 | private void processChildren(URL codebaseURL, Element node) throws InvalidJNLPException {
//Get the Children
NodeList nodes = node.getChildNodes();
for(int i=0;i<nodes.getLength();i++) {
Node cNode = nodes.item(i);
String nodeName = cNode.getNodeName();
//sk... |
7d4a8332-673a-4abd-9ea0-9bb31e28447e | 0 | public static void setMaxLitterSize(int newMAX_LITTER_SIZE)
{
MAX_LITTER_SIZE = newMAX_LITTER_SIZE;
} |
af5e57b8-617e-4647-9e68-45c177c509b8 | 3 | public final void unreadFrame() throws IOException {
if (wordpointer == -1 && bitindex == -1 && (framesize > 0)) {
source.unread(frame_bytes,0,framesize);
}
} |
ff95382f-c346-434c-8a85-e90dae8980f3 | 0 | @Override
public IautosCarInfo clone() throws CloneNotSupportedException {
return (IautosCarInfo) super.clone();
} |
626a021d-7bf5-4785-91af-6b04801f42c1 | 9 | public Move pickBestMove(Board aBoard, int theColor)
{
if (!Board.legitColor(theColor)) {
throw new IllegalArgumentException("StartGame.pickBestMove( ) got bad color '" + theColor + "'");
} else {
currColor = theColor;
}
if (aBoard == null) {
throw... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.