classlib: satisfy checkstyle after applying latest PR

This commit is contained in:
Alexey Andreev 2023-09-21 09:51:34 +02:00
parent 6efade1b49
commit 2ae9c593d2
11 changed files with 180 additions and 10 deletions

View File

@ -1,3 +1,18 @@
/*
* Copyright 2023 Jonathan Coates.
*
* 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.teavm.classlib.java.io;
import java.io.IOException;

View File

@ -1,3 +1,18 @@
/*
* Copyright 2023 Jonathan Coates.
*
* 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.teavm.classlib.java.nio.channels;
public interface TByteChannel extends TReadableByteChannel, TWritableByteChannel {

View File

@ -1,8 +1,22 @@
/*
* Copyright 2023 Jonathan Coates.
*
* 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.teavm.classlib.java.nio.channels;
import org.teavm.classlib.java.io.TCloseable;
import java.io.IOException;
import org.teavm.classlib.java.io.TCloseable;
public interface TChannel extends TCloseable {
boolean isOpen();

View File

@ -1,3 +1,18 @@
/*
* Copyright 2023 Jonathan Coates.
*
* 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.teavm.classlib.java.nio.channels;
import java.io.IOException;

View File

@ -1,3 +1,18 @@
/*
* Copyright 2023 Jonathan Coates.
*
* 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.teavm.classlib.java.nio.channels;
public class TNonReadableChannelException extends IllegalStateException {

View File

@ -1,3 +1,18 @@
/*
* Copyright 2023 Jonathan Coates.
*
* 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.teavm.classlib.java.nio.channels;
public class TNonWritableChannelException extends IllegalStateException {

View File

@ -1,8 +1,22 @@
/*
* Copyright 2023 Jonathan Coates.
*
* 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.teavm.classlib.java.nio.channels;
import org.teavm.classlib.java.nio.TByteBuffer;
import java.io.IOException;
import org.teavm.classlib.java.nio.TByteBuffer;
public interface TReadableByteChannel extends TChannel {
int read(TByteBuffer dst) throws IOException;

View File

@ -1,3 +1,18 @@
/*
* Copyright 2023 Jonathan Coates.
*
* 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.teavm.classlib.java.nio.channels;
import java.io.IOException;

View File

@ -1,8 +1,22 @@
/*
* Copyright 2023 Jonathan Coates.
*
* 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.teavm.classlib.java.nio.channels;
import org.teavm.classlib.java.nio.TByteBuffer;
import java.io.IOException;
import org.teavm.classlib.java.nio.TByteBuffer;
public interface TWritableByteChannel extends TChannel {
int write(TByteBuffer src) throws IOException;

View File

@ -1,3 +1,18 @@
/*
* Copyright 2023 Jonathan Coates.
*
* 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.teavm.classlib.java.nio.file;
public class TAccessDeniedException extends TFileSystemException {

View File

@ -1,3 +1,18 @@
/*
* Copyright 2023 Jonathan Coates.
*
* 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.teavm.classlib.java.nio.file;
import java.io.IOException;
@ -36,12 +51,20 @@ public class TFileSystemException extends IOException {
@Override
public String getMessage() {
if (file == null && other == null) return reason;
if (file == null && other == null) {
return reason;
}
StringBuilder out = new StringBuilder();
if (file != null) out.append(file);
if (other != null) out.append(" -> ").append(other);
if (reason != null) out.append(": ").append(reason);
if (file != null) {
out.append(file);
}
if (other != null) {
out.append(" -> ").append(other);
}
if (reason != null) {
out.append(": ").append(reason);
}
return out.toString();
}
}