summaryrefslogtreecommitdiffstats
path: root/tests/new/TopmostImplements.java
blob: 23c466d0e48a4a033564e4c244b9026322438a45 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import org.aspectj.testing.Tester;
import java.lang.reflect.Method;

// PR#126
        
public class TopmostImplements {
    public static void main(String[] args) { test(); }
    
    public static void test() {
        BC1 bc1 = new BC1();
        BC2 bc2 = new BC2();
        String m1 = "";
        String m2 = "";
        try { 
            m1 = bc1.getClass().getMethod("m1", null).toString();
            m2 = bc2.getClass().getMethod("m1", null).toString();
        } catch ( NoSuchMethodException nsme ) {
            Tester.check(false, "method not found");
        }
        Tester.checkEqual(m1, "public java.lang.String B.m1()", "from extends, implements");
        Tester.checkEqual(m2, "public java.lang.String B.m1()", "from extends");
      
        Tester.checkEqual(bc1.m1(), "BC1", "from extends, implements");
        Tester.checkEqual(bc2.m1(), "BC2", "from extends");  
        
    }
}

aspect Introducer {    
    public String A.m1() { return getName(); }
}


interface A {
    String getName();
}

class B implements A {
    public String getName() { return "B"; }
}

class BC1 extends B implements A {
    public String getName() { return "BC1"; }
} 

class BC2 extends B {
    public String getName() { return "BC2"; }
} 
316/stable28'>backport/47316/stable28 Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Security/FeaturePolicy/FeaturePolicy.php
blob: 9b513b80813727754a557bc77f070994d14dd388 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php

declare(strict_types=1);

/**
 * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */
namespace OC\Security\FeaturePolicy;

class FeaturePolicy extends \OCP\AppFramework\Http\FeaturePolicy {
	public function getAutoplayDomains(): array {
		return $this->autoplayDomains;
	}

	public function setAutoplayDomains(array $autoplayDomains): void {
		$this->autoplayDomains = $autoplayDomains;
	}

	public function getCameraDomains(): array {
		return $this->cameraDomains;
	}

	public function setCameraDomains(array $cameraDomains): void {
		$this->cameraDomains = $cameraDomains;
	}

	public function getFullscreenDomains(): array {
		return $this->fullscreenDomains;
	}

	public function setFullscreenDomains(array $fullscreenDomains): void {
		$this->fullscreenDomains = $fullscreenDomains;
	}

	public function getGeolocationDomains(): array {
		return $this->geolocationDomains;
	}

	public function setGeolocationDomains(array $geolocationDomains): void {
		$this->geolocationDomains = $geolocationDomains;
	}

	public function getMicrophoneDomains(): array {
		return $this->microphoneDomains;
	}

	public function setMicrophoneDomains(array $microphoneDomains): void {
		$this->microphoneDomains = $microphoneDomains;
	}

	public function getPaymentDomains(): array {
		return $this->paymentDomains;
	}

	public function setPaymentDomains(array $paymentDomains): void {
		$this->paymentDomains = $paymentDomains;
	}
}