Skip to content

Commit

Permalink
[ISSUE #782] delete invalid code in eventmesh-connector-plugin module (
Browse files Browse the repository at this point in the history
  • Loading branch information
AhahaGe authored Feb 28, 2022
1 parent eaa54a0 commit 1d86129
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 436 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,11 @@ protected boolean isContentTypeHeader(String key) {

@Override
protected boolean isCloudEventsHeader(String key) {
// return key.length() > 3 && key.substring(0, RocketMQHeaders.CE_PREFIX.length())
//.startsWith(RocketMQHeaders.CE_PREFIX);
return true;
}

@Override
protected String toCloudEventsKey(String key) {
//return key.substring(RocketMQHeaders.CE_PREFIX.length()).toLowerCase();
return key.toLowerCase();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ public RocketMQMessageWriter(String topic, String keys, String tags) {
@Override
public CloudEventContextWriter withContextAttribute(String name, String value)
throws CloudEventRWException {

//String propName = RocketMQHeaders.ATTRIBUTES_TO_HEADERS.get(name);
//if (propName == null) {
//propName = RocketMQHeaders.CE_PREFIX + name;
//}
//message.putUserProperty(propName, value);
message.putUserProperty(name, value);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@

public final class BeanUtils {

private static final InternalLogger log = ClientLogger.getLog();
private static final InternalLogger LOG = ClientLogger.getLog();

/**
* Maps primitive {@code Class}es to their corresponding wrapper {@code Class}.
*/
private static Map<Class<?>, Class<?>> primitiveWrapperMap = new HashMap<Class<?>, Class<?>>();
private static Map<Class<?>, Class<?>> primitiveWrapperMap = new HashMap<>();

static {
primitiveWrapperMap.put(Boolean.TYPE, Boolean.class);
Expand All @@ -49,7 +49,7 @@ public final class BeanUtils {
primitiveWrapperMap.put(Void.TYPE, Void.TYPE);
}

private static Map<Class<?>, Class<?>> wrapperMap = new HashMap<Class<?>, Class<?>>();
private static Map<Class<?>, Class<?>> wrapperMap = new HashMap<>();

static {
for (final Class<?> primitiveClass : primitiveWrapperMap.keySet()) {
Expand Down Expand Up @@ -91,7 +91,7 @@ public static <T> T populate(final Properties properties, final Class<T> clazz)
obj = clazz.getDeclaredConstructor().newInstance();
return populate(properties, obj);
} catch (Throwable e) {
log.warn("Error occurs !", e);
LOG.warn("Error occurs !", e);
}
return obj;
}
Expand All @@ -116,22 +116,11 @@ public static <T> T populate(final Properties properties, final T obj) {
}
}
} catch (RuntimeException e) {
log.warn("Error occurs !", e);
LOG.warn("Error occurs !", e);
}
return obj;
}

//public static <T> T populate(final KeyValue properties, final Class<T> clazz) {
// T obj = null;
// try {
// obj = clazz.newInstance();
// return populate(properties, obj);
// } catch (Throwable e) {
// log.warn("Error occurs !", e);
// }
// return obj;
//}

public static Class<?> getMethodClass(Class<?> clazz, String methodName) {
Method[] methods = clazz.getMethods();
for (Method method : methods) {
Expand Down Expand Up @@ -160,30 +149,5 @@ public static void setProperties(Class<?> clazz, Object obj, String methodName,
setterMethod.invoke(obj, value);
}
}


//public static <T> T populate(final Properties properties, final T obj) {
// Class<?> clazz = obj.getClass();
// try {
//
// final Set<Object> keySet = properties.keySet();
// for (Object key : keySet) {
// String[] keyGroup = key.toString().split("[\\._]");
// for (int i = 0; i < keyGroup.length; i++) {
// keyGroup[i] = keyGroup[i].toLowerCase();
// keyGroup[i] = StringUtils.capitalize(keyGroup[i]);
// }
// String beanFieldNameWithCapitalization = StringUtils.join(keyGroup);
// try {
// setProperties(clazz, obj, "set" + beanFieldNameWithCapitalization, properties.getProperty(key.toString()));
// } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ignored) {
// //ignored...
// }
// }
// } catch (RuntimeException e) {
// log.warn("Error occurs !", e);
// }
// return obj;
//}
}

Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ public static Message msgConvert(MessageExt rmqMsg) {


private static String buildCloudEventPropertyKey(String propName) {
//return RocketMQHeaders.CE_PREFIX + propName;
return propName;
}

Expand Down
Loading

0 comments on commit 1d86129

Please sign in to comment.