method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
63d2a23d-6f90-4093-b84e-2e8d14624c3f | 8 | @Override
public void print(int level) {
if (subExpression != null) {
subExpression.print(level);
} else {
if (unaryMinus) {
printLevel(level);
printLn("-");
} else if (unaryPlus) {
printLevel(level);
printLn("+");
} else if (preIncrement) {
printLevel(level);
printLn("INCREMENT... |
5ada0e52-33cd-4d70-8fb9-349a30471b2a | 5 | public void transBlissToEnglish(String blissInput)
{
foundNumbers ="";
boolean found = false;
String[] firstSplitArray = blissInput.split(";");
for(int i=0;i< firstSplitArray.length;i++)
{
//calling a method that checks for special combination words (contains mo... |
38950e6f-6fc3-490c-824d-dbc13659cb56 | 5 | @Override
public void tick(float delta) {
if (mouseTracker.isDragging()) {
//float dtheta = (float) dx/width;
float dtheta = 0;
float dz = 0;
float unitStep = (float) Math.PI * delta / 8;//4 seconds to 90 - sloow!
if (mouseTracker.getDeltaX() > 20... |
8c2fff62-84f7-4dae-9eb6-6da6a75a1252 | 4 | */
//This function is use for when you are on the line waiting for a product.
public static boolean isObjPresent(String xPathKey, int maxTime){
boolean flag = false;
for(int i=0; i<maxTime; i++) {
try{
Thread.sleep(1000);
if(isElementPresent(xPathKey)){
flag = true;... |
e8ed7178-0267-4d93-b95d-54a03f25a7c6 | 8 | public void fillRectangle(int x, int y, int cx, int cy, int color) {
// clip here instead
if (x > this.right || y > this.bottom)
return; // off screen
int Bpp = Options.Bpp;
// convert to 24-bit colour
color = Bitmap.convertTo24(color);
// correction for 24-bit colour
if (Bpp == 3)
color = ((colo... |
d47b2768-e11b-4cc5-a9e1-af074c13c0bb | 2 | public static void main(String[] args) {
SomeClassWithData some_object = new SomeClassWithData();
for (int i = 9; i > 0; --i) {
some_object.add(i);
}
Collection data = some_object.get_data();
for (Object aData : data) {
System.out.print(aData + " ");
... |
4c29a518-b790-4821-9371-7d4bb1924341 | 8 | private void rotateLeft(Node<T> currentNode, boolean changeRootOfSubtree) {
if (currentNode.getParent() != null) {
if (changeRootOfSubtree) {
Node<T> oldRoot = currentNode;
Node<T> newRoot = currentNode.getRightChild();
newRoot.setParent(oldRoot.getPar... |
dcbf991d-a220-474b-b18d-dd3cc395076b | 8 | private void checkInjections() {
if (isFieldsThenMethodsInjectedInPetBean()) {
if (fieldBean1InCatBean == null || fieldBean2InCatBean == null) {
fieldsInjectedInCatBean = false;
}
if (helloBean != null && setterBeanInCatBean != null && javaBean != null
... |
8f7d086f-ddba-4846-94ea-f70b545809b8 | 2 | @Override
public boolean equals( Object o )
{
if (o instanceof PegsHash)
{
PegsHash h = (PegsHash)o;
return (hash == h.hash && Arrays.equals( hashes, h.hashes ));
}
return false;
} |
a54b5653-12ee-428e-b3e3-9a0084685e9b | 8 | private ViewerCell searchPreviousCell(ViewerRow row,
ViewerCell currentCell, ViewerCell originalCell, ColumnViewer viewer) {
ViewerCell rv = null;
ViewerCell previousCell;
if (currentCell != null) {
previousCell = currentCell.getNeighbor(ViewerCell.LEFT, true);
} else {
if (row.getColumnCount() != 0) ... |
4f6d4314-eb54-4773-97ff-689345debfab | 0 | private void adjustConfigurations()
{
// fixed number due to win definitions
_triumpher = new HashMap<>(3);
// fill in the triumphers:
// paper is beaten by scissors
_triumpher.put(Output.Paper, Output.Scissors);
// rock is beaten by paper
_triumpher.put(Ou... |
8b632fab-f4e0-4f1d-a376-e2b743ed3f7c | 8 | public void closeNoMsgPlayer() {
BLN_CLOSING = true;
BLN_WORKING = false;
removeFromGroup();
if (vctConditions.size() != 0) {
Game.vctCheckConditions.removeElement(this);
}
Game.removeDuskObject(this);
Game.vctSockets.removeElement(this);
try {
SCK_CONN.shutdownInput();
} catch(Exception e){}
... |
8daaf838-b1fc-4f38-be32-9c1f443bc586 | 7 | public void paint(Graphics2D g2, TreePane treePane, Justification justification, Rectangle2D bounds) {
Font oldFont = g2.getFont();
Paint oldPaint = g2.getPaint();
Stroke oldStroke = g2.getStroke();
if (background != null) {
g2.setPaint(background);
g2.fill(bound... |
c66ba802-6855-4cd4-8948-5bbf21a2802c | 3 | public static String getText(String filename, Class source)
{
int nb;
char[] buffer = new char[1024];
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(
source.getResource(filename).openStream()));
StringBuffer res = new Strin... |
0fcc0491-44c5-49c4-abf5-1b0eeeda6fc7 | 5 | @Override
public void entityAttributeChanged(Entity entity, EntityAttribute attribute, double newValue) {
switch(attribute){
case MAX_HEALTH:
maxHealth = (int) Math.round(newValue);
break;
case ARMOR:
armor = newValue;
break;
case DAMAGE:
damageMultiplier = newValue;
break;
case... |
b283cc22-6753-4292-82cb-6c55766d7bfa | 2 | @Override
public String execute(SessionRequestContent request) throws ServletLogicException {
String page = ConfigurationManager.getProperty("path.page.tour");
String prevPage = (String) request.getSessionAttribute(JSP_PAGE);
resaveParamsShowTour(request);
formTourList(request);
... |
8db3ff85-9fc7-4314-b893-86f88f5b27d5 | 6 | @EventHandler
public void BlockDispenseEvent (org.bukkit.event.block.BlockDispenseEvent b) {
if(b.getBlock().getType() == Material.DISPENSER); {
if(b.getBlock().getLocation().subtract(0.0D, 1.0D, 0.0D).getBlock().getType() == Material.DRAGON_EGG);
ItemStack random = null;
Random r = new Random();
int zu... |
fcb7aa18-6f65-4b3f-9987-ff840a1eb9b0 | 5 | private double surfacePotential1(double sigma){
double difPot = 0.0D; // temporary values of the diffuse potential
// bisection method
double psiLow = 0.0D;
double pFuncLow = this.psiFunction1(psiLow, sigma);
double psiHigh = (5.0D/(this.expTerm*this.chargeValue))*Fmath.asinh(... |
7ae2a9d9-ea25-4d41-8d2f-87a5d6a5d61d | 8 | @Override
public void run() {
String update_field="";
OrclTableInfo oti=new OrclTableInfo(dbconS,un,pwd);
Hashtable<String, ArrayList<String>> cols;
if(dbconS.contains("sqlserver"))
cols=oti.getSqlServerColumns(tn,"hadoop");
else
cols=oti.getOracleColu... |
4d90cd73-2cad-43f1-96f5-9094a7b5ceca | 7 | private synchronized int getBestType(CellPoint cell) {
ArrayList<Piece> possiblePieces = new ArrayList<Piece>();
for (Piece a : pieces) {
if (piecesUsed.indexOf(a) == -1) {
possiblePieces.add(a);
}
}
// Check for each Piece in pieces if they are in piecesUsed, if not will
// add to possiblePieces
... |
417858c5-a6e4-4c89-ad01-56b863e32d53 | 7 | public void ProcessRun()
{
for (Simulation.FIELD field : Simulation.FIELD.values())
{
for (Simulation.HEIGHT height : Simulation.HEIGHT.values())
{
for (int level_set : GetLevelSets(field, height))
{
String field_height_path = field.getValue().replace(" ", "") + "/" + height.getValue().replace("... |
579dd3a0-24d5-4922-9bba-8b60ae721399 | 2 | public static int getUnreadCount(User user) {
int unreadCount = 0;
try {
String statement = new String("SELECT COUNT(mid) FROM " + DBTable + " WHERE uid2 = ? and isRead = false");
PreparedStatement stmt = DBConnection.con.prepareStatement(statement);
stmt.setInt(1, user.userID);
ResultSet rs = stmt.e... |
dbb720a5-152b-46dc-ad11-e65777ba4269 | 0 | public void testCheckMobile() {
String mobile = "13828452853";
assertTrue(StringUtils.checkMobile(mobile));
assertTrue(StringUtils.checkMobile("15845656658"));
assertTrue(StringUtils.checkMobile("18845656658"));
assertFalse(StringUtils.checkMobile("123"));
assertFalse(StringUtils.checkMobile("123333"));
a... |
7a58a2bd-6497-414a-8ff2-e484d8b53d1c | 7 | private void txtcedulaKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtcedulaKeyTyped
char caracter = evt.getKeyChar();//Validacion del campo cedula
if (caracter >= '0' && caracter <= '9' || caracter == 8 || caracter == KeyEvent.VK_BACK_SPACE || caracter == KeyEvent.VK_CAPS_LOCK || caracter =... |
5b8ada9b-f3e2-4156-a3a4-4dc829a24d64 | 0 | public static Jdbc getInstance() {
return singleton;
} |
0ea6558a-e735-4e89-9c31-139ee50185a5 | 2 | public WindowFast()
{
super();
//setStyleSheet(core.Const.menuStyle);
setMinimumSize(1000, 700);
setMaximumSize(1000, 700);
back.setGeometry(width()-200, height()-50*1-32, 150, 40);
start.setGeometry(width()-200, height()-50*2-32, 150, 40);
background.setParent(this);
logo.setParent(this... |
7fa51d50-fb93-4324-9c8a-001ad62ca610 | 8 | public JSONObject listFollowers(String email, Integer limit,String order,Integer since_id) {
JSONObject result = new JSONObject();
JSONArray response = new JSONArray();
try {
StringBuilder querry = new StringBuilder("SELECT id, username, about, name, email, isAnonymous FROM followers... |
bea45f42-d4fe-4008-b162-c15d4f47f657 | 8 | public ArrayList<DuplicateMusicObject> getDuplicateOnName() throws SQLException {
Run.addProcessStatus("Processing Duplicate Records on Name");
System.gc();
// This does a running check in 3 places.
// Here (in case it was stopped before hand)
// In the main loop (which stops it)
// And just after it ... |
5a7c9cb3-8c62-4772-be76-73bbb062cc47 | 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... |
fcdec5b2-822d-4850-8a70-f2bdf64afa13 | 0 | public void remove(int i) {
this.instances.remove(i);
} |
5227778d-9509-42ab-b10e-1736dbcf6060 | 7 | @Override
public DokanVolumeInformation onGetVolumeInformation(String arg0,
DokanFileInfo arg1) throws DokanOperationException {
DokanVolumeInformation info = new DokanVolumeInformation();
info.maximumComponentLength = fileSystem.getMaxPathLength();
if (fileSystem.supportsUnicodeFilenames())
info.fileSyste... |
ec7dba6a-235b-4eb4-bda6-0a82ad5cbb38 | 2 | public static boolean isTypeString(Class<?> type) {
// Consider any CharSequence (including StringBuffer and StringBuilder)
// as a String.
return (CharSequence.class.isAssignableFrom(type) || StringWriter.class.isAssignableFrom(type));
} |
794e0e6b-7d89-44dc-a691-51669b30d9b0 | 5 | public void setLights(MovingCar[] movingCars,
Parking[] left,
Parking[] right,
boolean[] llights,
boolean[] rlights)
{
try {
// read input from user
BufferedReader reader = new Buf... |
c0301599-7a67-4448-9c72-386d6218d08f | 6 | private static void adaptToBot() {
String opponentName = xvr.getBwapi().getEnemies().get(0).getName();
if (opponentName != null) {
opponentName = opponentName.toLowerCase();
}
// opponentName = "krasimir";
// opponentName = "tomas vajda";
// opponentName = "david churchill";
// opponentName = "florian... |
81507bff-2837-485c-ba64-1dd8ab12b5a2 | 5 | private void temp(double[][] array, boolean[][] water, int x, int y) {
if (!water[x][y])
calc[x][y] = 4.0;
for (int k = 1; k < 6; k++) {
ArrayList<Object[]> a = getNearbyRegions(array, x, y, k);
for (Object[] r : a)
if (r != null) {
double m = calc[x][y] * 0.7;
if (m > calc[(Integer) r[0]][(I... |
5d5596f1-86fb-4dd4-aa04-f991c77caede | 1 | @Override
public void handleNewPeerConnection(Socket s, byte[] peerId) {
SharingPeer peer = this.getOrCreatePeer(peerId,
s.getInetAddress().getHostAddress(), s.getPort());
try {
synchronized (peer) {
peer.register(this);
peer.bind(s);
}
this.connected.put(peer.getHexPeerId(), peer);
peer.... |
c41d53a3-cce8-4702-898d-90ae0b31cf00 | 9 | private void putAccountValue(final Exchange ex, final int value, final boolean string) {
if ((value > 0) && (value < 20000) && ((random(0, 100) == 0) || string)) {
_sb.setLength(0);
int i = 0;
for (i = 100; i < value; i += 100) {
_sb.append("......... ........... |
98b3a49b-b802-4d08-ad4d-94d67dce5780 | 1 | int nextEmpty(Object[] array) {
int nextempty = 0;
while (!(array[nextempty] == null)) {
nextempty++;
}
return nextempty;
} |
04af59a8-6c85-41c9-8ae7-b83632e29355 | 3 | * @Post: No changes
* @Return: List of all legal moves
*/
public ArrayList<Move> getMyLegalMoves()
{
ArrayList<Piece> myPieces = this.getPieces(this.isWhitesTurn());
ArrayList<Move> answer = new ArrayList<Move>(myPieces.size()*3);
this.deselectPiece();
for(Piece p : myPieces)
{
this.parseInput(p.myL... |
9bf775c8-5194-4a3a-9f24-11ea0d92846d | 9 | public List<ShopDataBean> getCouponList(int start, int end, String id) {
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
List<ShopDataBean> couponList = null;
String sql = "";
try {
conn = getConnection();
sql = "select a.* from (select ROWNUM as RNUM, b.* from (select ... |
facf7363-1d15-4353-82f7-611187a4ef90 | 6 | public MetaDatos(String mp3 ) throws ID3Exception
{
File oSourceFile = new File(mp3);
MediaFile oMediaFile = new MP3File(oSourceFile);
ID3Tag[] aoID3Tag = oMediaFile.getTags();
for (int i=0; i < aoID3Tag.length; i++){
if (aoID3Tag[i] instanceof ID3V1_0Ta... |
4bcbdeb6-672c-44a3-b604-479612cf8231 | 2 | public int getDmg(){
if (duration > 0 && rate % duration == 0){
return dmg;
}
else{
return 0;
}
} |
97917e50-d157-4d02-82e4-158a26315e5a | 2 | private List<City> getCityInfo(AbstractDao dao, List<LinkDirectionCity> links) throws DaoException {
List<City> list = new ArrayList<>();
for (LinkDirectionCity link : links) {
Criteria crit = new Criteria();
crit.addParam(DAO_ID_CITY, link.getIdCity());
List<City> ci... |
978b37bf-a595-4e56-ace1-0475d0314b29 | 4 | @SuppressWarnings("unchecked")
private void saturdayCheckActionPerformed(java.awt.event.ActionEvent evt) {
if(this.dayChecks[6].isSelected()) {
this.numSelected++;
if(this.firstSelection) {
stretch();
}
... |
e62d49e8-79b0-40d9-ad79-3f097c21c223 | 9 | public void keyPushed(char c){
ArrayList<BoundingBox> boxes = gr.getItems();
if(c == 'w'){
for(BoundingBox b : boxes){
b.setLocation(b.getX(), b.getY() - 10);
}
}
if(c == 'a'){
for(BoundingBox b : boxes){
b.setLocation(b.getX() - 10, b.getY());
}
}
if(c == 's'){
for(BoundingBox b : bo... |
bcb25bef-cd40-4722-a0f4-148de52c59e1 | 9 | protected void loadFields(com.sforce.ws.parser.XmlInputStream __in,
com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException {
super.loadFields(__in, __typeMapper);
__in.peekTag();
if (__typeMapper.isElement(__in, CreatedBy__typeInfo)) {
... |
8e036a8f-9eba-4834-9a91-6b3c711f4356 | 4 | public void setBase(final String line) {
int n = 0;
int d = 0;
boolean readN = true;
for (final char c : line.toCharArray()) {
if (c == '=') {
break;
} else if (c == '/') {
readN = false;
} else if (readN) {
n += c - '0';
} else {
d += c - '0';
}
}
base = (double) n / d;
} |
a9ac779c-4e1d-49ae-8f41-b06bb729fbfe | 6 | public String tryMakeReservation(String date, String movieName, String username) {
Savepoint savepoint = null;
try {
savepoint = conn.setSavepoint();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if(savepoint == null){
return null;
}
if(getNumberOfAvai... |
26584810-bf51-429c-bb0c-a09c3bd410f3 | 4 | public OutlineFont(String baseFont, PDFObject fontObj,
PDFFontDescriptor descriptor) throws IOException {
super(baseFont, descriptor);
PDFObject firstCharObj = fontObj.getDictRef("FirstChar");
PDFObject lastCharObj = fontObj.getDictRef("LastChar");
PDFObject widthArrayObj = ... |
2457dc64-8ab6-462b-882e-f532a3125c1c | 2 | public void newGame() {
// initialize the deck and hands (or do this in a newGame method)
bInGame = true;
deck = new Deck();
playerHand = new BlackjackHand();
dealerHand = new BlackjackHand();
deck.shuffle();
//deals cards
dealerHand.addCard(deck.dealCard(... |
ebb3a848-ebf0-4ee4-ad77-24f9eac1dcf2 | 7 | @Override
public String runMacro(HTTPRequest httpReq, String parm, HTTPResponse httpResp)
{
final String str="";
final java.util.Map<String,String> parms=parseParms(parm);
for(final String key : parms.keySet())
{
if(key!=null)
{
String val=parms.get(key);
if(val==null)
val="";
if((val.... |
be340538-8860-45f6-a65e-d35692c13c4c | 9 | private <T extends Comparable<T>> void merge(T[] arValues, int left, int middle, int right) {
//
int nrTimes = (right - left) + 1;
//
int leftMoves = left;
T leftValue = null;
//
int middleMoves = middle + 1;
T middleValue = null;
Vector<T> arTemp = new Vector<T>(nrTimes);
for ... |
28f2ac11-ebdd-453a-af5f-91cbc2e23172 | 1 | public DeployConfig(String filepath) {
if (!parseFile(filepath)) {
throw new IllegalArgumentException("Error in loading config file:" + filepath);
}
} |
c1146542-c78d-47d5-84cc-423b191f867f | 3 | public void setState(int state) {
this.state=state;
if (state==1) theApp.setStatusLabel("Sync Hunt");
else if (state==2) theApp.setStatusLabel("Msg Hunt");
else if (state==3) theApp.setStatusLabel("Debug Only");
} |
e1367873-d1b6-40ac-b151-3acb6c82f476 | 4 | @Override
public void paint(Graphics g) {
g.setColor(Color.GRAY);
g.fillRect(0, 0, getWidth(), getHeight());
if (layerCount > 0) {
int layer_size = Math.min(getHeight(), getWidth() / layerCount);
for (int i = 0; i < layerCount; i++) {
g.setColor(new Co... |
db62167c-1c43-4f7c-8d9b-d70f37030255 | 1 | public static ServerDataBase getInstance() {
if (instance == null) {
instance = new ServerDataBase();
}
return instance;
} |
3babc7ce-6246-497c-9d6f-8b5a8574fc84 | 1 | private boolean isPossibleToPlaceDiagLeftBelow(int boardElementsLength, int position, int dimension, int positionLeftBelow) {
return (elementDiagonallyLeftBelow(dimension, position, positionLeftBelow)) % dimension < dimension
&& elementDiagonallyLeftBelow(dimension, position, positionLeftBelow) ... |
b2903d5e-ab35-46a1-8cbd-f87afadc54e0 | 3 | @Override
public void draw(GL2 gl) {
if (planeTexture == null) {
loadTexture(textureToLoad, gl);
}
if (planeTexture != null) {
planeTexture.enable(gl);
planeTexture.bind(gl);
}
gl.glBegin(GL2.GL_QUADS);
gl.glNormal3f(normal[0], no... |
a682ef44-88f3-4315-821d-9d3bc270b733 | 3 | public void change(int cursorValue) {
if (cursorValue == -1) game.getFrame().getContentPane().setCursor(blank);
else if (cursorValue == 0) game.getFrame().getContentPane().setCursor(point);
else if (cursorValue == 1) game.getFrame().getContentPane().setCursor(click);
} |
99c0f35c-940c-4817-aa05-b2fa81a0ddc7 | 0 | public Builder pageno(Integer pageno) {
this.pageno = pageno;
return this;
} |
c2cf5b25-65fe-48f4-bcad-6a3026cefe4e | 1 | public static float getOptionValueAsFloat(String option) {
String value = CommandLineUtilities.getOptionValue(option);
if (value != null)
return Float.parseFloat(value);
return -1;
} |
62b39bc8-8df8-460a-8df5-1bd17a77239c | 8 | public static int groupLargestWordOrWords(LinkedList[] formable_words, LinkedList largest_formable_words){
int formable_word_amount = 0;
int largest_length = 0;
String temporary_word;
WordNode next_node;
WordNode temporary_node;
for(int i=0; i < 26; ++i){
if((temporary_node = formable_words[i].g... |
7c5ce136-a48f-4876-9fe6-da043604d0d6 | 6 | private void processServers(String[] keywords) {
logMessage(LOGLEVEL_NORMAL, "Getting a list of servers.");
if (keywords.length == 2) {
List<Server> servers = getUserServers(Functions.getUserName(keywords[1]));
if (servers != null && servers.size() > 0) {
for (Server server : servers) {
sendMessage(c... |
b8e30903-3b58-4a9f-846d-ed4995e4c6a8 | 8 | public boolean hasRecoil() {
switch (this) {
case BRAVE_BIRD:
case DOUBLE_EDGE:
case FLARE_BLITZ:
case HEAD_SMASH:
case SUBMISSION:
case TAKE_DOWN:
case VOLT_TACKLE:
case WOOD_HAMMER:
return true;
default:
return false;
}
} |
3cae5cbd-028b-429f-accc-4f437753b518 | 0 | public void setCtrl(CtrlConnexion ctrl) {
this.ctrl = ctrl;
} |
9d3cb0bc-0bef-4bfe-9d31-2b72a5759040 | 8 | @SuppressWarnings("unchecked")
public <KeyType, ValueType> HGIndex<KeyType, ValueType> getIndex(String name,
ByteArrayConverter<KeyType> keyConverter, ByteArrayConverter<ValueType> valueConverter,
Comparator<?> comparator, boolean isBidirectional, boolean createIfNecessary) {
indicesLock.readLock().lock();
... |
85d5c190-23f9-46ad-b894-173a7b8600e2 | 9 | private void checkAndFixUpdateFile(String updatesFilename) throws Exception {
FileReader updatesFR = new FileReader(updatesFilename);
BufferedReader updatesBR = new BufferedReader(updatesFR);
String update = updatesBR.readLine();
while (update != null) {
String str = update;
for (int i = 1; i <= 2; i++)... |
f991b7e3-09a2-4c0d-aa7b-767c51635b4a | 3 | private ImageIcon getIcon() {
if (icon == null) {
try {
Component element = (Component) cls.newInstance();
element.scale(.5);
BufferedImage bi = new BufferedImage(70, 30,
BufferedImage.TYPE_INT_ARGB);
Graphics2D g = (Graphics2D) bi.getGraphics();
g.setColor(Color.black);
g.setRenderin... |
f38da0b7-2a3e-42c3-bce3-56f9af273c64 | 3 | public static boolean hasUniq(String uniq) {
for (JSScriptInfo info : script_list.values()) {
if (info.scrUniq != null && info.scrUniq.equals(uniq)) return true;
}
return false;
} |
0109a0ce-9699-4ea4-b639-e63a5d7677ed | 0 | public void mouseDragged(MouseEvent event) {
} |
1429d36a-5fc6-492a-9346-32b67a53b8c0 | 3 | public void remove(String key) {
int hash = Hash(key) % BUCKETS;
LinkedList chain = (LinkedList)v.get(hash);
if(chain != null ) {
for(int i = 0; i < chain.getSize(); i++) {
HashNode n = (HashNode)chain.get(i);
if(n.key == key) {
chain.remove(i);
}
}
}
} |
0baf00a4-4307-4c6b-bf2f-276aad07bf59 | 8 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
LightMapKey other = (LightMapKey) obj;
if (!getOuterType().equals(other.getOuterType()))
return false;
if (color == null) {
i... |
2f37f0e6-febd-49ec-84e8-6649c56c8344 | 4 | public boolean createNewBooking(Gaest g)
{
int rowsInserted = 0;
String SQLStringGæst = "insert into GAEST_TBL "
+ " values (?,?,?,?,?,?,?,?,?,?,?)";
// String oldgid = "select GAEST_ID from GAEST_TBL";
// String nygid = oldgid.substring(1);
// int nynr = Integer... |
92deaa1c-c809-4dd0-84cc-c53bf64e9db8 | 9 | public VoidValue visitDefine(DefineComponent c) {
Define define = lookupDefine(c.getName());
if (overrides != null)
overrides.add(new Override(define, c.getName()));
if (define.status != DEFINE_KEEP) {
ignoredDefines.add(c);
define.status = DEFINE_IGNORE;
return VoidVal... |
90832601-e4a1-4522-ac43-139d91cfb3d6 | 1 | public void check() {
btnConfirm.setEnabled(vTxtColonnes.isInputValid() && vTxtLignes.isInputValid());
} |
80fad00c-b30f-42c6-a9c6-bdcee0d553ce | 9 | @POST
@Path("/GameAnswers/{playerID}/{id1}/{id2}/{id3}")
@Consumes("application/json")
public String postForAnswers(@PathParam("playerID") long playerID,
@PathParam("id1") long id1, @PathParam("id2") long id2,
@PathParam("id3") long id3, ArrayList<String> JsonInput) {
Player player = getPlayerByFacebookID(e... |
ff4e1113-9433-4899-b633-d43a27a41d21 | 9 | private boolean bcPresent()
{
while(!workingList.isEmpty()) //while working list of symbols not empty
{
String workingValue = workingList.remove(workingList.size()-1); //get symbol to work
queued.add(workingValue); //add symbol to queued(entailed)
if(!facts.contains(workingValue)) //if symbol... |
d26f9931-e435-49fe-b674-70ff4306c393 | 7 | public int compareTo( MUM other )
{
if ( other == null )
return 0; // what else can we do??
else if ( match.length < other.match.length )
return 1;
else if ( match.length > other.match.length )
return -1;
// prefer direct alignments to transpositions
else if ( transposed && !other.transposed )
r... |
fcad757b-53a1-414d-b32d-e2dc1fb6fa61 | 8 | @Test
public void removeAt() {
RandomAccessDoubleLinkedList test = new RandomAccessDoubleLinkedList();
try {
test.removeAt(2); // empty list
} catch (InvalidAccessException e) {
} catch (Exception e) {
fail("Unexpected Exception");
}
try {
test.insertAt(2, 3);
test.insertAt(7, 2);
test.in... |
6c8d7d7d-a152-4db6-8a80-29ddfd69a041 | 8 | private void writeFieldHeader(JDBField jdbfield) throws IOException {
byte[] bfr;
int RecordHeaderSize = 0;
int ofset = 0;
if (dbfConfig.getDbfVersion() == ru.nyrk.util.jdbf.DBFConfig.DbfVersion.xBaseVII) {
RecordHeaderSize = 48;
ofset = 31;
} else {
... |
3daac74c-5a91-4748-9b5e-d44063882dae | 8 | public boolean containsValue( Object val ) {
byte[] states = _states;
V[] vals = _values;
// special case null values so that we don't have to
// perform null checks before every call to equals()
if ( null == val ) {
for ( int i = vals.length; i-- > 0; ) {
... |
401de8ef-1ad7-4014-92a1-060958bed616 | 5 | public static boolean checkPlacement(
Fixture fixtures[], World world
) {
Box2D limits = null ;
for (Fixture f : fixtures) {
if (limits == null) f.area(limits = new Box2D()) ;
else limits.include(f.area()) ;
}
if (! checkAreaClear(
world.tileAt(limits.xpos() + 0.5f, limits.ypos()... |
d0346edd-b3d1-4c9a-95b2-f8f805d520f4 | 3 | public static List<File> getFiles(File folder) {
if (!folder.exists())
folder.mkdirs();
List<File> list = new ArrayList<File>();
for (File fileEntry : folder.listFiles()) {
if (fileEntry.isDirectory()) {
getFiles(fileEntry);
}
else {
list.add(fileEntry);
}
}
return list;
} |
9ea84ba5-184c-4087-a298-072e942fbace | 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... |
fd54b490-15d1-4fd8-bb39-8383473de789 | 7 | private JSONArray readArray(boolean stringy) throws JSONException {
JSONArray jsonarray = new JSONArray();
jsonarray.put(stringy
? read(this.stringhuff, this.stringhuffext, this.stringkeep)
: readValue());
while (true) {
if (probe) {
lo... |
bf61942e-16e2-46c1-9051-d1d518115eb5 | 5 | static private int jjMoveStringLiteralDfa9_0(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return jjStartNfa_0(7, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(8, active0);
return 9;
}
switch(curChar)
{
cas... |
924d29f5-4823-4ae8-9f86-a0d685a02b31 | 6 | @EventHandler
public void CaveSpiderNausea(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getCaveSpiderConfig().getDouble("CaveSpi... |
daa10451-4f39-4a0f-bb04-35f753a88209 | 4 | public int getTotalNewsCount(){
PreparedStatement stmt = null;
ResultSet rs = null;
int count=0;
try {
stmt = conn
.prepareStatement("select count(1) from NewsInfo");
rs = stmt.executeQuery();
if (rs.next()) {
count=rs.getInt(1);
}
if (stmt != null)
stmt.close();
if (rs... |
c203e78f-6b6c-4fc6-8304-8038b117b500 | 6 | public static boolean downloadTo(String file, String toFile) {
if (file.startsWith("/")) {
file = file.substring(1);
}
if (toFile.startsWith("/")) {
toFile = toFile.substring(1);
}
FTPClient client = connect();
try {
if (client == null) {
System.out.println(
"FTP error (if no error shown ... |
be10f740-2b68-4e7a-b041-d3d62cb7f52e | 7 | private void linkStatic(Map<String, String> methodMap,
Map<String, String> fieldMap)
throws IOException, LinkError {
String line;
while((line = in.readLine()) != null) {
String[] args = line.trim().split("\\s+");
if(args[0].equals("invokestatic")
... |
761fa830-37d1-48f6-a932-aec9647f9931 | 0 | public void add(Object o) {
synchronized(_queue) {
_queue.addElement(o);
_queue.notify();
}
} |
a3f46c37-36d4-424a-bbf4-37f9acbb1861 | 3 | public DisplayMode findFirstCompatibleMode(
DisplayMode modes[])
{
DisplayMode goodModes[] = device.getDisplayModes();
for (int i = 0; i < modes.length; i++) {
for (int j = 0; j < goodModes.length; j++) {
if (displayModesMatch(modes[i], goodModes[j])) {
... |
9dca1217-6856-4580-a5c5-48fffe042e0b | 8 | private void heapifyDown(int parentId) {
if (parentId <= 0 && parentId >= length) {
return;
}
int left = 2*parentId;
int right = 2*parentId + 1;
if (right < length) {
//left is smaller
if (heap[left].compareTo(heap[right]) < 0) {
if (heap[parentId].compareTo(heap[left]) > 0) {
switchTw... |
5f59dd21-d02d-4cf3-a182-a0c7fc357121 | 1 | public static Stream method241(int arg0, int arg1) {
if (Sound.sound[arg1] != null) {
Sound sound = Sound.sound[arg1];
return sound.method244(arg0);
} else {
return null;
}
} |
ee9c45a8-2234-4a0b-a27d-ee596a681ae9 | 3 | public String getResultDetail(int index) {
if (!detail) return null;
if (index < 0 || index >= getResultCount()) throw new IllegalArgumentException(CLASS + ": illegal value for index");
return details.get(index);
} |
7c5f59f3-d0f7-42b8-bda6-bf28390d210e | 2 | public void addCreature(Grid g, Point point, Rectangle2D bounds,
int CreatureType) {
if (CreatureType == INTEL_AGENT) {
// System.out.println("its intel agent");
IntelCreature intelCreature = new IntelCreature(point, bounds);
g.addCreature(intelCreature);
new Thread(new IntelCreatureRunnable... |
5c141fea-eb92-45b8-b1b8-d6a84804cb10 | 8 | private static String getNodeTextContents(Node n) {
if (n.getNodeType() == Node.TEXT_NODE || n.getNodeType() == Node.CDATA_SECTION_NODE) {
Text txtNode = (Text) n;
String content = txtNode.getWholeText(); //This concatenates any adjacent text/cdata/entity nodes
if (content ==... |
95cab5d7-6109-46d6-ac6f-82b8d7349a69 | 7 | public String escapeObfuscation() {
String escapeObfuscatedCode = null;
/*
* エスケープ処理は文字ごとに行う必要があるため、1文字ずつに分ける。
* 後に正規表現により比較作業を行うため、String型の配列に格納する。
*/
char ch[] = code.toCharArray();
String[] choppedCode = new String[ch.length];
for (int i = 0; i < choppedCode.length; i++) {
choppedCode[i] = S... |
33e2424a-0379-4d57-bd5c-1a57d8ee7129 | 6 | private static CycNaut calendar2Naut(final Calendar calendar, final int granularity) {
CycNaut dateNaut = new CycNaut(YEAR_FN, calendar.get(YEAR_GRANULARITY));
// if (granularity == WEEK_GRANULARITY) {
// dateNaut = new CycNaut(WEEK_FN, calendar.get(WEEK_GRANULARITY), dateNaut);
// } else
if (g... |
a524a1f9-514c-4221-89ad-59c7ac29a8f8 | 0 | @Test
public void testLoadDict() {
_dictionary.loadDict("/dict4test-3words.txt");
assertEquals(3, _dictionary.getWordList().size());
_dictionary.loadDict("/dict4test.txt");
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.