@Test(groups = "dev") public void autoWrapTest() throws EventDeliveryException { ctx.put(MongoSink.AUTO_WRAP, Boolean.toString(true)); ctx.put(MongoSink.DB_NAME, "test_wrap"); MongoSink sink = new MongoSink(); Configurables.configure(sink, ctx); sink.setChannel(channel); sink.start(); Transaction tx = channel.getTransaction(); tx.begin(); String msg = "2012/10/26 11:23:08 [error] 7289#0: *6430831 open() \"/usr/local/nginx/html/50x.html\" failed (2: No such file or directory), client: 10.160.105.161, server: sg15.redatoms.com, request: \"POST /mojo/ajax/embed HTTP/1.0\", upstream: \"fastcgi://unix:/tmp/php-fpm.sock:\", host: \"sg15.redatoms.com\", referrer: \"http://sg15.redatoms.com/mojo/mobile/package\""; Event e = EventBuilder.withBody(msg.getBytes()); channel.put(e); tx.commit(); tx.close(); sink.process(); sink.stop(); DB db = mongo.getDB("test_wrap"); DBCollection collection = db.getCollection("test_log"); DBCursor cursor = collection.find(new BasicDBObject(MongoSink.DEFAULT_WRAP_FIELD, msg)); assertTrue(cursor.hasNext()); DBObject dbObject = cursor.next(); assertNotNull(dbObject); assertEquals(dbObject.get(MongoSink.DEFAULT_WRAP_FIELD), msg); mongo.dropDatabase("test_wrap"); }
private void protect(Context ctx) { /* wipe by removing entries from the context */ for (String s : wipedEntrys) ctx.remove(s); /* Protect entry items */ for (String s : protectedEntrys) { Object o = ctx.get(s); if (o instanceof ISOMsg) { ISOMsg m = (ISOMsg) ctx.get(s); if (m != null) { m = (ISOMsg) m.clone(); ctx.put(s, m); // place a clone in the context for (String p : protectISO) protectField(m, Integer.parseInt(p)); } } if (o instanceof FSDMsg) { FSDMsg m = (FSDMsg) ctx.get(s); if (m != null) { for (String p : protectFSD) protectField(m, p); } } if (o instanceof String) { String p = (String) ctx.get(s); if (p != null) { ctx.put(s, protect(p)); } } } }
private void initContext() { context.put(JavacTaskImpl.class, this); if (context.get(TaskListener.class) != null) context.put(TaskListener.class, (TaskListener) null); if (taskListener != null) context.put(TaskListener.class, ccw.wrap(taskListener)); // initialize compiler's default locale context.put(Locale.class, locale); }
private void renderLine(Object object, Context context, int lineNumber, StringBuilder output) { String lineNumberInput = "#" + this.variableToSetName + "Number"; context.put(lineNumberInput, lineNumber); context.put(this.variableToSetName, object); output.append(this.repeatBlock.renderForContext(context)); context.remove(lineNumberInput); context.remove(this.variableToSetName); }
@Test(groups = "dev") public void timestampExistingFieldTest() throws EventDeliveryException, ParseException { ctx.put(MongoSink.MODEL, MongoSink.CollectionModel.dynamic.name()); String tsField = "createdOn"; ctx.put(MongoSink.TIMESTAMP_FIELD, tsField); MongoSink sink = new MongoSink(); Configurables.configure(sink, ctx); sink.setChannel(channel); sink.start(); JSONObject msg = new JSONObject(); msg.put("age", 11); msg.put("birthday", new Date().getTime()); String dateText = "2013-02-19T14:20:53+08:00"; msg.put(tsField, dateText); Transaction tx; for (int i = 0; i < 10; i++) { tx = channel.getTransaction(); tx.begin(); msg.put("name", "test" + i); JSONObject header = new JSONObject(); header.put(MongoSink.COLLECTION, "my_events"); header.put(MongoSink.DB_NAME, "dynamic_db"); Event e = EventBuilder.withBody(msg.toJSONString().getBytes(), header); channel.put(e); tx.commit(); tx.close(); } sink.process(); sink.stop(); msg.put(tsField, MongoSink.dateTimeFormatter.parseDateTime(dateText).toDate()); for (int i = 0; i < 10; i++) { msg.put("name", "test" + i); System.out.println("i = " + i); DB db = mongo.getDB("dynamic_db"); DBCollection collection = db.getCollection("my_events"); DBCursor cursor = collection.find(new BasicDBObject(msg)); assertTrue(cursor.hasNext()); DBObject dbObject = cursor.next(); assertNotNull(dbObject); assertEquals(dbObject.get("name"), msg.get("name")); assertEquals(dbObject.get("age"), msg.get("age")); assertEquals(dbObject.get("birthday"), msg.get("birthday")); assertTrue(dbObject.get(tsField) instanceof Date); System.out.println("ts = " + dbObject.get(tsField)); } }
@Test(groups = "dev") public void sinkSingleModelTest() throws EventDeliveryException { ctx.put(MongoSink.MODEL, MongoSink.CollectionModel.single.name()); MongoSink sink = new MongoSink(); Configurables.configure(sink, ctx); sink.setChannel(channel); sink.start(); Transaction tx = channel.getTransaction(); tx.begin(); JSONObject msg = new JSONObject(); msg.put("name", "test"); msg.put("age", 11); msg.put("birthday", new Date().getTime()); Event e = EventBuilder.withBody(msg.toJSONString().getBytes()); channel.put(e); tx.commit(); tx.close(); sink.process(); sink.stop(); DB db = mongo.getDB("test_events"); DBCollection collection = db.getCollection("test_log"); DBCursor cursor = collection.find(new BasicDBObject(msg)); assertTrue(cursor.hasNext()); DBObject dbObject = cursor.next(); assertNotNull(dbObject); assertEquals(dbObject.get("name"), msg.get("name")); assertEquals(dbObject.get("age"), msg.get("age")); assertEquals(dbObject.get("birthday"), msg.get("birthday")); }
protected Enter(Context context) { DEBUG.P(this,"Enter(1)"); context.put(enterKey, this); log = Log.instance(context); reader = ClassReader.instance(context); make = TreeMaker.instance(context); syms = Symtab.instance(context); chk = Check.instance(context); memberEnter = MemberEnter.instance(context); annotate = Annotate.instance(context); lint = Lint.instance(context); predefClassDef = make.ClassDef( make.Modifiers(PUBLIC), syms.predefClass.name, null, null, null, null); //predefClass是一个ClassSymbol(PUBLIC|ACYCLIC, names.empty, rootPackage) //且它的Scope members_field已有成员(几个基本类型符号(symbols for basic types)及其他操作符) //请参考Systab类的predefClass字段说明 predefClassDef.sym = syms.predefClass; todo = Todo.instance(context); fileManager = context.get(JavaFileManager.class); names = Name.Table.instance(context); //我加上的 DEBUG.P(0,this,"Enter(1)"); }
public static Names instance(Context context) { Names instance = context.get(namesKey); if (instance == null) { instance = new Names(context); context.put(namesKey, instance); } return instance; }
protected ClassWriter(Context context) { super(context); context.put(ClassWriter.class, this); options = Options.instance(context); attrWriter = AttributeWriter.instance(context); codeWriter = CodeWriter.instance(context); constantWriter = ConstantWriter.instance(context); }
private void dumpEnv(Context context) { try { SortedMap<String, String> map = sortFilter(System.getenv(), PREFIX_ENV); for (Map.Entry<String, ?> entry : map.entrySet()) { context.put("{0} = {1}", entry.getKey(), entry.getValue()); } } catch (SecurityException e) { LOG.warn("System.getenv()に失敗しました", e); } }
@BeforeMethod(groups = {"dev"}) public static void setup() throws UnknownHostException { mongo = new Mongo("localhost", 27017); Map<String, String> ctxMap = new HashMap<String, String>(); ctxMap.put(MongoSink.HOST, "localhost"); ctxMap.put(MongoSink.PORT, "27017"); ctxMap.put(MongoSink.DB_NAME, "test_events"); ctxMap.put(MongoSink.COLLECTION, "test_log"); ctxMap.put(MongoSink.BATCH_SIZE, "100"); ctx.putAll(ctxMap); Context channelCtx = new Context(); channelCtx.put("capacity", "1000000"); channelCtx.put("transactionCapacity", "1000000"); channel = new MemoryChannel(); Configurables.configure(channel, channelCtx); }
private void dumpSystemProperties(Context context) { try { SortedMap<String, Object> map = sortFilter(System.getProperties(), PREFIX_SYSPROP); for (Map.Entry<String, ?> entry : map.entrySet()) { context.put("{0} = {1}", entry.getKey(), entry.getValue()); } } catch (SecurityException e) { LOG.warn("System.getProperties()に失敗しました", e); } }
private Context generateCtx() { Context ctx = new Context(); ctx.put(Context.FLD_CATEGORY, getCategory()); ctx.put(Context.FLD_SUBJECT, getSubject()); ctx.put(Context.FLD_PREDICATE, getPredicate()); ctx.put(Context.FLD_OBJECT, getObject()); ctx.put(Context.FLD_START_FROM, getStartFrom()); ctx.put(Context.FLD_END_AT, getEndAt()); ctx.put(Context.FLD_SITE, getSite()); ctx.put(Context.FLD_OWNER, getOwner()); // FLD_ID, FLD_TIMESTAMP, FLD_CONSISTENCY are unnecessary ctx.put(Context.FLD_TIMESTAMP, TimeFormat.convert(timestamp)); // Set FLD_TIMESTAMP return ctx; }
private Context loadContext() throws ParseException, IOException { Context context = new Context(); if ((this.contextBaseDir != null) && this.contextBaseDir.exists()) { Collection<File> files = FileUtils.listFiles(this.contextBaseDir, null, false); for (File file : files) { String name = file.getName(); String value = FileUtils.readFileToString(file, CONTEXT_ENCODE); context.put(name, value); } } return context; }
@Test(groups = "dev") public void sinkDynamicDbTest() throws EventDeliveryException { ctx.put(MongoSink.MODEL, MongoSink.CollectionModel.dynamic.name()); MongoSink sink = new MongoSink(); Configurables.configure(sink, ctx); sink.setChannel(channel); sink.start(); JSONObject msg = new JSONObject(); msg.put("age", 11); msg.put("birthday", new Date().getTime()); Transaction tx; for (int i = 0; i < 10; i++) { tx = channel.getTransaction(); tx.begin(); msg.put("name", "test" + i); JSONObject header = new JSONObject(); header.put(MongoSink.COLLECTION, "my_events"); header.put(MongoSink.DB_NAME, "dynamic_db"); Event e = EventBuilder.withBody(msg.toJSONString().getBytes(), header); channel.put(e); tx.commit(); tx.close(); } sink.process(); sink.stop(); for (int i = 0; i < 10; i++) { msg.put("name", "test" + i); System.out.println("i = " + i); DB db = mongo.getDB("dynamic_db"); DBCollection collection = db.getCollection("my_events"); DBCursor cursor = collection.find(new BasicDBObject(msg)); assertTrue(cursor.hasNext()); DBObject dbObject = cursor.next(); assertNotNull(dbObject); assertEquals(dbObject.get("name"), msg.get("name")); assertEquals(dbObject.get("age"), msg.get("age")); assertEquals(dbObject.get("birthday"), msg.get("birthday")); } }
@Override public synchronized void configure(Context context) { spoolDirectory = context.getString(SPOOL_DIRECTORY); Preconditions.checkState( spoolDirectory != null, "Configuration must specify a spooling directory"); completedSuffix = context.getString(SPOOLED_FILE_SUFFIX, DEFAULT_SPOOLED_FILE_SUFFIX); deletePolicy = context.getString(DELETE_POLICY, DEFAULT_DELETE_POLICY); fileHeader = context.getBoolean(FILENAME_HEADER, DEFAULT_FILE_HEADER); fileHeaderKey = context.getString(FILENAME_HEADER_KEY, DEFAULT_FILENAME_HEADER_KEY); basenameHeader = context.getBoolean(BASENAME_HEADER, DEFAULT_BASENAME_HEADER); basenameHeaderKey = context.getString(BASENAME_HEADER_KEY, DEFAULT_BASENAME_HEADER_KEY); batchSize = context.getInteger(BATCH_SIZE, DEFAULT_BATCH_SIZE); inputCharset = context.getString(INPUT_CHARSET, DEFAULT_INPUT_CHARSET); decodeErrorPolicy = DecodeErrorPolicy.valueOf( context .getString(DECODE_ERROR_POLICY, DEFAULT_DECODE_ERROR_POLICY) .toUpperCase(Locale.ENGLISH)); ignorePattern = context.getString(IGNORE_PAT, DEFAULT_IGNORE_PAT); trackerDirPath = context.getString(TRACKER_DIR, DEFAULT_TRACKER_DIR); deserializerType = context.getString(DESERIALIZER, "ZipDeserializer"); deserializerContext = new Context(context.getSubProperties(DESERIALIZER + ".")); consumeOrder = ConsumeOrder.valueOf( context .getString(CONSUME_ORDER, DEFAULT_CONSUME_ORDER.toString()) .toUpperCase(Locale.ENGLISH)); // "Hack" to support backwards compatibility with previous generation of // spooling directory source, which did not support deserializers Integer bufferMaxLineLength = context.getInteger(BUFFER_MAX_LINE_LENGTH); if (bufferMaxLineLength != null && deserializerType != null && deserializerType.equalsIgnoreCase(DEFAULT_DESERIALIZER)) { deserializerContext.put(LineDeserializer.MAXLINE_KEY, bufferMaxLineLength.toString()); } maxBackoff = context.getInteger(MAX_BACKOFF, DEFAULT_MAX_BACKOFF); if (sourceCounter == null) { sourceCounter = new SourceCounter(getName()); } }
/** * This is the main dispatching method, handling all requests. It parses request, extracts * controller and action information, invokes action and forwards to rendering the template. */ public void handleRequest(HttpServletRequest req, HttpServletResponse res) { Context ctx = null; try { log.debug("about to handle request " + req.getServletPath()); /* Convert to multipart request if it has multipart content (fileuploads). */ if (HttpMultipartServletRequest.isMultipartContent(req)) { /* maxFileSize is defined in mega-bytes */ int maxFileSize = 1024 * 1024 * (new Integer(getInitParam(PARAM_MAXFILEUPLOADSIZE, "1")).intValue()); HttpMultipartServletRequest mreq = new HttpMultipartServletRequest(req, maxFileSize, -1); req = mreq; } req.setCharacterEncoding( "UTF-8"); // must set this before getParameter() to get the correct encoding /* create a context for the controller */ HttpSession session = req.getSession(true); // get session, create one if none exists Locale defaultLocale = computeDefaultLocale(supportedLanguages, req.getLocales()); ctx = Context.createInstance(this, session, req, res, defaultLocale); // create context instance ctx.put( CONTEXT_KEY, ctx); // put context into itself - some tools may need a context passed to them Target target = handleAction(ctx, req.getServletPath(), ACTION_INVOCATION_BY_URL); if (target != null) { log.debug("about to go to target " + target); TestTimer targetTimer = new TestTimer("target"); target.go(); targetTimer.done(); log.debug("returned from target"); } } catch (Throwable e) { // catch all sorts of exceptions log.fatalException(e); try { res.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } catch (IOException e1) { log.fatalException(e); } } finally { Context.destroyInstance(); } }
@Override public String renderForContext(Context context) { if (context == null) { return "RepeaterExpression:{No context set}"; } Object collection = this.variableExpression.resolveForObjectAndContext(null, context); if (collection == null) { return ""; } context.put("#" + this.variableToSetName, collection); StringBuilder output = new StringBuilder(); if (collection instanceof Object[]) { Object[] array = (Object[]) collection; for (int i = 0, length = array.length; i < length; i++) { Object obj = array[i]; this.renderLine(obj, context, i, output); } } else if (collection instanceof Iterable) { Iterable<?> iterable = (Iterable<?>) collection; int i = 0; for (Object obj : iterable) { this.renderLine(obj, context, i, output); i++; } } else { output.append("RepeaterExpression:{Expects an Array or an Iterable object}"); } context.remove("#" + this.variableToSetName); return output.toString(); }
/** * Executes action derived from specified path. * * @see #handleAction(Context, String) * @param ctx A context * @param path A path to an action * @param invocationMode One of ACTION_INVOKATION_XXX - During execution, the specified value can * be accessed in request context using the ACTION_INVOKATION_MODE_KEY. This may come handy * for those who need to know if an action was invoked by an url or programatically * @return The target returned by the action or some error target in case of an error. * @throws IOException */ protected Target handleAction(Context ctx, String path, String invocationMode) throws IOException { /* put invokation mode in request context */ ctx.put(ACTION_INVOCATION_MODE_KEY, invocationMode); String[] ca = extractControllerAndActionNames(path); String ctrlName = ca[0]; String actionName = ca[1]; TestTimer timer = new TestTimer("execute"); try { return executeAction(ctx, ctrlName, actionName); } catch (NoSuchActionException nme) { log.warn(nme.getMessage()); ctx.getResponse().sendError(HttpServletResponse.SC_NOT_FOUND); return null; } catch (HttpErrorException hee) { log.warn( "HttpErrorException " + hee.getStatusCode() + " :\"" + ctrlName + "/" + actionName + "\""); ctx.getResponse().sendError(hee.getStatusCode()); return null; } catch (Exception e) { String msg = "error doing action \"" + actionName + "\""; log.fatal(msg); log.fatalException(e); ctx.getResponse().sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); return null; } finally { timer.done(); } }
protected Enter(Context context) { context.put(enterKey, this); log = Log.instance(context); reader = ClassReader.instance(context); make = TreeMaker.instance(context); syms = Symtab.instance(context); chk = Check.instance(context); memberEnter = MemberEnter.instance(context); types = Types.instance(context); annotate = Annotate.instance(context); lint = Lint.instance(context); names = Names.instance(context); predefClassDef = make.ClassDef(make.Modifiers(PUBLIC), syms.predefClass.name, null, null, null, null); predefClassDef.sym = syms.predefClass; todo = Todo.instance(context); fileManager = context.get(JavaFileManager.class); Options options = Options.instance(context); pkginfoOpt = PkgInfo.get(options); }
/** Constructor; enters all predefined identifiers and operators into symbol table. */ private Symtab(Context context) throws CompletionFailure { super(); context.put(symtabKey, this); names = Name.Table.instance(context); byteType = new Type(TypeTags.BYTE, null); charType = new Type(TypeTags.CHAR, null); shortType = new Type(TypeTags.SHORT, null); intType = new Type(TypeTags.INT, null); longType = new Type(TypeTags.LONG, null); floatType = new Type(TypeTags.FLOAT, null); doubleType = new Type(TypeTags.DOUBLE, null); booleanType = new Type(TypeTags.BOOLEAN, null); voidType = new Type(TypeTags.VOID, null); botType = new Type(TypeTags.BOT, null); unknownType = new Type(TypeTags.UNKNOWN, null) { public boolean isSameType(Type that) { return true; } public boolean isSubType(Type that) { return false; } public boolean isSuperType(Type that) { return true; } }; rootPackage = new PackageSymbol(names.empty, null); emptyPackage = new PackageSymbol(names.emptyPackage, rootPackage); noSymbol = new TypeSymbol(0, names.empty, Type.noType, rootPackage); noSymbol.kind = Kinds.NIL; errSymbol = new ClassSymbol(PUBLIC | STATIC, names.any, null, rootPackage); errType = new ErrorType(errSymbol); initType(byteType, "byte", "Byte"); initType(shortType, "short", "Short"); initType(charType, "char", "Character"); initType(intType, "int", "Integer"); initType(longType, "long", "Long"); initType(floatType, "float", "Float"); initType(doubleType, "double", "Double"); initType(booleanType, "boolean", "Boolean"); initType(voidType, "void", "Void"); initType(botType, "<nulltype>"); initType(errType, errSymbol); initType(unknownType, "<any?>"); arrayClass = new ClassSymbol(PUBLIC, names.Array, noSymbol); methodClass = new ClassSymbol(PUBLIC, names.Method, noSymbol); predefClass = new ClassSymbol(PUBLIC, names.empty, rootPackage); Scope scope = new Scope(predefClass); predefClass.members_field = scope; scope.enter(byteType.tsym); scope.enter(shortType.tsym); scope.enter(charType.tsym); scope.enter(intType.tsym); scope.enter(longType.tsym); scope.enter(floatType.tsym); scope.enter(doubleType.tsym); scope.enter(booleanType.tsym); scope.enter(errType.tsym); classes.put(predefClass.fullname, predefClass); reader = ClassReader.instance(context); reader.init(this); objectType = enterClass("java.lang.Object"); classType = enterClass("java.lang.Class"); stringType = enterClass("java.lang.String"); stringBufferType = enterClass("java.lang.StringBuffer"); cloneableType = enterClass("java.lang.Cloneable"); throwableType = enterClass("java.lang.Throwable"); serializableType = enterClass("java.io.Serializable"); errorType = enterClass("java.lang.Error"); exceptionType = enterClass("java.lang.Exception"); runtimeExceptionType = enterClass("java.lang.RuntimeException"); classNotFoundExceptionType = enterClass("java.lang.ClassNotFoundException"); noClassDefFoundErrorType = enterClass("java.lang.NoClassDefFoundError"); assertionErrorType = enterClass("java.lang.AssertionError"); classLoaderType = enterClass("java.lang.ClassLoader"); ClassType arrayClassType = (ClassType) arrayClass.type; arrayClassType.supertype_field = objectType; arrayClassType.interfaces_field = List.make(cloneableType, serializableType); arrayClass.members_field = new Scope(arrayClass); lengthVar = new VarSymbol(PUBLIC | FINAL, names.length, intType, arrayClass); arrayClass.members().enter(lengthVar); Symbol cloneMethod = new MethodSymbol( PUBLIC, names.clone, new MethodType(Type.emptyList, objectType, Type.emptyList, methodClass), arrayClass); arrayClass.members().enter(cloneMethod); nullConst = enterConstant("null", botType); trueConst = enterConstant("true", booleanType.constType(new Integer(1))); falseConst = enterConstant("false", booleanType.constType(new Integer(0))); enterUnop("+", intType, intType, nop); enterUnop("+", longType, longType, nop); enterUnop("+", floatType, floatType, nop); enterUnop("+", doubleType, doubleType, nop); enterUnop("-", intType, intType, ineg); enterUnop("-", longType, longType, lneg); enterUnop("-", floatType, floatType, fneg); enterUnop("-", doubleType, doubleType, dneg); enterUnop("~", intType, intType, ixor); enterUnop("~", longType, longType, lxor); enterUnop("++", byteType, byteType, iadd); enterUnop("++", shortType, shortType, iadd); enterUnop("++", charType, charType, iadd); enterUnop("++", intType, intType, iadd); enterUnop("++", longType, longType, ladd); enterUnop("++", floatType, floatType, fadd); enterUnop("++", doubleType, doubleType, dadd); enterUnop("--", byteType, byteType, isub); enterUnop("--", shortType, shortType, isub); enterUnop("--", charType, charType, isub); enterUnop("--", intType, intType, isub); enterUnop("--", longType, longType, lsub); enterUnop("--", floatType, floatType, fsub); enterUnop("--", doubleType, doubleType, dsub); enterUnop("!", booleanType, booleanType, bool_not); nullcheck = enterUnop("<*nullchk*>", objectType, objectType, nullchk); enterBinop("+", stringType, stringType, stringType, string_add); enterBinop("+", stringType, intType, stringType, string_add); enterBinop("+", stringType, longType, stringType, string_add); enterBinop("+", stringType, floatType, stringType, string_add); enterBinop("+", stringType, doubleType, stringType, string_add); enterBinop("+", stringType, booleanType, stringType, string_add); enterBinop("+", stringType, objectType, stringType, string_add); enterBinop("+", stringType, botType, stringType, string_add); enterBinop("+", intType, stringType, stringType, string_add); enterBinop("+", longType, stringType, stringType, string_add); enterBinop("+", floatType, stringType, stringType, string_add); enterBinop("+", doubleType, stringType, stringType, string_add); enterBinop("+", booleanType, stringType, stringType, string_add); enterBinop("+", objectType, stringType, stringType, string_add); enterBinop("+", botType, stringType, stringType, string_add); enterBinop("+", intType, intType, intType, iadd); enterBinop("+", longType, longType, longType, ladd); enterBinop("+", floatType, floatType, floatType, fadd); enterBinop("+", doubleType, doubleType, doubleType, dadd); enterBinop("+", botType, botType, botType, error); enterBinop("+", botType, intType, botType, error); enterBinop("+", botType, longType, botType, error); enterBinop("+", botType, floatType, botType, error); enterBinop("+", botType, doubleType, botType, error); enterBinop("+", botType, booleanType, botType, error); enterBinop("+", botType, objectType, botType, error); enterBinop("+", intType, botType, botType, error); enterBinop("+", longType, botType, botType, error); enterBinop("+", floatType, botType, botType, error); enterBinop("+", doubleType, botType, botType, error); enterBinop("+", booleanType, botType, botType, error); enterBinop("+", objectType, botType, botType, error); enterBinop("-", intType, intType, intType, isub); enterBinop("-", longType, longType, longType, lsub); enterBinop("-", floatType, floatType, floatType, fsub); enterBinop("-", doubleType, doubleType, doubleType, dsub); enterBinop("*", intType, intType, intType, imul); enterBinop("*", longType, longType, longType, lmul); enterBinop("*", floatType, floatType, floatType, fmul); enterBinop("*", doubleType, doubleType, doubleType, dmul); enterBinop("/", intType, intType, intType, idiv); enterBinop("/", longType, longType, longType, ldiv); enterBinop("/", floatType, floatType, floatType, fdiv); enterBinop("/", doubleType, doubleType, doubleType, ddiv); enterBinop("%", intType, intType, intType, imod); enterBinop("%", longType, longType, longType, lmod); enterBinop("%", floatType, floatType, floatType, fmod); enterBinop("%", doubleType, doubleType, doubleType, dmod); enterBinop("&", booleanType, booleanType, booleanType, iand); enterBinop("&", intType, intType, intType, iand); enterBinop("&", longType, longType, longType, land); enterBinop("|", booleanType, booleanType, booleanType, ior); enterBinop("|", intType, intType, intType, ior); enterBinop("|", longType, longType, longType, lor); enterBinop("^", booleanType, booleanType, booleanType, ixor); enterBinop("^", intType, intType, intType, ixor); enterBinop("^", longType, longType, longType, lxor); enterBinop("<<", intType, intType, intType, ishl); enterBinop("<<", longType, intType, longType, lshl); enterBinop("<<", intType, longType, intType, ishll); enterBinop("<<", longType, longType, longType, lshll); enterBinop(">>", intType, intType, intType, ishr); enterBinop(">>", longType, intType, longType, lshr); enterBinop(">>", intType, longType, intType, ishrl); enterBinop(">>", longType, longType, longType, lshrl); enterBinop(">>>", intType, intType, intType, iushr); enterBinop(">>>", longType, intType, longType, lushr); enterBinop(">>>", intType, longType, intType, iushrl); enterBinop(">>>", longType, longType, longType, lushrl); enterBinop("<", intType, intType, booleanType, if_icmplt); enterBinop("<", longType, longType, booleanType, lcmp, iflt); enterBinop("<", floatType, floatType, booleanType, fcmpg, iflt); enterBinop("<", doubleType, doubleType, booleanType, dcmpg, iflt); enterBinop(">", intType, intType, booleanType, if_icmpgt); enterBinop(">", longType, longType, booleanType, lcmp, ifgt); enterBinop(">", floatType, floatType, booleanType, fcmpl, ifgt); enterBinop(">", doubleType, doubleType, booleanType, dcmpl, ifgt); enterBinop("<=", intType, intType, booleanType, if_icmple); enterBinop("<=", longType, longType, booleanType, lcmp, ifle); enterBinop("<=", floatType, floatType, booleanType, fcmpg, ifle); enterBinop("<=", doubleType, doubleType, booleanType, dcmpg, ifle); enterBinop(">=", intType, intType, booleanType, if_icmpge); enterBinop(">=", longType, longType, booleanType, lcmp, ifge); enterBinop(">=", floatType, floatType, booleanType, fcmpl, ifge); enterBinop(">=", doubleType, doubleType, booleanType, dcmpl, ifge); enterBinop("==", intType, intType, booleanType, if_icmpeq); enterBinop("==", longType, longType, booleanType, lcmp, ifeq); enterBinop("==", floatType, floatType, booleanType, fcmpl, ifeq); enterBinop("==", doubleType, doubleType, booleanType, dcmpl, ifeq); enterBinop("==", booleanType, booleanType, booleanType, if_icmpeq); enterBinop("==", objectType, objectType, booleanType, if_acmpeq); enterBinop("!=", intType, intType, booleanType, if_icmpne); enterBinop("!=", longType, longType, booleanType, lcmp, ifne); enterBinop("!=", floatType, floatType, booleanType, fcmpl, ifne); enterBinop("!=", doubleType, doubleType, booleanType, dcmpl, ifne); enterBinop("!=", booleanType, booleanType, booleanType, if_icmpne); enterBinop("!=", objectType, objectType, booleanType, if_acmpne); enterBinop("&&", booleanType, booleanType, booleanType, bool_and); enterBinop("||", booleanType, booleanType, booleanType, bool_or); }