method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
0b6235d1-7167-44a5-b2e7-2115245961c3 | 8 | public int getM(String word){
int m = 0;
String vc = "";
if(word != null){
for (int i = 0; i < word.length(); i++) {
char charAtIndex = word.charAt(i);
char vcChar =vcTrans(charAtIndex);
if(vcChar == 'y'){
if(i>0 && vcTrans(word.charAt(i-1)) == 'c'){
vc.concat("v");
}else{
vc.conc... |
e02e19eb-9855-4b66-9095-369f80b63447 | 8 | public boolean isMatch(String s, String p) {
boolean[] a = new boolean[s.length()+1];
boolean[] b = new boolean[s.length()+1];
a[0] = true;
for (int j=1; j<=s.length(); j++) a[j] = false;
for (int i=1; i<=p.length(); i++) {
char cp = p.charAt(i-1);
... |
7835f9f0-2de5-4017-881b-21f56095c528 | 0 | public Car driverCar() {
return new Audo();
} |
b9369439-65df-4f48-bcc0-167d3938d837 | 9 | public void sort (int[] a){
if (a==null || a.length<=1){
return;
}
int max = a[0];
for (int i=1; i<a.length; i++){
max = Math.max(max, a[i]);
}
int ten=1;
int[] aux = new int[a.length];
int [] count = new int[10];
while (t... |
8d8fffe6-c236-44d8-abbe-0731c62e9db6 | 1 | public void test_getValue_long_long() {
assertEquals(0, iField.getValue(0L, 567L));
assertEquals(12345678 / 90, iField.getValue(12345678L, 567L));
assertEquals(-1234 / 90, iField.getValue(-1234L, 567L));
assertEquals(INTEGER_MAX / 90, iField.getValue(LONG_INTEGER_MAX, 567L));
try... |
a9246f1d-aea5-4926-b28b-bafe4b38644d | 3 | public void fitBoundsToLayers() {
int width = 0;
int height = 0;
Rectangle layerBounds = new Rectangle();
for (int i = 0; i < layers.size(); i++) {
getLayer(i).getBounds(layerBounds);
if (width < layerBounds.width) width = layerBounds.width;
if (heig... |
14126b85-300d-4711-854f-b9d376ec4a4a | 5 | public void polynomialFit(int n){
if(this.nAnalyteConcns<(n+2))throw new IllegalArgumentException("Method polynomialFit(" + n +") requres at least " + (n+2) + " data points; only " + this.nAnalyteConcns + " were supplied");
this.methodUsed = 2;
this.sampleErrorFlag = true;
this.degSet = ... |
1b6948fe-7f18-4251-9b90-f65168e53ec4 | 5 | public final FEMFormatter putParams(final Iterable<? extends FEMFunction> params) throws NullPointerException, IllegalArgumentException {
final Iterator<? extends FEMFunction> iter = params.iterator();
if (iter.hasNext()) {
FEMFunction item = iter.next();
if (iter.hasNext()) {
this.putIndent().put("(").pu... |
4339c667-2e1a-4d35-aac4-de08fe49adf0 | 6 | String get_rep2()
{
switch( action_type )
{
case SS_ACTION_CUT:
return "CUT(" + arg + ")";
case SS_ACTION_ZERO:
return "ZERO(" + arg + ")";
case SS_ACTION_RANGE_ERROR:
return "RANGE_ERROR";
case SS_ACTION_RESTART:
return "RESTART";
case SS_ACTION_DONE:
return "DONE";
case SS_ACTION_NEGATE:
... |
d6c91725-dc50-46bc-b74b-4b5905a9a464 | 1 | @Override
public float contains( int x, int y ) {
if( boundaries.contains( x, y ) ){
return 1.f;
}
else{
return 0.f;
}
} |
2c7ef85f-66d5-4222-aa83-3fa1e3f69701 | 9 | @EventHandler
public void onPlayerInteract (PlayerInteractEvent event) {
Player player = event.getPlayer();
Block block = event.getClickedBlock();
if (event.getAction() == Action.LEFT_CLICK_BLOCK && player.getItemInHand().getType() == Material.BLAZE_ROD) {
player.setMetadata("x1", new FixedMetadataValue(plug... |
eaf9fa85-f79e-47bc-bbc6-c7d43976d5e9 | 9 | public void handle(CollisionEvent event) {
ArrayList<OperateShape> shapes = event.getTarget();
for (MoveShape shape : shapes) {
if (shape instanceof Circle) {
switch (event.getEdgeType()) {
case RIGHT:
shape.setAngle(180 - (shape.getAngle()));
break;
case LEFT:
shape.setAngle(180 - (sh... |
32573050-c06c-4975-ac28-71f3bc1fb690 | 8 | public static JDialog createDialog(Component c, String title,
boolean modal, final JColorChooser chooserPane,
ActionListener okListener, ActionListener cancelListener)
throws HeadlessException {
final Color initialColor = chooserPane.getColor();
Window window = getWindowForComponent(c);
final JDialog r... |
ed8da1a7-09f4-4a1b-9187-b4ca2c2f272a | 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... |
64abaaf0-31dc-4a84-94a2-1469bef750e9 | 1 | @Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((code == null) ? 0 : code.hashCode());
return result;
} |
7131cdf6-bdea-4e5c-a2d7-4d87942c3f9a | 7 | public void func_73707_e()
{
if (!field_73713_b.isFile())
{
return;
}
BufferedReader bufferedreader;
try
{
bufferedreader = new BufferedReader(new FileReader(field_73713_b));
}
catch (FileNotFoundException filenotfoundexceptio... |
9ffaac92-416d-4ed5-a722-864637223279 | 3 | public static void main(String [] args)
{
try {
//System.err.println("DBThread Runs");
Class.forName("com.mysql.jdbc.Driver");
connect = DriverManager.getConnection("jdbc:mysql://localhost/cdr_data?user=root&password=root");
preparedStatement = connect.prepare... |
c2d0a4b9-7280-491a-bdd6-04f1ffaf0b6e | 3 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
PrintWriter settings = null;
try {
settings = new PrintWriter(System.getProperty("user.home")+"/Documents/AcerX/settingsYM.txt", "UTF-8");
settings.println(jTextField1.... |
3e79ee67-5186-4182-881e-3f570e03ed9a | 1 | private static boolean isDigit(int c) {
return '0' <= c && c <= '9';
} |
55f9c85c-4a2d-49aa-8f7f-2d113c0be18d | 8 | public boolean displayModesMatch(DisplayMode m1, DisplayMode m2){
if(m1.getWidth() != m2.getWidth() || m1.getHeight() != m2.getHeight()){
return false;
}
if(m1.getBitDepth() != DisplayMode.BIT_DEPTH_MULTI && m2.getBitDepth() != DisplayMode.BIT_DEPTH_MULTI && m1.getBitDepth() != m2.getBitDepth()){
return fal... |
28cf5964-d49c-49b3-9d63-ab990e853356 | 7 | private JSONWriter append(String string) throws JSONException {
if (string == null) {
throw new JSONException("Null pointer");
}
if (this.mode == 'o' || this.mode == 'a') {
try {
if (this.comma && this.mode == 'a') {
this.writer.write('... |
0ce87e2f-7064-4b50-8572-503c84c10658 | 2 | public boolean isOnBorder(int x, int y) {
if (selectedX + x >= tileWidth) {
return true;
} else if (vectorToId(selectedX + x, selectedY) >= inv.getItems()
.size()) {
return true;
}
return false;
} |
43d11c6e-3c15-40b6-8053-c7cb738bc1bb | 3 | private void initLog4J() {
logger.setLevel(Level.INFO);
Logger.getRootLogger().addAppender(new ConsoleAppender(new PatternLayout("%d %-5p [%c] - %m%n")));
try {
if(logfile != null)
Logger.getRootLogger().addAppender(new FileAppender(new PatternLayout("%d %-5p... |
ca63bf32-2237-4de2-a285-838ebbc591f8 | 9 | public void setOptions(String[] options) throws Exception {
setDebug(Utils.getFlag('D', options));
String classIndex = Utils.getOption('c', options);
if (classIndex.length() != 0) {
if (classIndex.toLowerCase().equals("last")) {
setClassIndex(0);
} else i... |
fe9befac-1d3f-4a91-839a-ec128755fa0f | 3 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
if (active(request)) //if there is an active user
{
if (request.getRequestURI().equals(request.getContextPath() + "/followers")) //if there is no string after followers/
{
List<User> ... |
66de0fba-791b-415b-8ef7-5005d7ab784d | 8 | public static String getString(String expression) {
String result = "";
for (int i = 0; i < expression.length(); i++) {
if (expression.charAt(i) == '#') {
result += getRandomString(true, false, false, 1);
} else if (expression.charAt(i) == '*') {
... |
4dbb48a1-2266-4a58-a1e9-6be300e04135 | 5 | private static final int method3961(Class70 class70, int i) {
if (i != 2)
aFloatArray9797 = null;
if (Class342.aClass70_4247 == class70)
return 2;
if (class70 == Class285_Sub2.aClass70_8503)
return 0;
if (Class318_Sub1_Sub2.aClass70_8737 != class70) {
if (Class348_Sub40_Sub39.aClass70_9485 == class7... |
ccb0fcb6-af29-4b46-b784-856d707d3a55 | 5 | private boolean isChar(char c)
{
return 'a' <= c && 'z' >= c || 'A'<=c && 'Z' >=c || '0' <= c && '9' >= c ;
} |
f00db891-3598-4c6a-a923-a2d3cc68019b | 1 | private static int digitSum(String bigInt){
int sum = 0;
for(char c:bigInt.toCharArray()){
sum+=Integer.parseInt(""+c);
}
return sum;
} |
0f0743cc-9357-444c-a83a-2c0e62c1aff2 | 7 | String convert(String s, int nRows){
if(nRows<=1) return s;
StringBuffer result = new StringBuffer();
if(s.length()==0) return "";
for(int i=0;i<nRows;i++){
for(int j=0,index =i; index<s.length();j++,index=(2*nRows-2)*j+i){
result.append(s.charAt(index));
... |
b89963ef-1537-48c1-b36a-bf9c86283e9b | 2 | @Test
public void testGetAllTiles() {
System.out.println("getAllTiles");
Tile newtile=new Tile();
Tile[][] store=new Tile[3][3];
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
store[i][j]=newtile;
}
}
map.MapArray=store;
Ti... |
d87826ce-844b-4b62-b60e-f72283726136 | 1 | public static AbstractCarriage generateFreightCarriage() {
AbstractCarriage carriage = null;
try {
carriage = FreightCarriageFactory.newCarriage(
new RandomEnum<FreightCarType>(FreightCarType.class).random(),
generateId(),
generateNumber(),
generateMaxCapacity());
((AbstractFreightCarriage... |
b28c30fd-ded5-4a61-81ae-e69c6f707385 | 3 | public int getLowestX()
{
int x = a[0];
if(b[0] < x)
{
x = b[0];
}
if(c[0] < x)
{
x = c[0];
}
if(d[0] < x)
{
x = d[0];
}
return(x);
} |
e35bde94-5594-48f6-928b-90dd1cdc36b6 | 4 | private void checkVersion(int[] requiredVersion) throws IOException {
if (m_registryVersion == null) {
m_registryVersion = requiredVersion;
}
else if (requiredVersion != null) {
for (int i = 0; i < requiredVersion.length; i++) {
if (m_registryVersion[i] != requiredVersion[i]) {
... |
de67b5c0-c18d-4671-9e12-c37e8f267a90 | 2 | private static int max(int[] histogram) {
int max = 0;
for (int i = 0; i < histogram.length; i++) {
if (histogram[i] > max)
max = histogram[i];
}
return max;
} |
9e28803f-8628-45dc-ad6a-47ab0d763f34 | 3 | protected void addNewChat() {
String chatContent = chatInputJTxa.getText();
DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm a");
Date date = new Date();
if (!(chatContent == null || chatContent.isEmpty())) {
//chatHistoryDLM.addElement(userLogin.getName() + " (" + dateFormat.format(date) + "):... |
b44b459e-a72a-47c3-b95c-b4eb34a51b6d | 9 | private void validate()
{
if (majorVersion()<0 || year()<0 || month()<0 || minorVersion()<0)
throw new IllegalArgumentException("No components of a version" +
" number may be negative.");
if (year() > 99)
throw new IllegalArgumentException("The second numb... |
06c4f658-a3b6-49db-8d4b-d7389cfae5ea | 3 | public static void main(String[] args) {
HelloWorld hw = new HelloWorld();
hw.printHelloWorld();
System.out.println(args[0]);
System.out.println(args[1]);
System.out.println(args[2]);
HelloWorldWithMethod hw2 = new HelloWorldWithMethod();
hw2.he... |
59999a9c-59d3-4152-9ad9-98e7d402cb84 | 8 | public boolean displayModesMatch(DisplayMode mode1,
DisplayMode mode2)
{
if (mode1.getWidth() != mode2.getWidth() ||
mode1.getHeight() != mode2.getHeight())
{
return false;
}
if (mode1.getBitDepth() != DisplayMode.BIT_DEPTH_MULTI &&
mode2... |
ce9a17f7-2765-4871-b44a-37ea71a39f8b | 1 | private void closeIfNotKeepAlive() {
if ("close".equals(getFirstHeader("connection"))) {
requestClose(false);
}
} |
1761b747-0993-4c25-866d-ad81f0ca5e8e | 2 | private int[] getSq() {
int startRow = row/SQ_SIZE * SQ_SIZE;
int startCol = col/SQ_SIZE * SQ_SIZE;
int[] sqNumbers = new int[SIZE];
int count = 0;
for (int i = 0; i < SQ_SIZE; i++) {
for (int j = 0; j < SQ_SIZE; j++) {
sqNumbers[count] = grid[startRow + i][startCol + j];
count++;
... |
bc9c8caf-bbca-4dca-adb4-0c9a84913e18 | 5 | public static void beginButtonAction() {
running = true;
factories = new ArrayList<Factory>();
customers = new ArrayList<Customer>();
factoryCount = maxFactoryCount;
customerCount = maxCustomerCount;
factoryClock = new Signal();
factoryStore = new FactoryStoreSignal();
// construct store
customerSt... |
0a1ed8bf-df8d-4887-92ba-f52a4ac2a035 | 9 | private void cargarSetPrueba(){
DefaultTableModel temp = (DefaultTableModel) this.tablaSetPruebas.getModel();
String csvFile = "dataset/diabetes_prueba.csv";
BufferedReader br = null;
String line = "";
String cvsSplitBy = ",";
try {
double maximo0 = normalizacion.obtenerMaximo(0, csvFile);
doubl... |
825db152-e60a-4b61-90b7-6ee6d8dfe4db | 4 | public File askForTargetArchive(File def) {
JFileChooser chooser = new JFileChooser();
chooser.setFileFilter(new FileFilter() {
public boolean accept(File f) {
if(f.isDirectory())
return true;
else{
A... |
ceb3fb2b-16b4-4a9e-8685-8006361a40e8 | 4 | public void removePreferences(String module) {
String prefix = module + '.';
ArrayList<String> list = new ArrayList<>();
int length = prefix.length();
for (Enumeration<Object> keys = mPrefs.keys(); keys.hasMoreElements();) {
String key = (String) keys.nextElement();
if (key.startsWith(prefix)) {
lis... |
80f2d33b-5b84-47d5-a6a1-a8aee959976f | 6 | public void addPropertyTablesToJoin(ObjectStack propertyStack)
{
boolean propertiesFound = false;
List<ObjectRepresentation> allReps = propertyStack
.getAllRepresentations();
for (ObjectRepresentation rep : allReps)
{
if (!propertiesFound)
{
if (rep.getNonNullPropertyCount() > 0 || rep.isArray())... |
0a766b02-efe6-4444-b282-1a689fa40ef1 | 9 | private void produceHumidity() {
Perlin noise = new Perlin();
try { noise.setOctaveCount(octaves); } catch (Exception e) {e.printStackTrace();}
noise.setFrequency(frequency);
noise.setSeed(seed);
if (details) System.out.println("Noise produced.");
int dimx = MyzoGEN.DIMENSION_X * chunksX;
int dimy =... |
f8cde585-b0e0-4aa6-a533-6aa2deb659f2 | 7 | private PreparedStatement createQuery(String prefix, Connection con, Set<Key> keys, int count) {
List<Object> parms = new ArrayList<>();
List<Column> pk = getPk();
StringBuilder sb = new StringBuilder();
int rowIndex = 0;
for (Key key : new HashSet<>(keys)) {
keys.rem... |
181cea02-4ceb-4f81-8fe8-33461fd46348 | 4 | public static void saveMeetingRoom(MeetingRoom mr){
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try {
conn.setAutoCommit(false);
... |
82763e87-4779-439c-8a87-e88b4402ade4 | 7 | static void browseDump(ClassFile cls) {
String[] ix = cls.browseInterfaces();
String[] fx = cls.browseFields();
String[] mx = cls.browseMethods();
String[][] mf = cls.browseFieldrefs();
String[][] mm = cls.browseMethodrefs();
String[][] mi = cls.browseInterfaceMethodrefs();
Str... |
5bdf9c3d-cdb6-4e1c-bd05-9e7422fb406e | 2 | @Override
public void handleRequest(int request) {
if (request == 1) {
System.out.println("ConcreteHandlerA handleRequest " + request);
} else if (mSuccessor != null) {
mSuccessor.handleRequest(request);
}
} |
e1555e5b-4566-4346-bb6e-f296b1962cfd | 4 | private List<DBObject> ConstructYahooObj(List<String> finvizReturn, String Ticker) {
LinkedList<DBObject> MongoObjList = new LinkedList<DBObject>();
int headerFlag = 0;
String[] headers = new String[]{""};
for (String finvizValues : finvizReturn){
if (headerFlag == 0){
... |
533ca932-a373-44c5-a2da-12d6e28ff2b4 | 4 | public Transaction transactionWLockOnVar(int index) {
for (Transaction t: locks.keySet()) {
ArrayList<Lock> lockListT = locks.get(t);
for (Lock lock: lockListT) {
if(lock.getIndex()==index && lock.isWrite()) {
return t;
}
}
}
return null;
} |
3e214487-e00a-42ef-ab18-20e93d6ed0ad | 4 | public List<Position> getPath3(int x, int y){
try{
Pattern pattern= Pattern.compile("(\\d+)");
List<Position> posList= new ArrayList<>();
int X,Y = 0;
if(posicao(pacmanX(),pacmanY())){
String str=intelFant(x, y, pacmanX(), pacmanY(),"path");
... |
2a7fb985-1b9b-42dc-9aa3-9b2fa8741457 | 6 | private static void copyToZip(ZipOutputStream output, File from, boolean keepManifest) throws IOException {
ZipFile input = new ZipFile(from);
Enumeration<? extends ZipEntry> entries = input.entries();
while (entries.hasMoreElements()) {
try {
ZipEntry entry = entries.nextElement();
if (!keepManif... |
a9463608-8051-4ae7-8ba8-a46a295419e3 | 1 | private String ExtractIdFromLink(String partialLink) {
int beginIdx = partialLink.indexOf(ID_PREFIX)+ID_PREFIX.length();
int endIdx = partialLink.indexOf("-", beginIdx);
String id = endIdx != -1 ? partialLink.substring(beginIdx, endIdx) : partialLink.substring(beginIdx);
return id;
} |
7252c7ed-b5f4-46d1-a75d-3e705e17bdfd | 9 | public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7) {
if(var7 != 1) {
return false;
} else {
++var5;
BlockBed var8 = (BlockBed)Block.bed;
int var9 = MathHelper.floor_double((double)(var2.rotationYaw * 4.0F / 360.... |
2af082f0-58f2-4648-bcdd-7096ab2b981f | 3 | private static float commonOverPrintAlpha(float alpha) {
// if alpha is already present we reduce it and we minimize
// it if it is already lower then our over paint. This an approximation
// only for improved screen representation.
if (alpha != 1.0f && alpha > OVERPAINT_ALPHA) {
... |
8f081a9d-5a89-47be-b099-f9982936b5f5 | 4 | @Override
public String toString() {
StringBuffer sb = new StringBuffer(28);
if (hardwareType != HTYPE_ETHER) {
// append hType only if it is not standard ethernet
sb.append(this.hardwareType).append("/");
}
for (int i=0; i<hardwareAddress.length; i++) {
if ((hardwareAddress[i] & 0xff) < 0x10)
sb... |
6067cdb7-a01b-43aa-91ef-b613c746ff16 | 5 | @Override
public void keyPressed(KeyEvent e) {
int key = e.getKeyCode();
String keyEvent = "";
if (key == KeyEvent.VK_LEFT) {
keyEvent = "VK_LEFT";
}
if (key == KeyEvent.VK_RIGHT) {
keyEvent = "VK_RIGHT";
}
if(keyEvent != "" && started){
SnakeUserMessage SUM = new SnakeUserMessage(Player, key... |
c9d5d4b0-9861-418f-816b-2693629445b6 | 3 | final private void createAndAddVariable(String variableRepresentation) throws InvalidInputException
{
//ignore empty variable names
if (variableRepresentation.trim().equals(""))
{
return;
}
//find the variable and then add it to the tokenized expression
for (int variableIndex = 0; variableIndex < this.... |
6dc6b0f5-887c-448a-a345-a4a1ebb717b5 | 0 | public void setHelloWorld(String helloWorld) {
this.helloWorld = helloWorld;
} |
ab55840d-3075-48b5-8a97-6bf57f6ea0ef | 7 | static void testValidity(Object o) throws JSONException {
if (o != null) {
if (o instanceof Double) {
if (((Double)o).isInfinite() || ((Double)o).isNaN()) {
throw new JSONException(
"JSON does not allow non-finite numbers.");
... |
9b9268d3-dcde-4922-90a4-cf17c37031d6 | 6 | public void adjustBeginLineColumn(int newLine, int newCol)
{
int start = tokenBegin;
int len;
if (bufpos >= tokenBegin)
{
len = bufpos - tokenBegin + inBuf + 1;
}
else
{
len = bufsize - tokenBegin + bufpos + 1 + inBuf;
}
int i = 0, j = 0, k = 0;
int nextColDiff = ... |
7a1d5988-684a-49ab-8353-eb88995e5215 | 3 | public void loadMap(String s) {
try {
InputStream in = getClass().getResourceAsStream(s);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
numCols = Integer.parseInt(br.readLine());
numRows = Integer.parseInt(br.readLine());
map = new int[numRows][numCols];
width = numCols * til... |
4c96412d-303a-429b-924e-ddd92c366517 | 9 | public String ex_string(String buff, int item, String sep) {
String result = null;
int ptr1 = 0;
int ptr2 = 0;
int cpt = 0;
int next = 0;
if ( item > 1)
while ( cpt < item -1) {
ptr1 = buff.indexOf(sep, next); //search the tag preceeding area
cpt++;
next = ptr1+1;
}
else
ptr1 = 0; //... |
0abea3db-c0e9-4a2d-8938-05ea89e56f5b | 1 | synchronized public static void setEarthRadius(double radius, LengthUnit unit) {
EARTH_RADIUS = new double[LengthUnit.values().length];
for (LengthUnit toUnit : LengthUnit.values()) {
EARTH_RADIUS[toUnit.ordinal()] = unit.convertTo(toUnit, radius);
}
} |
b28055bb-f308-486b-850d-b11b7093a59a | 7 | private void idCmbxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_idCmbxActionPerformed
String id = "";
tableModel.setRowCount(0);
if (idCmbx.getSelectedItem() != null && idCmbx.getSelectedIndex() != 0) {
id = idCmbx.getSelectedItem().toString();
if (!... |
e05b437e-2fe8-4de2-bbf2-6b1e6ec0a3e4 | 7 | public void updateTheory(final List<Rule> rulesToAdd, //
final Set<String> rulesToDelete, //
Map<String, List<Rule>> oldNewRuleMapping) throws TheoryException {
if (null != rulesToDelete) {
for (String ruleLabel : rulesToDelete) {
removeRule(ruleLabel);
}
}
if (null != rulesToAdd) {
for (Rule r... |
286c58d2-b272-4be8-9afb-1f42c5b7c7af | 1 | @SuppressWarnings("deprecation")
public void testConstructor_RP_RP6() throws Throwable {
YearMonthDay dt1 = new YearMonthDay(2005, 7, 17);
TimeOfDay dt2 = new TimeOfDay(10, 20, 30, 40);
try {
new Period(dt1, dt2);
fail();
} catch (IllegalArgumentException ex) ... |
2c7c3af3-d3ee-4c96-93b4-53677c105f8c | 6 | public Report cleanupDirs(Report report) throws IOException
{
List<Path> newDirectories = new ArrayList<Path>();
for (Path path : report.getNewDirectories())
{
newDirectories.add(path);
}
Collections.sort(newDirectories, new Comparator<Path>()
{
@Override
public int compare(Path o1, Path o2)
{
... |
29159316-3ec2-430e-b32d-c837b5fc94c9 | 6 | @Override
public void run() {
int i = 0;
for (String line : linesToCheck) {
try {
boolean recursive = false;
if (DNSChecker.CheckedReflectors.containsKey(line)) {
continue;
}
int size = Integer.parseInt(... |
1775fd87-ddd7-406c-8305-531c58239374 | 6 | private boolean correctSyntax(String format, String assemblyLine, ArrayList<String> relevantOperands) {
String[] formatSplit = format.split("\\s+");
int noOfTokens = formatSplit.length;
String regex = ".*";
int i = 1;
int i2 = 0;
for (String str : formatSplit) {
if(i > 1 && i <= noOfTokens)
r... |
0edb0b47-96a2-40f9-85bb-906a7f1d0cef | 0 | public UpdateModule(){
setAuthor("Sinrel Group");
setName("GameUpdater");
setVersion("1.0.0");
} |
58c943d6-22a9-46b9-88ea-a5a0b66f5b18 | 0 | public int getY() {
return y;
} |
19d9ac2b-0f82-4d26-9420-766ef3975268 | 4 | private void checkPoint() {
// Ball went past left side
if (ball.getX() + ball.getWidth() / 2 < 0) {
ballSleep = Calendar.getInstance().getTimeInMillis() + POINT_DELAY;
ball.setPos(paddles[0].getX() + paddles[0].getWidth() / 2 + ball.getWidth() / 2, paddles[0].getY());
ball.setXSpeed(- ball.getXSpeed())... |
b863a735-f4eb-4448-b2f9-7f03452f8897 | 0 | public int getColumnCount() {
// TODO Auto-generated method stub
return 0;
} |
8cd3c094-6282-482b-a570-af18bfbaf48b | 2 | public static String[] searchHistory(Integer ID,String changed, String name) {
Database db = dbconnect();
String [] Array = null;
try {
String query = ("SELECT * FROM ticket_history WHERE ticket_TID = ? "
+ "AND changed_on = ? AND column_name = ?");
... |
9f98d1c4-20c4-4ba5-9406-418918f86ae9 | 9 | public void update() {
if (listBadgeNames.getSelectedValue() == null) {
return;
}
clearErrors();
if (txtBadgeName.isMessageDefault() || txtBadgeName.getText().isEmpty()) {
Util.setError(lblNameError, "Advancement name cannot be left blank");
return;
... |
b7a9572a-ac85-4ad0-8eda-55014412aa51 | 5 | public Terrain getTerrainAt(int x, int y)
{
System.out.println("TERRAIN AT "+x+" "+y+" "+tmap[x][y]);
if (tmap[x][y].ground) {
return tmap[x][y];
}
for (int i=x-1; i<=x+1; ++i) {
for (int j=y-1; j<=y+1; ++j) {
//System.out.println("TERRAIN AT "+i+" "+j+" "+tmap[i][j]);
try {
if (tmap[i... |
cafbbff6-90d8-402e-857f-097bb9bac1fa | 3 | public void lueFunktio() throws IllegalStateException {
if (!merkkiOsaTunnusta()) {
throw new IllegalStateException();
}
int aloituspaikka = paikka;
siirryTunnuksenLoppuun();
Funktio lisattava = kirjasto.haeFunktio(
s... |
9d1feac8-fdd9-486d-830a-cef550a6fd3b | 3 | public String createEnvironment() {
// returns a string containing a fully written out environment for this
// datasource
StringBuilder sb = new StringBuilder();
sb.append( TAB + TAB + "<environment id=\"" + this.environmentName
+ "\">\n" );
sb.append( TAB + TAB... |
2910934f-a704-4879-9795-b3ea41c88568 | 1 | public String getToken() {
if (token == null) {
token = out.toString();
}
return token;
} |
83375129-9f12-466f-950f-46a51111df39 | 8 | private GraphModel groupHelpVertexes(GraphModel newGraph, int K) {
ArrayList<GraphPoint> p = new ArrayList<GraphPoint>();
for (Vertex v : newGraph.getVertexArray()) {
// Alle Punkte, die 'noch zu Relokalisieren' sind (Hilfspunkte)
// werden gesammelt...
if (v.getLabel().equals("noch zu Relokalisieren"))
... |
9b902f48-f61f-4578-a5f0-1e2bb72e144c | 2 | public static void saveHouseInt()
{
String output ="savedata/"+idString+".houseaninteger";
try
{
PrintWriter fout=new PrintWriter(new FileWriter(output));
if(VERSION.equals("Peaches"))
fout.println("PDAE"+idString);
else
fout.println("CDAE"+idString);
fout.println(houseInt);
fout.close(... |
4ab4aba1-d54f-4b16-bc35-334ca1f1cb8e | 4 | public String[][] productdata(JXTreeTable treeTable, Boolean[] bflag) {
String[][] datas = new String[treeTable.getRowCount()][treeTable
.getColumnCount() + 1];
for (int i = 0; i < treeTable.getRowCount(); i++) {
for (int j = 0; j <= treeTable.getColumnCount(); j++) {
if (j < treeTable.getColumnCount()) ... |
b7e780a8-160b-4929-85ec-b04301b6a284 | 1 | public boolean isFPSStatus() {
if(frame == null) buildGUI();
return fpsStatus.isSelected();
} |
27221355-9e92-4f2d-9af2-0a3183c695b9 | 5 | private boolean zzRefill() throws java.io.IOException {
/* first: make room (if you can) */
if (zzStartRead > 0) {
System.arraycopy(zzBuffer, zzStartRead,
zzBuffer, 0,
zzEndRead-zzStartRead);
/* translate stored positions */
zzEndRead-= zzStartRe... |
59b016f1-be43-47f8-8fe1-b2b7276b9046 | 1 | private static void indent(StringBuffer buf, int depth) {
for (int i = 0; i < depth; i++) {
buf.append("\t");
}
} |
8c115da8-fafc-4c0b-9e20-d1332b452d32 | 0 | @Basic
@Column(name = "FES_ID_FUNCIONARIO")
public Integer getFesIdFuncionario() {
return fesIdFuncionario;
} |
93d866f4-d5d3-4e7d-9994-6a2f288cef4d | 4 | @Override
public Object getValueAt(int row, int col) {
switch (col) {
case 0:
return entidades.get(row).getUsuario().getNome();
case 1:
return entidades.get(row).getDataInicio().toLocalDate().toString();
case 2:
return entid... |
04983139-45dd-4d84-896e-4fc89589d35e | 8 | public void setStage() { //Initial set up before any level starts
//System.out.println("size=" + brickList.size());
brickList = null;
brickList = new ArrayList<Brick>();
powerList.clear();
for (int i = 0; i < stage.length; i++) {
//System.out.println(stage[i][0]);
... |
20fffe22-00a1-4500-9d67-737664ec381f | 3 | public void doit(JvstCodeGen gen, Bytecode bytecode, ASTList args)
throws CompileError
{
int num = gen.getMethodArgsLength(args);
if (num != dimension)
throw new CompileError(Javac.proceedName
+ "() with a wrong number of parameters");... |
8d6b1b7a-d97d-4263-aaed-9afa33908cac | 9 | private int getConstructorType(StructuredBlock body) {
/*
* A non static constructor must begin with a call to another
* constructor. Either to a constructor of the same class or to the
* super class
*/
InstructionBlock ib;
if (body instanceof InstructionBlock)
ib = (InstructionBlock) body;
else ... |
17f8aa05-e16e-49f7-b912-ea1569410418 | 4 | public String getPopupWarning() {
if (this.description == null) return null;
if (this == SNAPSHOT) return "Are you sure you want to enable development builds?\nThey are not guaranteed to be stable and may corrupt your world.\nYou are advised to run this in a separate directory or run regular backups.";
if (... |
2908ca94-bdd3-4de9-b3d0-eb67f50687b2 | 4 | private Representation execute() {
Representation repr = null;
// Get context
Context context = getContext();
// generate the DatabaseRequest
DataSetApplication datasetApp = (DataSetApplication) getApplication();
DataSetExplorerUtil dsExplorerUtil = new DataSetExplorerUtil(datas... |
ed2b2e30-3beb-40a1-aba5-5a62a9961769 | 2 | public SaveRunnable(MainClass mainClass) {
FileUtil.checkAutoSaveConfigYAML();
SavedMSG = LangUtil.getSavedMSG();
SavingMSG = LangUtil.getSavingMSG();
if(!SavingMSG.equals("%NONE%")){
saving = true;
}
if(!SavedMSG.equals("%NONE%")){
saved = true;
}
} |
0b0aea3c-bb1f-492f-ae95-9931ecead379 | 0 | public void decoder(int[] octets_data){
/*
if (taille == 3){
capt_distri = (octets_data[0] & 0xC0) >>> 6;
sonar_droit = (octets_data[0] & 0x20) >>> 5;
sonar_gauche = (octets_data[0] & 0x10) >>> 4;
etat_match = (octets_data[0] & 0x8) >>> 3;
couleur_table = (octets_data[0] & 0x4) >>> 2;
type_bal... |
a92e94e5-de23-435b-811c-18b6a8115bb0 | 1 | public void setVisible(boolean visible) {
if(frame == null) buildGUI();
frame.setVisible(visible);
} |
a1896e4e-e853-4bef-aff7-d59264dc3391 | 4 | public void close() {
if (bdl != null) {
bdl.close();
}
if (server != null) {
server.close();
}
isConnected = false;
boolean retry = true;
while (retry) {
try {
join();
retry = false;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.