code
stringlengths 130
281k
| code_dependency
stringlengths 182
306k
|
|---|---|
public class class_name {
public static String getValue(String value) {
if (value == null) {
return null;
}
String v = removeQuotes(value.trim()).trim();
if (v.isEmpty()) {
return null;
}
return v;
} }
|
public class class_name {
public static String getValue(String value) {
if (value == null) {
return null; // depends on control dependency: [if], data = [none]
}
String v = removeQuotes(value.trim()).trim();
if (v.isEmpty()) {
return null; // depends on control dependency: [if], data = [none]
}
return v;
} }
|
public class class_name {
public EClass getIfcConversionBasedUnit() {
if (ifcConversionBasedUnitEClass == null) {
ifcConversionBasedUnitEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(118);
}
return ifcConversionBasedUnitEClass;
} }
|
public class class_name {
public EClass getIfcConversionBasedUnit() {
if (ifcConversionBasedUnitEClass == null) {
ifcConversionBasedUnitEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(118);
// depends on control dependency: [if], data = [none]
}
return ifcConversionBasedUnitEClass;
} }
|
public class class_name {
public void pollBackup(long itemId) {
QueueItem item = getBackupMap().remove(itemId);
if (item != null) {
// for stats
age(item, Clock.currentTimeMillis());
}
} }
|
public class class_name {
public void pollBackup(long itemId) {
QueueItem item = getBackupMap().remove(itemId);
if (item != null) {
// for stats
age(item, Clock.currentTimeMillis()); // depends on control dependency: [if], data = [(item]
}
} }
|
public class class_name {
private boolean keyAlreadyExists(String newKey) {
Collection<?> itemIds = m_table.getItemIds();
for (Object itemId : itemIds) {
if (m_table.getItem(itemId).getItemProperty(TableProperty.KEY).getValue().equals(newKey)) {
return true;
}
}
return false;
} }
|
public class class_name {
private boolean keyAlreadyExists(String newKey) {
Collection<?> itemIds = m_table.getItemIds();
for (Object itemId : itemIds) {
if (m_table.getItem(itemId).getItemProperty(TableProperty.KEY).getValue().equals(newKey)) {
return true; // depends on control dependency: [if], data = [none]
}
}
return false;
} }
|
public class class_name {
protected static void register(Class<?> parent, String cname) {
Entry e = data.get(parent);
if(e == null) {
data.put(parent, e = new Entry());
}
e.addName(cname);
} }
|
public class class_name {
protected static void register(Class<?> parent, String cname) {
Entry e = data.get(parent);
if(e == null) {
data.put(parent, e = new Entry()); // depends on control dependency: [if], data = [none]
}
e.addName(cname);
} }
|
public class class_name {
private boolean getShowExplorer() {
if (getParamShowexplorer() != null) {
return Boolean.valueOf(getParamShowexplorer()).booleanValue();
}
Map<?, ?> dialogObject = (Map<?, ?>)getSettings().getDialogObject();
if (dialogObject == null) {
return false;
}
Boolean storedParam = (Boolean)dialogObject.get(getClass().getName());
if (storedParam == null) {
return false;
}
return storedParam.booleanValue();
} }
|
public class class_name {
private boolean getShowExplorer() {
if (getParamShowexplorer() != null) {
return Boolean.valueOf(getParamShowexplorer()).booleanValue(); // depends on control dependency: [if], data = [(getParamShowexplorer()]
}
Map<?, ?> dialogObject = (Map<?, ?>)getSettings().getDialogObject();
if (dialogObject == null) {
return false; // depends on control dependency: [if], data = [none]
}
Boolean storedParam = (Boolean)dialogObject.get(getClass().getName());
if (storedParam == null) {
return false; // depends on control dependency: [if], data = [none]
}
return storedParam.booleanValue();
} }
|
public class class_name {
private void setVerticalScrollbar(final CmsScrollBar scrollbar, int width) {
// Validate.
if ((scrollbar == m_scrollbar) || (scrollbar == null)) {
return;
}
// Detach new child.
scrollbar.asWidget().removeFromParent();
// Remove old child.
if (m_scrollbar != null) {
if (m_verticalScrollbarHandlerRegistration != null) {
m_verticalScrollbarHandlerRegistration.removeHandler();
m_verticalScrollbarHandlerRegistration = null;
}
remove(m_scrollbar);
}
m_scrollLayer.appendChild(scrollbar.asWidget().getElement());
adopt(scrollbar.asWidget());
// Logical attach.
m_scrollbar = scrollbar;
m_verticalScrollbarWidth = width;
// Initialize the new scrollbar.
m_verticalScrollbarHandlerRegistration = scrollbar.addValueChangeHandler(new ValueChangeHandler<Integer>() {
public void onValueChange(ValueChangeEvent<Integer> event) {
int vPos = scrollbar.getVerticalScrollPosition();
int v = getVerticalScrollPosition();
if (v != vPos) {
setVerticalScrollPosition(vPos);
}
}
});
maybeUpdateScrollbars();
} }
|
public class class_name {
private void setVerticalScrollbar(final CmsScrollBar scrollbar, int width) {
// Validate.
if ((scrollbar == m_scrollbar) || (scrollbar == null)) {
return;
// depends on control dependency: [if], data = [none]
}
// Detach new child.
scrollbar.asWidget().removeFromParent();
// Remove old child.
if (m_scrollbar != null) {
if (m_verticalScrollbarHandlerRegistration != null) {
m_verticalScrollbarHandlerRegistration.removeHandler();
// depends on control dependency: [if], data = [none]
m_verticalScrollbarHandlerRegistration = null;
// depends on control dependency: [if], data = [none]
}
remove(m_scrollbar);
// depends on control dependency: [if], data = [(m_scrollbar]
}
m_scrollLayer.appendChild(scrollbar.asWidget().getElement());
adopt(scrollbar.asWidget());
// Logical attach.
m_scrollbar = scrollbar;
m_verticalScrollbarWidth = width;
// Initialize the new scrollbar.
m_verticalScrollbarHandlerRegistration = scrollbar.addValueChangeHandler(new ValueChangeHandler<Integer>() {
public void onValueChange(ValueChangeEvent<Integer> event) {
int vPos = scrollbar.getVerticalScrollPosition();
int v = getVerticalScrollPosition();
if (v != vPos) {
setVerticalScrollPosition(vPos);
// depends on control dependency: [if], data = [(v]
}
}
});
maybeUpdateScrollbars();
} }
|
public class class_name {
public static UserPreferences load(final FileObject userPreferencesFile, final boolean loadDatabaseDrivers) {
try {
if (userPreferencesFile == null || !userPreferencesFile.exists()) {
logger.info("User preferences file does not exist");
return new UserPreferencesImpl(userPreferencesFile);
}
} catch (final FileSystemException e) {
logger.debug("Could not determine if file exists: {}", userPreferencesFile);
}
ChangeAwareObjectInputStream inputStream = null;
try {
inputStream = new ChangeAwareObjectInputStream(userPreferencesFile.getContent().getInputStream());
inputStream.addRenamedClass("org.datacleaner.user.UserPreferences", UserPreferencesImpl.class);
final UserPreferencesImpl result = (UserPreferencesImpl) inputStream.readObject();
if (loadDatabaseDrivers) {
final List<UserDatabaseDriver> installedDatabaseDrivers = result.getDatabaseDrivers();
for (final UserDatabaseDriver userDatabaseDriver : installedDatabaseDrivers) {
try {
userDatabaseDriver.loadDriver();
} catch (final IllegalStateException e) {
logger.error("Could not load database driver", e);
}
}
}
result._userPreferencesFile = userPreferencesFile;
result.refreshProxySettings();
return result;
} catch (final InvalidClassException e) {
logger.warn("User preferences file version does not match application version: {}", e.getMessage());
return new UserPreferencesImpl(userPreferencesFile);
} catch (final Exception e) {
logger.warn("Could not read user preferences file", e);
return new UserPreferencesImpl(userPreferencesFile);
} finally {
FileHelper.safeClose(inputStream);
}
} }
|
public class class_name {
public static UserPreferences load(final FileObject userPreferencesFile, final boolean loadDatabaseDrivers) {
try {
if (userPreferencesFile == null || !userPreferencesFile.exists()) {
logger.info("User preferences file does not exist"); // depends on control dependency: [if], data = [none]
return new UserPreferencesImpl(userPreferencesFile); // depends on control dependency: [if], data = [(userPreferencesFile]
}
} catch (final FileSystemException e) {
logger.debug("Could not determine if file exists: {}", userPreferencesFile);
} // depends on control dependency: [catch], data = [none]
ChangeAwareObjectInputStream inputStream = null;
try {
inputStream = new ChangeAwareObjectInputStream(userPreferencesFile.getContent().getInputStream()); // depends on control dependency: [try], data = [none]
inputStream.addRenamedClass("org.datacleaner.user.UserPreferences", UserPreferencesImpl.class); // depends on control dependency: [try], data = [none]
final UserPreferencesImpl result = (UserPreferencesImpl) inputStream.readObject();
if (loadDatabaseDrivers) {
final List<UserDatabaseDriver> installedDatabaseDrivers = result.getDatabaseDrivers();
for (final UserDatabaseDriver userDatabaseDriver : installedDatabaseDrivers) {
try {
userDatabaseDriver.loadDriver(); // depends on control dependency: [try], data = [none]
} catch (final IllegalStateException e) {
logger.error("Could not load database driver", e);
} // depends on control dependency: [catch], data = [none]
}
}
result._userPreferencesFile = userPreferencesFile; // depends on control dependency: [try], data = [none]
result.refreshProxySettings(); // depends on control dependency: [try], data = [none]
return result; // depends on control dependency: [try], data = [none]
} catch (final InvalidClassException e) {
logger.warn("User preferences file version does not match application version: {}", e.getMessage());
return new UserPreferencesImpl(userPreferencesFile);
} catch (final Exception e) { // depends on control dependency: [catch], data = [none]
logger.warn("Could not read user preferences file", e);
return new UserPreferencesImpl(userPreferencesFile);
} finally { // depends on control dependency: [catch], data = [none]
FileHelper.safeClose(inputStream);
}
} }
|
public class class_name {
private static boolean isDebugModeEnabled(String[] args) {
for (int i = 0; i < args.length; i++) {
String arg = args[i];
if (arg.equalsIgnoreCase("--debug")) {
return true;
}
}
return false;
} }
|
public class class_name {
private static boolean isDebugModeEnabled(String[] args) {
for (int i = 0; i < args.length; i++) {
String arg = args[i];
if (arg.equalsIgnoreCase("--debug")) {
return true; // depends on control dependency: [if], data = [none]
}
}
return false;
} }
|
public class class_name {
public static String findCommonPrefix(final String... strings) {
StringBuilder prefix = new StringBuilder();
int index = 0;
char c = 0;
loop:
while (true) {
for (int i = 0; i < strings.length; i++) {
String s = strings[i];
if (index == s.length()) {
break loop;
}
if (i == 0) {
c = s.charAt(index);
} else {
if (s.charAt(index) != c) {
break loop;
}
}
}
index++;
prefix.append(c);
}
return prefix.length() == 0 ? StringPool.EMPTY : prefix.toString();
} }
|
public class class_name {
public static String findCommonPrefix(final String... strings) {
StringBuilder prefix = new StringBuilder();
int index = 0;
char c = 0;
loop:
while (true) {
for (int i = 0; i < strings.length; i++) {
String s = strings[i];
if (index == s.length()) {
break loop;
}
if (i == 0) {
c = s.charAt(index); // depends on control dependency: [if], data = [(i]
} else {
if (s.charAt(index) != c) {
break loop;
}
}
}
index++; // depends on control dependency: [while], data = [none]
prefix.append(c); // depends on control dependency: [while], data = [none]
}
return prefix.length() == 0 ? StringPool.EMPTY : prefix.toString();
} }
|
public class class_name {
@SuppressWarnings("static-method")
protected Map<XVariableDeclaration, XFeatureCall> getReferencedLocalVariable(XExpression expression, boolean onlyWritable) {
final Map<XVariableDeclaration, XFeatureCall> localVariables = new TreeMap<>((k1, k2) -> {
return k1.getIdentifier().compareTo(k2.getIdentifier());
});
for (final XFeatureCall featureCall : EcoreUtil2.getAllContentsOfType(expression, XFeatureCall.class)) {
if (featureCall.getFeature() instanceof XVariableDeclaration) {
final XVariableDeclaration localVariable = (XVariableDeclaration) featureCall.getFeature();
if ((!onlyWritable || localVariable.isWriteable()) && !localVariables.containsKey(localVariable)) {
localVariables.put(localVariable, featureCall);
}
}
}
return localVariables;
} }
|
public class class_name {
@SuppressWarnings("static-method")
protected Map<XVariableDeclaration, XFeatureCall> getReferencedLocalVariable(XExpression expression, boolean onlyWritable) {
final Map<XVariableDeclaration, XFeatureCall> localVariables = new TreeMap<>((k1, k2) -> {
return k1.getIdentifier().compareTo(k2.getIdentifier());
});
for (final XFeatureCall featureCall : EcoreUtil2.getAllContentsOfType(expression, XFeatureCall.class)) {
if (featureCall.getFeature() instanceof XVariableDeclaration) {
final XVariableDeclaration localVariable = (XVariableDeclaration) featureCall.getFeature();
if ((!onlyWritable || localVariable.isWriteable()) && !localVariables.containsKey(localVariable)) {
localVariables.put(localVariable, featureCall); // depends on control dependency: [if], data = [none]
}
}
}
return localVariables;
} }
|
public class class_name {
private List<Key> getDateTimeKeys() {
Key date = findKey(DATE);
Key time = findKey(TIME);
if ((date == null) || (time == null)
|| !date.type.equals(time.type)) {
return null;
}
List<Key> dt = new ArrayList<>(2);
dt.add(date);
dt.add(time);
return dt;
} }
|
public class class_name {
private List<Key> getDateTimeKeys() {
Key date = findKey(DATE);
Key time = findKey(TIME);
if ((date == null) || (time == null)
|| !date.type.equals(time.type)) {
return null; // depends on control dependency: [if], data = [none]
}
List<Key> dt = new ArrayList<>(2);
dt.add(date);
dt.add(time);
return dt;
} }
|
public class class_name {
public FeatureVector createWordFeatures(DependencyInstance dependencyInstance, int i) {
int[] pos = dependencyInstance.getPostagids();
int[] posA = dependencyInstance.getCpostagids();
int[] toks = dependencyInstance.getFormids();
int[] lemma = dependencyInstance.getLemmaids();
int p0 = pos[i];
int pp = i > 0 ? pos[i - 1] : this.tokenStart;
int pn = i < pos.length - 1 ? pos[i + 1] : this.tokenEnd;
int c0 = posA[i];
int cp = i > 0 ? posA[i - 1] : this.tokenStart;
int cn = i < posA.length - 1 ? posA[i + 1] : this.tokenEnd;
int w0 = toks[i];
int wp = i == 0 ? this.tokenStart : toks[i - 1];
int wn = i == dependencyInstance.getLength() - 1 ? this.tokenEnd : toks[i + 1];
int l0 = 0;
int lp = 0;
int ln = 0;
if (lemma != null) {
l0 = lemma[i];
lp = i == 0 ? this.tokenStart : lemma[i - 1];
ln = i == dependencyInstance.getLength() - 1 ? this.tokenEnd : lemma[i + 1];
}
FeatureVector fv = new FeatureVector();
long code;
code = createWordCodeP(WORDFV_BIAS, 0);
addWordFeature(code, fv);
code = createWordCodeW(WORDFV_W0, w0);
addWordFeature(code, fv);
code = createWordCodeW(WORDFV_Wp, wp);
addWordFeature(code, fv);
code = createWordCodeW(WORDFV_Wn, wn);
addWordFeature(code, fv);
if (l0 != 0) {
code = createWordCodeW(WORDFV_W0, l0);
addWordFeature(code, fv);
code = createWordCodeW(WORDFV_Wp, lp);
addWordFeature(code, fv);
code = createWordCodeW(WORDFV_Wn, ln);
addWordFeature(code, fv);
}
code = createWordCodeP(WORDFV_P0, p0);
addWordFeature(code, fv);
code = createWordCodeP(WORDFV_Pp, pp);
addWordFeature(code, fv);
code = createWordCodeP(WORDFV_Pn, pn);
addWordFeature(code, fv);
code = createWordCodeP(WORDFV_P0, c0);
addWordFeature(code, fv);
code = createWordCodeP(WORDFV_Pp, cp);
addWordFeature(code, fv);
code = createWordCodeP(WORDFV_Pn, cn);
addWordFeature(code, fv);
code = createWordCodePP(WORDFV_PpP0, pp, p0);
addWordFeature(code, fv);
code = createWordCodePP(WORDFV_P0Pn, p0, pn);
addWordFeature(code, fv);
code = createWordCodePP(WORDFV_PpPn, pp, pn);
addWordFeature(code, fv);
code = createWordCodePPP(WORDFV_PpP0Pn, pp, p0, pn);
addWordFeature(code, fv);
code = createWordCodePP(WORDFV_PpP0, cp, c0);
addWordFeature(code, fv);
code = createWordCodePP(WORDFV_P0Pn, c0, cn);
addWordFeature(code, fv);
code = createWordCodePP(WORDFV_PpPn, cp, cn);
addWordFeature(code, fv);
code = createWordCodePPP(WORDFV_PpP0Pn, cp, c0, cn);
addWordFeature(code, fv);
code = createWordCodeWP(WORDFV_W0P0, w0, p0);
addWordFeature(code, fv);
code = createWordCodeWP(WORDFV_W0P0, w0, c0);
addWordFeature(code, fv);
if (l0 != 0) {
code = createWordCodeWP(WORDFV_W0P0, l0, p0);
addWordFeature(code, fv);
code = createWordCodeWP(WORDFV_W0P0, l0, c0);
addWordFeature(code, fv);
code = createWordCodeWP(WORDFV_W0Pp, l0, cp);
addWordFeature(code, fv);
code = createWordCodeWP(WORDFV_W0Pn, l0, cn);
addWordFeature(code, fv);
code = createWordCodeWP(WORDFV_WpPp, lp, cp);
addWordFeature(code, fv);
code = createWordCodeWP(WORDFV_WnPn, ln, cn);
addWordFeature(code, fv);
}
int[][] feats = dependencyInstance.getFeatids();
if (feats[i] != null) {
for (int u = 0; u < feats[i].length; ++u) {
int f = feats[i][u];
code = createWordCodeP(WORDFV_P0, f);
addWordFeature(code, fv);
if (l0 != 0) {
code = createWordCodeWP(WORDFV_W0P0, l0, f);
addWordFeature(code, fv);
}
}
}
return fv;
} }
|
public class class_name {
public FeatureVector createWordFeatures(DependencyInstance dependencyInstance, int i) {
int[] pos = dependencyInstance.getPostagids();
int[] posA = dependencyInstance.getCpostagids();
int[] toks = dependencyInstance.getFormids();
int[] lemma = dependencyInstance.getLemmaids();
int p0 = pos[i];
int pp = i > 0 ? pos[i - 1] : this.tokenStart;
int pn = i < pos.length - 1 ? pos[i + 1] : this.tokenEnd;
int c0 = posA[i];
int cp = i > 0 ? posA[i - 1] : this.tokenStart;
int cn = i < posA.length - 1 ? posA[i + 1] : this.tokenEnd;
int w0 = toks[i];
int wp = i == 0 ? this.tokenStart : toks[i - 1];
int wn = i == dependencyInstance.getLength() - 1 ? this.tokenEnd : toks[i + 1];
int l0 = 0;
int lp = 0;
int ln = 0;
if (lemma != null) {
l0 = lemma[i]; // depends on control dependency: [if], data = [none]
lp = i == 0 ? this.tokenStart : lemma[i - 1]; // depends on control dependency: [if], data = [none]
ln = i == dependencyInstance.getLength() - 1 ? this.tokenEnd : lemma[i + 1]; // depends on control dependency: [if], data = [none]
}
FeatureVector fv = new FeatureVector();
long code;
code = createWordCodeP(WORDFV_BIAS, 0);
addWordFeature(code, fv);
code = createWordCodeW(WORDFV_W0, w0);
addWordFeature(code, fv);
code = createWordCodeW(WORDFV_Wp, wp);
addWordFeature(code, fv);
code = createWordCodeW(WORDFV_Wn, wn);
addWordFeature(code, fv);
if (l0 != 0) {
code = createWordCodeW(WORDFV_W0, l0); // depends on control dependency: [if], data = [0)]
addWordFeature(code, fv); // depends on control dependency: [if], data = [none]
code = createWordCodeW(WORDFV_Wp, lp); // depends on control dependency: [if], data = [none]
addWordFeature(code, fv); // depends on control dependency: [if], data = [none]
code = createWordCodeW(WORDFV_Wn, ln); // depends on control dependency: [if], data = [none]
addWordFeature(code, fv); // depends on control dependency: [if], data = [none]
}
code = createWordCodeP(WORDFV_P0, p0);
addWordFeature(code, fv);
code = createWordCodeP(WORDFV_Pp, pp);
addWordFeature(code, fv);
code = createWordCodeP(WORDFV_Pn, pn);
addWordFeature(code, fv);
code = createWordCodeP(WORDFV_P0, c0);
addWordFeature(code, fv);
code = createWordCodeP(WORDFV_Pp, cp);
addWordFeature(code, fv);
code = createWordCodeP(WORDFV_Pn, cn);
addWordFeature(code, fv);
code = createWordCodePP(WORDFV_PpP0, pp, p0);
addWordFeature(code, fv);
code = createWordCodePP(WORDFV_P0Pn, p0, pn);
addWordFeature(code, fv);
code = createWordCodePP(WORDFV_PpPn, pp, pn);
addWordFeature(code, fv);
code = createWordCodePPP(WORDFV_PpP0Pn, pp, p0, pn);
addWordFeature(code, fv);
code = createWordCodePP(WORDFV_PpP0, cp, c0);
addWordFeature(code, fv);
code = createWordCodePP(WORDFV_P0Pn, c0, cn);
addWordFeature(code, fv);
code = createWordCodePP(WORDFV_PpPn, cp, cn);
addWordFeature(code, fv);
code = createWordCodePPP(WORDFV_PpP0Pn, cp, c0, cn);
addWordFeature(code, fv);
code = createWordCodeWP(WORDFV_W0P0, w0, p0);
addWordFeature(code, fv);
code = createWordCodeWP(WORDFV_W0P0, w0, c0);
addWordFeature(code, fv);
if (l0 != 0) {
code = createWordCodeWP(WORDFV_W0P0, l0, p0); // depends on control dependency: [if], data = [0)]
addWordFeature(code, fv); // depends on control dependency: [if], data = [none]
code = createWordCodeWP(WORDFV_W0P0, l0, c0); // depends on control dependency: [if], data = [0)]
addWordFeature(code, fv); // depends on control dependency: [if], data = [none]
code = createWordCodeWP(WORDFV_W0Pp, l0, cp); // depends on control dependency: [if], data = [none]
addWordFeature(code, fv); // depends on control dependency: [if], data = [none]
code = createWordCodeWP(WORDFV_W0Pn, l0, cn); // depends on control dependency: [if], data = [none]
addWordFeature(code, fv); // depends on control dependency: [if], data = [none]
code = createWordCodeWP(WORDFV_WpPp, lp, cp); // depends on control dependency: [if], data = [none]
addWordFeature(code, fv); // depends on control dependency: [if], data = [none]
code = createWordCodeWP(WORDFV_WnPn, ln, cn); // depends on control dependency: [if], data = [none]
addWordFeature(code, fv); // depends on control dependency: [if], data = [none]
}
int[][] feats = dependencyInstance.getFeatids();
if (feats[i] != null) {
for (int u = 0; u < feats[i].length; ++u) {
int f = feats[i][u];
code = createWordCodeP(WORDFV_P0, f); // depends on control dependency: [for], data = [none]
addWordFeature(code, fv); // depends on control dependency: [for], data = [none]
if (l0 != 0) {
code = createWordCodeWP(WORDFV_W0P0, l0, f); // depends on control dependency: [if], data = [none]
addWordFeature(code, fv); // depends on control dependency: [if], data = [none]
}
}
}
return fv;
} }
|
public class class_name {
public final void clear()
{
for (int i = 0; i < fields.length; ) {
stamp[i] = fields[i] = 0; // UNSET == 0
isSet[i++] = false;
}
areAllFieldsSet = areFieldsSet = false;
isTimeSet = false;
} }
|
public class class_name {
public final void clear()
{
for (int i = 0; i < fields.length; ) {
stamp[i] = fields[i] = 0; // UNSET == 0 // depends on control dependency: [for], data = [i]
isSet[i++] = false; // depends on control dependency: [for], data = [i]
}
areAllFieldsSet = areFieldsSet = false;
isTimeSet = false;
} }
|
public class class_name {
JsTopicMessageController getJsTopicMessageControllerFromJsTopicControls(String topic) {
logger.debug("Looking for messageController for topic '{}' from JsTopicControls annotation", topic);
Instance<JsTopicMessageController<?>> select = topicMessageController.select(new JsTopicCtrlsAnnotationLiteral());
if(select.isUnsatisfied()) {
return null;
}
return getJsTopicMessageControllerFromIterable(topic, select);
} }
|
public class class_name {
JsTopicMessageController getJsTopicMessageControllerFromJsTopicControls(String topic) {
logger.debug("Looking for messageController for topic '{}' from JsTopicControls annotation", topic);
Instance<JsTopicMessageController<?>> select = topicMessageController.select(new JsTopicCtrlsAnnotationLiteral());
if(select.isUnsatisfied()) {
return null; // depends on control dependency: [if], data = [none]
}
return getJsTopicMessageControllerFromIterable(topic, select);
} }
|
public class class_name {
public void marshall(ListChildrenRequest listChildrenRequest, ProtocolMarshaller protocolMarshaller) {
if (listChildrenRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listChildrenRequest.getParentId(), PARENTID_BINDING);
protocolMarshaller.marshall(listChildrenRequest.getChildType(), CHILDTYPE_BINDING);
protocolMarshaller.marshall(listChildrenRequest.getNextToken(), NEXTTOKEN_BINDING);
protocolMarshaller.marshall(listChildrenRequest.getMaxResults(), MAXRESULTS_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(ListChildrenRequest listChildrenRequest, ProtocolMarshaller protocolMarshaller) {
if (listChildrenRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listChildrenRequest.getParentId(), PARENTID_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(listChildrenRequest.getChildType(), CHILDTYPE_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(listChildrenRequest.getNextToken(), NEXTTOKEN_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(listChildrenRequest.getMaxResults(), MAXRESULTS_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
private static Object valueOf(final String value, final Class<?> objectType) {
if (objectType == Character.class) {
return value.charAt(0);
}
try {
final Constructor<?> constructor = objectType.getConstructor(String.class);
return constructor.newInstance(value);
} catch (InstantiationException | InvocationTargetException | NoSuchMethodException | IllegalAccessException e) {
//this should never happen
throw new RuntimeException( //NOSONAR
"Could not create instance of type "
+ objectType.getName()
+ " from value "
+ value, e);
}
} }
|
public class class_name {
private static Object valueOf(final String value, final Class<?> objectType) {
if (objectType == Character.class) {
return value.charAt(0); // depends on control dependency: [if], data = [none]
}
try {
final Constructor<?> constructor = objectType.getConstructor(String.class);
return constructor.newInstance(value); // depends on control dependency: [try], data = [none]
} catch (InstantiationException | InvocationTargetException | NoSuchMethodException | IllegalAccessException e) {
//this should never happen
throw new RuntimeException( //NOSONAR
"Could not create instance of type "
+ objectType.getName()
+ " from value "
+ value, e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
@Override
public boolean isOptional()
{
boolean isNullable = true;
if (!isId())
{
Column anno = member.getAnnotation(Column.class);
if (anno != null)
{
isNullable = anno.nullable();
}
}
else
{
isNullable = false;
}
return isNullable;
} }
|
public class class_name {
@Override
public boolean isOptional()
{
boolean isNullable = true;
if (!isId())
{
Column anno = member.getAnnotation(Column.class);
if (anno != null)
{
isNullable = anno.nullable(); // depends on control dependency: [if], data = [none]
}
}
else
{
isNullable = false; // depends on control dependency: [if], data = [none]
}
return isNullable;
} }
|
public class class_name {
public void marshall(AvailBlanking availBlanking, ProtocolMarshaller protocolMarshaller) {
if (availBlanking == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(availBlanking.getAvailBlankingImage(), AVAILBLANKINGIMAGE_BINDING);
protocolMarshaller.marshall(availBlanking.getState(), STATE_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(AvailBlanking availBlanking, ProtocolMarshaller protocolMarshaller) {
if (availBlanking == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(availBlanking.getAvailBlankingImage(), AVAILBLANKINGIMAGE_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(availBlanking.getState(), STATE_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
protected boolean _load ()
{
java.sql.ResultSet rs = null;
try
{
// This synchronization is necessary for Oracle JDBC drivers 8.1.7, 9.0.1, 9.2.0.1
// The documentation says synchronization is done within the driver, but they
// must have overlooked something. Without the lock we'd get mysterious error
// messages.
synchronized(getDbMeta())
{
getDbMetaTreeModel().setStatusBarMessage("Reading schemas for catalog "
+ this.getAttribute(ATT_CATALOG_NAME));
rs = getDbMeta().getSchemas();
final java.util.ArrayList alNew = new java.util.ArrayList();
int count = 0;
while (rs.next())
{
getDbMetaTreeModel().setStatusBarMessage("Creating schema " + getCatalogName() + "." + rs.getString("TABLE_SCHEM"));
alNew.add(new DBMetaSchemaNode(getDbMeta(),
getDbMetaTreeModel(),
DBMetaCatalogNode.this,
rs.getString("TABLE_SCHEM")));
count++;
}
if (count == 0)
alNew.add(new DBMetaSchemaNode(getDbMeta(),
getDbMetaTreeModel(),
DBMetaCatalogNode.this, null));
alChildren = alNew;
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
getDbMetaTreeModel().nodeStructureChanged(DBMetaCatalogNode.this);
}
});
rs.close();
}
}
catch (java.sql.SQLException sqlEx)
{
getDbMetaTreeModel().reportSqlError("Error retrieving schemas", sqlEx);
try
{
if (rs != null) rs.close ();
}
catch (java.sql.SQLException sqlEx2)
{
this.getDbMetaTreeModel().reportSqlError("Error retrieving schemas", sqlEx2);
}
return false;
}
return true;
} }
|
public class class_name {
protected boolean _load ()
{
java.sql.ResultSet rs = null;
try
{
// This synchronization is necessary for Oracle JDBC drivers 8.1.7, 9.0.1, 9.2.0.1
// The documentation says synchronization is done within the driver, but they
// must have overlooked something. Without the lock we'd get mysterious error
// messages.
synchronized(getDbMeta())
// depends on control dependency: [try], data = [none]
{
getDbMetaTreeModel().setStatusBarMessage("Reading schemas for catalog "
+ this.getAttribute(ATT_CATALOG_NAME));
rs = getDbMeta().getSchemas();
final java.util.ArrayList alNew = new java.util.ArrayList();
int count = 0;
while (rs.next())
{
getDbMetaTreeModel().setStatusBarMessage("Creating schema " + getCatalogName() + "." + rs.getString("TABLE_SCHEM"));
// depends on control dependency: [while], data = [none]
alNew.add(new DBMetaSchemaNode(getDbMeta(),
getDbMetaTreeModel(),
DBMetaCatalogNode.this,
rs.getString("TABLE_SCHEM")));
// depends on control dependency: [while], data = [none]
count++;
// depends on control dependency: [while], data = [none]
}
if (count == 0)
alNew.add(new DBMetaSchemaNode(getDbMeta(),
getDbMetaTreeModel(),
DBMetaCatalogNode.this, null));
alChildren = alNew;
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
getDbMetaTreeModel().nodeStructureChanged(DBMetaCatalogNode.this);
}
});
rs.close();
}
}
catch (java.sql.SQLException sqlEx)
{
getDbMetaTreeModel().reportSqlError("Error retrieving schemas", sqlEx);
try
{
if (rs != null) rs.close ();
}
catch (java.sql.SQLException sqlEx2)
{
this.getDbMetaTreeModel().reportSqlError("Error retrieving schemas", sqlEx2);
}
// depends on control dependency: [catch], data = [none]
return false;
}
// depends on control dependency: [catch], data = [none]
return true;
} }
|
public class class_name {
public void setFilters(java.util.Collection<ExportFilter> filters) {
if (filters == null) {
this.filters = null;
return;
}
this.filters = new java.util.ArrayList<ExportFilter>(filters);
} }
|
public class class_name {
public void setFilters(java.util.Collection<ExportFilter> filters) {
if (filters == null) {
this.filters = null; // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
this.filters = new java.util.ArrayList<ExportFilter>(filters);
} }
|
public class class_name {
@Nonnull
public static IBANCountryData createFromString (@Nonnull @Nonempty final String sCountryCode,
@Nonnegative final int nExpectedLength,
@Nullable final String sLayout,
@Nullable final String sFixedCheckDigits,
@Nullable final LocalDate aValidFrom,
@Nullable final LocalDate aValidTo,
@Nonnull final String sDesc)
{
ValueEnforcer.notEmpty (sDesc, "Desc");
if (sDesc.length () < 4)
throw new IllegalArgumentException ("Cannot converted passed string because it is too short!");
final ICommonsList <IBANElement> aList = _parseElements (sDesc);
final Pattern aPattern = _parseLayout (sCountryCode, nExpectedLength, sFixedCheckDigits, sLayout);
// And we're done
try
{
return new IBANCountryData (nExpectedLength, aPattern, sFixedCheckDigits, aValidFrom, aValidTo, aList);
}
catch (final IllegalArgumentException ex)
{
throw new IllegalArgumentException ("Failed to parse '" + sDesc + "': " + ex.getMessage ());
}
} }
|
public class class_name {
@Nonnull
public static IBANCountryData createFromString (@Nonnull @Nonempty final String sCountryCode,
@Nonnegative final int nExpectedLength,
@Nullable final String sLayout,
@Nullable final String sFixedCheckDigits,
@Nullable final LocalDate aValidFrom,
@Nullable final LocalDate aValidTo,
@Nonnull final String sDesc)
{
ValueEnforcer.notEmpty (sDesc, "Desc");
if (sDesc.length () < 4)
throw new IllegalArgumentException ("Cannot converted passed string because it is too short!");
final ICommonsList <IBANElement> aList = _parseElements (sDesc);
final Pattern aPattern = _parseLayout (sCountryCode, nExpectedLength, sFixedCheckDigits, sLayout);
// And we're done
try
{
return new IBANCountryData (nExpectedLength, aPattern, sFixedCheckDigits, aValidFrom, aValidTo, aList); // depends on control dependency: [try], data = [none]
}
catch (final IllegalArgumentException ex)
{
throw new IllegalArgumentException ("Failed to parse '" + sDesc + "': " + ex.getMessage ());
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
private String getOptionsForLanguage(Locale setLocale) {
// get available locales from the workplace manager
List<Locale> locales = OpenCms.getWorkplaceManager().getLocales();
StringBuffer resultBuffer = new StringBuffer();
int counter = 0;
Iterator<Locale> i = locales.iterator();
while (i.hasNext()) {
Locale currentLocale = i.next();
// add all locales to the select box
String language = currentLocale.getDisplayLanguage(setLocale);
if (CmsStringUtil.isNotEmpty(currentLocale.getCountry())) {
language = language + " (" + currentLocale.getDisplayCountry(setLocale) + ")";
}
if (CmsStringUtil.isNotEmpty(currentLocale.getVariant())) {
language = language + " (" + currentLocale.getDisplayVariant(setLocale) + ")";
}
if (counter != 0) {
resultBuffer.append("|");
}
resultBuffer.append(currentLocale.toString()).append(":").append(language);
counter++;
}
return resultBuffer.toString();
} }
|
public class class_name {
private String getOptionsForLanguage(Locale setLocale) {
// get available locales from the workplace manager
List<Locale> locales = OpenCms.getWorkplaceManager().getLocales();
StringBuffer resultBuffer = new StringBuffer();
int counter = 0;
Iterator<Locale> i = locales.iterator();
while (i.hasNext()) {
Locale currentLocale = i.next();
// add all locales to the select box
String language = currentLocale.getDisplayLanguage(setLocale);
if (CmsStringUtil.isNotEmpty(currentLocale.getCountry())) {
language = language + " (" + currentLocale.getDisplayCountry(setLocale) + ")"; // depends on control dependency: [if], data = [none]
}
if (CmsStringUtil.isNotEmpty(currentLocale.getVariant())) {
language = language + " (" + currentLocale.getDisplayVariant(setLocale) + ")"; // depends on control dependency: [if], data = [none]
}
if (counter != 0) {
resultBuffer.append("|"); // depends on control dependency: [if], data = [none]
}
resultBuffer.append(currentLocale.toString()).append(":").append(language); // depends on control dependency: [while], data = [none]
counter++; // depends on control dependency: [while], data = [none]
}
return resultBuffer.toString();
} }
|
public class class_name {
public Object getAttribute(final String name) {
assertActive();
if (attributes.containsKey(name)) {
return attributes.get(name);
}
Object value = originalSession.getAttribute(name);
if (value instanceof SerializedObjectHolder) {
value = ((SerializedObjectHolder) value).getDeserializedObject();
if (value != null) {
attributes.put(name, value);
} else {
originalSession.removeAttribute(name);
}
}
return value;
} }
|
public class class_name {
public Object getAttribute(final String name) {
assertActive();
if (attributes.containsKey(name)) {
return attributes.get(name); // depends on control dependency: [if], data = [none]
}
Object value = originalSession.getAttribute(name);
if (value instanceof SerializedObjectHolder) {
value = ((SerializedObjectHolder) value).getDeserializedObject(); // depends on control dependency: [if], data = [none]
if (value != null) {
attributes.put(name, value); // depends on control dependency: [if], data = [none]
} else {
originalSession.removeAttribute(name); // depends on control dependency: [if], data = [none]
}
}
return value;
} }
|
public class class_name {
private static String getServiceUserCredential(String clazz, ITestContext context) {
if (System.getenv("SERVICES_USER") != null) {
return System.getenv("SERVICES_USER");
}
if (context.getAttribute(clazz + SERVICES_USER) != null) {
return (String) context.getAttribute(clazz + SERVICES_USER);
} else {
return "";
}
} }
|
public class class_name {
private static String getServiceUserCredential(String clazz, ITestContext context) {
if (System.getenv("SERVICES_USER") != null) {
return System.getenv("SERVICES_USER"); // depends on control dependency: [if], data = [none]
}
if (context.getAttribute(clazz + SERVICES_USER) != null) {
return (String) context.getAttribute(clazz + SERVICES_USER); // depends on control dependency: [if], data = [none]
} else {
return ""; // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public static String fileNameFromString( final String text )
{
String value = text.replace( ' ', '_' );
if ( value.length() < 48 )
{
return value;
}
return value.substring( 0, 47 );
} }
|
public class class_name {
public static String fileNameFromString( final String text )
{
String value = text.replace( ' ', '_' );
if ( value.length() < 48 )
{
return value; // depends on control dependency: [if], data = [none]
}
return value.substring( 0, 47 );
} }
|
public class class_name {
public CustomField getCustomField(FieldType field)
{
CustomField result = m_configMap.get(field);
if (result == null)
{
result = new CustomField(field, this);
m_configMap.put(field, result);
}
return result;
} }
|
public class class_name {
public CustomField getCustomField(FieldType field)
{
CustomField result = m_configMap.get(field);
if (result == null)
{
result = new CustomField(field, this); // depends on control dependency: [if], data = [none]
m_configMap.put(field, result); // depends on control dependency: [if], data = [none]
}
return result;
} }
|
public class class_name {
public static void closeAll(Logger log, java.io.Closeable... closeables) {
for (java.io.Closeable c : closeables) {
if (c != null) {
try {
if (log != null) {
log.debug("Closing {}", c);
}
c.close();
} catch (Exception e) {
if (log != null && log.isDebugEnabled()) {
log.debug("Exception in closing {}", c, e);
}
}
}
}
} }
|
public class class_name {
public static void closeAll(Logger log, java.io.Closeable... closeables) {
for (java.io.Closeable c : closeables) {
if (c != null) {
try {
if (log != null) {
log.debug("Closing {}", c); // depends on control dependency: [if], data = [none]
}
c.close(); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
if (log != null && log.isDebugEnabled()) {
log.debug("Exception in closing {}", c, e); // depends on control dependency: [if], data = [none]
}
} // depends on control dependency: [catch], data = [none]
}
}
} }
|
public class class_name {
private void convertYieldOfAsyncGenerator(NodeTraversal t, LexicalContext ctx, Node yieldNode) {
checkNotNull(yieldNode);
checkState(yieldNode.isYield());
checkState(ctx != null && ctx.function != null);
checkState(ctx.function.isAsyncGeneratorFunction());
Node expression = yieldNode.removeFirstChild();
Node newActionRecord =
astFactory.createNewNode(astFactory.createQName(t.getScope(), ACTION_RECORD_NAME));
if (yieldNode.isYieldAll()) {
checkNotNull(expression);
// yield* expression becomes new ActionRecord(YIELD_STAR, expression)
newActionRecord.addChildToBack(astFactory.createQName(t.getScope(), ACTION_ENUM_YIELD_STAR));
newActionRecord.addChildToBack(expression);
} else {
if (expression == null) {
expression = NodeUtil.newUndefinedNode(null);
}
// yield expression becomes new ActionRecord(YIELD, expression)
newActionRecord.addChildToBack(astFactory.createQName(t.getScope(), ACTION_ENUM_YIELD));
newActionRecord.addChildToBack(expression);
}
newActionRecord.useSourceInfoIfMissingFromForTree(yieldNode);
yieldNode.addChildToFront(newActionRecord);
yieldNode.removeProp(Node.YIELD_ALL);
} }
|
public class class_name {
private void convertYieldOfAsyncGenerator(NodeTraversal t, LexicalContext ctx, Node yieldNode) {
checkNotNull(yieldNode);
checkState(yieldNode.isYield());
checkState(ctx != null && ctx.function != null);
checkState(ctx.function.isAsyncGeneratorFunction());
Node expression = yieldNode.removeFirstChild();
Node newActionRecord =
astFactory.createNewNode(astFactory.createQName(t.getScope(), ACTION_RECORD_NAME));
if (yieldNode.isYieldAll()) {
checkNotNull(expression); // depends on control dependency: [if], data = [none]
// yield* expression becomes new ActionRecord(YIELD_STAR, expression)
newActionRecord.addChildToBack(astFactory.createQName(t.getScope(), ACTION_ENUM_YIELD_STAR)); // depends on control dependency: [if], data = [none]
newActionRecord.addChildToBack(expression); // depends on control dependency: [if], data = [none]
} else {
if (expression == null) {
expression = NodeUtil.newUndefinedNode(null); // depends on control dependency: [if], data = [null)]
}
// yield expression becomes new ActionRecord(YIELD, expression)
newActionRecord.addChildToBack(astFactory.createQName(t.getScope(), ACTION_ENUM_YIELD)); // depends on control dependency: [if], data = [none]
newActionRecord.addChildToBack(expression); // depends on control dependency: [if], data = [none]
}
newActionRecord.useSourceInfoIfMissingFromForTree(yieldNode);
yieldNode.addChildToFront(newActionRecord);
yieldNode.removeProp(Node.YIELD_ALL);
} }
|
public class class_name {
private StringBuffer loadScriptTemplate(String path) {
StringWriter sw = new StringWriter();
InputStream is = null;
try {
is = ClassLoaderResourceUtils.getResourceAsStream(path, this);
int i;
while ((i = is.read()) != -1) {
sw.write(i);
}
} catch (IOException e) {
Marker fatal = MarkerFactory.getMarker("FATAL");
LOGGER.error(fatal, "a serious error occurred when initializing ClientSideHandlerGeneratorImpl");
throw new BundlingProcessException("Classloading issues prevent loading the loader template to be loaded. ",
e);
} finally {
IOUtils.close(is);
}
return sw.getBuffer();
} }
|
public class class_name {
private StringBuffer loadScriptTemplate(String path) {
StringWriter sw = new StringWriter();
InputStream is = null;
try {
is = ClassLoaderResourceUtils.getResourceAsStream(path, this); // depends on control dependency: [try], data = [none]
int i;
while ((i = is.read()) != -1) {
sw.write(i); // depends on control dependency: [while], data = [none]
}
} catch (IOException e) {
Marker fatal = MarkerFactory.getMarker("FATAL");
LOGGER.error(fatal, "a serious error occurred when initializing ClientSideHandlerGeneratorImpl");
throw new BundlingProcessException("Classloading issues prevent loading the loader template to be loaded. ",
e);
} finally { // depends on control dependency: [catch], data = [none]
IOUtils.close(is);
}
return sw.getBuffer();
} }
|
public class class_name {
public void onCommandException(CommandResponse response) {
String message = I18nProvider.getGlobal().commandError() + ":";
for (String error : response.getErrorMessages()) {
message += "\n" + error;
}
Log.logWarn(message);
if (response.getExceptions() == null || response.getExceptions().size() == 0) {
SC.warn(message);
} else {
// The error messaging window only supports 1 exception to display:
ExceptionWindow window = new ExceptionWindow(response.getExceptions().get(0));
window.show();
}
} }
|
public class class_name {
public void onCommandException(CommandResponse response) {
String message = I18nProvider.getGlobal().commandError() + ":";
for (String error : response.getErrorMessages()) {
message += "\n" + error; // depends on control dependency: [for], data = [error]
}
Log.logWarn(message);
if (response.getExceptions() == null || response.getExceptions().size() == 0) {
SC.warn(message); // depends on control dependency: [if], data = [none]
} else {
// The error messaging window only supports 1 exception to display:
ExceptionWindow window = new ExceptionWindow(response.getExceptions().get(0));
window.show(); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public static void initFileSendHeader(HttpServletResponse res, String filename, String contentType) {
filename = getEncodingFileName(filename);
if (contentType != null) {
res.setContentType(contentType);
} else {
res.setContentType("applicaiton/download;charset=utf-8");
}
res.setHeader("Content-Disposition", "attachment; filename=\"" + filename + "\";");
res.setHeader("Content-Transfer-Encoding", "binary");
res.setHeader("file-name", filename);
} }
|
public class class_name {
public static void initFileSendHeader(HttpServletResponse res, String filename, String contentType) {
filename = getEncodingFileName(filename);
if (contentType != null) {
res.setContentType(contentType); // depends on control dependency: [if], data = [(contentType]
} else {
res.setContentType("applicaiton/download;charset=utf-8"); // depends on control dependency: [if], data = [none]
}
res.setHeader("Content-Disposition", "attachment; filename=\"" + filename + "\";");
res.setHeader("Content-Transfer-Encoding", "binary");
res.setHeader("file-name", filename);
} }
|
public class class_name {
public final boolean synpred37_DRL5Expressions() {
state.backtracking++;
int start = input.mark();
try {
synpred37_DRL5Expressions_fragment(); // can never throw exception
} catch (RecognitionException re) {
System.err.println("impossible: "+re);
}
boolean success = !state.failed;
input.rewind(start);
state.backtracking--;
state.failed=false;
return success;
} }
|
public class class_name {
public final boolean synpred37_DRL5Expressions() {
state.backtracking++;
int start = input.mark();
try {
synpred37_DRL5Expressions_fragment(); // can never throw exception // depends on control dependency: [try], data = [none]
} catch (RecognitionException re) {
System.err.println("impossible: "+re);
} // depends on control dependency: [catch], data = [none]
boolean success = !state.failed;
input.rewind(start);
state.backtracking--;
state.failed=false;
return success;
} }
|
public class class_name {
private static CharSequence convertReverseDNSIPv4(String str, int suffixStartIndex) throws AddressStringException {
StringBuilder builder = new StringBuilder(suffixStartIndex);
int segCount = 0;
int j = suffixStartIndex;
for(int i = suffixStartIndex - 1; i > 0; i--) {
char c1 = str.charAt(i);
if(c1 == IPv4Address.SEGMENT_SEPARATOR) {
if(j - i <= 1) {
throw new AddressStringException(str, i);
}
for(int k = i + 1; k < j; k++) {
builder.append(str.charAt(k));
}
builder.append(c1);
j = i;
segCount++;
}
}
for(int k = 0; k < j; k++) {
builder.append(str.charAt(k));
}
if(segCount + 1 != IPv4Address.SEGMENT_COUNT) {
throw new AddressStringException(str, 0);
}
return builder;
} }
|
public class class_name {
private static CharSequence convertReverseDNSIPv4(String str, int suffixStartIndex) throws AddressStringException {
StringBuilder builder = new StringBuilder(suffixStartIndex);
int segCount = 0;
int j = suffixStartIndex;
for(int i = suffixStartIndex - 1; i > 0; i--) {
char c1 = str.charAt(i);
if(c1 == IPv4Address.SEGMENT_SEPARATOR) {
if(j - i <= 1) {
throw new AddressStringException(str, i);
}
for(int k = i + 1; k < j; k++) {
builder.append(str.charAt(k)); // depends on control dependency: [for], data = [k]
}
builder.append(c1); // depends on control dependency: [if], data = [(c1]
j = i; // depends on control dependency: [if], data = [none]
segCount++; // depends on control dependency: [if], data = [none]
}
}
for(int k = 0; k < j; k++) {
builder.append(str.charAt(k));
}
if(segCount + 1 != IPv4Address.SEGMENT_COUNT) {
throw new AddressStringException(str, 0);
}
return builder;
} }
|
public class class_name {
public DBCluster withDBClusterOptionGroupMemberships(DBClusterOptionGroupStatus... dBClusterOptionGroupMemberships) {
if (this.dBClusterOptionGroupMemberships == null) {
setDBClusterOptionGroupMemberships(new java.util.ArrayList<DBClusterOptionGroupStatus>(dBClusterOptionGroupMemberships.length));
}
for (DBClusterOptionGroupStatus ele : dBClusterOptionGroupMemberships) {
this.dBClusterOptionGroupMemberships.add(ele);
}
return this;
} }
|
public class class_name {
public DBCluster withDBClusterOptionGroupMemberships(DBClusterOptionGroupStatus... dBClusterOptionGroupMemberships) {
if (this.dBClusterOptionGroupMemberships == null) {
setDBClusterOptionGroupMemberships(new java.util.ArrayList<DBClusterOptionGroupStatus>(dBClusterOptionGroupMemberships.length)); // depends on control dependency: [if], data = [none]
}
for (DBClusterOptionGroupStatus ele : dBClusterOptionGroupMemberships) {
this.dBClusterOptionGroupMemberships.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} }
|
public class class_name {
public EClass getIfcMagneticFluxMeasure() {
if (ifcMagneticFluxMeasureEClass == null) {
ifcMagneticFluxMeasureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(704);
}
return ifcMagneticFluxMeasureEClass;
} }
|
public class class_name {
public EClass getIfcMagneticFluxMeasure() {
if (ifcMagneticFluxMeasureEClass == null) {
ifcMagneticFluxMeasureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(704);
// depends on control dependency: [if], data = [none]
}
return ifcMagneticFluxMeasureEClass;
} }
|
public class class_name {
public static Iterable<MetadataTemplate> getEnterpriseMetadataTemplates(
String scope, int limit, BoxAPIConnection api, String ... fields) {
QueryStringBuilder builder = new QueryStringBuilder();
if (fields.length > 0) {
builder.appendParam("fields", fields);
}
return new BoxResourceIterable<MetadataTemplate>(
api, ENTERPRISE_METADATA_URL_TEMPLATE.buildWithQuery(
api.getBaseURL(), builder.toString(), scope), limit) {
@Override
protected MetadataTemplate factory(JsonObject jsonObject) {
return new MetadataTemplate(jsonObject);
}
};
} }
|
public class class_name {
public static Iterable<MetadataTemplate> getEnterpriseMetadataTemplates(
String scope, int limit, BoxAPIConnection api, String ... fields) {
QueryStringBuilder builder = new QueryStringBuilder();
if (fields.length > 0) {
builder.appendParam("fields", fields); // depends on control dependency: [if], data = [none]
}
return new BoxResourceIterable<MetadataTemplate>(
api, ENTERPRISE_METADATA_URL_TEMPLATE.buildWithQuery(
api.getBaseURL(), builder.toString(), scope), limit) {
@Override
protected MetadataTemplate factory(JsonObject jsonObject) {
return new MetadataTemplate(jsonObject);
}
};
} }
|
public class class_name {
public CmsXmlContentValueSequence getValueSequence(String xpath, Locale locale) {
I_CmsXmlSchemaType type = m_contentDefinition.getSchemaType(xpath);
if (type == null) {
return null;
}
return new CmsXmlContentValueSequence(xpath, locale, this);
} }
|
public class class_name {
public CmsXmlContentValueSequence getValueSequence(String xpath, Locale locale) {
I_CmsXmlSchemaType type = m_contentDefinition.getSchemaType(xpath);
if (type == null) {
return null; // depends on control dependency: [if], data = [none]
}
return new CmsXmlContentValueSequence(xpath, locale, this);
} }
|
public class class_name {
public AbstractExpression replaceAVG () {
if (getExpressionType() == ExpressionType.AGGREGATE_AVG) {
AbstractExpression child = getLeft();
AbstractExpression left =
new AggregateExpression(ExpressionType.AGGREGATE_SUM);
left.setLeft(child.clone());
AbstractExpression right =
new AggregateExpression(ExpressionType.AGGREGATE_COUNT);
right.setLeft(child.clone());
return new OperatorExpression(ExpressionType.OPERATOR_DIVIDE,
left, right);
}
AbstractExpression lnode = null;
AbstractExpression rnode = null;
if (m_left != null) {
lnode = m_left.replaceAVG();
}
if (m_right != null) {
rnode = m_right.replaceAVG();
}
ArrayList<AbstractExpression> newArgs = null;
boolean changed = false;
if (m_args != null) {
newArgs = new ArrayList<>();
for (AbstractExpression expr: m_args) {
AbstractExpression ex = expr.replaceAVG();
newArgs.add(ex);
if (ex != expr) {
changed = true;
}
}
}
if (m_left != lnode || m_right != rnode || changed) {
AbstractExpression resExpr = clone();
resExpr.setLeft(lnode);
resExpr.setRight(rnode);
resExpr.setArgs(newArgs);
return resExpr;
}
return this;
} }
|
public class class_name {
public AbstractExpression replaceAVG () {
if (getExpressionType() == ExpressionType.AGGREGATE_AVG) {
AbstractExpression child = getLeft();
AbstractExpression left =
new AggregateExpression(ExpressionType.AGGREGATE_SUM);
left.setLeft(child.clone()); // depends on control dependency: [if], data = [none]
AbstractExpression right =
new AggregateExpression(ExpressionType.AGGREGATE_COUNT);
right.setLeft(child.clone()); // depends on control dependency: [if], data = [none]
return new OperatorExpression(ExpressionType.OPERATOR_DIVIDE,
left, right); // depends on control dependency: [if], data = [none]
}
AbstractExpression lnode = null;
AbstractExpression rnode = null;
if (m_left != null) {
lnode = m_left.replaceAVG(); // depends on control dependency: [if], data = [none]
}
if (m_right != null) {
rnode = m_right.replaceAVG(); // depends on control dependency: [if], data = [none]
}
ArrayList<AbstractExpression> newArgs = null;
boolean changed = false;
if (m_args != null) {
newArgs = new ArrayList<>(); // depends on control dependency: [if], data = [none]
for (AbstractExpression expr: m_args) {
AbstractExpression ex = expr.replaceAVG();
newArgs.add(ex); // depends on control dependency: [for], data = [none]
if (ex != expr) {
changed = true; // depends on control dependency: [if], data = [none]
}
}
}
if (m_left != lnode || m_right != rnode || changed) {
AbstractExpression resExpr = clone();
resExpr.setLeft(lnode); // depends on control dependency: [if], data = [none]
resExpr.setRight(rnode); // depends on control dependency: [if], data = [none]
resExpr.setArgs(newArgs); // depends on control dependency: [if], data = [none]
return resExpr; // depends on control dependency: [if], data = [none]
}
return this;
} }
|
public class class_name {
public static int indexOfIgnoreCase(CharSequence[] array, CharSequence value) {
if (null != array) {
for (int i = 0; i < array.length; i++) {
if (StrUtil.equalsIgnoreCase(array[i], value)) {
return i;
}
}
}
return INDEX_NOT_FOUND;
} }
|
public class class_name {
public static int indexOfIgnoreCase(CharSequence[] array, CharSequence value) {
if (null != array) {
for (int i = 0; i < array.length; i++) {
if (StrUtil.equalsIgnoreCase(array[i], value)) {
return i;
// depends on control dependency: [if], data = [none]
}
}
}
return INDEX_NOT_FOUND;
} }
|
public class class_name {
public DataNode getDataNode(final String dataSourceName, final String logicTableName) {
TableRule tableRule = getTableRule(logicTableName);
for (DataNode each : tableRule.getActualDataNodes()) {
if (shardingDataSourceNames.getDataSourceNames().contains(each.getDataSourceName()) && each.getDataSourceName().equals(dataSourceName)) {
return each;
}
}
throw new ShardingConfigurationException("Cannot find actual data node for data source name: '%s' and logic table name: '%s'", dataSourceName, logicTableName);
} }
|
public class class_name {
public DataNode getDataNode(final String dataSourceName, final String logicTableName) {
TableRule tableRule = getTableRule(logicTableName);
for (DataNode each : tableRule.getActualDataNodes()) {
if (shardingDataSourceNames.getDataSourceNames().contains(each.getDataSourceName()) && each.getDataSourceName().equals(dataSourceName)) {
return each; // depends on control dependency: [if], data = [none]
}
}
throw new ShardingConfigurationException("Cannot find actual data node for data source name: '%s' and logic table name: '%s'", dataSourceName, logicTableName);
} }
|
public class class_name {
public OmemoDevice getOwnDevice() {
synchronized (LOCK) {
BareJid jid = getOwnJid();
if (jid == null) {
return null;
}
return new OmemoDevice(jid, getDeviceId());
}
} }
|
public class class_name {
public OmemoDevice getOwnDevice() {
synchronized (LOCK) {
BareJid jid = getOwnJid();
if (jid == null) {
return null; // depends on control dependency: [if], data = [none]
}
return new OmemoDevice(jid, getDeviceId());
}
} }
|
public class class_name {
static Node getCatchHandlerForBlock(Node block) {
if (block.isBlock()
&& block.getParent().isTry()
&& block.getParent().getFirstChild() == block) {
for (Node s = block.getNext(); s != null; s = s.getNext()) {
if (NodeUtil.hasCatchHandler(s)) {
return s.getFirstChild();
}
}
}
return null;
} }
|
public class class_name {
static Node getCatchHandlerForBlock(Node block) {
if (block.isBlock()
&& block.getParent().isTry()
&& block.getParent().getFirstChild() == block) {
for (Node s = block.getNext(); s != null; s = s.getNext()) {
if (NodeUtil.hasCatchHandler(s)) {
return s.getFirstChild(); // depends on control dependency: [if], data = [none]
}
}
}
return null;
} }
|
public class class_name {
public static boolean validSignature(Document document, Key publicKey) {
Node signatureNode = document.getElementsByTagNameNS(XMLSignature.XMLNS, "Signature").item(0);
KeySelector keySelector = KeySelector.singletonKeySelector(publicKey);
try {
String providerName =
System.getProperty("jsr105Provider", "org.jcp.xml.dsig.internal.dom.XMLDSigRI");
XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM",
(Provider) Class.forName(providerName).newInstance());
DOMValidateContext valContext = new DOMValidateContext(keySelector, signatureNode);
XMLSignature signature = fac.unmarshalXMLSignature(valContext);
return signature.validate(valContext);
} catch (Exception e) {
logger.warn("Error validating an XML signature.", e);
return false;
}
} }
|
public class class_name {
public static boolean validSignature(Document document, Key publicKey) {
Node signatureNode = document.getElementsByTagNameNS(XMLSignature.XMLNS, "Signature").item(0);
KeySelector keySelector = KeySelector.singletonKeySelector(publicKey);
try {
String providerName =
System.getProperty("jsr105Provider", "org.jcp.xml.dsig.internal.dom.XMLDSigRI");
XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM",
(Provider) Class.forName(providerName).newInstance());
DOMValidateContext valContext = new DOMValidateContext(keySelector, signatureNode);
XMLSignature signature = fac.unmarshalXMLSignature(valContext);
return signature.validate(valContext); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
logger.warn("Error validating an XML signature.", e);
return false;
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
@Override
public final T process(final Map<String, Object> pReqVars,
final T pEntity,
final IRequestData pRequestData) throws Exception {
if (pEntity.getClass() == PurchaseInvoiceServiceLine.class) {
pReqVars.put("PurchaseInvoicevendordeepLevel", 3);
} else if (pEntity.getClass() == SalesInvoiceServiceLine.class) {
pReqVars.put("SalesInvoicecustomerdeepLevel", 3);
}
Set<String> ndFlDc = new HashSet<String>();
ndFlDc.add("itsId");
ndFlDc.add("isForeigner");
ndFlDc.add("taxDestination");
pReqVars.put("DebtorCreditorneededFields", ndFlDc);
T invLn = this.prcEntityPbEditDelete
.process(pReqVars, pEntity, pRequestData);
pReqVars.remove("DebtorCreditorneededFields");
if (invLn.getClass() == PurchaseInvoiceServiceLine.class) {
pReqVars.remove("PurchaseInvoicevendordeepLevel");
} else if (invLn.getClass() == SalesInvoiceServiceLine.class) {
pReqVars.remove("SalesInvoicecustomerdeepLevel");
}
RoundingMode rounding = null;
String taxRounding = null;
if (invLn.getClass() == PurchaseInvoiceServiceLine.class) {
PurchaseInvoice inv = (PurchaseInvoice) invLn.getItsOwner();
if (inv.getVendor().getTaxDestination() != null) {
rounding = inv.getVendor().getTaxDestination().getSalTaxRoundMode();
}
} else if (invLn.getClass() == SalesInvoiceServiceLine.class) {
SalesInvoice inv = (SalesInvoice) invLn.getItsOwner();
if (inv.getCustomer().getTaxDestination() != null) {
rounding = inv.getCustomer().getTaxDestination().getSalTaxRoundMode();
}
}
if (rounding != null) {
if (rounding.equals(RoundingMode.HALF_UP)) {
taxRounding = "S";
} else if (rounding.equals(RoundingMode.HALF_DOWN)) {
taxRounding = "s";
} else if (rounding.equals(RoundingMode.UP)) {
taxRounding = "U";
} else if (rounding.equals(RoundingMode.DOWN)) {
taxRounding = "D";
} else if (rounding.equals(RoundingMode.HALF_EVEN)) {
taxRounding = "B";
} else if (rounding.equals(RoundingMode.CEILING)) {
taxRounding = "C";
} else if (rounding.equals(RoundingMode.FLOOR)) {
taxRounding = "F";
} else {
taxRounding = "S";
}
}
pRequestData.setAttribute("taxRounding", taxRounding);
return invLn;
} }
|
public class class_name {
@Override
public final T process(final Map<String, Object> pReqVars,
final T pEntity,
final IRequestData pRequestData) throws Exception {
if (pEntity.getClass() == PurchaseInvoiceServiceLine.class) {
pReqVars.put("PurchaseInvoicevendordeepLevel", 3);
} else if (pEntity.getClass() == SalesInvoiceServiceLine.class) {
pReqVars.put("SalesInvoicecustomerdeepLevel", 3);
}
Set<String> ndFlDc = new HashSet<String>();
ndFlDc.add("itsId");
ndFlDc.add("isForeigner");
ndFlDc.add("taxDestination");
pReqVars.put("DebtorCreditorneededFields", ndFlDc);
T invLn = this.prcEntityPbEditDelete
.process(pReqVars, pEntity, pRequestData);
pReqVars.remove("DebtorCreditorneededFields");
if (invLn.getClass() == PurchaseInvoiceServiceLine.class) {
pReqVars.remove("PurchaseInvoicevendordeepLevel");
} else if (invLn.getClass() == SalesInvoiceServiceLine.class) {
pReqVars.remove("SalesInvoicecustomerdeepLevel");
}
RoundingMode rounding = null;
String taxRounding = null;
if (invLn.getClass() == PurchaseInvoiceServiceLine.class) {
PurchaseInvoice inv = (PurchaseInvoice) invLn.getItsOwner();
if (inv.getVendor().getTaxDestination() != null) {
rounding = inv.getVendor().getTaxDestination().getSalTaxRoundMode(); // depends on control dependency: [if], data = [none]
}
} else if (invLn.getClass() == SalesInvoiceServiceLine.class) {
SalesInvoice inv = (SalesInvoice) invLn.getItsOwner();
if (inv.getCustomer().getTaxDestination() != null) {
rounding = inv.getCustomer().getTaxDestination().getSalTaxRoundMode(); // depends on control dependency: [if], data = [none]
}
}
if (rounding != null) {
if (rounding.equals(RoundingMode.HALF_UP)) {
taxRounding = "S";
} else if (rounding.equals(RoundingMode.HALF_DOWN)) {
taxRounding = "s";
} else if (rounding.equals(RoundingMode.UP)) {
taxRounding = "U";
} else if (rounding.equals(RoundingMode.DOWN)) {
taxRounding = "D";
} else if (rounding.equals(RoundingMode.HALF_EVEN)) {
taxRounding = "B";
} else if (rounding.equals(RoundingMode.CEILING)) {
taxRounding = "C";
} else if (rounding.equals(RoundingMode.FLOOR)) {
taxRounding = "F";
} else {
taxRounding = "S";
}
}
pRequestData.setAttribute("taxRounding", taxRounding);
return invLn;
} }
|
public class class_name {
public synchronized void suspendReceives() {
receivesSuspended = true;
if (receiver == null) {
if(Thread.currentThread() == channel.getIoThread()) {
channel.getSourceChannel().suspendReads();
} else {
channel.getIoThread().execute(new Runnable() {
@Override
public void run() {
channel.getSourceChannel().suspendReads();
}
});
}
}
} }
|
public class class_name {
public synchronized void suspendReceives() {
receivesSuspended = true;
if (receiver == null) {
if(Thread.currentThread() == channel.getIoThread()) {
channel.getSourceChannel().suspendReads(); // depends on control dependency: [if], data = [none]
} else {
channel.getIoThread().execute(new Runnable() {
@Override
public void run() {
channel.getSourceChannel().suspendReads();
}
}); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
public Integer mapThrowable(final Throwable throwable) {
Throwable throwableToCheck = throwable;
int depthToGo = 20;
while (true) {
Integer resId = mapThrowableFlat(throwableToCheck);
if (resId != null) {
return resId;
} else {
throwableToCheck = throwableToCheck.getCause();
depthToGo--;
if (depthToGo <= 0 || throwableToCheck == throwable || throwableToCheck == null) {
Log.d("EventBus", "No specific message resource ID found for " + throwable);
// return config.defaultErrorMsgId;
return null;
}
}
}
} }
|
public class class_name {
public Integer mapThrowable(final Throwable throwable) {
Throwable throwableToCheck = throwable;
int depthToGo = 20;
while (true) {
Integer resId = mapThrowableFlat(throwableToCheck);
if (resId != null) {
return resId; // depends on control dependency: [if], data = [none]
} else {
throwableToCheck = throwableToCheck.getCause(); // depends on control dependency: [if], data = [none]
depthToGo--; // depends on control dependency: [if], data = [none]
if (depthToGo <= 0 || throwableToCheck == throwable || throwableToCheck == null) {
Log.d("EventBus", "No specific message resource ID found for " + throwable); // depends on control dependency: [if], data = [none]
// return config.defaultErrorMsgId;
return null; // depends on control dependency: [if], data = [none]
}
}
}
} }
|
public class class_name {
public ErrorResponse parseError(Response response) {
if (response.isSuccessful()) {
throw new IllegalArgumentException("Response must be unsuccessful.");
}
Converter<ResponseBody, ErrorResponse> responseBodyObjectConverter =
retrofit.responseBodyConverter(ErrorResponse.class, new Annotation[0]);
try {
return responseBodyObjectConverter.convert(response.errorBody());
} catch (IOException ex) {
throw new RuntimeException("Could not parse error response", ex);
}
} }
|
public class class_name {
public ErrorResponse parseError(Response response) {
if (response.isSuccessful()) {
throw new IllegalArgumentException("Response must be unsuccessful.");
}
Converter<ResponseBody, ErrorResponse> responseBodyObjectConverter =
retrofit.responseBodyConverter(ErrorResponse.class, new Annotation[0]);
try {
return responseBodyObjectConverter.convert(response.errorBody()); // depends on control dependency: [try], data = [none]
} catch (IOException ex) {
throw new RuntimeException("Could not parse error response", ex);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
private static String inlineCssImports(final String css, final String basePath) {
String retValue = css;
int start;
while ((start = retValue.indexOf(CSS_IMPORT_START)) != -1) {
int end = retValue.indexOf(CSS_IMPORT_END, start);
if (end != -1) {
final String filePath = retValue.substring(start + CSS_IMPORT_START.length(), end);
final String fileData = FileUtilities.readFileContents(new File(basePath + "/" + filePath));
retValue = retValue.replace(CSS_IMPORT_START + filePath + CSS_IMPORT_END, fileData);
}
}
return retValue;
} }
|
public class class_name {
private static String inlineCssImports(final String css, final String basePath) {
String retValue = css;
int start;
while ((start = retValue.indexOf(CSS_IMPORT_START)) != -1) {
int end = retValue.indexOf(CSS_IMPORT_END, start);
if (end != -1) {
final String filePath = retValue.substring(start + CSS_IMPORT_START.length(), end);
final String fileData = FileUtilities.readFileContents(new File(basePath + "/" + filePath));
retValue = retValue.replace(CSS_IMPORT_START + filePath + CSS_IMPORT_END, fileData); // depends on control dependency: [if], data = [none]
}
}
return retValue;
} }
|
public class class_name {
private static String formatName(String columnName, boolean caseSensitive) {
String returnValue = format(columnName);
if (caseSensitive) {
return returnValue;
}
return returnValue.toUpperCase();
} }
|
public class class_name {
private static String formatName(String columnName, boolean caseSensitive) {
String returnValue = format(columnName);
if (caseSensitive) {
return returnValue; // depends on control dependency: [if], data = [none]
}
return returnValue.toUpperCase();
} }
|
public class class_name {
public String prepareCallbackScript(List<I_CmsDataViewItem> result) {
try {
if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_callbackArg)) {
m_callbackArg = "{}";
}
JSONObject obj = new JSONObject(m_callbackArg);
JSONArray selection = new JSONArray();
for (I_CmsDataViewItem item : result) {
JSONObject singleResult = new JSONObject();
singleResult.put(CmsDataViewConstants.FIELD_ID, item.getId());
singleResult.put(CmsDataViewConstants.FIELD_TITLE, item.getTitle());
singleResult.put(CmsDataViewConstants.FIELD_DESCRIPTION, item.getDescription());
singleResult.put(CmsDataViewConstants.FIELD_DATA, item.getData());
selection.put(singleResult);
}
obj.put(CmsDataViewConstants.KEY_RESULT, selection);
String jsonString = obj.toString();
return "parent." + m_callback + "(" + jsonString + ")";
} catch (Exception e) {
return null;
}
} }
|
public class class_name {
public String prepareCallbackScript(List<I_CmsDataViewItem> result) {
try {
if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_callbackArg)) {
m_callbackArg = "{}"; // depends on control dependency: [if], data = [none]
}
JSONObject obj = new JSONObject(m_callbackArg);
JSONArray selection = new JSONArray();
for (I_CmsDataViewItem item : result) {
JSONObject singleResult = new JSONObject();
singleResult.put(CmsDataViewConstants.FIELD_ID, item.getId()); // depends on control dependency: [for], data = [item]
singleResult.put(CmsDataViewConstants.FIELD_TITLE, item.getTitle()); // depends on control dependency: [for], data = [item]
singleResult.put(CmsDataViewConstants.FIELD_DESCRIPTION, item.getDescription()); // depends on control dependency: [for], data = [item]
singleResult.put(CmsDataViewConstants.FIELD_DATA, item.getData()); // depends on control dependency: [for], data = [item]
selection.put(singleResult); // depends on control dependency: [for], data = [none]
}
obj.put(CmsDataViewConstants.KEY_RESULT, selection); // depends on control dependency: [try], data = [none]
String jsonString = obj.toString();
return "parent." + m_callback + "(" + jsonString + ")"; // depends on control dependency: [try], data = [none]
} catch (Exception e) {
return null;
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public DBInstance withReadReplicaDBClusterIdentifiers(String... readReplicaDBClusterIdentifiers) {
if (this.readReplicaDBClusterIdentifiers == null) {
setReadReplicaDBClusterIdentifiers(new java.util.ArrayList<String>(readReplicaDBClusterIdentifiers.length));
}
for (String ele : readReplicaDBClusterIdentifiers) {
this.readReplicaDBClusterIdentifiers.add(ele);
}
return this;
} }
|
public class class_name {
public DBInstance withReadReplicaDBClusterIdentifiers(String... readReplicaDBClusterIdentifiers) {
if (this.readReplicaDBClusterIdentifiers == null) {
setReadReplicaDBClusterIdentifiers(new java.util.ArrayList<String>(readReplicaDBClusterIdentifiers.length)); // depends on control dependency: [if], data = [none]
}
for (String ele : readReplicaDBClusterIdentifiers) {
this.readReplicaDBClusterIdentifiers.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} }
|
public class class_name {
public static String deepFieldName(Field field) {
DeepField annotation = field.getAnnotation(DeepField.class);
if (StringUtils.isNotEmpty(annotation.fieldName())) {
return annotation.fieldName();
} else {
return field.getName();
}
} }
|
public class class_name {
public static String deepFieldName(Field field) {
DeepField annotation = field.getAnnotation(DeepField.class);
if (StringUtils.isNotEmpty(annotation.fieldName())) {
return annotation.fieldName(); // depends on control dependency: [if], data = [none]
} else {
return field.getName(); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public void annotate(Run<?,?> build, Entry change, MarkupText text) {
if (build instanceof AbstractBuild && Util.isOverridden(ChangeLogAnnotator.class, getClass(), "annotate", AbstractBuild.class, Entry.class, MarkupText.class)) {
annotate((AbstractBuild) build, change, text);
} else {
Logger.getLogger(ChangeLogAnnotator.class.getName()).log(Level.WARNING, "You must override the newer overload of annotate from {0}", getClass().getName());
}
} }
|
public class class_name {
public void annotate(Run<?,?> build, Entry change, MarkupText text) {
if (build instanceof AbstractBuild && Util.isOverridden(ChangeLogAnnotator.class, getClass(), "annotate", AbstractBuild.class, Entry.class, MarkupText.class)) {
annotate((AbstractBuild) build, change, text); // depends on control dependency: [if], data = [none]
} else {
Logger.getLogger(ChangeLogAnnotator.class.getName()).log(Level.WARNING, "You must override the newer overload of annotate from {0}", getClass().getName()); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
private int getWidthOfWidestItem() {
int maxWidth = 0;
for (CmsContextMenuItemWidget item : m_menuItems) {
item.getElement().getStyle().clearWidth();
int itemWidth = measureWidth(item);
if (itemWidth > maxWidth) {
maxWidth = itemWidth;
}
}
return maxWidth;
} }
|
public class class_name {
private int getWidthOfWidestItem() {
int maxWidth = 0;
for (CmsContextMenuItemWidget item : m_menuItems) {
item.getElement().getStyle().clearWidth(); // depends on control dependency: [for], data = [item]
int itemWidth = measureWidth(item);
if (itemWidth > maxWidth) {
maxWidth = itemWidth; // depends on control dependency: [if], data = [none]
}
}
return maxWidth;
} }
|
public class class_name {
public static final void close(Closeable closeable) {
if (closeable == null) {
return;
}
try {
closeable.close();
} catch (IOException e) {
Log.e(TAG, "something went wrong on close", e);
}
} }
|
public class class_name {
public static final void close(Closeable closeable) {
if (closeable == null) {
return; // depends on control dependency: [if], data = [none]
}
try {
closeable.close(); // depends on control dependency: [try], data = [none]
} catch (IOException e) {
Log.e(TAG, "something went wrong on close", e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public void addPreserveTagList(List<String> preserveTags) {
for (Iterator<String> it = preserveTags.iterator(); it.hasNext();) {
addPreserveTag(it.next());
}
} }
|
public class class_name {
public void addPreserveTagList(List<String> preserveTags) {
for (Iterator<String> it = preserveTags.iterator(); it.hasNext();) {
addPreserveTag(it.next()); // depends on control dependency: [for], data = [it]
}
} }
|
public class class_name {
public static String toFirstUpper(String string) {
int c = ((int) string.charAt(0));
if (c >= 97 && c <=122) {
// is lower
char Upp = (char) (((int) string.charAt(0)) - 32);
return Upp + string.substring(1);
}
return string;
} }
|
public class class_name {
public static String toFirstUpper(String string) {
int c = ((int) string.charAt(0));
if (c >= 97 && c <=122) {
// is lower
char Upp = (char) (((int) string.charAt(0)) - 32);
return Upp + string.substring(1); // depends on control dependency: [if], data = [none]
}
return string;
} }
|
public class class_name {
public static String getParameter(final Request request, final String parameterName)
{
String parameterValue = request.getRequestParameters().getParameterValue(parameterName)
.toString();
if ((parameterValue == null) || parameterValue.isEmpty())
{
parameterValue = request.getPostParameters().getParameterValue(parameterName)
.toString();
}
if ((parameterValue == null) || parameterValue.isEmpty())
{
parameterValue = request.getQueryParameters().getParameterValue(parameterName)
.toString();
}
if ((parameterValue == null) || parameterValue.isEmpty())
{
parameterValue = request.getRequestParameters().getParameterValue(parameterName)
.toString();
}
return parameterValue;
} }
|
public class class_name {
public static String getParameter(final Request request, final String parameterName)
{
String parameterValue = request.getRequestParameters().getParameterValue(parameterName)
.toString();
if ((parameterValue == null) || parameterValue.isEmpty())
{
parameterValue = request.getPostParameters().getParameterValue(parameterName)
.toString(); // depends on control dependency: [if], data = [none]
}
if ((parameterValue == null) || parameterValue.isEmpty())
{
parameterValue = request.getQueryParameters().getParameterValue(parameterName)
.toString(); // depends on control dependency: [if], data = [none]
}
if ((parameterValue == null) || parameterValue.isEmpty())
{
parameterValue = request.getRequestParameters().getParameterValue(parameterName)
.toString(); // depends on control dependency: [if], data = [none]
}
return parameterValue;
} }
|
public class class_name {
JCExpressionStatement SuperCall(TreeMaker make,
List<Type> typarams,
List<JCVariableDecl> params,
boolean based) {
JCExpression meth;
if (based) {
meth = make.Select(make.Ident(params.head), names._super);
params = params.tail;
} else {
meth = make.Ident(names._super);
}
List<JCExpression> typeargs = typarams.nonEmpty() ? make.Types(typarams) : null;
return make.Exec(make.Apply(typeargs, meth, make.Idents(params)));
} }
|
public class class_name {
JCExpressionStatement SuperCall(TreeMaker make,
List<Type> typarams,
List<JCVariableDecl> params,
boolean based) {
JCExpression meth;
if (based) {
meth = make.Select(make.Ident(params.head), names._super); // depends on control dependency: [if], data = [none]
params = params.tail; // depends on control dependency: [if], data = [none]
} else {
meth = make.Ident(names._super); // depends on control dependency: [if], data = [none]
}
List<JCExpression> typeargs = typarams.nonEmpty() ? make.Types(typarams) : null;
return make.Exec(make.Apply(typeargs, meth, make.Idents(params)));
} }
|
public class class_name {
private static <T> void readFields(BufferedReader reader, DatabaseTableConfig<T> config) throws SQLException {
List<DatabaseFieldConfig> fields = new ArrayList<DatabaseFieldConfig>();
while (true) {
String line;
try {
line = reader.readLine();
} catch (IOException e) {
throw SqlExceptionUtil.create("Could not read next field from config file", e);
}
if (line == null || line.equals(CONFIG_FILE_FIELDS_END)) {
break;
}
DatabaseFieldConfig fieldConfig = DatabaseFieldConfigLoader.fromReader(reader);
if (fieldConfig == null) {
break;
}
fields.add(fieldConfig);
}
config.setFieldConfigs(fields);
} }
|
public class class_name {
private static <T> void readFields(BufferedReader reader, DatabaseTableConfig<T> config) throws SQLException {
List<DatabaseFieldConfig> fields = new ArrayList<DatabaseFieldConfig>();
while (true) {
String line;
try {
line = reader.readLine(); // depends on control dependency: [try], data = [none]
} catch (IOException e) {
throw SqlExceptionUtil.create("Could not read next field from config file", e);
} // depends on control dependency: [catch], data = [none]
if (line == null || line.equals(CONFIG_FILE_FIELDS_END)) {
break;
}
DatabaseFieldConfig fieldConfig = DatabaseFieldConfigLoader.fromReader(reader);
if (fieldConfig == null) {
break;
}
fields.add(fieldConfig);
}
config.setFieldConfigs(fields);
} }
|
public class class_name {
public List<Flow<Job<T>>> getAllFlow()
{
List<Flow<Job<T>>> list = new ArrayList<Flow<Job<T>>>();
List<Node> nodeList = childNode.get("flow");
for(Node node: nodeList)
{
Flow<Job<T>> type = new FlowImpl<Job<T>>(this, "flow", childNode, node);
list.add(type);
}
return list;
} }
|
public class class_name {
public List<Flow<Job<T>>> getAllFlow()
{
List<Flow<Job<T>>> list = new ArrayList<Flow<Job<T>>>();
List<Node> nodeList = childNode.get("flow");
for(Node node: nodeList)
{
Flow<Job<T>> type = new FlowImpl<Job<T>>(this, "flow", childNode, node);
list.add(type); // depends on control dependency: [for], data = [none]
}
return list;
} }
|
public class class_name {
public boolean releaseLock(TransactionImpl tx, Object obj)
{
LockEntry writer = getWriter(obj);
if (writer != null && writer.isOwnedBy(tx))
{
removeWriter(writer);
return true;
}
if (hasReadLock(tx, obj))
{
removeReader(tx, obj);
return true;
}
return false;
} }
|
public class class_name {
public boolean releaseLock(TransactionImpl tx, Object obj)
{
LockEntry writer = getWriter(obj);
if (writer != null && writer.isOwnedBy(tx))
{
removeWriter(writer);
// depends on control dependency: [if], data = [(writer]
return true;
// depends on control dependency: [if], data = [none]
}
if (hasReadLock(tx, obj))
{
removeReader(tx, obj);
// depends on control dependency: [if], data = [none]
return true;
// depends on control dependency: [if], data = [none]
}
return false;
} }
|
public class class_name {
private void pdb_SEQRES_Handler(String line) {
/*
* 1 2 3 4 5 6 7
* 1234567890123456789012345678901234567890123456789012345678901234567890
* SEQRES 1 A 376 LYS PRO VAL THR VAL LYS LEU VAL ASP SER GLN ALA THR
* SEQRES 1 A 21 GLY ILE VAL GLU GLN CYS CYS THR SER ILE CYS SER LEU
* SEQRES 2 A 21 TYR GLN LEU GLU ASN TYR CYS ASN
* SEQRES 1 B 30 PHE VAL ASN GLN HIS LEU CYS GLY SER HIS LEU VAL GLU
* SEQRES 2 B 30 ALA LEU TYR LEU VAL CYS GLY GLU ARG GLY PHE PHE TYR
* SEQRES 3 B 30 THR PRO LYS ALA
* SEQRES 1 C 21 GLY ILE VAL GLU GLN CYS CYS THR SER ILE CYS SER LEU
* SEQRES 2 C 21 TYR GLN LEU GLU ASN TYR CYS ASN
* SEQRES 1 D 30 PHE VAL ASN GLN HIS LEU CYS GLY SER HIS LEU VAL GLU
* SEQRES 2 D 30 ALA LEU TYR LEU VAL CYS GLY GLU ARG GLY PHE PHE TYR
* SEQRES 3 D 30 THR PRO LYS ALA
*/
String recordName = line.substring(0, 6).trim();
String chainID = line.substring(11, 12);
String newLength = line.substring(13,17).trim();
String subSequence = line.substring(18);
if ( lengthCheck == -1 ){
lengthCheck = Integer.parseInt(newLength);
}
StringTokenizer subSequenceResidues = new StringTokenizer(subSequence);
Character aminoCode1 = null;
if (! recordName.equals(AminoAcid.SEQRESRECORD)) {
// should not have been called
return;
}
currentChain = isKnownChain(chainID, seqResChains);
if ( currentChain == null) {
currentChain = new ChainImpl();
currentChain.setId(chainID);
currentChain.setName(chainID);
}
while (subSequenceResidues.hasMoreTokens()) {
String threeLetter = subSequenceResidues.nextToken();
aminoCode1 = StructureTools.get1LetterCode(threeLetter);
//if (aminoCode1 == null) {
// could be a nucleotide...
// but getNewGroup takes care of that and converts ATOM records with aminoCode1 == nnull to nucleotide...
//}
currentGroup = getNewGroup("ATOM", aminoCode1, threeLetter);
currentGroup.setPDBName(threeLetter);
if ( currentGroup instanceof AminoAcid){
AminoAcid aa = (AminoAcid)currentGroup;
aa.setRecordType(AminoAcid.SEQRESRECORD);
}
// add the current resNum to the new chain.
currentChain.addGroup(currentGroup);
}
Chain test = isKnownChain(chainID, seqResChains);
if ( test == null)
seqResChains.add(currentChain);
if (currentGroup != null)
currentGroup.trimToSize();
currentGroup = null;
currentChain = null;
// the current chain is finished!
//if ( current_chain.getLength() != lengthCheck ){
// System.err.println("the length of chain " + current_chain.getName() + "(" +
// current_chain.getLength() + ") does not match the expected " + lengthCheck);
//}
lengthCheck = Integer.parseInt(newLength);
} }
|
public class class_name {
private void pdb_SEQRES_Handler(String line) {
/*
* 1 2 3 4 5 6 7
* 1234567890123456789012345678901234567890123456789012345678901234567890
* SEQRES 1 A 376 LYS PRO VAL THR VAL LYS LEU VAL ASP SER GLN ALA THR
* SEQRES 1 A 21 GLY ILE VAL GLU GLN CYS CYS THR SER ILE CYS SER LEU
* SEQRES 2 A 21 TYR GLN LEU GLU ASN TYR CYS ASN
* SEQRES 1 B 30 PHE VAL ASN GLN HIS LEU CYS GLY SER HIS LEU VAL GLU
* SEQRES 2 B 30 ALA LEU TYR LEU VAL CYS GLY GLU ARG GLY PHE PHE TYR
* SEQRES 3 B 30 THR PRO LYS ALA
* SEQRES 1 C 21 GLY ILE VAL GLU GLN CYS CYS THR SER ILE CYS SER LEU
* SEQRES 2 C 21 TYR GLN LEU GLU ASN TYR CYS ASN
* SEQRES 1 D 30 PHE VAL ASN GLN HIS LEU CYS GLY SER HIS LEU VAL GLU
* SEQRES 2 D 30 ALA LEU TYR LEU VAL CYS GLY GLU ARG GLY PHE PHE TYR
* SEQRES 3 D 30 THR PRO LYS ALA
*/
String recordName = line.substring(0, 6).trim();
String chainID = line.substring(11, 12);
String newLength = line.substring(13,17).trim();
String subSequence = line.substring(18);
if ( lengthCheck == -1 ){
lengthCheck = Integer.parseInt(newLength); // depends on control dependency: [if], data = [none]
}
StringTokenizer subSequenceResidues = new StringTokenizer(subSequence);
Character aminoCode1 = null;
if (! recordName.equals(AminoAcid.SEQRESRECORD)) {
// should not have been called
return; // depends on control dependency: [if], data = [none]
}
currentChain = isKnownChain(chainID, seqResChains);
if ( currentChain == null) {
currentChain = new ChainImpl(); // depends on control dependency: [if], data = [none]
currentChain.setId(chainID); // depends on control dependency: [if], data = [none]
currentChain.setName(chainID); // depends on control dependency: [if], data = [none]
}
while (subSequenceResidues.hasMoreTokens()) {
String threeLetter = subSequenceResidues.nextToken();
aminoCode1 = StructureTools.get1LetterCode(threeLetter); // depends on control dependency: [while], data = [none]
//if (aminoCode1 == null) {
// could be a nucleotide...
// but getNewGroup takes care of that and converts ATOM records with aminoCode1 == nnull to nucleotide...
//}
currentGroup = getNewGroup("ATOM", aminoCode1, threeLetter); // depends on control dependency: [while], data = [none]
currentGroup.setPDBName(threeLetter); // depends on control dependency: [while], data = [none]
if ( currentGroup instanceof AminoAcid){
AminoAcid aa = (AminoAcid)currentGroup;
aa.setRecordType(AminoAcid.SEQRESRECORD); // depends on control dependency: [if], data = [none]
}
// add the current resNum to the new chain.
currentChain.addGroup(currentGroup); // depends on control dependency: [while], data = [none]
}
Chain test = isKnownChain(chainID, seqResChains);
if ( test == null)
seqResChains.add(currentChain);
if (currentGroup != null)
currentGroup.trimToSize();
currentGroup = null;
currentChain = null;
// the current chain is finished!
//if ( current_chain.getLength() != lengthCheck ){
// System.err.println("the length of chain " + current_chain.getName() + "(" +
// current_chain.getLength() + ") does not match the expected " + lengthCheck);
//}
lengthCheck = Integer.parseInt(newLength);
} }
|
public class class_name {
private String getDurationString(Duration value)
{
String result = null;
if (value != null)
{
double seconds = 0;
switch (value.getUnits())
{
case MINUTES:
case ELAPSED_MINUTES:
{
seconds = value.getDuration() * 60;
break;
}
case HOURS:
case ELAPSED_HOURS:
{
seconds = value.getDuration() * (60 * 60);
break;
}
case DAYS:
{
double minutesPerDay = m_projectFile.getProjectProperties().getMinutesPerDay().doubleValue();
seconds = value.getDuration() * (minutesPerDay * 60);
break;
}
case ELAPSED_DAYS:
{
seconds = value.getDuration() * (24 * 60 * 60);
break;
}
case WEEKS:
{
double minutesPerWeek = m_projectFile.getProjectProperties().getMinutesPerWeek().doubleValue();
seconds = value.getDuration() * (minutesPerWeek * 60);
break;
}
case ELAPSED_WEEKS:
{
seconds = value.getDuration() * (7 * 24 * 60 * 60);
break;
}
case MONTHS:
{
double minutesPerDay = m_projectFile.getProjectProperties().getMinutesPerDay().doubleValue();
double daysPerMonth = m_projectFile.getProjectProperties().getDaysPerMonth().doubleValue();
seconds = value.getDuration() * (daysPerMonth * minutesPerDay * 60);
break;
}
case ELAPSED_MONTHS:
{
seconds = value.getDuration() * (30 * 24 * 60 * 60);
break;
}
case YEARS:
{
double minutesPerDay = m_projectFile.getProjectProperties().getMinutesPerDay().doubleValue();
double daysPerMonth = m_projectFile.getProjectProperties().getDaysPerMonth().doubleValue();
seconds = value.getDuration() * (12 * daysPerMonth * minutesPerDay * 60);
break;
}
case ELAPSED_YEARS:
{
seconds = value.getDuration() * (365 * 24 * 60 * 60);
break;
}
default:
{
break;
}
}
result = Long.toString((long) seconds);
}
return (result);
} }
|
public class class_name {
private String getDurationString(Duration value)
{
String result = null;
if (value != null)
{
double seconds = 0;
switch (value.getUnits())
{
case MINUTES:
case ELAPSED_MINUTES:
{
seconds = value.getDuration() * 60;
break;
}
case HOURS:
case ELAPSED_HOURS:
{
seconds = value.getDuration() * (60 * 60);
break;
}
case DAYS:
{
double minutesPerDay = m_projectFile.getProjectProperties().getMinutesPerDay().doubleValue();
seconds = value.getDuration() * (minutesPerDay * 60); // depends on control dependency: [if], data = [none]
break;
}
case ELAPSED_DAYS:
{
seconds = value.getDuration() * (24 * 60 * 60);
break;
}
case WEEKS:
{
double minutesPerWeek = m_projectFile.getProjectProperties().getMinutesPerWeek().doubleValue();
seconds = value.getDuration() * (minutesPerWeek * 60);
break;
}
case ELAPSED_WEEKS:
{
seconds = value.getDuration() * (7 * 24 * 60 * 60);
break;
}
case MONTHS:
{
double minutesPerDay = m_projectFile.getProjectProperties().getMinutesPerDay().doubleValue();
double daysPerMonth = m_projectFile.getProjectProperties().getDaysPerMonth().doubleValue();
seconds = value.getDuration() * (daysPerMonth * minutesPerDay * 60);
break;
}
case ELAPSED_MONTHS:
{
seconds = value.getDuration() * (30 * 24 * 60 * 60);
break;
}
case YEARS:
{
double minutesPerDay = m_projectFile.getProjectProperties().getMinutesPerDay().doubleValue();
double daysPerMonth = m_projectFile.getProjectProperties().getDaysPerMonth().doubleValue();
seconds = value.getDuration() * (12 * daysPerMonth * minutesPerDay * 60);
break;
}
case ELAPSED_YEARS:
{
seconds = value.getDuration() * (365 * 24 * 60 * 60);
break;
}
default:
{
break;
}
}
result = Long.toString((long) seconds);
}
return (result);
} }
|
public class class_name {
public static String getURLshp(final HttpServletRequest request) {
String scheme = request.getScheme();
StringBuilder sb = new StringBuilder(scheme);
sb.append("://");
sb.append(request.getServerName());
int port = request.getServerPort();
if ("http".equalsIgnoreCase(scheme) && (port == 80)) {
return sb.toString();
}
if ("https".equalsIgnoreCase(scheme) && (port == 443)) {
return sb.toString();
}
sb.append(":");
sb.append(port);
return sb.toString();
} }
|
public class class_name {
public static String getURLshp(final HttpServletRequest request) {
String scheme = request.getScheme();
StringBuilder sb = new StringBuilder(scheme);
sb.append("://");
sb.append(request.getServerName());
int port = request.getServerPort();
if ("http".equalsIgnoreCase(scheme) && (port == 80)) {
return sb.toString(); // depends on control dependency: [if], data = [none]
}
if ("https".equalsIgnoreCase(scheme) && (port == 443)) {
return sb.toString(); // depends on control dependency: [if], data = [none]
}
sb.append(":");
sb.append(port);
return sb.toString();
} }
|
public class class_name {
private void logClusterSizes(String m, int dimensionality, Object2ObjectOpenCustomHashMap<long[], List<ArrayModifiableDBIDs>> clustersMap) {
if(LOG.isVerbose()) {
final StringBuilder msg = new StringBuilder(1000).append(m).append('\n');
for(ObjectIterator<Object2ObjectMap.Entry<long[], List<ArrayModifiableDBIDs>>> iter = clustersMap.object2ObjectEntrySet().fastIterator(); iter.hasNext();) {
Object2ObjectMap.Entry<long[], List<ArrayModifiableDBIDs>> entry = iter.next();
msg.append(BitsUtil.toStringLow(entry.getKey(), dimensionality)).append(" sizes:");
for(ArrayModifiableDBIDs c : entry.getValue()) {
msg.append(' ').append(c.size());
}
msg.append('\n');
}
LOG.verbose(msg.toString());
}
} }
|
public class class_name {
private void logClusterSizes(String m, int dimensionality, Object2ObjectOpenCustomHashMap<long[], List<ArrayModifiableDBIDs>> clustersMap) {
if(LOG.isVerbose()) {
final StringBuilder msg = new StringBuilder(1000).append(m).append('\n');
for(ObjectIterator<Object2ObjectMap.Entry<long[], List<ArrayModifiableDBIDs>>> iter = clustersMap.object2ObjectEntrySet().fastIterator(); iter.hasNext();) {
Object2ObjectMap.Entry<long[], List<ArrayModifiableDBIDs>> entry = iter.next();
msg.append(BitsUtil.toStringLow(entry.getKey(), dimensionality)).append(" sizes:"); // depends on control dependency: [for], data = [none]
for(ArrayModifiableDBIDs c : entry.getValue()) {
msg.append(' ').append(c.size()); // depends on control dependency: [for], data = [c]
}
msg.append('\n'); // depends on control dependency: [for], data = [none]
}
LOG.verbose(msg.toString()); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public static MtasDataCollector<?, ?> getCollector(String collectorType,
String dataType, String statsType, SortedSet<String> statsItems,
String sortType, String sortDirection, Integer start, Integer number,
String[] subCollectorTypes, String[] subDataTypes, String[] subStatsTypes,
SortedSet<String>[] subStatsItems, String[] subSortTypes,
String[] subSortDirections, Integer[] subStart, Integer[] subNumber,
String segmentRegistration, String boundary) throws IOException {
if (dataType != null && dataType.equals(CodecUtil.DATA_TYPE_LONG)) {
if (statsType.equals(CodecUtil.STATS_BASIC)) {
return new MtasDataLongBasic(collectorType, statsItems, sortType,
sortDirection, start, number, subCollectorTypes, subDataTypes,
subStatsTypes, subStatsItems, subSortTypes, subSortDirections,
subStart, subNumber, segmentRegistration, boundary);
} else if (statsType.equals(CodecUtil.STATS_ADVANCED)) {
return new MtasDataLongAdvanced(collectorType, statsItems, sortType,
sortDirection, start, number, subCollectorTypes, subDataTypes,
subStatsTypes, subStatsItems, subSortTypes, subSortDirections,
subStart, subNumber, segmentRegistration, boundary);
} else if (statsType.equals(CodecUtil.STATS_FULL)) {
return new MtasDataLongFull(collectorType, statsItems, sortType,
sortDirection, start, number, subCollectorTypes, subDataTypes,
subStatsTypes, subStatsItems, subSortTypes, subSortDirections,
subStart, subNumber, segmentRegistration, boundary);
} else {
throw new IOException("unknown statsType " + statsType);
}
} else if (dataType != null
&& dataType.equals(CodecUtil.DATA_TYPE_DOUBLE)) {
if (statsType.equals(CodecUtil.STATS_BASIC)) {
return new MtasDataDoubleBasic(collectorType, statsItems, sortType,
sortDirection, start, number, subCollectorTypes, subDataTypes,
subStatsTypes, subStatsItems, subSortTypes, subSortDirections,
subStart, subNumber, segmentRegistration, boundary);
} else if (statsType.equals(CodecUtil.STATS_ADVANCED)) {
return new MtasDataDoubleAdvanced(collectorType, statsItems, sortType,
sortDirection, start, number, subCollectorTypes, subDataTypes,
subStatsTypes, subStatsItems, subSortTypes, subSortDirections,
subStart, subNumber, segmentRegistration, boundary);
} else if (statsType.equals(CodecUtil.STATS_FULL)) {
return new MtasDataDoubleFull(collectorType, statsItems, sortType,
sortDirection, start, number, subCollectorTypes, subDataTypes,
subStatsTypes, subStatsItems, subSortTypes, subSortDirections,
subStart, subNumber, segmentRegistration, boundary);
} else {
throw new IOException("unknown statsType " + statsType);
}
} else {
throw new IOException("unknown dataType " + dataType);
}
} }
|
public class class_name {
public static MtasDataCollector<?, ?> getCollector(String collectorType,
String dataType, String statsType, SortedSet<String> statsItems,
String sortType, String sortDirection, Integer start, Integer number,
String[] subCollectorTypes, String[] subDataTypes, String[] subStatsTypes,
SortedSet<String>[] subStatsItems, String[] subSortTypes,
String[] subSortDirections, Integer[] subStart, Integer[] subNumber,
String segmentRegistration, String boundary) throws IOException {
if (dataType != null && dataType.equals(CodecUtil.DATA_TYPE_LONG)) {
if (statsType.equals(CodecUtil.STATS_BASIC)) {
return new MtasDataLongBasic(collectorType, statsItems, sortType,
sortDirection, start, number, subCollectorTypes, subDataTypes,
subStatsTypes, subStatsItems, subSortTypes, subSortDirections,
subStart, subNumber, segmentRegistration, boundary); // depends on control dependency: [if], data = [none]
} else if (statsType.equals(CodecUtil.STATS_ADVANCED)) {
return new MtasDataLongAdvanced(collectorType, statsItems, sortType,
sortDirection, start, number, subCollectorTypes, subDataTypes,
subStatsTypes, subStatsItems, subSortTypes, subSortDirections,
subStart, subNumber, segmentRegistration, boundary); // depends on control dependency: [if], data = [none]
} else if (statsType.equals(CodecUtil.STATS_FULL)) {
return new MtasDataLongFull(collectorType, statsItems, sortType,
sortDirection, start, number, subCollectorTypes, subDataTypes,
subStatsTypes, subStatsItems, subSortTypes, subSortDirections,
subStart, subNumber, segmentRegistration, boundary); // depends on control dependency: [if], data = [none]
} else {
throw new IOException("unknown statsType " + statsType);
}
} else if (dataType != null
&& dataType.equals(CodecUtil.DATA_TYPE_DOUBLE)) {
if (statsType.equals(CodecUtil.STATS_BASIC)) {
return new MtasDataDoubleBasic(collectorType, statsItems, sortType,
sortDirection, start, number, subCollectorTypes, subDataTypes,
subStatsTypes, subStatsItems, subSortTypes, subSortDirections,
subStart, subNumber, segmentRegistration, boundary); // depends on control dependency: [if], data = [none]
} else if (statsType.equals(CodecUtil.STATS_ADVANCED)) {
return new MtasDataDoubleAdvanced(collectorType, statsItems, sortType,
sortDirection, start, number, subCollectorTypes, subDataTypes,
subStatsTypes, subStatsItems, subSortTypes, subSortDirections,
subStart, subNumber, segmentRegistration, boundary); // depends on control dependency: [if], data = [none]
} else if (statsType.equals(CodecUtil.STATS_FULL)) {
return new MtasDataDoubleFull(collectorType, statsItems, sortType,
sortDirection, start, number, subCollectorTypes, subDataTypes,
subStatsTypes, subStatsItems, subSortTypes, subSortDirections,
subStart, subNumber, segmentRegistration, boundary); // depends on control dependency: [if], data = [none]
} else {
throw new IOException("unknown statsType " + statsType);
}
} else {
throw new IOException("unknown dataType " + dataType);
}
} }
|
public class class_name {
public static List<MediaType> parseMediaTypes(String mediaTypes) {
if (!Strings.isNullOrEmpty(mediaTypes)) {
return Collections.emptyList();
}
String[] tokens = mediaTypes.split(",\\s*");
List<MediaType> result = new ArrayList<MediaType>(tokens.length);
for (String token : tokens) {
result.add(parseMediaType(token));
}
return result;
} }
|
public class class_name {
public static List<MediaType> parseMediaTypes(String mediaTypes) {
if (!Strings.isNullOrEmpty(mediaTypes)) {
return Collections.emptyList(); // depends on control dependency: [if], data = [none]
}
String[] tokens = mediaTypes.split(",\\s*");
List<MediaType> result = new ArrayList<MediaType>(tokens.length);
for (String token : tokens) {
result.add(parseMediaType(token)); // depends on control dependency: [for], data = [token]
}
return result;
} }
|
public class class_name {
private List<String> getIndexes(CmsSetupDb dbCon, String tablename) throws SQLException {
List<String> indexes = new ArrayList<String>();
String tableIndex = readQuery(QUERY_SHOW_INDEX);
Map<String, String> replacer = new HashMap<String, String>();
replacer.put(REPLACEMENT_TABLENAME, tablename);
CmsSetupDBWrapper db = null;
try {
db = dbCon.executeSqlStatement(tableIndex, replacer);
while (db.getResultSet().next()) {
String index = db.getResultSet().getString(FIELD_INDEX);
if (!indexes.contains(index)) {
indexes.add(index);
}
}
} finally {
if (db != null) {
db.close();
}
}
return indexes;
} }
|
public class class_name {
private List<String> getIndexes(CmsSetupDb dbCon, String tablename) throws SQLException {
List<String> indexes = new ArrayList<String>();
String tableIndex = readQuery(QUERY_SHOW_INDEX);
Map<String, String> replacer = new HashMap<String, String>();
replacer.put(REPLACEMENT_TABLENAME, tablename);
CmsSetupDBWrapper db = null;
try {
db = dbCon.executeSqlStatement(tableIndex, replacer);
while (db.getResultSet().next()) {
String index = db.getResultSet().getString(FIELD_INDEX);
if (!indexes.contains(index)) {
indexes.add(index); // depends on control dependency: [if], data = [none]
}
}
} finally {
if (db != null) {
db.close(); // depends on control dependency: [if], data = [none]
}
}
return indexes;
} }
|
public class class_name {
public List<T> page(int pageNumber) {
if (pageNumber > totalPages && pageNumber > kaminariNextPage) {
throw new NoSuchElementException();
} else if (pageNumber < 1) {
throw new NoSuchElementException();
}
if (currentPage == 0 && pageNumber == 1) {
currentPage = 1;
return (currentItems);
}
if (currentPage == pageNumber) {
return (currentItems);
}
try {
setPageParam(pageNumber);
Response response = api.get(Response.Status.OK, queryParams, pathArgs);
currentItems = mapper.readValue((InputStream) response.getEntity(), javaType);
currentPage = pageNumber;
if (kaminariNextPage > 0) {
kaminariNextPage = getIntHeaderValue(response, NEXT_PAGE_HEADER);
}
return (currentItems);
} catch (GitLabApiException | IOException e) {
throw new RuntimeException(e);
}
} }
|
public class class_name {
public List<T> page(int pageNumber) {
if (pageNumber > totalPages && pageNumber > kaminariNextPage) {
throw new NoSuchElementException();
} else if (pageNumber < 1) {
throw new NoSuchElementException();
}
if (currentPage == 0 && pageNumber == 1) {
currentPage = 1;
// depends on control dependency: [if], data = [none]
return (currentItems);
// depends on control dependency: [if], data = [none]
}
if (currentPage == pageNumber) {
return (currentItems);
// depends on control dependency: [if], data = [none]
}
try {
setPageParam(pageNumber);
// depends on control dependency: [try], data = [none]
Response response = api.get(Response.Status.OK, queryParams, pathArgs);
currentItems = mapper.readValue((InputStream) response.getEntity(), javaType);
// depends on control dependency: [try], data = [none]
currentPage = pageNumber;
// depends on control dependency: [try], data = [none]
if (kaminariNextPage > 0) {
kaminariNextPage = getIntHeaderValue(response, NEXT_PAGE_HEADER);
// depends on control dependency: [if], data = [none]
}
return (currentItems);
// depends on control dependency: [try], data = [none]
} catch (GitLabApiException | IOException e) {
throw new RuntimeException(e);
}
// depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public static base_responses enable(nitro_service client, String ip[]) throws Exception {
base_responses result = null;
if (ip != null && ip.length > 0) {
dnsnameserver enableresources[] = new dnsnameserver[ip.length];
for (int i=0;i<ip.length;i++){
enableresources[i] = new dnsnameserver();
enableresources[i].ip = ip[i];
}
result = perform_operation_bulk_request(client, enableresources,"enable");
}
return result;
} }
|
public class class_name {
public static base_responses enable(nitro_service client, String ip[]) throws Exception {
base_responses result = null;
if (ip != null && ip.length > 0) {
dnsnameserver enableresources[] = new dnsnameserver[ip.length];
for (int i=0;i<ip.length;i++){
enableresources[i] = new dnsnameserver(); // depends on control dependency: [for], data = [i]
enableresources[i].ip = ip[i]; // depends on control dependency: [for], data = [i]
}
result = perform_operation_bulk_request(client, enableresources,"enable");
}
return result;
} }
|
public class class_name {
@Override
public void close() {
if (state == RELEASED) {
return;
}
if (state == READY) {
LIB.mdb_txn_abort(ptr);
}
keyVal.close();
state = RELEASED;
} }
|
public class class_name {
@Override
public void close() {
if (state == RELEASED) {
return; // depends on control dependency: [if], data = [none]
}
if (state == READY) {
LIB.mdb_txn_abort(ptr); // depends on control dependency: [if], data = [none]
}
keyVal.close();
state = RELEASED;
} }
|
public class class_name {
public void logTaskUpdates(TaskID taskId, long finishTime) {
if (disableHistory) {
return;
}
JobID id = taskId.getJobID();
if (!this.jobId.equals(id)) {
throw new RuntimeException("JobId from task: " + id +
" does not match expected: " + jobId);
}
if (null != writers) {
log(writers, RecordTypes.Task,
new Keys[]{Keys.TASKID, Keys.FINISH_TIME},
new String[]{ taskId.toString(),
String.valueOf(finishTime)});
}
} }
|
public class class_name {
public void logTaskUpdates(TaskID taskId, long finishTime) {
if (disableHistory) {
return; // depends on control dependency: [if], data = [none]
}
JobID id = taskId.getJobID();
if (!this.jobId.equals(id)) {
throw new RuntimeException("JobId from task: " + id +
" does not match expected: " + jobId);
}
if (null != writers) {
log(writers, RecordTypes.Task,
new Keys[]{Keys.TASKID, Keys.FINISH_TIME},
new String[]{ taskId.toString(),
String.valueOf(finishTime)});
}
} }
|
public class class_name {
protected Locator locator(final CouchbaseRequest request) {
if (request instanceof BinaryRequest) {
return binaryLocator;
} else if (request instanceof ViewRequest) {
return viewLocator;
} else if (request instanceof QueryRequest) {
return queryLocator;
} else if (request instanceof ConfigRequest) {
return configLocator;
} else if (request instanceof SearchRequest) {
return searchLocator;
} else if (request instanceof AnalyticsRequest) {
return analyticsLocator;
} else {
throw new IllegalArgumentException("Unknown Request Type: " + request);
}
} }
|
public class class_name {
protected Locator locator(final CouchbaseRequest request) {
if (request instanceof BinaryRequest) {
return binaryLocator; // depends on control dependency: [if], data = [none]
} else if (request instanceof ViewRequest) {
return viewLocator; // depends on control dependency: [if], data = [none]
} else if (request instanceof QueryRequest) {
return queryLocator; // depends on control dependency: [if], data = [none]
} else if (request instanceof ConfigRequest) {
return configLocator; // depends on control dependency: [if], data = [none]
} else if (request instanceof SearchRequest) {
return searchLocator; // depends on control dependency: [if], data = [none]
} else if (request instanceof AnalyticsRequest) {
return analyticsLocator; // depends on control dependency: [if], data = [none]
} else {
throw new IllegalArgumentException("Unknown Request Type: " + request);
}
} }
|
public class class_name {
@Override
public boolean route(RoutedMessage routedMessage) {
if (routedMessage == null) {
return true;
}
//There can be many Reader locks, but only one writer lock.
//This ReaderWriter lock is needed to avoid duplicate messages when the class is passing on the EarlyBuffer messages to the new WsLogHandler.
RERWLOCK.readLock().lock();
try {
// Cache message for WsLogHandlers that haven't registered yet.
if (earlierMessages != null) {
earlierMessages.add(routedMessage);
}
Set<String> routeAllMsgsToTheseLogHandlers = getLogHandlersForMsgId("*");
if (routeAllMsgsToTheseLogHandlers != null) {
routeToAll(routedMessage, routeAllMsgsToTheseLogHandlers);
}
Set<String> logHandlerIds = getLogHandlersForMessage(routedMessage.getFormattedMsg());
if (logHandlerIds == null) {
// There are no routing requirements for this msgId.
// Return true to tell the caller to log the msg normally.
return true;
} else {
// Ensure console doesn't duplicate printing specific message that included in wtoMessages=*
if(routeAllMsgsToTheseLogHandlers != null) {
if(!logHandlerIds.equals(routeAllMsgsToTheseLogHandlers)) {
Set<String> tempLogHandlerIds = new HashSet<String>();
for(String id : logHandlerIds) {
if(id.equals("DEFAULT") || id.equals("-DEFAULT") || id.equals("+DEFAULT") || !routeAllMsgsToTheseLogHandlers.contains(id)) {
tempLogHandlerIds.add(id);
}
}
return routeToAll(routedMessage, tempLogHandlerIds);
}else {
return true;
}
}else {
// Route to all LogHandlers in the wsLogHandlerService ConcurrentMap.
return routeToAll(routedMessage, logHandlerIds);
}
}
} finally {
RERWLOCK.readLock().unlock();
}
} }
|
public class class_name {
@Override
public boolean route(RoutedMessage routedMessage) {
if (routedMessage == null) {
return true; // depends on control dependency: [if], data = [none]
}
//There can be many Reader locks, but only one writer lock.
//This ReaderWriter lock is needed to avoid duplicate messages when the class is passing on the EarlyBuffer messages to the new WsLogHandler.
RERWLOCK.readLock().lock();
try {
// Cache message for WsLogHandlers that haven't registered yet.
if (earlierMessages != null) {
earlierMessages.add(routedMessage); // depends on control dependency: [if], data = [none]
}
Set<String> routeAllMsgsToTheseLogHandlers = getLogHandlersForMsgId("*");
if (routeAllMsgsToTheseLogHandlers != null) {
routeToAll(routedMessage, routeAllMsgsToTheseLogHandlers); // depends on control dependency: [if], data = [none]
}
Set<String> logHandlerIds = getLogHandlersForMessage(routedMessage.getFormattedMsg());
if (logHandlerIds == null) {
// There are no routing requirements for this msgId.
// Return true to tell the caller to log the msg normally.
return true; // depends on control dependency: [if], data = [none]
} else {
// Ensure console doesn't duplicate printing specific message that included in wtoMessages=*
if(routeAllMsgsToTheseLogHandlers != null) {
if(!logHandlerIds.equals(routeAllMsgsToTheseLogHandlers)) {
Set<String> tempLogHandlerIds = new HashSet<String>();
for(String id : logHandlerIds) {
if(id.equals("DEFAULT") || id.equals("-DEFAULT") || id.equals("+DEFAULT") || !routeAllMsgsToTheseLogHandlers.contains(id)) {
tempLogHandlerIds.add(id); // depends on control dependency: [if], data = [none]
}
}
return routeToAll(routedMessage, tempLogHandlerIds); // depends on control dependency: [if], data = [none]
}else {
return true; // depends on control dependency: [if], data = [none]
}
}else {
// Route to all LogHandlers in the wsLogHandlerService ConcurrentMap.
return routeToAll(routedMessage, logHandlerIds); // depends on control dependency: [if], data = [none]
}
}
} finally {
RERWLOCK.readLock().unlock();
}
} }
|
public class class_name {
public Owner setOwner() {
Element owner = setChild(root, "owner", childNames, false); //$NON-NLS-1$
Owner result = null;
try {
result = new Owner(owner);
} catch (MalformedElementException e) {
Assert.isTrue(false, Policy.bind("assert.internalError")); //$NON-NLS-1$
}
return result;
} }
|
public class class_name {
public Owner setOwner() {
Element owner = setChild(root, "owner", childNames, false); //$NON-NLS-1$
Owner result = null;
try {
result = new Owner(owner); // depends on control dependency: [try], data = [none]
} catch (MalformedElementException e) {
Assert.isTrue(false, Policy.bind("assert.internalError")); //$NON-NLS-1$
}
return result;
} } // depends on control dependency: [catch], data = [none]
|
public class class_name {
private void checkACL(String path, int perm) throws KeeperException.NoAuthException {
DataAndVersion node = _data.get(path);
if (node == null) {
return;
}
List<ACL> acl = node.getAcl();
if (acl == null || acl.size() == 0) {
return;
}
for (Id authId : _ids) {
if (authId.getScheme().equals("super")) {
return;
}
}
for (ACL a : acl) {
Id id = a.getId();
if ((a.getPerms() & perm) != 0) {
if (id.getScheme().equals("world") && id.getId().equals("anyone")) {
return;
}
for (Id authId : _ids) {
if (authId.getScheme().equals(id.getScheme()) && authId.getId().equals(id.getId())) {
return;
}
}
}
}
throw new KeeperException.NoAuthException();
} }
|
public class class_name {
private void checkACL(String path, int perm) throws KeeperException.NoAuthException {
DataAndVersion node = _data.get(path);
if (node == null) {
return;
}
List<ACL> acl = node.getAcl();
if (acl == null || acl.size() == 0) {
return;
}
for (Id authId : _ids) {
if (authId.getScheme().equals("super")) {
return; // depends on control dependency: [if], data = [none]
}
}
for (ACL a : acl) {
Id id = a.getId();
if ((a.getPerms() & perm) != 0) {
if (id.getScheme().equals("world") && id.getId().equals("anyone")) {
return; // depends on control dependency: [if], data = [none]
}
for (Id authId : _ids) {
if (authId.getScheme().equals(id.getScheme()) && authId.getId().equals(id.getId())) {
return; // depends on control dependency: [if], data = [none]
}
}
}
}
throw new KeeperException.NoAuthException();
} }
|
public class class_name {
@SuppressWarnings("signature") // conversion routine
public static @BinaryName String fieldDescriptorToBinaryName(String classname) {
if (classname.equals("")) {
throw new Error("Empty string passed to fieldDescriptorToBinaryName");
}
int dims = 0;
while (classname.startsWith("[")) {
dims++;
classname = classname.substring(1);
}
String result;
if (classname.startsWith("L") && classname.endsWith(";")) {
result = classname.substring(1, classname.length() - 1);
} else {
result = primitiveClassesFromJvm.get(classname);
if (result == null) {
throw new Error("Malformed base class: " + classname);
}
}
for (int i = 0; i < dims; i++) {
result += "[]";
}
return result.replace('/', '.');
} }
|
public class class_name {
@SuppressWarnings("signature") // conversion routine
public static @BinaryName String fieldDescriptorToBinaryName(String classname) {
if (classname.equals("")) {
throw new Error("Empty string passed to fieldDescriptorToBinaryName");
}
int dims = 0;
while (classname.startsWith("[")) {
dims++; // depends on control dependency: [while], data = [none]
classname = classname.substring(1); // depends on control dependency: [while], data = [none]
}
String result;
if (classname.startsWith("L") && classname.endsWith(";")) {
result = classname.substring(1, classname.length() - 1); // depends on control dependency: [if], data = [none]
} else {
result = primitiveClassesFromJvm.get(classname); // depends on control dependency: [if], data = [none]
if (result == null) {
throw new Error("Malformed base class: " + classname);
}
}
for (int i = 0; i < dims; i++) {
result += "[]"; // depends on control dependency: [for], data = [none]
}
return result.replace('/', '.');
} }
|
public class class_name {
public static double computeTauGammaAndDivide(final int start, final int stop,
final double[] x, final double max,
Complex_F64 tau) {
int index = start*2;
double nx = 0;
for (int i = start; i < stop; i++) {
double realX = x[index++] /= max;
double imagX = x[index++] /= max;
nx += realX * realX + imagX * imagX;
}
nx = Math.sqrt(nx);
double real_x0 = x[2*start];
double imag_x0 = x[2*start+1];
double mag_x0 = Math.sqrt(real_x0*real_x0 + imag_x0*imag_x0);
// TODO Could stability be improved by computing theta so that this
// special case doesn't need to be handled?
if( mag_x0 == 0 ) {
tau.real = nx;
tau.imaginary = 0;
} else {
tau.real = real_x0 / mag_x0 * nx;
tau.imaginary = imag_x0 / mag_x0 * nx;
}
double top,bottom;
// if there is a chance they can cancel swap the sign
// TODO not sure if this is right...
double m0 = mag(real_x0+tau.real , imag_x0+tau.imaginary);
double m1 = mag(real_x0-tau.real , imag_x0-tau.imaginary);
// if ( real_x0*tau.real<0) { // This is the previous rule until the m0 m1 code came into play
if ( m1 > m0 ) {
tau.real = -tau.real;
tau.imaginary = -tau.imaginary;
top = nx * nx - nx *mag_x0;
bottom = mag_x0*mag_x0 - 2.0* nx *mag_x0 + nx * nx;
} else {
top = nx * nx + nx *mag_x0;
bottom = mag_x0*mag_x0 + 2.0* nx *mag_x0 + nx * nx;
}
return bottom/top; // gamma
} }
|
public class class_name {
public static double computeTauGammaAndDivide(final int start, final int stop,
final double[] x, final double max,
Complex_F64 tau) {
int index = start*2;
double nx = 0;
for (int i = start; i < stop; i++) {
double realX = x[index++] /= max;
double imagX = x[index++] /= max;
nx += realX * realX + imagX * imagX; // depends on control dependency: [for], data = [none]
}
nx = Math.sqrt(nx);
double real_x0 = x[2*start];
double imag_x0 = x[2*start+1];
double mag_x0 = Math.sqrt(real_x0*real_x0 + imag_x0*imag_x0);
// TODO Could stability be improved by computing theta so that this
// special case doesn't need to be handled?
if( mag_x0 == 0 ) {
tau.real = nx; // depends on control dependency: [if], data = [none]
tau.imaginary = 0; // depends on control dependency: [if], data = [none]
} else {
tau.real = real_x0 / mag_x0 * nx; // depends on control dependency: [if], data = [none]
tau.imaginary = imag_x0 / mag_x0 * nx; // depends on control dependency: [if], data = [none]
}
double top,bottom;
// if there is a chance they can cancel swap the sign
// TODO not sure if this is right...
double m0 = mag(real_x0+tau.real , imag_x0+tau.imaginary);
double m1 = mag(real_x0-tau.real , imag_x0-tau.imaginary);
// if ( real_x0*tau.real<0) { // This is the previous rule until the m0 m1 code came into play
if ( m1 > m0 ) {
tau.real = -tau.real; // depends on control dependency: [if], data = [none]
tau.imaginary = -tau.imaginary; // depends on control dependency: [if], data = [none]
top = nx * nx - nx *mag_x0; // depends on control dependency: [if], data = [none]
bottom = mag_x0*mag_x0 - 2.0* nx *mag_x0 + nx * nx; // depends on control dependency: [if], data = [none]
} else {
top = nx * nx + nx *mag_x0; // depends on control dependency: [if], data = [none]
bottom = mag_x0*mag_x0 + 2.0* nx *mag_x0 + nx * nx; // depends on control dependency: [if], data = [none]
}
return bottom/top; // gamma
} }
|
public class class_name {
protected String getPreparedStatementText(ControlBeanContext context, Method m, Object[] args) {
StringBuilder sb = new StringBuilder();
for (SqlFragment frag : _children) {
boolean complexFragment = frag.hasComplexValue(context, m, args);
if (frag.hasParamValue() && !complexFragment) {
Object[] pValues = frag.getParameterValues(context, m, args);
for (Object o : pValues) {
sb.append(processSqlParams(o));
}
} else {
_hasParamValue |= complexFragment;
sb.append(frag.getPreparedStatementText(context, m, args));
}
}
return sb.toString();
} }
|
public class class_name {
protected String getPreparedStatementText(ControlBeanContext context, Method m, Object[] args) {
StringBuilder sb = new StringBuilder();
for (SqlFragment frag : _children) {
boolean complexFragment = frag.hasComplexValue(context, m, args);
if (frag.hasParamValue() && !complexFragment) {
Object[] pValues = frag.getParameterValues(context, m, args);
for (Object o : pValues) {
sb.append(processSqlParams(o)); // depends on control dependency: [for], data = [o]
}
} else {
_hasParamValue |= complexFragment; // depends on control dependency: [if], data = [none]
sb.append(frag.getPreparedStatementText(context, m, args)); // depends on control dependency: [if], data = [none]
}
}
return sb.toString();
} }
|
public class class_name {
public Object getObject(int idx) {
if (idx < 0) {
throw new IllegalArgumentException("Negative size: " + idx);
}
if (idx >= fields.size()) {
return null;
}
return fields.get(idx);
} }
|
public class class_name {
public Object getObject(int idx) {
if (idx < 0) {
throw new IllegalArgumentException("Negative size: " + idx);
}
if (idx >= fields.size()) {
return null; // depends on control dependency: [if], data = [none]
}
return fields.get(idx);
} }
|
public class class_name {
public static boolean fieldIsNonnull(Field field, AnnotationCache annotationCache) {
Class<?> type = field.getDeclaringClass();
if (annotationCache.hasFieldAnnotation(type, field.getName(), NONNULL)) {
return true;
}
if (annotationCache.hasFieldAnnotation(type, field.getName(), NULLABLE)) {
return false;
}
return annotationCache.hasClassAnnotation(type, FINDBUGS1X_DEFAULT_ANNOTATION_NONNULL) ||
annotationCache.hasClassAnnotation(type, JSR305_DEFAULT_ANNOTATION_NONNULL) ||
annotationCache.hasClassAnnotation(type, ECLIPSE_DEFAULT_ANNOTATION_NONNULL);
} }
|
public class class_name {
public static boolean fieldIsNonnull(Field field, AnnotationCache annotationCache) {
Class<?> type = field.getDeclaringClass();
if (annotationCache.hasFieldAnnotation(type, field.getName(), NONNULL)) {
return true; // depends on control dependency: [if], data = [none]
}
if (annotationCache.hasFieldAnnotation(type, field.getName(), NULLABLE)) {
return false; // depends on control dependency: [if], data = [none]
}
return annotationCache.hasClassAnnotation(type, FINDBUGS1X_DEFAULT_ANNOTATION_NONNULL) ||
annotationCache.hasClassAnnotation(type, JSR305_DEFAULT_ANNOTATION_NONNULL) ||
annotationCache.hasClassAnnotation(type, ECLIPSE_DEFAULT_ANNOTATION_NONNULL);
} }
|
public class class_name {
@Override
public void refresh() {
String url = mockupTypes.getUrl(mockupType);
if (mockupId == null || url == null) {
iframe.setSrc(null);
return;
}
iframe.setSrc(String.format(url, mockupId, System.currentTimeMillis()));
} }
|
public class class_name {
@Override
public void refresh() {
String url = mockupTypes.getUrl(mockupType);
if (mockupId == null || url == null) {
iframe.setSrc(null); // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
iframe.setSrc(String.format(url, mockupId, System.currentTimeMillis()));
} }
|
public class class_name {
@Override
public synchronized void dispatch(@NonNull Event event) {
String type = event.type;
List<EventHandlerWrapper> eventHandlers = subscribers.get(type);
if (eventHandlers != null) {
EventHandlerWrapper handler = null;
for (int i = 0, size = eventHandlers.size(); i < size; i++) {
handler = eventHandlers.get(i);
if (handler.eventHandlerReceiver != null) {
handler.handleEvent(event);
} else {
if (!TextUtils.isEmpty(handler.producer) && handler.producer.equals(event.sourceId)
|| TextUtils.isEmpty(handler.producer)) {
handler.handleEvent(event);
}
}
}
}
} }
|
public class class_name {
@Override
public synchronized void dispatch(@NonNull Event event) {
String type = event.type;
List<EventHandlerWrapper> eventHandlers = subscribers.get(type);
if (eventHandlers != null) {
EventHandlerWrapper handler = null;
for (int i = 0, size = eventHandlers.size(); i < size; i++) {
handler = eventHandlers.get(i); // depends on control dependency: [for], data = [i]
if (handler.eventHandlerReceiver != null) {
handler.handleEvent(event); // depends on control dependency: [if], data = [none]
} else {
if (!TextUtils.isEmpty(handler.producer) && handler.producer.equals(event.sourceId)
|| TextUtils.isEmpty(handler.producer)) {
handler.handleEvent(event); // depends on control dependency: [if], data = [han]
}
}
}
}
} }
|
public class class_name {
public static void scaleCol( double alpha , DMatrixRMaj A , int col ) {
int idx = col;
for (int row = 0; row < A.numRows; row++, idx += A.numCols) {
A.data[idx] *= alpha;
}
} }
|
public class class_name {
public static void scaleCol( double alpha , DMatrixRMaj A , int col ) {
int idx = col;
for (int row = 0; row < A.numRows; row++, idx += A.numCols) {
A.data[idx] *= alpha; // depends on control dependency: [for], data = [none]
}
} }
|
public class class_name {
protected void processConstraintsAndBinds(final RuleBuildContext context,
final PatternDescr patternDescr,
final Pattern pattern) {
MVELDumper.MVELDumperContext mvelCtx = new MVELDumper.MVELDumperContext().setRuleContext(context);
for (BaseDescr b : patternDescr.getDescrs()) {
String expression;
boolean isPositional = false;
if (b instanceof BindingDescr) {
BindingDescr bind = (BindingDescr) b;
expression = bind.getVariable() + (bind.isUnification() ? " := " : " : ") + bind.getExpression();
} else if (b instanceof ExprConstraintDescr) {
ExprConstraintDescr descr = (ExprConstraintDescr) b;
expression = descr.getExpression();
isPositional = descr.getType() == ExprConstraintDescr.Type.POSITIONAL;
} else {
expression = b.getText();
}
ConstraintConnectiveDescr result = parseExpression(context,
patternDescr,
b,
expression);
if (result == null) {
return;
}
isPositional &= !(result.getDescrs().size() == 1 && result.getDescrs().get(0) instanceof BindingDescr);
if (isPositional) {
processPositional(context,
patternDescr,
pattern,
(ExprConstraintDescr) b);
} else {
// need to build the actual constraint
List<Constraint> constraints = build(context, patternDescr, pattern, result, mvelCtx);
pattern.addConstraints(constraints);
}
}
TypeDeclaration typeDeclaration = getTypeDeclaration(pattern, context);
if (typeDeclaration != null && typeDeclaration.isPropertyReactive()) {
for (String field : context.getRuleDescr().lookAheadFieldsOfIdentifier(patternDescr)) {
addFieldToPatternWatchlist(pattern, typeDeclaration, field);
}
}
combineConstraints(context, pattern, mvelCtx);
} }
|
public class class_name {
protected void processConstraintsAndBinds(final RuleBuildContext context,
final PatternDescr patternDescr,
final Pattern pattern) {
MVELDumper.MVELDumperContext mvelCtx = new MVELDumper.MVELDumperContext().setRuleContext(context);
for (BaseDescr b : patternDescr.getDescrs()) {
String expression;
boolean isPositional = false;
if (b instanceof BindingDescr) {
BindingDescr bind = (BindingDescr) b;
expression = bind.getVariable() + (bind.isUnification() ? " := " : " : ") + bind.getExpression(); // depends on control dependency: [if], data = [none]
} else if (b instanceof ExprConstraintDescr) {
ExprConstraintDescr descr = (ExprConstraintDescr) b;
expression = descr.getExpression(); // depends on control dependency: [if], data = [none]
isPositional = descr.getType() == ExprConstraintDescr.Type.POSITIONAL; // depends on control dependency: [if], data = [none]
} else {
expression = b.getText(); // depends on control dependency: [if], data = [none]
}
ConstraintConnectiveDescr result = parseExpression(context,
patternDescr,
b,
expression);
if (result == null) {
return; // depends on control dependency: [if], data = [none]
}
isPositional &= !(result.getDescrs().size() == 1 && result.getDescrs().get(0) instanceof BindingDescr); // depends on control dependency: [for], data = [none]
if (isPositional) {
processPositional(context,
patternDescr,
pattern,
(ExprConstraintDescr) b); // depends on control dependency: [if], data = [none]
} else {
// need to build the actual constraint
List<Constraint> constraints = build(context, patternDescr, pattern, result, mvelCtx);
pattern.addConstraints(constraints); // depends on control dependency: [if], data = [none]
}
}
TypeDeclaration typeDeclaration = getTypeDeclaration(pattern, context);
if (typeDeclaration != null && typeDeclaration.isPropertyReactive()) {
for (String field : context.getRuleDescr().lookAheadFieldsOfIdentifier(patternDescr)) {
addFieldToPatternWatchlist(pattern, typeDeclaration, field); // depends on control dependency: [for], data = [field]
}
}
combineConstraints(context, pattern, mvelCtx);
} }
|
public class class_name {
private void getStringFromValue(final StringBuilder builder, final String directive, final String value) {
if (value != null) {
builder.append(directive).append(" ").append(value).append(";");
}
} }
|
public class class_name {
private void getStringFromValue(final StringBuilder builder, final String directive, final String value) {
if (value != null) {
builder.append(directive).append(" ").append(value).append(";"); // depends on control dependency: [if], data = [(value]
}
} }
|
public class class_name {
boolean addBusStop(BusStop busStop, boolean fireEvents) {
if (busStop == null) {
return false;
}
if (this.busStops.indexOf(busStop) != -1) {
return false;
}
if (!this.busStops.add(busStop)) {
return false;
}
busStop.addBusHub(this);
resetBoundingBox();
if (fireEvents) {
firePrimitiveChanged(new BusChangeEvent(this,
BusChangeEventType.STOP_ADDED,
busStop,
this.busStops.size() - 1,
null,
null,
null));
checkPrimitiveValidity();
}
return true;
} }
|
public class class_name {
boolean addBusStop(BusStop busStop, boolean fireEvents) {
if (busStop == null) {
return false; // depends on control dependency: [if], data = [none]
}
if (this.busStops.indexOf(busStop) != -1) {
return false; // depends on control dependency: [if], data = [none]
}
if (!this.busStops.add(busStop)) {
return false; // depends on control dependency: [if], data = [none]
}
busStop.addBusHub(this);
resetBoundingBox();
if (fireEvents) {
firePrimitiveChanged(new BusChangeEvent(this,
BusChangeEventType.STOP_ADDED,
busStop,
this.busStops.size() - 1,
null,
null,
null)); // depends on control dependency: [if], data = [none]
checkPrimitiveValidity(); // depends on control dependency: [if], data = [none]
}
return true;
} }
|
public class class_name {
public void notifyServletContextAttrAdded(String name, Object value) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
logger.logp(Level.FINE, CLASS_NAME, "notifyServletContextAttrAdded", "ENTRY"); //PI26908
// need to notify listeners registered in the
// ServletContextAttributeListener array
if (!servletContextLAttrListeners.isEmpty()) {
// We run the risk of getting a concurrent modification
Iterator i = servletContextLAttrListeners.iterator();
ServletContextAttributeEvent sEvent = new ServletContextAttributeEvent(this.getFacade(), name, value);
while (i.hasNext()) {
// get the listener
ServletContextAttributeListener sL = (ServletContextAttributeListener) i.next();
// invoke the listener's attr added method
sL.attributeAdded(sEvent);
}
}
} }
|
public class class_name {
public void notifyServletContextAttrAdded(String name, Object value) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
logger.logp(Level.FINE, CLASS_NAME, "notifyServletContextAttrAdded", "ENTRY"); //PI26908
// need to notify listeners registered in the
// ServletContextAttributeListener array
if (!servletContextLAttrListeners.isEmpty()) {
// We run the risk of getting a concurrent modification
Iterator i = servletContextLAttrListeners.iterator();
ServletContextAttributeEvent sEvent = new ServletContextAttributeEvent(this.getFacade(), name, value);
while (i.hasNext()) {
// get the listener
ServletContextAttributeListener sL = (ServletContextAttributeListener) i.next();
// invoke the listener's attr added method
sL.attributeAdded(sEvent); // depends on control dependency: [while], data = [none]
}
}
} }
|
public class class_name {
private void remove(CacheElement.CacheFile want) {
want.remove();
files.remove(want.ncfile);
try {
want.ncfile.setFileCache(null); // unhook the caching
want.ncfile.close();
} catch (IOException e) {
log.error("close failed on "+want.ncfile.getLocation(), e);
}
want.ncfile = null;
} }
|
public class class_name {
private void remove(CacheElement.CacheFile want) {
want.remove();
files.remove(want.ncfile);
try {
want.ncfile.setFileCache(null); // unhook the caching
// depends on control dependency: [try], data = [none]
want.ncfile.close();
// depends on control dependency: [try], data = [none]
} catch (IOException e) {
log.error("close failed on "+want.ncfile.getLocation(), e);
}
// depends on control dependency: [catch], data = [none]
want.ncfile = null;
} }
|
public class class_name {
protected void processGeneratedValue(EntityTable entityTable, EntityColumn entityColumn, GeneratedValue generatedValue) {
if ("JDBC".equals(generatedValue.generator())) {
entityColumn.setIdentity(true);
entityColumn.setGenerator("JDBC");
entityTable.setKeyProperties(entityColumn.getProperty());
entityTable.setKeyColumns(entityColumn.getColumn());
} else {
//允许通过generator来设置获取id的sql,例如mysql=CALL IDENTITY(),hsqldb=SELECT SCOPE_IDENTITY()
//允许通过拦截器参数设置公共的generator
if (generatedValue.strategy() == GenerationType.IDENTITY) {
//mysql的自动增长
entityColumn.setIdentity(true);
if (!"".equals(generatedValue.generator())) {
String generator = null;
IdentityDialect identityDialect = IdentityDialect.getDatabaseDialect(generatedValue.generator());
if (identityDialect != null) {
generator = identityDialect.getIdentityRetrievalStatement();
} else {
generator = generatedValue.generator();
}
entityColumn.setGenerator(generator);
}
} else {
throw new MapperException(entityColumn.getProperty()
+ " - 该字段@GeneratedValue配置只允许以下几种形式:" +
"\n1.useGeneratedKeys的@GeneratedValue(generator=\\\"JDBC\\\") " +
"\n2.类似mysql数据库的@GeneratedValue(strategy=GenerationType.IDENTITY[,generator=\"Mysql\"])");
}
}
} }
|
public class class_name {
protected void processGeneratedValue(EntityTable entityTable, EntityColumn entityColumn, GeneratedValue generatedValue) {
if ("JDBC".equals(generatedValue.generator())) {
entityColumn.setIdentity(true); // depends on control dependency: [if], data = [none]
entityColumn.setGenerator("JDBC"); // depends on control dependency: [if], data = [none]
entityTable.setKeyProperties(entityColumn.getProperty()); // depends on control dependency: [if], data = [none]
entityTable.setKeyColumns(entityColumn.getColumn()); // depends on control dependency: [if], data = [none]
} else {
//允许通过generator来设置获取id的sql,例如mysql=CALL IDENTITY(),hsqldb=SELECT SCOPE_IDENTITY()
//允许通过拦截器参数设置公共的generator
if (generatedValue.strategy() == GenerationType.IDENTITY) {
//mysql的自动增长
entityColumn.setIdentity(true); // depends on control dependency: [if], data = [none]
if (!"".equals(generatedValue.generator())) {
String generator = null;
IdentityDialect identityDialect = IdentityDialect.getDatabaseDialect(generatedValue.generator());
if (identityDialect != null) {
generator = identityDialect.getIdentityRetrievalStatement(); // depends on control dependency: [if], data = [none]
} else {
generator = generatedValue.generator(); // depends on control dependency: [if], data = [none]
}
entityColumn.setGenerator(generator); // depends on control dependency: [if], data = [none]
}
} else {
throw new MapperException(entityColumn.getProperty()
+ " - 该字段@GeneratedValue配置只允许以下几种形式:" +
"\n1.useGeneratedKeys的@GeneratedValue(generator=\\\"JDBC\\\") " +
"\n2.类似mysql数据库的@GeneratedValue(strategy=GenerationType.IDENTITY[,generator=\"Mysql\"])");
}
}
} }
|
public class class_name {
private Set<String> validateURL(ValidationHelper helper, Context context, String url) {
String pathToCheck = url;
Set<String> serverVariables = new HashSet<String>();
while (pathToCheck.contains("{")) {
if (!pathToCheck.contains("}")) {
final String message = Tr.formatMessage(tc, "serverInvalidURL", pathToCheck);
helper.addValidationEvent(new ValidationEvent(ValidationEvent.Severity.ERROR, context.getLocation("url"), message));
return serverVariables;
}
int firstIndex = pathToCheck.indexOf("{");
int lastIndex = pathToCheck.indexOf("}");
if (firstIndex > lastIndex) {
final String message = Tr.formatMessage(tc, "serverInvalidURL", pathToCheck);
helper.addValidationEvent(new ValidationEvent(ValidationEvent.Severity.ERROR, context.getLocation("url"), message));
return serverVariables;
}
String variable = pathToCheck.substring(firstIndex + 1, lastIndex);
if (variable.isEmpty() || variable.contains("{") || variable.contains("/")) {
final String message = Tr.formatMessage(tc, "serverInvalidURL", pathToCheck);
helper.addValidationEvent(new ValidationEvent(ValidationEvent.Severity.ERROR, context.getLocation("url"), message));
return serverVariables;
}
serverVariables.add(variable);
pathToCheck = pathToCheck.substring(lastIndex + 1);
}
if (pathToCheck.contains("}")) {
final String message = Tr.formatMessage(tc, "serverInvalidURL", pathToCheck);
helper.addValidationEvent(new ValidationEvent(ValidationEvent.Severity.ERROR, context.getLocation("url"), message));
return serverVariables;
}
return serverVariables;
} }
|
public class class_name {
private Set<String> validateURL(ValidationHelper helper, Context context, String url) {
String pathToCheck = url;
Set<String> serverVariables = new HashSet<String>();
while (pathToCheck.contains("{")) {
if (!pathToCheck.contains("}")) {
final String message = Tr.formatMessage(tc, "serverInvalidURL", pathToCheck);
helper.addValidationEvent(new ValidationEvent(ValidationEvent.Severity.ERROR, context.getLocation("url"), message)); // depends on control dependency: [if], data = [none]
return serverVariables; // depends on control dependency: [if], data = [none]
}
int firstIndex = pathToCheck.indexOf("{");
int lastIndex = pathToCheck.indexOf("}");
if (firstIndex > lastIndex) {
final String message = Tr.formatMessage(tc, "serverInvalidURL", pathToCheck);
helper.addValidationEvent(new ValidationEvent(ValidationEvent.Severity.ERROR, context.getLocation("url"), message)); // depends on control dependency: [if], data = [none]
return serverVariables; // depends on control dependency: [if], data = [none]
}
String variable = pathToCheck.substring(firstIndex + 1, lastIndex);
if (variable.isEmpty() || variable.contains("{") || variable.contains("/")) {
final String message = Tr.formatMessage(tc, "serverInvalidURL", pathToCheck);
helper.addValidationEvent(new ValidationEvent(ValidationEvent.Severity.ERROR, context.getLocation("url"), message)); // depends on control dependency: [if], data = [none]
return serverVariables; // depends on control dependency: [if], data = [none]
}
serverVariables.add(variable); // depends on control dependency: [while], data = [none]
pathToCheck = pathToCheck.substring(lastIndex + 1); // depends on control dependency: [while], data = [none]
}
if (pathToCheck.contains("}")) {
final String message = Tr.formatMessage(tc, "serverInvalidURL", pathToCheck);
helper.addValidationEvent(new ValidationEvent(ValidationEvent.Severity.ERROR, context.getLocation("url"), message)); // depends on control dependency: [if], data = [none]
return serverVariables; // depends on control dependency: [if], data = [none]
}
return serverVariables;
} }
|
public class class_name {
@Override
public boolean registerIdentification(Identifiable identifiable) {
if (identifiable == null || identifiable.getID() == null || identifiable.getID().isEmpty()) return false;
if (registered.containsValue(identifiable) || registered.containsKey(identifiable.getID())) {
return false;
}
registered.put(identifiable.getID(), identifiable);
return true;
} }
|
public class class_name {
@Override
public boolean registerIdentification(Identifiable identifiable) {
if (identifiable == null || identifiable.getID() == null || identifiable.getID().isEmpty()) return false;
if (registered.containsValue(identifiable) || registered.containsKey(identifiable.getID())) {
return false; // depends on control dependency: [if], data = [none]
}
registered.put(identifiable.getID(), identifiable);
return true;
} }
|
public class class_name {
public static Collection<IAction> getRegisteredActions(ActionScope scope) {
Map<String, IAction> actions = new HashMap<>();
if (scope == ActionScope.BOTH || scope == ActionScope.GLOBAL) {
actions.putAll(getRegistry(true).map);
}
if (scope == ActionScope.BOTH || scope == ActionScope.LOCAL) {
actions.putAll(getRegistry(false).map);
}
return actions.values();
} }
|
public class class_name {
public static Collection<IAction> getRegisteredActions(ActionScope scope) {
Map<String, IAction> actions = new HashMap<>();
if (scope == ActionScope.BOTH || scope == ActionScope.GLOBAL) {
actions.putAll(getRegistry(true).map); // depends on control dependency: [if], data = [none]
}
if (scope == ActionScope.BOTH || scope == ActionScope.LOCAL) {
actions.putAll(getRegistry(false).map); // depends on control dependency: [if], data = [none]
}
return actions.values();
} }
|
public class class_name {
public void replaceUuid(SIBUuid8 newUuid, Transaction transaction) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "replaceUuid", new Object[] {newUuid, transaction});
if (messagingEngineUuid.toString().equals(SIMPConstants.UNKNOWN_UUID))
{
messagingEngineUuid = newUuid;
try
{
requestUpdate(transaction);
}
catch(MessageStoreException e)
{
// MessageStoreException shouldn't occur so FFDC.
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.store.itemstreams.PtoPMessageItemStream.replaceUuid",
"1:720:1.93.1.14",
this);
SibTr.exception(tc, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "replaceUuid", e);
throw new SIResourceException(e);
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "replaceUuid");
return;
} }
|
public class class_name {
public void replaceUuid(SIBUuid8 newUuid, Transaction transaction) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "replaceUuid", new Object[] {newUuid, transaction});
if (messagingEngineUuid.toString().equals(SIMPConstants.UNKNOWN_UUID))
{
messagingEngineUuid = newUuid; // depends on control dependency: [if], data = [none]
try
{
requestUpdate(transaction); // depends on control dependency: [try], data = [none]
}
catch(MessageStoreException e)
{
// MessageStoreException shouldn't occur so FFDC.
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.store.itemstreams.PtoPMessageItemStream.replaceUuid",
"1:720:1.93.1.14",
this);
SibTr.exception(tc, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "replaceUuid", e);
throw new SIResourceException(e);
} // depends on control dependency: [catch], data = [none]
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "replaceUuid");
return;
} }
|
public class class_name {
private List parseAggregatedResponse(SearchResponse response, KunderaQuery query, MetamodelImpl metaModel,
Class clazz, EntityMetadata entityMetadata)
{
List results, temp = new ArrayList<>();
InternalAggregations internalAggs = ((InternalFilter) response.getAggregations().getAsMap()
.get(ESConstants.AGGREGATION_NAME)).getAggregations();
if (query.isSelectStatement() && KunderaQueryUtils.hasGroupBy(query.getJpqlExpression()))
{
Terms buckets = (Terms) (internalAggs).getAsMap().get(ESConstants.GROUP_BY);
filterBuckets(buckets, query);
results = onIterateBuckets(buckets, query, metaModel, clazz, entityMetadata);
}
else
{
results = new ArrayList<>();
temp = buildRecords(internalAggs, response.getHits(), query, metaModel, clazz, entityMetadata);
for (Object value : temp)
{
if (!value.toString().equalsIgnoreCase(ESConstants.INFINITY))
{
results.add(value);
}
}
}
return results;
} }
|
public class class_name {
private List parseAggregatedResponse(SearchResponse response, KunderaQuery query, MetamodelImpl metaModel,
Class clazz, EntityMetadata entityMetadata)
{
List results, temp = new ArrayList<>();
InternalAggregations internalAggs = ((InternalFilter) response.getAggregations().getAsMap()
.get(ESConstants.AGGREGATION_NAME)).getAggregations();
if (query.isSelectStatement() && KunderaQueryUtils.hasGroupBy(query.getJpqlExpression()))
{
Terms buckets = (Terms) (internalAggs).getAsMap().get(ESConstants.GROUP_BY);
filterBuckets(buckets, query); // depends on control dependency: [if], data = [none]
results = onIterateBuckets(buckets, query, metaModel, clazz, entityMetadata); // depends on control dependency: [if], data = [none]
}
else
{
results = new ArrayList<>(); // depends on control dependency: [if], data = [none]
temp = buildRecords(internalAggs, response.getHits(), query, metaModel, clazz, entityMetadata); // depends on control dependency: [if], data = [none]
for (Object value : temp)
{
if (!value.toString().equalsIgnoreCase(ESConstants.INFINITY))
{
results.add(value); // depends on control dependency: [if], data = [none]
}
}
}
return results;
} }
|
public class class_name {
private void stepDown() {
if (context.getLeader() != null && context.getLeader().equals(context.getCluster().member())) {
context.setLeader(0);
}
} }
|
public class class_name {
private void stepDown() {
if (context.getLeader() != null && context.getLeader().equals(context.getCluster().member())) {
context.setLeader(0); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public static void OuterProductUpdate(Matrix A, Vec x, Vec y, double c)
{
if (x.length() != A.rows() || y.length() != A.cols())
throw new ArithmeticException("Matrix dimensions do not agree with outer product");
if (x.isSparse())
for (IndexValue iv : x)
A.updateRow(iv.getIndex(), iv.getValue() * c, y);
else
for (int i = 0; i < x.length(); i++)
{
double rowCosnt = c * x.get(i);
A.updateRow(i, rowCosnt, y);
}
} }
|
public class class_name {
public static void OuterProductUpdate(Matrix A, Vec x, Vec y, double c)
{
if (x.length() != A.rows() || y.length() != A.cols())
throw new ArithmeticException("Matrix dimensions do not agree with outer product");
if (x.isSparse())
for (IndexValue iv : x)
A.updateRow(iv.getIndex(), iv.getValue() * c, y);
else
for (int i = 0; i < x.length(); i++)
{
double rowCosnt = c * x.get(i);
A.updateRow(i, rowCosnt, y); // depends on control dependency: [for], data = [i]
}
} }
|
public class class_name {
public <T extends IEvaluation> Map<Integer, T[]> evaluate(MultiDataSetIterator iterator, Map<Integer,T[]> evaluations){
try{
return doEvaluationHelper(iterator, evaluations);
} catch (OutOfMemoryError e){
CrashReportingUtil.writeMemoryCrashDump(this, e);
throw e;
}
} }
|
public class class_name {
public <T extends IEvaluation> Map<Integer, T[]> evaluate(MultiDataSetIterator iterator, Map<Integer,T[]> evaluations){
try{
return doEvaluationHelper(iterator, evaluations); // depends on control dependency: [try], data = [none]
} catch (OutOfMemoryError e){
CrashReportingUtil.writeMemoryCrashDump(this, e);
throw e;
} // depends on control dependency: [catch], data = [none]
} }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.