method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
65b720b4-1a49-4fb7-b351-aa40b0991786 | 6 | public void negate() {
boolean doneZeros = false;
boolean doneFirst = false;
for (int i = digits.size() - 1; i >= 0; i--) {
if ((digits.get(i)) > 0) {
doneZeros = true;
}
if (!doneFirst && doneZeros) {
int temp = 10 - digits.get(i);
digits.set(i, temp);
// System.out.println("made it");
... |
4625d327-deb7-4e32-8805-9b316aea4c7a | 0 | private boolean sendHandshake(Socket socket, byte[] remotePeerId, boolean obfuscate) throws IOException {
OutputStream os = socket.getOutputStream();
Handshake hs = Handshake.craft(this.torrent.getInfoHash(),this.id, remotePeerId, obfuscate);
os.write(hs.getBytes());
logger.debug("Send Handshake to " + this.so... |
2d86f244-76a1-4c2a-9e46-d5aaaed395f0 | 9 | public List<RefactoringSuggestion> call(String[] args) {
Options options = new Options();
options.addOption("cceor", true, "Consolidate Conditional Expression Or");
options.addOption("cceand", true, "Consolidate Conditional Expression And");
options.addOption("cdcf", false,
"Consolidate Duplica... |
74021a6a-c084-40a2-afb1-48917b0b654d | 5 | public static String colorize(String in) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < in.length(); i++) {
if (in.charAt(i) == '&' && i < in.length() - 1) {
char ctrl = in.charAt(i + 1);
ChatColor cc = ChatColor.getByChar(ctrl);
if (cc != null) {
sb.append(cc);
i++;
} el... |
583e28d9-4f2e-4a19-887d-3b117f2f4b6d | 9 | @Override
public void onUpdate(World apples) {
if (!apples.inBounds(X, Y)||life--<0)
{
alive = false;
//apples.explode(X, Y, 32, 8, 16);
}
if (!apples.isSolid(X, Y-10))
{
Y-=10;
}
for (int i = 1; i < 10; i++)
{
if (... |
d026a82b-a2a1-49b8-b2b8-4bc07e83704b | 3 | private <T extends Comparable> boolean search(T value, BinaryTree root) {
boolean result = false;
if (root == null) {
result = false;
} else {
if (value == root.getValue())
result = true;
else {
if (value.compareTo(root.getValue()) < 0) {
result = search(value, root.left);
} else {
... |
3d1120a6-15f2-4b36-ba3f-4a970b4a743f | 5 | private boolean noCopy() {
Iterator<Point> it = pointIterator();
while(it.hasNext()) {
Point a = it.next();
int count = 0;
Iterator<Point> et = pointIterator();
while(et.hasNext()) {
Point b = et.next();
if (a.x == b.x && a.y == b.y) ++count;
}
if (count != 1) return false;
}
retur... |
67e1de55-a133-461f-b646-7914fae001f4 | 4 | protected void slice_check()
{
if (bra < 0 ||
bra > ket ||
ket > limit ||
limit > current.length()) // this line could be removed
{
System.err.println("faulty slice operation");
// FIXME: report error somehow.
/*
fprintf(stderr, "faulty slice operation:\n");
debug(z, -1, 0);
... |
41807b18-21f1-4f94-8f33-ca329f4e1215 | 5 | public final void setFrame()
{
try
{
if (icons.size() == 0)
icons.add(ImageIO.read(Frame.class.getResource("/logo.png")));
}
catch (IOException e)
{
System.out.println("LOGO not located");
}
addComponentListener(TCode.input);
if (TCode.frameWidth == 0)
TC... |
388da7a8-4f48-4d32-9d3c-1b0249e10fb7 | 1 | public List<Row> getChildren() {
return canHaveChildren() ? Collections.unmodifiableList(mChildren) : null;
} |
b00fbe75-0114-44ce-9fef-bd0b94e4d7d6 | 4 | public void sendUpdates() {
if(connection.isClosed()) {
System.out.println("Why are you updating a closed socket?");
return;
}
try {
//write each queued event to output
while(queuedEvents.size()>0) {
UpdateEvent event = queuedEvents.poll();
if(event!=null){
event.writeTo(connection.getOut... |
c247f7b5-72e8-491b-acce-149b9e420522 | 6 | public IntegerWrapper integerUpperBound() {
{ IntervalCache interval = this;
{ Stella_Object ub = interval.upperBound;
if (ub != null) {
{ Surrogate testValue000 = Stella_Object.safePrimaryType(ub);
if (Surrogate.subtypeOfIntegerP(testValue000)) {
{ IntegerWrappe... |
5acd7e3a-2d27-419e-bebf-9f902fa7c0ab | 0 | public static void main(String[] args) {
double d = 257.234;
int i = (int) d;
System.out.println(i); // 257
byte b = (byte) d;
System.out.println(b); // 1 (257%256)
} |
62d108f2-d938-4b53-a91a-42d124fb8ff4 | 7 | @Override
public void onUpstreamMessageEvent(ChannelMessageEvent event,
PipelineHandlerContext context)
throws Exception
{
if( !(event.getMessage() instanceof IOBuffer) || errorState )
{
context.sendUpstream(event);
return;
}
IOBuffer buffer = (IOBuffer) event.getMessage();
bufferC... |
f1de9b60-77df-46a2-bbd1-6bcf9f14bd4a | 8 | private static Case directionOptimaleEchappee(Grille grille, Case caseMission) {
Monstre monstres = grille.getNbVampires(caseMission) != 0 ? Monstre.VAMPIRES : Monstre.LOUPS;
ArrayList<Case> toutesCasesAdjacentes = grille.getToutesCasesAdjacentes(caseMission);
ArrayList<Case> casesDisponibles = ... |
81893418-2387-45f7-803d-58cc54fdcf9e | 0 | public List findByActive(Object active) {
return findByProperty(ACTIVE, active);
} |
d7cd1e9b-b1f1-4b9a-b2df-91e4b24a0c8b | 8 | public void setInstances(Instances inst) {
m_Instances = inst;
String [] attribNames = new String [m_Instances.numAttributes()];
for (int i = 0; i < attribNames.length; i++) {
String type = "";
switch (m_Instances.attribute(i).type()) {
case Attribute.NOMINAL:
type = "(Nom) ";
break;
... |
6f769cf7-48df-4828-8237-88c3290fe865 | 9 | public static String possibleQueenMoves(int i) {
String list="", oldPiece;
int r=i/8, c=i%8;
int temp=1;
for (int j=-1; j<=1; j++)
{
for (int k=-1; k<=1; k++)
{
if(j!=0 || k!=0)
{
try {
w... |
d40fab68-0eb2-4cf9-bd7a-870b634377a7 | 1 | private static List<Integer> generate() {
List<Integer> list = new LinkedList<Integer>();
for (int i = 0; i < 10; i++) {
int num = new Random().nextInt(100);
list.add(num);
}
Collections.shuffle(list);
return Collections.unmodifiableList(list);
} |
2e571e45-e82c-4feb-a170-08d2ac9bd89e | 0 | public SetModeRainbowDanceParty(){
super(colors,1.0/20);
} |
a0db1c58-8dd2-4c82-88b7-2c9c9e47e36d | 1 | private void getCountryCollection(AbstractDao dao, List<Direction> directions) throws DaoException {
for (Direction dir : directions) {
Criteria crit = new Criteria();
crit.addParam(DAO_ID_DIRECTION, dir.getIdDirection());
List<LinkDirectionCountry> links = dao.findLinkDirect... |
c3879fc8-ad67-4829-9d75-feddfc0e1ca5 | 6 | public void activate(){
activated = true; //set activated
boolean allActive; //have all the parents been activated?
time = 0;
//find the longest time from parents (critical time)
for(Connection g:input){
if(time < g.getParent().time)
time = g.getParent().time;
}
//add current gate's propagation d... |
e9878e3d-63e4-446f-a9c8-f000b35bc682 | 7 | private void initBlocks(){
blocks.clear();
blocks.add(new Block(180,120,16,16));
blocks.add(new Block(50,120,16,16));
blocks.add(new Block(88,160,16,16));
blocks.add(new Block(88+16,160,16,16));
blocks.add(new Block(88+32,160,16,16));
int y=208;
for(int i=... |
c7eff4e8-3ffe-4412-96e2-1e25d9a0db7e | 3 | public void deregister(final Region region) {
this.regions.remove(region);
this.references.remove(region);
this.catalog.deregisterOptions(region);
// unload region from any loaded chunk index entries
final Iterator<Entry<Long, Set<Region>>> it = this.cache.entrySet().iterator();... |
7109754c-1b10-4bb8-9601-e19951404593 | 5 | @Override
protected void channelRead0(ChannelHandlerContext ctx, HttpObject obj) throws Exception {
if (obj instanceof HttpRequest) {
HttpRequest req = (HttpRequest) obj;
if (shouldBlock(req)) {
logger.info("Blocking black-listed request: " + req.getUri());
... |
b6c25c9c-5df4-41a0-9bcd-e8c1de664822 | 3 | private void tick() {
if (index == 4) {
System.exit(ERROR);
}
menus.get(index).tick();
for (int i = 0; i < timers.size(); i++) {
timers.get(i).tick();
}
for (Animation a : anims) {
a.tick();
}
} |
cfea9e07-0f2e-4be9-b900-f3a869deb1ab | 3 | public int getEdgeNumber(){
int counter = 0;
for(int i = 0; i < number; i++){
for(int j = 0; j < number; j++){
if(matrix[i][j] == 1){
counter++;
}
}
}
return counter / 2;
} |
85ffa3a3-286d-4426-9d0b-d70898adb743 | 7 | private void addInteraction(ThreatClass threatClass,
AbstractInsnNode abstractInsnNode) {
AbstractInsnNode previousNode = abstractInsnNode.getPrevious();
if (previousNode instanceof VarInsnNode) {
int var = ((VarInsnNode) previousNode).var;
previousNode = previousNode.getPrevious();
while (previousNode ... |
69298797-d596-47b6-80d4-112beb5267a3 | 6 | private boolean checkAuthURL(String action, String... params) {
// if there isn't at least one parameter OR
// if params length is not an even number
if (params.length < 2 || ((params.length % 2) != 0))
return false;
try {
//HttpURLConnection.setFollowRedirects(false);
HttpURLConnection ... |
2af28d5a-18cb-4165-a876-3cd4f1430e14 | 3 | public static String extractChars(String s) {
if (s == null) {
return StringPool.BLANK;
}
StringBuilder sb = new StringBuilder();
char[] c = s.toCharArray();
for (int i = 0; i < c.length; i++) {
if (Validator.isChar(c[i])) {
sb.append(c[i]);
}
}
return sb.toString();
} |
2c0d65d4-96c3-4317-99aa-b6aa092012b8 | 5 | protected Map<String, Object> postProcessCellStyle(Map<String, Object> style)
{
if (style != null)
{
String key = mxUtils.getString(style, mxConstants.STYLE_IMAGE);
String image = getImageFromBundles(key);
if (image != null)
{
style.put(mxConstants.STYLE_IMAGE, image);
}
else
{
image ... |
5d92b33d-272e-472c-9dc0-17ecd5d807ea | 2 | public List<Vector3f> getHotSpotsFor(String key){
List<Vector3f> modelHotSpots = getModel().getHotSpotFor(key);
List<Vector3f> transformedSpots = new ArrayList<Vector3f>();
Matrix4f transform = getTransformInverse();
if(modelHotSpots != null)
for(Vector3f vec : modelHotSpots)... |
c75d62a5-bef7-42dd-a31c-8845f9345053 | 5 | private static boolean closeFrames(boolean significant) {
for (Frame frame : Frame.getFrames()) {
if (frame instanceof SignificantFrame == significant && frame.isShowing()) {
try {
if (!CloseCommand.close(frame)) {
return false;
}
} catch (Exception exception) {
Log.error(exception);
... |
dbfb4e5b-e85c-4e4b-9e7c-697ee407d35b | 5 | public Position getNextPos(Node n){
Map map = Tools.getBackgroundMap();
Position newPos = new Position();
boolean inLake = false;
if(Configuration.useMap){
inLake = !map.isWhite(n.getPosition()); //we are already standing in the lake
}
if(inLake){
Main.fatalError("A node is standing in a lak... |
80994343-1cfa-415e-92ad-5f845d3ad38f | 3 | public int getIdByData(String name, String shortDescription, String version,
LanguageTypeEnum language){
int result = -1;
try {
PreparedStatement statement = connection.prepareStatement(GET_ID_BY_DATA);
statement.setString(1, name);
statement.setString(2, shortDescription);
statement.setString(3,... |
cf234ef9-7660-4abe-868b-e3fe5aa618fb | 2 | public byte[] process(byte[] srcBytes, boolean encrypt) {
try {
Cipher cipher = Cipher.getInstance("DES");
cipher.init(encrypt ? Cipher.ENCRYPT_MODE : Cipher.DECRYPT_MODE, key);
return cipher.doFinal(srcBytes);
} catch (Exception e) {
throw new IllegalArgumentException(e);
}
} |
1e1080ee-14e9-4fc7-8b54-892ac2f037c7 | 3 | private static void addStartButtonListener(JButton Start){
// <editor-fold defaultstate="collapsed" desc="MBO Start Button">
Start.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
fromMBO = true;
... |
3b1c589d-dcc6-4dc0-a9e2-80ad301465bb | 4 | @Override
public List<Player> selectPlayerOfMatchByDayHour(int heure, int day) throws SQLException, IOException {
connexionDB = ConnexionMysqlFactory.getInstance();
ResultSet rs = null;
List<Player> lp = new ArrayList<>();
Statement st = connexionDB.createStatement();
try (Pr... |
526d1058-236f-4ad0-9b68-0d5bf0b85147 | 6 | public static void main(String[] args) {
System.out.println("Enter # of Rows");
int rows = in.nextInt();
for (int column = 1; column <= rows; column++) {
for (int row = 1; row <= column; row++) {
if (row == 1 && column == 1) {
for (int i = 1; i <= rows; i++) {
System.out.print(decFormat.format(i... |
f9ec079d-bfb2-4079-aac0-83e58db20231 | 5 | public boolean existWhiteForest(){
for(int i=0;i<getDim();i++)
for(int j=0;j<getDim();j++)
if(!damiera[i][j].isFree() && damiera[i][j].getPezzo().getColore()==Color.WHITE)
if(!damiera[i][j].getPezzo().getAlberoMosse().isSAMNull())
return true;
return false;
} |
6e940893-7628-4851-9267-324b0ae8c546 | 8 | public Object nextValue() throws JSONException {
char c = nextClean();
String s;
switch (c) {
case '"':
case '\'':
return nextString(c);
case '{':
back();
return new JSONObject(this);
case '[':
... |
4c599fe7-1f6c-44bd-a080-9be88181f927 | 3 | public void setFullScreen(JFrame w, DisplayMode dm) {
w.dispose();
w.setUndecorated(true);
//display mode support
if (vc.isDisplayChangeSupported()) {
try {
vc.setDisplayMode(dm);
} catch (Exception ex) {
vc.setDisplayMode(vc.getD... |
aae639fa-93cc-485d-8cea-83b4754f5e57 | 5 | public Snake(Vector2f head, int length, int direction, ReadableColor color) {
this.initialSnake = new ArrayList<Vector2f>();
for (int i = 0; i < length; i++) {
if (direction == 0) initialSnake.add(initialSnake.size(), new Vector2f(head.x - i, head.y));
else if (direction == 1) in... |
fb847e3f-3ec9-47da-a692-c287ba6e7b63 | 3 | public static long unsortedExperiment(){
startTime = (new Date()).getTime();
int choice;
Long number;
for(int i = 0; i < NUMBER_OF_CHOICES; i++)
{
choice = choices[i];
number = numbers[choice];
if(!linearSearch(number))
{
System.out.println("Not found");
break;
}
else if... |
13890f2b-1a49-44f3-b037-801919fdf451 | 5 | private boolean gatherKeyPointers(){
String keys;
try{
keys = fileToString(pointerStorage);
}
catch (RuntimeException e){
System.out.println("Can't read pointer storage, perhaps it's empty");
return false;
}
String key = "";
St... |
4d209bdd-2671-4a70-95bf-f18188fd4d64 | 0 | @OneToMany(mappedBy="event1")
public List<Car> getCars() {
return cars;
} |
18b82f41-d614-45b6-9045-f6b5329d689f | 5 | public int getNumber(String colors)
{
if (colors.length() == 0)
return 0;
int result = 1;
int i = 0;
while (i < colors.length()) {
int max = 1;
i++;
while ((i < colors.length()) && (colors.charAt(i) == colors.charAt(i - 1)) ) {
i++;
max++;
}
if (max > result)
result = max;
}
r... |
f51d44ad-c101-4210-82c2-05d5b3beea78 | 8 | @Override
public void run() {
// First time through the while loop we do the merge
// that we were started with:
MergePolicy.OneMerge merge = this.startMerge;
try {
if (verbose())
message(" merge thread: start");
while(true) {
setRunningMe... |
bcbecd73-fa93-4996-8b10-44cd00e5f4f5 | 8 | public Stardata Fk425(Stardata s1950) {
double r, d, ur, ud, px, rv, sr, cr, sd, cd, w, wd, x, y, z, xd, yd, zd, rxysq, rxyzsq, rxy, rxyz, spxy, spxyz;
int i, j;
/* Star position and velocity vectors */
double r0[] = new double[3], rd0[] = new double[3];
/* Combined position an... |
44a9de19-6778-4898-8b8f-ab4bd7af2b00 | 3 | public static void main(String args[]) {
if (args.length > 0) {
if(args[0].length() <= 8 )
{
if (isNum(args[0])) {
Conver cv = new Conver();
cv.converStart(args[0]);
} else {
System.out.println("用户输入的字符不都为数,无法转换 !");
}
}
else
{
System.out.println("请输入八... |
f37bb011-d73d-4542-8f27-289e86c0745b | 7 | void print(){
int i=s.length;
int j=t.length;
int newi = i-1;
int newj = j-1;
for(int k=ed;k>=0;k--){
if(i-1>=0)
newi = i-1;
else
newi=i;
if(j-1>=0)
newj = j-1;
else
newj = j;
if((j-1)>=0 && m[i][j-1]<m[newi][newj]){
newj = j-1;
}
if((i-1)>=0 && m[i-1][j]<m[new... |
6fbbbd5e-6a06-440a-8bd4-9f2823c1a343 | 2 | @Override
public void process(SimEvent event) {
NodeReachedEvent _event = (NodeReachedEvent) event; // Casts the event.
//int _oldPosition = getPosition(); // Saves the old position (Where the agent came from).
setPosition(_event.getPosition()); // Sets the actual position to the reached node.
System.out.prin... |
0b5c7c96-b770-48cb-a94b-2da92652dc25 | 7 | public synchronized void move(){
//choose the direction
Location temp = new Location(loc.getX(), loc.getY());
this.chooseDirection();
//makes and checks temporary location
switch(dir){
case 'L':
temp.setX(temp.getX() - 1);
break;
case 'R':
temp.setX(temp.getX() + 1);
break;
... |
28d5a119-7c1c-4099-86e4-29b5496fa1ce | 1 | public static Sequence loadMidi(String fileName)
{
Sequence sequence = null;
try
{
sequence = MidiSystem.getSequence(new File("./res/midi/" + fileName));
}
catch (Exception e)
{
e.printStackTrace();
System.exit(1);
}
return sequence;
} |
e4254eb0-0951-40b9-87af-857fa8a5b4b4 | 4 | private void setupAccessibility() {
getAccessibleContext().setAccessibleDescription("Application for learning the CECIL machine language (English). Press ALT to tab between the menu bar and the main application.");
menuBar.getAccessibleContext().setAccessibleName("Menu bar");
menuBar.getAccessibleContext().set... |
c29bd0f5-ee8d-4652-a122-c1628df17cd1 | 5 | public Iterator<MedicineXmlTO> read() throws InterruptedException{
ArrayList<MedicineXmlTO> medTo = new ArrayList<MedicineXmlTO>();
try {
Connection connection = DbPool.getInstance().getConnection();
Statement st = connection.createStatement();
ResultSet rs = st.execu... |
730bbb3d-583b-442e-aee6-f85e2f5aeacd | 5 | protected void mapChildrenValues(Map<String, Object> output, ConfigurationSection section, boolean deep) {
if (section instanceof MemorySection) {
MemorySection sec = (MemorySection) section;
for (Map.Entry<String, Object> entry : sec.map.entrySet()) {
output.put(createP... |
5f772fde-a4c6-44dc-9bc8-792107e4ccee | 8 | public void run() {
Server server = Bukkit.getServer();
ChatColor purple = ChatColor.DARK_PURPLE;
Plugin larvikGaming = server.getPluginManager().getPlugin("LarvikGaming");
int delay = larvikGaming.getConfig().getInt("RestartTimeInHours", 6) * 3600000;
if (delay < 1) {
return;
}
try {
Th... |
7ada10e0-6ebb-4e21-9092-102ed4518090 | 5 | static final void method1935(int i, int i_10_, Class30 class30,
AnimatableToolkit class64, boolean bool, int i_11_) {
try {
anInt3270++;
if (class64 != null) {
if (bool != false)
method1929((byte) 106);
class30.method320(class64.EA(), class64.fa(), (byte) -4, i_11_,
class64.na(), i, clas... |
d6bb2cea-ed86-40ae-8750-b1bc3fa9d0fd | 1 | @AfterTest
public void tearDown() throws Exception {
driver.quit();
String verificationErrorString = verificationErrors.toString();
if (!"".equals(verificationErrorString)) {
fail(verificationErrorString);
}
} |
ef36d6df-6751-40e8-9002-598fa1ede57a | 0 | public int countBins(){
return this.bins.size();
} |
236e2a61-9f5f-43af-a702-08a54766dd27 | 5 | public static String[] getParagraphs(String article ){
String[] ret=null;
try {
int pFromIndex=0;
int pToIndex=0;
ArrayList<Integer> startPIndexs=new ArrayList<Integer>();
ArrayList<Integer> endPIndexs=new ArrayList<Integer>();
while(-1!= article.indexOf("<P>", pFromIndex)){
int t = ar... |
73850695-0ce6-4fe0-8714-9bd5492a4579 | 7 | public static void main(String[] args) {
try {
svm_model svmModel = svm.svm_load_model("SvmModel.eye");
FaceFeaturesFinder faceFeaturesFinder = new FaceFeaturesFinder(svmModel);
if (args.length != 1) {
throw new IOException("invalid images path");
}
String imagesPath=args[0] ;
File file... |
3257820a-e86f-4d53-ba62-605a0bc6bc87 | 3 | public int numberOfPersonsWhoOrderedTheSameMeal(){
int i = 0;
int timesTheSameMealIsOrdered = 0;
for(Command command: this.commands){
if(command.compareCommandTo(commands.get(i))==-1){
if(command.orderTheSameMeal(command)==1){
timesTheSameMealIsOrdered++;
}
}
i++;
}
return timesTheSameMe... |
d09ce15a-bc05-4b52-b8af-63adf8e087e9 | 9 | @Override
public String dismountString(Rider R)
{
switch(rideBasis)
{
case Rideable.RIDEABLE_AIR:
case Rideable.RIDEABLE_LAND:
case Rideable.RIDEABLE_WATER:
return "disembark(s) from";
case Rideable.RIDEABLE_TABLE:
case Rideable.RIDEABLE_SIT:
case Rideable.RIDEABLE_SLEEP:
case Rideable.RIDEABLE_W... |
3519983e-c8c0-43f9-8627-ba4dbe357348 | 8 | public Worker[] list () {
Connection con = null;
PreparedStatement statement = null;
ResultSet rs = null;
List<Worker> workers = new ArrayList<Worker>();
try {
con = ConnectionManager.getConnection();
String searchQuery = "SELECT * FROM workers WHERE status != 'terminated'";
stateme... |
389e05e2-bd68-48e9-a56d-9546c8bc8cbc | 8 | public static GameState readCSV(String filename){
int superzahl = 0;
CSVReader reader = null;
try {
reader = new CSVReader(new FileReader(filename), ';');
}
catch (IOException e){
System.out.println(e.toString());
}
String [] nextLine;
ArrayList<int[]> parsedList = new ArrayList<int[]>();
try {... |
3438da60-fa86-4494-be4e-44e9c7ec4bb3 | 8 | public Investment getChild(int id) {
for (Investment i : this.children) {
if (i instanceof Bond) {
if (i.getUniqueId() == id) return i;
}
else if (i instanceof Stock) {
if (i.getUniqueId() == id) return i;
}
else if (i instanceof MoneyMarket) {
if (i.getUniqueId() == id) return... |
c87ce5f9-1b26-4239-920f-8003c171d78f | 1 | public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
AnnotationVisitor av = mv.visitAnnotation(remapper.mapDesc(desc),
visible);
return av == null ? av : new RemappingAnnotationAdapter(av, remapper);
} |
09c08cc1-8986-423a-b259-3b5524dd969c | 3 | public void setIdentificador(TIdentificador node)
{
if(this._identificador_ != null)
{
this._identificador_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
... |
094b3cf6-90a3-4642-b112-47413def21b9 | 7 | private String getNewTheoryInList() {
StringBuffer theories = new StringBuffer( );
for(int i=0;i<theoriesSplittedsRead.length;i++){
if(theoriesSplittedsRead[i].contains("THEORY User_Pass IS"))
continue;
if(i+1 != theoriesSplittedsRead.length) //if space after the last end
theories.append(the... |
ab8304e0-1e2c-4f39-ad7c-7244bd9ab12c | 3 | @SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void visitMethod(ClassNode c, MethodNode m) {
FlowGraph fg = m.graph();
for(Iterator it = new HashSet(fg.handlersMap().entrySet()).iterator(); it.hasNext();) {
Map.Entry<Block, Handler> handlerEntry = (Entry<Block, Handler>) it.next();
Hand... |
4bbd5fe1-048e-4331-8ed8-348577514ded | 4 | private void DeleteInstanceButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DeleteInstanceButtonActionPerformed
if (!InstanceComboBox.getSelectedItem().toString().equals("<None>")) {
String instanceToBeRemoved = InstanceComboBox.getSelectedItem().toString();
... |
fd9c16d4-b04e-48cc-a6d7-b67c02799fca | 6 | public void GAstep_selection() {
/* провести селекцию*/
/**
* все сложить в одну кучу отсортировать по фитнесу удалить все лишние
*/
Map<Integer, Species> typeByOrganism = new HashMap<Integer, Species>();
List<Organism> allOrganisms = new ArrayList<Organism>();
... |
0f3e0a45-dee8-447e-8fa2-c82bc5a1ce29 | 2 | public byte[] getByteArray(String key) {
try {
if(hasKey(key))
return ((NBTReturnable<byte[]>) get(key)).getValue();
return new byte[]{};
} catch (ClassCastException e) {
return new byte[]{};
}
} |
22aee149-65aa-4eae-af80-96e845622a8a | 0 | public DDALine(Excel ex1, Excel ex2)
{
begin = ex1;
end = ex2;
this.setColoredExes();
} |
64493ad1-c655-4970-a663-95c9f0e6e94c | 3 | private boolean jj_3R_70() {
if (jj_scan_token(LEFTBRACKET)) return true;
if (jj_3R_61()) return true;
if (jj_scan_token(RIGHTBRACKET)) return true;
return false;
} |
b029ff9e-e766-4127-8deb-4bf16a226746 | 4 | private void showAddItemWizard() {
System.out.println("\n---------------------------------------");
System.out.println("- New item wizard - Step 1 -");
System.out.println("---------------------------------------");
System.out.println("Please select an option :");
Syste... |
94ac73dc-64ce-4233-b1a2-dde0d34d1d23 | 4 | @Test
public void testKlusToevoegen() throws Exception {
File f = new File("C:/Users/Jacky/Dropbox/Themaopdracht 4/CSVTestdata/KlusToevoegenTest.csv");
if (f.exists() && f.isFile()) {
String klusnaam;
String klusomschrijving;
String datumdag;
String datummaand;
String datumjaar;
FileReader fr = n... |
c81e5768-5740-45b3-9e8d-88cdfe1d013b | 3 | @Override
public Vector4D multiply(MatrixS4 matrix) {
double[] result = new double[4];
double suma;
try {
for (int i = 0; i < 4; i++) {
suma = 0;
for (int j = 0; j < 4; j++) {
suma += this.getElementAt(j + 1)
* matrix.getElementAt(j + 1, i + 1);
}
result[i] = suma;
}
} catch (... |
2a86b39a-76c7-4332-95f4-88734047a910 | 8 | @Override
public Solution runAlgorithm() {
for (int iter = 0; iter < maxiter; iter++) {
best = determineBest(population);
System.out.println((iter + 1) + ": " + best.getFitness());
if (best.getFitness() >= minFit) {
return best;
}
List<Solution> newSols = new ArrayList<>(popSize);
newSols.add(b... |
3a3588bd-9360-4318-b41c-e70b2232d374 | 8 | public static void main(String[] args) {
final int TOP_LIMIT = 10000;
int[] divisorTotals = new int[TOP_LIMIT + 1];
int totalSum = 0;
//store divisor totals in array
for (int i = 1; i <= TOP_LIMIT; i++) {
//1 is divisible by every number, don't need ... |
7b7affb5-36cb-4c1b-aaa0-b7b34deed6fe | 2 | public void testWithers() {
DateMidnight test = new DateMidnight(1970, 6, 9, GJ_DEFAULT);
check(test.withYear(2000), 2000, 6, 9);
check(test.withMonthOfYear(2), 1970, 2, 9);
check(test.withDayOfMonth(2), 1970, 6, 2);
check(test.withDayOfYear(6), 1970, 1, 6);
check(test.wi... |
15688e44-0a30-4a5a-8eca-b4561ee8991c | 2 | public void testWithers() {
YearMonth test = new YearMonth(1970, 6);
check(test.withYear(2000), 2000, 6);
check(test.withMonthOfYear(2), 1970, 2);
try {
test.withMonthOfYear(0);
fail();
} catch (IllegalArgumentException ex) {}
try {
tes... |
519c38f5-3fe0-421a-8970-274759f94dde | 3 | @Test
public void testPutGetMessagesInOrder() {
try {
int noOfMessages = 5;
final CountDownLatch gate = new CountDownLatch(noOfMessages);
final ArrayList<Message> list = new ArrayList<Message>(noOfMessages);
for (int i = 0; i < noOfMessages; i++) {
Message msg = new MockMessage("TestMessage");
li... |
b987d602-aca1-4728-949a-9feb0f33e112 | 8 | char processAmpersand()
throws XMLMiddlewareException, IOException, EOFException
{
char c;
switch (entityState)
{
case STATE_DTD:
throwXMLMiddlewareException("Invalid general entity reference or character reference.");
case STATE_ATTVALUE:
if (getCh... |
342a8f87-a038-4e6a-bd17-76aacef2e222 | 6 | public void testTextToTerm2() {
String text1 = "fred(?,2,?)";
String text2 = "[first(x,y),A]";
Term plist = Util.textToTerm(text2);
Term[] ps = plist.toTermArray();
Term t = Util.textToTerm(text1).putParams(ps);
assertTrue("fred(?,2,?) .putParams( [first(x,y),A] )", t.hasFunctor("fred", 3) && t.arg(1).hasFu... |
906aa3c7-1b66-486a-90b4-4cb8605a6461 | 5 | public final void writeNewSongbookData(final File masterPluginData) {
final OutputStream outMaster;
outMaster = this.io.openOut(masterPluginData);
try {
// head
this.io.write(outMaster, "return\r\n{\r\n");
// section dirs
this.io.write(outMaster, "\t[\"Directories\"] =\r\n\t{\r\n");
final Iterato... |
ad6beb5d-631a-44d3-b85a-a7ebd58f0198 | 0 | private static synchronized int getCounter() {
return counter++;
} |
e5ef4679-b4fd-45a7-8850-67246f129f4e | 3 | public String getImportFileFormatNameForExtension(String extension) {
String lowerCaseExtension = extension.toLowerCase();
for (int i = 0, limit = importers.size(); i < limit; i++) {
OpenFileFormat format = (OpenFileFormat) importers.get(i);
if (format.extensionExists(lowerCaseExtension)) {
return (String... |
dfe54b1a-5355-468f-a1ff-13a34aff954b | 3 | @SuppressWarnings("unchecked")
public String getTeamData() {
PreparedStatement st = null;
ResultSet rs = null;
JSONArray json = new JSONArray();
try {
conn = dbconn.getConnection();
st = conn.prepareStatement("SELECT id, match_number, auton_top*6 + auton_middl... |
618ed6ca-7243-48d5-bb42-fe3e68881654 | 0 | @Test
public void testTimes() {
calculator.pushOperand(3.0);
calculator.pushOperand(2);
calculator.pushTimesOperator();
calculator.evaluateStack();
assertEquals(6.0, calculator.popOperand(), 0);
} |
ce173433-4626-406f-882c-b0b5676d34a4 | 6 | @EventHandler(priority=EventPriority.LOW)
public void preCraftEvent(PrepareItemCraftEvent event) {
if(event.getViewers() == null || event.getRecipe() == null)
return;
Material mat = event.getRecipe().getResult().getType();
if(event.isRepair()) {
for(HumanEntity he: e... |
449b9148-ebff-47e4-8127-60d1cee74e9b | 3 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Json other = (Json) obj;
if (!Objects.equals(this.json, other.json)) {
return false;
... |
6388418b-ad21-4713-95c5-2ef856b65a53 | 9 | public static void extractArguments(String[] args, String argumentPrefix, Map<String, String> _arguments, List<String> _nonArguments)
throws InvalidArgumentException {
if (null == args || args.length == 0) return;
Map<String, String> arguments = new TreeMap<String, String>();
List<String> nonArguments = new A... |
1b4cd7c9-d918-4365-b3dd-fd7c9120570a | 7 | private String trimStr(String str,char ch) {
if(str == null) return null;
str = str.trim();
int count = str.length();
int len = str.length();
int st = 0;
char[] val = str.toCharArray();
while ((st < len) && (val[st] == ch)) {
st++;
}
while ((st < len) && (val[len - 1] == ch)) {
len--;
}
... |
682c5e41-e98d-41f5-ba3a-24b4ac17ecb8 | 8 | private Vector<Integer> getIdList(String csv[], boolean parent) {
Vector<Integer> results = new Vector<Integer>(this.ruleList.size());
results.setSize(this.ruleList.size());
for (int j = 0; j < this.ruleList.size(); j++) {
results.set(j, j);
}
for (int j = 0; j < csv.length; j++) {
int k = 0;
for ... |
604db415-7e7c-47c2-aaed-1caf26ef579f | 1 | private Class getClassObject(String name) throws ClassNotFoundException {
if (useContextClassLoader)
return Thread.currentThread().getContextClassLoader()
.loadClass(name);
else
return Class.forName(name);
} |
d977a905-cf56-43a8-8576-c3497dd1932a | 9 | @Override
public boolean equals(Object obj) {
if(this == obj) {
return true;
}
if(obj instanceof Build) {
Build that = (Build)obj;
return this.id == that.id
&& this.name != null ? this.name.equals(that.name) : this.name == that.name
... |
8fc15565-224c-49d4-aa0f-354a977cd1ec | 2 | private void resaveParamsSaveCity(SessionRequestContent request) {
String currCountry = request.getParameter(JSP_CURR_ID_COUNTRY);
if (currCountry != null && !currCountry.isEmpty()) {
request.setAttribute(JSP_CURR_ID_COUNTRY, currCountry);
}
createCurrCity(request);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.