当前位置: 首页>>代码示例>>Java>>正文


Java VM.isVerbose方法代码示例

本文整理汇总了Java中com.sun.squawk.VM.isVerbose方法的典型用法代码示例。如果您正苦于以下问题:Java VM.isVerbose方法的具体用法?Java VM.isVerbose怎么用?Java VM.isVerbose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.squawk.VM的用法示例。


在下文中一共展示了VM.isVerbose方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isExternallyVisible

import com.sun.squawk.VM; //导入方法依赖的package包/类
/**
     * Given the classes's access and the suite type,
     * determine the final accessibility of the class outside of this suite.
     *
     * @param klass the klass
     * @return true if an external suite could possibly access this klass.
     */
    public boolean isExternallyVisible(Klass klass) {
        int modifiers = klass.getModifiers();
        int suiteType = translator.getSuiteType();

        if (VM.isDynamic(klass)) {
            // if "dynamic", then class may be loaded by Class.findClass(), so we have to assume that it is used.
            Assert.always(!VM.isInternal(klass));
            return true;
        } else if (VM.isInternal(klass)) {
            // if the symbol wasn't marked as "export" or "dynamic" in the library.proprties file,
            // then there is no way that this is externally visible.
            return false;
        } else {
            // It's declared externally visible, but is it really?
            Assert.that(Modifier.isPackagePrivate(modifiers) || Modifier.isProtected(modifiers) || Modifier.isPublic(modifiers));

            switch (suiteType) {
                case Suite.APPLICATION:
                    return false;
                case Suite.LIBRARY:
                    // what can we do here
                    if (Modifier.isPackagePrivate(modifiers)) {
                        // treat as internal:
/*if[ENABLE_VERBOSE]*/
                        if (VM.isVerbose()) {
                            System.out.println("### FYI - Found package-private class: " + klass);
                        }
/*end[ENABLE_VERBOSE]*/			
                        return false;
                    }
                    return true;
                default:
                    // extendable and debuggable suites leave all symbols externally visible.
                    return true;
            }
        }
    }
 
开发者ID:tomatsu,项目名称:squawk,代码行数:45,代码来源:DeadClassEliminator.java

示例2: passed

