Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: dart/compiler/java/com/google/dart/compiler/util/DartSourceString.java

Issue 20722006: Removed compiler/ directory from repository (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: dart/compiler/java/com/google/dart/compiler/util/DartSourceString.java
diff --git a/dart/compiler/java/com/google/dart/compiler/util/DartSourceString.java b/dart/compiler/java/com/google/dart/compiler/util/DartSourceString.java
deleted file mode 100644
index 407d18b01e8496e5ee6e015934f00c51f781447c..0000000000000000000000000000000000000000
--- a/dart/compiler/java/com/google/dart/compiler/util/DartSourceString.java
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-package com.google.dart.compiler.util;
-
-import com.google.dart.compiler.DartSource;
-import com.google.dart.compiler.LibrarySource;
-
-import java.io.Reader;
-import java.io.StringReader;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-/**
- * Instances of the class <code>DartSourceString</code> represent a source
- * composed from a string rather than an external file.
- */
-public class DartSourceString implements DartSource {
- /**
- * The name of the source being represented.
- */
- private String name;
-
- /**
- * The source being represented.
- */
- private String source;
-
- /**
- * Initialize a new Dart source to have the given content.
- *
- * @param source the source being represented
- */
- public DartSourceString(String name, String source) {
- this.name = name;
- this.source = source;
- }
-
- @Override
- public boolean exists() {
- return true;
- }
-
- @Override
- public long getLastModified() {
- return 0;
- }
-
- @Override
- public LibrarySource getLibrary() {
- return null;
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public String getRelativePath() {
- return name;
- }
-
- @Override
- public Reader getSourceReader() {
- return new StringReader(source);
- }
-
- @Override
- public String getUniqueIdentifier() {
- try {
- return new URI(null, null, getName(), null).normalize().toString();
- } catch (URISyntaxException e) {
- throw new IllegalArgumentException(e);
- }
- }
-
- @Override
- public URI getUri() {
- try {
- return new URI(null, null, getName(), null, null).normalize();
- } catch (URISyntaxException e) {
- throw new IllegalArgumentException(e);
- }
- }
-}

Powered by Google App Engine
This is Rietveld 408576698