method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
807cdca1-2fdf-41ca-ad94-b779af33475f | 2 | protected void loadFilters() {
filterArray = new BufferedImageOp[1];
short[] straight = new short[256];
short[] added = new short[256];
for (int i = 0; i < 256; i++) {
straight[i] = (short)i;
if (i < (256 - 16)) {
added[i] = (short)(i + 16... |
f73ad6ad-bde0-4e55-9b11-662877a53f8a | 3 | public static void modifierCategorie(Categorie categorie,
String nouveauNom,
Icone nouvelleIcone,
Utilisateur utilisateur,
Role nouveauConsultationRoleMinim... |
65fa6bc4-0f57-4f7f-88dc-3308773e640a | 2 | public boolean isPlusInfinity(){
boolean test = false;
if(this.magnitude==Double.POSITIVE_INFINITY || this.phaseInDeg==Double.POSITIVE_INFINITY)test = true;
return test;
} |
dfe86c27-e457-444d-8f55-3cc8ef1aaea0 | 5 | @Override
public void mouseClicked(MouseEvent e){
Point offsettedLocation = e.getPoint();
boolean tileExists = view.hasTile(offsettedLocation);
if (e.getButton() == MouseEvent.BUTTON1){
Point tileLocation = view.getTileLocation(offsettedLocation);
if (tileExists){
Tile clickTile = view.getTile(offs... |
a5d48384-cbff-4dd9-a5c1-15377a1fa667 | 4 | public void setPrices(List<Price> prices)
{
if (prices == null)
throw new IllegalArgumentException("The prices field in the " + frameType.getId() + " frame may not be empty.");
if (prices.size() == 0)
prices.add(new Price(Currency.USD, "0.00"));
// see if the price contains dupl... |
b4f16925-4359-4033-a047-83b52fcefdbb | 2 | @Override
public Object load(){
Object model=null;
PreparedStatement stmt = null;
ResultSet rs = null;
XStream xStream = new XStream(new DomDriver());
try {
//TODO change query
String query = "select games from GameModel";
stmt = db.getConnection().prepareStatement(query);
rs = stmt.executeQuery(... |
4ab9ea10-23b4-4ec3-a182-7503b36fb842 | 4 | protected void renderHealthbars(Rendering rendering, Base base) {
if (health.dying()) return ;
final BaseUI UI = (BaseUI) PlayLoop.currentUI() ;
if (
UI.selection.selected() != this &&
UI.selection.hovered() != this &&
healthbar.level > 0.5f
) return ;
healthbar.level = ... |
f2bbca36-fe43-4bc1-8fed-4057ca19794f | 5 | @Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ShowTiming)) {
return false;
}
ShowTiming other = (ShowTiming) object;
if ((this.id == null && other.id != null... |
10caf7bf-02f5-4ba9-890b-42b83fec1af2 | 6 | private void LayDuLieu() {
try {
//lay thong tin ve khoa
if (cboKhoa.getItemCount() > 0) {
cboKhoa.removeAllItems();
}
ResultSet rsKhoa = kBLL.LayTTKhoa();
while (rsKhoa.next()) {
String khoa = rsKhoa.getString(2);//2 tu... |
c2d0d65f-b175-4b86-b269-2006f9fc0072 | 3 | @Override
protected void init() {
try {
final List<ColumnMetaData> cmds = ParserUtils.buildMDFromSQLTable(con, getDataDefinition(), this);
addToMetaData(cmds);
if (cmds.isEmpty()) {
throw new FileNotFoundException("DATA DEFINITION CAN NOT BE FOUND IN THE ... |
582a2965-6ff6-4e4a-9311-94a4be6d4229 | 2 | public void markRestrictionAsDone(String identifier)
{
//Check that it exists
for(Restriction r: restrictions){
if(r.getIdentifier().equals(identifier))
{
r.check();
return ;
}
}
//If we make it here, there's no ... |
26a03915-5d48-45c1-9854-c457d2276f00 | 2 | public static AccessModesEnumeration fromValue(String v) {
for (AccessModesEnumeration c: AccessModesEnumeration.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
} |
ef055a7a-8c30-47eb-a136-e25081c366c2 | 6 | public Enemy() {
super(0, 0);
initialDirection = Util.random(1, 4);
int greenCondition = 10;
int condition = Util.random(0, 100);
if (Math.max(greenCondition, condition) == greenCondition || greenCondition == condition) type = GHOST_IMMORTAL;
else type = GHOST_KILLABLE;
... |
b97dd119-7054-4705-85fb-15c10724c07e | 7 | public void paint(Graphics g) {
Dimension size = getSize();
Color colors[] = null;
if (isEnabled()) {
if (getModel().isArmed() && getModel().isPressed()) {
colors = AbstractLookAndFeel.getTheme().getPressedColors();
} else if (getMo... |
4294ab0e-482f-4e07-8b75-7ac8239fe6ff | 5 | private void getMusicbrainzIds(List<MusicbrainzAlbum> primaryAlbumMidList) {
for (MusicbrainzAlbum iterator : primaryAlbumMidList) {
GenericUrl url = new GenericUrl(
"https://www.googleapis.com/freebase/v1/topic"
+ iterator.getMid());
url.put("filter", "/common/topic/topic_equivalent_webpage");
u... |
a3eb4f20-4231-4a02-a51b-2591f797eb78 | 3 | private void placeIdentityDiscs() {
while (getIdentityDiscCoverage() < coverage) {
int randomX = (int) Math.round(Math.random() * grid.width);
int randomY = (int) Math.round(Math.random() * grid.height);
IdentityDisc idDisc = new IdentityDisc(new Position(randomX, randomY));
if (grid.validPosition(idD... |
e351b7eb-6a12-4c96-9993-043281d2353f | 8 | public QryResult evaluateBoolean (RetrievalModel r) throws IOException {
// Initialization
allocDaaTPtrs (r);
QryResult result = new QryResult ();
// Sort the arguments so that the shortest lists are first. This
// improves the efficiency of exact-match OR without changing
// the result.... |
19eda772-5a3a-4003-a689-4a0e39547de1 | 6 | public void run() {
draw();
while (true) {
int direct = -1;
// System.out.println("Need next");
direct = drop.take();
if (direct == -1)
continue;
if (!move(direct))
continue;
... |
ae43b8d3-98e9-4875-b55c-2e1ab1d31885 | 0 | @Override
public String getName() {
return name;
} |
6f464e37-00a5-4228-946f-ef374fdc6e58 | 2 | private List<Port> getRandomPorts(List<Port> defaultPorts) {
ArrayList<Port> randomPorts = new ArrayList<Port>(defaultPorts);
List<String> randomPortNames = ModelDefaults.getDefaultPortNames();
randomizeList(randomPortNames);
for(int i = 0; i < randomPorts.size(); i++) {
String name = randomPortNames.get(i);... |
009695df-c205-4397-84cf-da8fe5f963b2 | 1 | public TableDescription getTableDescription(String tableName) throws DataBaseTableException {
Table table = tableHashMap.get(tableName);
if (table == null) {
throw new DataBaseTableException("no such table");
}
return table.getTableDescription();
} |
eebf61de-7e7a-4169-83fd-819b3bacc330 | 4 | public GHRelease getLastReleases()
{
GHRelease versions = null;
for(GHRelease release : releases)
if(!release.isDraft() && (versions == null || Updater.isVersionGreater(versions.getTagName(), release.getTagName()) > 0))
versions = release;
return versions;
} |
225bd750-6cec-4fdc-80d5-94143fda7f65 | 7 | @Override
public void drop(DropTargetDropEvent dtde) {
System.out.println("DROPHANDLER: drop");
System.out.println("original: "+Main.orig);
CardHolder c_original = null ;
boolean success = false;
Component destination = null;
if (dtde.isDataFlavorSupported(PanelDataFlavor.SHARED_INSTANCE)) {
Transferabl... |
b5944b5e-8bc2-4fdf-a218-263444969097 | 1 | public static double[] clone( double[] vector )
{
int m = vector.length;
double[] res = new double[m];
for ( int i = 0; i < m; ++i )
{
res[i] = vector[i];
}
return(res);
} |
c49b426b-f8b0-48af-9329-bfb3e726ce9d | 3 | @SuppressWarnings("unchecked")
public static <TSource, Value> Comparable<Value> max(Iterable<TSource> iterable, Func1<Comparable<Value>, TSource> selector) {
Comparable<Value> maxVal = null;
for (TSource tSource : iterable) {
Comparable<Value> comparableVal = selector.call(tSource);
if (maxVal == null) maxVa... |
2d420a06-9768-4168-92d4-bde0ecf78aa4 | 6 | @Override
public boolean isValid(File file) {
if (globIncludeFilters.size() > 0) {
boolean matchFound = false;
for (int i = 0; i < globIncludeFilters.size(); i++) {
GlobFilenameFilter filter = (GlobFilenameFilter) globIncludeFilters.get(i);
if (filter.accept(file)) {
matchFound = true;
break;... |
26f902ce-567a-450e-856d-500a76383c83 | 6 | public int findSubstring( char[] W )
{
// starts with the root's son that has the first character of W
// as its incoming edge first character
Node node = findSon( root, W[0] );
int k,j = 0, nodeLabelEnd;
// scan nodes down from the root until a leaf is reached or the
// substring is found
w... |
d1b8cc5e-238d-4211-ad46-c5dee77ab58c | 4 | public static void main(String[] args) {
// String ip = JOptionPane.showInputDialog("ip:");
// String name = JOptionPane.showInputDialog(":");
//// new Client(ip, playerName, tankName, tankSpeed, bulletSpeed, bulletDamage)
// Client c =new Client(ip,name,"OZTANK",4,6,3);
// Thread th = new Thread(c);
// th.... |
d51c5519-7672-45ea-bc37-06823c5bc2fb | 1 | public StructuredBlock[] getSubBlocks() {
return (subBlock != null) ? new StructuredBlock[] { subBlock }
: new StructuredBlock[0];
} |
300945f5-7fb0-47d1-93e7-c686efd2301d | 9 | public void searchResults (final SearchMode mode, final EdictDictionary dictionary, final List<Integer> resultIndices) {
final Color backgroundColour = this.resultBackgroundColours.get (dictionary.getFilename());
if (mode != this.lastSearchMode) {
if (this.lastSearchMode != null) {
this.edictDocument.addBl... |
f8f1c13c-4c6e-43c4-a610-fbc1b9423a6d | 4 | public void resisted(Type primary, Type secondary)
{
int counter =0;
for (int i =0; i<resistantTypes.length; i++)
{
if(resistantTypes[i].equalsTo(primary.showType()) || resistantTypes[i].equalsTo(secondary.showType()))
{
counter ++;
}
... |
c4caacb2-6816-4632-88ff-1a7c2f53a5ec | 1 | public static void main(String a[]){
int[] input1 = {2,3,6,6,8,9,10,10,10,12,12};
int[] output = removeDuplicates(input1);
for(int i:output){
System.out.print(i+" ");
}
} |
8452a541-1872-42ee-9205-fb046a15532e | 0 | public void move(int x, int y)
{
int newX = this.GetX() + x;
int newY = this.GetY() + y;
this.SetX(newX);
this.SetY(newY);
} |
d103d6f9-ac3f-48ce-a2ad-aadcefe60eaf | 5 | public Record(List<Integer> values) {
if (values.size() == 0)
throw new IllegalArgumentException("value list empty.");
if (values.size() > 256 * 16)
throw new IllegalArgumentException("value list size " + values.size() + " too large.");
int numLoops = (1 + (values.size() - 1) / 16) % 256;
i... |
811f9e1b-37f0-4e20-9607-1beaceccb08f | 3 | public String toHeader() {
String txt = "";
switch (locType) {
case LATLONG:
txt = "Location" + delim + "Latitude" + delim + "Longitude";
break;
case NORTHINGEASTING:
txt = "Location" + delim + "Northing" + delim + "Easting";
... |
c2051b7d-a591-4047-b0a7-4c59b12ea3b3 | 7 | public HashMap<Integer, ArrayList<Mission>> listeMissionsDangersImminents() {
HashMap<Integer, ArrayList<Mission>> missionsDangersImminents = new HashMap<Integer, ArrayList<Mission>>();
for (int i = 0; i < colonnes; i++) {
for (int j = 0; j < lignes; j++) {
if (monstre == Mon... |
378bb38b-f603-467c-b963-c9b0f50d52c8 | 6 | protected void fixAfterInsertion(Node<T> node) {
while (getColor(node.getParent()) == NodeColor.RED) {
if (node.getParent() == node.getParent().getParent().getLeft()) {
Node<T> temp = node.getParent().getParent().getRight();
if (getColor(temp) == NodeColor.RED) {
setColor(node.getPar... |
5518b1b0-c4ac-49bf-aa92-39066fe527ba | 0 | private void centerFrame(){
Toolkit tk = Toolkit.getDefaultToolkit();
Dimension screenSize = tk.getScreenSize();
int screenHeight = screenSize.height;
int screenWidth = screenSize.width;
setSize(screenWidth / 2, screenHeight / 2);
setLocation(screenWidth / 4, screenHeight / 4);
} |
e85f8b61-5ec8-4448-9124-169461ee4b35 | 1 | public static void printHash(HashMap<String, Integer> hashMap) {
System.out.println("Print HashMap");
Set s = hashMap.entrySet();
Iterator it = s.iterator();
while (it.hasNext()) {
Map.Entry m = (Map.Entry) it.next();
System.out.println(m.getKey() + "\t" + m.getValue());
}
} |
ac982d90-893c-4cf5-a391-3cb43868b374 | 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... |
dcd2f743-ed3d-41fa-b33c-8c1bb9a1eb26 | 5 | @SuppressWarnings("deprecation")
public String findItemName(ItemStack item) {
// Used to find the name in the config so we can grab data of off it.
int dataValue = item.getDurability();
if (plugin.getResManager().shouldIgnoreDataValue(item) || item.getDurability() == 0) {
dataValue = -1;
}
for (String n... |
5c08a4b4-6e6f-481f-9fac-066d043ca8a6 | 4 | public UsuarioBean getFromRegister(CensoBean oCenso, UsuarioBean oUsuario) throws Exception {
try {
oMysql.conexion(enumTipoConexion);
//comprueba qe el dni existe en la tabla censo
String strId = oMysql.getId("censo", "dni", oCenso.getDni());
//si no existe te re... |
09c1cbae-b1b7-4ec2-9616-61f2aa3a7576 | 4 | public Main() {
e = new Engine("Test", 640, 480);
e.teleportEntity(e.findEntityGlobal(1), new Node(350, 60) );
e.moveEntity( e.findEntityGlobal(2), new Node(350, 350) );
//e.moveEntity( e.findEntityGlobal(1), new Node(250, 250) );
//e.translateEntity( e.findEntityGlobal... |
ac6c63b6-aacd-4991-88d8-22991d2052c8 | 7 | @Override
public void execute(JobExecutionContext context)
throws JobExecutionException {
HashMap<String, String> newIpAddresses = new HashMap<String, String>();
try {
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
while (interfaces.hasMoreElements()){
NetworkInte... |
98e1ec75-dcc8-4322-8ef6-5f96b282fc8a | 5 | public void load() {
synchronized (options) {
try {
options.load(new FileInputStream("timers.conf"));
synchronized (timers) {
timers.clear();
for (Object key : options.keySet()) {
String str = key.toStrin... |
881e5e42-5b86-4903-a9b4-a584b3a516f8 | 0 | @Test
public void test() {
// should write out "acaag"
System.out.println(Strings.lrs("aacaagtttacaagc"));
} |
1841c428-57b9-4578-99c0-e7ed7c130794 | 1 | public void put(String key, String word) {
List<String> current = get(key);
if (current == null) {
current = new ArrayList<String>();
super.put(key, current);
}
current.add(word);
} |
cec53863-57cc-48f1-9dd2-0d68e8ef97e8 | 3 | private void addObjectToNewRenderList(ArrayList<ArrayList<Renderable>> newList, Renderable r)
{
if(r == null || r.getTextureObject() == null)
return;
if(!batch.contains(r.getTextureObject()))
{
batch.addTexture(r.getTextureObject());
newList.add(new ArrayList<Renderable>());
}
newList.get(batch.g... |
999c0b52-55fc-48c0-b2f9-c5fa7cb8a8a3 | 1 | private int getCount(T item) {
if(histogram.containsKey(item))
return histogram.get(item);
return 0;
} |
efb6bfad-27eb-479e-a25b-252a8fbd65d8 | 0 | public void setFolderPath(String folderPath) {
this.folderPath = folderPath;
} |
99c845c4-ea9f-4726-8064-98551b4fadee | 8 | private void emitLoadOrStore(int opcode, int a, Adda address) throws Exception {
Value v = address.getArg1();
int b, c;
if(v instanceof Immediate) {
c = ((Immediate)v).getValue();
opcode = opcode - 1;
v = address.getArg2();
if(v.equals(Type.getGBP(... |
0040e7ad-29bf-4e15-a257-f55458950183 | 0 | public void setFiledName(String filedName) {
this.filedName = filedName;
} |
18ad9cc7-9a21-498a-a472-393f10c463c7 | 8 | public boolean stateEquals(Object o)
{
if (o==this) return true;
if (o == null || !(o instanceof MersenneTwister))
return false;
MersenneTwister other = (MersenneTwister) o;
if (mti != other.mti) return false;
for(int x=0;x<mag01.length;x++)
if (ma... |
9731fedf-d737-45a0-92d9-df9eb1575171 | 3 | public static Map getMapFromString(String unparsed){
//System.out.println("Getting map for " + unparsed);
UnparsedConfigurationData data = null;
try{ data = new UnparsedConfigurationData(unparsed); }
catch(Exception e){}
if(data == null) return null;
String gameType = data.getString("GameType");
GameType ... |
8d485b46-12b3-4a06-9a95-650d188e212c | 5 | private void deepSearch(int maxdepth, Vector<Integer> Row)
{
//Argumente: maxdepth: maximale Tiefe im Baum, root = 0
//Row: repraesentiert den aktuellen Weg durch den Baum
//Pruefen ob Tiefe ueberschritten wurde
if(Row.size() > maxdepth)
{
return;
}
//Position des aktuellen Knotens
float[] nod... |
51de749a-d3d3-4be9-93c5-48eca2b2412e | 5 | private static void simulate(Graph g, RandomGenerator rand, int nRequests, final FoldingPolicy foldingPolicy, final RoutingPolicy routingPolicy, final boolean bootstrap) {
int successes = 0, disconnectedFolding = 0, disconnectedBootstrap = 0, totalPathLength = 0;
for (int i = 0; i < nRequests; i++) {
final Simp... |
e9627d4e-3a65-4697-90a7-f7e142e1123e | 1 | private void renderItemList() {
int startPointXCoordinate = 10;
int startPointYCoordinate = 50;
for (int i = 0; i < items.size(); i++) {
int xCoordinate = startPointXCoordinate;
int yCoordinate = startPointYCoordinate + (i * 60);
renderItemOption(i, items.get(i), new Position(xCoordinate,
yCoordinat... |
8e635f24-6076-4832-a76e-3561b57c8d59 | 7 | private boolean conditionCH1(String value, int index) {
return ((contains(value, 0, 4, "VAN ", "VON ") || contains(value, 0,
3, "SCH")) ||
contains(value, index - 2, 6, "ORCHES", "ARCHIT", "ORCHID") ||
contains(v... |
d733a412-4957-4695-981e-b96af525bf73 | 1 | public static void imprimirarray(){
Iterator it=array.entrySet().iterator();
while(it.hasNext()){
Map.Entry e=(Map.Entry)it.next();
System.out.println(e.getKey()+";"+((Producto)e.getValue()).getDesc()+";"+((Producto)e.getValue()).getStock()+";"+((Producto)e.getValue()).getPrecio());
}
} |
3e1c08fd-77b6-4251-9bb1-e4afe48b9f60 | 1 | @Override
public void updateImage()
{
//we will update animation when delay counter reaches delay, then reset delay counter
delayCounter++;
if(delayCounter>delay)
{
delayCounter=0;
frameNumber++;//updates frame to next frame
frameNumber%=totalFrame;// if surpass 3rd frame, back to frameNumber 0
//set... |
5a58ce0d-5d41-4b89-adbb-c4c2152ca0fe | 3 | private void sortBestTimes() {
for (int j = 0; j <= 3; j++) {
for (int i = j + 1; i <= 4; i++) {
if (bestTimes[j] > bestTimes[i]) {
int temp = bestTimes[i];
bestTimes[i] = bestTimes[j];
bestTimes[j] = temp;
}... |
0b9d28d1-e3cf-4bf1-b7b4-72728366d554 | 2 | public boolean readyForUpdates() {
if(TCPServerManager != null)
{
return TCPServerManager.readyForUpdates;
}
if(tcpClient != null)
{
return tcpClient.readyForUpdates;
}
return false;
} |
ecd23a3c-73a0-41e7-9470-a6cc66470389 | 2 | private void addProductions(Collection productions) {
Iterator it = productions.iterator();
if (!it.hasNext())
return;
GrammarTableModel model = table.getGrammarModel();
int min = 1000000000, max = 0;
while (it.hasNext()) {
Production p = (Production) it.next();
int row = model.addProduction(p);
m... |
d8002f00-7a80-4eb6-bf81-4f34ac9bacff | 0 | public void setImage(Image img) {
image = img;
} |
13540be4-5711-4209-9ff7-8badf4ee5e1a | 9 | private void connectNounInstanceToRule(int fromInstance, double weight,
int toStart, double dynamicWeight, CABot3Net ruleNet) {
for (int iSet=0 ; iSet < instanceCounterSets; iSet++) {
int fromStart = fromInstance * nInstCASize;
// for each neuron in the body 40 excitatory neurons
// half of ... |
9dbf01e9-59ab-4cee-8bbe-90a3f9377bae | 0 | public String getDestinationStation() {
return this._destinationStation;
} |
a37dc2c9-03fd-43f7-af1d-1445fb91873a | 2 | public MCQOption[] getModel(int Question_ID) {
/**
*get mcqOPtions for a question
* @param Question_ID
* @return
*/
ArrayList<MCQOption> mCQOptions=new ArrayList<MCQOption>();
try {
StringBuffer sql = new StringBuffer("");
sql.append("SELECT M... |
91e751bf-f40a-43b6-bdb2-aa49edc26029 | 1 | @Override
public int deleteCustomer(int id) {
Customer customerWithId = dao.findById(id);
if(customerWithId!=null)
dao.delete(id);
return dao.checkCount();
} |
af8249ad-9c29-4d10-917b-fe829270e913 | 0 | public void setAmount(double amount) {
this.amount = amount;
} |
f1eb75a3-c56a-4d64-acc5-e3612680c365 | 6 | @Override
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException {
if (qName.equals("intelligenceBonus"))
attributeEnhancer = new IntelligenceBonus();
else if (qName.equals("memoryBonus"))
attributeEnhancer = new MemoryBonus();
else if (qName.equals("char... |
cf58d88f-8d55-4be7-8c1f-49e13922e982 | 2 | public void listaTabela() {
UsuarioBO funcionarios = new UsuarioBO();
if (userLogado.getTipo().equals("Diretor")) {
try {
tbResultadoBusca.setModel(DbUtils.resultSetToTableModel(funcionarios.tabeleaFuncionarios()));
} catch (SQLException ex) {
}
... |
836d92e4-9f18-4f52-872a-9e567b9b0abb | 1 | public static void quickSort(int[] array,int start,int end){
if(start < end){
//int mid = partition(array, start, end); //get the position of the prvit
int mid = randomized_partiton(array,start,end);
quickSort(array,start,mid-1); // sort the left
quickSort(array,mid+1,end); // sort the right
}
... |
0301d946-9300-4184-95a4-290eacaa70cd | 2 | public void build() {
// Build tree
if (verbose) Timer.showStdErr("Building interval forest");
config.getSnpEffectPredictor().buildForest();
if (verbose) Timer.showStdErr("done.");
} |
2a639a85-7b91-4ac7-849f-017b25b33737 | 5 | @Override
public boolean execute(CommandSender sender, String identifier,
String[] args) {
String titleId = args[0];
String title = "";
try {
title = DBManager.getTitleFromId(titleId);
} catch (Exception ex) {
plugin.getLogger().log(Level.SEVERE,
"Failed to assign title to variable", ex);
ret... |
c2dfba8c-af25-40c1-a713-9d6c30c2cee0 | 8 | public Point checkTileCollision(Rectangle rect) {
int fromTileX = pixelsToTiles(rect.getMinX());
int fromTileY = pixelsToTiles(rect.getMinY());
int toTileX = pixelsToTiles(rect.getMaxX() - 1);
int toTileY = pixelsToTiles(rect.getMaxY() - 1);
for (int x = fromTileX; x <= toTileX; x++) {
for (int y = from... |
e0c2ad26-4c3f-477a-bdd7-b9ed894fd5b6 | 1 | public void aconst(final Object cst) {
if (cst == null) {
mv.visitInsn(Opcodes.ACONST_NULL);
} else {
mv.visitLdcInsn(cst);
}
} |
bad9f888-e0ee-455c-b495-cc149572015e | 5 | @Test
public void testClientMessaging() {
System.out.println("testClientMessaging");
try {
assertTrue(c.registerToServer(GlobalConstants.IP_LOOPBACK));
} catch (Exception ex) {
fail("Registration from client to server failed - " + ex);
}
s.getListene... |
301af0f8-3244-434d-80bb-1e5fa5450554 | 6 | public static void main(String args[]) {
//<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://download.oracle.com/javas... |
79312327-25e9-4c0d-823e-867d98d0efef | 1 | public void test_now_nullDateTimeZone() throws Throwable {
try {
DateMidnight.now((DateTimeZone) null);
fail();
} catch (NullPointerException ex) {}
} |
5587c1dc-39f0-4e38-bb64-10f4e0deb13f | 4 | private void appendFrameTypes(final boolean local, final int n,
final Object[] types) {
for (int i = 0; i < n; ++i) {
Object type = types[i];
AttributesImpl attrs = new AttributesImpl();
if (type instanceof String) {
attrs.addAttribute("", "type", "type", "", (String) type);
} else if (type instanc... |
c202ba5e-2380-4cfa-ade3-2eb4e17438f0 | 4 | @Test
public void testTranslation() {
for(int verticesInShard=10; verticesInShard < 1000000; verticesInShard += 100000) {
for(int numShards=(10000000 / verticesInShard + 1); numShards < 100; numShards += 13) {
VertexIdTranslate trans = new VertexIdTranslate(verticesInShard, numSh... |
8b58c459-964f-43ca-b2b6-8e0f0e5b4561 | 6 | public Lista merge(Lista lista,int init1,int end1,int init2,int end2){
mergeSortL ms = new mergeSortL();
int i =0;
int li=0;
int ri=0;
ri=init2;
while(i<end2){
if((li<(end1)) &&(ri<end2)){
Node l1= lista.getHead();
Node... |
7aff36a4-bbd9-4abe-b760-c15bbce3690f | 2 | public static String find(String line) {
if (line.contains("נטיות")) {
return "";
}
line = line.replace("דרך תצורה=", "");
line = line.trim();
pattern = Pattern.compile("\\{\\{משקל\\|[^\\}]*\\}\\}", Pattern.UNICODE_CASE);
matcher = pattern.matcher(line);
... |
00278b7b-4a46-463b-a3fd-717f6c64650c | 3 | private void berekenMensualiteit() {
if (maandPercentage != null && startKapitaal != null && aantalMaanden != 0) {
mensualiteit = Calculate.berekenMensualiteit(startKapitaal, maandPercentage, aantalMaanden);
mensField.setText(mensualiteit.toString());
}
calculateTablesAndTotals();
} |
7e9177f5-0955-4c08-a227-9d03020a9585 | 2 | public Card getCard(int position) {
if (position >= 0 && position < vHand.size())
return (Card)vHand.elementAt(position);
else
return null;
} |
bd665dc1-f716-4362-8c55-a45050ca8309 | 8 | @Override
public void render(Graphics g) {
g.drawImage(texture,
(int) x + Tile.SIZE / 4, (int) (-yoffset / 8 + y + Tile.SIZE / 4), (int) x + Tile.SIZE / 4 * 3, (int) (-yoffset / 8 + y + Tile.SIZE / 4 * 3),
0, 0, texture.getWidth(null), texture.getHeight(null), null);
if (up && yoffset < 32) {
yoffset++;... |
b419e07d-13c2-4ecc-8904-985e437088be | 5 | private String searchGameDetails(String str) {
String tmp = null;
int start = str.indexOf("<div class=\"details_block\">");
if (start >= 0) {
tmp = str.substring(start);
int end = tmp.indexOf("</div>");
if (end >= 0) {
tmp = tmp.substring(0, end + 6);
}
start = tmp.indexOf("<b>") + 3;
end = ... |
9e8e611d-eaab-4619-ac96-c2ee5f0b1077 | 2 | private void loadFile() {
try {
Scanner s = new Scanner(indexFile);
s.useDelimiter("\n");
while(s.hasNext(entryPattern)) {
s.next(entryPattern);
MatchResult match = s.match();
map.put(match.group(1), match.group(2));
}
} catch (FileNotFoundException e) {
// Nothing to load, which ... |
d53e71e4-f6e4-424e-abf0-d2c959f37967 | 2 | public static boolean isPlate(int itemID)
{
for (int i=0; i<platebody.length; i++)
if (platebody[i] == itemID)
return true;
return false;
} |
e561595d-4bce-45b3-acd1-3b3929273fcb | 1 | public void setSteinOnPosition(Steinchen s, int pos){
if(field.get(pos) == null){
//Stein setzen
field.get(pos).add(s);
//neue Position des Steins
s.setPos(pos);
}
} |
9421feaa-e860-4a6d-9a73-f3ab7410c845 | 9 | public synchronized void run()
{
try
{
while (Thread.currentThread() == reader)
{
try
{
this.wait(100);
}
catch (InterruptedException ie)
{
}
if... |
9560ed43-4429-4f99-863b-7dbc77d2d7f8 | 8 | @Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if((affected==null)||(!(affected instanceof MOB))||(invoker==null))
return true;
final MOB mob=(MOB)affected;
if(msg.amISource(mob)
&&(CMLib.dice().rollPercentage()>(mob.charStats().getStat(CharStats.STAT_DEXTERITY)-(getXLEV... |
3813844a-f6b7-420e-a533-fa235cb70736 | 3 | public void open( boolean readOnly )
throws ReadOnlyException,
IOException {
if( !readOnly )
throw new ReadOnlyException( "This DirectoryResource implementation only supports read-only access at the moment." );
if( this.inputStream != null )
throw new IOException( "Cannot re-open Directory... |
0e5a367e-e3cc-4f82-b8b0-91dd2570a5ef | 3 | private BrewAction mapStep(JsonObject step) {
switch (step.getString("type").toLowerCase()) {
case "addingredient":
return new AddIngredient(unmarshalIngredient(step.getJsonObject("ingredient")));
case "changetemperature":
return new ChangeTemperature(unma... |
e8c72bb5-de44-4795-ad97-79ef10c5dc74 | 3 | private void checkConnectedPrinters() {
for (int i = 0; i < 3; i++) {
String usbId;
byte[] array = new byte[32];
int returnedVal;
if (i == 0) {
returnedVal = eZioLib.FindFirstUSB(array);
usbId = new String(array).trim();
... |
dc9e79cb-e0ed-404f-9922-66ea4575f381 | 5 | private boolean direction(int dayOfTheMonthT, int monthT, int yearT, int dayOfTheMonth, int month, int year){
boolean test = true;
boolean direction = false;
if(year>yearT){
direction = true;
}
else{
if(year<yearT){
direction = false;
... |
bae3dc31-93ce-48ff-99e5-d3514a648cdb | 1 | public void visitThrowStmt(final ThrowStmt stmt) {
if (CodeGenerator.DEBUG) {
System.out.println("code for " + stmt);
}
stmt.visitChildren(this);
genPostponed(stmt);
method.addInstruction(Opcode.opcx_athrow);
} |
5090cabd-fa78-474d-b0d0-3d75c6d9114f | 3 | public char skipTo(char to) throws JSONException {
char c;
try {
long startIndex = this.index;
long startCharacter = this.character;
long startLine = this.line;
this.reader.mark(1000000);
do {
c = this.next();
if... |
4b14f8a2-be61-4109-bcf7-45589db08819 | 5 | private static void skipWhitespace() {
char ch=lookChar();
while (ch != EOF && Character.isWhitespace(ch)) {
readChar();
if (ch == '\n' && readingStandardInput && writingStandardOutput) {
out.print("? ");
out.flush();
}
ch =... |
8d157647-b447-4fd2-80ac-773493724cc0 | 0 | public void addMouseListener(MouseListener mouseListener)
{
super.addMouseListener(mouseListener);
timeButton.addMouseListener(mouseListener);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.