commit | db498c1d9e9491c43c66cb25a48cab50a7717163 | [log] [tgz] |
---|---|---|
author | Alexander Rookey <atrookey@google.com> | Mon Aug 08 19:10:40 2016 -0400 |
committer | Alexander Rookey <atrookey@google.com> | Mon Aug 08 19:12:30 2016 -0400 |
tree | f3df87dfaccf0b5400c5ed743576a52fa9a3449c | |
parent | fb924e8074638ff74da150af54343c02ca0bcf22 [diff] |
Prevent stack overflows caused by recursive imports Change-Id: I4925dc67384878e0de9d8b50a1c7abe6e5e00e40
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ProtobufImportUriGlobalScopeProvider.java b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ProtobufImportUriGlobalScopeProvider.java index edc7eae..7ddcc2d 100644 --- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ProtobufImportUriGlobalScopeProvider.java +++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ProtobufImportUriGlobalScopeProvider.java
@@ -75,7 +75,9 @@ private void addPublicImportedUris(Protobuf protobuf, LinkedHashSet<URI> importedUris) { for (Import singleImport : protobufs.publicImportsIn(protobuf)) { - resolveImport(importedUris, singleImport); + if (!importedUris.contains(imports.resolvedUriOf(singleImport))) { + resolveImport(importedUris, singleImport); + } } }
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider.java b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider.java index d8d2522..12ce4d4 100644 --- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider.java +++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider.java
@@ -46,7 +46,6 @@ import com.google.eclipse.protobuf.protobuf.NativeFieldOption; import com.google.eclipse.protobuf.protobuf.NativeOption; import com.google.eclipse.protobuf.protobuf.OneOf; -import com.google.eclipse.protobuf.protobuf.Option; import com.google.eclipse.protobuf.protobuf.OptionField; import com.google.eclipse.protobuf.protobuf.OptionSource; import com.google.eclipse.protobuf.protobuf.Package;