-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6d6c8be
commit c639474
Showing
5 changed files
with
169 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,52 @@ | ||
/* * Copyright 2009 Toni Menzel. * * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 * * 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 org.ops4j.pax.tinybundles.internal;import java.io.InputStream;import java.util.Objects;import java.util.Properties;/** * @author Toni Menzel (tonit) * @since Apr 26, 2009 */public class Info { private static String version = ""; static { try { final InputStream inputStream = Info.class.getClassLoader().getResourceAsStream("META-INF/pax-tinybundlesversion.properties"); if (!Objects.isNull(inputStream)) { final Properties properties = new Properties(); properties.load(inputStream); version = properties.getProperty("pax.tinybundles.version", "").trim(); } } catch (Exception ignore) { // use default versions } } private Info() { // } public static String getPaxTinybundlesVersion() { return version; }} | ||
/* | ||
* Copyright 2009 Toni Menzel. | ||
* | ||
* Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* 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 org.ops4j.pax.tinybundles.internal; | ||
|
||
import java.io.InputStream; | ||
import java.util.Objects; | ||
import java.util.Properties; | ||
|
||
/** | ||
* @author Toni Menzel (tonit) | ||
* @since Apr 26, 2009 | ||
*/ | ||
public class Info { | ||
|
||
private static String version = ""; | ||
|
||
static { | ||
try { | ||
final InputStream inputStream = Info.class.getClassLoader().getResourceAsStream("META-INF/pax-tinybundlesversion.properties"); | ||
if (!Objects.isNull(inputStream)) { | ||
final Properties properties = new Properties(); | ||
properties.load(inputStream); | ||
version = properties.getProperty("pax.tinybundles.version", "").trim(); | ||
} | ||
} catch (Exception ignore) { | ||
// use default versions | ||
} | ||
} | ||
|
||
private Info() { // | ||
} | ||
|
||
public static String getPaxTinybundlesVersion() { | ||
return version; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
pax.tinybundles.version=${pom.version} | ||
pax.tinybundles.version=${pom.version} |
53 changes: 52 additions & 1 deletion
53
src/test/java/org/ops4j/pax/tinybundles/demo/DemoAnonymousInnerClass.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,52 @@ | ||
/* * Copyright 2009 Toni Menzel. * * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 * * 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 org.ops4j.pax.tinybundles.demo;/** * @author <a href="mailto:[email protected]">Rafael Liu</a> */public class DemoAnonymousInnerClass { Object object = new Object() { }; SomeInnerClass innerClass = new SomeInnerClass(); public DemoAnonymousInnerClass() { // } public static class SomeInnerClass { Object object = new Object() { }; public static class NestedInnerClass { int a; } } public Object foo() { class Local { } return new Local(); }} | ||
/* | ||
* Copyright 2009 Toni Menzel. | ||
* | ||
* Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* 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 org.ops4j.pax.tinybundles.demo; | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">Rafael Liu</a> | ||
*/ | ||
public class DemoAnonymousInnerClass { | ||
|
||
Object object = new Object() { | ||
}; | ||
|
||
SomeInnerClass innerClass = new SomeInnerClass(); | ||
|
||
public DemoAnonymousInnerClass() { // | ||
} | ||
|
||
public static class SomeInnerClass { | ||
|
||
Object object = new Object() { | ||
}; | ||
|
||
public static class NestedInnerClass { | ||
int a; | ||
} | ||
|
||
} | ||
|
||
public Object foo() { | ||
|
||
class Local { | ||
} | ||
|
||
return new Local(); | ||
} | ||
|
||
} |
29 changes: 28 additions & 1 deletion
29
src/test/java/org/ops4j/pax/tinybundles/demo/HelloWorld.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,28 @@ | ||
/* * Copyright 2009 Toni Menzel. * * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 * * 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 org.ops4j.pax.tinybundles.demo;/** * @author Toni Menzel (tonit) * @since Apr 9, 2009 */public interface HelloWorld { String sayHello(final String name);} | ||
/* | ||
* Copyright 2009 Toni Menzel. | ||
* | ||
* Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* 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 org.ops4j.pax.tinybundles.demo; | ||
|
||
/** | ||
* @author Toni Menzel (tonit) | ||
* @since Apr 9, 2009 | ||
*/ | ||
public interface HelloWorld { | ||
|
||
String sayHello(final String name); | ||
|
||
} |
37 changes: 36 additions & 1 deletion
37
src/test/java/org/ops4j/pax/tinybundles/demo/internal/HelloWorldImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,36 @@ | ||
/* * Copyright 2009 Toni Menzel. * * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 * * 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 org.ops4j.pax.tinybundles.demo.internal;import org.ops4j.pax.tinybundles.demo.HelloWorld;/** * @author Toni Menzel (tonit) * @since Apr 9, 2009 */public class HelloWorldImpl implements HelloWorld { public HelloWorldImpl() { // } @Override public String sayHello(final String name) { return String.format("Hello, %s!", name); }} | ||
/* | ||
* Copyright 2009 Toni Menzel. | ||
* | ||
* Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* 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 org.ops4j.pax.tinybundles.demo.internal; | ||
|
||
import org.ops4j.pax.tinybundles.demo.HelloWorld; | ||
|
||
/** | ||
* @author Toni Menzel (tonit) | ||
* @since Apr 9, 2009 | ||
*/ | ||
public class HelloWorldImpl implements HelloWorld { | ||
|
||
public HelloWorldImpl() { // | ||
} | ||
|
||
@Override | ||
public String sayHello(final String name) { | ||
return String.format("Hello, %s!", name); | ||
} | ||
|
||
} |