Java Examples for java.lang.Integer

The following java examples will help you to understand the usage of java.lang.Integer. These source code samples are taken from different open source projects.

Example 1
Project: intellij-community-master  File: concurency.java View source code
public java.lang.Object run() {
    final java.util.concurrent.atomic.AtomicInteger counter = new java.util.concurrent.atomic.AtomicInteger();
    java.lang.Thread th = org.codehaus.groovy.runtime.DefaultGroovyStaticMethods.start(null, new groovy.lang.Closure<java.lang.Void>(this, this) {

        public void doCall(java.lang.Object it) {
            for (java.lang.Integer i : new groovy.lang.IntRange(1, 8)) {
                org.codehaus.groovy.runtime.DefaultGroovyStaticMethods.sleep(null, 30);
                out("thread loop " + java.lang.String.valueOf(i));
                counter.incrementAndGet();
            }
        }

        public void doCall() {
            doCall(null);
        }
    });
    for (java.lang.Integer j : new groovy.lang.IntRange(1, 4)) {
        org.codehaus.groovy.runtime.DefaultGroovyStaticMethods.sleep(null, 50);
        out("main loop " + java.lang.String.valueOf(j));
        counter.incrementAndGet();
    }
    th.join();
    assert counter.get() == 12;
    return null;
}
Example 2
Project: platform2-master  File: FieldBMPBean.java View source code
public void initializeAttributes() {
    addAttribute(getIDColumnName());
    addAttribute("online_startingtime", "Leyfa rástímaskráningu á netinu", true, true, "java.lang.Boolean");
    addAttribute("field_type", "Vallargerð", false, false, "java.lang.String");
    addAttribute("number_of_holes", "Fjöldi hola", true, true, "java.lang.Integer");
    addAttribute("name", "Nafn", true, true, "java.lang.String");
    addAttribute("union_id", "Eigandi Samband/Klúbbur", true, true, "java.lang.Integer", "one-to-many", "is.idega.idegaweb.golf.entity.Union");
    addAttribute("field_par", "Par", true, true, "java.lang.Integer");
}
Example 3
Project: squill-master  File: ComplaintData.java View source code
public void insert(Squill squill) {
    ComplaintTable t = new ComplaintTable();
    squill.insert(t).values(insertElement(t.resolvedDate, getResolvedDate()), insertElement(t.percentSolved, getPercentSolved()), insertElement(t.comments, getComments()), insertElement(t.id, unchecked(java.lang.Integer.class, "null")), insertElement(t.customerId, getCustomerId()), insertElement(t.refoundSum, getRefoundSum()), insertElement(t.title, getTitle()));
}
Example 4
Project: tizzit-master  File: AccessRoles2ViewComponentsHbmImpl.java View source code
/**
     * @see de.juwimm.cms.model.AccessRoles2ViewComponentsHbm#create(java.lang.Integer, java.lang.String, java.lang.Integer)
     */
public void create(java.lang.Integer viewComponentId, java.lang.String accessRoleId, java.lang.Integer loginPageId) {
    // @todo implement public void create(java.lang.Integer viewComponentId, java.lang.String accessRoleId, java.lang.Integer loginPageId)
    throw new java.lang.UnsupportedOperationException("de.juwimm.cms.model.AccessRoles2ViewComponentsHbm.create(java.lang.Integer viewComponentId, java.lang.String accessRoleId, java.lang.Integer loginPageId) Not implemented!");
}
Example 5
Project: sosies-generator-master  File: ListOrderedSet2Test.java View source code
@SuppressWarnings(value = "unchecked")
@Test(timeout = 1000)
public void testOrdering_add1964() {
    fr.inria.diversify.testamplification.logger.Logger.writeTestStart(Thread.currentThread(), this, "testOrdering_add1964");
    final ListOrderedSet<E> set = setupSet();
    Iterator<E> it = set.iterator();
    for (int i = 0; i < 10; i++) {
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(), 6202, null, 6201, java.lang.Integer.toString(i));
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(), 6204, it, 6203, it.next());
    }
    for (int i = 0; i < 10; i += 2) {
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(), 6206, set, 6205, set.remove(java.lang.Integer.toString(i)));
    }
    it = set.iterator();
    for (int i = 1; i < 10; i += 2) {
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(), 6208, null, 6207, java.lang.Integer.toString(i));
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(), 6210, it, 6209, it.next());
    }
    for (int i = 0; i < 10; i++) {
        set.add(((E) (Integer.toString(i))));
        set.add(((E) (Integer.toString(i))));
    }
    fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(), 6212, set, 6211, set.size());
    it = set.iterator();
    for (int i = 1; i < 10; i += 2) {
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(), 6214, null, 6213, java.lang.Integer.toString(i));
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(), 2758, it, 2757, it.next());
    }
    for (int i = 0; i < 10; i += 2) {
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(), 6216, null, 6215, java.lang.Integer.toString(i));
        fr.inria.diversify.testamplification.logger.Logger.logAssertArgument(Thread.currentThread(), 6218, it, 6217, it.next());
    }
    fr.inria.diversify.testamplification.logger.Logger.writeTestFinish(Thread.currentThread());
}
Example 6
Project: nfldata-master  File: TestAvro.java View source code
public static void main(String[] args) {
    SparkConf conf = new SparkConf();
    conf.set("spark.serializer", "org.apache.spark.serializer.KryoSerializer");
    JavaSparkContext sc = new JavaSparkContext("local", "JavaAPISuite", conf);
    JavaRDD<String> lines = sc.textFile("log.txt");
    JavaRDD<Play> plays = lines.map( line -> new Play("game", 1, 1, 1, "offense", "defense", 1, 10, 20, "play desc", 0, 0, 2000, "qb", "offensiveplayer", "defense1", "defense2", false, false, false, false, "PASS", "home", "away", "dateplayed", "playid", "winner", 0, 0));
    /*
        public Play(java.lang.CharSequence Game, java.lang.Integer Quarter, java.lang.Integer GameMinutes, java.lang.Integer GameSeconds,
                java.lang.CharSequence Offense, java.lang.CharSequence Defense, java.lang.Integer Down, java.lang.Integer YardsToGo, java.lang.Integer YardLine,
                java.lang.CharSequence PlayDesc, java.lang.Integer OffenseScore, java.lang.Integer DefenseScore, java.lang.Integer Year, java.lang.CharSequence QB,
                java.lang.CharSequence OffensivePlayer, java.lang.CharSequence DefensivePlayer1, java.lang.CharSequence DefensivePlayer2,
                java.lang.Boolean Penalty, java.lang.Boolean Fumble, java.lang.Boolean Incomplete, java.lang.Boolean IsGoalGood, model.PlayTypes PlayType,
                java.lang.CharSequence HomeTeam, java.lang.CharSequence AwayTeam, java.lang.CharSequence DatePlayed, java.lang.CharSequence PlayId,
                java.lang.CharSequence Winner, java.lang.Integer HomeTeamScore, java.lang.Integer AwayTeamScore, java.lang.Boolean PlayerArrested,
                java.lang.Boolean OffensePlayerArrested, java.lang.Boolean DefensePlayerArrested, java.lang.Boolean HomeTeamPlayerArrested,
                java.lang.Boolean AwayTeamPlayerArrested) {
                */
    plays.collect().forEach( t -> System.out.println("Away:" + t.getDefense()));
}
Example 7
Project: coursera_recommender_systems-master  File: csv_loader.java View source code
/**
     * Data loader
     * @param strFilePath
     * @param AssocId
     * @param Simple
     * @return
     * @throws FileNotFoundException
     */
