Skip to content

Commit 28e1564

Browse files
committed
merge [squid:S2293]
2 parents 7794f67 + 4336570 commit 28e1564

28 files changed

+84
-79
lines changed

Diff for: src/main/java/com/ckfinder/connector/CKFinderSetupCKEditor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ public int doStartTag() throws JspException {
4747
if (flashType == null || flashType.equals("")) {
4848
flashType = DEFAULT_FLASH_TYPE;
4949
}
50-
Map<String, Map<String, String>> attr = new HashMap<String, Map<String, String>>();
51-
Map<String, String> params = new HashMap<String, String>();
50+
Map<String, Map<String, String>> attr = new HashMap<>();
51+
Map<String, String> params = new HashMap<>();
5252
params.put("filebrowserBrowseUrl", buildBrowseUrl(null));
5353
params.put("filebrowserUploadUrl", buildUploadUrl("Files"));
5454
params.put("filebrowserImageBrowseUrl", buildBrowseUrl(imageType));

Diff for: src/main/java/com/ckfinder/connector/configuration/Configuration.java

+24-24
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ public class Configuration implements IConfiguration {
9191
public Configuration(final ServletConfig servletConfig) {
9292
this.servletConf = servletConfig;
9393
this.xmlFilePath = servletConfig.getInitParameter("XMLConfig");
94-
this.plugins = new ArrayList<PluginInfo>();
95-
this.htmlExtensions = new ArrayList<String>();
96-
this.hiddenFolders = new ArrayList<String>();
97-
this.hiddenFiles = new ArrayList<String>();
98-
this.defaultResourceTypes = new ArrayList<String>();
94+
this.plugins = new ArrayList<>();
95+
this.htmlExtensions = new ArrayList<>();
96+
this.hiddenFolders = new ArrayList<>();
97+
this.hiddenFiles = new ArrayList<>();
98+
this.defaultResourceTypes = new ArrayList<>();
9999
}
100100

101101
/**
@@ -111,8 +111,8 @@ private void clearConfiguration() {
111111
this.imgWidth = DEFAULT_IMG_WIDTH;
112112
this.imgHeight = DEFAULT_IMG_HEIGHT;
113113
this.imgQuality = DEFAULT_IMG_QUALITY;
114-
this.types = new HashMap<String, ResourceType>();
115-
this.typesOrder = new ArrayList<String>();
114+
this.types = new HashMap<>();
115+
this.typesOrder = new ArrayList<>();
116116
this.thumbsEnabled = false;
117117
this.thumbsURL = "";
118118
this.thumbsDir = "";
@@ -121,18 +121,18 @@ private void clearConfiguration() {
121121
this.thumbsDirectAccess = false;
122122
this.thumbsMaxHeight = DEFAULT_THUMB_MAX_HEIGHT;
123123
this.thumbsMaxWidth = DEFAULT_THUMB_MAX_WIDTH;
124-
this.accessControlLevels = new ArrayList<AccessControlLevel>();
125-
this.hiddenFolders = new ArrayList<String>();
126-
this.hiddenFiles = new ArrayList<String>();
124+
this.accessControlLevels = new ArrayList<>();
125+
this.hiddenFolders = new ArrayList<>();
126+
this.hiddenFiles = new ArrayList<>();
127127
this.doubleExtensions = false;
128128
this.forceASCII = false;
129129
this.checkSizeAfterScaling = false;
130130
this.uriEncoding = DEFAULT_URI_ENCODING;
131131
this.userRoleSessionVar = "";
132-
this.plugins = new ArrayList<PluginInfo>();
132+
this.plugins = new ArrayList<>();
133133
this.secureImageUploads = false;
134-
this.htmlExtensions = new ArrayList<String>();
135-
this.defaultResourceTypes = new ArrayList<String>();
134+
this.htmlExtensions = new ArrayList<>();
135+
this.defaultResourceTypes = new ArrayList<>();
136136
this.events = new Events();
137137
this.basePathBuilder = null;
138138
this.disallowUnsafeCharacters = false;
@@ -385,7 +385,7 @@ private void setHiddenFolders(final NodeList childNodes) {
385385
* @param childNodes nodes with ACL configuration.
386386
*/
387387
private void setACLs(final NodeList childNodes) {
388-
this.accessControlLevels = new ArrayList<AccessControlLevel>();
388+
this.accessControlLevels = new ArrayList<>();
389389
for (int i = 0; i < childNodes.getLength(); i++) {
390390
Node childNode = childNodes.item(i);
391391
if (childNode.getNodeName().equals("accessControl")) {
@@ -508,8 +508,8 @@ private void setThumbs(final NodeList childNodes) {
508508
* @param doc XML document.
509509
*/
510510
private void setTypes(final Document doc) {
511-
types = new HashMap<String, ResourceType>();
512-
typesOrder = new ArrayList<String>();
511+
types = new HashMap<>();
512+
typesOrder = new ArrayList<>();
513513
NodeList list = doc.getElementsByTagName("type");
514514

515515
for (int i = 0; i < list.getLength(); i++) {
@@ -1077,19 +1077,19 @@ protected void copyConfFields(final Configuration configuration) {
10771077
configuration.events = this.events;
10781078
configuration.basePathBuilder = this.basePathBuilder;
10791079

1080-
configuration.htmlExtensions = new ArrayList<String>();
1080+
configuration.htmlExtensions = new ArrayList<>();
10811081
configuration.htmlExtensions.addAll(this.htmlExtensions);
1082-
configuration.hiddenFolders = new ArrayList<String>();
1083-
configuration.hiddenFiles = new ArrayList<String>();
1082+
configuration.hiddenFolders = new ArrayList<>();
1083+
configuration.hiddenFiles = new ArrayList<>();
10841084
configuration.hiddenFiles.addAll(this.hiddenFiles);
10851085
configuration.hiddenFolders.addAll(this.hiddenFolders);
1086-
configuration.typesOrder = new ArrayList<String>();
1086+
configuration.typesOrder = new ArrayList<>();
10871087
configuration.typesOrder.addAll(this.typesOrder);
1088-
configuration.defaultResourceTypes = new ArrayList<String>();
1088+
configuration.defaultResourceTypes = new ArrayList<>();
10891089
configuration.defaultResourceTypes.addAll(this.defaultResourceTypes);
1090-
configuration.types = new HashMap<String, ResourceType>();
1091-
configuration.accessControlLevels = new ArrayList<AccessControlLevel>();
1092-
configuration.plugins = new ArrayList<PluginInfo>();
1090+
configuration.types = new HashMap<>();
1091+
configuration.accessControlLevels = new ArrayList<>();
1092+
configuration.plugins = new ArrayList<>();
10931093
copyTypes(configuration.types);
10941094
copyACls(configuration.accessControlLevels);
10951095
copyPlugins(configuration.plugins);

Diff for: src/main/java/com/ckfinder/connector/configuration/Events.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public enum EventTypes {
4141
* default constructor.
4242
*/
4343
public Events() {
44-
eventHandlers = new HashMap<Events.EventTypes, List<EventCommandData>>();
44+
eventHandlers = new HashMap<>();
4545
eventHandlers.put(EventTypes.AfterFileUpload, new ArrayList<EventCommandData>());
4646
eventHandlers.put(EventTypes.InitCommand, new ArrayList<EventCommandData>());
4747
eventHandlers.put(EventTypes.BeforeExecuteCommand,

Diff for: src/main/java/com/ckfinder/connector/data/XmlElementData.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ public class XmlElementData {
4747
public XmlElementData(final String name) {
4848
super();
4949
this.name = name;
50-
this.attributes = new ArrayList<XmlAttribute>();
51-
this.childrens = new ArrayList<XmlElementData>();
50+
this.attributes = new ArrayList<>();
51+
this.childrens = new ArrayList<>();
5252
}
5353

5454
/**

Diff for: src/main/java/com/ckfinder/connector/errors/ErrorUtils.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public static ErrorUtils getInstance() {
8686
*/
8787
private ErrorUtils() {
8888
List<String> allAvailLangCodes = getAllLangCodes();
89-
langMap = new HashMap<String, Map<Integer, String>>();
89+
langMap = new HashMap<>();
9090
for (String langCode : allAvailLangCodes) {
9191
langMap.put(langCode, getMessagesByLangCode(langCode));
9292
}
@@ -105,7 +105,7 @@ private List<String> getAllLangCodes() {
105105
* @return read files from jar that matches lang file pattern.
106106
*/
107107
private List<String> readJarFiles() {
108-
List<String> langFiles = new ArrayList<String>();
108+
List<String> langFiles = new ArrayList<>();
109109
try {
110110
URL dirURL = ConnectorServlet.class.getResource("/lang/");
111111
// #768 there was a problem that files were loaded from work not from jar
@@ -160,7 +160,7 @@ private boolean checkJarEntry(final JarEntry jarEntry) {
160160
* @return map of lang messages.
161161
*/
162162
private Map<Integer, String> getMessagesByLangCode(final String langCode) {
163-
Map<Integer, String> langCodeMap = new HashMap<Integer, String>();
163+
Map<Integer, String> langCodeMap = new HashMap<>();
164164
try {
165165

166166
InputStream is = ConnectorServlet.class.getResourceAsStream("/lang/" + langCode + ".xml");

Diff for: src/main/java/com/ckfinder/connector/handlers/command/CopyFilesCommand.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ public void initParams(final HttpServletRequest request,
308308
final IConfiguration configuration,
309309
final Object... params) throws ConnectorException {
310310
super.initParams(request, configuration);
311-
this.files = new ArrayList<FilePostParam>();
311+
this.files = new ArrayList<>();
312312
this.copiedAll = (request.getParameter("copied") != null) ? Integer.valueOf(request.getParameter("copied")) : 0;
313313

314314
getFilesListFromRequest(request);

Diff for: src/main/java/com/ckfinder/connector/handlers/command/DeleteFilesCommand.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public void initParams(HttpServletRequest request,
160160
IConfiguration configuration,
161161
Object... params) throws ConnectorException {
162162
super.initParams(request, configuration);
163-
this.files = new ArrayList<FilePostParam>();
163+
this.files = new ArrayList<>();
164164
getFilesListFromRequest(request);
165165
}
166166

Diff for: src/main/java/com/ckfinder/connector/handlers/command/GetFilesCommand.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ protected int getDataForXml() {
117117
*
118118
*/
119119
private void filterListByHiddenAndNotAllowed() {
120-
List<String> tmpFiles = new ArrayList<String>();
120+
List<String> tmpFiles = new ArrayList<>();
121121
for (String file : this.files) {
122122
if (FileUtils.checkFileExtension(file, this.configuration.getTypes().get(this.type)) == 0
123123
&& !FileUtils.checkIfFileIsHidden(file, this.configuration)) {

Diff for: src/main/java/com/ckfinder/connector/handlers/command/GetFoldersCommand.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ protected int getDataForXml() {
8888
* ACL.
8989
*/
9090
private void filterListByHiddenAndNotAllowed() {
91-
List<String> tmpDirs = new ArrayList<String>();
91+
List<String> tmpDirs = new ArrayList<>();
9292
for (String dir : this.directories) {
9393
if (AccessControlUtil.getInstance(this.configuration).checkFolderACL(this.type, this.currentFolder + dir,
9494
this.userRole,

Diff for: src/main/java/com/ckfinder/connector/handlers/command/InitCommand.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ private void createResouceTypesData(final Element rootElement) throws Exception
198198

199199
List<String> types;
200200
if (super.type != null && !super.type.equals("")) {
201-
types = new ArrayList<String>();
201+
types = new ArrayList<>();
202202
types.add(super.type);
203203
} else {
204204
types = getTypes();

Diff for: src/main/java/com/ckfinder/connector/handlers/command/MoveFilesCommand.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ public void initParams(final HttpServletRequest request,
310310
final IConfiguration configuration, final Object... params)
311311
throws ConnectorException {
312312
super.initParams(request, configuration);
313-
this.files = new ArrayList<FilePostParam>();
313+
this.files = new ArrayList<>();
314314
this.movedAll = (request.getParameter("moved") != null) ? Integer.valueOf(request.getParameter("moved")) : 0;
315315

316316
getFilesListFromRequest(request);

Diff for: src/main/java/com/ckfinder/connector/utils/AccessControlUtil.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ private AccessControlUtil(final IConfiguration configuration1) {
9494
* loads ACL configuration from connector configuration.
9595
*/
9696
public void loadACLConfig() {
97-
aclEntries = new ArrayList<AccessControlUtil.ACLEntry>();
97+
aclEntries = new ArrayList<>();
9898
for (AccessControlLevel item : configuration.getAccessConrolLevels()) {
9999
ACLEntry aclEntry = new ACLEntry();
100100
aclEntry.role = item.getRole();
@@ -221,7 +221,7 @@ private int countAclByEntry(final int acl, final ACLEntry entry) {
221221
*/
222222
private List<ACLEntry> findACLEntryByRoleAndType(final String type,
223223
final String role) {
224-
List<ACLEntry> res = new ArrayList<AccessControlUtil.ACLEntry>();
224+
List<ACLEntry> res = new ArrayList<>();
225225
for (ACLEntry item : aclEntries) {
226226
if (item.role.equals(role) && item.type.equals(type)) {
227227
res.add(item);

Diff for: src/main/java/com/ckfinder/connector/utils/FileUtils.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ public class FileUtils {
5454

5555

5656
private static final Map<String, String> UTF8_LOWER_ACCENTS
57-
= new HashMap<String, String>();
57+
= new HashMap<>();
5858
private static final Map<String, String> UTF8_UPPER_ACCENTS
59-
= new HashMap<String, String>();
59+
= new HashMap<>();
6060

6161

6262
private static final Map<String, String> encodingMap;
6363
static {
64-
Map<String, String> mapHelper = new HashMap<String, String>();
64+
Map<String, String> mapHelper = new HashMap<>();
6565
mapHelper.put("%21", "!");
6666
mapHelper.put("%27", "'");
6767
mapHelper.put("%28", "(");
@@ -79,7 +79,7 @@ public class FileUtils {
7979
*/
8080
public static List<String> findChildrensList(final File dir,
8181
final boolean searchDirs) {
82-
List<String> files = new ArrayList<String>();
82+
List<String> files = new ArrayList<>();
8383
for (String subFiles : dir.list()) {
8484
File file = new File(dir + "/" + subFiles);
8585
if ((searchDirs && file.isDirectory())

Diff for: src/main/java/com/ckfinder/connector/utils/XMLCreator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void createDocument() throws ConnectorException {
6767
* standard constuctor.
6868
*/
6969
public XMLCreator() {
70-
this.errorList = new ArrayList<ErrorNode>();
70+
this.errorList = new ArrayList<>();
7171
}
7272

7373
/**

Diff for: src/main/java/com/dcfun/elec/base/query/BaseQuery.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public abstract class BaseQuery {
77

88

99
//将收集到的表单元素封装成map
10-
private Map<String, Object> keyValues = new HashMap<String, Object>();
10+
private Map<String, Object> keyValues = new HashMap<>();
1111

1212
public Map<String, Object> getKeyValues() {
1313
return keyValues;

Diff for: src/main/java/com/dcfun/elec/domain/ElecPopedom.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void setIsMenu(boolean isMenu) {
7070

7171
/**非持久化javabean属性*/
7272
//表示如果一个父包含的所有子的集合
73-
private List<ElecPopedom> list = new ArrayList<ElecPopedom>();
73+
private List<ElecPopedom> list = new ArrayList<>();
7474
//角色ID
7575
private String roleID;
7676
/**

Diff for: src/main/java/com/dcfun/elec/domain/ElecRole.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class ElecRole implements java.io.Serializable {
1111
private String roleName; //角色名称
1212

1313
/** 2016-04-23 23:45:25添加 Set<ElecUser>*/
14-
private Set<ElecUser> elecUsers = new HashSet<ElecUser>();
14+
private Set<ElecUser> elecUsers = new HashSet<>();
1515

1616
public Set<ElecUser> getElecUsers() {
1717
return elecUsers;

Diff for: src/main/java/com/dcfun/elec/domain/ElecUser.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class ElecUser implements java.io.Serializable {
2828
private String remark; //备注
2929

3030

31-
private Set<ElecUserFile> elecUserFiles = new HashSet<ElecUserFile>();
31+
private Set<ElecUserFile> elecUserFiles = new HashSet<>();
3232

3333
public Set<ElecUserFile> getElecUserFiles() {
3434
return elecUserFiles;

Diff for: src/main/java/com/dcfun/elec/service/impl/ElecCommonMsgServiceImpl.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ public ElecCommonMsg findCommonMsg() {
9999
/**********************************************begin**********************************************************/
100100
//获取数据内容
101101
//以类型作为条件,按照显示顺序升序排列,查询站点运行情况的数据
102-
Map<String, Object> stationCondition = new HashMap<String, Object>();
102+
Map<String, Object> stationCondition = new HashMap<>();
103103
stationCondition.put("type", "1");
104-
Map<String, String> stationOrderby = new LinkedHashMap<String, String>();
104+
Map<String, String> stationOrderby = new LinkedHashMap<>();
105105
stationOrderby.put("orderby", "asc");
106106
List<ElecCommonMsgContent> stationList = elecCommonMsgContentDao.findCollectionByConditionNoPage(stationCondition, stationOrderby);
107107
//获取返回的数据(拼装之后)
@@ -116,9 +116,9 @@ public ElecCommonMsg findCommonMsg() {
116116
commonMsg.setStationRun(stationContent);
117117
/**********************************************************************************/
118118
//以类型作为条件,按照显示顺序升序排列,查询站点运行情况的数据
119-
Map<String, Object> devCondition = new HashMap<String, Object>();
119+
Map<String, Object> devCondition = new HashMap<>();
120120
devCondition.put("type", "2");
121-
Map<String, String> devOrderby = new LinkedHashMap<String, String>();
121+
Map<String, String> devOrderby = new LinkedHashMap<>();
122122
devOrderby.put("orderby", "asc");
123123
List<ElecCommonMsgContent> devList = elecCommonMsgContentDao.findCollectionByConditionNoPage(devCondition, devOrderby);
124124
//获取返回的数据(拼装之后)

Diff for: src/main/java/com/dcfun/elec/service/impl/ElecFileUploadServiceImpl.java

+10-5
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ public List<ElecFileUpload> findFileUploadListByCondition(
9797
ElecFileUpload elecFileUpload) {
9898

9999
// 组织查询条件
100-
Map<String, Object> condition = new HashMap<String, Object>();
101-
Map<String, String> orderby = new LinkedHashMap<String, String>();
100+
Map<String, Object> condition = new HashMap<>();
101+
Map<String, String> orderby = new LinkedHashMap<>();
102102
if (!elecFileUpload.getProjId().equals("0")) {
103103
condition.put("o.projId", elecFileUpload.getProjId());
104104
}
@@ -109,7 +109,7 @@ public List<ElecFileUpload> findFileUploadListByCondition(
109109

110110
String scalar = "o.seqID,a.ddlName,b.ddlName,o.FileName,o.FileURL,o.progressTime,o.comment";
111111
String From = "Elec_FileUpload o";
112-
ArrayList<String> innerJoin = new ArrayList<String>();
112+
ArrayList<String> innerJoin = new ArrayList<>();
113113
innerJoin.add(" elec_systemddl a ON o.projID = a.ddlCode AND a.keyword='所属单位' ");
114114
innerJoin.add(" elec_systemddl b ON o.belongTo = b.ddlCode AND b.keyword='图纸类别' ");
115115

@@ -120,8 +120,13 @@ public List<ElecFileUpload> findFileUploadListByCondition(
120120
scalar, innerJoin, From);
121121

122122
// 将查询的结果,封装到List<ElecFileUpload>
123+
<<<<<<< HEAD
123124
List<ElecFileUpload> fileUploadList = new ArrayList<ElecFileUpload>();
124125
if (list != null && !list.isEmpty()) {
126+
=======
127+
List<ElecFileUpload> fileUploadList = new ArrayList<>();
128+
if (list != null && list.size() > 0) {
129+
>>>>>>> 43365707b590f3d0bcd1e88eb24b230468022998
125130
for (int i = 0; i < list.size(); i++) {
126131
Object[] arrays = list.get(i);
127132
// 组织页面显示的对象
@@ -167,7 +172,7 @@ public ElecFileUpload findFileByID(Integer fileID) {
167172
public List<ElecFileUpload> findFileUploadListByLuceneCondition(
168173
ElecFileUpload elecFileUpload) {
169174

170-
List<ElecFileUpload> fileUploadList = new ArrayList<ElecFileUpload>();
175+
List<ElecFileUpload> fileUploadList = new ArrayList<>();
171176

172177
//组织查询条件,进行 lucene索引查询
173178
String projId = elecFileUpload.getProjId();
@@ -179,7 +184,7 @@ public List<ElecFileUpload> findFileUploadListByLuceneCondition(
179184
if (list!=null && !list.isEmpty()) {
180185
for(ElecFileUpload fileUpload:list){
181186
Integer seqId = fileUpload.getSeqId();
182-
Map<String, Object> condition = new HashMap<String, Object>();
187+
Map<String, Object> condition = new HashMap<>();
183188
condition.put("seqId", seqId);
184189
List<ElecFileUpload> file = elecFileUploadDao.findCollectionByConditionNoPage(condition, null);
185190

0 commit comments

Comments
 (0)