import com.sun.squawk.VM; //导入方法依赖的package包/类
static void passed(String name) {
    if (VM.isVerbose()) {
        VM.print("Test ");
        VM.print(name);
        VM.print(" passed\n");
    }
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:8,代码来源:MiniTestHelper.java

示例3: run

import com.sun.squawk.VM; //导入方法依赖的package包/类
public void run() {
    try {
        test();
    } catch (TestFailedException ex) {
        System.out.flush();
        System.err.print(">>>>>>>> ");
        System.err.println(Thread.currentThread().getName());
        System.err.print("    ");
        System.err.println(ex.getMessage());
        if (VM.isVerbose()) {
            ex.printStackTrace();
        }
    }
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:15,代码来源:MiniTestHelper.java

示例4: relocateMemory

import com.sun.squawk.VM; //导入方法依赖的package包/类
private void relocateMemory() throws IOException {
      File binFilePath = new File(outFile);
      int[] memoryAddrs = getMemoryAddrs();
      if (VM.isVerbose()) {
          System.out.println("Relocating address in " + suiteFilePath + " to " + Integer.toHexString(requiredRelocationAddress) + " to new file " + binFilePath);
      }
Suite suite = new Suite();
suite.loadFromFile(suiteFilePath,
              new File(bootstrapSuitePath).getPath());
suite.relocateMemory(memoryAddrs);
File outputFile = new File(binFilePath.getAbsolutePath());
FileOutputStream fos = new FileOutputStream(outputFile);
suite.writeToStream(new DataOutputStream(fos));
fos.close();
  }
 
开发者ID:tomatsu,项目名称:squawk,代码行数:16,代码来源:FlashConverter.java

示例5: init

import com.sun.squawk.VM; //导入方法依赖的package包/类
private void init() throws RecordStoreException {
        currentRecordStores = new IRecordStoreEntry[4];
        if (scanVisitor == null) {
            scanVisitor = new RecordStoreManagerScanVisitor(this);
        }
        if (reScanVisitor == null) {
            reScanVisitor = new RecordStoreManagerReScanVisitor(this);
        }
        memoryHeap.scanBlocks(memoryHeapScanner);
        // Done scanning sectors, now check post conditions
        String installedMidletName = VM.getManifestProperty(ApplicationDescriptorEntry.PROPERTY_MIDLET_NAME);
        String installedMidletVendor = VM.getManifestProperty(ApplicationDescriptorEntry.PROPERTY_MIDLET_VENDOR);
        String installedMidletVersion = VM.getManifestProperty(ApplicationDescriptorEntry.PROPERTY_MIDLET_VERSION);
        if (installedMidletName == null || installedMidletVendor == null || installedMidletVersion == null) {
            throw new RecordStoreException("No MIDlet suite installed.");
        }
        String eraseRmsReason = checkMIDletVersion(installedMidletName, installedMidletVendor, installedMidletVersion);
        if (eraseRmsReason != null) {
/*if[ENABLE_VERBOSE]*/
            if (VM.isVerbose()) {
                System.out.println(eraseRmsReason);
            }
/*end[ENABLE_VERBOSE]*/	    
            if (currentApplicationDescriptor != null) {
                invalidateEntryAt(currentApplicationDescriptor.getAddress());
            }
            // TODO This is a down side to my optimization of scanning, where only valid entries are
            // ever present, we need to delete all stores and their records in this case, can I come up
            // with an optimization for this ?
            // This is where timestamps might come in handy, think about it
            // TODO Write a test for this case
            for (int i=0; i < currentRecordStores.length; i++) {
                IRecordStoreEntry store = currentRecordStores[i];
                if (store == null) {
                    continue;
                }
                store.deleteRecords();
                invalidateEntryAt(store.getAddress());
            }
            currentApplicationDescriptor = new ApplicationDescriptorEntry();
            currentApplicationDescriptor.setMidletName(installedMidletName);
            currentApplicationDescriptor.setMidletVendor(installedMidletVendor);
            currentApplicationDescriptor.setMidletVersion(installedMidletVersion);
            logEntry(currentApplicationDescriptor);
            currentRecordStores = new IRecordStoreEntry[4];
        }
    }
 
开发者ID:tomatsu,项目名称:squawk,代码行数:48,代码来源:RecordStoreManager.java

示例6: writeToStream

import com.sun.squawk.VM; //导入方法依赖的package包/类
/**
    * Write the suite to a stream
    * @param dos the data output stream
    * @throws IOException
    */
   public void writeToStream(DataOutputStream dos) throws IOException {
///*if[!SIMPLE_VERIFY_SIGNATURES]*/
       DataOutputStream output = dos;
       final int MAX_HEADER_SIZE = Integer.MAX_VALUE;
///*else[SIMPLE_VERIFY_SIGNATURES]*/
//      SigningOutputStream output = new SigningOutputStream(dos);
//      final int MAX_HEADER_SIZE = SignatureVerifier.MAXIMUM_HEADER_SIZE;
///*end[SIMPLE_VERIFY_SIGNATURES]*/

       if (hasParent()) {
           if (VM.isVerbose()) {
               System.out.println("Converting library/app suite:");
           }
           /*
            * u4 magic // 0xDEADBEEF
            * u2 minor_version;
            * u2 major_version;
            * u4 attributes; // mask of the ATTRIBUTE_* constants in this class
            * u4 parent_hash;
            * utf8 parent_url;
            * u4 root; // offset (in bytes) in 'memory' of the root of the graph
            * u4 size; // size (in bytes) of memory  'memory' on a word boundary
            * u1 memory[size];
            */
           output.writeInt(0xDEADBEEF);
           output.writeShort(FLASH_SUITE_MINOR_VERSION); // minor
           output.writeShort(FLASH_SUITE_MAJOR_VERSION); // major
           output.writeInt(ObjectMemoryFile.ATTRIBUTE_32BIT | (isTargetBigEndian() ? ObjectMemoryFile.ATTRIBUTE_BIGENDIAN : 0)); // 32 bit
           output.writeInt(getParent().getHash());
           output.writeUTF(getSpotParentURL());
           output.writeInt(rootOffset);
           output.writeInt(memorySize);
           output.write(oopMap);
           writePad(output, outputHeaderSize - unpaddedHdrSize);
           if ((outputHeaderSize - oopMap.length) > MAX_HEADER_SIZE) {
               throw new RuntimeException(
				   "Header size of suite is too large. For compatibility with SuiteSignatureVerifier header size "
				   + "must not be larger than "
				   + MAX_HEADER_SIZE
				   + " bytes, but it is "
				   + outputHeaderSize
				   + " bytes");
           }
       } else {
           if (VM.isVerbose()) {
               System.out.println("Converting boostrap suite:");
               System.out.println("rootOffset: 0x" + Integer.toHexString(rootOffset + outputHeaderSize));
               System.out.println("hash: 0x" + Integer.toHexString(getHash()));
               System.out.println("size: 0x" + Integer.toHexString(memorySize));
           }
           writeLittleEndianInt(output, rootOffset + outputHeaderSize);
           writeLittleEndianInt(output, getHash());
           writeLittleEndianInt(output, memorySize);
       }
       output.write(objectMemory);

///*if[!SIMPLE_VERIFY_SIGNATURES]*/
       output.flush();
///*else[SIMPLE_VERIFY_SIGNATURES]*/
//		if (hasParent())
//		// If this is not the bootstrap suite write the hash
//		// and sign the suite.
//		{
//			output.writeInt(getHash());
//			output.flushAndAppendSignature();
//		}else{
//			output.flushWithoutSignature();
//		}
///*end[SIMPLE_VERIFY_SIGNATURES]*/
   }
 
开发者ID:tomatsu,项目名称:squawk,代码行数:76,代码来源:Suite.java


注:本文中的com.sun.squawk.VM.isVerbose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。