Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6dbe7c6

Browse files
author
zhourenjian@gmail.com
committed
Ignore copy right year in generating RPC/Pipe classes
1 parenta4005a1 commit6dbe7c6

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

‎sources/net.sf.j2s.ajax/generator/net/sf/j2s/ajax/SimpleSource4Java.java‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,14 @@ public static String generateSourceFromObject(SimpleSerializable s) {
206206
}
207207

208208
Type[]interfaces =s.getClass().getGenericInterfaces();
209+
List<Type>interfaceList =newArrayList<Type>();
209210
if (interfaces !=null &&interfaces.length >0) {
210211
for (inti =0;i <interfaces.length;i++) {
211212
Class<?>t = (Class<?>)interfaces[i];
212213
if (!SimpleSerializable.isSubInterfaceOf(t,ISimpleConstant.class)) {
213214
continue;
214215
}
216+
interfaceList.add(t);
215217
StringtypeName =t.getName();
216218
hasMoreImports =true;
217219
if (!importedClasses.contains(typeName)) {
@@ -329,10 +331,10 @@ public int compare(Class<?> c1, Class<?> c2) {
329331
source.append(simpleClazzName);
330332
}
331333

332-
if (interfaces !=null &&interfaces.length >0) {
334+
if (interfaceList.size() >0) {
333335
booleankeywordAppended =false;
334-
for (inti =0;i <interfaces.length;i++) {
335-
Class<?>t = (Class<?>)interfaces[i];
336+
for (inti =0;i <interfaceList.size();i++) {
337+
Class<?>t = (Class<?>)(Type)interfaceList.get(i);
336338
if (!SimpleSerializable.isSubInterfaceOf(t,ISimpleConstant.class)) {
337339
continue;
338340
}
@@ -348,7 +350,7 @@ public int compare(Class<?> c1, Class<?> c2) {
348350
}
349351

350352
source.append(simpleTypeName);
351-
if (i !=interfaces.length -1) {
353+
if (i !=interfaceList.size() -1) {
352354
source.append(", ");
353355
}
354356
}

‎sources/net.sf.j2s.ajax/generator/net/sf/j2s/ajax/SourceUtils.java‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
importjava.io.FileOutputStream;
77
importjava.io.IOException;
88
importjava.util.ArrayList;
9+
importjava.util.Date;
910
importjava.util.HashMap;
1011
importjava.util.Iterator;
1112
importjava.util.List;
@@ -175,6 +176,13 @@ public static void updateSourceContent(File file, String source) {
175176

176177
if (source.equals(oldSource)) {
177178
return;
179+
}else {
180+
@SuppressWarnings("deprecation")
181+
StringcopyrightYear ="* Copyright (c) " + (newDate().getYear() +1900);
182+
StringupdatedSource =oldSource.replaceFirst("\\* Copyright\\(c\\)\\d{4}",copyrightYear);
183+
if (source.equals(updatedSource)) {
184+
return;
185+
}
178186
}
179187
}
180188
FileOutputStreamfos =null;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp