Skip to content

Commit

Permalink
wertwrt
Browse files Browse the repository at this point in the history
  • Loading branch information
car031 committed Aug 23, 2024
1 parent 00f5af4 commit 5e37c5e
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ public boolean equals(Object obj) {
if (getClass() != obj.getClass())
return false;
SystemMessage other = (SystemMessage) obj;
if (status != other.status)
return false;
return true;
return status == other.status;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ public FormatConverter getConverter(String inFileName, String outFileName) {
return new NoConversionConverter();

String inOutkey = composeKey(inFileName, outFileName);

List<FormatConverter> formatConverters = getConverters().get(inOutkey);
if (formatConverters == null || formatConverters.isEmpty())
formatConverters = getConverters().get("*-pdf");
Expand Down Expand Up @@ -522,14 +522,14 @@ public synchronized void init() {
if (!converters.isEmpty())
return;

// Acquire the 'ThumbnailBuilder' extensions of the core plugin
// Acquire the 'FormatConverter' extensions of the core plugin
PluginRegistry registry = PluginRegistry.getInstance();
Collection<Extension> exts = registry.getExtensions("logicaldoc-core", "FormatConverter");

for (Extension ext : exts) {
String className = ext.getParameter("class").valueAsString();

// Try to instantiate the builder
// Try to instantiate the converter
Object converter;
try {
Class<?> clazz = Class.forName(className);
Expand All @@ -539,8 +539,8 @@ public synchronized void init() {
"The specified converter %s doesn't implement FormatConverter interface", className));
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException
| InvocationTargetException | NoSuchMethodException | SecurityException e) {
log.error(e.getMessage(), e);
break;
log.warn(e.getMessage(), e);
continue;
}

FormatConverter cnvrt = (FormatConverter) converter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,6 @@ public boolean equals(Object obj) {
return false;
} else if (!name.equals(other.name))
return false;
if (parentId != other.parentId)
return false;
return true;
return parentId == other.parentId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ public boolean equals(Object obj) {
return false;
} else if (!name.equals(other.name))
return false;
if (userId != other.userId)
return false;
return true;
return userId == other.userId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ public boolean equals(Object obj) {
return false;
} else if (!password.equals(other.password))
return false;
if (userId != other.userId)
return false;
return true;
return userId == other.userId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
* @since 8.1.2
*/
public class SyndicationStandardProperties extends SyndicationDetailsTab {
private static final String NODISPLAY = "nodisplay";

private static final String APIKEY = "apikey";

private static final String REPLICATECUSTOMID = "replicatecustomid";
Expand Down Expand Up @@ -98,16 +100,16 @@ private void refresh() {
* and prevent it to auto-fill the username and password we really use.
*/
TextItem fakeUsername = ItemFactory.newTextItem("prevent_autofill", syndication.getUsername());
fakeUsername.setCellStyle("nodisplay");
fakeUsername.setCellStyle(NODISPLAY);
TextItem hiddenPassword = ItemFactory.newTextItem("password_hidden", syndication.getPassword());
hiddenPassword.setCellStyle("nodisplay");
hiddenPassword.setCellStyle(NODISPLAY);
hiddenPassword.addChangedHandler(changedHandler);
FormItem password = ItemFactory.newSafePasswordItem(PASSWORD, I18N.message(PASSWORD), syndication.getPassword(),
hiddenPassword, changedHandler);
password.addChangedHandler(changedHandler);

TextItem hiddenApiKey = ItemFactory.newTextItem("apikey_hidden", syndication.getApiKey());
hiddenApiKey.setCellStyle("nodisplay");
hiddenApiKey.setCellStyle(NODISPLAY);
hiddenApiKey.addChangedHandler(changedHandler);
FormItem apiKey = ItemFactory.newSafePasswordItem(APIKEY, I18N.message(APIKEY), syndication.getApiKey(),
hiddenApiKey, changedHandler);
Expand Down
13 changes: 13 additions & 0 deletions logicaldoc-util/src/main/java/com/logicaldoc/util/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,19 @@ public Object getBean(String id) {
: applicationContext.getBean(Character.toLowerCase(id.charAt(0)) + id.substring(1));
}

/**
* Says if a bean is or not available
*
* @param id identifier of the bean
*
* @return true if the bean is available
*/
public boolean containsBean(String id) {
// If not found with give ID try to lowercase the first char
return applicationContext.containsBean(id)
|| applicationContext.containsBean(Character.toLowerCase(id.charAt(0)) + id.substring(1));
}

/**
* Retrieves the collection of all the bean ids
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void testDelete() throws ServerException, PersistenceException {
}

@Test
public void testCountDocuments() throws ServerException, PersistenceException {
public void testCountDocuments() throws ServerException {
assertEquals(0L, testSubject.countDocuments(-1L));
assertEquals(0L, testSubject.countDocuments(99L));
}
Expand Down

0 comments on commit 5e37c5e

Please sign in to comment.