method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
b7d2a690-8cd2-447b-b20e-05677add2b50 | 7 | @EventHandler
public void onPlayerMove(PlayerMoveEvent event) {
// Respect other plugins
if (event.isCancelled()) {
return;
}
Player player = event.getPlayer();
if (preChecks(player, event.getTo())) {
JumpPort port = JumpPorts.getPort(event.getTo());
... |
be5e77a4-72af-4281-bcd3-ac353474a4ee | 3 | private void addPiece(final BusyTile busyTile, final Position position, final boolean activate) {
add(busyTile);
if(busyTile.getColor())//ovvero se è bianco
if (activate) {
busyTile.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
board.remo... |
427ea6c8-343d-4a5b-a131-1ae918215bae | 2 | private void sortFiles(File[] files) {
if (directoryComparator != null) {
try {
Arrays.sort(files, directoryComparator);
} catch (ClassCastException cce) {
cce.printStackTrace();
}
} else {
Arrays.sort(files);
}
} |
98b33444-4dfc-413c-9053-23b875df1a17 | 6 | public Object getValueAt(int row, int col) {
CounterParty c = (CounterParty)counterParties.getBusinessObjects().get(row);
if (col == 0) {
return c;
} else if (col == 1) {
return Utils.toString(c.getAliases());
} else if (col == 2) {
return c.getBankAccountsString();
} else if (col == 3... |
44492020-6930-416f-86a3-601dff3f480f | 4 | public MainGeneration() throws Exception{
int x = 0;
Scanner sc = new Scanner(System.in);
/*Tant que le résultat est différent des réponses attendues
On continue de demander une réponse adéquate*/
while(x != 1 && x != 2 ){
System.out.println("Génération Controlée(1)");
System.out.println("Génération Aléat... |
ce2eb178-4832-44fb-99c2-06bd8e2eca68 | 3 | public CoreInterface getTreeObject(CoreInterface ci){
if(ci.getClass() == Dvd.class){
return dvdTree.get(ci);
}else if(ci.getClass() == Location.class){
return locationTree.get(ci);
}else if(ci.getClass() == Genre.class){
return genreTree.get(ci);
}
return null;
} |
d0b97510-f48d-4272-b4e8-47006b1f6c43 | 3 | private void checkEnoughCapacity(int number) {
int len = keys.length;
if (len - currentSize < number) {
// Make inner arrays two times longer
changeCapacityBy(keys, len);
changeCapacityBy(values, len);
} else if (currentSize < len / 4 && len / 2 > INITIAL_CAPA... |
c25f01e6-59a9-45c4-b5a2-36ac51f53a69 | 1 | public Course(ResultSet rs) throws Exception{
DBConnector db = new DBConnector();
if(rs.next()){
setCourseID(rs.getInt("courseid"));
setTitle(rs.getString("title"));
setYear(rs.getInt("year"));
setSeason(rs.getString("season"));
setTeacher(db.g... |
b4779fb7-5dab-42c5-a195-1d90e3d2e3d3 | 9 | protected boolean canAct(Tickable ticking, int tickID)
{
switch(tickID)
{
case Tickable.TICKID_AREA:
if(!(ticking instanceof Area))
break;
//$FALL-THROUGH$
case Tickable.TICKID_MOB:
case Tickable.TICKID_ITEM_BEHAVIOR:
case Tickable.TICKID_ROOM_BEHAVIOR:
{
if((--tickDown)<1)
{
tickReset... |
3465d3cc-8878-4d5e-a1db-15770d210c52 | 5 | private void update(DocumentEvent event)
{
String newValue = "";
try
{
Document doc = event.getDocument();
newValue = doc.getText(0, doc.getLength());
}
catch (BadLocationException e)
{
e.prin... |
26e5fdcf-44c5-442a-b41a-14e28a7b138b | 5 | private void collectFiles(String path, File... files) {
for (File file : files) {
if (!file.canRead()) {
logger.warn("Can't read from file %:", file.getAbsolutePath());
continue;
}
UpdateItem ui = new UpdateItem();
ui.setNewData(tru... |
624ce2cb-1345-4cb0-99c1-aae948057a7e | 6 | public String getAlfrescoProperty(String filename, String property) {
Document doc = (Document) session.getObjectByPath("/" + filename);
List<Property<?>> properties = doc.getProperties();
String propertyValue = "";
for (Property<?> p : properties) {
if (p.getFirstValue() ==... |
9f708ba7-1a9c-4043-96ea-2447c036e138 | 8 | private void makewt(int nw) {
int j, nwh, nw0, nw1;
float wn4r, wk1r, wk1i, wk3r, wk3i;
double delta, delta2, deltaj, deltaj3;
ip[0] = nw;
ip[1] = 1;
if (nw > 2) {
nwh = nw >> 1;
delta = 0.785398163397448278999490867136046290 / nwh;
de... |
d8f285b9-352b-44de-a4a4-a2f7a94be6f5 | 8 | public SortedSet<Map.Entry<String,Integer>> runRandom(final int n){
final Map<String,Integer> results = new HashMap<String,Integer>();
final int threadCount = 10;
final int threadLoad = n/threadCount;
if(n<threadCount){
for(int i = 0;i<n;i++){
String seq = backtrackF(0, len - 1);
Integer freq = resul... |
ff7625de-15a0-44cb-a2f1-fd2df4a2223d | 4 | protected void dispatchEvent(AWTEvent event){
super.dispatchEvent(event);
// interested only in mouseevents
if(!(event instanceof MouseEvent))
return;
MouseEvent me = (MouseEvent)event;
// interested only in popuptriggers
if(!me.isPopupTrigger()) ... |
0cfe15e8-2234-4b39-8315-d5ab281bb65b | 2 | private void updateMatchResults(Player winner) {
if(null!=winner) {
GameScore gs = players.get(winner);
if(gs.hasWon()) {
matchWinner = winner;
matchWinner.win();
}
}
} |
9dbcfd30-cab9-423e-b6e7-7f8a97d292d0 | 4 | public String getHelpText(HelpType command) throws Connect4Exception {
String helpText = "";
switch (command) {
case BOARD:
case GAME:
case SPACES:
case TOKENS:
helpText = command.getHelpText();
break;
... |
5fd9a130-2395-4fdf-9077-bc5bf596f130 | 5 | public static void ChangeTile() {
if (!intrfce.Menu.runMenu) {
for (int h = 0; h < Engine.mb.BLOCKS[layer - 1].length; h++) {
for (int w = 0; w < Engine.mb.BLOCKS[layer - 1][h].length; w++) {
if (r.intersects(Engine.mb.BLOCKS[layer - 1][h][w].r)) {
if (isPressed) {
Engine.mb.ID[layer - 1][h][... |
b20d499a-8c73-4017-89c7-1a386b841760 | 5 | public boolean updateConnections(Node n) throws WrongConfigurationException{
boolean edgeAdded = false;
// For the given node n, retrieve only the nodes which are possible neighbor candidates. This
// is possible because of the rMax filed of the GeometricNodeCollection, which indicates the maximum
// distan... |
a4878106-9bea-49d2-a1c4-1470185f79cf | 1 | public void Command (CommandSender sender, Command cmd, String commandlabel, String[] args) {
if (args[0].equalsIgnoreCase("reload")) {
return;
}
} |
071b58b5-7d8f-4ad6-9e21-7fb08182597c | 0 | @Override
public String toString()
{
return "isStatic()";
} |
68aab12b-dd9a-46e2-b675-fc8159088305 | 2 | public void flush()
{
FileOutputStream saveFile = null;
try
{
saveFile = new FileOutputStream(".contacts.txt");
ObjectOutputStream expt = new ObjectOutputStream(saveFile);
expt.writeObject(this.IDgenerator);
expt.writeObject(this.contactList);
expt.writeObject(this.meetingList);
}catch(IOExcepti... |
bff7c8f1-dc57-486b-bb31-038b5dd1716b | 1 | public void cleanup() {
final Iterator iter = cleanup.iterator();
while (iter.hasNext()) {
final Node node = (Node) iter.next();
node.cleanup();
}
vars = null;
phis = null;
pushes = null;
pops = null;
defs = null;
def = null;
cleanup = null;
} |
220cdc96-d44c-4bb8-8785-1c1b7fefb093 | 0 | public boolean checkDefeated(){
return monster.isAlive();
} |
43c97fc5-7217-4c50-92ce-ec49c1a883c7 | 6 | public void draw(Graphics g){
final STATE state = this.now_state;
switch(state){
case STATE_NORMAL:
int frame_count = player.get_frame_count();
int chip_size = MapChip.CHIP_SIZE;//1チップの大きさ
/* 移動アニメーションのためにオフセットを計算する */
double one_frame = (double)chip_size / (double)Frame_Of_Move;
... |
228f8e45-7061-4d4d-b535-4a3e3af9af9a | 8 | public void oneLevelDeepPost(String container1, String url1, String dest) {
String fileData = "";
BufferedWriter bufferWritter = null;
try {
String container = container1;
String url = url1;
String destination = dest;
Document doc = postUrl(url);
... |
14405c12-98ee-4ba9-a368-f4d4ddbc8786 | 4 | public void toggle(KeyEvent key, boolean pressed){
int keyCode = key.getKeyCode();
if(keyCode == KeyEvent.VK_UP) up = pressed;
if(keyCode == KeyEvent.VK_DOWN) down = pressed;
if(keyCode == KeyEvent.VK_LEFT) left = pressed;
if(keyCode == KeyEvent.VK_RIGHT) right = pressed;
} |
47a10939-9240-4517-bc59-053abf08e91a | 4 | public boolean isNear(double x, double y, double zoom) {
double distance = Math.abs(dist(x, y));
if (zoom >= 0 && distance > 5.0 / Math.sqrt(zoom))
return false;
double d = (from.getX() - to.getX()) * (from.getX() - to.getX())
+ (from.getY() - to.getY()) * (from.getY(... |
123d2de6-37e6-4fad-81d8-44854b51afcb | 6 | public Complex[] getData1() {
for (k = 0; k < power; k++) {
for (j = 0; j < 1 << k; j++) {
bfsize = 1 << (power - k);
for (i = 0; i < bfsize / 2; i++) {
Complex temp1 = new Complex(0, 0);
Complex temp2 = new Complex(0, 0);
p = j * bfsize;
x2[i + p] = temp1.plus(x1[i + p], x1[i + p + bf... |
a94ed3a6-fa7e-43a2-9653-10fa10eb73c1 | 7 | public static void main(String[] args) {
final long startTime = System.currentTimeMillis();
/*
if (args.length > 3 && !args[1].equals("-k") || args.length < 3) {
System.err.println("Usage: [-DataCounter implementation] [-sorting routine] [filename of document to analyze]");
System... |
ecf72214-f4ec-416b-a008-51e7521c9bea | 0 | @Override
public String toString()
{
return "isPublic()";
} |
4423b66f-0808-461f-9115-62acf279a9ca | 4 | private Integer differenceBetweenSpecieLists(List<Specie> list1,
List<Specie> list2) {
Integer difference1 = 0;
for (Specie s : list1) {
if (!list2.contains(s)) {
difference1++;
}
}
Integer difference2 = 0;
for (Specie s : list2) {
if (!list1.contains(s)) {
difference2++;
}
}
retur... |
9a537d50-985c-422b-9825-617c044b9ac5 | 4 | private int jjMoveStringLiteralDfa4_5(long old0, long active0) {
if (((active0 &= old0)) == 0L)
return 4;
try {
curChar = input_stream.readChar();
} catch (java.io.IOException e) {
return 4;
}
switch (curChar) {
case 93:
if ((active0 & 0x200000L) != 0L)
return jjStopAtPos(4, 21);
break;
... |
e2ecbd55-311f-4535-bc53-8623966d7f45 | 6 | public void drawSkillEffects(Graphics2D g2d, Character character, boolean isMonster) {
int buffAmount = character.getBuffs().size();
if (buffAmount > 0) {
for (int i=0; i<character.getBuffs().size(); i++) {
if (!isMonster) {
g2d.drawImage(character.getBuff... |
9c21f5ef-5df7-4d2c-bba8-933f1c0dc41a | 6 | private void vender() {
dtmcv = (DefaultTableModel) JT_CarrinhoCompras.getModel();
JT_Venda_Produtos.selectAll();
int linha = JT_Venda_Produtos.getSelectedRow();
int codigo = Integer.parseInt((String) JT_Venda_Produtos.getValueAt(linha, 0)), quantidade = Integer.parseInt(JTF_Qtde.getTex... |
ad02bcb1-964e-4e77-bcfb-e8c633beca9d | 5 | @Test
public void testExecutingState() throws ProcessExecutionException, ProcessRollbackException {
IProcessComponent<?> comp = TestUtil.executionSuccessComponent(true);
// use reflection to set internal process state
TestUtil.setState(comp, ProcessState.EXECUTING);
assertTrue(comp.getState() == ProcessState... |
02764622-80e9-40c8-8fd5-893ee6b75832 | 7 | public static final List<String> loadEnumerablePage(final String iniFile)
{
final StringBuffer str=new CMFile(iniFile,null,CMFile.FLAG_LOGERRORS).text();
if((str==null)||(str.length()==0))
return new Vector<String>();
final List<String> page=Resources.getFileLineVector(str);
for(int p=0;p<(page.size()-1);p... |
8488018f-afe3-4ab0-a24e-b87fc6c32084 | 1 | @Override
public GameFont getClonedObject(String name, Map<String, String> data) {
// Get an existing GameFont, remember this can possibly return null if
// it wasn't a validFont.
GameFont cachedFont = getObject(name, data);
if (cachedFont == null) {
return cachedFont;
}
return cachedFont.getShallowClo... |
d704a4fc-7240-4cfc-bde0-024fb3f3a87e | 0 | public void f() {
System.out.println("public f()");
} |
26538eb2-316b-48bf-938e-be84b09efa26 | 1 | public HostInfo(String address, int port) {
try {
this.address = InetAddress.getByName(address);
this.port = port;
} catch (Exception e) {
System.err.println("Cannot get IP address" + address + ":" + port);
}
} |
3293cdd7-d12d-4138-9d4a-2f8f37f7d3ce | 5 | public void update() {
for (int i = 0; i < bullets.size(); i++) {
Bullet bullet = bullets.get(i);
bullet.fly();
for (int j = 0; j < enemies.size(); j++) {
Enemy enemy = enemies.get(j);
if (GameTool.isCollision(bullet, enemy)) {
// 敵人要消失
enemies.remove(enemy);
// 子彈要消失
bullets.r... |
bd915b04-8616-4c69-aa5e-27bb660cd0b0 | 9 | public void quickClear(Space center) {
if (center.getState() == State.REVEALED && !center.isMine()) {
int nearFlags = 0;
List<Space> adjacent = center.getAllAdjecentSpaces(this);
for (Space s : adjacent) {
if (s.getState() == State.FLAGGED) {
... |
3a7c7892-3940-48f2-a176-96a4dbf3e37a | 7 | @Override
public List<Point> findWay(Node<Point> start, Node<Point> goal, ListGraph<Point> graph) {
// Closed list is only a fraction of the complete graph
int initSize = (int) Math.log(graph.getVerticesSizes());
System.out.println(initSize);
this.closedList = new HashSet<Node<Point... |
ecb6cb88-a13d-408d-aced-464758cd8241 | 7 | @Override
public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
Scriptable thisObj, Object[] args)
{
if (!f.hasTag(SCRIPT_TAG)) {
return super.execIdCall(f, cx, scope, thisObj, args);
}
int id = f.methodId();
switch (i... |
56752188-a838-4eca-b299-7acd26bbb554 | 1 | public Set<Point3> getAlivePositions() {
Set<Point3> points = new HashSet<Point3>();
synchronized (beings) {
for (Being b : beings) {
points.add(new Point3(b.getPosition()));
}
}
return points;
} |
99ca353c-caf5-43e2-8875-2c80132efaf4 | 1 | private Message errorMessage(Stat stat) {
Message msg = new Message();
String subject = stat.getName() + ": validation failed";
if (stat.getStateDescription() != null) subject += " (" + stat.getStateDescription() + ")";
msg.subject(subject);
addNameValue(stat, msg);
msg.a... |
2506d651-19f2-4e95-8c82-4ff4d8de68fa | 1 | public Set getDeclarables() {
Set used = new SimpleSet();
if (instr != null)
instr.fillDeclarables(used);
return used;
} |
f8a8efdc-7121-4bb8-a55e-4824fa1d26a9 | 5 | private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_exitMenuItemActionPerformed
{//GEN-HEADEREND:event_exitMenuItemActionPerformed
if(hasChanges)
{
int dialogResult = JOptionPane.showConfirmDialog(this, "You have unsaved changes, would you like to sa... |
494e321f-fa39-4748-991b-703ac41048b7 | 8 | @Override
public void update(GameContainer gc, int delta, Level level) {
Input input = gc.getInput();
if (input.isKeyDown(Input.KEY_LEFT) || input.isKeyDown(Input.KEY_A)) {
velocity.x -= runSpeed;
} else if (input.isKeyDown(Input.KEY_RIGHT) || input.isKeyDown(Input.KEY_D)) {
velocity.x += runSpeed;
}
... |
61c8c6d7-1e38-42e4-b2ad-9b9d93f5007c | 9 | public void create(Qualificador qualificador) {
if (qualificador.getQualificadorAplicacaoCollection() == null) {
qualificador.setQualificadorAplicacaoCollection(new ArrayList<QualificadorAplicacao>());
}
if (qualificador.getQualificadorProdutoCollection() == null) {
quali... |
f7413df5-bb13-400b-97a8-9e22879d8278 | 9 | static final synchronized AbstractToolkit createToolkit
(int i, int i_168_, int i_169_, IndexLoader loader, int i_170_, d var_d,
Canvas canvas, int i_171_) {
try {
anInt4576++;
if (i_170_ == i_171_)
return Class348_Sub5.createSoftwareToolkit(true, i_168_, i_169_, canvas, var_d);
if (i_171_ == 2)
... |
48ba5184-e2c4-40ea-ac0b-322f2e332850 | 8 | public void body()
{
// Process events
Object obj = null;
while ( Sim_system.running() )
{
Sim_event ev = new Sim_event();
super.sim_get_next(ev); // get the next event in the queue
obj = ev.get_data(); // get the incoming data
... |
6549bc70-e41b-4d85-bfe5-d71b3b08f061 | 3 | @Override
public void deserialize(Buffer buf) {
super.deserialize(buf);
level = buf.readUByte();
if (level < 1 || level > 200)
throw new RuntimeException("Forbidden value on level = " + level + ", it doesn't respect the following condition : level < 1 || level > 200");
in... |
15248251-a941-401a-ae10-30937f539e4c | 8 | public final Variable addend() throws RecognitionException, TokenStreamException {
Variable result = new Variable("","","");;
Variable e1, e2;
try { // for error handling
e1=factor();
result = e1;
{
_loop313:
do {
switch ( LA(1)) {
case OP_PRODUCTO:
{
{
ma... |
ab370264-7bfd-4953-9a8c-bf3e3ac1d505 | 4 | @Override
public void setBoolean(long i, boolean value)
{
if (ptr != 0) {
Utilities.UNSAFE.putLong(ptr + sizeof * i, value == true ? 1 : 0);
} else {
if (isConstant()) {
throw new IllegalAccessError("Constant arrays cannot be modified.");
}
... |
c1bfd0e2-7189-445b-b113-e3d07091e337 | 2 | private static PixImage randomImage(int i, int j) {
/**
* Visit each cell (in a roundabout order); randomly pick a color.
*/
PixImage image = new PixImage(i, j);
Random random = new Random(0); // Create a "Random" object with seed 0
int x = 0;
int y = 0;
for (int xx = 0; xx < i; xx++) {
x = (x + 78... |
2de3ed66-4087-4e57-ac61-db535eb3961d | 6 | public ServerFinder(JFrame parent) {
super(parent, I18n.getInstance().getString("sfTitle"));
setLayout(new BorderLayout());
table = new JTable();
table.setCellSelectionEnabled(false);
table.setColumnSelectionAllowed(false);
table.setRowSelectionAllowed(true);
table.setModel(new ServerTableModel(new Vecto... |
623d12f8-78b0-44da-a109-7d8182630e1c | 7 | public void run() {
try {
while(!finished && !socket.isClosed()) {
Packet packet = Packet.unpack(in);
if(packet == null) {
// The other side closed the connection
break;
}
//System.out.println("Received packet: " + packet);
if((packet.getFlags() & Packet.FIN) != 0) {
gotFIN = t... |
0c36e268-a6e9-4196-91db-7781d22162b2 | 2 | public static pgrid.service.corba.repair.IssueState from_int (int value)
{
if (value >= 0 && value < __size)
return __array[value];
else
throw new org.omg.CORBA.BAD_PARAM ();
} |
c46421be-69e1-4a51-9905-e2aaee1b8b55 | 3 | public void setAuthorities(String roles) {
this.authorities = new HashSet<GrantedAuthority>();
for (final String role : roles.split(",")) {
if (role != null && !"".equals(role.trim())) {
GrantedAuthority grandAuthority = new GrantedAuthority() {
public St... |
7f752f7a-595a-4c46-95f0-0cc56d16756a | 2 | public void updateViews() {
for (IUpdateView iv : viewList) {
if (iv != null) {
iv.updateView();
}
}
} |
1dcdc2a5-6aac-4473-b8da-1801c1e6ffeb | 8 | public static void main(String argv[]) throws Exception {
PORT = Integer.parseInt(argv[0]);
FILENAME = argv[1];
SERVER_SOCKET = new DatagramSocket(PORT);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int expected_number = 0;
boolean eof = false;
do {
byte[] packet_buffer = new byte[1024]... |
58fbfb86-713e-4870-bcd0-7057aea740f4 | 0 | private NetworkingPreference(ProxyInfo proxy) {
System.setProperty("http.proxyHost", proxy.getHost());
System.setProperty("http.proxyPort", proxy.getPort());
} |
6a6ab160-730f-41c0-8828-4bf8303ae383 | 0 | @Override
public void startSetup(Attributes atts) {
super.startSetup(atts);
TEXT = atts.getValue(A_TEXT);
setEnabled(false);
addActionListener(this);
Outliner.documents.addUndoQueueListener(this);
Outliner.documents.addDocumentRepositoryListener(this);
} |
e611195e-7919-418c-80ab-5cc3e5b29da5 | 5 | public void jsFunction_waitCraft(String wnd, int timeout) {
deprecated();
int cur = 0;
while (true) {
if (cur > timeout)
break;
if (UI.instance.make_window != null)
if ((UI.instance.make_window.is_ready) &&
... |
3f1b5e15-c405-4379-b5f6-9cf1c238c3af | 1 | public Value naryOperation(final AbstractInsnNode insn, final List values)
throws AnalyzerException {
if (insn.getOpcode() == MULTIANEWARRAY) {
return newValue(Type.getType(((MultiANewArrayInsnNode) insn).desc));
} else {
return newValue(Type.getReturnType(((MethodInsnNode) insn).desc));
}
} |
a6cd1377-e5b3-4a1f-ac49-01ad2494c9d6 | 2 | public void addCards(PlayingCard... nCards)
{
int nL=this.cards.length+nCards.length;
PlayingCard[] newCards=new PlayingCard[nL];
for (int i=0;i<this.cards.length;i++)
{
newCards[i]=cards[i];
}
for (int i=0;i<nCards.length;i++)
{
newCards[i+this.cards.length]=nCards[i];
}
this.cards=newCards;
... |
4bbef4af-3610-490d-bc4a-3081636e67be | 8 | Object[] allocateArray(Object data[], int num) {
Object newData[] = null;
if (data instanceof javax.vecmath.Point3f[]) {
newData = new Point3f[num];
} else if (data instanceof javax.vecmath.Vector3f[]) {
newData = new Vector3f[num];
} else if (data instanceof javax.vecmath.Color3f[]) {
... |
fb4ad2af-be4f-4226-af9a-1e011136bff0 | 1 | @Override
public void closeChannel() throws IOException{
this.input.close();
this.output.close();
if(tcpchannelsocket != null) tcpchannelsocket.close();
} |
4ddd0995-d790-4775-b9f6-f698e2da7c93 | 9 | public static Stella_Object wrapKifWithForall(Stella_Object tree, Cons declaredvariables) {
if (Stella_Object.safePrimaryType(tree) == Logic.SGT_STELLA_CONS) {
{ Cons tree000 = ((Cons)(tree));
if (Stella_Object.symbolP(tree000.value)) {
{ GeneralizedSymbol testValue000 = ((GeneralizedSymbol... |
6ff8e782-7f84-42ef-8532-24b04ac81c1f | 5 | @Override
public void changeUserPassword(String username, String oldPassword, String newPassword) throws UserLockedOutException {
// throws UserLockedOutException if this isn't allowed
lockoutService.allowAttempt(username);
for(LdapServer ldapServer : ldapServers) {
try {
if(ldapServer.verifyPasswor... |
e50289cb-24e7-46d6-89a5-ce4b43455f83 | 1 | private boolean jj_2_76(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_76(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(75, xla); }
} |
b42b5007-8784-4e56-9e8f-e01a09109184 | 4 | @Override
public void process(JCas aJCas) throws AnalysisEngineProcessException {
String inputDocument = aJCas.getDocumentText();
Matcher questionMatcher = questionPattern.matcher(inputDocument);
// Find all question patterns, and create Question annotations
while (questionMatcher.find()) {
Q... |
8a3066dd-bdae-4b4a-a050-9906f38acee4 | 0 | public ArrayReverseIterator(T[] source)
{
this._source = source;
this._position = this._source.length - 1;
} |
f688f717-3f5e-4661-8c30-58275773a550 | 3 | public void setFullScreen( DisplayMode dm ){
this.setUndecorated(true);
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
this.pack();
this.setSize(1920, 1080);
this.setResizable(false);
this.setVisible(true);
vc.setFullScreenWindow(this);
if( dm !=... |
e30b13ba-a304-48a6-b253-4888185126a8 | 6 | @Override
protected boolean canDeleteChild(int index, Construct child, boolean isUser) {
if(mState == null || mState.mPlaceholders == null) {
return super.canDeleteChild(index, child, isUser);
}
Placeholder descriptor = getPlaceholderForConstruct(child);
if(descriptor == null || descriptor.isPermanent()... |
3ffafb32-f342-4cb9-89a4-d8aa9107d1a0 | 1 | private void readLines(final BufferedReader reader, final MyObjects myObjects) throws IOException {
String line;
while ((line = reader.readLine()) != null) {
myObjects.addLine(line);
}
} |
5b52bf50-4658-4b42-b4ba-5669595412c3 | 0 | public List<Partner> findAllPartnersByHallEventId(final Long hallEventId) {
return new ArrayList<Partner>();
} |
23d50658-7bf7-4bba-ab7d-d1984ebfe35b | 8 | private void dispatch(UpdateRequest ur) {
if (ur instanceof PrintRequest) {
print((PrintRequest) ur);
} else if (ur instanceof RemoveRequest) {
remove(((RemoveRequest) ur));
} else if (ur instanceof HighlightRequest) {
HighlightRequest hr = (HighlightRequest) ... |
06b0fc62-0c0b-4081-8bf7-a8ce3596015a | 7 | public FightThread() {
int mapTime = HyperPVP.getTime();
int left = HyperPVP.getMinutesLeft();
int third = mapTime / 3;
int one = mapTime;
int two = mapTime - third;
int three = mapTime - third - third;
ChatColor status = ChatColor.GREEN;
if (left <= one && left > two) {
status = ChatColor.GREEN... |
442814fd-cd43-4a2f-ae52-9b6f2f7560cf | 5 | public static String getName(Object instance)
{
Class<? extends Object> type = instance.getClass();
if (type.isArray() || Collection.class.isAssignableFrom(type)
|| Map.class.isAssignableFrom(type))
{
return "Array";
}
else
{
if (packages.contains(type.getPackage().getName()))
{
return ty... |
2368f2a1-82d8-43e9-9f09-fa2c06633e75 | 0 | public String getKodPocztowy() {
return kodPocztowy;
} |
ffca32ad-ea01-4836-b397-c8bbcb084406 | 8 | private void encode(String message)
{
int index = 0;
// initialize dictionary w/ single symbols
for(int i = 0; i < message.length(); i++)
{
if(i + 1 == message.length())
{
if(!dictionary.containsKey(message.substring(i)))
dictionary.put(message.substring(i), index++);
}
else
{
if(... |
483bd128-6dca-4e2d-8b8c-2c627ce32718 | 1 | public static double stddev(double[] vals) {
double mean = mean(vals);
double squareSum = 0;
for (double v : vals) {
squareSum += v * v;
}
return Math.sqrt(squareSum / vals.length - mean * mean);
} |
925594ec-b3f6-402c-a0e3-dd82c5e3ff93 | 1 | private int getEhtoY(Pelihahmo h){
if (h==h1){
return ehtoh1y;
} else {
return ehtoh2y;
}
} |
12f9305f-ef3d-459c-ac72-1c91c7fabc2d | 0 | public double getX() {
return x;
} |
c439310d-8e5e-400c-9f79-3f3d375cba84 | 8 | public void actionPerformed(ActionEvent e) {
if (e.getSource() == b1)
count[0]++;
else if (e.getSource() == b2)
count[1]++;
else if (e.getSource() == b3)
count[2]++;
else if (e.getSource() == b4)
coun... |
026af5ea-8d07-4af4-a672-27dfc0b1990d | 0 | public JButton getjButtonQuitter() {
return jButtonQuitter;
} |
a0415f91-ab77-4634-b5d0-95aa4d02ab5a | 0 | public void loadAntBrains(AntBrain red, AntBrain black) {
redAntBrain = red;
blackAntBrain = black;
} |
4b832a48-3bce-4f1c-bd01-6849532d9eab | 3 | private boolean isInTrack(int var1, int var2, int var3) {
for (int var4 = 0; var4 < this.connectedTracks.size(); ++var4) {
ChunkPosition var5 = (ChunkPosition) this.connectedTracks.get(var4);
if (var5.x == var1 && var5.z == var3) {
return true;
}
}
... |
34a10eae-76de-47c2-9636-53123897ee5e | 3 | public void leerArchivoOrigen()
{
try
{
FileInputStream file=new FileInputStream("articulos.txt");
int c;
while((c=file.read())!=-1)
{
dataInput=dataInput+String.valueOf((char)c);
}
file.close();
}
... |
f315b9e5-90d0-4b1f-88d3-b64a7efcf76c | 8 | private void compareFiles() {
progress = 0;
long start = System.currentTimeMillis();
for (int i=0; i<fileArray.size(); i++) {
calculataAndPublishProgress(i, fileArray.size(), "State 4 of 5: Find duplicate files! ");
ArrayList<File> duplicateFileArray = new ArrayList<File>();
for (int j=(i+1); j<fileArr... |
96eac32c-f166-4a6a-8f5a-aa1929420c44 | 1 | private SkinPreviewVO getSelectedListEntry() {
SkinPreviewVO ret = null;
if (this.previewList.size() > this.selectedIndex) {
ret = this.previewList.get(this.selectedIndex);
}
return ret;
} |
eef23d31-6dc9-4467-92f4-8d1382d7d3e6 | 6 | @Override
public boolean activate() {
furnace = SceneEntities.getNearest(Constants.FURNACE_IDS);
if (!Players.getLocal().isMoving() && furnace.isOnScreen() && !Bank.isOpen() && Inventory.getCount(Constants.STEEL_BAR_ID) > 0) {
if (Inventory.getCount(Constants.IRON_ORE_ID) <= 1 && Invento... |
07309035-b389-44cb-b743-680df22b235a | 2 | public OrgaEinheit getOrgaEinheitZuLeitername(String Leitername) {
OrgaEinheit rueckgabe = null;
ResultSet resultSet;
try {
resultSet = db
.executeQueryStatement("SELECT * FROM OrgaEinheiten WHERE Leitername = '"
+ Leitername + "'");
if(resultSet.next())
rueckgabe = new OrgaEinheit(resultSet,... |
73ae4234-fa6c-4bb3-a502-a85f1bf4a155 | 4 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Cliente other = (Cliente) obj;
if (this.idCliente != other.idCliente) {
return false;
... |
a4ad25ea-a1cd-450f-ba6c-79afdfc1661d | 2 | @Override
public void show() {
// Get list of styles and populate comboBox.
styles.removeAllItems();
File[] fileNames = CSS_DIR.listFiles();
for (int i = 0; i < fileNames.length; i++) {
File file = fileNames[i];
if (file.isFile()) {
styles.addItem(file);
}
}
super.show();
} |
35c38e20-4b80-414e-9c8e-cf149213fdcb | 5 | private Response takeAnswer() throws IOException{ //Implementation to take answer input. Used for storing user responses and storing answer keys.
String s = null;
@SuppressWarnings("unchecked")
ArrayList<String> copy = (ArrayList<String>) right.clone(); //Replacement of responses so responses are not lost
HashM... |
c5a36ce9-b3ab-4b61-bb26-94fbe9947050 | 7 | public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof KeyedValueDataset)) {
return false;
}
KeyedValueDataset that = (KeyedValueDataset) obj;
if (this.data == null) {
if (that.getKey() != null || th... |
0bba69b3-03de-44f9-b23b-a352685d803f | 4 | private int getOnlinePlayers() {
try {
Method onlinePlayerMethod = Server.class.getMethod("getOnlinePlayers");
if (onlinePlayerMethod.getReturnType().equals(Collection.class)) {
return ((Collection<?>) onlinePlayerMethod.invoke(Bukkit.getServer())).size();
} else {
return ((Player[]) onlinePlayerMeth... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.