Java sun.reflect.generics.reflectiveObjects.NotImplementedException 代码实例

・15 分钟阅读

以下是展示如何使用sun.reflect.generics.reflectiveObjects.NotImplementedException的最佳示例。 我们使用了代码质量辨别算法从开源项目中提取出了最佳的优秀示例。

实例 1


private synchronized void initFromOs() {
    String os = System.getProperty("os.name").toLowerCase();
    if (os.equals("linux")) {
        exec = "socat -d -d PTY: PTY: ";
        correctPort = "/dev/pt/s";
    } else if (os.equals("mac os x")) {
        exec = "socat -d -d PTY PTY ";
        correctPort = "/dev/ttys";
    } else {
        //TODO
        throw new NotImplementedException();
    }
}
 

实例 2


public static LambertPoint convertToLambert(double latitude, double longitude, LambertZone zone) throws NotImplementedException {
        if (zone == Lambert93) {
            throw new NotImplementedException();
        } else {
            LambertPoint pt1 = geographicToCartesian(longitude - LON_MERID_GREENWICH, latitude, 0, A_WGS84, E_WGS84);
            pt1.translate(168, 60, -320);
            LambertPoint pt2 = cartesianToGeographic(pt1, LON_MERID_PARIS, A_WGS84, E_WGS84, DEFAULT_EPS);
            return geographicToLambert(pt2.getY(), pt2.getX(), zone, LON_MERID_PARIS, E_WGS84);
        }
    }
 

实例 3


/**
 * Reads the next chunk of the trace.
 * @return The log chunk readed
 * @throws IOException In case we are unable to read from the stream
 */
public LogChunk next() throws IOException {
    byte optByte = stream.readByte();
    //Only the first 3 bits of the optByte are the magic number
    byte magic = (byte)(optByte & 7);
    switch (magic) {
        case InstruBinaryLog.LOG_TEST:
            return new TestChunk(stream);
        case InstruBinaryLog.LOG_METHOD:
            return new MethodCallChunk(optByte, stream);
        case InstruBinaryLog.LOG_VAR:
            throw new NotImplementedException();
        case InstruBinaryLog.LOG_EXCEPTION:
            throw new NotImplementedException();
        case InstruBinaryLog.LOG_CATCH:
            throw new NotImplementedException();
        case InstruBinaryLog.LOG_ASSERT:
            throw new NotImplementedException();
        case InstruBinaryLog.LOG_CLOSE:
            eof = true;
            return null;
        default:
            throw new IOException("Unknown magic number, File is corrupted or not proper format");
    }
}
 

实例 4


@Override
public JerseyInvocation.Builder request() {
    checkNotClosed();
    //TODO
    //return new JerseyInvocation.Builder(getUri(), config.snapshot());
    throw new NotImplementedException();
}
 

实例 5


@Override
   /**
    * Not implemented jet
    * the field with "geom" identifier will contain the WKT representation
    * of the geometry
    */
   public long create(HashMap<String, String> newValues) throws Exception {
throw new NotImplementedException();
   }
 

实例 6


@Test
public void runCmdTest() throws IOException, InterruptedException {
    String shell =
            "java -jar" +
                    " -Dcassandra.migration.scripts.locations=filesystem:target/test-classes/migration/integ" +
                    " -Dcassandra.migration.cluster.contactpoints=" + BaseIT.CASSANDRA_CONTACT_POINT +
                    " -Dcassandra.migration.cluster.port=" + BaseIT.CASSANDRA_PORT +
                    " -Dcassandra.migration.cluster.username=" + BaseIT.CASSANDRA_USERNAME +
                    " -Dcassandra.migration.cluster.password=" + BaseIT.CASSANDRA_PASSWORD +
                    " -Dcassandra.migration.keyspace.name=" + BaseIT.CASSANDRA__KEYSPACE +
                    " target/*-jar-with-dependencies.jar" +
                    " migrate";
    ProcessBuilder builder;
    if (isWindows()) {
        throw new NotImplementedException();
    } else {
        builder = new ProcessBuilder("bash", "-c", shell);
    }
    builder.redirectErrorStream(true);
    final Process process = builder.start();
    watch(process);
    while (!runCmdTestCompleted)
        Thread.sleep(1000L);
    assertThat(runCmdTestSuccess, is(true));
}
 

实例 7


public static CimDateTime createCurrentTime()
{
    /**
     * TODO to implement
     */
    throw new NotImplementedException();
}
 

实例 8


public FlowReturn callback(BaseSrc element, long offset, int size, Pointer bufRef) {                  
            try {   
                throw new NotImplementedException();
//                Buffer buffer = new Buffer(size);
//                //System.out.println("Sending buf=" + buf);
//                FlowReturn retVal = ((CustomSrc) element).srcFillBuffer(offset, size, buffer);
//                bufRef.setPointer(0, buffer.getAddress());
//                buffer.disown();
//                return retVal;
            } catch (Exception ex) {
                return FlowReturn.UNEXPECTED;
            }                    
        }
 

实例 9


public HullSampling(double[] element, AbstractProbabilityDensityFunction pdf) {
        throw new NotImplementedException();
        //this.element = element;
        //this.pdf = pdf;
        //pdf.setValue(element);
}
 

实例 10


/**
 * Concatenates each block of SSH commands between SCP commands.
 * <p>
 * Contiguous SSH commands are converted to a single SSH command, separated by semicolons.
 * That way, more commands can be executed using a single <code>Channel</code> connection.
 *
 * @return  the compressed collection of <code>Command</code>s.
 */
