method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
009353e0-3ca2-4cd0-a98f-7b0752844fae | 9 | public void process() {
for (OutputVariable outputVariable : outputVariables) {
outputVariable.fuzzyOutput().clear();
}
/*
* BEGIN: Debug information
*/
if (FuzzyLite.debug()) {
Logger logger = FuzzyLite.logger();
for (InputVariable i... |
3cd2678d-6bf8-47ed-9c72-e2558a8fad67 | 2 | @Override
public void execute(CommandExecutor player, String[] args)
{
try {
player.getServer().Stop();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
} |
ffa1944a-8ebf-40e7-b94a-c4d8683aaee1 | 7 | @Override
public void register() {
// TODO: register new user (which, if successful, also logs them in)
String username=this.getLoginView().getRegisterUsername();
String password1=this.getLoginView().getRegisterPassword();
String password2=this.getLoginView().getRegisterPasswordRepeat();
String usernam... |
c7fcef67-618a-41ca-81bc-6df980d21f03 | 8 | private void displayData() {
if (this.states != null) {
System.out.println("#################################################");
System.out.println("States: " + this.states);
if (this.emissions != null) {
System.out.println("Emissions: " + this.emissions);
if (this.stateProb != null) {
System... |
7f922f3e-7b2c-46cf-8e0e-7ddbe2811a51 | 8 | public Updater(Plugin plugin, int id, File file, UpdateType type, boolean announce) {
this.plugin = plugin;
this.type = type;
this.announce = announce;
this.file = file;
this.id = id;
this.updateFolder = plugin.getServer().getUpdateFolder();
final File pluginFile... |
42038a26-b78f-44d1-96e9-5020737129bb | 7 | private int getNumberOfNeighbors(int row, int col) {
int neighborCount = 0;
for (int leftIndex = -1; leftIndex < 2; leftIndex++) {
for (int topIndex = -1; topIndex < 2; topIndex++) {
if ((leftIndex == 0) && (topIndex == 0)) continue; // skip own
... |
fa130b15-7454-4726-b119-d46b99bf2f84 | 3 | public int getGroupMembershipIndexByUsernameAndGroupID(int groupMembershipID, String username){
for(GroupMembership groupMembership : groupMemberships){
if(groupMembershipID == groupMembership.getGroupID() && username.equals(groupMembership.getUsername())) return groupMemberships.indexOf(groupMember... |
e3d402de-833b-4fc2-b383-cbb9b33d481f | 4 | @Override
public void delete(Key key)
{
if (isEmpty())
return;
for (Node x = first, p = null; x != null; p = x, x = x.next)
if (key.equals(x.key))
{
N--;
if (x == first)
{
x = x.next;
first = x;
}
else
p.next = x.next;
return;
}
} |
74b7cb8c-65f5-4289-b875-29c8d73309b8 | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ChangeOfValue other = (ChangeOfValue) obj;
if (newValue == null) {
if (ot... |
f8210964-dffe-4aaa-8e7f-c3f4e113552e | 3 | public boolean func_862_a(int var1, int var2, int var3) {
return !this.field_1235_h?false:var1 == this.field_1242_a && var2 == this.field_1241_b && var3 == this.field_1240_c;
} |
7634936b-c5ce-48b3-a331-c84922f3c579 | 7 | public static int floodFill(int r, int c) {
int area = 1;
for (int i = 0; i < dir.length; i++)
if (r + dir[i][0] >= 0 && r + dir[i][0] < n && c + dir[i][1] >= 0
&& c + dir[i][1] < m && !used[r + dir[i][0]][c + dir[i][1]]
&& map[r + dir[i][0]][c + dir[i][1]] == '0') {
used[r + dir[i][0]][c + dir[i][... |
fdba8609-9de3-4d80-b714-afa26263a930 | 2 | public Table(int playersNumber, int botsNumber)
{
players = new ArrayList<>();
deck = new Deck();
while (playersNumber-- > 0)
{
addPlayer(new Human("Player " + (playersNumber + 1)));
}
while (botsNumber-- > 0)
{
addPlayer(new Bot("Bot ... |
821cf16c-745b-44b7-a064-5032cf1d7ad4 | 8 | public PatternRecord(IXMLElement elt){
if (!elt.getName().equals("pattern"))
throw new RuntimeException("<pattern> node expected, but found "+elt.getName());
Enumeration children = elt.enumerateChildren();
while (children.hasMoreElements()){
IXMLElement e = (IXMLElement)children.nextElement();
if (e.... |
f80ceb80-7dde-4765-bd03-017d0d98da30 | 0 | public static void main(String[] args)
{
int result = sum(new int[] {1,3,3});
System.out.println(result);
int result1 = sum(1,2,3,4);
System.out.println(result1);
} |
e8ba59e0-dc01-4218-af9d-0b5959e12a86 | 7 | public static void main(String [] args){
String usage = "java mobilemedia.startMobileMediaClient --hostName <String> --portNum <String> --archName <String>\n";
String hostName=null,portNum=null;
String archName=null;
for(int i=0; i < args.length; i++){
if(args[i].equals("--hostName")){
hostName = ar... |
cb419638-0f36-4a89-bbe2-f34f539045c1 | 2 | public int onesCount()
{
int a = bits;
int count = 0;
for(int i = 0 ; i < 32 ; i ++){
if((a & 0x1) == 0x1){
count ++ ;
}
a = a >> 1;
}
return count;
} |
6379edac-87dc-473f-88e0-8c7ee66fa976 | 6 | public boolean checkSum(int x, int y, int z) {
if (getSquare(x + y))
if (getSquare(x - y))
if (getSquare(x + z))
if (getSquare(x - z))
if (getSquare(z + y))
if (getSquare(y - z))
r... |
190296cb-fdbe-4f1e-95ec-f4f82812205d | 7 | @Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
... |
cd30a831-7ab2-4106-8893-37027c0cf98a | 8 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final DefaultSchema other = (DefaultSchema) obj;
if (this.mappingType != other.mappingType && (this.mappingType... |
9eb88758-b06b-4629-b4ff-c057b9084ce4 | 9 | private boolean r_mark_suffix_with_optional_U_vowel() {
int v_1;
int v_2;
int v_3;
int v_4;
int v_5;
int v_6;
int v_7;
// (, line 159
// or, line 161
lab0: do {
... |
2c4b50cc-fbcb-4cf6-ac19-57a01348da4e | 0 | public static void main(String[] args) {
int x = 5;
double y = 5.332542;
// The old way:
System.out.println("Row 1: [" + x + " " + y + "]");
// The new way:
System.out.format("Row 1: [%d %f]\n", x, y);
// or
System.out.printf("Row 1: [%d %f]\n", x, y);
System.out.println(String.format("Row 1: [%d %... |
16b0aa1e-51e3-424b-952c-8a702c51c2e9 | 4 | public static ConfigurationIcon iconForConfiguration(
Configuration configuration) {
if (configuration instanceof FSAConfiguration)
return new FSAConfigurationIcon(configuration);
else if (configuration instanceof PDAConfiguration)
return new PDAConfigurationIcon(configuration);
else if (configuration in... |
a0525527-c32f-4915-9f9e-cdfbb93d6c07 | 2 | public void run() {
try {
InputStream in = socket.getInputStream();
// the server socket is the part that listens,
// you listen by calling serverSocket.accept();
// when someone connects to you, the server is returned.
// client initiate connections to server
BufferedReader reader = new BufferedRea... |
7eb0b8dd-ed43-4479-89fe-b2e045c712f7 | 7 | public void add(T value) {
if (root == null) {
root = new BinaryTree();
root.setValue(value);
amount++;
} else {
BinaryTree node = root;
while (true) {
if (root == null) {
root = new BinaryTree();
root.setValue(value);
amount++;
break;
} else {
if (value.compareTo(roo... |
5ce18097-8644-481b-8e27-4a1504d48343 | 5 | @Override
public void ParseIn(Connection Main, Server Environment)
{
if (Main.Data.LoadingRoom != 0)
{
Room Room = Environment.RoomManager.GetRoom(Main.Data.LoadingRoom);
if (Room == null)
{
return;
}
if (Room.Model ==... |
a0855993-c88f-47da-b927-771cc80d4fa6 | 7 | public void renderSheet(int xp, int yp, SpriteSheet sheet, boolean fixed) {
if (fixed) {
xp -= xOffset;
yp -= yOffset;
}
for (int y = 0; y < sheet.HEIGHT; y++) {
int ya = y + yp;
for (int x = 0; x < sheet.WIDTH; x++) {
int xa = x + xp;
if (xa < 0 || xa >= width || ya < 0 || ya >= height) conti... |
0e181ff7-6cb2-4bf9-9b0f-061c2fd5be50 | 7 | public CobaltFont(String fontPath, String textureName)
{
glyphHeight = 16;
characters = new HashMap<Character, TextureRegion>();
Texture texture = new Texture("res/font/", textureName);
try
{
String file = "";
@SuppressWarnings("resource")
Scanner scanner = new Scanner(new File(rootDirectory ... |
ffe163f7-01e5-457a-94dd-81de32d1ec09 | 7 | private void getBipolarQuestionList() {
titleDLM.removeAllElements();
bipolarQuestionList = bipolarQuestion.getBipolarQuestionList(fileName, publicFileName, counterTeamType);
if (bipolarQuestionList.size() != 0) {
for (int i = 0; i < bipolarQuestionList.size(); i++) {
titleDLM.addElement(bipolarQuestionLis... |
289fc508-2f1a-48a2-9b3e-1ee79fb91c89 | 0 | public void setTitel(String titel) {
this.titel = titel;
} |
339122d9-a2c5-435c-bfd2-669e10e66df4 | 6 | public void run() {
File processedFileDir = new File(Lunar.OUT_DIR + Lunar.ROW_DIR
+ Lunar.PROCESSED_DIR);
try {
while (true) {
File row = ImageStorage.rowFilesPoll();
if (row != null) {
BufferedReader in = new BufferedReader(new FileReader(row));
String line;
StringBuffer stmtBuffer ... |
4065bd9d-824f-47a5-b0ae-be5247c42ec0 | 1 | @Override
public void show () {
System.out.println(i);
if(i != 1){
System.out.println("|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||");
universe.generateWorlds(false);
}
i++;
} |
76fcf8aa-82a0-4901-9b5b-44cda35c9eb1 | 3 | @Override
@SuppressWarnings("RefusedBequest")
// Not calling superclass is intended, but not optimal. All buffers should in
// my current oppinion be the same buffer Collection. Right now there are some actions that are both added to the AttackData
// class and the placable itself which is weird. Bette... |
e6709c4c-4f00-4bce-8a5e-cea783841fa7 | 8 | public void mouseMoved(MouseEvent e) {
int x = e.getX();
int y = e.getY();
if (state == RESIZE) {
if (rect1.contains(x, y) || rect2.contains(x, y)) {
setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
}
else {
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
... |
1d34a6bc-e57b-4c44-adc6-b15c35647fbb | 3 | @Override
public void run() {
init();
long start = 0;
long elapsed = 0;
long wait = 0;
while(running){
start = System.nanoTime();
update();
render();
renderScreen();
elapsed = System.nanoTime() - start;
... |
ef6409a3-7dc9-4a65-ad6b-08b877dd3427 | 2 | public int turretTracker(){
int loop;
for (loop = 0; loop < turretBuilder.size(); loop++){
if (turretBuilder.get(loop).focused){
return loop;
}
}
return -1;
} |
5e1e9d70-63fd-4a07-88ff-55471c3066b1 | 2 | @RequestMapping("createAndSaveDept")
@ResponseBody
public String createAndSaveDept(HttpServletRequest request, HttpServletResponse response)
{
String deptName = request.getParameter("deptName");
if (null == deptName || "".equals(deptName))
{
System.out.println("Department Name cannot be NULL!");
retur... |
9b133f7f-9cb7-4438-9ab5-20bc8a9dd593 | 1 | public static void DisplayGreetings(Player color) {
Game.board.Display();
PrintSeparator('_');
if (color.equals(Player.white)){
System.out.println("Congrats!!!!!!!!!! White has Won.");
}
else{
System.out.println("Congrats!!!!!!!!!! Black ... |
a56d4e0f-f5ca-49c1-bdff-fdb65ae2a1df | 9 | public boolean ParseMobCommand(Mob mob,String command){
boolean found = true;
if (!this.parsePlayerCommand(mob,command)){ // mobs are players.
String token;
StringTokenizer st = new StringTokenizer(command, " ");
if (st.hasMoreTokens()) {
token = st.... |
32395dc5-ced7-4a9b-8818-6bc6db959d5a | 5 | @Test
public void testBuildCity() {
VertexLocationRequest location1 = new VertexLocationRequest(0, 0, VertexDirection.NorthWest);
BuildCityRequest request = new BuildCityRequest(0, location1);
ServerModel aGame;
aGame = gamesList.get(1);
int totalCitiesBEFORE = aGame.getMap().getCities().size();
int pla... |
1b0e9031-102f-4443-a445-9a8a3176ef82 | 3 | public static void main(String[] args) throws InterruptedException {
new LoaderManager(LoaderManager.ServerAPI.StandAlone, null);//todo
a = new Date();
System.out.println("Starting... Running checks on every Service");
IsMinecraftDown.checkAllStatus();
while (!IsMinecraftDown.... |
364fb804-912b-4bbc-91ca-a814d738d0d7 | 6 | @Override
public PlayerAction chooseAction(State state, IPlayer player) throws Exception {
lastAction = new PlayerAction();
lastAction.oldStake = player.getCurrentBet();
// minimum raise
double payToCall = state.getBiggestRaise() - player.getCurrentBet();
double handStrength = 0;
if (state.getStage() == ... |
9f7283f5-b7e9-47be-8be5-c14afa8505ce | 3 | public static final int task1() {
int sum = 0;
for (int i = 0; i < 1000; i++) {
if ((i % 3 == 0) || (i % 5 == 0)) {
sum += i;
}
}
return sum;
} |
449ac690-4e35-4c3d-82db-fc6bdd330988 | 4 | public XMLConfiguration get(QcRequest request)
throws QcException, Exception
{
XMLConfiguration xmlData = null;
log.debug("Requested Url :" + request.getURL());
//Open HTTP connection to the url
HttpURLConnection conn = (HttpURLConnection) new URL(request.getUR... |
db6dbcec-c6a5-47e7-a675-7e5fc7b0f9de | 6 | protected void doHurt(int damage, int attackDir) {
if (hurtTime > 0 || invulnerableTime > 0) return;
Sound.playerHurt.play();
//level.add(new TextParticle("" + damage, x, y, Color.get(-1, 504, 504, 504)));
health -= damage;
if (attackDir == 0) yKnockback = +6;
if (attackDir == 1) yKnockback = -6;
if (att... |
61960fc2-c9eb-4dc8-99a9-4118d65bc294 | 3 | public void lisaaJonoonLaskutoimitus(Laskutoimitus lisattava) throws IllegalArgumentException, IllegalStateException {
if (lisattava == null) {
throw new IllegalArgumentException();
}
if (seuraavaArvollinen == null) {
throw new IllegalStateException();
}
... |
991f30f9-cbf4-40fe-8aab-537f20aca696 | 8 | public void putAll( Map<? extends Double, ? extends Short> map ) {
Iterator<? extends Entry<? extends Double,? extends Short>> it =
map.entrySet().iterator();
for ( int i = map.size(); i-- > 0; ) {
Entry<? extends Double,? extends Short> e = it.next();
this.put( e.get... |
90746ed0-9dbf-4192-826b-99ddb344c826 | 2 | public static void update(Level lvl,long gametime){
Statistique.gametime = gametime;
if(Avatar.isDead)
Statistique.numberOfDeath++;
if(lvl.isCompleted())
Statistique.currentLvl++;
} |
0c1ba5fa-b76d-4a14-a633-4f763fccfc98 | 3 | @Override
public boolean propertyEquals(String key, Object test_value) {
if (propertyExists(key)) {
Object value = getProperty(key);
if (value != null) {
return value.equals(test_value);
} else {
if (test_value == null) {
return true;
} else {
return false;
}
}
} else {
ret... |
4694784f-ad9d-4269-be6f-9adb057adc89 | 8 | public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
input.useLocale(Locale.US);
System.out.println("Inserire la lunghezza dei due cateti : ");
double cateto1 = input.nextDouble();
double cateto2 = input.nextDouble();
input.close();
double ipotenusa = Math.sqrt... |
ff87bd40-3ca7-4277-b79b-951cc6e43959 | 2 | public int getMDef(){
int value = 0;
for (Armor armor : armorList) {
if(armor != null) value += armor.getStats().getmDef();
}
return value;
} |
e32c2cca-6ae3-4b74-8fd4-5f9041b64711 | 1 | public boolean validChosenItemIndex() {
return getChosenItemIndex() >= 0 && getChosenItemIndex() < items.size();
} |
8c89b371-bcf3-4140-ae17-abfd1737ea10 | 2 | public void start() {
this.stop = false;
this.forceStop = false;
if (this.thread == null || !this.thread.isAlive()) {
this.thread = new Thread(this);
this.thread.setName("bt-announce");
this.thread.start();
}
} |
80be57a4-9acc-4bf4-b56b-28a5c039e019 | 5 | protected void rnt(TouchFrame frame) {
float cx = getWidth() * 0.5f;
float cy = getHeight() * 0.5f;
float tx1 = frame.getLocalX();
float ty1 = frame.getLocalY();
float tx0 = frame.getLastLocalX();
float ty0 = frame.getLastLocalY();
float r = (float)Math.sqrt((tx0 - cx) * (tx0 -... |
69b79b1a-ec30-439a-b714-7f166bda8cfa | 5 | public void printTopologyOrder(Graph<T> g) throws EdgeVerticeNotFound{
DFSSearch(g);
ArrayList<Integer> result=new ArrayList<Integer>();
ArrayList<Integer> newInput=new ArrayList<Integer>();
for(int i:clock2){
newInput.add(i);
}
while(result.size()!=clock2.length){
int max=0;
int maxIndex=-1;
... |
2c56d15e-8771-4aad-af08-5847e75e2262 | 2 | public void initMaze() {
for (int i = 0; i < newRun.BOARD_MAX; i++) {
for (int j = 0; j < newRun.BOARD_MAX; j++) {
board[i][j].setBorder(findBorder(j, i, true));
}
}
} |
78ec07d6-8068-48a4-99ce-2a8a620bbc48 | 0 | public static GeneralValidator isGreaterThanEqualsTo() {
return GREATER_THAN_EQUALS_TO_VALIDATOR;
} |
2aa6eb4a-f6ca-466f-900f-7953551c3966 | 7 | @Override
public void run() {
mainLoop:
while (true) {
// update running status
for (int i = 0; i < maxClients; i++) {
handshaked[i] = listeners[i].handshakesFinished();
running[i] = listeners[i].clientRunning();
... |
a93a74ad-699c-4193-9dbe-ec337208ea55 | 4 | public SchachbrettFeld getKoenigPosition(boolean farbe) // figurFarbe ist true für schwarz
{
SchachbrettFeld feld = null;
for (SchachbrettFeld f : this.felder) {
if (f.figur != null && f.figur.getClass().getSimpleName().equals("Koenig") && f.figur.figurFarbe == farbe) {
f... |
550b6876-62a7-4c6b-8faf-5adf4f5292f8 | 5 | private Document initDocument(String responseContent, Document document, boolean namespaceAware) {
if(document == null) {
try {
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(namespaceAware);
final DocumentBuilder builder = factory.newDocumentBuil... |
e1e3b0f4-1060-41d0-9054-bc5262176b38 | 1 | public boolean buttonDown(int button) {
return poll[button - 1] == MouseState.ONCE
|| poll[button - 1] == MouseState.PRESSED;
} |
17d9f4be-1315-45ec-8771-71ef2bc45c46 | 9 | void playSound(boolean capturing) {
if (tile != null) {
if (tile instanceof Bear)
AUDIO_BEAR.play();
else if (tile instanceof Duck)
AUDIO_DUCK.play();
else if (tile instanceof Fox)
AUDIO_FOX.play();
else if (tile instanceof Hunter) {
if (capturing)
A... |
e5b59ef1-cf81-4de5-8232-6edead79ee0d | 6 | private void DisableOther(CommandSender sender, String[] args) {
if (args.length < 2 && extraauth.DB.Contains(args[1])) {
send(sender, extraauth.Lang._("Command.NoPlayer"));
return;
}
final PreUnregistrationEvent event = new PreUnregistrationEvent(
new PlayerInformation(args[1]));
ex... |
c8be08cc-6bd5-473b-a1dd-41d2d768636d | 6 | private void trSort (final int ISA, final int n, final int depth) {
final int[] SA = this.SA;
int first = 0, last;
int t;
if (-n < SA[0]) {
TRBudget budget = new TRBudget (n, trLog (n) * 2 / 3 + 1);
do {
if ((t = SA[first]) < 0) {
first -= t;
}
else {
last = SA[ISA + t] + 1;
... |
6899874d-58f1-4783-b5a2-b3e27b9d7017 | 4 | public static void main(String[] args) {
// TODO Auto-generated method stub
//程序自带数组
int[] systemArray = {23,12,14,2,5,7,46,130,25,3};
int sy[] = new int[10];
//System.out.println(sy.length +" " +systemArray.length);
System.out.println("请选择待排序数组的产生类型");
System.out.println("1.程序自定义数据2.随机产生3.用户输入4.退出");
S... |
b28527b5-f8a4-4bf2-a5aa-5db02863c74a | 7 | private String updateTask(String taskName, String newName, String startTime,
String endTime) {
backUp();
ArrayList<Task> found = searchKeyword(taskName);
for(int i = 0; i < found.size(); i++){
resetTaskKeyword(found.get(i));
}
if (!(found.get(0).getTaskName().equalsIgnoreCase("searchFound"))){
re... |
eb26a80d-06ec-4c9a-8ec1-c790865da862 | 8 | @Override
public void update(Observable o, Object arg) {
if (presenter.getState().getStatus().equals("Discarding")){
initDiscardValues();
if(totalResources>=7 && !hasDiscarded) { // !hasDiscarded = issue 209 fix
discardView.showModal();
updateResourceValues();
}
else if(totalResources<7 || hasDis... |
21c2c21d-c643-44c6-8d61-2da0025be010 | 8 | public static void dcopy_f77 (int n, double dx[], int incx, double
dy[], int incy) {
double dtemp;
int i,ix,iy,m;
if (n <= 0) return;
if ((incx == 1) && (incy == 1)) {
// both increments equal to 1
m = n%7;
for (i = 1; i <= m; i++) {
d... |
bf6d4129-2b8a-4dd1-a7b9-e5937a9dc767 | 2 | private void setValues(boolean config) {
if (!config) {
return;
}
try
{
mConfig.addDefault("MySQL.Hostname", "localhost");
mConfig.addDefault("MySQL.Username", "root");
mConfig.addDefault("MySQL.Password", "password");
mConfig.addDefault("MySQL.Database", "paintballpvp");
mConfig.addDefaul... |
7d20a76d-de04-4f0b-8671-f76522f65ada | 2 | public void setDAO(String daoLine) {
if (daoLine.equals("Mock")) {
dao = new MockDAO();
}
else if (daoLine.equals("MySQL")) {
dao = new MySQLDAO();
}
} |
4ca19910-a7d2-4893-937b-59d1fc5e1ce0 | 6 | public String getTipoPago(String tipo){
if (tipo.equals("Efectivo")){
return "E";
} else if (tipo.equals("Vale")){
return "V";
} else if(tipo.equals("Voucher")){
return "O";
} else if(tipo.equals("Cuenta de Cobro")){
return "C";
} e... |
290bcbf5-a40a-422c-9fe3-1d50984a849a | 9 | protected SortKeyDefinition[] makeSortKeys() throws XPathException {
// handle sort keys if any
int numberOfSortKeys = 0;
AxisIterator kids = iterateAxis(Axis.CHILD);
while (true) {
Item child = kids.next();
if (child == null) {
break;
... |
52d07cea-cf0e-4a94-add2-30a6f9e64bb3 | 1 | public void testConstructor_ObjectStringEx2() throws Throwable {
try {
new YearMonthDay("T10:20:30.040+14:00");
fail();
} catch (IllegalArgumentException ex) {
// expected
}
} |
65455ce5-6806-4b88-bb19-37c83800e1a8 | 8 | private static String initialise(Token currentToken,
int[][] expectedTokenSequences,
String[] tokenImage) {
String eol = System.getProperty("line.separator", "\n");
StringBuffer expected = new StringBuffer();
int maxSize = 0;
for (int i = 0; i < expe... |
3216496d-1891-49a9-9f0a-abb3a0178c11 | 2 | public static void main(String[] args) {
JPopupMenu jp = new JPopupMenu();
jp.add(new JMenuItem("Menu 1"));
JFrame frame = new JFrame("Hello There");
FileSystemView fsv = new SingleRootFileSystemView(new File("C:/Watcher"));
//new File DirectoryRestrictedFileSystemView(new File("C:\\"));
J... |
ca626ec4-0bad-4518-98aa-5e7fe776941e | 0 | public void die(){
} |
fcdd2e17-11ae-437c-8fda-6b0653221a29 | 6 | @Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
if (mDragDockable != null && mDragInsertIndex >= 0) {
Insets insets = getInsets();
int count = getComponentCount();
int x;
if (mDragInsertIndex < count) {
Component child = getComponent(mDragInsertIndex);
if (child i... |
c2ec09fa-5a1c-4c58-b1c3-69b833a60d1f | 3 | private void pickCustomColor() {
Color c = JColorChooser.showDialog(SwingUtilities.getAncestorOfClass(Dialog.class, this), "Select Color", lastSelection != null ? ((ColorValue) lastSelection).color : null);
if (c != null) {
setSelectedColor(c);
} else if (lastSelection != null) {
... |
c0f65f1f-fec3-4066-ac91-f1c26a45e0a6 | 0 | public void setAccountId(String accountId) {
this.accountId = accountId;
} |
1d3c942b-06b4-4970-bb21-93d4a0d8182b | 4 | @Override
public String execute(SessionRequestContent request) throws ServletLogicException {
String page = (String)request.getSessionAttribute(JSP_PAGE);
if (page == null) {
page = ConfigurationManager.getProperty("path.page.index");
request.setSessionAttribute(JSP_PAGE, pag... |
2567aca8-4692-44f5-9da8-896eeb3f5ff5 | 9 | void assignPrefixes() {
for (Map.Entry<String, Map<String, PrefixUsage>> entry : namespacePrefixUsageMap.entrySet()) {
String ns = entry.getKey();
if (!ns.equals("") && !ns.equals(WellKnownNamespaces.XML)) {
Map<String, PrefixUsage> prefixUsageMap = entry.getValue();
if (prefix... |
2d3869ed-8a90-4cc7-a889-620a5290bc22 | 3 | public static String readString(ByteBuffer buffer)
{
// Check that the buffer contains a short with the length of the string
if (buffer.remaining() < 2) {
return null;
}
// The first 2 bytes is the string length.
int stringLength = buffer.getShort();
// Check that the buffer contains the entire st... |
17b32e9d-f238-4c9a-88cf-c2c7c60edd2e | 0 | public void setRandCode(String randCode) {
this.randCode = randCode;
} |
1ce4fcf0-31ee-47ca-b47b-b7f536b1fa5b | 1 | public static void setLogLevel(int logLevel) {
logLevel = logLevelEquivalents.get(logLevel) == null ? 4 : logLevelEquivalents.get(logLevel);
org.apache.log4j.Logger.getRootLogger().setLevel(Level.toLevel(logLevel));
} |
42ea32b0-120b-40ae-8a47-912017af0a1f | 6 | public void sql_change_acct_info(int choice) throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
Statement s = GUI.con.createStatement();
if(choice == 1)
{
s.executeUpdate ("UPDATE all_users SET Hierarchy = \'"+c... |
081639ad-9be1-4396-85b4-766c03fbf9da | 3 | private static Move BackwardRightForWhite(int r, int c, Board board){
Move backwardRight = null;
if(r>=1 && c<Board.cols-1 &&
board.cell[r-1][c+1] == CellEntry.empty
)
{
backwardRight = new Move(r,c,r-1,c+1);
}
return backwardRight;
} |
14416ab6-dbbe-482e-aa7f-d72263a0d0a8 | 4 | @Override
public void keyReleased(KeyEvent e) {
int keyCode = e.getKeyCode();
// Controls for player 1
if(keyCode == KeyEvent.VK_W) {
GameMaster.player.moveUp = false;
}
if(keyCode == KeyEvent.VK_S) {
GameMaster.player.moveDown = false;
}
// Controls for player 2
if(keyCode == KeyEvent.VK... |
6af982c6-d100-42d7-a113-9b9ea9cff5a3 | 0 | public void setTaille(int taille) {
this.taille = taille;
} |
c444dfef-1ef0-447f-9265-6bfc7ce94fd6 | 4 | public int getNextIncompleteIndex(int row, int col)
{
boolean notFound = true ;
int len = translations.size() ;
int t = row ;
int back = -1 ;
while ( (t < len) && notFound)
{
TMultiLanguageEntry dummy = (TMultiLanguageEntry) translations.get(t) ;
String str = dummy.getTrans... |
c7e762d0-e460-4979-b17a-65a682caae3f | 0 | public void testByteFloatConvert() {
byte[] data = ByteUtils.floatToByte(1.23f);
float f = ByteUtils.byte2Float(data);
assertEquals(1.23f, f, 0);
} |
19326004-2d8e-4c18-952b-ef3124d1cf7a | 2 | public static void soloDecimales(JTextField Texto)
{
Texto.addKeyListener(new KeyAdapter()
{
@Override
public void keyTyped(KeyEvent e)
{
char c = e.getKeyChar();
if(!Character.isDigit(c) && Character.isLetter(c))
{... |
86095436-e56d-4b51-96dc-5786a28bcc70 | 7 | public void mouseMoved(MouseEvent e) {
if (searchPage == null || head2tail || peaks1 == null) {
return;
}
// ポップアップが表示されている場合
if ((selectPopup != null && selectPopup.isVisible())
|| contextPopup != null && contextPopup.isVisible()) {
return;
}
cursorPoint = e.getPoint();
P... |
89405a0a-5d7f-4fc2-ae79-732255304201 | 9 | private Map splitFilename(String filename, PodCastFileNameFormat format, Map parentProps)
{
Map returnValues = new HashMap();
//Allow access to parent props in messages.
returnValues.putAll(parentProps);
returnValues.put(PodCastFileProperties.FILE_VALID, Boolean.TRUE);
//If... |
94d9824c-d8bc-482c-86bb-7e4bcea09843 | 1 | @Override
protected void keyboardFocusLost() {
if (state != null) {
state.keyboardFocusLost();
}
} |
60ce7575-07bc-4fd5-a71a-29da2981c094 | 3 | private List<Edge> getEdgesTriees() {
ArrayList<Edge> edgesTriees = new ArrayList<>();
Integer p;
for (int i = 0; i < vertex.length; i++) {
for (int j = 0; j < vertex.length; j++) {
p = this.edges[i][j];
if (p != null) {
edgesTriees... |
44521d06-b99c-4c2b-9108-755b7fadbd10 | 9 | public static void test2(){
try
{
InputStream returnStream = null;
HttpsURLConnection conn = null;
int connectTimeout=15000;
int readTimeout=30000;
String requestMethod="GET";
String charEncode="utf-8";
String url="https... |
2306c6b1-8473-4e17-b233-2300333f4d5f | 0 | public void setId(Integer id) {
this.id = id;
} |
46f9f424-3584-44a1-9085-6a8626d49df3 | 0 | public Pyramid4(int side)
{
setSide(side);
base = DimensionalTrasform.scale(side, base);
coloredEx = new ArrayList<Excel>();
setColoredExes();
} |
ac49aca2-60a0-4e45-8b5e-a93a45926179 | 0 | @Override
public PermissionType getType() {
return PermissionType.GROUP;
} |
66af6556-a64d-4cad-8df9-c033b3d64ee9 | 9 | public boolean onCommand(CommandSender sender, Command cmd, String commandlabel, String[] args) {
final ChatColor yellow = ChatColor.YELLOW;
final ChatColor red = ChatColor.RED;
final ArrayList<Player> cMagic = CrazyFeet.CrazyMagic;
if(args.length < 1) {
if(sender instanceof Player) {
Player player... |
19d4f201-7d96-4ecb-bd9f-9662561cd1a7 | 2 | private void startNextTrial() {
gui.showCursor();
if (!currentTrialGroup.isEmpty()) {
if (experimentPhase == PHASE_XP) {
globalTrialNb++;
}
currentTrial = currentTrialGroup.remove(0);
showPreTrialBlankScreen();
} else {
//all trials have been shown, ask participant to complete the pattern ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.