aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/android/tools/r8/utils/ClasspathClassCollection.java
blob: ee00c3976691374c8592a46471991f5dedee2a6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) 2017, the R8 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.android.tools.r8.utils;

import com.android.tools.r8.errors.CompilationError;
import com.android.tools.r8.graph.ClassKind;
import com.android.tools.r8.graph.DexClasspathClass;

/** Represents a collection of classpath classes. */
public class ClasspathClassCollection extends ClassMap<DexClasspathClass> {
  public ClasspathClassCollection(ClassProvider<DexClasspathClass> classProvider) {
    super(null, classProvider);
  }

  @Override
  DexClasspathClass resolveClassConflict(DexClasspathClass a, DexClasspathClass b) {
    throw new CompilationError("Classpath type already present: " + a.type.toSourceString());
  }

  @Override
  ClassKind getClassKind() {
    return ClassKind.CLASSPATH;
  }

  @Override
  public String toString() {
    return "classpath classes: " + super.toString();
  }
}