method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
88fa9170-921b-4f91-9c25-a31b1333625d | 5 | public void newNPC(int npcType, int x, int y, int heightLevel, int rangex1, int rangey1, int rangex2, int rangey2, int WalkingType, int HP, boolean Respawns) {
// first, search for a free slot
int slot = -1;
for (int i = 1; i < maxNPCs; i++) {
if (npcs[i] == null) {
slot = i;
break;
}
}
if(slot... |
e73b3621-5b73-44fb-838e-fe9e0335ad87 | 9 | public static Set<String> extracLinks(String url,LinkFilter filter){
Set<String> links=new HashSet<String>();
try{
FileOutputStream out = null ;
OutputStreamWriter out1 = null ;
BufferedWriter bw=null;
Parser parser= new Parser(url);
... |
77ba96a5-a5f4-40f8-a3d7-0caf6b1249dc | 9 | @Override
/*
handles the answers inserted into the answertextfield on the answerpanel
*/
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().startsWith(AntwortTextField.VALUE_CHANGED)) {
correctAnswers = 0;
if (fragebogen != null) {
... |
10b9f0f5-3ecf-4244-98db-6445bab09c16 | 7 | private String findVal(Node[] state, Node myNode, int index) {
String val;
int id = myNode.getId();
int ring = id % 4; // ring = right value
int left = 0;
int mod = 0;
int size = 4;
int[] ids;
// 0 = diagonal TL-BR, 1 = horizontal, 2 = diagonal BL-TR, 3 = vertical
switch(index) {
// TL-BR
... |
fe3d88b3-1915-4897-928c-89e24be51fc8 | 1 | @Override
public int getRoot(int n) {
int root = id[n];
while(root != id[root]) {
id[root] = id[id[root]];
root = id[root];
}
return root;
} |
1ab1bffe-bc70-4aac-8eac-59aaeec16d07 | 1 | private static SessionFactory buildSessionFactory() {
try {
return new Configuration().configure().buildSessionFactory();
} catch (Throwable ex) {
System.err.println("===================================Initial SessionFactory creation failed." + ex);
throw new Exceptio... |
f6ad83a1-6432-461f-92f5-6531c4ce0816 | 5 | public Object [][] getDatos(){
Object[][] data = new String[getCantidadElementos()][colum_names.length];
//realizamos la consulta sql y llenamos los datos en "Object"
try{
if (colum_names.length>=0){
r_con.Connection();
String c... |
5db87c0e-abbf-4593-9eed-baab5a90fcae | 5 | public void calcAdjacencies() {
for (int i = 0; i < rows * columns; i++) {
LinkedList<Integer> cells = new LinkedList<Integer>();
int column = i % columns;
int row = i / columns;
if (column > 0) { // left
cells.add(i - 1);
}
if (column < columns - 1) { // right
cells.add(i + 1);
}
... |
a705eef0-95e7-4853-a736-aaef7ee3d9ba | 8 | public static int getLevenshteinDistance (String s, String t) {
if (s == null || t == null) {
throw new IllegalArgumentException("Strings must not be null");
}
int n = s.length(); // length of s
int m = t.length(); // length of t
if (n == 0) {
return m;
} else if (m... |
16568883-3df2-4c18-bc23-6a84cc37e313 | 4 | public void run() {
// signal that this thread has started
threadStarted();
while (!isInterrupted()) {
// get a task to run
Runnable task = null;
try {
task = getTask();
}
catch (Int... |
d73652d1-a2ed-4446-8cea-237bf376b5e3 | 4 | public static void arc(double x, double y, double r, double angle1, double angle2) {
if (r < 0) {
throw new IllegalArgumentException("arc radius must be nonnegative");
}
while (angle2 < angle1) {
angle2 += 360;
}
double xs = scaleX(x);
double ys = ... |
1e400c11-e799-40b8-a026-ce9d0c63b31c | 1 | private void writeType(YamlFile yamlFile, String key, Class<?> value)
{
yamlFile.set(key, value.getSimpleName());
} |
822a17ea-7e72-483d-89a8-0f909ff00b09 | 0 | public void setCountry(String country) {
this.country = country;
} |
a4362099-ead8-4f25-971b-0e8bc7a1f9de | 6 | public Map<K, V> read(JsonReader in) throws IOException {
JsonToken peek = in.peek();
if (peek == JsonToken.NULL) {
in.nextNull();
return null;
}
Map<K, V> map = constructor.construct();
if (peek == JsonToken.BEGIN_ARRAY) {
in.beginArray();
while (in.hasNe... |
c271f92e-e066-49c3-bc6f-6dcab57e0569 | 5 | @Override
public int hashCode() {
final int PRIME = 31;
int result = 1;
result = PRIME * result + ((cellPhone == null) ? 0 : cellPhone.hashCode());
result = PRIME * result + ((email == null) ? 0 : email.hashCode());
result = PRIME * result + ((firstName == null) ? 0 : firstName.hashCode());
result = PRIME ... |
78c79170-f457-458a-b84a-43d2fa3720cb | 0 | @Override
public String toString() {
return "READ";
} |
38fb9b91-017b-4517-bc6c-21a7403e8d22 | 7 | @Override
public LinkedList<Individual> crossover(int[] parents, Population pop) {
LinkedList<Individual> children= new LinkedList<Individual>();
Random r = new Random();
//for each 2 parents
for (int i = 0; i < parents.length-1; i += 2) {
// copy 2 parents to build children
Expression ch1 = (Expr... |
ad36f817-ac37-40df-80d4-7fca2934ce90 | 7 | @Override
public String getMCstring(){
String s = "";
for (int i = 0; i < mc.length; i++) {
if(mc[i] == true)
s = s.concat("1");
else
s = s.concat("0");
if(i == 5 || i == 10 || i == 15 || i == 20 || i == 25)
s = s.co... |
07b08fa1-b9c1-4024-b879-fe17e421373c | 8 | public void sink(Map<String, Object> settings, TupleEntry tupleEntry, OutputCollector outputCollector)
throws IOException {
String rowKeyField = SettingsHelper.getMappingRowKeyField(settings);
Tuple key = tupleEntry.selectTuple(new Fields(rowKeyField));
ByteBuffer keyBuffer = SerializerHelper.se... |
4613e9e3-44d1-4b39-ac52-3b72c6557d05 | 7 | @SuppressWarnings("deprecation")
@EventHandler
public void PlayerInteract(PlayerInteractEvent event)
{
final Player p = event.getPlayer();
int amount = p.getItemInHand().getAmount();
final Location loc = p.getTargetBlock(null, 256).getLocation();
if(p.hasPermission("skeptermod.useitem.chaoslightning") || (p.i... |
44182ac4-9690-4268-a4ed-0cf1072281a8 | 0 | public EsteenTyyppi eksistoi() {
liikuta();
lenna();
return this.osuikoJohonkin;
} |
ce053c20-c482-447f-8b42-5594c9d7f0a5 | 0 | public String getName(){ return name; } |
5dba76b9-02d7-4385-bb48-11023896a3ef | 1 | public boolean isRefresh() {
if(frame == null) buildGUI();
return refresh.isSelected();
} |
5e1c7e0d-b24e-4a1b-8403-b6fcf7e97d9e | 1 | public static Object trapRead(Object[] args, String name) {
if (args[0] == null)
return _classobject.trapFieldRead(name);
else
return ((Metalevel)args[0])._getMetaobject().trapFieldRead(name);
} |
aae6010c-80ee-4b66-945c-dcdc9eb6534b | 1 | public void removePiece(Piece piece) {
if (this.placedPiece == piece) {
this.remove(piece);
this.placedPiece = null;
this.validate();
this.repaint();
} else {
throw new PieceNotInFieldException(piece, this);
}
} |
d58003d4-f314-4ad7-9f3a-b1a4176534b3 | 2 | public static Integer getOpcodeFromToBit(Integer opcode, int fromBit, int toBit) {
// Groesser kleiner ;)
if(fromBit > toBit) {
int tmp = toBit;
toBit = fromBit;
fromBit = tmp;
}
int operand = 0;
for(int i = fromBit; i <= toBit; i++) {
operand += Math.pow(2, i);
}
int k = opcode & 0x3fff;
... |
a6442618-4b77-4eda-92c8-3bc1bda749c3 | 2 | public String getPackageClassName() {
if(StringUtils.isBlank(className)){
return "";
}
return StringUtils.isBlank(packageName)?className:packageName+"."+className;
} |
6306a14d-f436-4aba-b276-38f05a46d523 | 0 | public InetAddress getAddress() {
return address;
} |
3b767b00-538b-4aec-afad-1cb10e981f91 | 1 | @Deprecated
public void loadTexture(String filename)
{
try
{
texture = TextureLoader.getTexture("PNG", new FileInputStream("./res/" + filename));
}
catch (IOException e)
{
e.printStackTrace();
}
} |
d8d89f21-ab01-4ef4-ae2e-e4c5dee291f5 | 5 | public AnnotationVisitor visitParameterAnnotation(final int parameter,
final String desc, final boolean visible) {
AnnotationNode an = new AnnotationNode(desc);
if (visible) {
if (visibleParameterAnnotations == null) {
int params = Type.getArgumentTypes(this.desc).length;
visibleParameterAnnotations =... |
6e8fd9d7-edb6-4f63-a667-1f9983bce835 | 0 | @Override
public String getId() {
return id;
} |
f0c1996f-cc82-4a16-931e-ec1c4f623c1f | 0 | public static byte[] encrypt(byte[] data, String publicKey,
String privateKey) throws Exception {
// 生成本地密钥
SecretKey secretKey = getSecretKey(publicKey, privateKey);
// 数据加密
Cipher cipher = Cipher.getInstance(secretKey.getAlgorithm());
cipher.init(Cipher.ENCRYPT_MODE, secretKey);
return cipher.doFina... |
0dfa8f7d-9248-4136-9253-6269214f3542 | 9 | @Override
public void actionPerformed(ActionEvent e) {
if (e.getSource().equals(submit)) {
credentials[0] = usernameField.getText();
credentials[1] = new String(passwordField.getPassword());
if (credentials[0].length() == 0 ||
credentials[1].length() == 0)
return;
setVisible(false);
}... |
2e6b9d39-b9e6-4a01-8747-6ee4a2cc97cd | 3 | private void load(InputStream in0) throws IOException
{
DataInputStream in = new DataInputStream(new GZIPInputStream(in0));
int bufferWidth = readInt(in);
int bufferHeight = readInt(in);
int ascent = readInt(in);
if (bufferWidth == 0 || bufferHeight == 0)
bufferWidth = bufferHeight = 0;
this.bufferWidt... |
f1cb199c-3e37-4659-98a2-84a98792a378 | 9 | protected void attackEntity(Entity var1, float var2) {
if(!this.worldObj.multiplayerWorld) {
int var3 = this.getCreeperState();
if((var3 > 0 || var2 >= 3.0F) && (var3 <= 0 || var2 >= 7.0F)) {
this.setCreeperState(-1);
--this.timeSinceIgnited;
if(this.timeSince... |
9846a807-a0e7-4127-b72c-1d9f44e0fb46 | 8 | public void delete(String fname, String lname, String id, String major)
{
idError.setText("");
//System.out.println("id present");
fnameLabel.setVisible(true);
lnameLabel.setVisible(true);
idLabel.setVisible(true);
majorLabel.setVisible(true);
fnameField.setVisible(true);
lnameField.... |
91b80c0e-59f5-4d95-a42d-0fdbdb6dacba | 1 | public Vector2f getDoorSize()
{
if(getTransform().getRotation().getY() == 90)
{
return new Vector2f(WIDTH, LENGHT);
}else {
return new Vector2f(LENGHT, WIDTH);
}
} |
f8cf4c40-415d-431a-87b7-dc9b5e65b582 | 1 | @Override
public void setBackground( Color bg ) {
super.setBackground( bg );
if( canvas != null ){
canvas.setBackground( bg );
}
} |
b236d7f3-ec79-4ebb-95dc-30e1d21c424a | 3 | private void close(boolean saveChanges) {
if (saveChanges) {
if (!setMainDir())
return;
if (!setModDir())
return;
saveConfig();
}
dispose();
} |
c0ed4827-a0c8-4fbc-9c28-e9edb2cb36a9 | 4 | @Override
public synchronized void gridletSubmit(Gridlet gridlet, boolean ack) {
// Create a server side Gridlet
SSGridlet sgl = new SSGridlet(gridlet);
if(!validateGridlet(sgl)) {
try {
// reject the Gridlet
gridlet.setGridletStatus(Gridlet.FAILED);
super.sendFinish... |
dfdb07b7-57e2-4891-b6ec-62f21a513605 | 9 | private void applyFlank(char[][] board, int x, int y, int xInc, int yInc, char player, char opponent){
int origX = x, origY = y;
while(true){
x += xInc;
y += yInc;
if(x < 0 || x >= SIZE || y < 0 || y >= SIZE)
return;
if(board[x][y] == player)
break;
else if(board[x][y] != opponent)... |
66f43e35-c251-4c0f-89c6-875b2ab5d67a | 9 | public static String pipelineHome(String plUser, String plPort){
StringBuilder homePath = new StringBuilder();
// By getting the owner of the preferences file we can get the Pipeline user.
Process p = null;
try {
String s = "";
if ( !plUser.equals("root") ) {
... |
a672e4c3-6b3a-41ed-a406-d01df292b0f0 | 3 | public void checkCollisions()
{
if (getEntities() == null) return;
List<Entity> entities = getEntities().getList(null);
for (Entity other : entities)
{
if (collidesWith((Positioned)other, false))
{
reactToCollision(other, collidesWith... |
0e1fdd01-bfaa-4f3b-8769-921a248cd32d | 3 | boolean isSampleValid(double[] sample) {
for (int i = 0; i < parameterNames.length; i++) {
if (sample[i] < lowBound[i] || sample[i] > upBound[i]) {
return false;
}
}
return true;
} |
be242e21-97aa-4823-b745-17f39f53f17e | 9 | public void collideCheck()
{
if (dead) return;
float xMarioD = world.mario.x - x;
float yMarioD = world.mario.y - y;
float w = 16;
if (xMarioD > -w && xMarioD < w)
{
if (yMarioD > -height && yMarioD < world.mario.height)
{
if (... |
836563b0-521f-4857-8461-6cae6cb8a081 | 6 | public static Stella_Object accessKvConsSlotValue(KvCons self, Symbol slotname, Stella_Object value, boolean setvalueP) {
if (slotname == Stella.SYM_STELLA_KEY) {
if (setvalueP) {
self.key = value;
}
else {
value = self.key;
}
}
else if (slotname == Stella.SYM_STELLA_... |
d6e01160-281e-46f2-9763-9f5ba7efb633 | 4 | public void fillPouch(int i) {
if (i < 0)
return;
int toAdd = c.POUCH_SIZE[i] - c.pouches[i];
if (toAdd > c.getItems().getItemAmount(1436)) {
toAdd = c.getItems().getItemAmount(1436);
}
if (toAdd > c.POUCH_SIZE[i] - c.pouches[i])
toAdd = c.POUCH_SIZE[i] - c.pouches[i];
if (toAdd > 0) {
c.getItem... |
3630c5f2-e8f5-49ea-934b-3efc4202378f | 6 | public void doFrameEnterHighscore() {
char key = getLastKeyChar();
clearLastKey();
if (key==KeyBackspace && playername.length()>0)
playername = playername.substring(0,playername.length()-1);
if (key==KeyEnter) {
highscores = Highscore.insert(highscores,
new Highscore(score,playername));
clearLastK... |
f81086c5-732f-44b1-8d31-79d90eef21b5 | 6 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Noticia other = (Noticia) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
... |
613df082-a2c8-4e18-9d20-7b85d33ee90a | 8 | public boolean simplify(Constraint other) {
if (nvariables<other.nvariables)
// Are we a subset of other? Let other figure it out.
return other.simplify(this);
// Is other a subset of us?
for (int i=0; i<other.nvariables; ++i)
for (int j=0; j<nvariables; ++j)
if (variables[j].equals(other.variable... |
8bacc4b2-aff3-4ff2-9153-101e0d0fc84f | 6 | @Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
if (init == false) {
try {
use... |
05e97b4c-bd3f-4689-ae1a-a2d5a6206c5c | 8 | @Override
public AxisSpace reserveSpace(Graphics2D g2, Plot plot,
Rectangle2D plotArea, RectangleEdge edge,
AxisSpace space) {
// create a new space object if one wasn't supplied...
if (space == null) {
space = new AxisS... |
30df239c-fd0a-45f5-bd2b-da76bb477f39 | 8 | public final IAMIndexBuilder decode(final IAMCodec codec) throws IOException, IllegalArgumentException {
final IAMINDEXTYPE xmlIndex = JAXB.unmarshal(IO.inputReaderFrom(codec.getSourceData()), IAMINDEXTYPE.class);
final IAMIndexBuilder indexBuilder = new IAMIndexBuilder();
codec.useByteOrder(IAMByteOrder.from(xm... |
bcc5a6da-6e26-4177-acb4-1c5bc078ab7f | 3 | private double testQueueEnqueue(int inserts) {
System.out.println("Testing queue with " + inserts + " pushes");
long[] times = new long[20];
long startTime;
long endTime;
for (int i = 0; i < 20; i++) {
queue = new Queue();
startTime = System.currentTimeM... |
4aa92d92-3b03-4f35-8585-351caafcbd78 | 1 | public void setAverErrors(List< List<Double>> l_averErrors) {
if(!this.averErrors.isEmpty()) {this.averErrors.clear();}
/*this.averErrors.add(new ArrayList<Double>()); //trainig
this.averErrors.add(new ArrayList<Double>()); //testing
this.averErrors.add(new ArrayList<Double>()); //valida... |
fe078eae-3414-4553-b44b-cf7579a2e6c4 | 0 | public int getBlue(){
return _blue;
} |
677e2fe1-c837-4cba-933a-f6341a5c2169 | 4 | private static final JsonElement resolvePath(final JsonObject root, String key, JsonElement finalValue){
// treat all dots as a branch
String[] segments = key.split("\\.");
int segmentCount = segments.length;
JsonObject currentProperty = root;
String currentPath = "";
for(int i = 0; i < segmentCount; ... |
c5a6712f-0051-4674-aba7-cf364ebc8d2e | 5 | public static String getIdNameById(int id){
if(id < 10){
return "000" + id;
}
else if(id >= 10 && id < 100){
return "00" + id;
}
else if(id >= 100 && id < 1000){
return "0" + id;
}
else{
return "" + id;
}
... |
3fcc9602-15b6-4e49-be30-fedb474befcf | 0 | public void addPlotter(final Plotter plotter) {
plotters.add(plotter);
} |
a815b85e-b420-4490-9d94-472994d89c0c | 0 | @Override
public String getExecCommand() {
return execCommand;
} |
dbf67c18-c6bb-4c64-b7e2-84e3fc4d8d38 | 8 | @Override
public ICTMC load(String pathname) throws Exception {
ICTMC ret = null;
BufferedReader inputStrm;
String currentLine;
String[] fields;
int i = -1;
int j = -1;
int n = -1;
double h = -1;
double T = -1;
double e = -1;
int k = -1;
double[][] si = null;
double[][] tmpQ = null;
if(t... |
c921d073-19d1-4069-834a-e2e246cda0e4 | 6 | private void sendSupportedFeatures() throws IOException {
List<String> supportedFeatures = config.getSupportedFeatures();
if (supportedFeatures!=null && !supportedFeatures.isEmpty()) {
//building $Supports string
String supportsString = "$Supports";
for (String suppor... |
10248702-4b0e-4e15-a8e8-ff02f285f32f | 5 | private String myInitSubString(String varName)
{
String tmpName = null;
int j = 0;
for(int i = 0; i != varName.length(); i++)
{
if(varName.charAt(i) == '_' && j == 0)
{
j = i;
continue;
}
if(varName.charAt(i) == '_' && j != 0)
{
tmpName = varName.substring(j + 1, i);
break;
}
... |
1b698085-8034-486e-8b48-ee62d6057ffd | 7 | int afterName() throws IOException {
int n = in.next();
switch (n) {
case ' ':
case '\t':
case '\r':
case '\n':
in.back();
String ws = parseWhitespace(in);
if (!isIgnoreWhitespace()) {
set(JSONEventType.WHITESPACE, ws, false);
}
return AFTER_NAME;
case ':':
return BEFORE_VALUE;
cas... |
1b477705-40b6-44b5-b213-f79a1bdf073a | 9 | @Override
public void run() throws Exception {
try {
// Eclipse doesn't support System.console()
BufferedReader console = new BufferedReader(new InputStreamReader(System.in));
ConfigManager config = NetBase.theNetBase().config();
String server = config.getProperty("net.server.ip");
if ( server == nu... |
69e13084-a52e-4666-8bf1-65e07ec2fc44 | 7 | @Override
public void keyReleased(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_LEFT) {
canasta.setMoveLeft(false);
} else if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
canasta.setMoveRight(false);
} else if (e.getKeyCode() == KeyEvent.VK_G) {
if (!instrucc... |
b6d884d5-c767-45fd-a7c6-e0e60b400060 | 9 | @Override
public void process(JCas aJCas) throws AnalysisEngineProcessException {
String text = aJCas.getDocumentText();
//Go through document word by word
int pos = 0;
StringTokenizer tokenizer = new StringTokenizer(text, " \t\n\r.<.>/?\";:[{]}\\|=+()!", true);
//Get the string ID as the fir... |
c4288976-6700-4cb3-bc57-b9885e7e9fd4 | 7 | public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable
{
String name = method.getName();
if (Object.class == method.getDeclaringClass()) {
if ("equals".equals(name)) {
Object obj = args[0];
return new Boolean(checkEquals(... |
ff9428ab-022c-4b70-b210-284fa895c950 | 4 | private boolean updateGameLevel() {
if (linesToLevel <= 0) {
int delay;
switch (difficulty) {
case Normal:
++level;
linesToLevel += (int)(level * 1.25) + 5;
// Level 1 fall rate is 1 second, ever level thereafter decrease by 50 ms
delay = FALL_RATE - (75 * level);
break;
... |
d71ce8ac-e056-41ad-a3a0-69413f673bdf | 2 | @Override
int trimIndex(Fastq fastq) {
int qual[] = FastqTools.qualtityArray(fastq);
for( int i = 0; i < qual.length; i++ ) {
int median = median(qual, i); // Compute running median
if( median < qualityThreshold ) return i; // Below threshold? => trim here
}
return qual.length;
} |
5f6a389e-fb23-4392-b891-67910f4be52e | 2 | public void Set_edgewieghtE(float[][] temp){
int ni = temp.length;
int nj = temp[0].length;
for (int i = 0; i < ni; i++) {
for (int j = 0; j < nj; j++) {
t_edgeweight[i][j] = temp[i][j];
}
}
} |
c9218cea-efd9-4fd0-bd31-f1c3b8c6039d | 3 | public void setPreserved() {
if (!preserved) {
preserved = true;
Identifier ptr = this;
while (ptr != null) {
ptr.setSinglePreserved();
ptr = ptr.left;
}
ptr = right;
while (ptr != null) {
ptr.setSinglePreserved();
ptr = ptr.right;
}
}
} |
10df0823-073d-4a82-a191-8ff461d27cd4 | 9 | public static Tour crossoverDouble(Tour parent1, Tour parent2) {
Tour child = new Tour();
int[] mrk = new int[4];
mrk[0] = (int) (r.nextInt(parent1.tourSize()));
mrk[1] = (int) (r.nextInt(parent1.tourSize()));
mrk[2] = (int) (r.nextInt(parent1.tourSize()));
mrk[3] = (int) (r.nex... |
b8071494-feed-49e7-8d08-3fa5f79dbe57 | 2 | private void cargarDatosPersona(){
txtCodigo.setText(String.valueOf(persona.getCodigo()));
txtNombre.setText(persona.getNombre());
txtTelefonoFijo.setText(persona.getTelefonoFijo());
txtCelular.setText(persona.getCelular());
txtEmail.setText(persona.getEmail());
if(person... |
8539a338-8e35-4f2a-bb06-3cb20a227da9 | 3 | private boolean login(HttpServletResponse response, HttpServletRequest request) {
String userMail = request.getParameter("email");
String userPassword = request.getParameter("password");
UserBean user = this.model.getUser(userMail);
HttpSession session;
if(user != null){
... |
3cb854ad-3bb9-466e-a5e1-8f0ee080b9a4 | 1 | public void visitInnerClassType(final String name) {
if (argumentStack % 2 != 0) {
declaration.append('>');
}
argumentStack /= 2;
declaration.append('.');
declaration.append(separator).append(name.replace('/', '.'));
separator = "";
argumentStack *= 2;
} |
7411e8e1-5bae-4f43-8639-a41e08595d28 | 4 | public static void main(String[] args) {
try {
// Set platform look and feel
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (UnsupportedLookAndFeelException e) {
// handle exception
} catch (ClassNotFoundException e) {
// handle exception
} catch (InstantiationException... |
d858641d-3e0e-460e-9199-0bf523525410 | 2 | @Override
public void setMaxFileSize(String size) {
if ((size != null) && (!size.isEmpty())) maxFileSize = size;
} |
5a766523-a0e3-4c8e-b5a7-d619df746e25 | 0 | private void jButtonCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCloseActionPerformed
//Récupération de la méthode contrôleur 'clode'
ctrlCR.close();
}//GEN-LAST:event_jButtonCloseActionPerformed |
a44668e7-7abd-444a-8181-cd82ddabaffc | 3 | @Override
protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
String[] line = value.toString().split(inDelimiter);
String keyCol = "";
String valueCol = "";
for (int i = 0; i < line.length; i++) {
if (i == Integer.parseInt(keyColumn))
keyCol = lin... |
125ca153-7077-445f-8a43-0434d64bbde3 | 6 | protected String convert(String line) {
String[] words = line.split("\\s");
if (words.length < 3)
return "*** Error : too few tokens on line ***";
if (words[0].length() != 2)
return "*** Error : invalid prefix ***";
DPoint offset = osgb.GridSquareToOffset(words[0].charAt(0), words[0]
.charAt(1));
... |
d23f2c2b-c952-41eb-8d27-e22fe7be8926 | 1 | public Item next() {
if (!hasNext()) throw new NoSuchElementException();
Item item = current.item;
current = current.next;
return item;
} |
1f559e5d-b565-4817-8d50-2e02bad03124 | 3 | private void printLambda(Node t, int n)
{
if (t.getCdr().isNull())
{
t.getCar().print(n+4, false);
System.out.println();
if (n > 0)
{
for (int i = 0; i < n; i++)
System.out.print(" ");
}
t.get... |
d461a901-3efe-45fe-9857-d142751e6df1 | 1 | public static ConnectionBDD getInstance() {
if(instance == null){
instance = new ConnectionBDD();
}
return instance;
} |
f1b88055-78bf-4bef-8686-f56ace0ffaa1 | 0 | @Override
public boolean execute(CommandSender sender, String[] args) {
return false;
} |
3cbf88f1-b614-4586-9e4a-19acc6370ca7 | 6 | @Override
public void run() {
if (Updater.this.url != null) {
// Obtain the results of the project's file feed
if (Updater.this.read()) {
if (Updater.this.versionCheck(Updater.this.versionName)) {
if (Updater.this.versionLink != null... |
05b1e67c-0c26-42e9-b492-5aa7f84b7b12 | 1 | @Override
public int hashCode() {
return id != null ? id.hashCode() : 0;
} |
36d43abb-3c98-43be-ac2e-f83d8b020f59 | 6 | public static Stella_Object accessIntegerIntervalIteratorSlotValue(IntegerIntervalIterator self, Symbol slotname, Stella_Object value, boolean setvalueP) {
if (slotname == Stella.SYM_STELLA_INTERVAL_CURSOR) {
if (setvalueP) {
self.intervalCursor = ((IntegerWrapper)(value)).wrapperValue;
}
... |
36c26096-9b74-412e-82b5-a5630d2487d3 | 2 | @Override
public void run() {
try {
openConnection();
while (running) {
Socket socket;
System.out.println("waiting for connection");
socket = serverSocket.accept();
ClientHandler h = new ClientHandler(new Connection(sock... |
f16dbaee-9694-4d34-9ba0-432c9c2c5378 | 9 | public void startEngine(String[] args) {
try {
final OptionManager om = OptionManager.instance();
final boolean hasArg = om.parseCommandLine(args,OPTION_CONTAINER);
/* Update the verbosity level according to the verbosity option */
String verbosity = null;
if (hasArg) {
verbosity = (String)OptionMa... |
a8212a41-0209-47b3-baba-8389d55b4a3a | 4 | public void saveLogEntrada(PosListaPrecio itemOracle,
String tipo,
int idPos){
logger.info("itemOracle.getPcaIdElemento() = " + itemOracle.getPcaIdElemento());
logger.info("idPos = " + idPos);
logger.info("tipo = " + tipo);
try {
PhpposLogEntrada... |
70710896-0834-4aee-a395-4694a4a2cdcb | 6 | public void listAppConstant(String constantLabel) throws UnrecognizedCommandException {
if (null != constantLabel && !"".equals(constantLabel.trim())) {
try {
printUsage(constantLabel);
} catch (NullValueException e) {
}
}
if (null == constantLabel) {
String[] header = { "Constant", "Description" ... |
803ccb1d-20ec-45da-adbf-c1606a2e8f82 | 3 | public void updateElement()
{
if(this.GameElementListener != null)
{
this.GameElementListener.Update(this);
}
if(this.Gravitation.isxEnable())
{
this.Location.setX(this.Location.getX() + this.Gravitation.getxValue());
}
if(this.Gravit... |
c1e87e33-419c-4ce0-9efc-4e077d48035c | 2 | public Markers intersects(Markers interval1, Marker intervals) {
Markers ints = new Markers();
for (Marker i : interval1)
if (i.intersects(intervals)) ints.add(i);
return ints;
} |
0ee83abe-2037-4592-a339-1260ed0dc610 | 3 | public int percentageOfInhabitedHabitats() {
int amount = 0;
for (Habitat h : habitats.values()) {
if (h != null) {
if (h.isInhabited()) amount++;
}
}
return amount;
} |
145018ea-aa9d-4800-8b45-384d89d3d7bc | 8 | void removeInternal(Node<K, V> node, boolean unlink) {
if (unlink) {
node.prev.next = node.next;
node.next.prev = node.prev;
node.next = node.prev = null; // Help the GC (for performance)
}
Node<K, V> left = node.left;
Node<K, V> right = node.right;
Node<K, V> originalParent = nod... |
30ed5057-516d-4feb-9f4b-1044c6153716 | 9 | public void doGet(HttpRequest req, HttpResponse res) {
logger.debug("Request received:\n"+req.toVerboseString());
//Get the possible query parameters.
String username = req.getParameter("username");
String password = req.getParameter("password");
String logout = req.getParameter("logout");
//See if this... |
c4917530-ae37-4fac-ae03-0120a487688a | 7 | private static void parseDocument() {
// get the root element
Element docEle = domBounds.getDocumentElement();
docEle.normalize();
System.out.println("Root element :" + docEle.getNodeName());
NodeList bl = docEle.getElementsByTagName("Bound");
if (bl != null && bl.getLength() > 0) {
for (int i = 0; i < ... |
887fc0cd-e031-4931-8e93-5d32b0facb7b | 9 | @Override
public boolean equals(Object obj) {
if( this == obj ) {
return true;
}
if( obj == null ) {
return false;
}
if( getClass() != obj.getClass() ) {
return false;
}
final CsvContext other = (CsvContext) obj;
if( columnNumber != other.columnNumber ) {
return false;
}
if( rowNumber !... |
913dbf7a-1c6b-4c75-aa0e-1a9bd6d1e327 | 9 | Sdef( String name, String defName, String consolFunc ) throws RrdException
{
super( name );
this.defName = defName;
this.consolFunc = consolFunc;
// -- Parse the consolidation function to be used
if ( consolFunc.equalsIgnoreCase("AVERAGE") || consolFunc.equalsIgnoreCase("AVG") )
aggregate = Source.AGG_A... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.