Skip to content

Commit cb256e9

Browse files
committed
cosmetic update - remove some warnings ...
1 parent 846cd33 commit cb256e9

11 files changed

Lines changed: 19 additions & 21 deletions

File tree

src/main/java/act/app/util/AppCrypto.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public String encrypt(String message) {
3838
logger.error("Cannot encrypt/decrypt! Please download Java Crypto Extension pack from Oracle: http://www.oracle.com/technetwork/java/javase/tech/index-jsp-136007.html");
3939
if (Act.isDev()) {
4040
logger.warn("Application will keep running with no encrypt/decrypt facilities in Dev mode");
41-
return Codec.encodeBASE64(message);
41+
return Codec.encodeBase64(message);
4242
}
4343
}
4444
throw e;
@@ -54,7 +54,7 @@ public String decrypt(String message) {
5454
logger.error("Cannot encrypt/decrypt! Please download Java Crypto Extension pack from Oracle: http://www.oracle.com/technetwork/java/javase/tech/index-jsp-136007.html");
5555
if (Act.isDev()) {
5656
logger.warn("Application will keep running with no encrypt/decrypt facilities in Dev mode");
57-
return new String(Codec.decodeBASE64(message));
57+
return new String(Codec.decodeBase64(message));
5858
}
5959
}
6060
throw e;

src/main/java/act/data/ApacheMultipartParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ void close() throws IOException {
10051005
*/
10061006
FileItemIteratorImpl(InputStream input, H.Format contentType, String charEncoding) throws FileUploadException, IOException {
10071007

1008-
if ((null == contentType) || (!contentType.toContentType().toLowerCase().startsWith(MULTIPART))) {
1008+
if ((null == contentType) || (!contentType.contentType().toLowerCase().startsWith(MULTIPART))) {
10091009
throw new InvalidContentTypeException("the request doesn't contain a " + MULTIPART_FORM_DATA + " or " + MULTIPART_MIXED + " stream, content type header is " + contentType);
10101010
}
10111011

@@ -1022,7 +1022,7 @@ protected void raiseError(long pSizeMax, long pCount) throws IOException {
10221022

10231023
}
10241024

1025-
boundary = getBoundary(contentType.toContentType());
1025+
boundary = getBoundary(contentType.contentType());
10261026
if (boundary == null) {
10271027
throw new FileUploadException("the request was rejected because " + "no multipart boundary was found");
10281028
}

src/main/java/act/handler/builtin/Echo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class Echo extends FastRequestHandler {
1111
private String contentType;
1212

1313
public Echo(String msg) {
14-
this(msg, H.Format.txt.toContentType());
14+
this(msg, H.Format.TXT.contentType());
1515
}
1616

1717
public Echo(String msg, String contentType) {

src/main/java/act/handler/builtin/StaticFileGetter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ public void handle(ActionContext context) {
6161
}
6262
InputStream is = new BufferedInputStream(IO.is(file));
6363
H.Response resp = context.resp();
64-
if (H.Format.unknown != fmt) {
65-
resp.contentType(fmt.toContentType());
64+
if (H.Format.UNKNOWN != fmt) {
65+
resp.contentType(fmt.contentType());
6666
}
6767
IO.copy(is, context.resp().outputStream());
6868
}

src/main/java/act/util/DataEnhancer.java renamed to src/main/java/act/util/DataObjectEnhancer.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@
1313
* methods, e.g. {@link Object#equals(Object)}
1414
*/
1515
@ActComponent
16-
public class DataEnhancer extends AppByteCodeEnhancer<DataEnhancer> {
16+
public class DataObjectEnhancer extends AppByteCodeEnhancer<DataObjectEnhancer> {
1717

1818
private ObjectMetaInfo metaInfo;
1919

20-
public DataEnhancer() {
20+
public DataObjectEnhancer() {
2121
super($.F.<String>yes());
2222
}
2323

24-
protected DataEnhancer(ClassVisitor cv) {
24+
protected DataObjectEnhancer(ClassVisitor cv) {
2525
super($.F.<String>yes(), cv);
2626
}
2727

2828
@Override
29-
protected Class<DataEnhancer> subClass() {
30-
return DataEnhancer.class;
29+
protected Class<DataObjectEnhancer> subClass() {
30+
return DataObjectEnhancer.class;
3131
}
3232

3333
@Override

src/main/java/act/util/ObjectMetaInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import org.osgl.util.S;
1111

1212
/**
13-
* Datastructure captures a class's meta information in related to {@link DataEnhancer}.
13+
* Datastructure captures a class's meta information in related to {@link DataObjectEnhancer}.
1414
* The following info will be captured:
1515
* <ul>
1616
* <li>Is the class annotated with {@link Data} annotation</li>

src/test/java/act/handler/builtin/StaticFileGetterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public File answer(InvocationOnMock invocation) throws Throwable {
4545

4646
@Test
4747
public void invokePathHandlerOnNonExistingResource() {
48-
when(ctx.accept()).thenReturn(H.Format.html);
48+
when(ctx.accept()).thenReturn(H.Format.HTML);
4949
ctx.param(ParamNames.PATH, "/some/where/non_exists.txt");
5050
pathHandler.handle(ctx);
5151
eq(resp.status, 404);

src/test/java/act/util/DataEnhancerTest.java renamed to src/test/java/act/util/DataObjectEnhancerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import java.io.PrintWriter;
1919
import java.lang.reflect.Method;
2020

21-
public class DataEnhancerTest extends TestBase {
21+
public class DataObjectEnhancerTest extends TestBase {
2222

2323
public static final String TMPL_PATH = "/path/to/template";
2424

@@ -141,7 +141,7 @@ protected synchronized Class<?> loadClass(final String name,
141141
try {
142142
ClassReader cr = new ClassReader(is);
143143
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
144-
DataEnhancer enhancer = new DataEnhancer(cw);
144+
DataObjectEnhancer enhancer = new DataObjectEnhancer(cw);
145145
cr.accept(enhancer, 0);
146146
b = cw.toByteArray();
147147
//CheckClassAdapter.verify(new ClassReader(cw.toByteArray()), true, new PrintWriter(System.out));

src/test/java/testapp/cli/StaticWithoutReturnType.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
package testapp.cli;
22

33
import act.cli.Command;
4-
import act.cli.HelpMsg;
54
import act.cli.Optional;
65
import act.cli.Required;
76

87
public class StaticWithoutReturnType {
98

109
private String s;
1110

12-
@Command("foo.bar")
13-
@HelpMsg("help")
11+
@Command(value = "foo.bar", help = "help")
1412
public static void doIt(
1513
@Required(lead = "-o,--op1") String op1,
1614
@Optional(lead = "-n,--number") int num

src/test/java/testapp/controller/HelloWorldApp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public HelloWorldApp() {
2727
@Before
2828
public void mockFormat(String fmt) {
2929
if ("json".equals(fmt)) {
30-
context.accept(H.Format.json);
30+
context.accept(H.Format.JSON);
3131
}
3232
context.session().put("foo", "bar");
3333
}

0 commit comments

Comments
 (0)