method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
ec57aaea-656c-47e0-9dc7-ed4c16f63d37 | 9 | private void export(boolean b) throws IOException
{
int result = jfc.showSaveDialog(drawComponent1);
if(result == JFileChooser.APPROVE_OPTION)
{
File file = jfc.getSelectedFile();
String datatype = "";
if(jfc.getFileFilter().getDescription().equals("SVG-Dateien"))
{
datatype = ".svg";
}
el... |
5610dac6-8858-4f0d-8db6-eb3d0670a186 | 8 | @Override
public void setRiding(Rideable ride)
{
final Rideable amRiding = riding();
if ((ride != null) && (amRiding != null) && (amRiding == ride) && (amRiding.amRiding(this)))
return;
if ((amRiding != null) && (amRiding.amRiding(this)))
amRiding.delRider(this);
riding = ride;
if ((ride != null) && (... |
a1342d3b-99d8-4098-8cb6-13b8f0b04dd3 | 1 | private void setWords(){
words = new ArrayList<Word>();
Iterator<Word> iterator = Main.getListAllWords().getList().iterator();
while(iterator.hasNext()){
words.add(iterator.next());
}
progressBar.setMaximum(words.size());
Collections.shuffle(words);
nu... |
4993889d-b4f5-4e5e-8c9f-d545b9d24bf2 | 6 | public static void simplifySolve(Node node) //simplifies all solvable child nodes
{
if(node.child.size() == 0) //leaf nodes would be values, so no simplification needed
{
return;
}
else if(node.child.size() == 1 && !node.data.equals("-") && node.data.charAt(0) != '&'... |
e95a0288-2f1e-4b08-bf18-2dd12386ff18 | 7 | public static ArrayList<String> getTextSection(ArrayList<String> text, int sectionID) {
ArrayList<String> section = new ArrayList<String>();
int lineBegin = 0;
int lineEnd = 0;
// detect the beginning and the end of the section
for (int i = 0; i < text.size(); i++) {
String str = text.get(i);
if ... |
2d2b9f62-5015-4a5c-818b-ce0b0b6a773b | 6 | public void cargarListaUsuarios(){
FileInputStream archivo=null;
ObjectInputStream flujo=null;
Usuario usuario;
// Se crean los elementos necesarios
try{
archivo=new FileInputStream("listaUsuarios");
flujo=new ObjectInputStream(archivo);
... |
73affe72-03a4-4158-b466-72eb14c3dc6b | 0 | @Column(name = "PCA_SECUEN")
@Id
public Integer getPcaSecuen() {
return pcaSecuen;
} |
780efd7d-efc4-4496-afba-1cb561b7b6f6 | 5 | private boolean redirectForLogin(HttpServletRequest servletRequest) {
String uri = servletRequest.getRequestURI();
return uri.endsWith(".jsp") || uri.endsWith("/carrinho") || uri.endsWith("/carrinho/") || uri.endsWith("/carrinho/main")
|| uri.endsWith("/carrinho/cad_lista")|| uri.endsWi... |
0c769f8d-851c-4b69-8373-990756629b2d | 0 | @Override // Note this will use the natural reverse order sort of Rank
public int compareTo(Card that) {
return this.rank.compareTo(that.rank);
} |
28be8a1e-34cc-45e7-b6bc-5c8e225b7a34 | 1 | public final void checkNewDay() {
GregorianCalendar today = new GregorianCalendar();
today.setTime(Config.getDate());
today.set(GregorianCalendar.HOUR, 0);
today.set(GregorianCalendar.MINUTE, 0);
if (date.before(today)) {
date = new GregorianCalendar();
// Set all counters to zero
setNew();
}
} |
7e820afb-d9af-4d2c-bcb3-c58848472a30 | 7 | public static JavaVersion get(int majorVersion) {
switch (majorVersion) {
case 0x2D:
return JDK1_1;
case 0x2E:
return JDK1_2;
case 0x2F:
return JDK1_3;
case 0x30:
return JDK1_4;
case 0x31:
return J2SE5_0;
... |
03760c20-bad7-44a7-b29d-fd3d2070bcb1 | 0 | public Angle getAngle() {
return angle;
} |
19d2949c-fb40-4cd8-991d-1ed2e3e257e3 | 8 | public static ListNode swapPairs(ListNode head) {
if (head == null)
return null;
if (head.next == null)
return head;
ListNode newHead = null;
boolean start = true;
;
ListNode first;
ListNode second;
ListNode thrid;
ListNode last = null;
while (head != null && head.next != null) {
first = ... |
ff72cf27-622e-43f9-8068-ed45a2ed7b7b | 2 | private int getMax() {
int max = -Integer.MAX_VALUE;
for(int i = 0; i < data.length; i++) {
if(data[i] > max)
max = data[i];
}
return max;
} |
6ee26f2b-d518-44ee-94ac-1772a4c48ff0 | 2 | private void createXml(List<WordWithCount> sortedList) throws IOException {
//refactoring mMaxCount to the value of the word at the 10% place (10% most freq)
int wordsCount = Math.min(mMaxWords, sortedList.size());
mMaxCount = sortedList.get((int)(0.05f * wordsCount)).getFreq();
mOutput.write("<?xml version=\"1... |
060793fa-46fe-42d0-b2d7-b4ace08a3c41 | 2 | public void fillActivitiesTable() {
activityService = ActivityService.getInstance();
List<Activity> activities = activityService.getActivities();
DefaultTableModel dtm = (DefaultTableModel) activitiesTable.getModel();
for (int i = 0; i < dtm.getRowCount(); i++) {
dtm.removeRow(i);
}
for (Activity activ... |
cabf40b3-f83d-45ce-91d8-094d15fc935c | 3 | public boolean sellBook(Book bookTOsell, int nrSellBooks, String buyer) {
int index = bookList.getBookList().indexOf(bookTOsell);
int remainingBook = bookList.getBookList().get(index).getQuantity()
- nrSellBooks;
bookList.getBookList().get(index).setQuantity(remainingBook);
Sell sale = sellFactory.creat... |
f2e162b9-cc36-48a7-8a25-16aa41b73dbe | 3 | private List<Release> getReleases(final Repository repository) throws IOException {
try {
return repoReleasesCache.get(repository.getName(), new Callable<List<Release>>() {
@Override
public List<Release> call() throws IOException {
... |
fbf5ae2a-36c0-497b-ab4a-924a0c25a22e | 2 | public void compile(String program) {
program = optimize(program);
jumpMarkers = new int[program.length()];
for (int i = 0; i < program.length(); i++) {
if (program.charAt(i) == '[') {
jumpMarkers[i] = i + extract(i, program).length() + 1;
}
}
... |
e5ef96a7-c8e4-4490-841e-78cb744765b8 | 4 | public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) {
int var6 = var1.getBlockMetadata(var2, var3, var4);
if(var6 > 0) {
double var7 = (double)var2 + 0.5D + ((double)var5.nextFloat() - 0.5D) * 0.2D;
double var9 = (double)((float)var3 + 0.0625F);
do... |
55e5cac8-fc52-4376-b60a-83057a57b5c0 | 5 | public static void main(String[] args) {
List<Integer> list = new ArrayList<>();
for (int i = 0; i < 100; i++) {
list.add((int) (Math.random() * 10));
}
PriorityQueue<Integer> threadQueue = new PriorityQueue<>();
threadQueue.addAll(list);
System.out.println("Waiting threads ...");
int c = 0;
for (Int... |
2aa565dd-3c61-46a3-a5aa-b5d74cfedf7a | 4 | public SMPLContainer visitStringExp(ASTSubstrExp st, SMPLEnvironment state) {
SMPLContainer strContainer = st.getString().visit(this, state);
SMPLContainer startContainer = st.getStart().visit(this, state);
SMPLContainer endContainer = st.getEnd().visit(this, state);
if (!"Stri... |
aaf14476-cff4-4daa-8643-467aa3064444 | 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... |
c2efd874-2219-4f36-ba7f-9b1c368127cb | 0 | public int getFirewallId1() {
return firewallId1;
} |
0e421651-9dd1-4a7f-937e-feddd886dc1b | 5 | void runServerThread(){
DataHandler handler = new DataHandler();
AckBroadcast ack_broadcast = null;
while(true){
Message op = null;
try{
op = queue.take();
}catch(InterruptedException e){
}
ack_broadcast = handler.InsertDataIntoServerStore(op);
if(ack_broadcast.getOriginal_client... |
18f36bf3-8bcb-4e74-abff-7550c0ab69fb | 8 | private static String escapeJSON(String text) {
StringBuilder builder = new StringBuilder();
builder.append('"');
for (int index = 0; index < text.length(); index++) {
char chr = text.charAt(index);
switch (chr) {
case '"':
case '\\':
... |
05812f93-1ee9-4138-a675-c2f466042c11 | 9 | public void start() throws IOException {
Replicator replicator = new ReplicatorImpl(serverStrings, me);
replicator.initialize();
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
while (true) {
System.out.print(">> ");
String input = in.re... |
f12a586d-c672-4a9c-93fb-3ef6940e1224 | 6 | public void setEditValue(int n, EditInfo ei) {
if (n == 0) {
flags = (ei.checkbox.getState())
? (flags | FLAG_INVERT)
: (flags & ~FLAG_INVERT);
}
if (n == 1 && ei.value > 0) {
r_on = ei.value;
}
if (n == 2 && ei.valu... |
5ff1ae36-2508-4ff8-b600-ae0209597f39 | 2 | private Collection<URL> buildURLs(Set<String> runtimeClasspathElements) throws ComponentConfigurationException {
List<URL> urls = new ArrayList<URL>(runtimeClasspathElements.size());
for (String element : runtimeClasspathElements) {
try {
final URL url = new ... |
5b7c6f62-4e07-4aa0-8eb2-a8ebf10d05c1 | 1 | private SourceDataLine getSourceDataLine(String fileName) {
try {
URL url = getClass().getResource(fileName);
inStream = AudioSystem.getAudioInputStream(url);
AudioFormat format = inStream.getFormat();
DataLine.Info info = new DataLine.Info(SourceDataLine.class, f... |
9a1442ba-ebc3-445d-b168-d2fddf8d4e1f | 5 | public Tree<T> findChild(T otherLabel) throws InvalidOperationException {
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// Implement this method.
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if (otherLabel == null){
throw new InvalidOperationException("Can't search for null");
}
... |
83c1eede-ee65-4ad7-ac5a-c48538a41d03 | 1 | public void initialize(Map map) {
for (MovingSquare movingSquare : movingSquares) {
movingSquare.initialize(map);
}
} |
6e6235f5-de46-474a-9960-6302949ee46d | 4 | public boolean isOverBtn(int x, int y) {
if(x > xLoc && x < xLoc + xSize) {
if(y > yLoc && y < yLoc + ySize) {
return true;
}
}
return false;
} |
946d6fe1-9a0b-4d6e-b33c-5fb0e3b54c97 | 5 | private static ArrayList<String> combineAllResults
(ArrayList<String> pseudographics, ArrayList<Integer> resultByDigits, boolean negativeSign, int divisorHasDigits) {
int res = resultByDigits.get(0);
for(int i = 1; i < resultByDigits.size(); i++){
res = res * 10 + resultByDigits.get(i);
}
if(negativeSign... |
987fe208-1a26-47ea-be3d-051b3fcd2f5f | 0 | protected java.util.Date getDateFromString(String dateStr) {
Calendar calendar = DatatypeConverter.parseDateTime(dateStr);
return calendar.getTime();
} |
b7637c0b-e4c5-4dac-9b9a-ed6046f979c1 | 0 | public CoffeescriptConfiguration( ColorManager colorManager ) {
this.colorManager = colorManager;
} |
1caa9435-ab4b-4861-a474-c29f57449d3f | 8 | private void makeNewLinks(){
ShapeNode retrievedShape = null;
ArrayList myList = new ArrayList();
String kind = null;
myList.addAll(this.nodes);
ShapeNode parent=new ShapeNode();
ShapeNode child = new ShapeNode();
// parent.setKind(node_type.LINK_NODE);
... |
2ee3a898-7be3-41ff-9141-3aaff50bda1e | 6 | public int[][] asIntegerGrid() {
int[][] grid = new int[2 * height + 1][2 * width + 1];
for(int y = 0; y < height; y++) {
for(int x = 0; x < width; x++) {
grid[2 * y + 1][2 * x + 1] = 1;
if(passable(x, y, Direction.UP )) { grid[2 * y ][2 * x + 1] = 1; }
if(passable(x, y, Direction.DOWN )) {... |
8343cbd3-d145-41ad-9f01-e89c84540105 | 7 | public int search(int[] A, int target, boolean isLow) {
int low = 0;
int high = A.length - 1;
while (low <= high) {
if (low == high && A[low] == target)
return low;
int mid = isLow ? (low + high) >>> 1 : ((low + high) >>> 1) + ((low + high) & 1);
... |
133c480c-2368-4488-8bea-424bb540af43 | 5 | */
public static void hideNativeCursor(boolean hide) {
hideNativeCursor = hide;
// Check if the the current mouse supports native cursors
// (if it allows for the creation and use of native cursors)
if ((Cursor.getCapabilities() & Cursor.CURSOR_ONE_BIT_TRANSPARENCY) == 0) {
System.out
.println("KouchK... |
d7634166-97a0-4f8f-8e51-07bcfc26609a | 2 | private void assignAsVillager(Player player) {
if (villagerCount > 0) {
player.setRole(Role.Villager);
villagerCount--;
} else if (mafiaCount > 0) {
player.setRole(Role.Mafia);
mafiaCount--;
}
} |
b487f164-ced3-4b29-8289-b0d4611c68a8 | 4 | @Override
public void endSetup(Attributes atts) {
// Set the Window Location.
// Get Main Window Dimension out of the prefs.
PreferenceInt pWidth = Preferences.getPreferenceInt(Preferences.MAIN_WINDOW_W);
PreferenceInt pHeight = Preferences.getPreferenceInt(Preferences.MAIN_WINDOW_H);
PreferenceInt pInitialP... |
3f40badf-dfad-44c4-b680-fe049fa9d6e3 | 7 | private void fireDMConListener(TypeEvent typeEvent, Exception e) {
java.util.List list;
synchronized (this) {
if (eventListeners == null) {
return;
}
list = (java.util.List) eventListeners.clone();
}
int size = list.size();
for ... |
edd18b78-41cf-4c91-9b3d-e596e63f9026 | 9 | private boolean formulaOK(Stock stock, ArrayList<EconomicIndicator> indicatorsTest,
ArrayList<Double> formula) {
//Will all indicators very high result in an unusable price?
double calcPrice = 0;
for (int i = 0; i < indicators.size(); i++){
calcPrice += indicatorsMin.get(i) * fo... |
0da26b8c-51b0-4355-af63-8ca744aa2433 | 8 | public static void generate(CellPattern pattern, Location gLoc){
int x = pattern.getCentralIndices().x;
int y = pattern.getCentralIndices().y;
Grid<Actor> gr = GridWorldLife.instance.world.getGrid();
CellState[][] states = pattern.getPattern();
if(x >= states[0].length || x < 0 || y >= states.length || ... |
88e68699-ebcb-4aec-a289-55237e5b9bf9 | 8 | protected String requestAccessToken(ApiConfiguration configuration)
throws AccessDeniedException
{
try
{
if (configuration.getAccessToken() != null)
{
return configuration.getAccessToken();
}
Form form = new... |
d56ea79a-e30e-498b-ac5a-e66e2a482d44 | 6 | public String nextCDATA() throws JSONException {
char c;
int i;
StringBuffer sb = new StringBuffer();
for (;;) {
c = next();
if (end()) {
throw syntaxError("Unclosed CDATA");
}
sb.append(c);
i = ... |
c92e0170-0c0f-4020-8984-d4f94a09876a | 5 | public int countAll(){
Connection con = null;
Statement stmt = null;
try {
DBconnection dbCon = new DBconnection();
Class.forName(dbCon.getJDBC_DRIVER());
con = DriverManager.getConnection(dbCon.getDATABASE_URL(),
dbCon.getDB_USERNAME(... |
fa10c3d8-9042-49b3-965c-f3fa0bb761f2 | 7 | private static void logic(int delta) {
ball.update(delta);
bat.update(delta);
for (Brick brick : bricks) {
if (ball.intersects(brick)) {
ball.setDY(Math.abs(ball.getDY()));
brick.setUsed(false);
brick.setX(0);
brick.set... |
5f42a3b5-49e2-4201-ad1f-950174202304 | 8 | public static void main(String[] args) {
ConsistentGlobalProblemSetInitialisation starter = new ConsistentGlobalProblemSetInitialisation();
starter.initLanguage(new char[] { 'a', 'b' }, 10, "[ab]*abab");
int solutionFoundCounter = 0;
int noSolutionFound = 0;
List<Long> cycleCount = new LinkedList<Long>();
... |
1be0ac1d-e969-4c12-9624-37ee6702e8c9 | 4 | public static boolean getIs64BitJVM() {
final java.lang.String keys [] = {
"sun.arch.data.model",
"com.ibm.vm.bitmode",
"os.arch",
};
for (java.lang.String key : keys ) {
java.lang.String property = System.getProperty(key);
i... |
cda9c7c0-a9fb-42e0-bcb2-1a4827a4c55f | 6 | public void drawFrame(Graphics g) {
switch (GS) {
case TITLE: // startup screen
titleScreen.draw(g);
break;
case GAME: //walking maps
xOffset = (int)player.getX();
yOffset = (int)player.getY();
area.draw(g, engine.width/2-xOffset, engine.height/2-yOffset);
player.draw(g, engine.width/2-xOffset, ... |
f785eff4-6b69-47ae-bdd5-a6acb72a597f | 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 fe... |
90f63002-6832-4de2-a7d4-4b389adaa29a | 5 | public static void menuVendas() {
Scanner input = new Scanner(System.in);
System.out.println("--------------------------------------------------------------------");
System.out.println("----------------------------- VENDAS -------------------------------");
System.out.println("---------... |
b2c4a360-f0ed-4615-9826-8d9096fee52b | 1 | public static int updateUtilisateur(int id, int idfonction, int idville, String nom, String prenom, String identifiant, String password) throws SQLException {
int result;
String query;
try {
query = "UPDATE UTILISATEUR set ID_FONCTION=?,ID_VILLE=?,UTILNOM=?,UTILPRENOM=?,IDENTIFIANT=?... |
7d026b46-1bfd-45e9-8399-9b6e45b2efe6 | 3 | public static void assureCorrectness(int iterations, StringSource src, StripAlgorithm... alg) throws Exception {
String answer;
System.out.print("Assuring that all algorithms are correct... ");
for (int i = 0; i < iterations; i++) {
String question = src.nextString();
ans... |
a9227881-9f8e-4bdb-88c4-df1811b62263 | 1 | */
public static CycAccess setCurrent(CycAccess access) {
currentCyc.set(access);
return access;
} |
da409c2f-4a45-4af8-9950-def9f0f853de | 4 | public String toString()
{
String ret = "";
if( colortype == COLORTYPERGB ) // rgb
{
ret = " rgb=" + colorstr;
}
else if( colortype == COLORTYPEINDEXED ) // indexed
{
ret = " indexed=" + colorval;
}
else if( colortype == COLORTYPETHEME ) // theme
{
ret = " theme=" + colorval;
... |
f02926c4-f904-48cc-bc4f-1b7cb6938f22 | 6 | public void EstraiFraseAnnoEsatto()
{
try {
PrintWriter writer = new PrintWriter(new FileWriter(heidelAnnoEsatto, false));
ArrayList<String> vals = new ArrayList<String>();
for (Document d : documents)
{
for (HeidelTerm ht : d.HeidelTerms)
{
if (ht.Tipo.equals("DATE")
&& ht.Valo... |
e73eebec-91ec-4539-ae94-bf9d27cc4bcb | 6 | public void actionPerformed(ActionEvent event){
if (event.getActionCommand().equals(loadStr)){
// create BufferedReader
try {
book = PDDocument.load(new File(fileName));
bookGrain = book.getNumberOfPages();
but_run.setEnabled(true);
} catch (IOException e... |
cfbbd8ac-054b-496e-a338-fa55bba79571 | 4 | private static String str2Hex(String theStr) {
byte[] bytes;
String result = "";
int tmp;
String tmpStr;
try {
bytes = theStr.getBytes("GBK");
for (int i = 0; i < bytes.length; i++) {
... |
24a57c06-22b7-46f0-b592-c0cbab0e9fea | 0 | public ExportSelectionSubMenuItem() {
super();
setEnabled(false);
Outliner.documents.addTreeSelectionListener(this);
Outliner.documents.addDocumentRepositoryListener(this);
} |
f012803c-528b-4b05-8e6b-1453f4abee76 | 1 | public LinkedList<Trusts> getTrusts() throws SQLException {
LinkedList<String> select = new LinkedList<String>();
select.add("*");
LinkedList<String> from = new LinkedList<String>();
from.add("Trusts");
LinkedList<Pair<String, String>> whereClauses = new LinkedList<Pair<String, S... |
68280efc-dacf-4a81-a2fd-6153ec574bee | 6 | @EventHandler
public void SlimeHunger(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.getSlimeConfig().getDouble("Slime.Hunger.Dodg... |
b335e1d6-8e04-4afd-8dbe-9b7048f9654a | 4 | public ObjectDefinition child(IClientContext ctx) {
if (childrenIds == null) {
return this;
}
int index = childId(ctx);
if (index >= 0 && index < childrenIds.length) {
if (childrenIds[index] == -1) {
return new ObjectDefinition(loader, -1);
}
return ctx.definitions.object(childrenIds[index]);... |
bb84ed67-af92-4224-90da-82634479e515 | 0 | public FileDataBase getFileDataBase(){
return fileDataBase;
} |
fa9ff547-3048-4ac7-8167-cc5dcd2cdc00 | 3 | public ArrayList<Gebruiker> getAlleKlantenBrieven(){
factuur.removeAll(factuur);
Calendar test = Calendar.getInstance();
test.add(Calendar.DATE, -30);
for (Gebruiker k : alleKlanten){
if(k.getOpenFactuur() != null){
if(!factuur.contains(k)){
... |
c121a34c-6a63-4539-8204-ded325298d85 | 9 | private void testAbstractMethods(ByteMatcher matcher) {
// test methods from abstract superclass
assertEquals("length is one", 1, matcher.length());
assertEquals("matcher for position 0 is this", matcher, matcher.getMatcherForPosition(0));
try {
matcher.getMatcherForPositio... |
48e2a359-b10f-4569-a24e-87fad0bf792b | 1 | private boolean isValidLightGrenadeCoverage(Grid grid) {
final int lightGrenadeCount = getLightGrenadesOfGrid(grid).size();
if (lightGrenadeCount * 100 / grid.gridSize() <= 2)
return true;
return false;
} |
bd486ee7-e801-48ea-9da1-c1f456cf2f18 | 8 | public void releaseConn() {
if (resultSet != null) {
try {
resultSet.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
if (stmt != null) {
try {
stmt.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printS... |
c13b67d7-0b35-4421-bf7e-e537d035ae11 | 2 | public void testPropertyAddToCopyYear() {
LocalDateTime test = new LocalDateTime(1972, 6, 9, 10, 20, 30, 40);
LocalDateTime copy = test.year().addToCopy(9);
check(test, 1972, 6, 9, 10, 20, 30, 40);
check(copy, 1981, 6, 9, 10, 20, 30, 40);
copy = test.year().addToCopy(0);... |
5f1a7f3b-bcfd-4ce7-8db3-1421e09b589d | 4 | public JPopupMenu makeMethodMenu(T occupant, Location loc)
{
this.occupant = occupant;
this.currentLocation = loc;
JPopupMenu menu = new JPopupMenu();
Method[] methods = getMethods();
Class oldDcl = null;
for (int i = 0; i < methods.length; i++)
{
... |
b1335f17-058f-40a3-a6c2-690639711e48 | 0 | @OneToMany(cascade=CascadeType.REMOVE)
@JoinColumn(name="eventId")
public List<Participant> getParticipants() {
return participants;
} |
f8624ea3-5572-48c6-a897-b118f50a875e | 1 | public boolean replaceSubBlock(StructuredBlock oldBlock,
StructuredBlock newBlock) {
if (subBlock == oldBlock)
subBlock = newBlock;
else
return false;
return true;
} |
5dddf243-2b4b-409c-8c30-325c4f3e2fa1 | 0 | public void setInternal(T internal) {
this.internal = internal;
} |
1d2e613a-0f6c-4495-a254-8d7ed0d272ff | 0 | @Test
public void itSetsBrewButtonStatus() {
maker.setBrewButtonStatus(CoffeeMakerAPI.BREW_BUTTON_PUSHED);
assertEquals(CoffeeMakerAPI.BREW_BUTTON_PUSHED, maker.getBrewButtonStatus());
maker.setBrewButtonStatus(CoffeeMakerAPI.BREW_BUTTON_NOT_PUSHED);
assertEquals(CoffeeMakerAPI.BREW... |
617f21b4-4022-4987-88b1-74ed4c459237 | 4 | protected Color getCtryColor(String country) {
if (Utilities.isNotACountry(country))
country = "NAT";
// if (noCountryPattern.matcher(country).matches())
// country = "NAT";
else
country = country.toUpperCase();
final String religion = mapPanel.... |
fca2b8f8-ed74-4993-bee7-e77c9cfe9e54 | 4 | public void breakUp(Molecule A){
Molecule Asub;
Network networkA;
ArrayList<Molecule> fragmentsMol = new ArrayList<Molecule>();
ArrayList<Network> fragments = new ArrayList<Network>();
int[] bondingSites;
int bondingSite;
int[] AsubMolID;
bondingSite=0;
AsubM... |
0e029b1f-cb0c-4e0e-9876-42b08ec00207 | 9 | private void parseDims(String layout) {
for (int i = 0, level = -1; i < layout.length(); i++) {
char c = layout.charAt(i);
switch (c) {
case LB:
if (level == dims.length - 1) {
throw new UnsupportedOperationException(
"Can only handle arrays with length "
+ dims.length);
... |
e35bd08b-4347-4634-ba96-9b20640d01aa | 4 | * @return The starting y-coordinate for the specified row.
*/
public int getRowStart(Row row) {
List<Row> rows = mModel.getRows();
int pos = getInsets().top;
int last = getLastRowToDisplay();
for (int i = getFirstRowToDisplay(); i <= last; i++) {
Row oneRow = rows.get(i);
if (row == oneRow) {
break... |
2fabab9b-2dcd-43f1-9ee1-4a9ed893fe31 | 2 | private int pointInAux(Point point, List<Nodo> list) {
for (int i = 0; i < list.getLength(); i++) {
Nodo rect = list.get(i);
if (rect.contains(point))
return i;
}
return -1;
} |
12bf5a5a-1193-45d7-ad4d-e488083f8a45 | 0 | public static boolean checkEventFileExists(String artistName){
return getEventsFile(artistName).exists();
} |
51d551b4-6ca7-4dbe-96c1-cfea862299a9 | 6 | public void addFragment( FragKind kind, int offset, BitSet versions, String frag )
{
BitSet missing=null;
if ( kind == FragKind.almost )
{
missing = (BitSet)current.getVersions().clone();
missing.xor(versions);
}
if ( sections.isEmpty() || SectionState... |
f1d8ecc7-73a3-4599-b325-75e96da49047 | 9 | public Object getValue(Object instance) throws InvocationTargetException {
if (parent != null) {
instance = parent.getValue(instance);
}
if (instance.getClass().isArray()) {
instance = asList((Object[]) instance);
}
if (instance instanceof Collection<?>) {
LinkedList<Object> result = new LinkedList<... |
03284d52-f204-45e5-ac6f-9c0f4b49bc3b | 9 | public static void main(String args[]) throws Throwable{
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb=new StringBuilder();
for(int C;(C=parseInt(in.readLine().trim()))!=-1;){
char[] word=in.readLine().trim().toCharArray(),guesses=in.readLine().trim().toCharArray();
... |
5881dca3-3180-4f62-8989-3a63b3be3362 | 0 | @Override
public void setCivilState(String civilState) {
super.setCivilState(civilState);
}; |
fa771f86-8cce-442f-8514-e51ef84f8642 | 6 | private void passwordKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_passwordKeyPressed
if(evt.getKeyCode() == KeyEvent.VK_ENTER){
try {
// TODO add your handling code here:
//System.out.println(username.getText());
//System.out.println(password.getText... |
78859776-ac71-482a-ae9d-eafffaaf9207 | 0 | public int getNbLignes() {
return nbLignes;
} |
189f07ec-605f-467a-a676-a30f86c4fc79 | 7 | @Override
public void update(double dt) {
super.update(dt);
for (Entity e : level.getEntityNear(y, x, getWidth(), getHeight())) {
if (e == this || e == owner || !(e instanceof LivingEntity))
continue;
boolean collide = Collide.aabb(x, y, getWidth(),
(int) getHeight(), e.getBox().x, e.getBox().y,
... |
fe715e2b-82ee-490b-9204-a38d1697d6a8 | 1 | private static final String getSymbolStringRep(String str, boolean isSpecial) {
if (isSpecial) {
return SYMBOL_NAME_QUOTE + str + SYMBOL_NAME_QUOTE;
}
return str;
} |
1f6e48da-aa9a-4928-b540-b2256a5e317d | 8 | public void fetch(){
if(corpus == null || corpus.size()==0){
return;
}
//TODO 映射每列
int len = -1; //总共有多少个字段;
for(int i=0;i<len;i++){
Iterator<RawSample> it = corpus.iterator();
String dt = "";
while(it.hasNext()){
RawSample rs = it.next();
if(dt.length()<1){
dt = rs.getTypes().get(i);... |
946fd01e-c939-41af-85e1-836c929725d1 | 6 | private boolean check(EdgeWeightedDigraph G) {
// edge-weighted digraph is cyclic
if (hasCycle()) {
// verify cycle
DirectedEdge first = null, last = null;
for (DirectedEdge e : cycle()) {
if (first == null) first = e;
if (last != null... |
3e3b5574-4b6a-4b87-9172-98ecdb0e480a | 0 | public synchronized int next() {
synchronized (this) {
++currentEvenValue; // Danger point here!
// Thread.yield();
++currentEvenValue;
}
return currentEvenValue;
} |
5222a175-b137-44ef-87c1-dde73799142e | 1 | public int lookup(String name) {
Object found = get(name);
if (found == null)
return -1;
else
return ((Integer)found).intValue();
} |
44d35f02-15df-4e06-a20a-decaae70d9a6 | 0 | @Basic
@Column(name = "FES_ESTADO")
public String getFesEstado() {
return fesEstado;
} |
04e80c2e-6d00-4ffb-b538-c8c02b140fd1 | 3 | public void add(Element e)
{
try
{
for (Element el : team)
{
if (el == null)
{
el = e;
break;
}
}
}
catch(Exception e1)
{
//Team filled
}
} |
0a16d198-70f7-4ab8-bb82-bed27b63617c | 0 | public boolean getSeenFossil() {
return this.seenFossil;
} |
5b7ca0bd-0df5-47b0-8a6d-9c01f6cb0fca | 2 | public void render(Screen screen) {
if (time >= lifeTime - 6 * 20) {
if (time / 6 % 2 == 0) return;
}
//screen.render(x - 4, y - 4, item.getSprite(), Color.get(-1, 0, 0, 0), 0);
//screen.render(x - 4, y - 4 - (int) (zz), item.getSprite(), item.getColor(), 0);
} |
3304175d-4854-4938-92c2-fb1faf15bc93 | 5 | public void enableModules() {
for(Module module : modules) {
for(Class<?> interfacee : module.getClass().getInterfaces()) {
if(runnableMap.get(interfacee) != null) {
runnableMap.get(interfacee).run(module);
}
}
if(runnableM... |
c6a60f8e-c2b4-43aa-ad7d-5a51c08136d3 | 5 | public void rotateLeft(RBNode x) {
// pushing node x down and to the Left to balance the tree. x's Right child (y)
// replaces x (since y > x), and y's Left child becomes x's Right child
// (since it's < y but > x).
RBNode y = x.getRight(); // get x's Right node, this becomes y
// set x's ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.