openddrmobi / openddr-java Goto Github PK
View Code? Open in Web Editor NEWOpenDDR Java Clients
License: Apache License 2.0
OpenDDR Java Clients
License: Apache License 2.0
Hi,
this piece of code throws a StringIndexOutOfBoundsException
Classifier client = new ClassifierBuilder().with(LoaderOption.JAR).build();
Device device = client.classifyDevice("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Iridium/2018.4 Safari/537.36 Chrome/66.0.3359.130");
The cause lies in the DeviceAdjuster Class - Line 129:
if (pattern != null) {
if (pattern.contains(CHROME)) {
String parts = pattern.substring(pattern.indexOf(CHROME));
String version = parts.substring(CHROME.length() + 1, parts.indexOf(" "));
the last indexOf(" ") returns -1, as there are no more products in the submitted User-Agent. In my oppinion it should be
parts.indexOf(" ") == -1 ? parts.length() : parts.indexOf(" ")
Currently the ClassifierBuilder has to be instantiated with new. Instead, Classifier could get a static method builder() to create a new ClassifierBuilder.
OpenDDR Classifier Console null
Exception in thread "main" java.lang.NullPointerException: URL Path cannot be null
at mobi.openddr.classifier.loader.impl.URLResource.(URLResource.java:34)
at mobi.openddr.classifier.loader.LoaderFactory.getLoader(LoaderFactory.java:41)
at mobi.openddr.classifier.Classifier.initDeviceData(Classifier.java:65)
at mobi.openddr.classifier.console.ClassifierConsole.main(ClassifierConsole.java:162)
Currently complex nested types like types
in device data are only mentioned but members are not listed. Their detail attributes like tablet
etc. should be made visible.
The constant ASPECT_OPERATIVE_SYSTEM and underlying value should be renamed to reflect the change to "operationSystem"
The Device
object of Classifier uses the term "attribute" instead of "property" while the actual device data and W3C Simple API equivalent calls everything a "property".
This should be streamlined to match more naturally with the W3C and OpenDDR data model. "attribute" shall be available deprecated until removed in the next major version (2.0) of the Client APIs.
CI_DEPLOY_PASSWORD
for Sonatype/OSSHGet the clients running on a CI instance
Travis-CI or Circle CI.
Upgrade to Java 8, e.g. use Lambdas or maybe Async Loading where appropriate.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.