From 3a9e2b2b7b2e695d60979ecb3b72e49ec97ca27b Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Wed, 6 May 2020 16:12:09 -0700 Subject: Remove all non-Apache2 licensed files from sdk Remove MODULE_LICENSE_APACHE2 Repositories containing third-party code need a METADATA and a license_type. Repositories containing only first-party code no longer need a MODULE_LICENSE_* file. Remove EPL-licensed eclipse plugin and attribute_stats. Remove CC-BY-SA licensed typos files. Bug: 68860345 Bug: 69058154 Bug: 151953481 Test: treehugger Test: https://android-build.googleplex.com/builds/forrest/run/L63500000550775268 Exempt-From-Owner-Approval: janitorial work Change-Id: I5fafa76de21fb0b46c82a2c07ac048afbee3df25 --- .../editors/layout/gle2/LayoutMetadataTest.java | 109 --------------------- 1 file changed, 109 deletions(-) delete mode 100644 eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadataTest.java (limited to 'eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadataTest.java') diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadataTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadataTest.java deleted file mode 100644 index c71064eba..000000000 --- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadataTest.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (C) 2011 The Android Open Source Project - * - * Licensed under the Eclipse Public License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.eclipse.org/org/documents/epl-v10.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.android.ide.eclipse.adt.internal.editors.layout.gle2; - -import static com.android.SdkConstants.ATTR_ID; -import static com.android.SdkConstants.ID_PREFIX; -import static com.android.SdkConstants.NEW_ID_PREFIX; -import static com.android.SdkConstants.TOOLS_PREFIX; -import static com.android.SdkConstants.TOOLS_URI; - -import com.android.ide.common.layout.BaseLayoutRule; -import com.android.ide.eclipse.adt.AdtPlugin; -import com.android.ide.eclipse.adt.AdtUtils; -import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor; -import com.android.ide.eclipse.adt.internal.editors.layout.refactoring.AdtProjectTest; -import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode; -import com.android.utils.Pair; -import com.android.utils.XmlUtils; - -import org.eclipse.core.resources.IFile; -import org.eclipse.jface.text.IDocument; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.PartInitException; -import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion; -import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -/** - * - */ -@SuppressWarnings({"restriction", "javadoc", "deprecation"}) // XML DOM model -public class LayoutMetadataTest extends AdtProjectTest { - - public void testMetadata1() throws Exception { - Pair pair = getNode("metadata.xml", "listView1"); - UiElementNode uiNode = pair.getSecond(); - Node node = uiNode.getXmlNode(); - - assertNull(LayoutMetadata.getProperty(node, "foo")); - - Element element = (Element) node; - String prefix = XmlUtils.lookupNamespacePrefix(element, TOOLS_URI, null, false); - if (prefix == null) { - // Add in new prefix... - prefix = XmlUtils.lookupNamespacePrefix(element, - TOOLS_URI, TOOLS_PREFIX, true); - } - element.setAttribute(prefix + ':' + "foo", "bar"); - } - - // ==== Test utilities ==== - - private static String getText(IDocument document, Node node) throws Exception { - IndexedRegion region = (IndexedRegion) node; - // This often returns the wrong value: - //int length = region.getLength(); - int length = region.getEndOffset() - region.getStartOffset(); - return document.get(region.getStartOffset(), length); - } - - private Pair getNode(String filename, String targetId) - throws Exception, PartInitException { - IFile file = getLayoutFile(getProject(), filename); - AdtPlugin.openFile(file, null); - IEditorPart newEditor = AdtUtils.getActiveEditor(); - assertTrue(newEditor instanceof AndroidXmlEditor); - AndroidXmlEditor xmlEditor = (AndroidXmlEditor) newEditor; - IStructuredDocument document = xmlEditor.getStructuredDocument(); - UiElementNode root = xmlEditor.getUiRootNode(); - assertNotNull(root); - UiElementNode node = findById(root, targetId); - assertNotNull(node); - Pair pair = Pair.of(document, node); - return pair; - } - - private static UiElementNode findById(UiElementNode node, String targetId) { - assertFalse(targetId.startsWith(NEW_ID_PREFIX)); - assertFalse(targetId.startsWith(ID_PREFIX)); - - String id = node.getAttributeValue(ATTR_ID); - if (id != null && targetId.equals(BaseLayoutRule.stripIdPrefix(id))) { - return node; - } - - for (UiElementNode child : node.getUiChildren()) { - UiElementNode result = findById(child, targetId); - if (result != null) { - return result; - } - } - - return null; - } -} -- cgit v1.2.3