method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
3b246468-1139-4900-8d19-feb711c98f76 | 4 | public void loadFiles() {
for (Files file : Files.values()) {
File confFile = new File(file.getPath());
if (confFile.exists()) {
if (_configurations.containsKey(file)) {
_configurations.remove(file);
}
YamlConfiguration conf = YamlConfiguration.loadConfiguration(confFile);
_configurations.... |
d00f08e0-1f06-4dff-b7a0-e3e40c65d0a9 | 6 | public boolean getBoolean(int index) throws JSONException {
Object o = get(index);
if (o.equals(Boolean.FALSE) ||
(o instanceof String &&
((String)o).equalsIgnoreCase("false"))) {
return false;
} else if (o.equals(Boolean.TRUE) ||
(o in... |
c66ebacd-1554-410a-86ce-6e5bacc2a4d4 | 5 | @Override
public int compareTo(Team o) {
if (o.points == this.points)
if (o.wins == this.wins)
if (o.goalDiference == this.goalDiference)
if (o.goalScored == this.goalScored)
if (o.games == this.games)
return this.name.toLowerCase().compareTo(
o.name.toLowerCase());
e... |
8b3faf63-3318-4f6b-8c6c-cf173e5b4ae2 | 5 | public static String[][] board(int row, int column, String user,
String boardArray[][]) {
for (int i = 0; i < 3; i++) {
System.out.println("-------------");
for (int j = 0; j < 4; j++) {
System.out.print("| ");
if (i == row && j == column) {
boardArray[i][j] = user;
} else if (boardArray[i][... |
9e9ba0e7-d004-4ede-8e93-c77962318cd6 | 2 | public static ASTList concat(ASTList a, ASTList b) {
if (a == null)
return b;
else {
ASTList list = a;
while (list.right != null)
list = list.right;
list.right = b;
return a;
}
} |
51639194-b66c-4051-ab3e-fd6c45938cd4 | 8 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Cartao other = (Cartao) obj;
if (dezenas == null) {
if (other.dezenas != null)
return false;
} else if (!dezenas.equals(other.dezenas))
... |
55cc073d-761c-416f-ab73-6724b86cfd56 | 6 | public void run() {
ircConnection.isRunning = true;
try {
String line = ircConnection.input.readLine();
while (ircConnection.isRunning && !this.ircConnection.waitingForReconnect && (line != null)) {
if (ircConnection.debug) {
System.out.println("< " + line);
}
Iterator itr = ircConnection.han... |
2d60afe5-2db5-4901-af4d-45d00d5a08b0 | 0 | public Osoba getOsoba() {
return osoba;
} |
1aad70a8-ebec-41c6-bf60-745451e984d9 | 4 | public JSONWriter key(String string) throws JSONException {
if (string == null) {
throw new JSONException("Null key.");
}
if (this.mode == 'k') {
try {
this.stack[this.top - 1].putOnce(string, Boolean.TRUE);
if (this.comma) {
... |
cf3a4e0b-d4d3-4c8d-807d-54a0f4066598 | 6 | @Override
public void run() {
// ustawienie flagi informującej, że wykonywanie komend jest w toku
if(!ExecuteCmdTask.plugin.execFlag) {
ExecuteCmdTask.plugin.execFlag = true;
} else if(this.fromExecTask == false) {
return;
}
// jeśli coś czeka w kolejce
if(!ExecuteCmdTask.plugin.cmdQueue.isEmpty()... |
25a30878-502f-4ddd-98d3-82072f6fe18f | 8 | @Override
public boolean tick(Tickable ticking, int tickID)
{
if(!super.tick(ticking,tickID))
return false;
if(affected==null)
return false;
if(affected instanceof Room)
{
final Room room=(Room)affected;
if(!room.getArea().getClimateObj().canSeeTheMoon(room,this))
unInvoke();
else
for(in... |
4f49750c-e57e-4861-a079-567288e93eda | 3 | private static int expectBoolean ( Object value ) throws SocketException {
int v;
try {
v = ( (Boolean) value ).booleanValue() ? 1 : 0;
}
catch ( ClassCastException e ) {
throw new AFUNIXSocketException("Unsupport value: " + value, e);
}
catch ( Nu... |
d022d0fc-3251-4071-9d2b-5b5160b1b65a | 4 | public void createWeights()
{
WordWeight wordWeight = new WordWeight(this.startWord, 0);
this.wordWeight.put(this.startWord, wordWeight);
char alphabetLetter;
int i;
//label used for breaking loop
outerLoop:
while(!(this.queue.isEmpty()))
{
char[] splitWord = this.queue.get(0).toCharArray();
... |
d8ed4a9d-5f58-44de-ac25-a4516330ca9e | 0 | private void setFitnessValues() {
individuals.stream()
.forEach(chromo -> chromo.setFitness(computeFitness.apply(chromo)));
fittestChromo = individuals.stream()
.sorted((i1, i2) -> Double.compare(i2.getFitness(), i1.getFitness()))
.findFirst().get();
} |
7f6bc06b-5e92-4fbc-a99d-8a96b3dd07e9 | 8 | @Override
public void run() {
/////////////////////////////////////////////
// iterations 0 to max-1
setToleranceAsFraction(initialToleranceFraction);
bom.resetSummary();
int numIts = 0;
while (numIts < maxIts) {
if (numIts > 0) {
// update parameters based on previous results
... |
1a74ada9-257f-46f4-b69b-d0fae5a9862c | 0 | public Gem(int x,int y)
{
super(x,y);
} |
f02582cd-68f0-4b4a-916f-bdd560c8c656 | 0 | public void setDigestMethod(DigestMethodType value) {
this.digestMethod = value;
} |
ac785b82-2508-4870-be59-2df5834be5a0 | 2 | public void run() {
do {
if (failed >= 3) {
}
} while (true);
} |
96bf727d-84e6-43fd-8278-a65863283f88 | 4 | @Override
public void run(){
isAlive = true;
try{
PrintWriter printWriter = new PrintWriter(socket.getOutputStream());
while(isAlive){
synchronized (messageList){
while(!messageList.isEmpty()){
printWriter.println(me... |
1fc44334-8edb-4eab-8429-8513f807a11e | 7 | @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
CacheKey other = (CacheKey) obj;
if (this.last... |
3fd06e23-6160-4d75-b107-e1b260febbe9 | 5 | private void setEncoding(){
String encoding = "cp1251";
//if(Environment.isWin()) encoding = "Cp866";
if(Environment.isWin()) encoding = "utf8";
else if (Environment.isMac()) encoding = "utf8";
else if (Environment.isUnix()) encoding = "utf8";
message(Environment.getOsN... |
fee980da-4f97-410d-b11f-ef4c17dcb307 | 8 | static public void main(String[] args) throws SAXException, IOException {
InferHandler handler = new InferHandler(new DatatypeLibraryLoader());
XMLReaderCreator xrc = new Jaxp11XMLReaderCreator();
XMLReader xr = xrc.createXMLReader();
xr.setContentHandler(handler);
for (int i = 0; i < args.length; i... |
66104efe-ecd7-4f56-9ed0-7c7a89e62c5b | 0 | static boolean test1(int val) {
System.out.println("test1(" + val + ")");
System.out.println("result: " + (val < 1));
return val < 1;
} |
6e561d28-b065-4311-8e27-8774945ebca8 | 8 | private static int decode4to3(
byte[] source, int srcOffset,
byte[] destination, int destOffset, int options ) {
// Lots of error checking and exception throwing
if( source == null ){
throw new NullPointerException( "Source array was null." );
} // end if
... |
d0af30fc-e4d1-4017-ae71-37bd2a36d23f | 0 | private void clearFields() {
initQuantity();
initTotalAmount();
initItemCounter();
txtBarCode.clear();
txtBarCode.requestFocus();
table.getItems().clear();
hideChange();
countCustomers();
updateItemCounter(0);
} |
f2ef3f97-2eef-4f04-bc29-84c2936a04b3 | 1 | public void removeTab(AbstractTab tab) {
remove(tab);
if ( getComponentCount() == 0 )
MainWindow.getInstance().resetTitle();
} |
896d8c2e-bc0c-41d7-acd8-04a6f298e688 | 3 | public void execute()
throws MojoExecutionException, MojoFailureException {
if (workingDirectory == null) {
try {
BSFManager.registerScriptingEngine("ruby", JRubyEngine.class.getName(), new String[]{"rb"});
BSFManager rubyManager = new BSFManager();
... |
7ab765e9-256b-48ba-bcdd-66d0b614b6af | 8 | @EventHandler
public void handleDamage(EntityDamageEvent event) {
Entity entity = event.getEntity();
if (entity instanceof Player) {
Player player = (Player) entity;
Cuboid cuboid = Cuboid.getCuboid(player.getLocation());
if (cuboid != null) {
if (cuboid.hasEvent(CuboidEvent.God)) {... |
5bc6d89f-3c81-4ad1-9df2-bd5b3913415f | 9 | public static Automaton makeInterval(int min, int max, int digits) throws IllegalArgumentException {
Automaton a = new Automaton();
String x = Integer.toString(min);
String y = Integer.toString(max);
if (min > max || (digits > 0 && y.length() > digits))
throw new IllegalArgumentException();
int d;
if (di... |
211b52f9-6b52-4c38-addc-228ca4d7a6bc | 8 | void checkTryCatchOrder() {
/*
* Check if try/catch ranges are okay. The following succeeds for all
* classes generated by the sun java compiler, but hand optimized
* classes (or generated by other compilers) will fail.
*/
Handler last = null;
for (Iterator i = handlers.iterator(); i.hasNext();) {
... |
9e918fba-738f-497e-b84d-5d67d34465c9 | 0 | public static Image getMirrorImage(Image image) {
return getScaledImage(image, -1, 1);
} |
cbac830f-ed39-41b3-a7c2-a12ab196f194 | 2 | public void setTribe(String name) throws InvalidFieldException {
String[] s = GameData.getCurrentGame().getTribeNames();
name = name.trim();
if (!name.equalsIgnoreCase(s[0]) && !name.equalsIgnoreCase(s[1])) {
throw new InvalidFieldException(
InvalidFieldException.Field.CONT_TRIBE, "Invalid Tribe.");
}
... |
41fcdfab-2eb5-4f02-845d-d6e2bc9755c9 | 3 | public ThePlayer getThePlayer()
{
for (int r = 0; r < getNumRows(); r++)
{
for (int c = 0; c < getNumCols(); c++)
{
Location loc = new Location(r, c);
if (get(loc) instanceof ThePlayer)
return (ThePlayer) get(loc);
... |
5c064bc2-2ff4-4cd8-a165-bc367db16b58 | 6 | @EventHandler
public void PlayerMiningFatigue(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.getPlayerConfig().getDouble("Player.M... |
5a766cde-4904-4946-bf97-4751dfd14a84 | 8 | public Path findCircuit(int citiesRemaining, Vertex home, Graphics g)
{
this.visited = true;
Path bestPath = new Path();
bestPath.cost = 1000000000;
if(citiesRemaining == 0)
{
//Checks this node's edges to
//find the edge that goes back home
for(Edge e : this.edges)
{
if(e.toV... |
f3c165f2-8c23-4655-9665-d7af78570a0e | 0 | public JTextField getTimePeriodTextField() {
return timePeriodTextField;
} |
627c16eb-9c84-4e07-aeb1-f0e1b5cca10e | 9 | @Override
public HashMap< String, String > getResult(String SQL)
{
HashMap< String, String > tableColInfo = new HashMap< String, String >();
Datenbank db = (Datenbank)this.context.getObject("cms.datenbank", ContextType.USED, null);
if((SQL.toLowerCase()).indexOf("insert") == ... |
b6879dde-2403-46c0-9ca5-8190bc3eaef8 | 8 | private void buy(String type, int id) throws DataBaseConnectorException {
if(type != null){
int cost = -1;
if(type.equals("$tank$")){
cost = dataBaseConnector.getTankCost(id);
} else if(type.equals("$armor$")){
cost = dataBase... |
dc87c004-d76d-459e-ae5b-7b4817b8092d | 0 | public void setCtrFecha(int ctrFecha) {
this.ctrFecha = ctrFecha;
} |
cb6dbe76-0c83-4f66-afc4-de3718784972 | 2 | boolean classCreationAllowed(Chain<SootClass> classes, String classname){
boolean bool = true;
for (SootClass cl : classes){
if(cl.getName().equals(classname)){
bool = false;
break;
}
}
return bool;
} |
af7bbb09-e555-44f1-b687-94a190dc82f4 | 7 | public void validar(ActionEvent event) {
if (event.getComponent().getId().equals("validarId")) {
try {
FacesContext context = FacesContext.getCurrentInstance();
HttpServletResponse response = (HttpServletResponse) context
.getExternalContext().getResponse();
Usuario us = new Usuario();
Usuari... |
b1915e0a-0a8b-4995-b6b1-9ff6d434e8e1 | 1 | public void dumpExpression(TabbedPrintWriter writer)
throws java.io.IOException {
if (!isInnerMost) {
writer.print(writer.getClassString(classInfo, Scope.AMBIGUOUSNAME));
writer.print(".");
}
writer.print("this");
} |
50c7ddb4-a453-423b-8b05-9c66cb1676b0 | 6 | Object put(Object key, Object value)
throws IOException {
if (value == null) {
return remove(key);
}
int hash = hashCode(key);
long child_recid = _children[hash];
if (child_recid == 0) {
// no bucket/page here yet, let's create a bucket
Has... |
c6829533-ddb6-4321-b190-0b52e60b0df8 | 7 | public Vector obtenerOfertasIncluidasEntre(java.sql.Date diaIni,
java.sql.Date diaFin) {
Vector vector = new Vector();
try {
java.sql.Date dateAuxIni;
java.sql.Date dateAuxFin;
String numReserva;
Oferta oferta;
Enumeration e = this.ofertas.elements();
while (e.hasMoreElements()) {
oferta = ... |
e4cf3ced-7b8b-4c97-afdc-7e8c5ba8fe70 | 4 | public static String toString(JSONObject jo) throws JSONException {
StringBuffer sb = new StringBuffer();
sb.append(escape(jo.getString("name")));
sb.append("=");
sb.append(escape(jo.getString("value")));
if (jo.has("expires")) {
sb.append(";expires=");
s... |
026b0f98-db00-4b1b-bd6d-6599363991b1 | 4 | private void checkCollisions(GameContext g) {
if (isResolved()) {
return;
}
List<Collidable> possibleCollisions = g.quadTree.retrieve(new ArrayList<Collidable>(),this);
float percent;
for (Collidable c : possibleCollisions) {
if (!c.isResolved()) {
if ((percent = Collisions.detectCollision(this,c... |
323ff9ee-a9ec-475d-af63-c9b444718a8d | 7 | private void unicast (Message m, int delay) {
int src = m.getSource();
int dst = m.getDestination();
Record source = r.find (src);
Record destination = r.find (dst);
if ((source == null) || (destination == null)) {
/* In this unlikely event. */
String msg =
String.format("Error: link <P%d, ... |
9adadb99-5523-4146-87f3-3b6c2f27ba7c | 0 | public int getMana()
{
return mana;
} |
c57c276f-c806-49b4-87f5-34cf80b1f186 | 9 | private LinkedList<BasketballPlayer> getPlayers(){
LinkedList<BasketballPlayer> players = new LinkedList<BasketballPlayer>();
if(pointGuard1 != null){
players.add(pointGuard1);
}
if(pointGuard2 != null){
players.add(pointGuard2);
}
if(shootingGuard1 != null){
players.add(shootingGuard1);
}
if(s... |
4a8d628d-ca56-4345-94d4-72ff1b606d3f | 9 | @Override
public void setupSurface(Surface surface, Face direction) {
this.surface = surface;
//get the warped texture image
surfaceTexture = warpImage("/texture/" + surface.roomView.room.getWallTexture() + ".png");
//set bounds for the surface
surfaceWidth = surface.roomView.width / 4;
surfaceHeight =... |
0c9767d3-fb5c-4713-9dc9-79b3c6e7d5ee | 0 | public void setBlogDelegate(BlogDelegate blogDelegate) {
this.blogDelegate = blogDelegate;
} |
84ed8693-6fc4-4591-b388-8f812e6741a5 | 2 | public int print(Graphics g, PageFormat fmt, int index) {
if(index > 0) return Printable.NO_SUCH_PAGE;
int n = jcb.getSelectedIndex();
try { return pg.getPrintable(n).print(g, fmt, n); }
catch(Exception ex) {}
return Printable.PAGE_EXISTS;
} |
3ced45e2-b322-4fcd-9755-50b812fc2751 | 5 | public Tuple<Integer,Integer> getAnyUncapturedMosquito ( int[][] board ) {
List<Tuple<Integer,Integer>> uncapturedMosquitoes = new ArrayList<Tuple<Integer,Integer>>();
Tuple<Integer,Integer> mosquito = null;
for ( int i = 0; i<100; i++ ) {
for ( int j = 0; j<100; j++ ) {
if ( board[i][j] > 0 ) {
Tuple... |
605aaf6a-2083-4800-a094-c22ea3d709e3 | 8 | private static void findBitSets(int size, int cardinality, BitSetStrategy strategy) {
if (Thread.currentThread().isInterrupted()) {
throw new RuntimeException("Timed out.");
}
if (size < cardinality) {
return;
}
BitSet b = new BitSet(size);
if (cardinality == 0) {
strategy.execute(b);
return;
... |
d4ea2788-afc2-49f8-a07a-1bfdf2be045c | 8 | public void updateRecord(long now, DNSRecord rec)
{
// We do not want to block the entire DNS while we are updating the
// record for each listener (service info)
List listenerList = null;
synchronized (this)
{
listenerList = new ArrayList(listeners);
}
... |
0fb0bc65-a27a-42fd-aad9-426c2a9735e5 | 6 | public static void showGUI(){
/*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.
... |
af6ab1a3-90c9-4050-bb3d-c65a77cffbce | 8 | private ArrayList<Group> setV1ToCoverNextTer(HashSet v1Marked, HashSet v1Set, ArrayList<Integer> uncoveredV2) {
//v1Marked = conjuntos dos nos de I que ja foram marcados
ArrayList<NodeDegree> sortedMarked = new ArrayList<NodeDegree>();
Iterator<Integer> it = v1Marked.iterator();
while(it.hasNext()) {
int ... |
553effde-5b57-4369-9947-cbcb8370a5ef | 8 | private void remove(){
List<Map.Entry<String, Integer>> folder = new ArrayList<Map.Entry<String, Integer>>(frqMap2.entrySet());
Collections.sort(folder, new Comparator<Map.Entry<String, Integer>>() {
public int compare(Map.Entry<String, Integer> e1,
Map.Entry<S... |
cfdbb08e-2af2-4798-8df4-2230f83717aa | 0 | public double mean()
{
//**************************
return this.mean;
//**************************
} |
dfb7a49b-a39b-4cb7-9f8a-4ad7ed23310d | 0 | public synchronized void logout(String robot_name) {
robots.remove(robot_name);
} |
526d2999-9464-496b-8ff3-2e5a5e8203a5 | 9 | boolean IsStandardToken(char data){
//Pre:
//Post:
if ( data >='a' && data <= 'z' ||
data >='A' && data <= 'Z' ||
data >= '0' && data <='9' ||
data == '_' ||
data == '.' ||
data == '-')
return true;
... |
e9c764db-4aef-4b61-85fd-b5243d491783 | 3 | public void skipToSequenceNumber(int sid, int sequenceNumber) throws IOException {
OggPacket p = null;
while( (p = getNextPacket()) != null ) {
if(p.getSid() == sid && p.getSequenceNumber() >= sequenceNumber) {
nextPacket = p;
break;
}
}
... |
bb3dc060-415c-4461-bac0-266186a18600 | 4 | public static String tensionUnitIndexToString(int index) {
switch (index) {
case 0:
return "N";
case 1:
return "lbf";
case 2:
return "kgf";
case 3:
return "daN";
default:
r... |
43f9f50d-3203-49f2-ae74-e0d5bc40277f | 0 | public Order() {
} |
75961031-13f1-4f35-a2c2-054f717509fe | 7 | private static int parseArgs(String[] args, HamaConfiguration conf,
BSPJob bsp) {
conf.set(inputMatrixAPathString, args[0]);
conf.setInt(inputMatrixARows, Integer.parseInt(args[1]));
conf.setInt(inputMatrixACols, Integer.parseInt(args[2]));
conf.set(inputMatrixBPathString, args[3]);
conf.setInt(inputMatrix... |
a4a9e39a-ceb3-4504-9567-24d47ccf0cce | 5 | public void onEnable() {
initConfig();
Runnable runnable = null;
host = host.toLowerCase();
if ( host.equals(FREEDNS_AFRAID_ORG) ) {
runnable = new Afraid(this, username, password, domain);
}
else if ( host.equals(DYNS_DNS) ) {
runnable = new Dyn(this, username, password, domain);
}
else if ( h... |
c448d8a8-8c17-4084-9535-151ca97e6629 | 8 | @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!sender.hasPermission("cyom.commands.sudo")) {
sender.sendMessage(plugin.translate(sender, "command-no-perms", "You do not have permission to use this command"));
return true;... |
2165878c-722a-4995-b2c4-67faf721d40b | 5 | public static Language getLanguageBySource(String src) {
switch (src) {
case "java":
return Java;
case "pas":
return Pascal;
case "c":
return C;
case "cpp":
return Cplus;
case "py":
... |
92fe7908-cedf-4107-9975-245851f88c88 | 1 | public void read(String pathToProperty) {
try {
Logger.debug("Working Directory = " + System.getProperty("user.dir"));
load(new FileReader(pathToProperty));
} catch (IOException e) {
throw new ConfigurationLoadingException(e);
}
} |
3228c61a-a593-42f6-802c-203caa415ed9 | 4 | public void renderTo(Rendering rendering) {
///if (colour != null && colour.r < 1) I.say(" Colour: "+colour) ;
super.renderTo(rendering) ;
final MoteFX displayed = statusFX.atIndex(statusDisplayIndex) ;
if (displayed != null) {
displayed.progress += 0.04f ;
float alpha = displayed.progress... |
d8aa9a22-0f8d-4698-b785-384ec381d9ea | 6 | @EventHandler
public void SilverfishWaterBreathing(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.getSilverfishConfig().getDouble(... |
18e4618e-c236-40b8-8c36-4a0bf19007a9 | 3 | public static TopQueue search(String target, String dictFile) throws IOException {
BufferedReader reader;
reader = new BufferedReader(new FileReader(dictFile));
TopQueue topQueue = new TopQueue();
String word;
int distance;
while((word = reader.readLine()) != null)
... |
8e3b8360-b13e-4967-9979-effd8db0efa2 | 3 | private void resolutionFullAleat(){
Plateau tmp=new Plateau(plat);
//tant que le score du plateau n'est pas egal au score maximal
while(tmp.getScore()!=tmp.scoreOptimal && !resolu){
//on melange la liste de polyominos
shuffle();
//on creer un plateau temporaire vide
tmp=new Plateau(plat);
... |
f08d0359-0c4d-4b5b-9498-d06c64f42d33 | 0 | public void removeOldImagesIfNecessary() {
imageTemplateRepository.removeOldImagesIfNecessary();
} |
7f4edb33-f267-4c8e-a0a6-2437313af479 | 5 | @Override
protected void doAction(int option)
{
switch (option)
{
case 1:
teamMenu();
break;
case 2:
matchMenu();
break;
case 3:
rankingMenu();
break;
c... |
d8b8f8f0-9b2f-4ce9-afa4-b7d8af140dbd | 2 | public static Path getBackgroundDirectory() {
Path ret = null;
// Setting depends on the authui location. It is not possible to control if the directory is
// already there.
if (!isX86() && FileUtil.control(SystemInformation.getOSPath().resolve(SYSTEMFILE_AUTHUI_x64))) {
ret... |
5a8b80ac-5ffb-4124-b6ef-0748b25660cf | 1 | public boolean[] decodeBooleans() {
boolean[] res = new boolean[decodeInt()];
for (int i = 0; i < res.length; i++) {
res[i] = decodeBoolean();
}
return res;
} |
946fba95-d005-452d-9d32-dbdac8752ae6 | 0 | public XMLGregorianCalendar getExpiryDate() {
return expiryDate;
} |
73edbc1d-eb8f-4fa8-bd25-fb9c0e08d2ee | 3 | public String readString(DataInputStream stream, int maxLength) throws Exception {
short length = stream.readShort();
if (length > maxLength || length < 0) return null;
StringBuilder builder = new StringBuilder();
for (int i = 0; i < length; i++) {
builder.append(stream.readChar());
}
return builder.t... |
b1271aa1-b2c4-4fe9-8efc-f089df4df397 | 4 | private void dropElement() {
BufferedReader in;
try {
ElementListViewHelper helper = (ElementListViewHelper) dropElementComboBox.getSelectedItem();
if(helper == null)
return;
NetworkHardware nh = (NetworkHardware) helper.getNetworkHardware();
DataOutputStream dos = new DataOutputStream(socket... |
0f3150a3-f6ca-47a6-b1fb-a74ac8427963 | 3 | protected static long getChildLong(String str, Element elem) {
String str2 = getTextContent(str, elem);
if (null == str2 || "".equals(str2)||"null".equals(str)) {
return -1;
} else {
return Long.valueOf(str2);
}
} |
d7a76729-9ee3-41a5-80b3-1b3a5bcbcbb3 | 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:/... |
1a5e20c1-99d9-41ed-ac0f-62b5980166f0 | 5 | public void controllerUpdate(ControllerEvent evt) {
if (evt instanceof ConfigureCompleteEvent ||
evt instanceof RealizeCompleteEvent ||
evt instanceof PrefetchCompleteEvent) {
synchronized (waitSync) {
stateTransitionOK = true;
waitSync.notifyAll();
}
} else if (... |
c6df9bb7-45bb-46a1-a93d-13600a4f4658 | 4 | @Override
public Node visitThirdPriorExp(ThirdPriorExpContext ctx) {
String symbol = "";
if (ctx.GREATERE() != null)
symbol = ">=";
if (ctx.LESSE() != null)
symbol = "<=";
if (ctx.LESS() != null)
symbol = "<";
if (ctx.GREATER() != null)
symbol = ">";
return new Operation(ctx.start.getLine(), sy... |
d3933aaf-4203-4da7-9ac2-746be050da19 | 7 | @Override
public ElementHandler createHandler(String name) {
if ("pos".equals(name)) {
return new VectorBuilder(parentContext, new FinishCallback<Vector3>() {
@Override
public void handle(Vector3 value) {
CameraBuilder.this.position = value;
... |
8002e704-9989-4a8c-87bb-19c822196d83 | 3 | public static boolean[] getArticulationPoints(boolean[][] graph)
{
boolean[] visited=new boolean[graph.length];
int[] disc=new int[graph.length];
int[] low=new int[graph.length];
int[] parent=new int[graph.length];
int i=0;
for(i=0;i<parent.length;i++)
parent[i]=-1;
boolean[] ap=new boolean[graph.leng... |
c57f98ea-93ff-445c-9a4e-8e6fa287f3fb | 7 | public SqlLimitResponse limit(SqlLimitRequest request) {
StringBuilder sb = new StringBuilder(500);
int firstRow = request.getFirstRow();
int lastRow = request.getMaxRows();
if (lastRow > 0) {
// fetch 1 more than we return so that
// we know if more rows are available
lastRow = las... |
05d0f075-0e35-47aa-9ce1-fe364d1a09ab | 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... |
7160a960-142f-4af6-8287-e87d9f330bf0 | 7 | ServerMessage(int code, MessageHandler handler) {
m_handler = handler;
m_map.put(code, this);
} |
f7778674-f9d0-4433-bea7-6377b0557546 | 8 | @Override
public double evaluate(int[][] board) {
int rCol1 = 0, rCol2 = 0, rRow1 = 0, rRow2 = 0;
for (int i = 0; i < board.length; i++) {
for (int j = 0; j < board[0].length; j++) {
if (i != board.length - 1) {
if (board[i][j] < board[i + 1][j]) {
... |
16127ff1-60d0-471d-bf5e-92b369803633 | 2 | public Bitmap flipX()
{
int[] temp = new int[pixels.length];
for(int i = 0; i < width; i++)
for(int j = 0; j < height; j++)
temp[i + j * width] = pixels[(width - i - 1) + j * width];
pixels = temp;
return this;
} |
4bf89c18-5a6a-4552-bb84-3377f8c44c52 | 7 | private List<Layer> makeLayersHierarchy(List<Layer> layers) {
LinkedList<LinkedList<Layer>> layersStack = new LinkedList<LinkedList<Layer>>();
ArrayList<Layer> rootLayers = new ArrayList<Layer>();
for (Layer layer : layers) {
switch (layer.getType()) {
case HIDDE... |
ed72bc6f-5d0e-41b6-8df5-49492de85420 | 5 | public void setApplicant(Application app, boolean is) {
if (is) {
for (Application a : applications) if (a.matches(app)) return ;
applications.add(app) ;
}
else for (Application a : applications) if (a.matches(app)) {
applications.remove(a) ;
}
} |
490bb7e6-0508-4f8b-ae2d-3560441442ac | 0 | public boolean getStartAtTop() {
return this.startAtTop;
} |
a959df1a-b130-4179-9b9a-8f6734ed03a7 | 9 | void dumpPageMap(final int count, final long from, final long timestamp, final int recordSize)
throws PersistitIOException {
if (count * PM.ENTRY_SIZE + PM.OVERHEAD != recordSize) {
throw new CorruptJournalException("Invalid record size " + recordSize + " for PM record at "
... |
3f2548f7-0d9b-4e90-a2d8-77763c844e37 | 0 | @Before
public void setUp()
{
createInjector( new EventBusModule()
{
@Override
protected void configure()
{
bindBus( "eventbus.test" ).toAnyBoundClass();
}
} ).injectMembers( this );
} |
df61dda4-a4fa-4fd6-9453-7405772bc1b2 | 8 | @Override
public AbstractTableModel getTableModel() {
return new AbstractTableModel() {
@Override
public String getColumnName(int col) {
return columnsNames[col];
}
@Override
public int getRowCount() {
return docume... |
b10f455b-0f33-40a8-8048-6e6ef19b93d7 | 3 | public Direction isAnExit(Room room){
if(exits.containsValue(room)){
for(Entry<Direction, Room> entry : exits.entrySet()){
if(entry.getValue().equals(room)) return entry.getKey();
}
}
return null;
} |
cd7de460-7117-4d9d-9c3c-3e27d518757d | 5 | public int getValue(){
int value = 0, count = getCards_count();
boolean isAce = false;
cards cards;
int cards_value;
for(int i = 0; i<count; i++){
cards = getCards(i);
cards_value = cards.getValue();
if(cards_value > 10){ cards_value = 10;}
if(cards_va... |
e5c98e55-c9fd-4aca-bcc2-453a10c927c3 | 7 | private void addQuantumDynamicsMenuItems() {
if (model.isSubatomicEnabled()) {
if (lightSourceMenuItem == null) {
lightSourceMenuItem = new JMenuItem(model.getActions().get("Edit the light source"));
String s = getInternationalText("LightSource");
lightSourceMenuItem.setText((s != null ? s : "Ligh... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.