public static String LoadDataAssociations(String strFilePath, Integer AssocId, Boolean Simple) throws FileNotFoundException {
    Map<java.lang.Integer, java.lang.Double> UserCompare = new TreeMap<java.lang.Integer, java.lang.Double>();
    @SuppressWarnings("unused") Collection<Integer> advUserCompare = new ArrayList<Integer>();
    Collection<ratingsData> UserRatings = new ArrayList<ratingsData>();
    String output = AssocId.toString();
    String adVoutput = AssocId.toString();
    String result = "";
    Integer xbarValue = 0;
    try {
        @SuppressWarnings("unused") int ii = 0;
        //Read the input file and convert into
        @SuppressWarnings("resource") CSVReader reader = new CSVReader(new FileReader(strFilePath), ',');
        String[] nextLine;
        while ((nextLine = reader.readNext()) != null) {
            ratingsData ratingsDataVal = new ratingsData();
            //Comparing MovieId with AssocId
            if (java.lang.Integer.parseInt(nextLine[1]) == AssocId) {
                UserCompare.put(java.lang.Integer.parseInt(nextLine[0]), java.lang.Double.parseDouble(nextLine[2]));
            } else {
                ratingsDataVal.setUserId(java.lang.Integer.parseInt(nextLine[0]));
                ratingsDataVal.setMovieId(java.lang.Integer.parseInt(nextLine[1]));
                ratingsDataVal.setRatingValue(java.lang.Double.parseDouble(nextLine[2]));
                UserRatings.add(ratingsDataVal);
            }
        }
        Map<java.lang.Integer, java.lang.Integer> MovieRatings = new TreeMap<java.lang.Integer, java.lang.Integer>();
        //Y Values
        MovieRatings = calculate_ratings.findYvalue(UserRatings, UserCompare);
        //simple association
        Map<java.lang.Integer, java.lang.Double> MovieAssociations = new TreeMap<java.lang.Integer, java.lang.Double>();
        //simple association
        Map<java.lang.Integer, java.lang.Double> AdvMovieAssociations = new TreeMap<java.lang.Integer, java.lang.Double>();
        //Advanced Value
        Map<java.lang.Integer, java.lang.Integer> advMovieRatings = new TreeMap<java.lang.Integer, java.lang.Integer>();
        //findXBarvalue
        advMovieRatings = calculate_ratings.findXBarvalue(UserRatings, UserCompare);
        xbarValue = calculate_ratings.XBarvalue(UserRatings, UserCompare);
        for (Iterator<java.lang.Integer> mr = MovieRatings.keySet().iterator(); mr.hasNext(); ) {
            //(x+y)/y
            java.lang.Integer dmr = mr.next();
            java.lang.Double Val = (double) (MovieRatings.get(dmr) + UserCompare.size()) / UserCompare.size();
            MovieAssociations.put(dmr, (Val - 1));
            Float advValue = (float) ((Val - 1) / (((float) (advMovieRatings.get(dmr)) / (xbarValue))));
            AdvMovieAssociations.put(dmr, (double) advValue);
        }
        //Sorted - Simple
        Map<java.lang.Integer, java.lang.Double> SortedMovieAssociations = new TreeMap<java.lang.Integer, java.lang.Double>();
        SortedMovieAssociations = sort_map.sortMapByValue(MovieAssociations);
        int h = 0;
        for (Iterator<java.lang.Integer> smr = SortedMovieAssociations.keySet().iterator(); smr.hasNext(); ) {
            h = h + 1;
            java.lang.Integer dsmr = smr.next();
            output = output + "," + dsmr + "," + SortedMovieAssociations.get(dsmr).toString().substring(0, 5);
            if (h >= recsys_code_pa1.TOP_5) {
                break;
            }
        }
        //Sorted - Advanced
        Map<java.lang.Integer, java.lang.Double> SortedAdvMovieAssociations = new TreeMap<java.lang.Integer, java.lang.Double>();
        SortedAdvMovieAssociations = sort_map.sortMapByValue(AdvMovieAssociations);
        int adv = 0;
        for (Iterator<java.lang.Integer> asmr = SortedAdvMovieAssociations.keySet().iterator(); asmr.hasNext(); ) {
            adv = adv + 1;
            java.lang.Integer adsmr = asmr.next();
            //output
            adVoutput = adVoutput + "," + adsmr + "," + SortedAdvMovieAssociations.get(adsmr).toString().substring(0, 5);
            //Top 5
            if (adv >= recsys_code_pa1.TOP_5) {
                break;
            }
        }
        if (Simple == true) {
            result = adVoutput;
        } else {
            result = output;
        }
    } catch (Exception e) {
        System.out.println(e.getMessage());
    }
    return result;
}
Example 8
Project: ISTIC_M2GL-master  File: YetiChessUltimate.java View source code
/** Test case automatically generated by YETI **/
@Test
public void test_1() throws Exception {
    // time:1355225044102
    int v7 = -3;
    // time:1355225044102
    java.lang.Integer v8 = yetihelper.Helper.dummyInteger((int) v7);
    // time:1355225044102
    material.Square v9 = new material.Square((java.lang.Integer) v8, (java.lang.Integer) v8);
    // time:1355225044160
    java.util.List v38 = yetihelper.Helper.smartList();
    // time:1355225044167
    material.Square v42 = new material.Square((java.util.List) v38);
    // time:1355225044203
    java.lang.Integer v83 = v9.getRow();
    // time:1355225044213
    java.lang.Integer v119 = v42.getCol();
    // time:1355225044282
    material.Board v212 = new material.Board();
    // time:1355225044382
    material.Square v453 = new material.Square((java.lang.Integer) v119, (java.lang.Integer) v83);
    v212.movePiece((material.Piece) null, (material.Square) v453);
/**BUG FOUND: RUNTIME EXCEPTION**/
// time:1355225044399
/**YETI EXCEPTION - START 
      java.lang.NullPointerException
      	at material.Board.movePiece(Board.java:126)
      YETI EXCEPTION - END**/
/** original locs: 720 minimal locs: 10**/
}
Example 9
Project: javassist-master  File: Jassist150.java View source code
public static void implTestClassTailCache() throws NotFoundException, CannotCompileException {
    ClassPool pool = new ClassPool(true);
    for (int paths = 0; paths < 50; paths++) {
        pool.appendClassPath(JAVASSIST_JAR);
        pool.appendClassPath(CLASSES_FOLDER);
        pool.appendClassPath(TEST_CLASSES_FOLDER);
    }
    CtClass cc = pool.get("Jassist150$Inner1");
    CtMethod ccGet = cc.getDeclaredMethod("get");
    String code1 = "{ int n1 = Integer.valueOf(1); " + "  int n2 = Integer.valueOf(2); " + "  int n3 = Integer.valueOf(3); " + "  int n4 = Integer.valueOf(4); " + "  int n5 = Integer.valueOf(5); " + "  return n1+n2+n3+n4+n5; }";
    String code2 = "{ int n1 = java.lang.Integer.valueOf(1); " + "  int n2 = java.lang.Integer.valueOf(2); " + "  int n3 = java.lang.Integer.valueOf(3); " + "  int n4 = java.lang.Integer.valueOf(4); " + "  int n5 = java.lang.Integer.valueOf(5); " + "  return n1+n2+n3+n4+n5; }";
    String code3 = "{ int n1 = java.lang.Integer#valueOf(1); " + "  int n2 = java.lang.Integer#valueOf(2); " + "  int n3 = java.lang.Integer#valueOf(3); " + "  int n4 = java.lang.Integer#valueOf(4); " + "  int n5 = java.lang.Integer#valueOf(5); " + "  return n1+n2+n3+n4+n5; }";
    loop(cc, ccGet, code1);
}
Example 10
Project: error-prone-master  File: UClassTypeTest.java View source code
@Test
public void equality() {
    UType stringType = UClassType.create("java.lang.String");
    new EqualsTester().addEqualityGroup(stringType).addEqualityGroup(UClassType.create("java.util.List", stringType)).addEqualityGroup(UClassType.create("java.util.Map", stringType, stringType)).addEqualityGroup(UClassType.create("java.lang.Integer")).addEqualityGroup(UClassType.create("java.util.List", UClassType.create("java.lang.Integer"))).testEquals();
}
Example 11
Project: iterator-master  File: Integer.java View source code
public static void encode_(java.lang.Object obj, com.jsoniter.output.JsonStream stream) throws java.io.IOException {
    java.util.List list = (java.util.List) obj;
    int size = list.size();
    if (size == 0) {
        return;
    }
    java.lang.Object e = list.get(0);
    if (e == null) {
        stream.writeNull();
    } else {
        stream.writeVal((java.lang.Integer) e);
    }
    for (int i = 1; i < size; i++) {
        stream.write(',');
        e = list.get(i);
        if (e == null) {
            stream.writeNull();
        } else {
            stream.writeVal((java.lang.Integer) e);
        }
    }
}
Example 12
Project: Refaster-master  File: UClassTypeTest.java View source code
@Test
public void equality() {
    UType stringType = UClassType.create("java.lang.String");
    new EqualsTester().addEqualityGroup(stringType).addEqualityGroup(UClassType.create("java.util.List", stringType)).addEqualityGroup(UClassType.create("java.util.Map", stringType, stringType)).addEqualityGroup(UClassType.create("java.lang.Integer")).addEqualityGroup(UClassType.create("java.util.List", UClassType.create("java.lang.Integer"))).testEquals();
}
Example 13
Project: CCIndex_HBase_0.90.0-master  File: AColumnFamilyDescriptor.java View source code
@SuppressWarnings(value = "unchecked")
public void put(int field$, java.lang.Object value$) {
    switch(field$) {
        case 0:
            name = (java.nio.ByteBuffer) value$;
            break;
        case 1:
            compression = (org.apache.hadoop.hbase.avro.generated.ACompressionAlgorithm) value$;
            break;
        case 2:
            maxVersions = (java.lang.Integer) value$;
            break;
        case 3:
            blocksize = (java.lang.Integer) value$;
            break;
        case 4:
            inMemory = (java.lang.Boolean) value$;
            break;
        case 5:
            timeToLive = (java.lang.Integer) value$;
            break;
        case 6:
            blockCacheEnabled = (java.lang.Boolean) value$;
            break;
        case 7:
            bloomfilterEnabled = (java.lang.Boolean) value$;
            break;
        default:
            throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
}
Example 14
Project: hadoop-hbase-master  File: AColumnFamilyDescriptor.java View source code
@SuppressWarnings(value = "unchecked")
public void put(int field$, java.lang.Object value$) {
    switch(field$) {
        case 0:
            name = (java.nio.ByteBuffer) value$;
            break;
        case 1:
            compression = (org.apache.hadoop.hbase.avro.generated.ACompressionAlgorithm) value$;
            break;
        case 2:
            maxVersions = (java.lang.Integer) value$;
            break;
        case 3:
            blocksize = (java.lang.Integer) value$;
            break;
        case 4:
            inMemory = (java.lang.Boolean) value$;
            break;
        case 5:
            timeToLive = (java.lang.Integer) value$;
            break;
        case 6:
            blockCacheEnabled = (java.lang.Boolean) value$;
            break;
        case 7:
            bloomfilterEnabled = (java.lang.Boolean) value$;
            break;
        default:
            throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
}
Example 15
Project: jaxb2-commons-master  File: JavaParserTest.java View source code
public void testParse() throws Exception {
    final String text = "public class Dummy implements java.util.Comparator<java.lang.Integer>{}";
    final JavaTypeParser javaTypeParser = new JavaTypeParser();
    final JCodeModel codeModel = new JCodeModel();
    JClass comparator = javaTypeParser.parseClass("java.util.Comparator", codeModel);
    assertNotNull(comparator);
    JClass integerComparator = javaTypeParser.parseClass("java.util.Comparator<java.lang.Integer>", codeModel);
    assertNotNull(integerComparator);
    JClass wildcardIntegerComparator = javaTypeParser.parseClass("java.util.Comparator<? extends java.lang.Integer>", codeModel);
    assertNotNull(wildcardIntegerComparator);
}
Example 16
Project: SimRAT-master  File: SimRATPOA.java View source code
public org.omg.CORBA.portable.OutputStream _invoke(String $method, org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler $rh) {
    org.omg.CORBA.portable.OutputStream out = null;
    java.lang.Integer __method = (java.lang.Integer) _methods.get($method);
    if (__method == null)
        throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    switch(__method.intValue()) {
        case // SimRATApp/SimRAT/getScreenshot
        0:
            {
                SimRATApp.Image $result = null;
                $result = this.getScreenshot();
                out = $rh.createReply();
                SimRATApp.ImageHelper.write(out, $result);
                break;
            }
        case // SimRATApp/SimRAT/mouseMove
        1:
            {
                int x = in.read_long();
                int y = in.read_long();
                this.mouseMove(x, y);
                out = $rh.createReply();
                break;
            }
        case // SimRATApp/SimRAT/mousePress
        2:
            {
                int x = in.read_long();
                int y = in.read_long();
                int button = in.read_long();
                this.mousePress(x, y, button);
                out = $rh.createReply();
                break;
            }
        case // SimRATApp/SimRAT/mouseRelease
        3:
            {
                int x = in.read_long();
                int y = in.read_long();
                int button = in.read_long();
                this.mouseRelease(x, y, button);
                out = $rh.createReply();
                break;
            }
        case // SimRATApp/SimRAT/keyPress
        4:
            {
                int keyCode = in.read_long();
                this.keyPress(keyCode);
                out = $rh.createReply();
                break;
            }
        case // SimRATApp/SimRAT/keyReleased
        5:
            {
                int keyCode = in.read_long();
                this.keyReleased(keyCode);
                out = $rh.createReply();
                break;
            }
        case // SimRATApp/SimRAT/uploadFileToServer
        6:
            {
                SimRATApp.SimRATFile inFile = SimRATApp.SimRATFileHelper.read(in);
                this.uploadFileToServer(inFile);
                out = $rh.createReply();
                break;
            }
        case // SimRATApp/SimRAT/downloadFileFromServer
        7:
            {
                String fPath = in.read_string();
                SimRATApp.SimRATFile $result = null;
                $result = this.downloadFileFromServer(fPath);
                out = $rh.createReply();
                SimRATApp.SimRATFileHelper.write(out, $result);
                break;
            }
        case // SimRATApp/SimRAT/shutdown
        8:
            {
                this.shutdown();
                out = $rh.createReply();
                break;
            }
        default:
            throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    }
    return out;
}
Example 17
Project: openmicroscopy-master  File: InMemoryPlanarPixelBuffer.java View source code
public void checkBounds(Integer x, Integer y, Integer z, Integer c, Integer t) throws DimensionsOutOfBoundsException {
    if (x != null && (x > getSizeX() - 1 || x < 0)) {
        throw new DimensionsOutOfBoundsException("X '" + x + "' greater than sizeX '" + getSizeX() + "'.");
    }
    if (y != null && (y > getSizeY() - 1 || y < 0)) {
        throw new DimensionsOutOfBoundsException("Y '" + y + "' greater than sizeY '" + getSizeY() + "'.");
    }
    if (z != null && (z > getSizeZ() - 1 || z < 0)) {
        throw new DimensionsOutOfBoundsException("Z '" + z + "' greater than sizeZ '" + getSizeZ() + "'.");
    }
    if (c != null && (c > getSizeC() - 1 || c < 0)) {
        throw new DimensionsOutOfBoundsException("C '" + c + "' greater than sizeC '" + getSizeC() + "'.");
    }
    if (t != null && (t > getSizeT() - 1 || t < 0)) {
        throw new DimensionsOutOfBoundsException("T '" + t + "' greater than sizeT '" + getSizeT() + "'.");
    }
}
Example 18
Project: keshmesh-master  File: A.java View source code
private void m() {
    Integer integerUnsafe = -100;
    Integer unCachedIntegerUnsafe = -1000;
    Integer integerSafe = new Integer(5);
    /* [LCK01J,01,java.lang.Integer */
    synchronized (integerUnsafe) {
    /* ] */
    }
    /* [LCK01J,02,java.lang.Integer */
    synchronized (unCachedIntegerUnsafe) {
    /* ] */
    }
    synchronized (integerSafe) {
    }
}
Example 19
Project: scs-bigtable-master  File: ReducerPOA.java View source code
public org.omg.CORBA.portable.OutputStream _invoke(String $method, org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler $rh) {
    org.omg.CORBA.portable.OutputStream out = null;
    java.lang.Integer __method = (java.lang.Integer) _methods.get($method);
    if (__method == null)
        throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    switch(__method.intValue()) {
        case // scs/demos/mapreduce/Reducer/reduce
        0:
            {
                try {
                    scs.demos.mapreduce.OutputCollector collector = scs.demos.mapreduce.OutputCollectorHelper.read(in);
                    scs.demos.mapreduce.Reporter reporter = scs.demos.mapreduce.ReporterHelper.read(in);
                    scs.demos.bigtable.Sorter sorter = scs.demos.bigtable.SorterHelper.read(in);
                    this.reduce(collector, reporter, sorter);
                    out = $rh.createReply();
                } catch (scs.demos.mapreduce.IOMapReduceException $ex) {
                    out = $rh.createExceptionReply();
                    scs.demos.mapreduce.IOMapReduceExceptionHelper.write(out, $ex);
                }
                break;
            }
        default:
            throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    }
    return out;
}
Example 20
Project: tuprolog-5-master  File: JavaObjectTest.java View source code
@Test
public void variableAsParameter() throws PrologException {
    String goal = "java_object('java.lang.Integer', [0], Zero),\n" + "java_object('java.lang.Integer', [0], Expected),\n" + "Zero <- equals(Expected) returns Result.";
    SolveInfo solution = engine.solve(goal);
    assertTrue(solution.isSuccess());
    assertEquals(Struct.TRUE, solution.getTerm("Result"));
}
Example 21
Project: wikbook-master  File: MemberKeyTestCase.java View source code
public void testOK() {
    assertEquals(MemberKey.createNamedKey("a"), MemberKey.parse("a"));
    assertEquals(MemberKey.createSignedKey("a"), MemberKey.parse("a()"));
    assertEquals(MemberKey.createSignedKey("a"), MemberKey.parse("a(  )"));
    assertEquals(MemberKey.createSignedKey("a", "java.lang.String"), MemberKey.parse("a(java.lang.String)"));
    assertEquals(MemberKey.createSignedKey("a", "java.lang.String"), MemberKey.parse("a( java.lang.String)"));
    assertEquals(MemberKey.createSignedKey("a", "java.lang.String"), MemberKey.parse("a(java.lang.String )"));
    assertEquals(MemberKey.createSignedKey("a", "java.lang.String"), MemberKey.parse("a( java.lang.String )"));
    assertEquals(MemberKey.createSignedKey("a", "java.lang.String", "java.lang.Integer"), MemberKey.parse("a(java.lang.String,java.lang.Integer)"));
    assertEquals(MemberKey.createSignedKey("a", "java.lang.String", "java.lang.Integer"), MemberKey.parse("a(java.lang.String, java.lang.Integer)"));
    assertEquals(MemberKey.createSignedKey("a", "java.lang.String", "java.lang.Integer"), MemberKey.parse("a(java.lang.String ,java.lang.Integer)"));
    assertEquals(MemberKey.createSignedKey("a", "java.lang.String", "java.lang.Integer"), MemberKey.parse("a(java.lang.String , java.lang.Integer)"));
}
Example 22
Project: restx-master  File: TypeHelperTest.java View source code
@Test
public void should_produce_type_expression() throws Exception {
    assertThat(TypeHelper.getTypeExpressionFor("java.lang.String")).isEqualTo("java.lang.String.class");
    assertThat(TypeHelper.getTypeExpressionFor("java.util.List<java.lang.String>")).isEqualTo("Types.newParameterizedType(java.util.List.class, java.lang.String.class)");
    assertThat(TypeHelper.getTypeExpressionFor("java.util.Map<java.lang.String, java.lang.Integer>")).isEqualTo("Types.newParameterizedType(java.util.Map.class, java.lang.String.class, java.lang.Integer.class)");
    assertThat(TypeHelper.getTypeExpressionFor("java.util.List<java.util.List<java.lang.String>>")).isEqualTo("Types.newParameterizedType(java.util.List.class, Types.newParameterizedType(java.util.List.class, java.lang.String.class))");
    assertThat(TypeHelper.getTypeExpressionFor("java.util.List<java.util.Map<java.lang.String, java.lang.Integer>>")).isEqualTo("Types.newParameterizedType(java.util.List.class, Types.newParameterizedType(java.util.Map.class, java.lang.String.class, java.lang.Integer.class))");
    assertThat(TypeHelper.getTypeExpressionFor("java.util.List<java.util.Map<java.util.Set<java.lang.String>, java.lang.Integer>>")).isEqualTo("Types.newParameterizedType(java.util.List.class, Types.newParameterizedType(java.util.Map.class, Types.newParameterizedType(java.util.Set.class, java.lang.String.class), java.lang.Integer.class))");
}
Example 23
Project: glassfish-master  File: Servlet.java View source code
/** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
     * @param request servlet request
     * @param response servlet response
     */
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException {
    response.setContentType("text/html");
    java.io.PrintWriter out = response.getWriter();
    out.println("<html>");
    out.println("<head>");
    out.println("<title>Servlet</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("</body>");
    out.println("</html>");
    try {
        Context initial = new InitialContext();
        Object objref = initial.lookup("java:comp/env/ejb/SPSession");
        SPSessionHome home = (SPSessionHome) PortableRemoteObject.narrow(objref, SPSessionHome.class);
        SPSession myspsession = home.create();
        out.println("<pre>");
        myspsession.createPartsAndSuppliers();
        out.println("Created " + myspsession.checkAllParts() + " Parts.");
        out.println("Created " + myspsession.checkAllSuppliers() + " Suppliers.");
        out.println("Removing Part 200...");
        myspsession.removePart(new java.lang.Integer(200));
        out.println("Removing Supplier 145/145...");
        myspsession.removeSupplier(new java.lang.Integer(145), new java.lang.Integer(145));
        out.println("Left " + myspsession.checkAllParts() + " Parts.");
        out.println("Left " + myspsession.checkAllSuppliers() + " Suppliers.");
        out.println("</pre>");
    } catch (Exception ex) {
        System.err.println("Caught an exception:");
        ex.printStackTrace();
    }
    out.close();
}
Example 24
Project: JOrocos-master  File: COperationInterfacePOA.java View source code
public org.omg.CORBA.portable.OutputStream _invoke(String $method, org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler $rh) {
    org.omg.CORBA.portable.OutputStream out = null;
    java.lang.Integer __method = (java.lang.Integer) _methods.get($method);
    if (__method == null)
        throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    switch(__method.intValue()) {
        /**
         * Get a list of all operations.
         */
        case // RTT/corba/COperationInterface/getOperations
        0:
            {
                String $result[] = null;
                $result = this.getOperations();
                out = $rh.createReply();
                RTT.corba.COperationInterfacePackage.COperationListHelper.write(out, $result);
                break;
            }
        /**
         * Get a list of all arguments of a given operation.
         */
        case // RTT/corba/COperationInterface/getArguments
        1:
            {
                try {
                    String operation = in.read_string();
                    RTT.corba.CArgumentDescription $result[] = null;
                    $result = this.getArguments(operation);
                    out = $rh.createReply();
                    RTT.corba.CDescriptionsHelper.write(out, $result);
                } catch (RTT.corba.CNoSuchNameException $ex) {
                    out = $rh.createExceptionReply();
                    RTT.corba.CNoSuchNameExceptionHelper.write(out, $ex);
                }
                break;
            }
        /**
         * Returns the number of arguments required in callOperation() and sendOperation() for
         * a given operation.
         */
        case // RTT/corba/COperationInterface/getArity
        2:
            {
                try {
                    String operation = in.read_string();
                    short $result = (short) 0;
                    $result = this.getArity(operation);
                    out = $rh.createReply();
                    out.write_ushort($result);
                } catch (RTT.corba.CNoSuchNameException $ex) {
                    out = $rh.createExceptionReply();
                    RTT.corba.CNoSuchNameExceptionHelper.write(out, $ex);
                }
                break;
            }
        /**
         * Returns the number of arguments required in CSendHandle::collect() and CSendHandle::collectIfDone() for
         * a given operation.
         */
        case // RTT/corba/COperationInterface/getCollectArity
        3:
            {
                try {
                    String operation = in.read_string();
                    short $result = (short) 0;
                    $result = this.getCollectArity(operation);
                    out = $rh.createReply();
                    out.write_ushort($result);
                } catch (RTT.corba.CNoSuchNameException $ex) {
                    out = $rh.createExceptionReply();
                    RTT.corba.CNoSuchNameExceptionHelper.write(out, $ex);
                }
                break;
            }
        /**
         * Get a result type of a given operation.
         */
        case // RTT/corba/COperationInterface/getResultType
        4:
            {
                try {
                    String operation = in.read_string();
                    String $result = null;
                    $result = this.getResultType(operation);
                    out = $rh.createReply();
                    out.write_string($result);
                } catch (RTT.corba.CNoSuchNameException $ex) {
                    out = $rh.createExceptionReply();
                    RTT.corba.CNoSuchNameExceptionHelper.write(out, $ex);
                }
                break;
            }
        /**
         * Returns the argument or return type name of call as known to the Orocos type system.
         */
        case // RTT/corba/COperationInterface/getArgumentType
        5:
            {
                try {
                    String operation = in.read_string();
                    short nbr = in.read_ushort();
                    String $result = null;
                    $result = this.getArgumentType(operation, nbr);
                    out = $rh.createReply();
                    out.write_string($result);
                } catch (RTT.corba.CNoSuchNameException $ex) {
                    out = $rh.createExceptionReply();
                    RTT.corba.CNoSuchNameExceptionHelper.write(out, $ex);
                } catch (RTT.corba.CWrongArgumentException $ex) {
                    out = $rh.createExceptionReply();
                    RTT.corba.CWrongArgumentExceptionHelper.write(out, $ex);
                }
                break;
            }
        /**
         * Returns the argument type  of collect as known to the Orocos type system.
         */
        case // RTT/corba/COperationInterface/getCollectType
        6:
            {
                try {
                    String operation = in.read_string();
                    short nbr = in.read_ushort();
                    String $result = null;
                    $result = this.getCollectType(operation, nbr);
                    out = $rh.createReply();
                    out.write_string($result);
                } catch (RTT.corba.CNoSuchNameException $ex) {
                    out = $rh.createExceptionReply();
                    RTT.corba.CNoSuchNameExceptionHelper.write(out, $ex);
                } catch (RTT.corba.CWrongArgumentException $ex) {
                    out = $rh.createExceptionReply();
                    RTT.corba.CWrongArgumentExceptionHelper.write(out, $ex);
                }
                break;
            }
        /**
         * Get a description of a given operation.
         */
        case // RTT/corba/COperationInterface/getDescription
        7:
            {
                try {
                    String operation = in.read_string();
                    String $result = null;
                    $result = this.getDescription(operation);
                    out = $rh.createReply();
                    out.write_string($result);
                } catch (RTT.corba.CNoSuchNameException $ex) {
                    out = $rh.createExceptionReply();
                    RTT.corba.CNoSuchNameExceptionHelper.write(out, $ex);
                }
                break;
            }
        /**
         * Checks if a given operation accepts the list of arguments.
         * If no exception is thrown, the arguments and operation name were valid.
         */
        case // RTT/corba/COperationInterface/checkOperation
        8:
            {
                try {
                    String operation = in.read_string();
                    org.omg.CORBA.Any args[] = RTT.corba.CAnyArgumentsHelper.read(in);
                    this.checkOperation(operation, args);
                    out = $rh.createReply();
                } catch (RTT.corba.CNoSuchNameException $ex) {
                    out = $rh.createExceptionReply();
                    RTT.corba.CNoSuchNameExceptionHelper.write(out, $ex);
                } catch (RTT.corba.CWrongNumbArgException $ex) {
                    out = $rh.createExceptionReply();
                    RTT.corba.CWrongNumbArgExceptionHelper.write(out, $ex);
                } catch (RTT.corba.CWrongTypeArgException $ex) {
                    out = $rh.createExceptionReply();
                    RTT.corba.CWrongTypeArgExceptionHelper.write(out, $ex);
                }
                break;
            }
        /**
         * Call an operation with a list of arguments.
         * This method will block until the operation completes and returns its result.
         */
        case // RTT/corba/COperationInterface/callOperation
        9:
            {
                try {
                    String operation = in.read_string();
                    RTT.corba.CAnyArgumentsHolder args = new RTT.corba.CAnyArgumentsHolder();
                    args.value = RTT.corba.CAnyArgumentsHelper.read(in);
                    org.omg.CORBA.Any $result = null;
                    $result = this.callOperation(operation, args);
                    out = $rh.createReply();
                    out.write_any($result);
                    RTT.corba.CAnyArgumentsHelper.write(out, args.value);
                } catch (RTT.corba.CNoSuchNameException $ex) {
                    out = $rh.createExceptionReply();
                    RTT.corba.CNoSuchNameExceptionHelper.write(out, $ex);
                } catch (RTT.corba.CWrongNumbArgException $ex) {
                    out = $rh.createExceptionReply();
                    RTT.corba.CWrongNumbArgExceptionHelper.write(out, $ex);
                } catch (RTT.corba.CWrongTypeArgException $ex) {
                    out = $rh.createExceptionReply();
                    RTT.corba.CWrongTypeArgExceptionHelper.write(out, $ex);
                } catch (RTT.corba.CCallInterrupted $ex) {
                    out = $rh.createExceptionReply();
                    RTT.corba.CCallInterruptedHelper.write(out, $ex);
                }
                break;
            }
        /**
         * Send an operation with a list of arguments.
         * This method will return immediately and return a CSendHandle.
         */
        case // RTT/corba/COperationInterface/sendOperation
        10:
            {
                try {
                    String operation = in.read_string();
                    org.omg.CORBA.Any args[] = RTT.corba.CAnyArgumentsHelper.read(in);
                    RTT.corba.CSendHandle $result = null;
                    $result = this.sendOperation(operation, args);
                    out = $rh.createReply();
                    RTT.corba.CSendHandleHelper.write(out, $result);
                } catch (RTT.corba.CNoSuchNameException $ex) {
                    out = $rh.createExceptionReply();
                    RTT.corba.CNoSuchNameExceptionHelper.write(out, $ex);
                } catch (RTT.corba.CWrongNumbArgException $ex) {
                    out = $rh.createExceptionReply();
                    RTT.corba.CWrongNumbArgExceptionHelper.write(out, $ex);
                } catch (RTT.corba.CWrongTypeArgException $ex) {
                    out = $rh.createExceptionReply();
                    RTT.corba.CWrongTypeArgExceptionHelper.write(out, $ex);
                } catch (RTT.corba.CCallInterrupted $ex) {
                    out = $rh.createExceptionReply();
                    RTT.corba.CCallInterruptedHelper.write(out, $ex);
                }
                break;
            }
        default:
            throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    }
    return out;
}
Example 25
Project: android-sdk-sources-for-api-level-23-master  File: IntegerTest.java View source code
/**
     * java.lang.Integer#compareTo(java.lang.Integer)
     */
public void test_compareToLjava_lang_Integer() {
    // Test for method int java.lang.Integer.compareTo(java.lang.Integer)
    assertTrue("-2 compared to 1 gave non-negative answer", new Integer(-2).compareTo(new Integer(1)) < 0);
    assertEquals("-2 compared to -2 gave non-zero answer", 0, new Integer(-2).compareTo(new Integer(-2)));
    assertTrue("3 compared to 2 gave non-positive answer", new Integer(3).compareTo(new Integer(2)) > 0);
    try {
        new Integer(0).compareTo(null);
        fail("No NPE");
    } catch (NullPointerException e) {
    }
}
Example 26
Project: ARTPart-master  File: IntegerTest.java View source code
/**
     * java.lang.Integer#compareTo(java.lang.Integer)
     */
public void test_compareToLjava_lang_Integer() {
    // Test for method int java.lang.Integer.compareTo(java.lang.Integer)
    assertTrue("-2 compared to 1 gave non-negative answer", new Integer(-2).compareTo(new Integer(1)) < 0);
    assertEquals("-2 compared to -2 gave non-zero answer", 0, new Integer(-2).compareTo(new Integer(-2)));
    assertTrue("3 compared to 2 gave non-positive answer", new Integer(3).compareTo(new Integer(2)) > 0);
    try {
        new Integer(0).compareTo(null);
        fail("No NPE");
    } catch (NullPointerException e) {
    }
}
Example 27
Project: j2objc-master  File: IntegerTest.java View source code
/**
     * @tests java.lang.Integer#compareTo(java.lang.Integer)
     */
public void test_compareToLjava_lang_Integer() {
    // Test for method int java.lang.Integer.compareTo(java.lang.Integer)
    assertTrue("-2 compared to 1 gave non-negative answer", new Integer(-2).compareTo(new Integer(1)) < 0);
    assertEquals("-2 compared to -2 gave non-zero answer", 0, new Integer(-2).compareTo(new Integer(-2)));
    assertTrue("3 compared to 2 gave non-positive answer", new Integer(3).compareTo(new Integer(2)) > 0);
    try {
        new Integer(0).compareTo(null);
        fail("No NPE");
    } catch (NullPointerException e) {
    }
}
Example 28
Project: FloreantPos-master  File: BaseDrawerPullReport.java View source code
public int hashCode() {
    if (Integer.MIN_VALUE == this.hashCode) {
        if (null == this.getId())
            return super.hashCode();
        else {
            String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
            this.hashCode = hashStr.hashCode();
        }
    }
    return this.hashCode;
}
Example 29
Project: checklistbank-master  File: NameUsageAvro.java View source code
// Used by DatumReader.  Applications should not call. 
@SuppressWarnings(value = "unchecked")
public void put(int field$, java.lang.Object value$) {
    switch(field$) {
        case 0:
            key = (java.lang.Integer) value$;
            break;
        case 1:
            nubKey = (java.lang.Integer) value$;
            break;
        case 2:
            datasetKey = (java.lang.String) value$;
            break;
        case 3:
            constituentKey = (java.lang.String) value$;
            break;
        case 4:
            parentKey = (java.lang.Integer) value$;
            break;
        case 5:
            parent = (java.lang.String) value$;
            break;
        case 6:
            acceptedKey = (java.lang.Integer) value$;
            break;
        case 7:
            accepted = (java.lang.String) value$;
            break;
        case 8:
            basionymKey = (java.lang.Integer) value$;
            break;
        case 9:
            basionym = (java.lang.String) value$;
            break;
        case 10:
            scientificName = (java.lang.String) value$;
            break;
        case 11:
            canonicalName = (java.lang.String) value$;
            break;
        case 12:
            nameType = (java.lang.Integer) value$;
            break;
        case 13:
            authorship = (java.lang.String) value$;
            break;
        case 14:
            originKey = (java.lang.Integer) value$;
            break;
        case 15:
            taxonomicStatusKey = (java.lang.Integer) value$;
            break;
        case 16:
            nomenclaturalStatusKey = (java.util.List<java.lang.Integer>) value$;
            break;
        case 17:
            threatStatusKey = (java.util.List<java.lang.Integer>) value$;
            break;
        case 18:
            rankKey = (java.lang.Integer) value$;
            break;
        case 19:
            habitatKey = (java.util.List<java.lang.Integer>) value$;
            break;
        case 20:
            publishedIn = (java.lang.String) value$;
            break;
        case 21:
            accordingTo = (java.lang.String) value$;
            break;
        case 22:
            kingdomKey = (java.lang.Integer) value$;
            break;
        case 23:
            kingdom = (java.lang.String) value$;
            break;
        case 24:
            phylumKey = (java.lang.Integer) value$;
            break;
        case 25:
            phylum = (java.lang.String) value$;
            break;
        case 26:
            classKey = (java.lang.Integer) value$;
            break;
        case 27:
            clazz = (java.lang.String) value$;
            break;
        case 28:
            orderKey = (java.lang.Integer) value$;
            break;
        case 29:
            order = (java.lang.String) value$;
            break;
        case 30:
            familyKey = (java.lang.Integer) value$;
            break;
        case 31:
            family = (java.lang.String) value$;
            break;
        case 32:
            genusKey = (java.lang.Integer) value$;
            break;
        case 33:
            genus = (java.lang.String) value$;
            break;
        case 34:
            subgenusKey = (java.lang.Integer) value$;
            break;
        case 35:
            subgenus = (java.lang.String) value$;
            break;
        case 36:
            speciesKey = (java.lang.Integer) value$;
            break;
        case 37:
            species = (java.lang.String) value$;
            break;
        case 38:
            numDescendants = (java.lang.Integer) value$;
            break;
        case 39:
            sourceId = (java.lang.String) value$;
            break;
        case 40:
            isSynonym = (java.lang.Boolean) value$;
            break;
        case 41:
            extinct = (java.lang.Boolean) value$;
            break;
        case 42:
            description = (java.util.List<java.lang.String>) value$;
            break;
        case 43:
            vernacularName = (java.util.List<java.lang.String>) value$;
            break;
        case 44:
            vernacularLang = (java.util.List<java.lang.String>) value$;
            break;
        case 45:
            vernacularNameLang = (java.util.List<java.lang.String>) value$;
            break;
        case 46:
            higherTaxonKey = (java.util.List<java.lang.Integer>) value$;
            break;
        case 47:
            issues = (java.util.List<java.lang.Integer>) value$;
            break;
        default:
            throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
}
Example 30
Project: chill-master  File: FiscalRecord.java View source code
// Used by DatumReader.  Applications should not call.
@SuppressWarnings(value = "unchecked")
public void put(int field$, java.lang.Object value$) {
    switch(field$) {
        case 0:
            calendarDate = (java.lang.CharSequence) value$;
            break;
        case 1:
            fiscalWeek = (java.lang.Integer) value$;
            break;
        case 2:
            fiscalYear = (java.lang.Integer) value$;
            break;
        default:
            throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
}
Example 31
Project: eMandoa-master  File: FilePartPOA.java View source code
public org.omg.CORBA.portable.OutputStream _invoke(String method, org.omg.CORBA.portable.InputStream _input, org.omg.CORBA.portable.ResponseHandler handler) throws org.omg.CORBA.SystemException {
    org.omg.CORBA.portable.OutputStream _out = null;
    // do something
    // quick lookup of operation
    java.lang.Integer opsIndex = (java.lang.Integer) m_opsHash.get(method);
    if (null == opsIndex)
        throw new org.omg.CORBA.BAD_OPERATION(method + " not found");
    switch(opsIndex.intValue()) {
        // getPart
        case 0:
            {
                int _arg0 = _input.read_long();
                utiles.FilePartPackage.partHolder _arg1 = new utiles.FilePartPackage.partHolder();
                _arg1._read(_input);
                _out = handler.createReply();
                _out.write_long(getPart(_arg0, _arg1));
                utiles.FilePartPackage.partHelper.write(_out, _arg1.value);
                break;
            }
        // getPartCount
        case 1:
            {
                _out = handler.createReply();
                _out.write_long(getPartCount());
                break;
            }
    }
    return _out;
}
Example 32
Project: SEEP-master  File: SynchronousCommunicationChannelTest.java View source code
/**
	 * Run the SynchronousCommunicationChannel(int,Socket,Socket,Socket,Buffer) constructor test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 18/10/13 19:04
	 */
public void testSynchronousCommunicationChannel_1() throws Exception {
    int opId = 1;
    Socket downstreamSocketD = new Socket();
    Socket downstreamSocketC = new Socket();
    Socket blindSocket = new Socket();
    Buffer buffer = new Buffer();
    SynchronousCommunicationChannel result = new SynchronousCommunicationChannel(opId, downstreamSocketD, downstreamSocketC, blindSocket, buffer);
    // add additional test code here
    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NumberFormatException: null
    //       at java.lang.Integer.parseInt(Integer.java:454)
    //       at java.lang.Integer.parseInt(Integer.java:527)
    //       at uk.ac.imperial.lsds.seep.runtimeengine.SynchronousCommunicationChannel.<init>(SynchronousCommunicationChannel.java:53)
    assertNotNull(result);
}
Example 33
Project: grails-ide-master  File: ControllerReturnTypeInferencingTests.java View source code
public void testReturnType1() throws Exception {
    createControllerClass("FlarController", "class FlarController {\n" + "  def list = { [first : [''], second : 9 ] }\n" + "}");
    String contents = "new FlarController().list().first\n" + "new FlarController().list().second";
    int start = contents.indexOf("first");
    int end = start + "first".length();
    assertTypeInDomainClass(contents, start, end, "java.util.List<java.lang.String>");
    start = contents.indexOf("second");
    end = start + "second".length();
    assertTypeInDomainClass(contents, start, end, "java.lang.Integer");
    start = contents.indexOf("list");
    end = start + "list".length();
    assertTypeInDomainClass(contents, start, end, "java.util.Map");
}
Example 34
Project: AIM-master  File: UtilsTest.java View source code
@Test
public void testGetCtBehaviourUtils() throws NotFoundException, InstrumentationException {
    ClassPool cPool = new ClassPool(true);
    CtClass ctClass = cPool.get(DummyClass.class.getName());
    Assert.assertNull(Utils.getCtBehaviour(ctClass, "wrongName()"));
    Assert.assertNotNull(Utils.getCtBehaviour(ctClass, "DummyClass()"));
    Assert.assertTrue(Utils.getCtBehaviour(ctClass, "DummyClass()") instanceof CtConstructor);
    Assert.assertNotNull(Utils.getCtBehaviour(ctClass, "DummyClass(java.lang.Integer)"));
    Assert.assertTrue(Utils.getCtBehaviour(ctClass, "DummyClass(java.lang.Integer)") instanceof CtConstructor);
    Assert.assertNotNull(Utils.getCtBehaviour(ctClass, "DummyClass(double)"));
    Assert.assertTrue(Utils.getCtBehaviour(ctClass, "DummyClass(double)") instanceof CtConstructor);
    Assert.assertNotNull(Utils.getCtBehaviour(ctClass, "org.lpe.common.instrumentation.adaptive.utils.DummyClass.methodA()"));
    Assert.assertTrue(Utils.getCtBehaviour(ctClass, "methodA()") instanceof CtMethod);
    Assert.assertFalse(Modifier.isStatic(Utils.getCtBehaviour(ctClass, "methodA()").getModifiers()));
    Assert.assertNotNull(Utils.getCtBehaviour(ctClass, "methodB(java.lang.Integer)"));
    Assert.assertTrue(Utils.getCtBehaviour(ctClass, "methodB(java.lang.Integer)") instanceof CtMethod);
    Assert.assertNotNull(Utils.getCtBehaviour(ctClass, "staticMethod()"));
    Assert.assertTrue(Utils.getCtBehaviour(ctClass, "staticMethod()") instanceof CtMethod);
    Assert.assertTrue(Modifier.isStatic(Utils.getCtBehaviour(ctClass, "staticMethod()").getModifiers()));
}
Example 35
Project: checkstyle-master  File: InputMethodParamPad.java View source code
public void dottedCalls() {
    this.method();
    // warn
    this.method();
    this.method();
    InputMethodParamPad p = new InputMethodParamPad();
    p.method();
    // warn
    p.method();
    p.method();
    java.lang.Integer.parseInt("0");
    // warn
    java.lang.Integer.parseInt("0");
    java.lang.Integer.parseInt("0");
}
Example 36
Project: ellipsedetector-master  File: HoughCirclesDescriptor.java View source code
/** creates a HoughCirclesOpImage.
          *  @param pb operation parameters (thresholds, output intensity, radii).
          *  @param hints result image rendering parameters.
          *  @return an instance of HoughCirclesOpImage.
          */
public RenderedImage create(ParameterBlock pb, RenderingHints hints) {
    if (!validateParameters(pb)) {
        return null;
    }
    return new HoughCirclesOpImage(pb.getRenderedSource(0), new ImageLayout(), (Integer) pb.getObjectParameter(0), (Integer) pb.getObjectParameter(1), (Integer) pb.getObjectParameter(2), (Integer) pb.getObjectParameter(3), (Integer) pb.getObjectParameter(4));
}
Example 37
Project: ImageTools-master  File: CompareObjects.java View source code
/**
	 * Compare two generic values
	 * if o is < co -> retvalue=-1
	 * else if o=co -> revalue=0
	 * else retvalue 1
	 * 
	 * Implements and overrides Comparator to avoid instantiating a new class for every arraylist object
	 * 
	 * @param o -compare
	 * @param co -compare to
	 * @return revalue - the integer value representing the result
	 */
public int compare(Object o, Object co) {
    // TODO compare two objects of the same type
    int retvalue = -2;
    if (o instanceof java.lang.String & co instanceof java.lang.String) {
        //compare strings
        String comp = (String) o;
        String compto = (String) co;
        int i = 0;
        while (retvalue == -2 & i < comp.length()) {
            if (i > (compto.length() - 1) & i < (comp.length() - 1)) {
                retvalue = 1;
            } else if (i > (comp.length() - 1) & i < (compto.length() - 1)) {
                retvalue = -1;
            } else if (i > comp.length() & i > compto.length()) {
                retvalue = 0;
            } else if (comp.charAt(i) < compto.charAt(i)) {
                retvalue = -1;
            } else if (comp.charAt(i) > compto.charAt(i)) {
                retvalue = 1;
            }
            i++;
        }
    } else {
        //compare numbers and characters
        if (o instanceof java.lang.Float) {
            if ((java.lang.Float) o == (java.lang.Float) co) {
                retvalue = 0;
            } else if ((java.lang.Float) o < (java.lang.Float) co) {
                retvalue = -1;
            } else {
                retvalue = 1;
            }
        } else if (o instanceof java.lang.Double & co instanceof java.lang.Double) {
            if ((java.lang.Float) o == (java.lang.Float) co) {
                retvalue = 0;
            } else if ((java.lang.Float) o < (java.lang.Float) co) {
                retvalue = -1;
            } else {
                retvalue = 1;
            }
        } else if (o instanceof java.lang.Character & co instanceof java.lang.Character) {
            if ((java.lang.Character) o == (java.lang.Character) co) {
                retvalue = 0;
            } else if ((java.lang.Character) o < (java.lang.Character) co) {
                retvalue = -1;
            } else {
                retvalue = 1;
            }
        } else if (o instanceof java.lang.Integer & co instanceof java.lang.Integer) {
            if ((java.lang.Integer) o == (java.lang.Integer) co) {
                retvalue = 0;
            } else if ((java.lang.Integer) o < (java.lang.Integer) co) {
                retvalue = -1;
            } else {
                retvalue = 1;
            }
        }
    }
    return retvalue;
}
Example 38
Project: org.revisionfilter-master  File: ClassNameTest.java View source code
public void testExtractClassName() {
    assertEquals("java/lang/Integer", ClassName.extractClassName("Ljava/lang/Integer;"));
    assertEquals("java/lang/Integer", ClassName.extractClassName("[Ljava/lang/Integer;"));
    assertEquals("java/lang/Integer", ClassName.extractClassName("[[Ljava/lang/Integer;"));
    assertEquals("java/lang/Integer", ClassName.extractClassName("[[[Ljava/lang/Integer;"));
    assertEquals("java/lang/Integer", ClassName.extractClassName("java/lang/Integer"));
}
Example 39
Project: wikipediaminer-master  File: PageSummary.java View source code
// Used by DatumReader.  Applications should not call. 
@SuppressWarnings(value = "unchecked")
public void put(int field$, java.lang.Object value$) {
    switch(field$) {
        case 0:
            id = (java.lang.Integer) value$;
            break;
        case 1:
            title = (java.lang.CharSequence) value$;
            break;
        case 2:
            namespace = (java.lang.Integer) value$;
            break;
        case 3:
            forwarded = (java.lang.Boolean) value$;
            break;
        default:
            throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
}
Example 40
Project: gjtapi-master  File: _CorbaProviderImplBase.java View source code
public org.omg.CORBA.portable.OutputStream _invoke(String method, org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler rh) {
    org.omg.CORBA.portable.OutputStream out = null;
    java.lang.Integer __method = (java.lang.Integer) _methods.get(method);
    if (__method == null)
        throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    switch(__method.intValue()) {
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/addListener
        0:
            {
                net.sourceforge.gjtapi.raw.remote.corba.CorbaListener cl = net.sourceforge.gjtapi.raw.remote.corba.CorbaListenerHelper.read(in);
                this.addListener(cl);
                out = rh.createReply();
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/allocateMedia
        1:
            {
                String term = in.read_string();
                int type = in.read_long();
                net.sourceforge.gjtapi.raw.remote.corba.LongEntry parameters[] = net.sourceforge.gjtapi.raw.remote.corba.LongDictionaryHelper.read(in);
                boolean __result = false;
                __result = this.allocateMedia(term, type, parameters);
                out = rh.createReply();
                out.write_boolean(__result);
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/answerCall
        2:
            {
                try {
                    int callId = in.read_long();
                    String address = in.read_string();
                    String terminal = in.read_string();
                    this.answerCall(callId, address, terminal);
                    out = rh.createReply();
                } catch (net.sourceforge.gjtapi.raw.remote.corba.PrivilegeViolationEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.PrivilegeViolationExHelper.write(out, __ex);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.ResourceUnavailableEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.ResourceUnavailableExHelper.write(out, __ex);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.MethodNotSupportedEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.MethodNotSupportedExHelper.write(out, __ex);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.RawStateEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.RawStateExHelper.write(out, __ex);
                }
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/attachMedia
        3:
            {
                int call = in.read_long();
                String address = in.read_string();
                boolean onFlag = in.read_boolean();
                boolean __result = false;
                __result = this.attachMedia(call, address, onFlag);
                out = rh.createReply();
                out.write_boolean(__result);
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/beep
        4:
            {
                int call = in.read_long();
                this.beep(call);
                out = rh.createReply();
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/createCall
        5:
            {
                try {
                    int callId = in.read_long();
                    String address = in.read_string();
                    String terminal = in.read_string();
                    String destination = in.read_string();
                    int __result = (int) 0;
                    __result = this.createCall(callId, address, terminal, destination);
                    out = rh.createReply();
                    out.write_long(__result);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.PrivilegeViolationEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.PrivilegeViolationExHelper.write(out, __ex);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.ResourceUnavailableEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.ResourceUnavailableExHelper.write(out, __ex);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.MethodNotSupportedEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.MethodNotSupportedExHelper.write(out, __ex);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.RawStateEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.RawStateExHelper.write(out, __ex);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.InvalidPartyEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.InvalidPartyExHelper.write(out, __ex);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.InvalidArgumentEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.InvalidArgumentExHelper.write(out, __ex);
                }
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/freeMedia
        6:
            {
                String terminal = in.read_string();
                int type = in.read_long();
                boolean __result = false;
                __result = this.freeMedia(terminal, type);
                out = rh.createReply();
                out.write_boolean(__result);
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/getAddresses
        7:
            {
                try {
                    String __result[] = null;
                    __result = this.getAddresses();
                    out = rh.createReply();
                    net.sourceforge.gjtapi.raw.remote.corba.StringArrayHelper.write(out, __result);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.ResourceUnavailableEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.ResourceUnavailableExHelper.write(out, __ex);
                }
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/getAddressesForTerm
        8:
            {
                try {
                    String terminal = in.read_string();
                    String __result[] = null;
                    __result = this.getAddressesForTerm(terminal);
                    out = rh.createReply();
                    net.sourceforge.gjtapi.raw.remote.corba.StringArrayHelper.write(out, __result);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.InvalidArgumentEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.InvalidArgumentExHelper.write(out, __ex);
                }
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/getAddressType
        9:
            {
                String name = in.read_string();
                int __result = -1;
                __result = this.getAddressType(name);
                out = rh.createReply();
                out.write_long(__result);
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/getCall
        10:
            {
                int callId = in.read_long();
                net.sourceforge.gjtapi.raw.remote.corba.CallData __result = null;
                __result = this.getCall(callId);
                out = rh.createReply();
                net.sourceforge.gjtapi.raw.remote.corba.CallDataHelper.write(out, __result);
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/getCallsOnAddress
        11:
            {
                String address = in.read_string();
                net.sourceforge.gjtapi.raw.remote.corba.CallData __result[] = null;
                __result = this.getCallsOnAddress(address);
                out = rh.createReply();
                net.sourceforge.gjtapi.raw.remote.corba.CallArrayHelper.write(out, __result);
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/getCallsOnTerminal
        12:
            {
                String terminal = in.read_string();
                net.sourceforge.gjtapi.raw.remote.corba.CallData __result[] = null;
                __result = this.getCallsOnTerminal(terminal);
                out = rh.createReply();
                net.sourceforge.gjtapi.raw.remote.corba.CallArrayHelper.write(out, __result);
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/getCapabilities
        13:
            {
                net.sourceforge.gjtapi.raw.remote.corba.StringEntry __result[] = null;
                __result = this.getCapabilities();
                out = rh.createReply();
                net.sourceforge.gjtapi.raw.remote.corba.StringDictionaryHelper.write(out, __result);
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/getDialledDigits
        14:
            {
                int id = in.read_long();
                String address = in.read_string();
                String __result = null;
                __result = this.getDialledDigits(id, address);
                out = rh.createReply();
                out.write_string(__result);
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/getPrivateData
        15:
            {
                try {
                    int callId = in.read_long();
                    String address = in.read_string();
                    String terminal = in.read_string();
                    org.omg.CORBA.Any __result = null;
                    __result = this.getPrivateData(callId, address, terminal);
                    out = rh.createReply();
                    out.write_any(__result);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.NotSerializableEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.NotSerializableExHelper.write(out, __ex);
                }
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/getTerminals
        16:
            {
                try {
                    net.sourceforge.gjtapi.raw.remote.corba.TermData __result[] = null;
                    __result = this.getTerminals();
                    out = rh.createReply();
                    net.sourceforge.gjtapi.raw.remote.corba.TermArrayHelper.write(out, __result);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.ResourceUnavailableEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.ResourceUnavailableExHelper.write(out, __ex);
                }
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/getTerminalsForAddr
        17:
            {
                try {
                    String terminal = in.read_string();
                    net.sourceforge.gjtapi.raw.remote.corba.TermData __result[] = null;
                    __result = this.getTerminalsForAddr(terminal);
                    out = rh.createReply();
                    net.sourceforge.gjtapi.raw.remote.corba.TermArrayHelper.write(out, __result);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.InvalidArgumentEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.InvalidArgumentExHelper.write(out, __ex);
                }
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/hold
        18:
            {
                try {
                    int callId = in.read_long();
                    String address = in.read_string();
                    String terminal = in.read_string();
                    this.hold(callId, address, terminal);
                    out = rh.createReply();
                } catch (net.sourceforge.gjtapi.raw.remote.corba.PrivilegeViolationEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.PrivilegeViolationExHelper.write(out, __ex);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.ResourceUnavailableEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.ResourceUnavailableExHelper.write(out, __ex);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.MethodNotSupportedEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.MethodNotSupportedExHelper.write(out, __ex);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.RawStateEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.RawStateExHelper.write(out, __ex);
                }
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/initialize
        19:
            {
                try {
                    net.sourceforge.gjtapi.raw.remote.corba.StringEntry props[] = net.sourceforge.gjtapi.raw.remote.corba.StringDictionaryHelper.read(in);
                    this.initialize(props);
                    out = rh.createReply();
                } catch (net.sourceforge.gjtapi.raw.remote.corba.ProviderUnavailableEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.ProviderUnavailableExHelper.write(out, __ex);
                }
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/isMediaTerminal
        20:
            {
                String terminal = in.read_string();
                boolean __result = false;
                __result = this.isMediaTerminal(terminal);
                out = rh.createReply();
                out.write_boolean(__result);
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/join
        21:
            {
                try {
                    int callId1 = in.read_long();
                    int callId2 = in.read_long();
                    String address = in.read_string();
                    String terminal = in.read_string();
                    int __result = (int) 0;
                    __result = this.join(callId1, callId2, address, terminal);
                    out = rh.createReply();
                    out.write_long(__result);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.RawStateEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.RawStateExHelper.write(out, __ex);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.InvalidArgumentEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.InvalidArgumentExHelper.write(out, __ex);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.MethodNotSupportedEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.MethodNotSupportedExHelper.write(out, __ex);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.PrivilegeViolationEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.PrivilegeViolationExHelper.write(out, __ex);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.ResourceUnavailableEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.ResourceUnavailableExHelper.write(out, __ex);
                }
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/play
        22:
            {
                try {
                    String terminal = in.read_string();
                    String streamIds[] = net.sourceforge.gjtapi.raw.remote.corba.StringArrayHelper.read(in);
                    int offset = in.read_long();
                    net.sourceforge.gjtapi.raw.remote.corba.LongEntry rtcs[] = net.sourceforge.gjtapi.raw.remote.corba.LongDictionaryHelper.read(in);
                    net.sourceforge.gjtapi.raw.remote.corba.LongEntry optArgs[] = net.sourceforge.gjtapi.raw.remote.corba.LongDictionaryHelper.read(in);
                    this.play(terminal, streamIds, offset, rtcs, optArgs);
                    out = rh.createReply();
                } catch (net.sourceforge.gjtapi.raw.remote.corba.MediaResourceEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.MediaResourceExHelper.write(out, __ex);
                }
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/record
        23:
            {
                try {
                    String terminal = in.read_string();
                    String streamId = in.read_string();
                    net.sourceforge.gjtapi.raw.remote.corba.LongEntry rtcs[] = net.sourceforge.gjtapi.raw.remote.corba.LongDictionaryHelper.read(in);
                    net.sourceforge.gjtapi.raw.remote.corba.LongEntry optArgs[] = net.sourceforge.gjtapi.raw.remote.corba.LongDictionaryHelper.read(in);
                    this.record(terminal, streamId, rtcs, optArgs);
                    out = rh.createReply();
                } catch (net.sourceforge.gjtapi.raw.remote.corba.MediaResourceEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.MediaResourceExHelper.write(out, __ex);
                }
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/release
        24:
            {
                try {
                    String address = in.read_string();
                    int callId = in.read_long();
                    this.release(address, callId);
                    out = rh.createReply();
                } catch (net.sourceforge.gjtapi.raw.remote.corba.RawStateEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.RawStateExHelper.write(out, __ex);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.MethodNotSupportedEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.MethodNotSupportedExHelper.write(out, __ex);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.PrivilegeViolationEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.PrivilegeViolationExHelper.write(out, __ex);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.ResourceUnavailableEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.ResourceUnavailableExHelper.write(out, __ex);
                }
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/releaseCallId
        25:
            {
                int callId = in.read_long();
                this.releaseCallId(callId);
                out = rh.createReply();
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/removeListener
        26:
            {
                net.sourceforge.gjtapi.raw.remote.corba.CorbaListener cl = net.sourceforge.gjtapi.raw.remote.corba.CorbaListenerHelper.read(in);
                this.removeListener(cl);
                out = rh.createReply();
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/reportCallsOnAddress
        27:
            {
                try {
                    String address = in.read_string();
                    boolean flag = in.read_boolean();
                    this.reportCallsOnAddress(address, flag);
                    out = rh.createReply();
                } catch (net.sourceforge.gjtapi.raw.remote.corba.InvalidArgumentEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.InvalidArgumentExHelper.write(out, __ex);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.ResourceUnavailableEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.ResourceUnavailableExHelper.write(out, __ex);
                }
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/reportCallsOnTerminal
        28:
            {
                try {
                    String terminal = in.read_string();
                    boolean flag = in.read_boolean();
                    this.reportCallsOnTerminal(terminal, flag);
                    out = rh.createReply();
                } catch (net.sourceforge.gjtapi.raw.remote.corba.InvalidArgumentEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.InvalidArgumentExHelper.write(out, __ex);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.ResourceUnavailableEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.ResourceUnavailableExHelper.write(out, __ex);
                }
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/reserveCallId
        29:
            {
                try {
                    String address = in.read_string();
                    int __result = (int) 0;
                    __result = this.reserveCallId(address);
                    out = rh.createReply();
                    out.write_long(__result);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.InvalidArgumentEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.InvalidArgumentExHelper.write(out, __ex);
                }
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/retrieveSignals
        30:
            {
                try {
                    String terminal = in.read_string();
                    int num = in.read_long();
                    int patterns[] = net.sourceforge.gjtapi.raw.remote.corba.LongArrayHelper.read(in);
                    net.sourceforge.gjtapi.raw.remote.corba.LongEntry rtcs[] = net.sourceforge.gjtapi.raw.remote.corba.LongDictionaryHelper.read(in);
                    net.sourceforge.gjtapi.raw.remote.corba.LongEntry optArgs[] = net.sourceforge.gjtapi.raw.remote.corba.LongDictionaryHelper.read(in);
                    net.sourceforge.gjtapi.raw.remote.corba.DetectEvent __result = null;
                    __result = this.retrieveSignals(terminal, num, patterns, rtcs, optArgs);
                    out = rh.createReply();
                    net.sourceforge.gjtapi.raw.remote.corba.DetectEventHelper.write(out, __result);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.MediaResourceEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.MediaResourceExHelper.write(out, __ex);
                }
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/sendPrivateData
        31:
            {
                try {
                    int callId = in.read_long();
                    String address = in.read_string();
                    String terminal = in.read_string();
                    org.omg.CORBA.Any data = in.read_any();
                    org.omg.CORBA.Any __result = null;
                    __result = this.sendPrivateData(callId, address, terminal, data);
                    out = rh.createReply();
                    out.write_any(__result);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.NotSerializableEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.NotSerializableExHelper.write(out, __ex);
                }
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/sendSignals
        32:
            {
                try {
                    String terminal = in.read_string();
                    int syms[] = net.sourceforge.gjtapi.raw.remote.corba.LongArrayHelper.read(in);
                    net.sourceforge.gjtapi.raw.remote.corba.LongEntry rtcs[] = net.sourceforge.gjtapi.raw.remote.corba.LongDictionaryHelper.read(in);
                    net.sourceforge.gjtapi.raw.remote.corba.LongEntry optArgs[] = net.sourceforge.gjtapi.raw.remote.corba.LongDictionaryHelper.read(in);
                    this.sendSignals(terminal, syms, rtcs, optArgs);
                    out = rh.createReply();
                } catch (net.sourceforge.gjtapi.raw.remote.corba.MediaResourceEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.MediaResourceExHelper.write(out, __ex);
                }
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/setLoadControl
        33:
            {
                try {
                    String startAddr = in.read_string();
                    String endAddr = in.read_string();
                    double duration = in.read_double();
                    double admissionRate = in.read_double();
                    double interval = in.read_double();
                    int treatment[] = net.sourceforge.gjtapi.raw.remote.corba.LongArrayHelper.read(in);
                    this.setLoadControl(startAddr, endAddr, duration, admissionRate, interval, treatment);
                    out = rh.createReply();
                } catch (net.sourceforge.gjtapi.raw.remote.corba.MethodNotSupportedEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.MethodNotSupportedExHelper.write(out, __ex);
                }
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/setPrivateData
        34:
            {
                int callId = in.read_long();
                String address = in.read_string();
                String terminal = in.read_string();
                org.omg.CORBA.Any data = in.read_any();
                this.setPrivateData(callId, address, terminal, data);
                out = rh.createReply();
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/shutdown
        35:
            {
                this.shutdown();
                out = rh.createReply();
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/stop
        36:
            {
                String terminal = in.read_string();
                this.stop(terminal);
                out = rh.createReply();
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/stopReportingCall
        37:
            {
                int callId = in.read_long();
                boolean __result = false;
                __result = this.stopReportingCall(callId);
                out = rh.createReply();
                out.write_boolean(__result);
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/triggerRTC
        38:
            {
                String terminal = in.read_string();
                int action = in.read_long();
                this.triggerRTC(terminal, action);
                out = rh.createReply();
                break;
            }
        case // com/uforce/jtapi/generic/raw/remote/corba/CorbaProvider/unHold
        39:
            {
                try {
                    int callId = in.read_long();
                    String address = in.read_string();
                    String term = in.read_string();
                    this.unHold(callId, address, term);
                    out = rh.createReply();
                } catch (net.sourceforge.gjtapi.raw.remote.corba.RawStateEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.RawStateExHelper.write(out, __ex);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.MethodNotSupportedEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.MethodNotSupportedExHelper.write(out, __ex);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.PrivilegeViolationEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.PrivilegeViolationExHelper.write(out, __ex);
                } catch (net.sourceforge.gjtapi.raw.remote.corba.ResourceUnavailableEx __ex) {
                    out = rh.createExceptionReply();
                    net.sourceforge.gjtapi.raw.remote.corba.ResourceUnavailableExHelper.write(out, __ex);
                }
                break;
            }
        default:
            throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    }
    return out;
}
Example 41
Project: robolectric-master  File: MethodSignatureTest.java View source code
@Test
public void parse_shouldHandlePrimitiveReturnTypes() {
    final MethodSignature signature = MethodSignature.parse("java/lang/Long/foo(Ljava/lang/Integer;)Z");
    assertThat(signature.className).isEqualTo("java.lang.Long");
    assertThat(signature.methodName).isEqualTo("foo");
    assertThat(signature.paramTypes).contains("java.lang.Integer");
    assertThat(signature.returnType).isEqualTo("boolean");
}
Example 42
Project: kaa-master  File: GplusAvroConfig.java View source code
// Used by DatumReader.  Applications should not call.
@SuppressWarnings(value = "unchecked")
public void put(int field$, java.lang.Object value$) {
    switch(field$) {
        case 0:
            max_parallel_connections = (java.lang.Integer) value$;
            break;
        case 1:
            min_parallel_connections = (java.lang.Integer) value$;
            break;
        case 2:
            keep_alive_time_milliseconds = (java.lang.Long) value$;
            break;
        default:
            throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
}
Example 43
Project: tuscany-sca-2.x-master  File: _TestInterfaceImplBase.java View source code
public org.omg.CORBA.portable.OutputStream _invoke(String $method, org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler $rh) {
    org.omg.CORBA.portable.OutputStream out = null;
    java.lang.Integer __method = (java.lang.Integer) _methods.get($method);
    if (__method == null)
        throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    switch(__method.intValue()) {
        case // org/apache/tuscany/sca/host/corba/testing/general/TestInterface/getInt
        0:
            {
                int arg = in.read_long();
                int $result = (int) 0;
                $result = this.getInt(arg);
                out = $rh.createReply();
                out.write_long($result);
                break;
            }
        default:
            throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    }
    return out;
}
Example 44
Project: android_libcore-master  File: ResultSetTest.java View source code
/*
     * Public statics test
     */
@TestTargetNew(level = TestLevel.COMPLETE, notes = "Field testing", method = "!Constants", args = {})
public void testPublicStatics() {
    HashMap<String, Integer> thePublicStatics = new HashMap<String, Integer>();
    thePublicStatics.put("CLOSE_CURSORS_AT_COMMIT", new java.lang.Integer(2));
    thePublicStatics.put("HOLD_CURSORS_OVER_COMMIT", new java.lang.Integer(1));
    thePublicStatics.put("CONCUR_UPDATABLE", new java.lang.Integer(1008));
    thePublicStatics.put("CONCUR_READ_ONLY", new java.lang.Integer(1007));
    thePublicStatics.put("TYPE_SCROLL_SENSITIVE", new java.lang.Integer(1005));
    thePublicStatics.put("TYPE_SCROLL_INSENSITIVE", new java.lang.Integer(1004));
    thePublicStatics.put("TYPE_FORWARD_ONLY", new java.lang.Integer(1003));
    thePublicStatics.put("FETCH_UNKNOWN", new java.lang.Integer(1002));
    thePublicStatics.put("FETCH_REVERSE", new java.lang.Integer(1001));
    thePublicStatics.put("FETCH_FORWARD", new java.lang.Integer(1000));
    /*
         * System.out.println( "CLOSE_CURSORS_AT_COMMIT: " +
         * ResultSet.CLOSE_CURSORS_AT_COMMIT ); System.out.println(
         * "HOLD_CURSORS_OVER_COMMIT: " + ResultSet.HOLD_CURSORS_OVER_COMMIT );
         * System.out.println( "CONCUR_UPDATABLE: " + ResultSet.CONCUR_UPDATABLE );
         * System.out.println( "CONCUR_READ_ONLY: " + ResultSet.CONCUR_READ_ONLY );
         * System.out.println( "TYPE_SCROLL_SENSITIVE: " +
         * ResultSet.TYPE_SCROLL_SENSITIVE ); System.out.println(
         * "TYPE_SCROLL_INSENSITIVE: " + ResultSet.TYPE_SCROLL_INSENSITIVE );
         * System.out.println( "TYPE_FORWARD_ONLY: " +
         * ResultSet.TYPE_FORWARD_ONLY ); System.out.println( "FETCH_UNKNOWN: " +
         * ResultSet.FETCH_UNKNOWN ); System.out.println( "FETCH_REVERSE: " +
         * ResultSet.FETCH_REVERSE ); System.out.println( "FETCH_FORWARD: " +
         * ResultSet.FETCH_FORWARD );
         */
    Class<?> resultSetClass;
    try {
        resultSetClass = Class.forName("java.sql.ResultSet");
    } catch (ClassNotFoundException e) {
        fail("java.sql.ResultSet class not found!");
        return;
    }
    // end try
    Field[] theFields = resultSetClass.getDeclaredFields();
    int requiredModifier = Modifier.PUBLIC + Modifier.STATIC + Modifier.FINAL;
    int countPublicStatics = 0;
    for (Field element : theFields) {
        String fieldName = element.getName();
        int theMods = element.getModifiers();
        if (Modifier.isPublic(theMods) && Modifier.isStatic(theMods)) {
            try {
                Object fieldValue = element.get(null);
                Object expectedValue = thePublicStatics.get(fieldName);
                if (expectedValue == null) {
                    fail("Field " + fieldName + " missing!");
                }
                // end
                assertEquals("Field " + fieldName + " value mismatch: ", expectedValue, fieldValue);
                assertEquals("Field " + fieldName + " modifier mismatch: ", requiredModifier, theMods);
                countPublicStatics++;
            } catch (IllegalAccessException e) {
                fail("Illegal access to Field " + fieldName);
            }
        // end try
        }
    // end if
    }
// end for
}
Example 45
Project: open-mika-master  File: ResultSetTest.java View source code
/*
     * Public statics test
    @TestTargetNew(
        level = TestLevel.COMPLETE,
        notes = "Field testing",
        method = "!Constants",
        args = {}
    )
     */
public void testPublicStatics() {
    HashMap<String, Integer> thePublicStatics = new HashMap<String, Integer>();
    thePublicStatics.put("CLOSE_CURSORS_AT_COMMIT", new java.lang.Integer(2));
    thePublicStatics.put("HOLD_CURSORS_OVER_COMMIT", new java.lang.Integer(1));
    thePublicStatics.put("CONCUR_UPDATABLE", new java.lang.Integer(1008));
    thePublicStatics.put("CONCUR_READ_ONLY", new java.lang.Integer(1007));
    thePublicStatics.put("TYPE_SCROLL_SENSITIVE", new java.lang.Integer(1005));
    thePublicStatics.put("TYPE_SCROLL_INSENSITIVE", new java.lang.Integer(1004));
    thePublicStatics.put("TYPE_FORWARD_ONLY", new java.lang.Integer(1003));
    thePublicStatics.put("FETCH_UNKNOWN", new java.lang.Integer(1002));
    thePublicStatics.put("FETCH_REVERSE", new java.lang.Integer(1001));
    thePublicStatics.put("FETCH_FORWARD", new java.lang.Integer(1000));
    /*
         * System.out.println( "CLOSE_CURSORS_AT_COMMIT: " +
         * ResultSet.CLOSE_CURSORS_AT_COMMIT ); System.out.println(
         * "HOLD_CURSORS_OVER_COMMIT: " + ResultSet.HOLD_CURSORS_OVER_COMMIT );
         * System.out.println( "CONCUR_UPDATABLE: " + ResultSet.CONCUR_UPDATABLE );
         * System.out.println( "CONCUR_READ_ONLY: " + ResultSet.CONCUR_READ_ONLY );
         * System.out.println( "TYPE_SCROLL_SENSITIVE: " +
         * ResultSet.TYPE_SCROLL_SENSITIVE ); System.out.println(
         * "TYPE_SCROLL_INSENSITIVE: " + ResultSet.TYPE_SCROLL_INSENSITIVE );
         * System.out.println( "TYPE_FORWARD_ONLY: " +
         * ResultSet.TYPE_FORWARD_ONLY ); System.out.println( "FETCH_UNKNOWN: " +
         * ResultSet.FETCH_UNKNOWN ); System.out.println( "FETCH_REVERSE: " +
         * ResultSet.FETCH_REVERSE ); System.out.println( "FETCH_FORWARD: " +
         * ResultSet.FETCH_FORWARD );
         */
    Class<?> resultSetClass;
    try {
        resultSetClass = Class.forName("java.sql.ResultSet");
    } catch (ClassNotFoundException e) {
        fail("java.sql.ResultSet class not found!");
        return;
    }
    // end try
    Field[] theFields = resultSetClass.getDeclaredFields();
    int requiredModifier = Modifier.PUBLIC + Modifier.STATIC + Modifier.FINAL;
    int countPublicStatics = 0;
    for (Field element : theFields) {
        String fieldName = element.getName();
        int theMods = element.getModifiers();
        if (Modifier.isPublic(theMods) && Modifier.isStatic(theMods)) {
            try {
                Object fieldValue = element.get(null);
                Object expectedValue = thePublicStatics.get(fieldName);
                if (expectedValue == null) {
                    fail("Field " + fieldName + " missing!");
                }
                // end
                assertEquals("Field " + fieldName + " value mismatch: ", expectedValue, fieldValue);
                assertEquals("Field " + fieldName + " modifier mismatch: ", requiredModifier, theMods);
                countPublicStatics++;
            } catch (IllegalAccessException e) {
                fail("Illegal access to Field " + fieldName);
            }
        // end try
        }
    // end if
    }
// end for
}
Example 46
Project: Cassandra-KVPM-master  File: CfDef.java View source code
// Used by DatumReader.  Applications should not call. 
@SuppressWarnings(value = "unchecked")
public void put(int field$, java.lang.Object value$) {
    switch(field$) {
        case 0:
            keyspace = (java.lang.CharSequence) value$;
            break;
        case 1:
            name = (java.lang.CharSequence) value$;
            break;
        case 2:
            column_type = (java.lang.CharSequence) value$;
            break;
        case 3:
            comparator_type = (java.lang.CharSequence) value$;
            break;
        case 4:
            subcomparator_type = (java.lang.CharSequence) value$;
            break;
        case 5:
            comment = (java.lang.CharSequence) value$;
            break;
        case 6:
            row_cache_size = (java.lang.Double) value$;
            break;
        case 7:
            key_cache_size = (java.lang.Double) value$;
            break;
        case 8:
            read_repair_chance = (java.lang.Double) value$;
            break;
        case 9:
            replicate_on_write = (java.lang.Boolean) value$;
            break;
        case 10:
            gc_grace_seconds = (java.lang.Integer) value$;
            break;
        case 11:
            default_validation_class = (java.lang.CharSequence) value$;
            break;
        case 12:
            key_validation_class = (java.lang.CharSequence) value$;
            break;
        case 13:
            min_compaction_threshold = (java.lang.Integer) value$;
            break;
        case 14:
            max_compaction_threshold = (java.lang.Integer) value$;
            break;
        case 15:
            row_cache_save_period_in_seconds = (java.lang.Integer) value$;
            break;
        case 16:
            key_cache_save_period_in_seconds = (java.lang.Integer) value$;
            break;
        case 17:
            memtable_flush_after_mins = (java.lang.Integer) value$;
            break;
        case 18:
            memtable_throughput_in_mb = (java.lang.Integer) value$;
            break;
        case 19:
            memtable_operations_in_millions = (java.lang.Double) value$;
            break;
        case 20:
            merge_shards_chance = (java.lang.Double) value$;
            break;
        case 21:
            id = (java.lang.Integer) value$;
            break;
        case 22:
            column_metadata = (java.util.List<org.apache.cassandra.db.migration.avro.ColumnDef>) value$;
            break;
        case 23:
            row_cache_provider = (java.lang.CharSequence) value$;
            break;
        case 24:
            key_alias = (java.nio.ByteBuffer) value$;
            break;
        default:
            throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
}
Example 47
Project: jacorb-master  File: ComputInterfacePOA.java View source code
public org.omg.CORBA.portable.OutputStream _invoke(String method, org.omg.CORBA.portable.InputStream _input, org.omg.CORBA.portable.ResponseHandler handler) throws org.omg.CORBA.SystemException {
    org.omg.CORBA.portable.OutputStream _out = null;
    // do something
    // quick lookup of operation
    java.lang.Integer opsIndex = (java.lang.Integer) m_opsHash.get(method);
    if (null == opsIndex)
        throw new org.omg.CORBA.BAD_OPERATION(method + " not found");
    switch(opsIndex.intValue()) {
        // get_result
        case 0:
            {
                int _arg0 = _input.read_ulong();
                _out = handler.createReply();
                _out.write_long(get_result(_arg0));
                break;
            }
    }
    return _out;
}
Example 48
Project: mobicents-master  File: ConfigPropertiesPropertyEditorTest.java View source code
@Test
public void testGetAsText() throws Exception {
    ConfigProperties configProperties = new ConfigProperties();
    configProperties.addProperty(new ConfigProperties.Property("p1", "java.lang.String", ConfigProperties.Property.toObject("java.lang.String", "string")));
    configProperties.addProperty(new ConfigProperties.Property("p2", "java.lang.Integer", ConfigProperties.Property.toObject("java.lang.Integer", "0")));
    configProperties.addProperty(new ConfigProperties.Property("p3", "java.lang.String", null));
    propertyEditor.setValue(configProperties);
    Assert.assertEquals(configProperties.toString(), propertyEditor.getAsText());
}
Example 49
Project: winlet-master  File: SubCountTei.java View source code
public VariableInfo[] getVariableInfo(TagData data) {
    String str = data.getAttributeString("name");
    if (str != null && !str.equals("")) {
        VariableInfo info1 = new VariableInfo(str, "java.lang.Integer", true, VariableInfo.AT_END);
        VariableInfo[] info = { info1 };
        return info;
    }
    VariableInfo[] info = {};
    return info;
}
Example 50
Project: xjava-master  File: WordCount.java View source code
public Map<String, Integer> phrase(String input) {
    Map<String, Integer> countMap = new HashMap<String, Integer>();
    input = input.trim().toLowerCase().replaceAll("[\\W]", " ");
    final String[] tokenizedInput = input.split("\\s+");
    for (String aWord : tokenizedInput) {
        Integer count = countMap.get(aWord);
        countMap.put(aWord, count == null ? 1 : count + 1);
    }
    return countMap;
}
Example 51
Project: android-libcore64-master  File: OldIntegerTest.java View source code
public void test_getIntegerLjava_lang_StringI() {
    // Test for method java.lang.Integer
    // java.lang.Integer.getInteger(java.lang.String, int)
    Properties tProps = new Properties();
    tProps.put("testIncInt", "notInt");
    System.setProperties(tProps);
    assertTrue("returned incorrect default Integer", Integer.getInteger("testIncInt", 4).equals(new Integer(4)));
}
Example 52
Project: android_platform_libcore-master  File: OldIntegerTest.java View source code
public void test_getIntegerLjava_lang_StringI() {
    // Test for method java.lang.Integer
    // java.lang.Integer.getInteger(java.lang.String, int)
    Properties tProps = new Properties();
    tProps.put("testIncInt", "notInt");
    System.setProperties(tProps);
    assertTrue("returned incorrect default Integer", Integer.getInteger("testIncInt", 4).equals(new Integer(4)));
}
Example 53
Project: camelwatch-master  File: EndpointOperationsJmxImpl.java View source code
@Override
public Message browseMessageAsXml(int offset, boolean includeBody) throws Exception {
    String result = (String) conn.invoke(instance.getObjectName(), "browseMessageAsXml", new Object[] { offset }, new String[] { "java.lang.Integer" });
    if (result == null)
        return null;
    Document doc = new SAXBuilder().build(new StringReader(result));
    Element root = doc.getRootElement();
    return new MessageFactory().build(root);
}
Example 54
Project: classlib6-master  File: _ORBProxyImplBase.java View source code
public org.omg.CORBA.portable.OutputStream _invoke(String $method, org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler $rh) {
    org.omg.CORBA.portable.OutputStream out = null;
    java.lang.Integer __method = (java.lang.Integer) _methods.get($method);
    if (__method == null)
        throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    switch(__method.intValue()) {
        /** Method used to cause ORB to activate the named adapter, if possible.
  	* This will cause the named POA to register itself with the activator as
  	* a side effect.  This should always happen before this call can complete.
  	* This method returns true if adapter activation succeeded, otherwise it
  	* returns false.
  	*/
        case // PortableActivationIDL/ORBProxy/activate_adapter
        0:
            {
                String name[] = org.omg.PortableInterceptor.AdapterNameHelper.read(in);
                boolean $result = false;
                $result = this.activate_adapter(name);
                out = $rh.createReply();
                out.write_boolean($result);
                break;
            }
        default:
            throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    }
    return out;
}
Example 55
Project: ikvm-openjdk-master  File: _ORBProxyImplBase.java View source code
public org.omg.CORBA.portable.OutputStream _invoke(String $method, org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler $rh) {
    org.omg.CORBA.portable.OutputStream out = null;
    java.lang.Integer __method = (java.lang.Integer) _methods.get($method);
    if (__method == null)
        throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    switch(__method.intValue()) {
        /** Method used to cause ORB to activate the named adapter, if possible.
  	* This will cause the named POA to register itself with the activator as
  	* a side effect.  This should always happen before this call can complete.
  	* This method returns true if adapter activation succeeded, otherwise it
  	* returns false.
  	*/
        case // PortableActivationIDL/ORBProxy/activate_adapter
        0:
            {
                String name[] = org.omg.PortableInterceptor.AdapterNameHelper.read(in);
                boolean $result = false;
                $result = this.activate_adapter(name);
                out = $rh.createReply();
                out.write_boolean($result);
                break;
            }
        default:
            throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    }
    return out;
}
Example 56
Project: JDK-master  File: _ORBProxyImplBase.java View source code
public org.omg.CORBA.portable.OutputStream _invoke(String $method, org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler $rh) {
    org.omg.CORBA.portable.OutputStream out = null;
    java.lang.Integer __method = (java.lang.Integer) _methods.get($method);
    if (__method == null)
        throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    switch(__method.intValue()) {
        /** Method used to cause ORB to activate the named adapter, if possible.
  	* This will cause the named POA to register itself with the activator as
  	* a side effect.  This should always happen before this call can complete.
  	* This method returns true if adapter activation succeeded, otherwise it
  	* returns false.
  	*/
        case // PortableActivationIDL/ORBProxy/activate_adapter
        0:
            {
                String name[] = org.omg.PortableInterceptor.AdapterNameHelper.read(in);
                boolean $result = false;
                $result = this.activate_adapter(name);
                out = $rh.createReply();
                out.write_boolean($result);
                break;
            }
        default:
            throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    }
    return out;
}
Example 57
Project: ptii-master  File: _CorbaActorImplBase.java View source code
public org.omg.CORBA.portable.OutputStream _invoke(String method, org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler rh) {
    org.omg.CORBA.portable.OutputStream out = null;
    java.lang.Integer __method = (java.lang.Integer) _methods.get(method);
    if (__method == null) {
        throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    }
    switch(__method.intValue()) {
        /* Mirror the fire() method of the Ptolemy
         * executable interface.
         * @exception CorbaIllegalActionException If the
         *   method is an illegal action of the actor.
         */
        case // util/CorbaActor/fire
        0:
            {
                try {
                    this.fire();
                    out = rh.createReply();
                } catch (ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionException __ex) {
                    out = rh.createExceptionReply();
                    ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionExceptionHelper.write(out, __ex);
                }
                break;
            }
        /* Return the value (in the form of a string) of
             * a parameter.
             * @exception CorbaIllegalActionException If the
             *  query of parameter is not supported by the actor.
             * @exception CorbaUnknowParamException If the parameter
             *  name is not known by the actor.
             */
        case // util/CorbaActor/getParameter
        1:
            {
                try {
                    String paramName = in.read_string();
                    String __result = null;
                    __result = this.getParameter(paramName);
                    out = rh.createReply();
                    out.write_string(__result);
                } catch (ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionException __ex) {
                    out = rh.createExceptionReply();
                    ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionExceptionHelper.write(out, __ex);
                } catch (ptolemy.domains.ct.demo.Corba.util.CorbaUnknownParamException __ex) {
                    out = rh.createExceptionReply();
                    ptolemy.domains.ct.demo.Corba.util.CorbaUnknownParamExceptionHelper.write(out, __ex);
                }
                break;
            }
        /* Mirror the initialize() method of the Ptolmey
             * executable interface.
             * @exception CorbaIllegalActionException If the
             *   method is an illegal action of the actor.
             */
        case // util/CorbaActor/initialize
        2:
            {
                try {
                    this.initialize();
                    out = rh.createReply();
                } catch (ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionException __ex) {
                    out = rh.createExceptionReply();
                    ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionExceptionHelper.write(out, __ex);
                }
                break;
            }
        /* Return true if the specified channel of the specified
             * port contains unsent data.
             * @exception CorbaIllegalActionException If the query is
             *   not supported by the actor.
             * @exception CorbaUnknownPortException If the specified
             *   port is not known by the actor.
             * @exception CorbaIndexOutofBoundException If the
             *   channel index is out of the width of the port.
             */
        case // util/CorbaActor/hasData
        3:
            {
                try {
                    String portName = in.read_string();
                    short portIndex = in.read_short();
                    boolean __result = false;
                    __result = this.hasData(portName, portIndex);
                    out = rh.createReply();
                    out.write_boolean(__result);
                } catch (ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionException __ex) {
                    out = rh.createExceptionReply();
                    ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionExceptionHelper.write(out, __ex);
                } catch (ptolemy.domains.ct.demo.Corba.util.CorbaIndexOutofBoundException __ex) {
                    out = rh.createExceptionReply();
                    ptolemy.domains.ct.demo.Corba.util.CorbaIndexOutofBoundExceptionHelper.write(out, __ex);
                } catch (ptolemy.domains.ct.demo.Corba.util.CorbaUnknownPortException __ex) {
                    out = rh.createExceptionReply();
                    ptolemy.domains.ct.demo.Corba.util.CorbaUnknownPortExceptionHelper.write(out, __ex);
                }
                break;
            }
        /* Return true if there is a parameter of the specified
             * name defined in the actor.
             */
        case // util/CorbaActor/hasParameter
        4:
            {
                String paramName = in.read_string();
                boolean __result = false;
                __result = this.hasParameter(paramName);
                out = rh.createReply();
                out.write_boolean(__result);
                break;
            }
        /* Return true if there is a port of the specified name
             * and specified property contained by the actor.
             * @param portName The name of the port.
             * @param isInput True if the port is an input port.
             * @param isOutput True if the port is an output port.
             * @param isMultiport True if the port is a multiport.
             */
        case // util/CorbaActor/hasPort
        5:
            {
                String portName = in.read_string();
                boolean isInput = in.read_boolean();
                boolean isOutput = in.read_boolean();
                boolean isMultiport = in.read_boolean();
                boolean __result = false;
                __result = this.hasPort(portName, isInput, isOutput, isMultiport);
                out = rh.createReply();
                out.write_boolean(__result);
                break;
            }
        /* Set the width of the specified port.
             * @param portName The name of the port.
             * @param width The width to be set.
             * @exception CorbaIllegalActionException If the width
             *  to be set is not supported by the port, e.g. the
             *  port is restricted to a single port, but the width
             *  to be set is greater than one.
             * @exception CorbaUnknownPortException If the port is \
             *  not known by the actor.
             */
        case // util/CorbaActor/setPortWidth
        6:
            {
                try {
                    String portName = in.read_string();
                    short width = in.read_short();
                    this.setPortWidth(portName, width);
                    out = rh.createReply();
                } catch (ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionException __ex) {
                    out = rh.createExceptionReply();
                    ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionExceptionHelper.write(out, __ex);
                } catch (ptolemy.domains.ct.demo.Corba.util.CorbaUnknownPortException __ex) {
                    out = rh.createExceptionReply();
                    ptolemy.domains.ct.demo.Corba.util.CorbaUnknownPortExceptionHelper.write(out, __ex);
                }
                break;
            }
        /* Mirror the postfire() method of the Ptolmey
             * executable interface.
             * @exception CorbaIllegalActionException If the
             *   method is an illegal action of the actor.
             */
        case // util/CorbaActor/postfire
        7:
            {
                try {
                    boolean __result = false;
                    __result = this.postfire();
                    out = rh.createReply();
                    out.write_boolean(__result);
                } catch (ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionException __ex) {
                    out = rh.createExceptionReply();
                    ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionExceptionHelper.write(out, __ex);
                }
                break;
            }
        /* Mirror the prefire() method of the Ptolmey
             * executable interface.
             * @exception CorbaIllegalActionException If the
             *   method is an illegal action of the actor.
             */
        case // util/CorbaActor/prefire
        8:
            {
                try {
                    boolean __result = false;
                    __result = this.prefire();
                    out = rh.createReply();
                    out.write_boolean(__result);
                } catch (ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionException __ex) {
                    out = rh.createExceptionReply();
                    ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionExceptionHelper.write(out, __ex);
                }
                break;
            }
        /* Set the value of the specified parameter.
             * @param paramName The parameter name.
             * @param paramValue The value to be set.
             * @exception CorbaIllegalActionException If the set
             *  value opertaion is not supported by the parameter.
             * @exception CorbaUnknownParamException If the
             *  parameter name is not known by the actor.
             * @exception CorbaIllegalValueException If the value
             *  is invalid for this parameter.
             */
        case // util/CorbaActor/setParameter
        9:
            {
                try {
                    String paramName = in.read_string();
                    String paramValue = in.read_string();
                    this.setParameter(paramName, paramValue);
                    out = rh.createReply();
                } catch (ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionException __ex) {
                    out = rh.createExceptionReply();
                    ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionExceptionHelper.write(out, __ex);
                } catch (ptolemy.domains.ct.demo.Corba.util.CorbaUnknownParamException __ex) {
                    out = rh.createExceptionReply();
                    ptolemy.domains.ct.demo.Corba.util.CorbaUnknownParamExceptionHelper.write(out, __ex);
                } catch (ptolemy.domains.ct.demo.Corba.util.CorbaIllegalValueException __ex) {
                    out = rh.createExceptionReply();
                    ptolemy.domains.ct.demo.Corba.util.CorbaIllegalValueExceptionHelper.write(out, __ex);
                }
                break;
            }
        /*  Mirror the stopFire() method of the Ptolmey
             * executable interface.
             * @exception CorbaIllegalActionException If the
             *   method is an illegal action of the actor.
             */
        case // util/CorbaActor/stopFire
        10:
            {
                try {
                    this.stopFire();
                    out = rh.createReply();
                } catch (ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionException __ex) {
                    out = rh.createExceptionReply();
                    ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionExceptionHelper.write(out, __ex);
                }
                break;
            }
        /* Mirror the terminate() method of the Ptolmey
             * executable interface.
             * @exception CorbaIllegalActionException If the
             *   method is an illegal action of the actor.
             */
        case // util/CorbaActor/terminate
        11:
            {
                try {
                    this.terminate();
                    out = rh.createReply();
                } catch (ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionException __ex) {
                    out = rh.createExceptionReply();
                    ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionExceptionHelper.write(out, __ex);
                }
                break;
            }
        /* Transfer the input data to the specified port.
             * @param portName The port name.
             * @param portIndex The channel number within the port.
             * @param tokenValue The string for the value of the
             *        data token.
             * @exception CorbaIllegalActionException If the action is
             *  illegal.
             * @exception CorbaUnknownPortException If the port is unknown.
             * @exception CorbaIndexOutofBoundException If the index
             *  number is out of the width of the port.
             * @exception CorbaIllegalValueException If the value is not
             *  valid, e.g. the string cannot be converted to a value.
             */
        case // util/CorbaActor/transferInput
        12:
            {
                try {
                    String portName = in.read_string();
                    short portIndex = in.read_short();
                    String tokenValue = in.read_string();
                    this.transferInput(portName, portIndex, tokenValue);
                    out = rh.createReply();
                } catch (ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionException __ex) {
                    out = rh.createExceptionReply();
                    ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionExceptionHelper.write(out, __ex);
                } catch (ptolemy.domains.ct.demo.Corba.util.CorbaUnknownPortException __ex) {
                    out = rh.createExceptionReply();
                    ptolemy.domains.ct.demo.Corba.util.CorbaUnknownPortExceptionHelper.write(out, __ex);
                } catch (ptolemy.domains.ct.demo.Corba.util.CorbaIndexOutofBoundException __ex) {
                    out = rh.createExceptionReply();
                    ptolemy.domains.ct.demo.Corba.util.CorbaIndexOutofBoundExceptionHelper.write(out, __ex);
                } catch (ptolemy.domains.ct.demo.Corba.util.CorbaIllegalValueException __ex) {
                    out = rh.createExceptionReply();
                    ptolemy.domains.ct.demo.Corba.util.CorbaIllegalValueExceptionHelper.write(out, __ex);
                }
                break;
            }
        /* Transfer the output from an output port.
             * @param portName The port name
             * @param portIndex The channel index within the port.
             * @exception CorbaIllegalActionException If the operation
             *  is illegal, e.g. the port is not an output port.
             * @exception CorbaUnknownPortException If the port name
             *  is unknown.
             * @exception CorbaIndexOutofBoundException If the index
             *  number is out of the width of the port.
             */
        case // util/CorbaActor/transferOutput
        13:
            {
                try {
                    String portName = in.read_string();
                    short portIndex = in.read_short();
                    String __result = null;
                    __result = this.transferOutput(portName, portIndex);
                    out = rh.createReply();
                    out.write_string(__result);
                } catch (ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionException __ex) {
                    out = rh.createExceptionReply();
                    ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionExceptionHelper.write(out, __ex);
                } catch (ptolemy.domains.ct.demo.Corba.util.CorbaUnknownPortException __ex) {
                    out = rh.createExceptionReply();
                    ptolemy.domains.ct.demo.Corba.util.CorbaUnknownPortExceptionHelper.write(out, __ex);
                } catch (ptolemy.domains.ct.demo.Corba.util.CorbaIndexOutofBoundException __ex) {
                    out = rh.createExceptionReply();
                    ptolemy.domains.ct.demo.Corba.util.CorbaIndexOutofBoundExceptionHelper.write(out, __ex);
                }
                break;
            }
        /* Mirror the wrapup() method of the Ptolmey
             * executable interface.
             * @exception CorbaIllegalActionException If the
             *   method is an illegal action of the actor.
             */
        case // util/CorbaActor/wrapup
        14:
            {
                try {
                    this.wrapup();
                    out = rh.createReply();
                } catch (ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionException __ex) {
                    out = rh.createExceptionReply();
                    ptolemy.domains.ct.demo.Corba.util.CorbaIllegalActionExceptionHelper.write(out, __ex);
                }
                break;
            }
        default:
            throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    }
    return out;
}
Example 58
Project: robovm-master  File: OldIntegerTest.java View source code
public void test_getIntegerLjava_lang_StringI() {
    // Test for method java.lang.Integer
    // java.lang.Integer.getInteger(java.lang.String, int)
    Properties tProps = new Properties();
    tProps.put("testIncInt", "notInt");
    System.setProperties(tProps);
    assertTrue("returned incorrect default Integer", Integer.getInteger("testIncInt", 4).equals(new Integer(4)));
}
Example 59
Project: hawk-drivers-master  File: SVersion.java View source code
public void sSet(SField sField, Object val) {
    if (sField.getName().equals("major")) {
        setMajor((Integer) val);
        return;
    }
    if (sField.getName().equals("minor")) {
        setMinor((Integer) val);
        return;
    }
    if (sField.getName().equals("revision")) {
        setRevision((Integer) val);
        return;
    }
    if (sField.getName().equals("date")) {
        setDate((Date) val);
        return;
    }
    if (sField.getName().equals("downloadUrl")) {
        setDownloadUrl((String) val);
        return;
    }
    if (sField.getName().equals("supportUrl")) {
        setSupportUrl((String) val);
        return;
    }
    if (sField.getName().equals("supportEmail")) {
        setSupportEmail((String) val);
        return;
    }
    if (sField.getName().equals("oid")) {
        setOid((Long) val);
        return;
    }
    if (sField.getName().equals("rid")) {
        setRid((Integer) val);
        return;
    }
    throw new RuntimeException("Field " + sField.getName() + " not found");
}
Example 60
Project: FIP3A-master  File: file_listPOA.java View source code
public org.omg.CORBA.portable.OutputStream _invoke(String method, org.omg.CORBA.portable.InputStream _input, org.omg.CORBA.portable.ResponseHandler handler) throws org.omg.CORBA.SystemException {
    org.omg.CORBA.portable.OutputStream _out = null;
    // do something
    // quick lookup of operation
    java.lang.Integer opsIndex = (java.lang.Integer) m_opsHash.get(method);
    if (null == opsIndex)
        throw new org.omg.CORBA.BAD_OPERATION(method + " not found");
    switch(opsIndex.intValue()) {
        // next_one
        case 0:
            {
                files.directory_entryHolder _arg0 = new files.directory_entryHolder();
                _arg0._read(_input);
                _out = handler.createReply();
                _out.write_boolean(next_one(_arg0));
                files.directory_entryHelper.write(_out, _arg0.value);
                break;
            }
    }
    return _out;
}
Example 61
Project: camel-master  File: ManagedBrowsableEndpointTest.java View source code
public void testBrowseableEndpoint() throws Exception {
    // JMX tests dont work well on AIX CI servers (hangs them)
    if (isPlatform("aix")) {
        return;
    }
    getMockEndpoint("mock:result").expectedMessageCount(2);
    template.sendBody("direct:start", "Hello World");
    template.sendBody("direct:start", "Bye World");
    assertMockEndpointsSatisfied();
    MBeanServer mbeanServer = getMBeanServer();
    ObjectName name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"mock://result\"");
    String uri = (String) mbeanServer.getAttribute(name, "EndpointUri");
    assertEquals("mock://result", uri);
    Long size = (Long) mbeanServer.invoke(name, "queueSize", null, null);
    assertEquals(2, size.longValue());
    String out = (String) mbeanServer.invoke(name, "browseExchange", new Object[] { 0 }, new String[] { "java.lang.Integer" });
    assertNotNull(out);
    // message body is not dumped when browsing exchange
    assertFalse(out.contains("Hello World"));
    out = (String) mbeanServer.invoke(name, "browseExchange", new Object[] { 1 }, new String[] { "java.lang.Integer" });
    assertNotNull(out);
    // message body is not dumped when browsing exchange
    assertFalse(out.contains("Bye World"));
    out = (String) mbeanServer.invoke(name, "browseMessageBody", new Object[] { 1 }, new String[] { "java.lang.Integer" });
    assertNotNull(out);
    assertEquals("Bye World", out);
}
Example 62
Project: lombok-pg-master  File: DoPrivilegedPlain.java View source code
@lombok.DoPrivileged
@java.lang.SuppressWarnings("all")
int test1() {
    try {
        return java.security.AccessController.doPrivileged(new java.security.PrivilegedExceptionAction<java.lang.Integer>() {

            x() {
                super();
            }

            public java.lang.Integer run() {
                System.out.println("Test");
                return 0;
            }
        });
    } catch (final java.security.PrivilegedActionException $ex) {
        final java.lang.Throwable $cause = $ex.getCause();
        throw new java.lang.RuntimeException($cause);
    }
}
Example 63
Project: pojobuilder-master  File: PojoWithGuavaOptionalBuilder.java View source code
/**
   * Creates a new {@link PojoWithGuavaOptional} based on this builder's settings.
   *
   * @return the created PojoWithGuavaOptional
   */
public PojoWithGuavaOptional build() {
    try {
        PojoWithGuavaOptional result = new PojoWithGuavaOptional();
        if (isSet$primitiveInt$int) {
            result.primitiveInt = value$primitiveInt$int;
        }
        if (isSet$boxedInt$java$lang$Integer) {
            result.boxedInt = value$boxedInt$java$lang$Integer;
        }
        if (isSet$array$int$L) {
            result.array = value$array$int$L;
        }
        return result;
    } catch (RuntimeException ex) {
        throw ex;
    } catch (Exception ex) {
        throw new java.lang.reflect.UndeclaredThrowableException(ex);
    }
}
Example 64
Project: agile-itsm-master  File: CaracteristicaTipoItemConfiguracaoServiceEjb.java View source code
/*
     * (non-Javadoc)
     * @see
     * br.com.centralit.citcorpore.negocio.CaracteristicaTipoItemConfiguracaoService
     * #excluirAssociacaoCaracteristicaTipoItemConfiguracao(java.lang.Integer,
     * java.lang.Integer)
     */
@Override
public void excluirAssociacaoCaracteristicaTipoItemConfiguracao(final Integer idTipoItemConfiguracao, final Integer idCaracteristica) throws Exception {
    if (idCaracteristica != null && idCaracteristica.intValue() != 0) {
        this.getDao().excluirAssociacaoCaracteristicaTipoItemConfiguracao(idTipoItemConfiguracao, idCaracteristica);
    } else {
        final Collection<CaracteristicaDTO> caracteristicas = this.getCaracteristicaService().consultarCaracteristicasAtivas(idTipoItemConfiguracao);
        if (caracteristicas != null && !caracteristicas.isEmpty()) {
            for (final CaracteristicaDTO caracteristica : caracteristicas) {
                this.getDao().excluirAssociacaoCaracteristicaTipoItemConfiguracao(idTipoItemConfiguracao, caracteristica.getIdCaracteristica());
            }
        }
    }
}
Example 65
Project: jboss-openjdk-orb-master  File: _CodeBaseImplBase.java View source code
public org.omg.CORBA.portable.OutputStream _invoke(String method, org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler rh) {
    org.omg.CORBA.portable.OutputStream out = rh.createReply();
    java.lang.Integer __method = (java.lang.Integer) _methods.get(method);
    if (__method == null)
        throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    switch(__method.intValue()) {
        // Operation to obtain the IR from the sending context
        case // SendingContext/CodeBase/get_ir
        0:
            {
                com.sun.org.omg.CORBA.Repository __result = null;
                __result = this.get_ir();
                com.sun.org.omg.CORBA.RepositoryHelper.write(out, __result);
                break;
            }
        // Operations to obtain a URL to the implementation code
        case // SendingContext/CodeBase/implementation
        1:
            {
                String x = com.sun.org.omg.CORBA.RepositoryIdHelper.read(in);
                String __result = null;
                __result = this.implementation(x);
                out.write_string(__result);
                break;
            }
        case // SendingContext/CodeBase/implementations
        2:
            {
                String x[] = com.sun.org.omg.CORBA.RepositoryIdSeqHelper.read(in);
                String __result[] = null;
                __result = this.implementations(x);
                com.sun.org.omg.SendingContext.CodeBasePackage.URLSeqHelper.write(out, __result);
                break;
            }
        // the same information
        case // SendingContext/CodeBase/meta
        3:
            {
                String x = com.sun.org.omg.CORBA.RepositoryIdHelper.read(in);
                com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription __result = null;
                __result = this.meta(x);
                com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescriptionHelper.write(out, __result);
                break;
            }
        case // SendingContext/CodeBase/metas
        4:
            {
                String x[] = com.sun.org.omg.CORBA.RepositoryIdSeqHelper.read(in);
                com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription __result[] = null;
                __result = this.metas(x);
                com.sun.org.omg.SendingContext.CodeBasePackage.ValueDescSeqHelper.write(out, __result);
                break;
            }
        // information
        case // SendingContext/CodeBase/bases
        5:
            {
                String x = com.sun.org.omg.CORBA.RepositoryIdHelper.read(in);
                String __result[] = null;
                __result = this.bases(x);
                com.sun.org.omg.CORBA.RepositoryIdSeqHelper.write(out, __result);
                break;
            }
        default:
            throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    }
    return out;
}
Example 66
Project: jdbc-for-kafka-master  File: GetAllPartitionsMetadata.java View source code
@Override
public ResultSet execute(ConsumerConnection connection, String... params) throws TopicNotFoundException, NoPartitionsException {
    List<PartitionMetadata> metadata = null;
    List<String> columns = new ArrayList<String>();
    List<Integer> types = new ArrayList<Integer>();
    List<String> typeClassNames = new ArrayList<String>();
    columns.add("leader");
    types.add(Types.BINARY);
    typeClassNames.add("kafka.cluster.Broker");
    columns.add("partitionId");
    types.add(Types.INTEGER);
    typeClassNames.add("java.lang.Integer");
    columns.add("sizeInBytes");
    types.add(Types.INTEGER);
    typeClassNames.add("java.lang.Integer");
    metadata = connection.getAllPartsMetadata();
    return new PartitionMetadataResultSet(metadata, new ResultSetMetaData(columns, types, typeClassNames));
}
Example 67
Project: jdk7u-corba-master  File: _CodeBaseImplBase.java View source code
public org.omg.CORBA.portable.OutputStream _invoke(String method, org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler rh) {
    org.omg.CORBA.portable.OutputStream out = rh.createReply();
    java.lang.Integer __method = (java.lang.Integer) _methods.get(method);
    if (__method == null)
        throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    switch(__method.intValue()) {
        // Operation to obtain the IR from the sending context
        case // SendingContext/CodeBase/get_ir
        0:
            {
                com.sun.org.omg.CORBA.Repository __result = null;
                __result = this.get_ir();
                com.sun.org.omg.CORBA.RepositoryHelper.write(out, __result);
                break;
            }
        // Operations to obtain a URL to the implementation code
        case // SendingContext/CodeBase/implementation
        1:
            {
                String x = com.sun.org.omg.CORBA.RepositoryIdHelper.read(in);
                String __result = null;
                __result = this.implementation(x);
                out.write_string(__result);
                break;
            }
        case // SendingContext/CodeBase/implementations
        2:
            {
                String x[] = com.sun.org.omg.CORBA.RepositoryIdSeqHelper.read(in);
                String __result[] = null;
                __result = this.implementations(x);
                com.sun.org.omg.SendingContext.CodeBasePackage.URLSeqHelper.write(out, __result);
                break;
            }
        // the same information
        case // SendingContext/CodeBase/meta
        3:
            {
                String x = com.sun.org.omg.CORBA.RepositoryIdHelper.read(in);
                com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription __result = null;
                __result = this.meta(x);
                com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescriptionHelper.write(out, __result);
                break;
            }
        case // SendingContext/CodeBase/metas
        4:
            {
                String x[] = com.sun.org.omg.CORBA.RepositoryIdSeqHelper.read(in);
                com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription __result[] = null;
                __result = this.metas(x);
                com.sun.org.omg.SendingContext.CodeBasePackage.ValueDescSeqHelper.write(out, __result);
                break;
            }
        // information
        case // SendingContext/CodeBase/bases
        5:
            {
                String x = com.sun.org.omg.CORBA.RepositoryIdHelper.read(in);
                String __result[] = null;
                __result = this.bases(x);
                com.sun.org.omg.CORBA.RepositoryIdSeqHelper.write(out, __result);
                break;
            }
        default:
            throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    }
    return out;
}
Example 68
Project: ManagedRuntimeInitiative-master  File: NotAnMBeanTest.java View source code
public static void main(String[] args) throws Exception {
    System.out.println("Try to create a java.lang.Integer as an MBean");
    MBeanServer mbs = MBeanServerFactory.createMBeanServer();
    try {
        mbs.createMBean("java.lang.Integer", null);
        System.out.println("TEST FAILS: createMBean of " + "java.lang.Integer succeeded!");
        System.exit(1);
    } catch (NotCompliantMBeanException e) {
        System.out.println("Got expected exception: " + e);
        System.out.println("Test passed");
    }
}
Example 69
Project: openjdk-master  File: NotAnMBeanTest.java View source code
public static void main(String[] args) throws Exception {
    System.out.println("Try to create a java.lang.Integer as an MBean");
    MBeanServer mbs = MBeanServerFactory.createMBeanServer();
    try {
        mbs.createMBean("java.lang.Integer", null);
        System.out.println("TEST FAILS: createMBean of " + "java.lang.Integer succeeded!");
        System.exit(1);
    } catch (NotCompliantMBeanException e) {
        System.out.println("Got expected exception: " + e);
        System.out.println("Test passed");
    }
}
Example 70
Project: hideyoshi-master  File: DataSources.java View source code
public String returnScript(WebSphereProfileConfiguration wasConfig) {
    List<DataSourceConfiguration> dataSourceList = wasConfig.getDataSource();
    if (dataSourceList == null) {
        return "";
    }
    StringBuilder script = new StringBuilder();
    for (DataSourceConfiguration dataSource : dataSourceList) {
        String name = dataSource.getName();
        String jndiName = dataSource.getJndiName();
        String databaseName = dataSource.getDatabaseName();
        String driverType = dataSource.getDriverType();
        String serverName = wasConfig.getServerName();
        String portNumber = dataSource.getPortNumber();
        String dataStoreHelperClassName = dataSource.getDataStoreHelperClassName();
        String componentManagedAuthenticationAlias = dataSource.getComponentManagedAuthenticationAlias();
        String xaRecoveryAuthAlias = dataSource.getXaRecoveryAuthAlias();
        script.append("nodeList = AdminTask.listJDBCProviders().split('\\r\\n')\n");
        script.append("jdbcProvider = nodeList[len(nodeList)-1]\n");
        script.append("dsId = \"\"\n");
        script.append("dsList = AdminConfig.getid(\"/DataSource:").append(name).append("\")\n");
        script.append("if (len(dsList) > 0):\n");
        script.append("  for item in dsList.split('\\n'):\n");
        script.append("      item = item.rstrip()\n");
        script.append("      jndiName = AdminConfig.showAttribute(item, \"jndiName\" )\n");
        script.append("      if (\"").append(jndiName).append("\" == jndiName):\n");
        script.append("          dsId = item\n");
        script.append("if (dsId == \"\"):\n");
        script.append("  AdminTask.createDatasource(jdbcProvider , ['-name', '").append(name).append("', '-jndiName', '").append(jndiName).append("', '-configureResourceProperties', '[[databaseName java.lang.String ").append(databaseName).append("] [driverType java.lang.Integer ").append(driverType).append("] [serverName java.lang.String  ").append(serverName).append("] [portNumber java.lang.Integer ").append(portNumber).append("]]', '-dataStoreHelperClassName', '").append(dataStoreHelperClassName).append("', '-componentManagedAuthenticationAlias', '").append(componentManagedAuthenticationAlias).append("', '-xaRecoveryAuthAlias', '").append(xaRecoveryAuthAlias).append("'])\n");
        script.append("else:\n");
        script.append("  print \"").append(name).append(" already exists in this JDBC Provider!\"\n");
        script.append("  print \"Removing existing data source and creating a new one\"\n");
        script.append("  AdminConfig.remove(dsId)\n");
        script.append("  AdminConfig.save()\n");
        script.append("  AdminTask.createDatasource(jdbcProvider , ['-name', '").append(name).append("', '-jndiName', '").append(jndiName).append("', '-configureResourceProperties', '[[databaseName java.lang.String ").append(databaseName).append("] [driverType java.lang.Integer ").append(driverType).append("] [serverName java.lang.String  ").append(serverName).append("] [portNumber java.lang.Integer ").append(portNumber).append("]]', '-dataStoreHelperClassName', '").append(dataStoreHelperClassName).append("', '-componentManagedAuthenticationAlias', '").append(componentManagedAuthenticationAlias).append("', '-xaRecoveryAuthAlias', '").append(xaRecoveryAuthAlias).append("'])\n");
    }
    script.append("print 'Successfully configured data sources.'\n");
    return script.toString();
}
Example 71
Project: janala2-gradle-master  File: ObjectFactory.java View source code
public static ObjectValue create(int nFields, String className) {
    if (className.equals("java.lang.Integer")) {
        return new IntegerObjectValue();
    } else if (className.equals("java.lang.Long")) {
        return new LongObjectValue();
    } else if (className.equals("java.sql.Date") || className.equals("java.sql.Time") || className.equals("java.sql.Timestamp") || className.equals("java.util.Date")) {
        return new SqlDateObjectValue();
    }
    return new ObjectValue(nFields);
}
Example 72
Project: janala2-master  File: ObjectFactory.java View source code
public static ObjectValue create(int nFields, String className) {
    if (className.equals("java.lang.Integer")) {
        return new IntegerObjectValue();
    } else if (className.equals("java.lang.Long")) {
        return new LongObjectValue();
    } else if (className.equals("java.sql.Date") || className.equals("java.sql.Time") || className.equals("java.sql.Timestamp") || className.equals("java.util.Date")) {
        return new SqlDateObjectValue();
    }
    return new ObjectValue(nFields);
}
Example 73
Project: sample-skeleton-projects-master  File: SampleClassTest.java View source code
@Test
public void testPrivateLargeIntegerNoArg() {
    try {
        // Get the zero arg constructor
        Constructor<SampleClass> zeroArgCons = SampleClass.class.getConstructor();
        // call the contructor
        SampleClass classRef = zeroArgCons.newInstance();
        // get the method
        Method intPrivateMethod = SampleClass.class.getDeclaredMethod("getLargerInteger", java.lang.Integer.class, java.lang.Integer.class);
        // set it TRUE
        intPrivateMethod.setAccessible(Boolean.TRUE);
        // and now, invoke the method
        Object result = intPrivateMethod.invoke(classRef, 2, 3);
        assertNotNull(result);
        assertEquals(result, 2);
        result = intPrivateMethod.invoke(classRef, 3, 2);
        assertNotNull(result);
        assertEquals(result, 2);
    } catch (NoSuchMethodExceptionSecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException |  e) {
        log.error(e.getMessage(), e);
    }
}
Example 74
Project: snomed-content-service-master  File: RefsetBrowseServiceStub.java View source code
/* (non-Javadoc)
	 * @see org.ihtsdo.otf.refset.service.RefsetBrowseService#getRefsets(java.lang.Integer, java.lang.Integer)
	 */
@Override
public List<Refset> getRefsets(Integer page, Integer size, boolean published) throws RefsetServiceException {
    LOGGER.debug("getRefsets");
    if (page == 1 && size == 10) {
        return dataService.getRefSets();
    }
    List<Refset> refsets = dataService.getRefSets();
    int total = refsets.size();
    int from_temp = page >= 1 ? (Math.min(total, Math.abs(page * size)) - size) : 0;
    int from = from_temp >= 0 ? from_temp : 0;
    int temp = Math.min(total, Math.abs(page * size));
    int to = temp <= total ? temp : total;
    return refsets.subList(from, to);
}
Example 75
Project: test4j-master  File: MethodDecoderTest.java View source code
@Test
@Ignore
public void testDecodeMethod() {
    String json = "{methodName:'demo2Para',declaredBy:'org.test4j.json.encoder.object.spec.MethodJsonDemo',paraType:['java.lang.String','java.lang.Integer']}";
    Method method = JSON.toObject(json, Method.class);
    want.object(method).notNull();
    want.string(method.getName()).isEqualTo("demo2Para");
}
Example 76
Project: uml-auto-assessment-master  File: ArrayStoreHandlerTest.java View source code
public void testGetBadObjectType() {
    ArrayStoreExceptionHandler handle = new ArrayStoreExceptionHandler();
    ArrayStoreException wrapped = null;
    try {
        Object x[] = new String[3];
        x[0] = new Integer(0);
    } catch (ArrayStoreException e) {
        try {
            wrapped = (ArrayStoreException) handle.wrapException(e);
        } catch (Throwable e1) {
            e1.printStackTrace();
        }
    }
    assertTrue(wrapped.getMessage().contains("java.lang.Integer"));
}
Example 77
Project: fb-contrib-master  File: EXS_Sample.java View source code
public static void testFPBug2646424(String[] args) {
    if (args.length == 0) {
        try {
            Class.forName("java.lang.Integer");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
            return;
        }
    } else {
        throw new IllegalArgumentException("cannot take arguments");
    // EXS
    }
}
Example 78
Project: jdk7u-jdk-master  File: NotAnMBeanTest.java View source code
public static void main(String[] args) throws Exception {
    System.out.println("Try to create a java.lang.Integer as an MBean");
    MBeanServer mbs = MBeanServerFactory.createMBeanServer();
    try {
        mbs.createMBean("java.lang.Integer", null);
        System.out.println("TEST FAILS: createMBean of " + "java.lang.Integer succeeded!");
        System.exit(1);
    } catch (NotCompliantMBeanException e) {
        System.out.println("Got expected exception: " + e);
        System.out.println("Test passed");
    }
}
Example 79
Project: openjdk8-jdk-master  File: NotAnMBeanTest.java View source code
public static void main(String[] args) throws Exception {
    System.out.println("Try to create a java.lang.Integer as an MBean");
    MBeanServer mbs = MBeanServerFactory.createMBeanServer();
    try {
        mbs.createMBean("java.lang.Integer", null);
        System.out.println("TEST FAILS: createMBean of " + "java.lang.Integer succeeded!");
        System.exit(1);
    } catch (NotCompliantMBeanException e) {
        System.out.println("Got expected exception: " + e);
        System.out.println("Test passed");
    }
}
Example 80
Project: voidbase-master  File: FacebookUser.java View source code
@SuppressWarnings(value = "unchecked")
public void put(int field$, java.lang.Object value$) {
    switch(field$) {
        case 0:
            name = (org.apache.avro.util.Utf8) value$;
            break;
        case 1:
            num_likes = (java.lang.Integer) value$;
            break;
        case 2:
            num_photos = (java.lang.Integer) value$;
            break;
        case 3:
            num_groups = (java.lang.Integer) value$;
            break;
        default:
            throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
}
Example 81
Project: replication-datasource-master  File: UserOuterService.java View source code
/**
     * 비� {@link UserInnerService#findByUserIdWithPropagationRequired(java.lang.Integer)} 가 readOnly = true� 하여�
     * Propagation.REQUIRED는 기존 트랜잭션� 존재할 경우 기존 트랜잭션과 커넥션� 재사용하기 때문� 바깥 트랜잭션� 따�
     * Write DB로 요청� 보낸다.
     * <p/>
     * 물론 기존 트랜잭션� 존재하지 않� 경우�는 새로운 트랜잭션� 맺기 때문� 올바르게 작�한다.
     */
@Transactional(readOnly = false)
public Map<String, User> findByIdWriteAndInnerReadWithPropagationRequired(Integer outerFirstId, Integer innerId, Integer outerSecondId) {
    Map<String, User> users = new HashMap<String, User>();
    users.put("outerFirstUser", userRepository.findById(outerFirstId));
    users.put("innerUser", userInnerService.findByUserIdWithPropagationRequired(innerId));
    users.put("outerSecondUser", userRepository.findById(outerSecondId));
    return users;
}
Example 82
Project: geowave-master  File: JavassistUtilsTest.java View source code
@Test
public void testCloneAnnotationsAttribute() {
    CtClass clz = ClassPool.getDefault().makeClass("testCloneAnnotationsAttribute");
    CtMethod ctmethod = addNewMethod(clz, "origMethod");
    AnnotationsAttribute attr = annotateMethod(ctmethod, "origAnno", 135);
    AnnotationsAttribute clonedAttr = JavassistUtils.cloneAnnotationsAttribute(ctmethod.getMethodInfo().getConstPool(), attr, java.lang.annotation.ElementType.METHOD);
    Assert.assertEquals(135, ((IntegerMemberValue) clonedAttr.getAnnotation("java.lang.Integer").getMemberValue("origAnno")).getValue());
}
Example 83
Project: infoglue-master  File: ChangeContentStateAction.java View source code
//private ContentVO contentVO = new ContentVO();	
//private ContentVersionVO contentVersionVO = new ContentVersionVO();	
/**
	 * This method gets called when calling this action. 
	 * If the stateId is 2 which equals that the user tries to prepublish the page. If so we
	 * ask the user for a comment as this is to be regarded as a new version. 
	 */
public String doExecute() throws Exception {
    AccessConstraintExceptionBuffer ceb = new AccessConstraintExceptionBuffer();
    Integer protectedContentId = ContentControllerProxy.getController().getProtectedContentId(contentId);
    if (this.stateId.intValue() == 2) {
        if (protectedContentId != null && !AccessRightController.getController().getIsPrincipalAuthorized(this.getInfoGluePrincipal(), "Content.SubmitToPublish", protectedContentId.toString()))
            ceb.add(new AccessConstraintException("Content.contentId", "1005"));
    } else {
        if (protectedContentId != null && !AccessRightController.getController().getIsPrincipalAuthorized(this.getInfoGluePrincipal(), "Content.CreateVersion", protectedContentId.toString()))
            ceb.add(new AccessConstraintException("Content.contentId", "1007"));
    }
    ceb.throwIfNotEmpty();
    //If the comment is not null we carry out the stateChange
    if (getStateId().intValue() == 2 && getVersionComment() == null) {
        return "commentVersion";
    }
    List events = new ArrayList();
    ContentStateController.changeState(getContentVersionId(), getStateId(), getVersionComment(), this.overrideVersionModifyer, this.recipientFilter, this.getInfoGluePrincipal(), getContentId(), events);
    this.contentVersionId = null;
    return "success";
}
Example 84
Project: jboss-rmi-api_spec-master  File: _CodeBaseImplBase.java View source code
public org.omg.CORBA.portable.OutputStream _invoke(String method, org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler rh) {
    org.omg.CORBA.portable.OutputStream out = rh.createReply();
    java.lang.Integer __method = _methods.get(method);
    if (__method == null)
        throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    switch(__method.intValue()) {
        // Operation to obtain the IR from the sending context
        case // SendingContext/CodeBase/get_ir
        0:
            {
                org.jboss.com.sun.org.omg.CORBA.Repository __result = null;
                __result = this.get_ir();
                org.jboss.com.sun.org.omg.CORBA.RepositoryHelper.write(out, __result);
                break;
            }
        // Operations to obtain a URL to the implementation code
        case // SendingContext/CodeBase/implementation
        1:
            {
                String x = org.jboss.com.sun.org.omg.CORBA.RepositoryIdHelper.read(in);
                String __result = null;
                __result = this.implementation(x);
                out.write_string(__result);
                break;
            }
        case // SendingContext/CodeBase/implementations
        2:
            {
                String x[] = org.jboss.com.sun.org.omg.CORBA.RepositoryIdSeqHelper.read(in);
                String __result[] = null;
                __result = this.implementations(x);
                org.jboss.com.sun.org.omg.SendingContext.CodeBasePackage.URLSeqHelper.write(out, __result);
                break;
            }
        // the same information
        case // SendingContext/CodeBase/meta
        3:
            {
                String x = org.jboss.com.sun.org.omg.CORBA.RepositoryIdHelper.read(in);
                org.jboss.com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription __result = null;
                __result = this.meta(x);
                org.jboss.com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescriptionHelper.write(out, __result);
                break;
            }
        case // SendingContext/CodeBase/metas
        4:
            {
                String x[] = org.jboss.com.sun.org.omg.CORBA.RepositoryIdSeqHelper.read(in);
                org.jboss.com.sun.org.omg.CORBA.ValueDefPackage.FullValueDescription __result[] = null;
                __result = this.metas(x);
                org.jboss.com.sun.org.omg.SendingContext.CodeBasePackage.ValueDescSeqHelper.write(out, __result);
                break;
            }
        // information
        case // SendingContext/CodeBase/bases
        5:
            {
                String x = org.jboss.com.sun.org.omg.CORBA.RepositoryIdHelper.read(in);
                String __result[] = null;
                __result = this.bases(x);
                org.jboss.com.sun.org.omg.CORBA.RepositoryIdSeqHelper.write(out, __result);
                break;
            }
        default:
            throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    }
    return out;
}
Example 85
Project: seam-revisited-master  File: TransformImageSizeTag.java View source code
/* (non-Javadoc)
     * @see org.ajax4jsf.components.taglib.html.HtmlCommandButtonTagBase#setProperties(javax.faces.component.UIComponent)
     */
protected void setProperties(UIComponent component) {
    // TODO Auto-generated method stub
    super.setProperties(component);
    HtmlTransformImageSize comp = (HtmlTransformImageSize) component;
    if (this._factor != null) {
        if (this._factor.isLiteralText()) {
            try {
                java.lang.Double __factor = (java.lang.Double) getFacesContext().getApplication().getExpressionFactory().coerceToType(this._factor.getExpressionString(), java.lang.Double.class);
                comp.setFactor(__factor);
            } catch (ELException e) {
                throw new FacesException(e);
            }
        } else {
            component.setValueExpression("factor", this._factor);
        }
    }
    if (this._height != null) {
        if (this._height.isLiteralText()) {
            try {
                java.lang.Integer __height = (java.lang.Integer) getFacesContext().getApplication().getExpressionFactory().coerceToType(this._height.getExpressionString(), java.lang.Integer.class);
                comp.setHeight(__height);
            } catch (ELException e) {
                throw new FacesException(e);
            }
        } else {
            component.setValueExpression("height", this._height);
        }
    }
    if (this._maintainRatio != null) {
        if (this._maintainRatio.isLiteralText()) {
            try {
                Boolean __maintainRatio = (Boolean) getFacesContext().getApplication().getExpressionFactory().coerceToType(this._maintainRatio.getExpressionString(), Boolean.class);
                comp.setMaintainRatio(__maintainRatio.booleanValue());
            } catch (ELException e) {
                throw new FacesException(e);
            }
        } else {
            component.setValueExpression("maintainRatio", this._maintainRatio);
        }
    }
    if (this._width != null) {
        if (this._width.isLiteralText()) {
            try {
                java.lang.Integer __width = (java.lang.Integer) getFacesContext().getApplication().getExpressionFactory().coerceToType(this._width.getExpressionString(), java.lang.Integer.class);
                comp.setWidth(__width);
            } catch (ELException e) {
                throw new FacesException(e);
            }
        } else {
            component.setValueExpression("width", this._width);
        }
    }
}
Example 86
Project: seam2jsf2-master  File: TransformImageSizeTag.java View source code
/* (non-Javadoc)
     * @see org.ajax4jsf.components.taglib.html.HtmlCommandButtonTagBase#setProperties(javax.faces.component.UIComponent)
     */
protected void setProperties(UIComponent component) {
    // TODO Auto-generated method stub
    super.setProperties(component);
    HtmlTransformImageSize comp = (HtmlTransformImageSize) component;
    if (this._factor != null) {
        if (this._factor.isLiteralText()) {
            try {
                java.lang.Double __factor = (java.lang.Double) getFacesContext().getApplication().getExpressionFactory().coerceToType(this._factor.getExpressionString(), java.lang.Double.class);
                comp.setFactor(__factor);
            } catch (ELException e) {
                throw new FacesException(e);
            }
        } else {
            component.setValueExpression("factor", this._factor);
        }
    }
    if (this._height != null) {
        if (this._height.isLiteralText()) {
            try {
                java.lang.Integer __height = (java.lang.Integer) getFacesContext().getApplication().getExpressionFactory().coerceToType(this._height.getExpressionString(), java.lang.Integer.class);
                comp.setHeight(__height);
            } catch (ELException e) {
                throw new FacesException(e);
            }
        } else {
            component.setValueExpression("height", this._height);
        }
    }
    if (this._maintainRatio != null) {
        if (this._maintainRatio.isLiteralText()) {
            try {
                Boolean __maintainRatio = (Boolean) getFacesContext().getApplication().getExpressionFactory().coerceToType(this._maintainRatio.getExpressionString(), Boolean.class);
                comp.setMaintainRatio(__maintainRatio.booleanValue());
            } catch (ELException e) {
                throw new FacesException(e);
            }
        } else {
            component.setValueExpression("maintainRatio", this._maintainRatio);
        }
    }
    if (this._width != null) {
        if (this._width.isLiteralText()) {
            try {
                java.lang.Integer __width = (java.lang.Integer) getFacesContext().getApplication().getExpressionFactory().coerceToType(this._width.getExpressionString(), java.lang.Integer.class);
                comp.setWidth(__width);
            } catch (ELException e) {
                throw new FacesException(e);
            }
        } else {
            component.setValueExpression("width", this._width);
        }
    }
}
Example 87
Project: domeo-master  File: PubmedArticleManagerImpl.java View source code
/*
	 * Search of PubMed articles records with pagination.
	 * 
	 * (non-Javadoc)
	 * @see org.mindinformatics.services.connector.pubmed.dataaccess.IPubmedArticleManager#searchPubmedArticles(java.lang.String, java.util.List, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer)
	 */
@Override
public Map<Map<String, String>, List<ExternalPubmedArticle>> searchPubmedArticles(String typeQuery, List<String> queryTerms, Integer pubStartMonth, Integer pubStartYear, Integer pubEndMonth, Integer pubEndYear, Integer range, Integer offset) {
    System.out.println("A1******* " + typeQuery);
    PubmedQueryTermBuilder termBuilder = new PubmedQueryTermBuilder();
    // We are restricting the  publication types to a restricted list
    // This restriction might be reconsidered
    List<String> pubTypes = new ArrayList<String>();
    for (String theType : ALLOWABLE_PUBLICATION_TYPES) {
        pubTypes.add(theType.replace(" ", "+"));
    }
    if (CollectionUtils.isNotEmpty(queryTerms)) {
        System.out.println("******* " + typeQuery);
        if (typeQuery.equals(QUERY_TYPE_TITLE)) {
            termBuilder.addJournalArticleTitleWords(queryTerms);
        } else if (typeQuery.equals(QUERY_TYPE_PUBMED_IDS)) {
            termBuilder.addPubmedIds(queryTerms);
            this.maxNumberSearchResults = queryTerms.size();
        } else if (typeQuery.equals(QUERY_TYPE_DOIS)) {
            termBuilder.add(queryTerms);
        } else if (typeQuery.equals(QUERY_TYPE_PUBMED_CENTRAL_IDS)) {
            termBuilder.add(queryTerms);
        } else {
            termBuilder.add(queryTerms);
        }
    }
    termBuilder.setPublicationDateRange(pubStartMonth, pubStartYear, pubEndMonth, pubEndYear);
    // The Integer is the total number of results
    int offsetValidated = 0;
    int maxResultsValidated = 0;
    Map<Integer, PubmedArticleSet> results;
    if (range > 0 && offset >= 0) {
        offsetValidated = offset;
        maxResultsValidated = range;
        results = pubmedSearchAgent.fetchWithStats(termBuilder.toString(), maxResultsValidated, offsetValidated);
    } else {
        // This is just returning the first group of results
        maxResultsValidated = this.getMaxNumberSearchResults();
        results = pubmedSearchAgent.fetchWithStats(termBuilder.toString(), this.getMaxNumberSearchResults(), 0);
    }
    Map<Map<String, String>, List<ExternalPubmedArticle>> mapToReturn = new HashMap<Map<String, String>, List<ExternalPubmedArticle>>();
    if (results == null) {
        Map<String, String> stats = new HashMap<String, String>();
        stats.put("total", Integer.toString(0));
        stats.put("exception", "PubmedArticleManagerImpl.searchPubmedArticles().nullresults");
        mapToReturn.put(stats, new ArrayList<ExternalPubmedArticle>());
        return mapToReturn;
    }
    int totalResults = results.keySet().iterator().next();
    List<ExternalPubmedArticle> convertedResults = convertToExternalPubmedArticles(results.values().iterator().next());
    Map<String, String> stats = new HashMap<String, String>();
    stats.put("total", Integer.toString(totalResults));
    stats.put("range", Integer.toString(maxResultsValidated));
    stats.put("offset", Integer.toString(offsetValidated));
    mapToReturn.put(stats, convertedResults);
    return mapToReturn;
}
Example 88
Project: geotools-2.7.x-master  File: PostgisSQLBuilderTest.java View source code
/**
     * Test method for
     * {@link PostgisSQLBuilder#buildSQLQuery(java.lang.String, org.geotools.data.jdbc.fidmapper.FIDMapper, org.opengis.feature.type.AttributeDescriptor[], org.opengis.filter.Filter, org.opengis.filter.sort.SortBy[], java.lang.Integer, java.lang.Integer)}.
     * 
     * @throws SQLEncoderException
     */
public void testBuildSQLQueryNoOffsetNoLimit() throws SQLEncoderException {
    FIDMapper mapper = new OIDFidMapper();
    SortBy[] sortBy = null;
    Integer offset = null;
    Integer limit = null;
    String sql = buildSQLQuery(mapper, sortBy, offset, limit);
    final String baseSelect = "SELECT \"oid\", \"attribute\" FROM \"typeName\"";
    assertEquals(baseSelect, sql);
}
Example 89
Project: geotools-old-master  File: PostgisSQLBuilderTest.java View source code
/**
     * Test method for
     * {@link PostgisSQLBuilder#buildSQLQuery(java.lang.String, org.geotools.data.jdbc.fidmapper.FIDMapper, org.opengis.feature.type.AttributeDescriptor[], org.opengis.filter.Filter, org.opengis.filter.sort.SortBy[], java.lang.Integer, java.lang.Integer)}.
     * 
     * @throws SQLEncoderException
     */
public void testBuildSQLQueryNoOffsetNoLimit() throws SQLEncoderException {
    FIDMapper mapper = new OIDFidMapper();
    SortBy[] sortBy = null;
    Integer offset = null;
    Integer limit = null;
    String sql = buildSQLQuery(mapper, sortBy, offset, limit);
    final String baseSelect = "SELECT \"oid\", \"attribute\" FROM \"typeName\"";
    assertEquals(baseSelect, sql);
}
Example 90
Project: geotools-tike-master  File: PostgisSQLBuilderTest.java View source code
/**
     * Test method for
     * {@link PostgisSQLBuilder#buildSQLQuery(java.lang.String, org.geotools.data.jdbc.fidmapper.FIDMapper, org.opengis.feature.type.AttributeDescriptor[], org.opengis.filter.Filter, org.opengis.filter.sort.SortBy[], java.lang.Integer, java.lang.Integer)}.
     * 
     * @throws SQLEncoderException
     */
public void testBuildSQLQueryNoOffsetNoLimit() throws SQLEncoderException {
    FIDMapper mapper = new OIDFidMapper();
    SortBy[] sortBy = null;
    Integer offset = null;
    Integer limit = null;
    String sql = buildSQLQuery(mapper, sortBy, offset, limit);
    final String baseSelect = "SELECT \"oid\", \"attribute\" FROM \"typeName\"";
    assertEquals(baseSelect, sql);
}
Example 91
Project: geotools_trunk-master  File: PostgisSQLBuilderTest.java View source code
/**
     * Test method for
     * {@link PostgisSQLBuilder#buildSQLQuery(java.lang.String, org.geotools.data.jdbc.fidmapper.FIDMapper, org.opengis.feature.type.AttributeDescriptor[], org.opengis.filter.Filter, org.opengis.filter.sort.SortBy[], java.lang.Integer, java.lang.Integer)}.
     * 
     * @throws SQLEncoderException
     */
public void testBuildSQLQueryNoOffsetNoLimit() throws SQLEncoderException {
    FIDMapper mapper = new OIDFidMapper();
    SortBy[] sortBy = null;
    Integer offset = null;
    Integer limit = null;
    String sql = buildSQLQuery(mapper, sortBy, offset, limit);
    final String baseSelect = "SELECT \"oid\", \"attribute\" FROM \"typeName\"";
    assertEquals(baseSelect, sql);
}
Example 92
Project: droolsjbpm-master  File: ReteDslTestEngineTest.java View source code
public void testObjectTypeNodeStep() throws Exception {
    String str = "TestCase 'testOTN'\nTest 'dummy'\n";
    str += "ObjectTypeNode :\n";
    str += "otn1, java.lang.Integer;\n";
    NodeTestResult result = executeTest(str);
    ObjectTypeNode otn1 = (ObjectTypeNode) result.context.get("otn1");
    assertNotNull(otn1);
    assertEquals(new ClassObjectType(Integer.class), otn1.getObjectType());
}
Example 93
Project: kunagi-master  File: GTask.java View source code
// --- update properties by map ---
public void updateProperties(Map props) {
    requirementId = (String) props.get("requirementId");
    number = (Integer) props.get("number");
    label = (java.lang.String) props.get("label");
    description = (java.lang.String) props.get("description");
    remainingWork = (Integer) props.get("remainingWork");
    burnedWork = (Integer) props.get("burnedWork");
    ownerId = (String) props.get("ownerId");
    impedimentId = (String) props.get("impedimentId");
}
Example 94
Project: sx10-master  File: RemoteIndexedMemoryChunk.java View source code
public final RemoteIndexedMemoryChunk<T> x10$util$RemoteIndexedMemoryChunk$$init$S(Type<T> T, int length, Object value) {
    this.T = T;
    this.length = length;
    this.home = x10.lang.Runtime.home();
    //TODO: check wraparound
    java.lang.Integer tmpId = lastId.incrementAndGet();
    id2Object.put(tmpId, value);
    java.lang.Integer existingId = object2Id.putIfAbsent(value, tmpId);
    if (existingId != null) {
        this.id = existingId;
        id2Object.remove(tmpId);
    } else {
        this.id = tmpId;
    }
    return this;
}
Example 95
Project: edemocracia-master  File: GraficosLocalServiceClp.java View source code
public java.util.Map<java.lang.String, java.lang.Integer> getUsuariosPorUf(long companyId, com.liferay.portal.model.Country pais) {
    Object returnObj = null;
    try {
        returnObj = _invokableLocalService.invokeMethod(_methodName3, _methodParameterTypes3, new Object[] { companyId, ClpSerializer.translateInput(pais) });
    } catch (Throwable t) {
        t = ClpSerializer.translateThrowable(t);
        if (t instanceof RuntimeException) {
            throw (RuntimeException) t;
        } else {
            throw new RuntimeException(t.getClass().getName() + " is not a valid exception");
        }
    }
    return (java.util.Map<java.lang.String, java.lang.Integer>) ClpSerializer.translateOutput(returnObj);
}
Example 96
Project: HBaseToolbox-master  File: AvroSpatialReference.java View source code
@Override
public AvroSpatialReference build() {
    try {
        AvroSpatialReference record = new AvroSpatialReference();
        record.wkid = fieldSetFlags()[0] ? this.wkid : (java.lang.Integer) defaultValue(fields()[0]);
        return record;
    } catch (Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
    }
}
Example 97
Project: checker-framework-master  File: ClassValInferenceTest.java View source code
public <T extends Number, I extends Number & List<String>> void testGetClass(T typeVar, I intersect) {
    @ClassBound("ClassValInferenceTest") Class<?> c1 = this.getClass();
    @ClassBound("ClassValInferenceTest") Class<?> c2 = getClass();
    String[] array = { "hello" };
    @ClassBound("java.lang.String[]") Class<?> c3 = array.getClass();
    String[][][][] arrayMulti = null;
    @ClassBound("java.lang.String[][][][]") Class<?> c4 = arrayMulti.getClass();
    @ClassBound("java.lang.String") Class<?> c5 = array[0].getClass();
    List<String> list = null;
    @ClassBound("java.util.List") Class<?> c6 = list.getClass();
    @ClassBound("java.lang.Number") Class<?> c7 = typeVar.getClass();
    @ClassBound("java.util.ArrayList") Class<?> c8 = new ArrayList<String>().getClass();
    List<? super Number> wildCardListLB = null;
    List<? extends Number> wildCardListUB = null;
    @ClassBound("java.lang.Object") Class<?> c9 = wildCardListLB.get(0).getClass();
    @ClassBound("java.lang.Number") Class<?> c10 = wildCardListUB.get(0).getClass();
    Integer i = 0;
    @ClassBound("java.lang.Integer") Class<?> c11 = i.getClass();
    @ClassBound("java.lang.Object") Class<?> c12 = intersect.getClass();
    try {
    } catch (NullPointerExceptionArrayIndexOutOfBoundsException |  ex) {
        @ClassBound("java.lang.RuntimeException") Class<?> c = ex.getClass();
    }
}
Example 98
Project: core-master  File: BeansTest.java View source code
@SuppressWarnings("serial")
@Test
public void testTypeCollectionSignature() {
    Collection<Type> types = new ArrayList<Type>();
    types.add(Object.class);
    types.add(new TypeLiteral<List<String>>() {
    }.getType());
    types.add(new TypeLiteral<Map<Integer, String>>() {
    }.getType());
    types.add(new TypeLiteral<Map<Integer, String>>() {
    }.getType());
    types.add(new TypeLiteral<Instance<Integer>[]>() {
    }.getType());
    types.add(Object.class);
    assertEquals(SIGNATURE, Beans.createTypeCollectionId(types));
}
Example 99
Project: eclipselink.runtime-master  File: _CORBAServerManagerImplBase.java View source code
public org.omg.CORBA.portable.OutputStream _invoke(String method, org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler rh) {
    org.omg.CORBA.portable.OutputStream out = rh.createReply();
    java.lang.Integer __method = (java.lang.Integer) _methods.get(method);
    if (__method == null)
        throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    switch(__method.intValue()) {
        case // org/eclipse/persistence/testing/Remote/SunCORBA/CORBAServerManager/createRemoteSessionController
        0:
            {
                org.eclipse.persistence.sessions.remote.corba.sun.CORBARemoteSessionController __result = null;
                __result = this.createRemoteSessionController();
                org.eclipse.persistence.sessions.remote.corba.sun.CORBARemoteSessionControllerHelper.write(out, __result);
                break;
            }
        default:
            throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    }
    return out;
}
Example 100
Project: KnittingBoar-master  File: StartupConfiguration.java View source code
// Used by DatumReader.  Applications should not call. 
@SuppressWarnings(value = "unchecked")
public void put(int field$, java.lang.Object value$) {
    switch(field$) {
        case 0:
            split = (com.cloudera.knittingboar.yarn.avro.generated.FileSplit) value$;
            break;
        case 1:
            iterations = (java.lang.Integer) value$;
            break;
        case 2:
            batchSize = (java.lang.Integer) value$;
            break;
        case 3:
            other = (java.util.Map<java.lang.CharSequence, java.lang.CharSequence>) value$;
            break;
        default:
            throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
}
Example 101
Project: ArchStudio5-master  File: NativePropertyCoder.java View source code
@Override
public IEncodedValue encode(IPropertyCoder masterCoder, Object value) {
    if (value instanceof java.lang.String) {
        return new EncodedValue("java.lang.String", (java.lang.String) value);
    } else if (value instanceof java.lang.Boolean) {
        return new EncodedValue("java.lang.Boolean", ((java.lang.Boolean) value).toString());
    } else if (value instanceof java.lang.Byte) {
        return new EncodedValue("java.lang.Byte", ((java.lang.Byte) value).toString());
    } else if (value instanceof java.lang.Short) {
        return new EncodedValue("java.lang.Short", ((java.lang.Short) value).toString());
    } else if (value instanceof java.lang.Character) {
        return new EncodedValue("java.lang.Character", ((java.lang.Character) value).toString());
    } else if (value instanceof java.lang.Integer) {
        return new EncodedValue("java.lang.Integer", ((java.lang.Integer) value).toString());
    } else if (value instanceof java.lang.Long) {
        return new EncodedValue("java.lang.Long", ((java.lang.Long) value).toString());
    } else if (value instanceof java.lang.Float) {
        return new EncodedValue("java.lang.Float", ((java.lang.Float) value).toString());
    } else if (value instanceof java.lang.Double) {
        return new EncodedValue("java.lang.Double", ((java.lang.Double) value).toString());
    }
    return null;
}