method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
1aaeccc8-3ec6-4290-a5fe-3135b9e20d63 | 4 | public ArrayList<Location> getAdjPoints(){
ArrayList<Location> localPoints = new ArrayList<>();
for(int dx = -1; dx < 2; dx++){
for(int dy = -1; dy < 2; dy++){
if(dx == 0 && dy == 0){
continue;
}
l... |
f04372ea-05d0-40c2-a2c8-87510c361237 | 2 | public Group getGroup(int id)
{
Group group = null;
try
{
PreparedStatement ps = con.prepareStatement( "SELECT * FROM groups WHERE id=?" );
ps.setInt( 1, id );
ResultSet rs = ps.executeQuery();
if( rs.next() )
{
group = getGroupFromRS( rs );
}
... |
d525edbb-494f-4ee6-a3a5-10184802465c | 2 | private static boolean setDefaults() {
HashMap<String, Object> defaults = new HashMap<String, Object>();
defaults.put("enabled", true);
defaults.put("defaultHeight", 0);
defaults.put("floorColour", "RED");
defaults.put("gridColour", "WHITE");
defaults.put("liftFences", true);
defaults.put("setSizeFromSign", tru... |
dbc16994-38b2-4650-8e28-8ff685cd57ad | 8 | public void init(){//----------------------------------------------init
//背景色の設定
setBackground(BackColor);
//各リスナーの追加
addKeyListener(new MyKey());
addMouseListener(new MyMouse());
addMouseMotionListener(new MyMouseMotion());
//ダブルバッファ処理
main = createImage(MainScreen, ScreenHeight);
mg = main.getGraphi... |
46dc9b42-8ebc-4404-9e21-93f227ae1397 | 6 | private void giveItem(Command command){
NPC npc = null;
for(NPC n : npcs.values()){
if(n.getCurrentRoom().equals(currentRoom)){
npc = n;
}
}
if(npc == null){
System.out.println("Give to whom?");
} else if (!com... |
445017c3-98d3-47c2-95d1-769bbf971e2d | 7 | private byte[] crypt_raw(byte password[], byte salt[], int log_rounds) {
int rounds, i, j;
int cdata[] = (int[])bf_crypt_ciphertext.clone();
int clen = cdata.length;
byte ret[];
if (log_rounds < 4 || log_rounds > 31)
throw new IllegalArgumentException ("Bad number of rounds");
rounds = 1 << log_rounds;
... |
59fd38c4-ff30-4a21-b004-5e97d3adc42e | 4 | static void performStrike(
Actor actor, Actor target,
Skill offence, Skill defence
) {
//
// TODO: Allow for wear and tear to weapons/armour over time...
final boolean success = actor.health.conscious() ? actor.traits.test(
offence, target, defence, 0 - rangePenalty(actor, target), 1
)... |
3ea49a3b-994a-4b92-9ae3-a96fa782b15b | 5 | public void generateManifestEntries(){
Paths lPaths = new Paths();
String lBasePath = mManifestBuilder.getBaseDirectory().getPath();
lPaths.glob(lBasePath, mWildcardFilePath);
for(File lFile : lPaths.getFiles()){
String lFilePath = mManifestBuilder.relativeFilePath(lFile);
... |
3f31d6c5-2a73-4a87-bcc5-ac1636744fe8 | 1 | private void tulosta() {
for (Elokuva e : elokuvat) {
System.out.println(e);
}
} |
86e63b9b-d675-41c6-aaf1-19d47a956697 | 8 | public int search1(int[] A, int target) {
if (A == null) {
return -1;
}
int start = 0;
int end = A.length;
int result = -1;
while (start < end) {
int mid = start + (end - start) / 2;
if (A[mid] == target) {
result = mid;
break;
}
if (A[start] < A[mid]) {
if (A[start] <= target && ... |
dd3df86e-9b29-45aa-b830-36b4f14a93f3 | 4 | public <T extends BusinessObject> void delete(T bo) throws DataException {
Connection conn = ConnectionPool.getInstance().get();
try {
// go through each level of the class hierarchy and delete on each table
Class boClass = bo.getClass();
while (true) {
PreparedStatement stmt = conn.pr... |
b82f7b9d-51fa-4c75-90d6-bd188a71ff58 | 5 | private void extractDialogue(File conversationFile){
this.dialogue = new ArrayList<DialoguePart>();
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(conversationFile));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
String line = null;
try {
if(reader!=nu... |
522f3b79-0ce0-479c-ba04-cbeacbcd5f57 | 2 | @Override
public void display(int depth) {
StringBuffer buff = new StringBuffer();
for (int i = 0; i < depth; i++) {
buff.append('-');
}
for (Component component : mList) {
component.display(depth + 2);
}
} |
d6b17695-0645-4843-ba57-73bfb593e05a | 0 | @Override
public byte[] toByte() {
return mContent.getBytes();
} |
c787790e-4cca-4a0f-8378-b91d9fbca477 | 2 | private void initButtonClicks(){
//Создаем слушателя на нажаьте кнопок
KeyListener keyListener = new KeyAdapter(){
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER){
btnReg.doClick();
}
else {
... |
e4295462-e6aa-4a47-9e0c-e405fc2fdcd7 | 1 | public void setSurrounding(int index, UIElement surround) {
this.surroundings[index] = surround;
if(surround.getSurroundings()[Math.abs(index - 3)] == null) {
surround.setSurrounding(Math.abs(index - 3), this);
}
} |
14a6426e-4072-4db6-9512-b1cb77daa423 | 7 | public List<Sequence> importSequences() throws IOException, ImportException {
boolean done = false;
List<Taxon> taxonList = null;
List<Sequence> sequences = null;
while (!done) {
try {
NexusBlock block = findNextBlock();
if (block == NexusBlock.TAXA) {
taxonList = readTaxaBlock();
} else i... |
5d94e173-d2b0-4b9b-9d87-a543340e1580 | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
AnswerSearchResultsBean other = (AnswerSearchResultsBean) obj;
if (answers == null) {
if (other.answers != null)
return false;
} else if... |
24811f20-4e33-4e7d-ba10-f34b1880bb2d | 9 | public boolean skipPast(String to) throws JSONException {
boolean b;
char c;
int i;
int j;
int offset = 0;
int n = to.length();
char[] circle = new char[n];
/*
* First fill the circle buffer with as many characters as are in the
* to string. If we... |
b05f5119-e5de-4f45-9701-2f4e9c25c32f | 2 | private boolean lastContactFromTeam(int i) {
for (User user : playmode.getTeams()[i].getUser()) {
if(user.getID() == lastContactUserID){
return true;
}
}
return false;
} |
2371d63b-075c-4e1d-a9f0-6f53d2565f8c | 3 | static boolean compareBytes( byte[] data,int i, String compareTo )
{
byte[] c = compareTo.getBytes();
int j=0;
while ( i<data.length && j<c.length )
if ( data[i++]!=c[j++] )
break;
return j == c.length;
} |
1da45c8b-2c81-46b3-ae24-1cc4cf648d72 | 8 | public LinkedList<LinkedList<Direction>> spreadBestPaths() throws CloneNotSupportedException {
LinkedList<LinkedList<Direction>> bestPaths = new LinkedList<LinkedList<Direction>>();
SokobanMap temMap = (SokobanMap) this.clone();
LinkedList<Position> toSpread = new LinkedList<Position>();
toSpread.add(manPositio... |
db5d393a-30a9-4354-89c7-72cac15beefd | 1 | public static void main(String[] args) {
ApplicationContext context = SpringApplication.run(Application.class, args);
System.out.println("Let's inspect the beans provided by Spring Boot:");
String[] beanNames = context.getBeanDefinitionNames();
Arrays.sort(beanNames);
for (Stri... |
23243879-9125-4be0-82ea-77164a7a0b72 | 6 | void Draw_Legs(GL2 gl2) {
if(!render_meshes) {/*
int i,j;
for(i=0;i<6;++i) {
Leg leg=legs[i];
gl2.glDisable(GL2.GL_LIGHTING);
switch(i) {
case 0: gl2.glColor3f(1,0,0); break;
case 1: gl2.glColor3f(0,1,0); break;
case 2: gl2.glColor3f(0,0,1); break;
... |
0f752787-6f95-4dde-af8d-1b168aa1b247 | 0 | @Override
public String execute(String[] args){
runList = new ProcessList();
return "new batch created.";
} |
131191f6-f3fc-44b3-8b28-2fc3f75dd082 | 1 | public static void addAccountToList(Account accountObject){
if(arrayCount < 10)
{
accList[arrayCount] = accountObject;
arrayCount++;
}
} |
ba57f0a9-e9f9-4b3b-8249-923734f4ca9e | 7 | @Override
public String strip(String s) throws Exception {
final int length = s.length();
char[] chars = null;
int off = 0;
try {
chars = (char[]) value.get(s);
off = offset.getInt(s);
} catch (IllegalArgumentException e) {
throw new Runtim... |
d1c43e78-3c30-4d05-923e-4d66354914d3 | 7 | private void create(Create query) throws IOException, Error, ClassNotFoundException{
Hashtable<String, Table> tables = null;
File tableFile = new File(databaseDefUrl);
if(tableFile.exists()){
tables = this.getTableDef();
}else{
tables = new Hashtable<String, Table>();
}
//Check if it already has a tab... |
f8462614-2c2e-48e7-a471-4358caf79410 | 2 | public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
@SuppressWarnings("rawtypes")
List users = getHibernateTemplate().find("from User where username=?", username);
if (users == null || users.isEmpty()) {
throw new UsernameNotFoundException("user ... |
2e984bad-2df8-45b7-b568-adfc058af6da | 7 | private boolean checarNoNumero(String cN){
char temp;
for(int i=0; i<cN.length(); i++){
temp=cN.charAt(i);
if(temp<32 ||(temp>32&&temp<65) || (temp>90 && temp<97) || temp>122)
return false;
}
return true;
} |
896363c8-ffd9-4a74-84f7-9feb9f75f391 | 4 | public void send() {
if (!isStart)
{
JOptionPane.showMessageDialog(null, "司服器尚未啟動,請不要猴急!", "Error",
JOptionPane.ERROR_MESSAGE);
}
else if (clients.size() == 0)
{
JOptionPane.showMessageDialog(null, "沒有用戶連線,只能和空氣說話!", "Erro... |
666b677a-b61a-4f35-bca4-96921688e1a4 | 5 | private void pageDown() {
TextGrid.DataGridCel cel;
if (rowOffset + numberOfRows > grid.getNumRows()) {
currentRow = grid.getNumRows() - rowOffset;
} else {
if (grid.getNumRows() < numberOfRows) {
rowOffset = 0;
currentRow = grid.getNumRows... |
a3868ea7-a9ee-4b07-ab2b-244c4cedb256 | 0 | public void setParams(Object params) {
this.params = params;
} |
d355af80-9fe5-4a5d-bf7d-9ceb88d149ae | 2 | public void drawCard(Graphics g, JComponent theJPanelInstance) {
Image cardPic;
int fileNumber;
if (hasBeenRemoved) {
return;
}
if (isFaceUp) {
fileNumber = suit * A1JPanel.CARDS_IN_EACH_SUIT + value;
cardPic = CardImageLoa... |
cd21ae24-3810-4eef-8e18-e0b36b33b23c | 7 | public void calculate() {
for(int i = 0 ; i < numberOfAnts_ ; i++){
ants_.add(new Ant(numberOfElements_, numberOfValues_, pK_));
}
for(int j = 0; j < numberOfIteration_ ; j++){
for(int i = 0; i < numberOfAnts_; i++){
ants_.get(i).generatePermutation(cPI_);
if(j == 0){
cPI_.generate();
}
... |
ee0a0459-2966-48f9-89c8-53d6f437a3f8 | 4 | public List<String> databaseInfo(String columnName) throws SQLException{
String temp;
List<String> bankInfo=new ArrayList();
try{
databaseConnector=myConnector.getConnection();
stmnt=(Statement) databaseConnector.createStatement();
SQL... |
1ba2562d-b51b-49b3-848f-6cae6ea236b5 | 5 | void menuLoad() {
animate = false; // stop any animation in progress
// Get the user to choose an image file.
FileDialog fileChooser = new FileDialog(shell, SWT.OPEN);
if (lastPath != null)
fileChooser.setFilterPath(lastPath);
fileChooser.setFilterExtensions(OPEN_FILTER_EXTENSIONS);
fileChooser.setFil... |
e176c3d9-a03d-41c7-9bc7-e394e282d620 | 0 | private void jLabel16MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel16MouseClicked
client.sendMessage( "DING@" + roomId + "@" + " " + "@" + client.frame.getTitle() );
}//GEN-LAST:event_jLabel16MouseClicked |
587bbf4c-02b3-432a-879e-d86789d03115 | 6 | private void parseValue(String value)
{
if(value == null) throw new IllegalArgumentException("value is null");
srcValue = value.trim();
resultValue = srcValue;
isExpCalc = true;
if(srcValue.equals("")){
resultValue = "";
cellType = ValueType.STRING;
expResultType = ValueType.STRING;
re... |
b31c70d9-ef19-42e8-961e-d18ec9f86caf | 5 | private JSONObject setCookie(Cookie[] cookies, HttpServletResponse response, String last, List<String> prevEntityIDs, int maxAge) {
Map<String, String> previousIdps = new HashMap<String, String>();
boolean setLast = (last != null);
boolean setPrevious = (prevEntityIDs.size() > 0);
last =... |
d6ea2689-410f-4821-ae48-adba9882d229 | 3 | private Document parseFile(String filePath){
System.out.println("Parsing Queue file XML ... " + filePath);
DocumentBuilder docBuilder;
Document doc = null;
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
docBuilderFactory.setIgnoringElementContent... |
82527ac2-47ba-4270-923c-8ad9d3babf0e | 8 | @Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((author == null) ? 0 : author.hashCode());
result = prime * result
+ ((dateCreated == null) ? 0 : dateCreated.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * re... |
05f6ba44-17db-494a-a14f-36cca2a28b28 | 2 | public static long binomialCoefficient(int n, int k) {
long binom = 1;
if (k > n - k) {
k = n - k;
}
for (int i = 0; i < k; ++i) {
binom *= (n - i);
binom /= (i + 1);
}
return binom;
} |
187c9dae-561e-4233-aa3b-0501aa9bf199 | 9 | public int search(int[] nums, int target) {
if (nums == null || nums.length == 0) {
return -1;
}
int low = 0;
int high = nums.length - 1;
while (low <= high) {
int mid = (low + high) / 2;
if (nums[mid] == target) {
return mid;
} else if (nums[low] <= nums[mid]) {
if (nums[low] <= target &&... |
17d37c8f-4bde-4403-8482-816bf60fd46b | 4 | private boolean check4(int i, int j) {
int first = getMatrix(i, j);
if (first == 0 || first == -1) {
return false;
}
int second = getMatrix(i + 1, j - 1);
int third = getMatrix(i + 2, j - 2);
if (first == second && first == third) {
return true;
}
return false;
} |
cfddc04c-d802-46e2-a079-f13e693dcf8c | 0 | public Sorcerer() {
super(new EarthSpike(), new MagicCrasher(), new SoulBurn(), 30.0, 50.0, 100.0, 60.0, 20.0, 60.0, "Sorcerer",500,250);
} // End DVC |
662700d9-db7d-4a2c-a641-1c0c42b64b93 | 5 | public FroshProjectController() throws FroshProjectException {
// Get the View class
//
String viewClassName = FroshProjectConfig.getProperty("View.className");
if (viewClassName == null) {
viewClassName = "CLIView";
}
// Log a message
//
Fros... |
316e1103-8952-4de9-8642-771395960c2d | 8 | @Override
public Environmental getStock(String name, MOB mob)
{
final List<Environmental> storeInv=new ConvertingList<ShelfProduct,Environmental>(storeInventory,converter);
Environmental item=CMLib.english().fetchEnvironmental(storeInv,name,true);
if(item==null)
item=CMLib.english().fetchEnvironmental(storeI... |
01c71bc5-09c7-4578-a69e-665498277098 | 9 | public static void quickSort(long[] a,int begin, int end){
int left = begin;
int right = end;
long key = a[left];
while(left < right){
while(left < right && a[right] >= key)
right--;
if(left < right)
a[left] = a[right];
while(left < right && a[left] < key)
left++;
if(left < right)
a[... |
44905e62-6607-427b-a370-1bd628e71747 | 1 | public Tester(String name) {
this.name = name;
} |
1f26ccfc-58a4-4369-9c90-1d683a310490 | 9 | void rewardPlayersFor(String rewardType, int [] rewards, ScoreMaker scorer)
{
final int [] scores = new int[C.playerCount];
for (int i = 0; i < scores.length; i++) {
scores[i] = scorer.get(i);
}
Integer [] order = new Integer[C.playerCount];
for (int i = 0; i < order.length; i++) {
order[i] = i;
}
... |
28852b3a-a36f-467b-b834-21f48216d852 | 8 | public static void main(String [] args) {
//startTime
double startTime = System.currentTimeMillis();
int [][] grid = {
{8,02,22,97,38,15,00,40,00,75,04,05,07,78,52,12,50,77,91,8},
{49,49,99,40,17,81,18,57,60,87,17,40,98,43,69,48,04,56,62,00},
{81,49,31,73,55,79,14,29,93,71,40,67,53,88,30,03,49,13,36,6... |
9e8774da-ec2e-4dce-81ec-9d4cd82cf476 | 3 | public Collection beginParsing() {
try {
parser.parse(libraryFile, this);
return null;
} catch(SAXParserShouldStopNowException e) {
return collection;
} catch(SAXException e) {
e.printStackTrace();
return null;
} catch(Exception e) {
e.printStackTrace();
return null;
}
} |
02b76d1f-faf8-4bfb-9786-5db37735c8e3 | 3 | private void check(final String[] columnData, final int[] lengths, final String[] expected, final boolean preserveLeading,
final boolean preserveTrailing) {
final List<ColumnMetaData> columnMetaData = new ArrayList<ColumnMetaData>();
assertEquals("data and col lengths different size...", co... |
2ac08f14-be6f-4b18-a13e-7c1fba71ffed | 2 | public static void main(String args[]) {
try {
Socket clientSocket=new Socket("172.17.132.170",4331);
String str=null;
DataInputStream in=null;
DataOutputStream out=null;
in=new DataInputStream(clientSocket.getInputStream());
out=new DataOutputStream(clientSocket.getOutputStream());
out.write... |
71fe201c-b0cd-4a9e-925a-bb9e91e2910f | 2 | public NaturalSatellite buildNaturalSatellite(Planet primaryObject) {
primaryObjName = primaryObject.getName();
if (population > 0) {
this.inhabited = true;
}
if (population == 0) {
this.inhabited = false;
}
NaturalS... |
93c70d39-72c8-4b9f-8c1a-e86b266aea9f | 1 | @Override
protected void tearDown() throws Exception {
super.tearDown();
if (cycAccess != null) {
cycAccess.close();
}
} |
3cc54163-6c53-42d9-bd3e-51738a8c242a | 2 | Pass3(File oSource, int addressMax, byte[] iNES, boolean iNESWrite) {
this.addressMax = addressMax; // Set the maximum address
this.source = new File(oSource.getName() + ".tmp.fin"); // Set the source file
this.iNESWrite = iNESWrite; // Set the iNES write indicator
String name = oSou... |
18c943c7-77be-43bf-b57e-03547a65ca02 | 4 | @Override
void draw(Graphics g, int xSize, int ySize) {
xPixels = col*xSize;
yPixels = row*ySize;
g.setColor(color);
g.fillRect(xPixels, yPixels, xSize, ySize);
g.setColor(Color.BLUE);
if (doorDirection == DoorDirection.UP) {
g.fillRect(xPixels, yPixels, xSize, doorWidth);
}
if (doorDir... |
cf73b744-7ecc-4c5e-84c6-f39e7c9bb90f | 5 | public Fish instantiateFishSpecies(Point p, String className) {
try {
Class cl = Class.forName(className);
return (Fish) (cl.getDeclaredConstructor(
int.class, int.class, Rectangle.class).newInstance(
p.x, p.y, bounds));
... |
e900b377-a3fa-4b05-ac9e-a9316f78d126 | 7 | private boolean worldParam(Player pl, String[] args) {
boolean ret = false;
if ((Permissions != null && Permissions.has(pl, "orerespawn.world")) || pl.isOp()) {
if (args.length == 3) {
World wo = plugin.getServer().getWorld(args[1]);
if (wo != null) {
... |
0ead9393-41d7-4fd3-883b-b224b2b127e8 | 7 | static void show2(DataQueue q, Frame owner) {
if (q.pointer <= 0) {
JOptionPane.showMessageDialog(owner, "No data to plot. Collect some and come back.", "Empty Data Set",
JOptionPane.ERROR_MESSAGE);
return;
}
if (q instanceof ObjectQueue)
throw new RuntimeException("An object queue is generally no... |
44907db5-bced-4478-9895-1715dab4dd24 | 7 | public void showTestWindow() {
boolean cancel = false;
do {
try {
String response = JOptionPane.showInputDialog(ChiSquaredPopup.this, "How many degrees of freedom?", "Enter a number.", JOptionPane.QUESTION_MESSAGE);
if (response == null) {
... |
3b85561e-582b-4699-8592-bc27c8069a4b | 3 | private boolean isValidMultiAnswers() {
boolean res = true;
for (int i=0; i < 4 && res; i++) {
String s = tfMultiList.get(i).getText();
// checks each tf is (1,200)
res = res && isValidQuestionOrAnswer(s);
}
return res;
} |
000a438a-82ba-4f20-93e1-563f5bdeacaf | 0 | @Test
@Ignore
public void runTestReflection4() throws IOException {
InfoflowResults res = analyzeAPKFile("Reflection_Reflection4.apk");
Assert.assertEquals(1, res.size());
} |
051ef49b-b7a7-4339-a444-20e06e521d90 | 3 | public MetaDataXMLParser(XMLEventReader xmlReader) throws XMLStreamException {
while (xmlReader.hasNext()) {
XMLEvent = xmlReader.nextEvent();
if (XMLEvent.isStartElement()) {
if (XMLEvent.asStartElement().getName().getLocalPart().equalsIgnoreCase("version... |
27f220ba-49ea-4350-9aa7-6785e9d9ceef | 1 | public Query<T> skip(int count)
{
Iterable<T> rs;
if(this.isRandomAccessable(this._source))
{
rs = new RandomSkipIterable(this.createRandomAccessor(this._source), count);
}
else
{
rs = new SkipIterable(this._source, count);
}
return new Query<T>(rs);
} |
c38a4508-9973-413c-bb97-d1a0d9f1a6fc | 2 | public boolean contains(E element) {
for (int i = 0; i < this.size; i++) {
if (array[i].equals(element)) {
return true;
}
}
return false;
} |
7b06850f-dea7-4d2a-bee5-dda1e743b4ee | 3 | private void writeGAMA() throws IOException
{
if (param.isGammaSet() || param.isSRGBIntentSet())
{
ChunkStream cs = new ChunkStream("gAMA");
float gamma;
if (!param.isSRGBIntentSet())
{
gamma = param.getGamma();
}
else
{
gamma = 1.0F / 2.2F; // SRGB gamma
}
// TD should include ... |
c36a657a-9105-4960-b329-b18e8c881153 | 4 | public void execute() throws MojoExecutionException {
Set<String> mainKeys = null;
try {
// parse the main messages file and create a set of its defined
// message keys
Resource resource = new FileSystemResource(messagesDirectory + mainMessagesFile);
... |
dc8d2630-81cf-46eb-bc26-32e0adae7454 | 4 | public Game() {
if (game != null) { game.fallTimer.stop(); }
game = this;
this.setLayout(null);
this.setOpaque(false);
difficulty = Options.difficulty;
multipleLives = Options.multipleLives;
lives = multipleLives ? 3 : 1;
fallTimer = new Timer(FALL_RATE, this);
holdUsed = false;
resumeBu... |
a2b97b2c-c69e-4d6f-9dd3-56a34c40024d | 2 | public static AbstractInsnNode nextRealInsn(AbstractInsnNode n) {
while (n != null && n.getOpcode() == -1) {
n = n.getNext();
}
return n;
} |
a8cab1ca-794f-4b26-91f7-a75e3d248887 | 6 | public void addBook(BookVO bookVO) throws LibraryManagementException {
Connection connection = null;
PreparedStatement preparedStatement = null;
ConnectionFactory connectionFactory = new ConnectionFactory();
try {
connection = connectionFactory.getConnection();
preparedStatement = connection
.prepare... |
535947c3-f198-4113-8a13-3612bb488443 | 3 | final public void Sign() throws ParseException {
/*@bgen(jjtree) Sign */
SimpleNode jjtn000 = new SimpleNode(JJTSIGN);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
try {
if (jj_2_77(3)) {
jj_consume_token(PLUS);
} else if (jj_... |
2c7aa573-788a-402b-a42a-03e2d9eb3a25 | 6 | @Override
public void run()
{
File dirFile = null;
for (final String target : this.targetDir) {
dirFile = new File(target);
this.addDirNode(this.document.getRootElement(), dirFile);
}
final Format form = Format.getPrettyFormat();
form.setOmitDeclaration(true);
form.setEncoding("UTF-8");
final X... |
1750f761-8078-4c7a-9794-f9326da31e2b | 2 | private void insertCountry() {
CountryBO countryBO = ServiceLocator.getBean(CountryBO.class);
BufferedImage imBuff = null;
InputStream is = InsertImageTest.class.getResourceAsStream("/flags/mexico.png");
try {
imBuff = ImageIO.read(is);
} catch (IOException e) {
e.printStackTrace();
... |
ca04c17d-a3f9-4c9d-a97a-a0b0619befae | 4 | public void rafraichirListeLignes() throws IOException {
String[] reponseParsed;
int idControleur;
coucheReseau.envoyer("REFRESH");
reponse = coucheReseau.recevoir();//ID CONTROLEUR + JSON LIGNES
reponseParsed = reponse.split(";");
//{"id_controleur":2, "lignes":["ligne1", "ligne2", "ligne... |
a78b5e05-c36e-4fa7-95cc-de26c9787281 | 3 | @Override
void load(DataInput datainput, int depth) {
try {
if (depth > 512) {
throw new RuntimeException("Tried to read NBT tag with too high complexity, depth > 512");
} else {
this.type = datainput.readByte();
int j = datainput.readI... |
1679269b-2bc0-4c1e-85bd-d9b76c42506e | 8 | protected static final void doPackPrimitive(final Class clazz, final MethodVisitor mv) {
switch (Type.getType(clazz).getSort()) {
case Type.BOOLEAN:
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Boolean", "valueOf", "(Z)Ljava/lang/Boolean;");
break;
... |
0948d74e-e3c7-4c85-b465-40f3b73c5f74 | 0 | public void setEncoding(String charset) throws UnsupportedEncodingException {
// Just try to see if the charset is supported first...
"".getBytes(charset);
_charset = charset;
} |
ba5c7a39-96a9-4d05-9946-5b016fd0b1f7 | 0 | public void render(GameContainer container, Graphics g) throws SlickException {
board.draw(g, container.getWidth() / 10);
} |
cb582ca3-7095-48d1-b088-f264fc1dd9c6 | 9 | @Override
public void unInvoke()
{
// undo the affects of this spell
MOB recheckMOB=null;
if(canBeUninvoked())
{
if(affected instanceof MOB)
{
final MOB mob=(MOB)affected;
if((mob.location()!=null)&&(!mob.amDead()))
mob.location().show(mob,null,CMMsg.MSG_OK_VISUAL,L("<S-NAME> return(s) to <... |
31a9ffcb-b456-42d8-8762-480323eda3ba | 6 | public static void main(String[] args) {
// read in two string from two files
In in1 = new In(args[0]);
In in2 = new In(args[1]);
String text1 = in1.readAll().trim().replaceAll("\\s+", " ");
String text2 = in2.readAll().trim().replaceAll("\\s+", " ");
int N1 = text1.leng... |
d7a1d209-8443-4f36-b9d7-0a1b30f18c28 | 0 | private void handleInput(int x, int y, int z) {
handleMap(new Rectangular(Math.max(x, y), Math.min(x, y)), z);
handleMap(new Rectangular(Math.max(x, z), Math.min(x, z)), y);
handleMap(new Rectangular(Math.max(y, z), Math.min(y, z)), x);
} |
b1d5e1c4-b277-4b32-b398-56c8d0e8099a | 8 | public RSS(String rss){
if(rss != null){
rss.replaceAll("\n", "");
rss.replaceAll("\t", "");
Pattern p = Pattern.compile("<item>(.*?)</item>", Pattern.DOTALL);
Matcher m = p.matcher(rss);
Pattern titleParse = Pattern.compile("<title>(.*?)</title>", Pattern.DOTALL);
//Pattern linkParse = Pattern.com... |
65d7c24e-3be8-495a-ac05-37baf3e72cc0 | 6 | @Override
public boolean touchDown(int arg0, int arg1, int arg2, int arg3) {
int x = ((int) mousePosition.x / 32) * 32;
int y = ((int) mousePosition.y / 32) * 32;
Vector2 position = new Vector2(x, y);
if(cursor != null && !isSpotOccupied(position)) {
switch(keyToType.get(cursor)) {
case BRICK:
if(... |
cd28fb11-5f2e-4524-ade3-8d3ecab6e943 | 8 | private void addTextContent(Element parent, TextObject textObj) /*throws XMLStreamException*/ {
if (textObj == null)
return;
//Could have multiple text content variants
for (int i=0; i<textObj.getTextContentVariantCount(); i++) {
TextContent textContent = textObj.getTextContentVariant(i);
if (... |
974ee437-5c04-48b1-9b83-b7195bb8f4b1 | 2 | static synchronized String getOMSAppVersion() {
if (oms_version == null) {
try {
BufferedReader r = new BufferedReader(new InputStreamReader(
Utils.class.getResourceAsStream("version.txt")));
oms_version = r.readLine();
r.close(... |
654f4789-2e9b-42ce-867d-92d3c2579901 | 4 | public String generateCode() {
String code = "";
String ident = " ";
// Function description (commented)
for (int i = 0; i < descDoc.size(); i++) {
code += ("// " + descDoc.get(i));
}
code += ("function " + toString() + "{\n\n");
// Variables
for (int i = 0; i < variables.size(); i++) {
cod... |
543d5050-c209-4f49-8bbd-accd595255c3 | 3 | private static void war() {
wars++;
System.out.println("WAR!");
for (int i = 0; i < 4; i++) {
for (int j = 0; j < hands.length; j++) {
if (hands[j].handSize() != 0) {
stacks[j].put(hands[j].get());
}
}
}
compareStacks();
} |
9e97c656-e0a1-4e47-941f-6f4d2afd18af | 8 | private boolean chevronFinder(UnitedPortalEvent event1)
{
if(!active||event1==null || event1.getCause()!=TeleportCause.NETHER_PORTAL || !AddressBook.readAddress(event1.getFrom().getWorld().getName()).canDial())
{
return false;
}
String dd=getGate(event1);
for(ChevronWorld s:AddressBoo... |
d6ebcf20-0099-4824-a003-cfcfb84c59ae | 4 | private static void listElements(){
String stringToPrint = "";
for (int x = 0; x <= elementsDiscovered.length-1; x++){ //goes through elementsDiscovered
if(elementString(elementsDiscovered[x]) == null){ //finding the string of that postion's
stringToPrint += ".";
GuiMaster.println(stringToPrint); // int.... |
5a99fbf8-7e73-4d39-88a3-43f08e23125f | 7 | public static void findAllColumns(String schemaFile) {
allColumns = new TreeSet<String>();
try {
Connection conn = null;
Statement stmt;
// load the H2 Driver
try {
Class.forName("org.h2.Driver");
} catch (ClassNotFoundException e) {
System.err.println("Unable to load H2 driver");
e.prin... |
1b90f53b-2826-433b-b5ad-5cc81f182f8a | 4 | public void showStatus(int step, Field field)
{
if(!isVisible()) {
setVisible(true);
}
stepLabel.setText(STEP_PREFIX + step);
stats.reset();
fieldView.preparePaint();
for(int row = 0; row < field.getDepth(); row++) {
for(... |
cbd7000c-621f-4c59-be15-3f78da6591ac | 5 | private Character getMaxChildHeuristicKey(Map <Integer, Integer> heuristicMap) {
Integer maxWeight = 0;
Character maxWeightKey = null;
for (TrieNode child : this.children.values()) {
Integer weight = heuristicMap.get(Integer.valueOf(child.getId()));
if (weight != null && weight > maxWeight) {
... |
ffdc2726-26c5-4009-a6cf-0b4796eb2a5a | 4 | public static String concatenate(String[] stringArray, String delimiter) {
if (delimiter == null || stringArray == null || stringArray.length == 0) {
return null;
}
String result = stringArray[0];
for (int i = 1; i < stringArray.length ;i++) {
result += delimit... |
50c44a73-ee54-4037-80af-2b1410a996d9 | 8 | private int nextAnalogueSegment(int box0){
// next adc
int nextAdc = nBoxes;
boolean endFound = false;
boolean test = true;
int ii = box0;
while(test){
if(this.adcs[ii]){
nextAdc = ii;
test = ... |
f4f908aa-7970-4353-8be8-3071c03b615c | 7 | public Object nextContent() throws JSONException {
char c;
StringBuffer sb;
do {
c = next();
} while (Character.isWhitespace(c));
if (c == 0) {
return null;
}
if (c == '<') {
return XML.LT;
}
sb = new Str... |
d63d2317-c45d-46d8-bb70-d6b7cbbef247 | 1 | public DB getDB() {
initMongo();
DB db = MongoDbUtils.getDB(mongo, dbName, username, password == null ? null : password.toCharArray());
return db;
} |
7c546266-40e2-4caf-99d7-f0f3b7b20a10 | 8 | private double launchAngle(double launchX, double launchY) {
double goalX = (GOAL_X + 1) * 30;
double goalY = (GOAL_Y + 1) * 30;
double degreeWant = Math.atan(Math.abs(goalY - launchY)
/ Math.abs(goalX - launchX))
* 180 / Math.PI;
if (goalX - launchX > 0 && goalY - launchY > 0) {// in the first
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.