Index: /trunk/src/org/openstreetmap/josm/data/osm/pbf/BlobHeader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/pbf/BlobHeader.java	(revision 18701)
+++ /trunk/src/org/openstreetmap/josm/data/osm/pbf/BlobHeader.java	(revision 18702)
@@ -27,4 +27,5 @@
 
     /**
+     * Get the blob type
      * @return The blob type
      */
@@ -34,4 +35,5 @@
 
     /**
+     * Get the blob metadata
      * @return The blob metadata
      */
@@ -41,4 +43,5 @@
 
     /**
+     * Get the blob size
      * @return The blob size
      */
Index: /trunk/src/org/openstreetmap/josm/data/osm/pbf/Info.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/pbf/Info.java	(revision 18701)
+++ /trunk/src/org/openstreetmap/josm/data/osm/pbf/Info.java	(revision 18702)
@@ -36,4 +36,5 @@
 
     /**
+     * Get the OSM version
      * @return The version
      */
@@ -43,4 +44,5 @@
 
     /**
+     * Get the OSM timestamp
      * @return The timestamp
      */
@@ -50,4 +52,5 @@
 
     /**
+     * Get the OSM changeset
      * @return The changeset
      */
@@ -57,4 +60,5 @@
 
     /**
+     * Get the OSM user id
      * @return The user id
      */
@@ -64,4 +68,5 @@
 
     /**
+     * Get the id for the username in the PBF
      * @return The user string id (in PBF strings)
      */
@@ -71,4 +76,5 @@
 
     /**
+     * Get the visibility of the object
      * @return {@code false} if the object was deleted
      */
Index: /trunk/src/org/openstreetmap/josm/io/OsmPbfReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmPbfReader.java	(revision 18701)
+++ /trunk/src/org/openstreetmap/josm/io/OsmPbfReader.java	(revision 18702)
@@ -86,5 +86,5 @@
     }
 
-    private DataSet parse(InputStream source) throws IllegalDataException, IOException {
+    private void parse(InputStream source) throws IllegalDataException, IOException {
         final CountingInputStream inputStream;
         if (source.markSupported()) {
@@ -119,5 +119,4 @@
             }
         }
-        return this.getDataSet();
     }
 
@@ -133,5 +132,5 @@
      */
     @Nonnull
-    private BlobHeader parseBlobHeader(CountingInputStream cis, ByteArrayOutputStream baos, ProtobufParser parser)
+    private static BlobHeader parseBlobHeader(CountingInputStream cis, ByteArrayOutputStream baos, ProtobufParser parser)
             throws IOException, IllegalDataException {
         String type = null;
@@ -181,5 +180,6 @@
      */
     @Nonnull
-    private Blob parseBlob(BlobHeader header, CountingInputStream cis, ProtobufParser parser, ByteArrayOutputStream baos) throws IOException {
+    private static Blob parseBlob(BlobHeader header, CountingInputStream cis, ProtobufParser parser, ByteArrayOutputStream baos)
+            throws IOException {
         long start = cis.getBytesRead();
         int size = Integer.MIN_VALUE;
@@ -214,4 +214,7 @@
             }
         }
+        if (type == null) {
+            throw new IllegalStateException("Compression type not found, pbf may be malformed");
+        }
         return new Blob(size, type, current.getBytes());
     }
@@ -226,5 +229,5 @@
      */
     @Nonnull
-    private HeaderBlock parseHeaderBlock(Blob blob, ByteArrayOutputStream baos) throws IOException {
+    private static HeaderBlock parseHeaderBlock(Blob blob, ByteArrayOutputStream baos) throws IOException {
         try (InputStream blobInput = blob.inputStream();
              ProtobufParser parser = new ProtobufParser(blobInput)) {
@@ -334,5 +337,5 @@
                 dateGranularity);
         final DataSet ds = getDataSet();
-        if (!primitiveGroups.isEmpty()) {
+        if (!primitiveGroups.isEmpty() && headerBlock.bbox() != null) {
             try {
                 ds.beginUpdate();
@@ -406,5 +409,5 @@
      */
     @Nonnull
-    private String[] parseStringTable(ByteArrayOutputStream baos, byte[] bytes) throws IOException {
+    private static String[] parseStringTable(ByteArrayOutputStream baos, byte[] bytes) throws IOException {
         try (ByteArrayInputStream is = new ByteArrayInputStream(bytes);
              ProtobufParser parser = new ProtobufParser(is)) {
@@ -681,5 +684,4 @@
      * @throws IOException          if something happened while reading a {@link ByteArrayInputStream}
      */
-    @Nonnull
     private void parseRelation(ByteArrayOutputStream baos, byte[] bytes, PrimitiveBlockRecord primitiveBlockRecord)
             throws IllegalDataException, IOException {
@@ -758,5 +760,5 @@
      */
     @Nonnull
-    private Info parseInfo(ByteArrayOutputStream baos, byte[] bytes) throws IOException {
+    private static Info parseInfo(ByteArrayOutputStream baos, byte[] bytes) throws IOException {
         try (ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
              ProtobufParser parser = new ProtobufParser(bais)) {
@@ -768,23 +770,23 @@
             boolean visible = true;
             while (parser.hasNext()) {
-                ProtobufRecord record = new ProtobufRecord(baos, parser);
-                switch (record.getField()) {
+                ProtobufRecord protobufRecord = new ProtobufRecord(baos, parser);
+                switch (protobufRecord.getField()) {
                     case 1:
-                        version = record.asUnsignedVarInt().intValue();
+                        version = protobufRecord.asUnsignedVarInt().intValue();
                         break;
                     case 2:
-                        timestamp = record.asUnsignedVarInt().longValue();
+                        timestamp = protobufRecord.asUnsignedVarInt().longValue();
                         break;
                     case 3:
-                        changeset = record.asUnsignedVarInt().longValue();
+                        changeset = protobufRecord.asUnsignedVarInt().longValue();
                         break;
                     case 4:
-                        uid = record.asUnsignedVarInt().intValue();
+                        uid = protobufRecord.asUnsignedVarInt().intValue();
                         break;
                     case 5:
-                        userSid = record.asUnsignedVarInt().intValue();
+                        userSid = protobufRecord.asUnsignedVarInt().intValue();
                         break;
                     case 6:
-                        visible = record.asUnsignedVarInt().byteValue() == 0;
+                        visible = protobufRecord.asUnsignedVarInt().byteValue() == 0;
                         break;
                     default: // Fall through, since the PBF format could be extended
@@ -897,5 +899,5 @@
      */
     @Nonnull
-    private Info[] parseDenseInfo(ByteArrayOutputStream baos, byte[] bytes) throws IllegalDataException, IOException {
+    private static Info[] parseDenseInfo(ByteArrayOutputStream baos, byte[] bytes) throws IllegalDataException, IOException {
         long[] version = EMPTY_LONG; // technically ints
         long[] timestamp = EMPTY_LONG;
