method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
2924b20e-2c1d-431e-b6c3-f956b133ba24 | 6 | public static String formatNode(final Node node) {
final StringBuilder text = new StringBuilder();
text.append('[').append(node.getNodeName());
String value = "";
if (node.isType(NodeType.RULE)) {
value = node.getAttribute(RuleNode.Attributes.NAME);
} else if (node.i... |
ccebb818-758f-41d4-9ffd-a867ec57cbd4 | 8 | Markers findClosestMarkers(Marker queryMarker, Markers markers, int maxDistance) {
Markers closest = new Markers();
HashSet<String> done = new HashSet<String>();
for (Marker m : markers) {
// We don't care about these
if ((m instanceof Chromosome) || (m instanceof Intergenic) || (m instanceof Gene) || (m i... |
636e43e1-0743-49b4-8974-cebcfa753ff5 | 5 | final AnimatableToolkit method614(byte i, int i_4_, boolean bool) {
anInt5615++;
Class64_Sub3 class64_sub3_5_;
Class64_Sub3 class64_sub3_6_;
if (i == 1) {
class64_sub3_6_ = ((OpenGlToolkit) aHa_Sub2_5598).aClass64_Sub3_7864;
class64_sub3_5_ = ((OpenGlToolkit) aHa_Sub2_5598).aClass64_Sub3_7780;
} else if ... |
d8098f8c-607f-4d69-84ea-6c13cefffc2e | 7 | public static int kToLast(NodeList list, int k) {
if(list.isEmpty() || list == null) {
System.out.println("Error: Empty list! exiting...");
System.exit(0);
}
if(k < 0) {
System.out.println("Error: k < 0! exiting...");
System.exit(0);
}
Node current = list.getHead();
Node runner = list.getHead();... |
334b6034-0833-4c7b-8aa5-a85fcaa9c663 | 9 | private JSONArray readArray() throws JSONException {
JSONArray result = new JSONArray();
/* to cover input that ends with ",]". */
boolean hasTrailingSeparator = false;
while (true) {
switch (nextCleanInternal()) {
case -1:
throw syntaxEr... |
8503e57d-cb33-42cd-9c05-38f4b86e938c | 7 | private boolean isAddressAdded(Address address)
{
for(int i=0; i<addedAddressCount; i++)
{
Address addedAddress = addresses[i];
if(addedAddress.getCountry().equalsIgnoreCase(address.getCountry()))
{
if(addedAddress.getCity().equalsIgnoreCase(address.getCity()))
{
if(addedAddress.getStreet... |
e0db71fe-9395-4eb4-99ab-e00ca2bb40e5 | 6 | final synchronized void method87(byte i) {
if (i > -11)
aClass262_5185 = null;
anInt5173++;
if (Class93.loaderApplet != null && Class305.canvas == null
&& !((Signlink) Class348_Sub23_Sub1.signlink).aBoolean3794) {
try {
Class var_class = Class93.loaderApplet.getClass();
Field field = var_class.get... |
17d20d30-46bd-4290-876c-cddd712704ec | 2 | public String getShortDateUK(){
this.shortDateUK = (new Integer(this.getDayOfTheMonth())).toString();
if(this.shortDateUK.length()<2)this.shortDateUK = "0" + this.shortDateUK;
int monthI = this.getMonthAsInteger();
if(monthI<10){
this.shortDateUK += ".0" + monthI;
}
... |
81e3e6a6-689a-45c4-9909-f8c951950d87 | 6 | private void addCadenaToggle(JToggleButton button) {
if (INICIO) {
if (maxCaracteres()) {
if (ordenSecuencia()) {
if (button.isSelected()) {
String string = button.getText();
if (!string.isEmpty()) {
... |
991ea5ab-bdec-48dd-8d24-c577dc6f8992 | 4 | public boolean playing() {
if (channel == null || channel.attachedSource != this)
return false;
else if (paused() || stopped())
return false;
else
return channel.playing();
} |
4ee08456-0bea-4a1f-9d64-972346483bb2 | 6 | public static Card loadCard(final InputStream cardStream) throws IOException {
Card card;
BufferedReader reader = new BufferedReader(new InputStreamReader(cardStream));
ArrayList<String> lines = readAllLines(reader);
switch (findCardType(lines)) {
case "Character": card = new Chara();
break;
case "Clim... |
b054e284-ecde-433b-9d7d-303cbeffddbf | 6 | public static Solucao Vizinhos(Solucao solucao, int x){
if(x==1){
Solucao novasolucao = VizinhoRedundancia(solucao);
if(!novasolucao.equals(solucao)){
return novasolucao;
}
}
else if(x==0){
Solucao novasolucao = V... |
aa4f20b8-6f29-47c0-af61-c3236776796e | 3 | public ArrayList<Positie> getBaanClean(){ //returnt baan tot op botsing, minus 1ste positie
if(!isIetsGeraakt()) return baan;
ArrayList<Positie> baanClean = new ArrayList<Positie>();
for(int i = 1; i < baan.size(); i++){
baanClean.add(baan.get(i));
if(baan.get(i).equals(... |
0db5d0c3-9973-4c79-854f-827ac2ec393a | 4 | public static boolean addPartDialog() {
JPanel addPart = new JPanel();
JPanel input = new JPanel(new SpringLayout());
JLabel nameLabel = new JLabel("Name*");
JTextField name = new JTextField();
JLabel quantLabel = new JLabel("Quantity");
SpinnerNumberModel quantMod = new SpinnerNumberModel(1,0,10000,1);
J... |
f1383d8d-82bd-42dd-9ef7-70742c0c2de4 | 3 | private boolean grabWavBlock8LE (AudioInputStream audioStream) {
byte inBlock[]=new byte[CHUNK_SIZE];
int a,countLoad;
try {
countLoad=audioStream.read(inBlock);
for (a=0;a<countLoad;a++) {
outPipe.writeInt(LEconv8(inBlock[a]));
fileCounter++;
sampleCounter++;
}
}
catch (Exception e) {
... |
c49cae9a-5271-4373-aba5-cd28f2b96da3 | 4 | @Override
public void intersect(Vector vector, VectorVectorMapper callback) {
int size = Math.min(size(), vector.size());
for(int i=0; i<size; i++) {
float v1 = get(i);
float v2 = vector.get(i);
if (v1 != 0 && v2!= 0) {
if (!callback.map(i, v1, v2)... |
f1a1655c-773f-4770-a013-f1748045baeb | 9 | public static FeatureVector intersection(FeatureVector v1, FeatureVector v2) {
FeatureVector result = new FeatureVector();
v1.idSort();
v2.idSort();
Iterator<Feature> it1 = v1.iterator();
Iterator<Feature> it2 = v2.iterator();
Feature f1 = null;
Feature f2 = null;
if (it1.hasNext... |
6454599c-db2b-4716-a5d9-a3d6eff85629 | 8 | public static void main(String args[]) {
// Print each token with line number
Token tok;
try {
Lexer lex = new Lexer(args[0]);
while (true) {
tok = lex.nextToken();
String p = "";
if ((tok.getKind() == Tokens.Identifier) ||
... |
a138b481-9a6f-4f87-aac1-0e936e3d916a | 3 | @Override
public Object execute(HttpServletRequest request, HttpServletResponse response) throws Exception {
Contexto oContexto = (Contexto) request.getAttribute("contexto");
oContexto.setVista("jsp/hilo/list.jsp");
try {
HiloDao oHiloDao = new HiloDao(oContexto.getEnumTipoConex... |
7c575f64-26b7-46c0-8362-58b4a8c5dc25 | 2 | void mapOut(String out, Object comp, String comp_out) {
if (comp == ca.getComponent()) {
throw new ComponentException(
"cannot connect 'Out' with itself for " + out);
}
ComponentAccess ac_dest = lookup(comp);
FieldAccess destAccess = (FieldAccess) ac_dest.output(comp_out);
FieldAccess srcAccess = (Fie... |
6d0f9e29-f5c6-42ea-9682-ecc039d1eb15 | 0 | public void setNovCedula(Integer novCedula) {
this.novCedula = novCedula;
} |
9854bbb4-149e-4a14-8761-389b297f2f9c | 5 | public void start() throws InterruptedException {
boolean test = false;
if (test || m_test) {
System.out.println("ConnectFour::Start() BEGIN");
}
setWindow(new GameWindow(this));
getPlayer1().isYourMove();
getWindow().displayPlayerTurn(Game.PlayerTurn.PLAYER1);
if ((getPlayer1() instanceof ConnectFour... |
79e9af53-d92b-4e7e-8986-bdcafa1954e5 | 3 | private int readCommand (boolean charstring) {
while (true) {
int t = readNext (charstring);
if (t == CMD) {
/*
System.out.print("CMD= "+num+", args=");
for (int i=0; i<stackptr; i++) {
System.out.print(" "+stack[i]);
... |
00d5bf50-3cf6-4684-90c2-9a051a564592 | 4 | public void detectVision(Entity players[], Entity enemies[]) {
for (int i = 0; i < enemies.length; i++) {
enemies[i].visible = false;
}
for (int p = 0; p < players.length; p++) {
for (int i = 0; i < enemies.length; i++) {
if(players[p].sightRadius.intersects(enemies[i].rec)) {
//System.out.print... |
c5666e33-5af5-40a1-86e4-6f6ae642f4b8 | 8 | protected int alphabetaScore(GameState state, Color faction)
{
state = state.getCounter().score(state, false);
int playerScore = 0;
Color maxPlayer = null;
int maxScore = Integer.MIN_VALUE;
for(Player p : state.getPlayerList())
{
//determine the player's score
if(p.getFaction().equals(faction))
... |
3157ad63-1e34-4772-a64a-315fcbe7abed | 0 | public Controleur(Modele _plateau) {
plateau = _plateau;
} |
2eb60e6d-1edf-4958-876c-9c7f51d8d4fa | 1 | @Test
public void PelaajanAlkusijaintiKunEiKerrottu() {
assertTrue("Pelaajan alkusijainti oli väärä",
t.getPelaajanAlkusijainti().getX() == 0
&& t.getPelaajanAlkusijainti().getY() == 0);
} |
ad28dbb4-3dbc-4d5e-b75d-3491b72e259e | 0 | private String extractAnnotationNameFromUserInput(String antFromUser) {
int endOfAnnotationName = antFromUser.toString().indexOf("(");
return antFromUser.substring(1,endOfAnnotationName);
} |
c9c1aa03-4b70-4457-b294-b5d4540ba8e0 | 9 | @Override
public Parameter getParameter(final int parameterIndex) {
Parameter parameter;
switch (parameterIndex) {
case 0:
case 1:
parameter = super.getParameter(parameterIndex);
break;
case 2:
parameter = size;
... |
442486c8-533d-4acb-b300-5f72f1e8f7ed | 9 | @Override
public JSONObject addUserActivity(String userId, Long qId, String answer,
Long time) throws JSONException{
List<User> result = null;
boolean hasAttempted = false;
JSONObject mainojb=new JSONObject();
try {
pm = PMF.get().getPersistenceManager();
Query query = pm.newQuery(User.class, ":p.con... |
8ca1e315-765f-45fd-8b90-0fee640c6e18 | 2 | private void insertNew() {
DB db = DB.connect();
for (IDomainObject domainObject : newObjects) {
if (domainObject instanceof Contact) {
db.getContacts().add((Contact) domainObject);
} else {
db.getAddresses().add((Address) domainObject);
}
}
} |
cecc1c0c-9b49-4ad5-af59-715278570e2d | 7 | public void leftClick() {
if (super.state.equals("revealed") || super.state.equals("flag")
|| super.state.equals("question")) {
return;
} else {
super.state = "revealed";
this.setEnabled(false);
// if no mines surrounding a tile, calls leftClick on surrounding
// tiles
if (this.numMinesSurroun... |
0fc92c70-0dba-427a-8981-bdf2d74f140a | 0 | @Override
public void rotateX(int angle) {
base = DimensionalTrasform.rotateX(angle, base);
setColoredExes();
} |
98484485-45cc-4ed2-8341-f80f4fa3c9c4 | 2 | @Override
public void buildSettlement(IPresenter presenter, VertexLocation vertLoc) {
MoveResponse response = presenter.getProxy().buildSettlement(presenter.getPlayerInfo().getIndex(), vertLoc, false, presenter.getCookie());
if(response != null && response.isSuccessful()) {
presenter.updateServerModel(respon... |
22d8fa97-db3a-4c57-8598-b0412ff7966b | 1 | @Override
public void interact(Command c) {
if (c == Command.OPEN) {
controller.command(c);
}
} |
f6a59e24-0d79-46bc-9236-82be61e37ddb | 1 | public void putValue(String word, boolean palindrome) {
if ( word != null ) {
logger.info("Adding [{}]:[{}] to InMemory datastore", word, palindrome);
values.put(word, palindrome);
// dataStoreUpdatedEvent.select(new AnnotationLiteral<Updated>(){}).fire(word);
dataStoreUpdatedEvent.fire(word);
}
} |
ef441a50-2a77-44bd-9437-29c036589456 | 2 | public String getRankColor(Client client) {
if (client.isAdministrator()) {
return administrator;
}
if (client.isModerator()) {
return moderator;
}
return foreground;
} |
758d4574-957c-43d7-8c71-ca91443030cc | 3 | public void SetTexture(int textureNum)
{
if (textureNum == -1){
currentPaint = startTile;
}
else if (textureNum == -3) {
currentPaint = enemyTile;
}
else if (textureNum == -999) {
currentPaint = defaultPaint;
}
else {
currentPaint = textureList[textureNum];... |
479458e0-d05e-4e98-acbe-d8e85da38b18 | 3 | @Override
public boolean equals( Object o )
{
if ( this == o )
{
return true;
}
if ( o == null )
{
return false;
}
if ( !(o instanceof Student) )
{
return false;
}
final Student other = (Studen... |
89e53296-e4ca-48de-b74d-59c2366d5802 | 1 | private static void showResults(List<File> results) {
for (File archivo : results) {
System.out.println(archivo.getAbsolutePath());
}
} |
fd37bb55-f274-4871-96ac-95663ce2ffbc | 5 | Object[] parameterForType(String typeName, String value, Widget widget) {
if (value.equals("")) return new Object[] {new TabItem[0]};
if (typeName.equals("org.eclipse.swt.widgets.TabItem")) {
TabItem item = findItem(value, ((TabFolder) widget).getItems());
if (item != null) return new Object[] {item};
}
i... |
a9e644aa-97a1-4249-8f1a-29523481f0e5 | 1 | public Container findContainerByUUID(final String uuid){
try{
return (Container) em.createNamedQuery(Container.FIND_CONTAINER_BY_UUID).
setParameter("uuid",uuid ).getSingleResult();
} catch (NoResultException e){
return null;
}
} |
effca69c-f61b-4a48-962d-f4e76738bd7a | 3 | public boolean equals(Object var1) {
if(!(var1 instanceof ChunkCoordinates)) {
return false;
} else {
ChunkCoordinates var2 = (ChunkCoordinates)var1;
return this.posX == var2.posX && this.posY == var2.posY && this.posZ == var2.posZ;
}
} |
18ffa0c5-9797-4ee9-bfa7-8a694dcf6ac4 | 0 | public OGLRenderer(Window _window) {
this.window = _window;
} |
6b8ded2d-9d14-4c22-a676-5f1cbd365b7f | 7 | public Object getPropertyValue(TOObject obj, TOProperty prop) {
TOObjectProperty objprop = getObjectProperty(obj, prop);
if (objprop != null) {
Object ret = null;
switch (objprop.getPropType()) {
case TOPropertyType.TYPE_STR: {
ret = objprop.ge... |
28014248-e1eb-4570-9d2b-39e0c8cae4a3 | 9 | @Override
public void update(Observable o, Object arg) {
switch ((String) (arg)) {
case "start":
startGame();
break;
case "your turn":
JOptionPane.showMessageDialog(this, "It's your turn, you can play", "Info", JOptionPane.INFORMATION_M... |
977d6ae4-aaf4-41ac-b218-f4f8f76336b8 | 0 | @Override
public String toString() {
return "rlog:" + name();
} |
2a8ec23c-065e-4fb8-9388-734e6819abdb | 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... |
f760a0db-6e8c-4ef3-92fe-6fa7d3ee28a8 | 9 | static int nextPalindrome(int a) {
int tmp = a;
int i;
for (i = 0; tmp > 0; i++) {
status[i] = tmp % 10;
tmp /= 10;
}
i--;
int middle = i / 2;
int carry = 1;
if (i % 2 == 0) {
// odd number
if (status[middle] < 9) {
if (middle == 0) {
status[middle] += 2;
} else {
status[mi... |
e18c199c-52c4-4171-8df6-1d729d81c835 | 6 | public void amountIncremented(int ID)
{
switch (ID)
{
case 0:
case 1:
case 2:
case 3:
bonusStats--;
characterStr.updateMaxStats(characterStr.count + bonusStats, 18);
characterInt.updateMaxStats(characterInt.count + bonusStats, 18);
characterDex.updateMaxStats(characterDex.count + bonusStats, 18... |
f3b8b74a-58e9-4d7a-b836-2a4c0614e39f | 1 | public static void updateService( int idservice,int identreprise, String libelle) throws SQLException {
String query = "";
try {
query = "UPDATE SERVICE SET ID_ENTREPRISE=?,SERLIBELLE=? where ID_SERVICE=? ";
PreparedStatement pStatement = ConnectionBDD.getInstance()... |
f5ea8c66-8ca0-463e-a0da-76ad8ad6afc2 | 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... |
8826ae5d-0314-4c34-89c7-baf458eeb435 | 8 | public static Class<?> kettleToJavaType(int t) {
switch (t) {
case ValueMetaInterface.TYPE_STRING:
return String.class;
case ValueMetaInterface.TYPE_INTEGER:
return long.class;
case ValueMetaInterface.TYPE_NUMBER:
return double.class;
case ValueMetaInterface.TYPE_BIGNUMBER:
return BigDecimal.class... |
36dc9391-0610-420a-838c-0b1ae1ecf54b | 3 | public String getExchangeRate(String key, String exchange)
{
if (this.exchangeRates != null && this.exchangeRates.containsKey(key))
{
Map<String,String> exchanges = this.exchangeRates.get(key);
if (exchanges.containsKey(exchange))
{
return exchanges.get(exchange);
}
}
r... |
134da864-089d-4039-a243-54cb90135564 | 7 | public void cal(Users user,HttpServletRequest request){
int no =0 , chk=0;
if(!user.getFile2().isEmpty())
{
no++;
chk=1;
}
if(!user.getFile1().isEmpty())
{
no++;
chk=2;
}
if(no==2)
{
... |
317ef209-502d-4d2d-add1-34f2cb5d506f | 4 | void star() {
int x = 9;
int y = 5;
int center = 4;
for(int i = 0; i < y; i++){
for(int c = 0; c < x; c++){
if((c >= (center - i)) && (c <= (center + i))){
System.out.print("*");
}else{
System.out.print(... |
65b93f60-d6fc-44a7-80c3-5f6f074c649c | 4 | public Game getGame() {
boolean test = false;
if (test || m_test) {
System.out.println("FileManager :: getGame() BEGIN");
}
if (test || m_test) {
System.out.println("FileManager :: getGame() END");
}
return m_game;
} |
1f58d8e4-7001-497d-beac-194e09be4bd3 | 2 | public void removeBan(String banmask) {
String[] bans = new String[banlist.size()];
banlist.toArray(bans);
for (int i = 0; i < bans.length; i++)
if (bans[i].startsWith(banmask))
banlist.remove(bans[i]);
} |
4308b855-73bb-453a-be74-eb095604ff88 | 9 | private void setUDPOptionsEnabled(boolean enabled)
{
lb_udpBufferSize.setEnabled(enabled);
udpBufferSize.setEnabled(enabled && lb_udpBufferSize.isSelected());
udpBufferSizeUnit.setEnabled(enabled && lb_udpBufferSize.isSelected());
lb_udpPacketSize.setEnabled(enabled);
udpPacketSize.setEnabled(enabled && lb_... |
f2f52290-24d6-4ad8-a603-ff630dfdc9c1 | 5 | public void permuteUniqueDFS(int [] num, Stack<Integer> stk, int level){
if(level == num.length){
res.add(new ArrayList<Integer>(stk));
return;
}
for(int i = 0; i < num.length; ++i){
if(!visited.get(i)){
// if(i > level && num[i] == num[i-1]) co... |
5575146d-d02c-410e-9f45-b24a14ac71f9 | 8 | public boolean crawlRecipesByUser(int userID) {
String recipesURL = baseURL + userID + recipeURL;
Document doc = null;
try {
doc = Jsoup.connect(recipesURL).userAgent(USER_AGENTS.get((int) Math.random() * USER_AGENTS.size())).timeout(100000).get();
} catch (IOException e) {
... |
7bcf12ee-33f5-483a-8d8b-a9aab6dd88f1 | 2 | public void login(String username, String password) {
// Get instance of ConfigManager from file
ConfigManager cm = new ConfigManager();
try {
// Try to connect to RMI through port 1099
Registry registry = LocateRegistry.getRegistry(cm.getServerIp(),
1099);
Rmi rmi = (Rmi) registry.lookup("pcs");
... |
6a446020-5ba7-489f-80aa-8ed87dd74c92 | 5 | public void onNeighborChange(Level var1, int var2, int var3, int var4, int var5) {
if(var5 != 0) {
LiquidType var6 = Block.blocks[var5].getLiquidType();
if(this.type == LiquidType.WATER && var6 == LiquidType.LAVA || var6 == LiquidType.WATER && this.type == LiquidType.LAVA) {
var1.set... |
8818a5e6-7650-4597-8e4f-bd13c3e532e5 | 9 | public void unlockBothSides(){
int i = getRoomCoords(getArea())[0];
int j = getRoomCoords(getArea())[1];
if(getFace()==Face.NORTHERN)i--;
else if(getFace()==Face.EASTERN)j++;
else if(getFace()==Face.SOUTHERN)i++;
else if(getFace()==Face.WESTERN)j--;
if(i==-1||j==-1){
i = adjacentGrid[0];
j = adjac... |
9e60422f-14f7-4fba-93ad-4972f12dd06f | 8 | private void deleteObject(Object changedObject){
String table = changedObject.getClass().getSimpleName();
switch(table){
case "User":
User user = (User) changedObject;
dataStorage.users().removeUser(user);
break;
case "Group":
... |
949df2de-0a67-4592-8dd7-4838e3680396 | 2 | private void restoreScreen() {
if (graphicsDevice != null) {
Window window = graphicsDevice.getFullScreenWindow();
if (window != null) {
window.dispose();
}
graphicsDevice.setFullScreenWindow(null);
}
} |
cfd2f979-c549-468a-9c68-1f30d1c763f3 | 3 | public int getTipCount() {
int count = 0;
Stack<JadeNode> nodes = new Stack<JadeNode>();
nodes.push(this);
while (nodes.isEmpty() == false) {
JadeNode jt = nodes.pop();
for (int i = 0; i < jt.getChildCount(); i++) {
nodes.push(jt.getChild(i));
}
if (jt.isExternal()) {
count += 1;
}
}
... |
546e6a98-db79-4b24-8fcf-6cf63853d6b4 | 5 | @Override
public boolean equals(Object object) {
if (!(object instanceof RoleSchool)) {
return false;
}
RoleSchool other = (RoleSchool) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
... |
adbaadda-1141-4854-abc2-2ee33cae666e | 5 | @Override
public void run() {
super.run();
int i = 0, iTmp = new Random().nextInt(20)+1;
firtsFase();
while (health > 0) {
time = (1000 / start.FPS) - (System.currentTimeMillis() - time);
if (time > 0) {
try {
move();
if (y > player.getY()-70) {
lookUp();
} else {
... |
ddc9deca-478c-497c-a0a8-23ac7b104786 | 2 | public int getPreferredWidth(Outline outline) {
int preferredWidth = getPreferredHeaderWidth();
OutlineModel model = outline.getModel();
for (Row row : model.getRows()) {
int width = getRowCell(row).getPreferredWidth(row, this) + model.getIndentWidth(row, this);
if (width > preferredWidth) {
preferredWi... |
03e21518-8369-4c89-b01f-fbe169995f5e | 9 | public void runBadgeTest(int localSwitch){ //TODO Placeholder
String demoStretchAdult = "Demonstrating Stretch~Stretch~!";
String demoStretchBaby = "Demonshtwating Stwetch~Stwetch~ eajy!";
switch (localSwitch){
case 1:
localCounter++;
stay(50);
if (localCounter > 60 && localStep ==0)
{
//Determ... |
dbeb9ac3-033e-4c47-b391-9659dadd6b01 | 6 | @Override
public String toString() {
String result = "";
for (int i = 0; i < this.state.length; i++) {
if (i < 9 || i > 35) {
if (i % 3 == 0) {
result += " " + this.state[i];
} else if (i % 3 == 2) {
result += this.state[i] + "\n";
} else {
result += this.state[i];
}
} else ... |
b6ea22fe-18b6-4f19-a183-ea6bb0578c3c | 3 | public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException
{
if(req.getParameter("logout")!= null)
{
HttpSession session = req.getSession();
User loggedInUser = User.getLoggedInUser(session);
loggedInUser.logout();
resp.sendRedirect("/");
}
else if (User.getLoggedInUs... |
19f3a389-3a7f-4579-be5f-575c5ab69921 | 3 | private DropTarget createTableDropTarget(final Table table){
DropTarget dropTarget = new DropTarget(table, DND.DROP_MOVE | DND.DROP_COPY);
dropTarget.setTransfer(new Transfer[] { FileTransfer.getInstance() });
dropTarget.addDropListener(new DropTargetAdapter() {
public void dragEnter(DropTargetEvent event) {
... |
78e33948-dd95-4bc4-9f02-5cc1702d9030 | 1 | public final void yyclose() throws java.io.IOException {
zzAtEOF = true; /* indicate end of file */
zzEndRead = zzStartRead; /* invalidate buffer */
if (zzReader != null)
zzReader.close();
} |
76a6d18b-75b1-4215-a469-55b43a31bebb | 7 | public boolean handleChangedFile(Set<String> filePath, long revision) {
Logger.println("==FindBugs begin to logchanged");
boolean result = true;
//1.从svn中拷贝修改的文件
for (String path : filePath) {
if (path.endsWith(".java")) {
// copyChangedFilesFromLocal(path);
SVNUtil.exportSingleFile(path, mFindbugsSrc... |
e70dcd4b-528a-4a14-9bb2-19ee0c0d4db1 | 2 | @Override
protected Transferable createTransferable(JComponent c) {
Transferable t = null;
if (c instanceof JList) {
@SuppressWarnings("unchecked")
JList<River> list = (JList<River>) c;
Object value = list.getSelectedValue();
if (value instanceof RiverComponent... |
6cde483b-d63c-4e5c-8462-f075015be58c | 3 | public static void removeCols(JTable paymentTable) {
TableColumnModel tcm = paymentTable.getColumnModel();
System.out.println("getColumnCount:" + tcm.getColumnCount());
if (tcm.getColumnCount() == 10) {
paymentTable.removeColumn(tcm.getColumn(9));
}
if (tcm.getColumn... |
824ff932-16f7-44fd-9430-85cd03216801 | 9 | private void update_frame_animation(){
switch(pacman_direction){
case UP:
current_animation_index = tmp_animation_index++ % up_animation_length;
if(tmp_animation_index % up_animation_length == 0)tmp_animation_index = 0;
break;
case DOWN:
... |
f861f48a-f1fc-4238-8663-e647379d2a9f | 0 | @Override
public String notation() {
return this.from.toString() + "x" + this.to.toString();
} |
f33f66eb-5c45-4218-8823-f045e3888553 | 4 | private static MethodDoc findSuperMethod(MethodDoc md) {
MethodDoc overrides = md.overriddenMethod();
if (overrides != null)
return overrides;
ClassDoc cls = md.containingClass();
/* search the method in implemented interfaces */
for (ClassDoc intf : cls.interfaces()) {
for (MethodDoc intfmethod : intf... |
b4cab05c-5497-467a-b7a4-4737a36794a8 | 9 | @Override
public void mouseDragged(MouseEvent e) {
int h = x - e.getX();
int v = y - e.getY();
if (ecran.getAffichage() == 2) {
int points = 0;
for (Model3D m : ecran.getModels()) {
points += m.getPoints().size();
}
if (points > Parametre.nbLimitePoint) {
ecran.setAffichage(0);
}
reaff... |
2deb1944-58cb-4683-a943-ee7d705e8b94 | 0 | public String getFirstName() {
return _firstName;
} |
b511418d-d68e-48bd-9f69-78f75e563280 | 3 | public Expression negate() {
if ((getType() != Type.tFloat && getType() != Type.tDouble)
|| getOperatorIndex() <= NOTEQUALS_OP) {
setOperatorIndex(getOperatorIndex() ^ 1);
return this;
}
return super.negate();
} |
8e85ddb0-63a0-4554-a978-45f67ed6deff | 8 | @Override
public int hashCode() {
/*
* See On Quaternions and Ocontions John H. Conway, Derek A. Smith page 42
* [-l,-r] = [l,r] and [-l,r]=[l,-r]=-[l,r]
*/
double firstValUnequalZero = left.re;
if (Quaternion.isAlmostZero(firstValUnequalZero)) {
firstValUnequalZero = left.i;
if... |
b8067271-ae0b-46da-a313-51f014e08c90 | 1 | public List findPage(int page,int size) {
log.debug("finding all Record instances");
try {
String queryString = "from Record";
Query queryObject = getSession().createQuery(queryString);
queryObject.setFirstResult(page);
queryObject.setMaxResults(size);
return queryObject.list();
} catch (RuntimeExc... |
702e3509-a830-4d57-ac9e-5cf3047a0db7 | 6 | private void checkCollisions() {
// Collision between ball and left paddle
if (leftPaddle.collide(ball)) {
if (ball.getXSpeed() < 0) {
changeBallTrajectory(true);
}
}
// Collision between ball and right paddle
if (rightPaddle.collide(ball)) {
if (ball.getXSpeed() > 0) {
changeBallTrajector... |
6fada406-c624-4af4-b5b4-ad85f8145a82 | 0 | @Test
public void runTestActivityLifecycle3() throws IOException {
InfoflowResults res = analyzeAPKFile("Lifecycle_ActivityLifecycle3.apk");
Assert.assertEquals(1, res.size());
} |
c5859fed-218c-4642-b67e-45bccbc6d855 | 4 | public boolean equals(Object o){
if (this == o)
return true;
if(o==null)
return false;
if (atributo.getClass()!=o.getClass() || atributo!=o){
return false;
}
return true;
} |
c7cf9d5f-d95a-437d-93c3-52983f938315 | 7 | private void initComponents() {
jDialogJanelaPrincipal = new javax.swing.JDialog();
jPanelPrincipal = new javax.swing.JPanel();
jLabel15 = new javax.swing.JLabel();
jButtonInserirNovo = new javax.swing.JButton();
jButtonConsultar = new javax.swing.JButton();
jPanelMenus ... |
be2f5e49-e889-4b0d-8db0-c4b7055ba537 | 0 | public boolean isInitial() {
final ReentrantLock l = lock;
l.lock();
try {
return initial;
}
finally {
l.unlock();
}
} |
0ccbbaba-e4d2-4933-a4b2-36cc5a4175f3 | 0 | public static String upcase(String s) {
return s.toUpperCase();
} |
7810da8a-2791-40c7-9dce-bcbe997ce4dc | 0 | @XmlTransient
public Collection<Usuario> getUsuarioCollection() {
return usuarioCollection;
} |
b5762bc2-5d4e-4a51-a537-e34a1a299c41 | 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... |
8ff35c30-7e97-41cb-93dc-98a4d2a939fc | 9 | public static String cleanPath(String path) {
if (path == null) {
return null;
}
String pathToUse = replace(path, WINDOWS_FOLDER_SEPARATOR, FOLDER_SEPARATOR);
// Strip prefix from path to analyze, to not treat it as part of the
// first path element. This is necessary to correctly parse paths like
// "f... |
a18f578c-f33b-4e79-80fa-52a1c2e89306 | 5 | private void handleRequiredEmptyChecks(Field field, Object container, SwingWorkerInterface swingworker) throws IllegalAccessException {
Required reqAnno = field.getAnnotation(Required.class);
ShouldBeEmpty empty = field.getAnnotation(ShouldBeEmpty.class);
if (reqAnno != null || empty != null) {... |
bfecb9c7-9975-4bc1-a16d-e8fc06eb86d6 | 9 | public static void main(String[] args) {
//Parameters
double minTurkerProb = .7;
double maxTurkerProb = .95;
int numTurkers = 500;
int numQuestions = 20000;
int numPossibleAnswers = 4;
int numDuplications = 5;
double desiredConfidence = .95;
int loops = 100;
boolean reachConfidence = false;
//P... |
b5ca1aae-77e9-4706-9591-4cebef3a2248 | 6 | public String toString() {
String toString = null;
if (face == 1) {
toString = "One";
}
if (face == 2) {
toString = "Two";
}
if (face == 3) {
toString = "Three";
}
if (face == 4) {
toString = "Four";
}
if (face == 5) {
toString = "Five";
... |
c7284f5d-2dfc-43b5-ae6c-4d967aa8c11a | 7 | public boolean isPointInMap(int x, int y) {
for (int yMap = 0; yMap < getMap().length; ++yMap) {
for (int xMap = 0; xMap < getMap()[yMap].length; ++xMap) {
if (getMap()[yMap][xMap] < 22) {
if (x >= xPos + (xMap - 1) * 64 && xPos + (xMap) * 64 < x
&& y >= (yMap - 1) * 64 && (yMap) * 64 < y) {
... |
a1255d44-a8d7-40e2-9226-785fcce7d2b3 | 1 | public void visit_i2b(final Instruction inst) {
stackHeight -= 1;
if (stackHeight < minStackHeight) {
minStackHeight = stackHeight;
}
stackHeight += 1;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.