Skip to content

Commit

Permalink
change line separators to line feed
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverlietz committed Sep 6, 2023
1 parent 6d6c8be commit c639474
Show file tree
Hide file tree
Showing 5 changed files with 169 additions and 5 deletions.
53 changes: 52 additions & 1 deletion src/main/java/org/ops4j/pax/tinybundles/internal/Info.java
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;
}

}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pax.tinybundles.version=${pom.version}
pax.tinybundles.version=${pom.version}
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 src/test/java/org/ops4j/pax/tinybundles/demo/HelloWorld.java
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);

}
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);
}

}

0 comments on commit c639474

Please sign in to comment.