public static Collection<Command> compressCommands( Collection<Command> commands ) {
    // TODO to be implemented
    throw new NotImplementedException();
}
 

实例 11


public static FullHttpResponse formatResponse(List<TimeSeries> timeSeriesList, RenderParameters parameters) throws NotImplementedException, LogarithmicScaleNotAllowed {
    // Let's remove empty series
    List<TimeSeries> filtered = filterAllNulls(timeSeriesList);
    switch (parameters.getFormat()) {
        case JSON: return formatResponseAsJson(filtered, parameters);
        case RAW: return formatResponseAsRaw(filtered);
        case CSV: return formatResponseAsCSV(filtered, parameters);
        case PNG: return formatResponseAsPng(filtered, parameters);
        default:throw new NotImplementedException();
    }
}
 

实例 12


public void setOption(String optionName, String optionValue) {
    if (optionName.equals(JavaCore.COMPILER_COMPLIANCE)) {
        mCompilerCompliance = optionValue;
    } else if (optionName.equals(JavaCore.COMPILER_SOURCE)) {
        mCompilerSource = optionValue;
    } else if (optionName.equals(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM)) {
        mCompilerTarget = optionValue;
    } else {
        throw new NotImplementedException();
    }
}
 

实例 13


/**
 * @see at.iaik.suraq.smtlib.SMTLibObject#substituteUninterpretedFunction(java.util.Map,
 *      java.util.Map)
 */
@Override
public SMTLibObject substituteUninterpretedFunction(
        Map<Token, UninterpretedFunction> substitutions,
        Map<SMTLibObject, SMTLibObject> done) {
    throw new NotImplementedException();
}
 

实例 14


private T processComplexFieldJsonToEntity(ComplexField complexField, T entity, JSONObject json, String propertyName) throws InstantiationException, IllegalAccessException, JSONException {
        switch (complexField.getType()) {
                case BASIC_COLLECTION:
                        return this.processBasicCollectionJsonToEntity(complexField, entity, json, propertyName);
                case ENTITY_COLLECTION:
                        return this.processEntityCollectionJsonToEntity(complexField, entity, json, propertyName);
                case NESTED_ENTITY:
                        return this.processNestedEntityJsonToEntity(complexField, entity, json, propertyName);
        }
        throw new NotImplementedException();
}
 

实例 15


public JsonArray generate() {
    JsonArray res = new JsonArray();
    SchemaList items = schema.getItems();
    JsonElement  newEl;
    int minItems = schema.getMinItems();
    int maxItems = schema.getMaxItems();
    if(configuration!=null) {
        if (configuration.globalArrayItemsMin!=null) minItems = configuration.globalArrayItemsMin;
        if (configuration.globalArrayItemsMax!=null) maxItems = configuration.globalArrayItemsMax;
        if (propertyName != null ) {
            if (configuration.arrayItemsMin.get(propertyName)!=null) minItems = configuration.arrayItemsMin.get(propertyName);
            if (configuration.arrayItemsMax.get(propertyName)!=null) maxItems = configuration.arrayItemsMax.get(propertyName);
        }
    }
    maxItems = minItems + rnd.nextInt(maxItems-minItems);
    //meant for JSON generator after all, not OutOfMemory generator :)
    if(minItems>500) minItems = 500;
    if(maxItems>500) maxItems = 500;
    int cnt = 0;
    if(configuration.arrayPredefinedItems != null && propertyName!=null && configuration.arrayPredefinedItems.get(propertyName)!=null) {
        for(JsonElement je:configuration.arrayPredefinedItems.get(propertyName)) {
            res.put(je);
            if(++cnt>maxItems) break;
        }
    }
    else if(items!=null && items.size()>0) {
        //if we have array with
        if (items.size() == 1) {
            for(int i =0;i<maxItems;i++) {
                for (Map.Entry<Matcher<Schema>, Class> entry : commonPropertyMatchers.entrySet()) {
                    if (entry.getKey().matches(items.get(0))) {
                        try {
                            Generator gen = (Generator) entry.getValue().getDeclaredConstructor(Schema.class, GeneratorConfig.class, String.class).newInstance(items.get(0), configuration, propertyName);
                            newEl = gen.generate();
                            if (newEl != null) {
                                res.put(newEl);
                                break;
                            }
                        } catch (InstantiationException e) {
                            e.printStackTrace();
                        } catch (IllegalAccessException e) {
                            e.printStackTrace();
                        } catch (NoSuchMethodException e) {
                            e.printStackTrace();
                        } catch (InvocationTargetException e) {
                            e.printStackTrace();
                        }
                    }
                }
            }
        } else {
            for (Schema itemSchema : items) {
                for (Map.Entry<Matcher<Schema>, Class> entry : commonPropertyMatchers.entrySet()) {
                    if (entry.getKey().matches(itemSchema)) {
                        try {
                            Generator gen = (Generator) entry.getValue().getDeclaredConstructor(Schema.class, GeneratorConfig.class).newInstance(itemSchema, configuration);
                            newEl = gen.generate();
                            if (newEl != null) {
                                res.put(newEl);
                                break;
                            }
                        } catch (InstantiationException e) {
                            e.printStackTrace();
                        } catch (IllegalAccessException e) {
                            e.printStackTrace();
                        } catch (NoSuchMethodException e) {
                            e.printStackTrace();
                        } catch (InvocationTargetException e) {
                            e.printStackTrace();
                        }
                    }
                }
                if(++cnt>maxItems) break;
            }
        }
    } else {
        //then items can be any
        throw new NotImplementedException();
    }
    return res;
}
 
讨论
淘淘あ西西 profile image