Skip to content

NPE given invalid import #1376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
danrubel opened this issue Jan 30, 2012 · 6 comments
Closed

NPE given invalid import #1376

danrubel opened this issue Jan 30, 2012 · 6 comments
Labels
closed-cannot-reproduce Closed as we were unable to reproduce the reported issue legacy-area-analyzer Use area-devexp instead.
Milestone

Comments

@danrubel
Copy link

NPE occurs given:

import('');

void main() {
  print("Hello World");
}

!ENTRY com.google.dart.tools.core 1 0 2012-01-29 19:35:01.752
!MESSAGE INFO: Could not find file for source "file:/Users/danrubel/Work/eclipse-3.7.0-64/trunk/dart/d2j/" (1): Input/Output error: /Users/danrubel/Work/eclipse-3.7.0-64/trunk/dart/d2j (No such file or directory)

!ENTRY com.google.dart.tools.core 4 0 2012-01-29 19:35:02.211
!MESSAGE Exception caught while building file:/Users/danrubel/Work/eclipse-3.7.0-64/trunk/dart/d2j/d2j.dart
!STACK 0
java.lang.NullPointerException
    at com.google.dart.compiler.resolver.TopLevelElementBuilder.fillInLibraryScope(TopLevelElementBuilder.java:72)
    at com.google.dart.compiler.DartCompiler$Compiler.buildLibraryScopes(DartCompiler.java:433)
    at com.google.dart.compiler.DartCompiler$Compiler.updateAndResolve(DartCompiler.java:216)
    at com.google.dart.compiler.DartCompiler$Compiler.compile(DartCompiler.java:170)
    at com.google.dart.compiler.DartCompiler$Compiler.access$3(DartCompiler.java:167)
    at com.google.dart.compiler.DartCompiler.compileLib(DartCompiler.java:1148)
    at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.secureCompileLib(DartCompilerUtilities.java:800)
    at com.google.dart.tools.core.internal.builder.DartcBuildHandler.buildLibrary(DartcBuildHandler.java:408)
    at com.google.dart.tools.core.internal.builder.DartcBuildHandler.buildAllApplications(DartcBuildHandler.java:301)
    at com.google.dart.tools.core.internal.builder.DartBuilder.build(DartBuilder.java:91)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

@danrubel
Copy link
Author

Removed Area-Editor label.
Added Area-Compiler label.

@danrubel
Copy link
Author

It appears that #import('') resolves to a directory, so it exists, but really is not a valid URLSource

@DartBot
Copy link

DartBot commented Feb 29, 2012

This comment was originally written by [email protected]


Set owner to [email protected].

@kasperl
Copy link

kasperl commented Apr 17, 2012

Removed Area-Compiler label.
Added Area-Analyzer label.

@danrubel
Copy link
Author

danrubel commented Jun 4, 2012

Added this to the M1 milestone.

@DartBot
Copy link

DartBot commented Jun 5, 2012

This comment was originally written by [email protected]


This seems to work now:

$ /home/zundel/dart-all/dart/out/DebugIA32/dartc /tmp/t.dart
file:/tmp/t.dart:1: Cannot find referenced source:
     1: #import('');
Compilation failed with 1 problem.


Added CannotReproduce label.

@danrubel danrubel added Type-Defect legacy-area-analyzer Use area-devexp instead. closed-cannot-reproduce Closed as we were unable to reproduce the reported issue labels Jun 5, 2012
@danrubel danrubel added this to the M1 milestone Jun 5, 2012
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-cannot-reproduce Closed as we were unable to reproduce the reported issue legacy-area-analyzer Use area-devexp instead.
Projects
None yet
Development

No branches or pull requests

3 participants