_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q16600
LongArrays.insertEntry
train
public static long[] insertEntry(long[] a, int idx, long val) { long[] b = new long[a.length + 1]; for (int i = 0; i < b.length; i++) { if (i < idx) { b[i] = a[i]; } else if (i == idx) { b[idx] = val; } else { b[i] = a[i...
java
{ "resource": "" }
q16601
HelpTopicNode.getIndex
train
public int getIndex() { if (parent != null) { for (int i = 0; i < parent.children.size(); i++) { if (parent.children.get(i) == this) { return i; } } } return -1; }
java
{ "resource": "" }
q16602
HelpTopicNode.getNextSibling
train
public HelpTopicNode getNextSibling() { int i = getIndex() + 1; return i == 0 || i == parent.children.size() ? null : parent.children.get(i); }
java
{ "resource": "" }
q16603
HelpTopicNode.getPreviousSibling
train
public HelpTopicNode getPreviousSibling() { int i = getIndex() - 1; return i < 0 ? null : parent.children.get(i); }
java
{ "resource": "" }
q16604
HelpTopicNode.addChild
train
public void addChild(HelpTopicNode node, int index) { node.detach(); node.parent = this; if (index < 0) { children.add(node); } else { children.add(index, node); } }
java
{ "resource": "" }
q16605
DialogControl.create
train
public static DialogControl<String> create(String message, String title, String styles, String responses, String excludeResponses, String defaultResponse, String saveResponseId, IPromptCallback<String> callback) { retu...
java
{ "resource": "" }
q16606
DialogControl.getLastResponse
train
public DialogResponse<T> getLastResponse() { String saved = saveResponseId == null ? null : PropertyUtil.getValue(SAVED_RESPONSE_PROP_NAME, saveResponseId); int i = NumberUtils.toInt(saved, -1); DialogResponse<T> response = i < 0 || i >= responses.size() ? null : responses.get(i); return...
java
{ "resource": "" }
q16607
DialogControl.saveLastResponse
train
public void saveLastResponse(DialogResponse<T> response) { if (saveResponseId != null && (response == null || !response.isExcluded())) { int index = response == null ? -1 : responses.indexOf(response); PropertyUtil.saveValue(SAVED_RESPONSE_PROP_NAME, saveResponseId, false, ...
java
{ "resource": "" }
q16608
LongArrayList.uniq
train
public void uniq() { if (size <= 1) { return; } int cursor = 0; for (int i=1; i<size; i++) { if (elements[cursor] != elements[i]) { cursor++; elements[cursor] = elements[i]; } } size = cursor+1; }
java
{ "resource": "" }
q16609
TypeConversion.selfConvert
train
private static Object selfConvert( String parsingMethod, String value, Class<?> type ) { try { Method method = type.getMethod( parsingMethod, String.class ); return method.invoke( null, value ); } catch (InvocationTargetException e) { throw...
java
{ "resource": "" }
q16610
S2SDateTimeServiceImpl.convertDateToCalendar
train
@Override public Calendar convertDateToCalendar(java.util.Date date) { Calendar calendar = null; if (date != null) { calendar = Calendar.getInstance(); calendar.setTime(date); calendar.clear(Calendar.ZONE_OFFSET); calendar.clear(Calendar.DST_OFFSET); ...
java
{ "resource": "" }
q16611
HelpConverterMojo.execute
train
@Override public void execute() throws MojoExecutionException { if (StringUtils.isEmpty(moduleSource) && ignoreMissingSource) { getLog().info("No help module source specified."); return; } init("help", moduleBase); registerLoader(new SourceLo...
java
{ "resource": "" }
q16612
HelpConverterMojo.registerExternalLoaders
train
private void registerExternalLoaders() throws MojoExecutionException { if (archiveLoaders != null) { for (String entry : archiveLoaders) { try { SourceLoader loader = (SourceLoader) Class.forName(entry).newInstance(); registerLoader(loader); ...
java
{ "resource": "" }
q16613
DigitalSignature.verify
train
public boolean verify(String base64Signature, String content, String timestamp) throws Exception { return verify(base64Signature, content, timestamp, keyName); }
java
{ "resource": "" }
q16614
SessionController.create
train
protected static SessionController create(String sessionId, boolean originator) { Map<String, Object> args = new HashMap<>(); args.put("id", sessionId); args.put("title", StrUtil.formatMessage("@cwf.chat.session.title")); args.put("originator", originator ? true : null); Window d...
java
{ "resource": "" }
q16615
SessionController.afterInitialized
train
@Override public void afterInitialized(BaseComponent comp) { super.afterInitialized(comp); window = (Window) comp; sessionId = (String) comp.getAttribute("id"); lstParticipants.setRenderer(new ParticipantRenderer(chatService.getSelf(), null)); model.add(chatService.getSelf())...
java
{ "resource": "" }
q16616
DateRangeChooser.findMatchingItem
train
public Listitem findMatchingItem(String label) { for (Listitem item : getChildren(Listitem.class)) { if (label.equalsIgnoreCase(item.getLabel())) { return item; } } return null; }
java
{ "resource": "" }
q16617
DateRangeChooser.getStartDate
train
public Date getStartDate() { DateRange range = getSelectedRange(); return range == null ? null : range.getStartDate(); }
java
{ "resource": "" }
q16618
DateRangeChooser.getEndDate
train
public Date getEndDate() { DateRange range = getSelectedRange(); return range == null ? null : range.getEndDate(); }
java
{ "resource": "" }
q16619
CompilationFailureException.shortMessage
train
public static String shortMessage( List<CompilerError> messages ) { StringBuffer sb = new StringBuffer(); sb.append( "Compilation failure" ); if ( messages.size() == 1 ) { sb.append( LS ); CompilerError compilerError = (CompilerError) messages.get( 0 ); ...
java
{ "resource": "" }
q16620
S2SBaseFormGenerator.sortAttachments
train
public void sortAttachments(ByteArrayInputStream byteArrayInputStream) { List<String> attachmentNameList = new ArrayList<>(); List<AttachmentData> attacmentList = getAttachments(); List<AttachmentData> tempAttacmentList = new ArrayList<>(); try{ DocumentBuilderFacto...
java
{ "resource": "" }
q16621
LongDoubleUnsortedVector.hasBadValues
train
public boolean hasBadValues() { for(int i=0; i<top; i++) { double v = vals[i]; boolean bad = Double.isNaN(v) || Double.isInfinite(v); if(bad) return true; } return false; }
java
{ "resource": "" }
q16622
ServerDetails.setCharsetName
train
public void setCharsetName(final String charsetName) { if(Charset.isSupported(charsetName)) { this.charsetName = charsetName; } else { throw new UnsupportedCharsetException("No support for, " + charsetName + ", is available in this instance of the JVM"); } }
java
{ "resource": "" }
q16623
AbstractPubSubHub.serialize
train
protected byte[] serialize(IMessage<ID, DATA> msg) { return msg != null ? SerializationUtils.toByteArray(msg) : null; }
java
{ "resource": "" }
q16624
AbstractPubSubHub.deserialize
train
protected <T extends IMessage<ID, DATA>> T deserialize(byte[] msgData, Class<T> clazz) { return msgData != null ? SerializationUtils.fromByteArray(msgData, clazz) : null; }
java
{ "resource": "" }
q16625
FilteredQueryService.filteredResult
train
private IQueryResult<T> filteredResult(IQueryResult<T> unfilteredResult) { List<T> unfilteredList = unfilteredResult.getResults(); List<T> filteredList = unfilteredList == null ? null : filters.filter(unfilteredList); Map<String, Object> metadata = Collections.<String, Object> singletonMap("unfi...
java
{ "resource": "" }
q16626
SpringContextUtils.contextMergedBeans
train
public static ApplicationContext contextMergedBeans(String xmlPath, Map<String, ?> extraBeans) { final DefaultListableBeanFactory parentBeanFactory = buildListableBeanFactory(extraBeans); //loads the xml and add definitions in the context GenericApplicationContext parentContext = new GenericApplicationConte...
java
{ "resource": "" }
q16627
SpringContextUtils.contextMergedBeans
train
public static ApplicationContext contextMergedBeans(Map<String, ?> extraBeans, Class<?> config) { final DefaultListableBeanFactory parentBeanFactory = buildListableBeanFactory(extraBeans); //loads the annotation classes and add definitions in the context GenericApplicationContext parent...
java
{ "resource": "" }
q16628
SpringContextUtils.setProperties
train
private static void setProperties(GenericApplicationContext newContext, Properties properties) { PropertiesPropertySource pps = new PropertiesPropertySource("external-props", properties); newContext.getEnvironment().getPropertySources().addFirst(pps); }
java
{ "resource": "" }
q16629
SpringContextUtils.buildListableBeanFactory
train
private static DefaultListableBeanFactory buildListableBeanFactory(Map<String, ?> extraBeans) { //new empty context final DefaultListableBeanFactory parentBeanFactory = new DefaultListableBeanFactory(); //Injection of the new beans in the context for (String key : extraBeans.k...
java
{ "resource": "" }
q16630
RRFedNonFedBudgetBaseGenerator.validateBudgetForForm
train
protected boolean validateBudgetForForm(ProposalDevelopmentDocumentContract pdDoc) throws S2SException { boolean valid = true; ProposalDevelopmentBudgetExtContract budget = s2SCommonBudgetService.getBudget(pdDoc.getDevelopmentProposal()); if(budget != null) { for (BudgetPeriodContra...
java
{ "resource": "" }
q16631
StopWatchFactory.create
train
public static IStopWatch create() { if (factory == null) { throw new IllegalStateException("No stopwatch factory registered."); } try { return factory.clazz.newInstance(); } catch (Exception e) { throw new RuntimeException("Could not create st...
java
{ "resource": "" }
q16632
StopWatchFactory.create
train
public static IStopWatch create(String tag, Map<String, Object> data) { IStopWatch sw = create(); sw.init(tag, data); return sw; }
java
{ "resource": "" }
q16633
RRFedNonFedBudgetV1_0Generator.getCumulativeTravels
train
private CumulativeTravels getCumulativeTravels(BudgetSummaryDto budgetSummaryData) { CumulativeTravels cumulativeTravels = CumulativeTravels.Factory.newInstance(); SummaryDataType summary = SummaryDataType.Factory.newInstance(); if (budgetSummaryData != null) { if (budgetSummaryData...
java
{ "resource": "" }
q16634
RRFedNonFedBudgetV1_0Generator.getGraduateStudents
train
private GraduateStudents getGraduateStudents(OtherPersonnelDto otherPersonnel) { GraduateStudents graduate = GraduateStudents.Factory.newInstance(); if (otherPersonnel != null) { graduate.setNumberOfPersonnel(otherPersonnel.getNumberPersonnel()); graduate.setProjectRole(otherPer...
java
{ "resource": "" }
q16635
RRFedNonFedBudgetV1_0Generator.getUndergraduateStudents
train
private UndergraduateStudents getUndergraduateStudents(OtherPersonnelDto otherPersonnel) { UndergraduateStudents undergraduate = UndergraduateStudents.Factory.newInstance(); if (otherPersonnel != null) { undergraduate.setNumberOfPersonnel(otherPersonnel.getNumberPersonnel()); un...
java
{ "resource": "" }
q16636
RRFedNonFedBudgetV1_0Generator.getOthersForOtherDirectCosts
train
private Others getOthersForOtherDirectCosts(BudgetPeriodDto periodInfo) { Others othersDirect = Others.Factory.newInstance(); if (periodInfo != null && periodInfo.getOtherDirectCosts() != null) { Others.Other otherArray[] = new Others.Other[periodInfo.getOtherDirectCosts().size()]; ...
java
{ "resource": "" }
q16637
ThemeUtil.applyThemeClass
train
public static void applyThemeClass(BaseUIComponent component, IThemeClass... themeClasses) { StringBuilder sb = new StringBuilder(); for (IThemeClass themeClass : themeClasses) { String cls = themeClass == null ? null : themeClass.getThemeClass(); if (cls != null) { ...
java
{ "resource": "" }
q16638
PluginDefinition.setUrl
train
public void setUrl(String url) { this.url = url; if (clazz == null && url != null) { setClazz(ElementPlugin.class); } }
java
{ "resource": "" }
q16639
PluginDefinition.getResources
train
@SuppressWarnings("unchecked") public <E extends IPluginResource> List<E> getResources(Class<E> clazz) { List<E> list = new ArrayList<>(); for (IPluginResource resource : resources) { if (clazz.isInstance(resource)) { list.add((E) resource); } } ...
java
{ "resource": "" }
q16640
PluginDefinition.setClazz
train
public void setClazz(Class<? extends ElementBase> clazz) { this.clazz = clazz; try { // Force execution of static initializers Class.forName(clazz.getName()); } catch (ClassNotFoundException e) { MiscUtil.toUnchecked(e); } }
java
{ "resource": "" }
q16641
PluginDefinition.isForbidden
train
public boolean isForbidden() { if (authorities.size() == 0) { return false; // If no restrictions, return false } boolean result = true; for (Authority priv : authorities) { result = !SecurityUtil.isGranted(priv.name); if (requiresAll == result) { ...
java
{ "resource": "" }
q16642
PluginDefinition.setPath
train
public void setPath(String path) { if (path != null) { manifest = ManifestIterator.getInstance().findByPath(path); } }
java
{ "resource": "" }
q16643
PluginDefinition.getValueWithDefault
train
private String getValueWithDefault(String value, String manifestKey) { if (StringUtils.isEmpty(value) && manifest != null) { value = manifest.getMainAttributes().getValue(manifestKey); } return value; }
java
{ "resource": "" }
q16644
PluginDefinition.createElement
train
public ElementBase createElement(ElementBase parent, IPropertyProvider propertyProvider, boolean deserializing) { try { ElementBase element = null; if (isForbidden()) { log.info("Access to plugin " + getName() + " is restricted."); } else if (isDisabled()) { ...
java
{ "resource": "" }
q16645
PluginDefinition.initElement
train
public void initElement(ElementBase element, IPropertyProvider propertyProvider) { if (propertyProvider != null) { for (PropertyInfo propInfo : getProperties()) { String key = propInfo.getId(); if (propertyProvider.hasProperty(key)) { String value...
java
{ "resource": "" }
q16646
PersonGenerator.nextPerson
train
public Person nextPerson() { if(!initialized) { init(); } Person person = new Person(); Gender gender = this.gender == null ? (random.nextBoolean() ? Gender.FEMALE : Gender.MALE) : this.gender; person.setGender(gender); List<String> givenNamesPool = gender == Gender.FEMALE ? givenFemaleNames : givenMaleNames...
java
{ "resource": "" }
q16647
PersonGenerator.nextPeople
train
public List<Person> nextPeople(int num) { List<Person> names = new ArrayList<Person>(num); for(int i = 0; i < num; i++) { names.add(nextPerson()); } return names; }
java
{ "resource": "" }
q16648
ContextMarshaller.marshal
train
public String marshal(ContextItems contextItems) { SimpleDateFormat timestampFormat = new SimpleDateFormat("yyyyMMddHHmmssz"); contextItems.setItem(PROPNAME_TIME, timestampFormat.format(new Date())); contextItems.setItem(PROPNAME_KEY, signer.getKeyName()); return contextItems.toString();...
java
{ "resource": "" }
q16649
ContextMarshaller.unmarshal
train
public ContextItems unmarshal(String marshaledContext, String authSignature) throws Exception { ContextItems contextItems = new ContextItems(); contextItems.addItems(marshaledContext); String whichKey = contextItems.getItem(PROPNAME_KEY); String timestamp = contextItems.getItem(PROPNAME_...
java
{ "resource": "" }
q16650
RRFedNonFedBudgetV1_1Generator.getTravel
train
private Travel getTravel(BudgetPeriodDto periodInfo) { Travel travel = Travel.Factory.newInstance(); if (periodInfo != null) { TotalDataType total = TotalDataType.Factory.newInstance(); if (periodInfo.getDomesticTravelCost() != null) { total.setFederal(periodInfo...
java
{ "resource": "" }
q16651
IntArrays.count
train
public static int count(int[] array, int value) { int count = 0; for (int i = 0; i < array.length; i++) { if (array[i] == value) { count++; } } return count; }
java
{ "resource": "" }
q16652
IntArrays.reorder
train
public static void reorder(int[] array, int[] order) { int[] original = copyOf(array); for (int i = 0; i < array.length; i++) { array[i] = original[order[i]]; } }
java
{ "resource": "" }
q16653
IntArrays.countUnique
train
public static int countUnique(int[] indices1, int[] indices2) { int numUniqueIndices = 0; int i = 0; int j = 0; while (i < indices1.length && j < indices2.length) { if (indices1[i] < indices2[j]) { numUniqueIndices++; i++; } else if...
java
{ "resource": "" }
q16654
ActionTypeRegistry.getType
train
public static IActionType<?> getType(String script) { for (IActionType<?> actionType : instance) { if (actionType.matches(script)) { return actionType; } } throw new IllegalArgumentException("Script type was not recognized: " + script); }
java
{ "resource": "" }
q16655
MongoUtils.collectionExists
train
public static boolean collectionExists(MongoDatabase db, String collectionName) { return db.listCollections().filter(Filters.eq("name", collectionName)).first() != null; }
java
{ "resource": "" }
q16656
MongoUtils.createCollection
train
public static MongoCollection<Document> createCollection(MongoDatabase db, String collectionName, CreateCollectionOptions options) { db.createCollection(collectionName, options); return db.getCollection(collectionName); }
java
{ "resource": "" }
q16657
ElementBase.registerAllowedParentClass
train
protected static synchronized void registerAllowedParentClass(Class<? extends ElementBase> clazz, Class<? extends ElementBase> parentClass) { allowedParentClasses.addCardinality(clazz, parentClass, 1); }
java
{ "resource": "" }
q16658
ElementBase.registerAllowedChildClass
train
protected static synchronized void registerAllowedChildClass(Class<? extends ElementBase> clazz, Class<? extends ElementBase> childClass, int maxOccurrences) { allowedChildClasses.ad...
java
{ "resource": "" }
q16659
ElementBase.canAcceptChild
train
public static boolean canAcceptChild(Class<? extends ElementBase> parentClass, Class<? extends ElementBase> childClass) { return allowedChildClasses.isRelated(parentClass, childClass); }
java
{ "resource": "" }
q16660
ElementBase.canAcceptParent
train
public static boolean canAcceptParent(Class<? extends ElementBase> childClass, Class<? extends ElementBase> parentClass) { return allowedParentClasses.isRelated(childClass, parentClass); }
java
{ "resource": "" }
q16661
ElementBase.addChild
train
protected void addChild(ElementBase child, boolean doEvent) { if (!child.canAcceptParent(this)) { CWFException.raise(child.rejectReason); } if (!canAcceptChild(child)) { CWFException.raise(rejectReason); } if (doEvent) { befor...
java
{ "resource": "" }
q16662
ElementBase.removeChild
train
public void removeChild(ElementBase child, boolean destroy) { if (!children.contains(child)) { return; } boolean isLocked = child.isLocked() || child.getDefinition().isInternal(); if (destroy) { child.removeChildren(); if...
java
{ "resource": "" }
q16663
ElementBase.updateParent
train
private void updateParent(ElementBase newParent) { ElementBase oldParent = this.parent; if (oldParent != newParent) { beforeParentChanged(newParent); this.parent = newParent; if (oldParent != null) { oldParent.updateState(); ...
java
{ "resource": "" }
q16664
ElementBase.removeChildren
train
public void removeChildren() { for (int i = children.size() - 1; i >= 0; i--) { removeChild(children.get(i), true); } }
java
{ "resource": "" }
q16665
ElementBase.setDefinition
train
public void setDefinition(PluginDefinition definition) { if (this.definition != null) { if (this.definition == definition) { return; } CWFException.raise("Cannot modify plugin definition."); } this.definition = definition;...
java
{ "resource": "" }
q16666
ElementBase.setDesignMode
train
public void setDesignMode(boolean designMode) { this.designMode = designMode; for (ElementBase child : children) { child.setDesignMode(designMode); } updateState(); }
java
{ "resource": "" }
q16667
ElementBase.editProperties
train
public void editProperties() { try { PropertyGrid.create(this, null); } catch (Exception e) { DialogUtil.showError("Displaying property grid: \r\n" + e.toString()); } }
java
{ "resource": "" }
q16668
ElementBase.getChild
train
@SuppressWarnings("unchecked") public <T extends ElementBase> T getChild(Class<T> clazz, ElementBase last) { int i = last == null ? -1 : children.indexOf(last); for (i++; i < children.size(); i++) { if (clazz.isInstance(children.get(i))) { return (T) children.get...
java
{ "resource": "" }
q16669
ElementBase.getChildren
train
public <T extends ElementBase> Iterable<T> getChildren(Class<T> clazz) { return MiscUtil.iterableForType(children, clazz); }
java
{ "resource": "" }
q16670
ElementBase.getChildCount
train
public int getChildCount(Class<? extends ElementBase> clazz) { if (clazz == ElementBase.class) { return getChildCount(); } int count = 0; for (ElementBase child : children) { if (clazz.isInstance(child)) { count++; } ...
java
{ "resource": "" }
q16671
ElementBase.findChildElement
train
@SuppressWarnings("unchecked") public <T extends ElementBase> T findChildElement(Class<T> clazz) { for (ElementBase child : getChildren()) { if (clazz.isInstance(child)) { return (T) child; } } for (ElementBase child : getChildren()) { ...
java
{ "resource": "" }
q16672
ElementBase.hasAncestor
train
public boolean hasAncestor(ElementBase element) { ElementBase child = this; while (child != null) { if (element.hasChild(child)) { return true; } child = child.getParent(); } return false; }
java
{ "resource": "" }
q16673
ElementBase.moveChild
train
public void moveChild(int from, int to) { if (from != to) { ElementBase child = children.get(from); ElementBase ref = children.get(to); children.remove(from); to = children.indexOf(ref); children.add(to, child); afterMoveChild(child, ref); ...
java
{ "resource": "" }
q16674
ElementBase.setIndex
train
public void setIndex(int index) { ElementBase parent = getParent(); if (parent == null) { CWFException.raise("Element has no parent."); } int currentIndex = parent.children.indexOf(this); if (currentIndex < 0 || currentIndex == index) { ...
java
{ "resource": "" }
q16675
ElementBase.moveChild
train
protected void moveChild(BaseUIComponent child, BaseUIComponent before) { child.getParent().addChild(child, before); }
java
{ "resource": "" }
q16676
ElementBase.canAcceptChild
train
public boolean canAcceptChild() { if (maxChildren == 0) { rejectReason = getDisplayName() + " does not accept any children."; } else if (getChildCount() >= maxChildren) { rejectReason = "Maximum child count exceeded for " + getDisplayName() + "."; } else { rej...
java
{ "resource": "" }
q16677
ElementBase.canAcceptChild
train
public boolean canAcceptChild(Class<? extends ElementBase> childClass) { if (!canAcceptChild()) { return false; } Cardinality cardinality = allowedChildClasses.getCardinality(getClass(), childClass); int max = cardinality.getMaxOccurrences(); if (max == 0) {...
java
{ "resource": "" }
q16678
ElementBase.canAcceptParent
train
public boolean canAcceptParent(Class<? extends ElementBase> clazz) { if (!canAcceptParent(getClass(), clazz)) { rejectReason = getDisplayName() + " does not accept " + clazz.getSimpleName() + " as a parent."; } else { rejectReason = null; } return rejectR...
java
{ "resource": "" }
q16679
ElementBase.canAcceptParent
train
public boolean canAcceptParent(ElementBase parent) { if (!canAcceptParent()) { return false; } if (!canAcceptParent(getClass(), parent.getClass())) { rejectReason = getDisplayName() + " does not accept " + parent.getDisplayName() + " as a parent."; } else...
java
{ "resource": "" }
q16680
ElementBase.getRoot
train
public ElementBase getRoot() { ElementBase root = this; while (root.getParent() != null) { root = root.getParent(); } return root; }
java
{ "resource": "" }
q16681
ElementBase.getAncestor
train
@SuppressWarnings("unchecked") public <T extends ElementBase> T getAncestor(Class<T> clazz) { ElementBase parent = getParent(); while (parent != null && !clazz.isInstance(parent)) { parent = parent.getParent(); } return (T) parent; }
java
{ "resource": "" }
q16682
ElementBase.processResources
train
private void processResources(boolean register) { CareWebShell shell = CareWebUtil.getShell(); for (IPluginResource resource : getDefinition().getResources()) { resource.register(shell, this, register); } }
java
{ "resource": "" }
q16683
ElementBase.notifyParent
train
public void notifyParent(String eventName, Object eventData, boolean recurse) { ElementBase ele = parent; while (ele != null) { recurse &= ele.parentListeners.notify(this, eventName, eventData); ele = recurse ? ele.parent : null; } }
java
{ "resource": "" }
q16684
ElementBase.notifyChildren
train
public void notifyChildren(String eventName, Object eventData, boolean recurse) { notifyChildren(this, eventName, eventData, recurse); }
java
{ "resource": "" }
q16685
InfoPanelService.searchChildren
train
private static IInfoPanel searchChildren(ElementBase parent, ElementBase exclude, boolean activeOnly) { IInfoPanel infoPanel = null; if (parent != null) { for (ElementBase child : parent.getChildren()) { if ((child != exclude) && ((infoPanel = getInfoPanel(child, act...
java
{ "resource": "" }
q16686
InfoPanelService.getInfoPanel
train
private static IInfoPanel getInfoPanel(ElementBase element, boolean activeOnly) { if (element instanceof ElementPlugin) { ElementPlugin plugin = (ElementPlugin) element; if ((!activeOnly || plugin.isActivated()) && (plugin.getDefinition().getId().equals("infoPanelPlugin"))) ...
java
{ "resource": "" }
q16687
InfoPanelService.associateEvent
train
public static void associateEvent(BaseComponent component, String eventName, Action action) { getActionListeners(component, true).add(new ActionListener(eventName, action)); }
java
{ "resource": "" }
q16688
InfoPanelService.getActionListeners
train
private static List<ActionListener> getActionListeners(BaseComponent component, boolean forceCreate) { @SuppressWarnings("unchecked") List<ActionListener> ActionListeners = (List<ActionListener>) component.getAttribute(EVENT_LISTENER_ATTR); if (ActionListeners == null && forceCreate) { ...
java
{ "resource": "" }
q16689
S2SValidatorServiceImpl.validate
train
@Override public boolean validate(XmlObject formObject, List<AuditError> errors, String formName) { final List<String> formErrors = new ArrayList<>(); final boolean result = validateXml(formObject, formErrors); errors.addAll(formErrors.stream() .map(validationError -> s2SEr...
java
{ "resource": "" }
q16690
JdbcQueue.resetRetryCounter
train
public Map<String, Long> resetRetryCounter() { Map<String, Long> result = retryCounter.asMap(); retryCounter.clear(); return result; }
java
{ "resource": "" }
q16691
JdbcQueue._queueWithRetries
train
protected boolean _queueWithRetries(Connection conn, IQueueMessage<ID, DATA> msg, int numRetries, int maxRetries) { try { Date now = new Date(); msg.setNumRequeues(0).setQueueTimestamp(now).setTimestamp(now); return putToQueueStorage(conn, msg); } catch (D...
java
{ "resource": "" }
q16692
JdbcQueue._requeueWithRetries
train
protected boolean _requeueWithRetries(Connection conn, IQueueMessage<ID, DATA> msg, int numRetries, int maxRetries) { try { jdbcHelper.startTransaction(conn); conn.setTransactionIsolation(transactionIsolationLevel); if (!isEphemeralDisabled()) { re...
java
{ "resource": "" }
q16693
JdbcQueue._finishWithRetries
train
protected void _finishWithRetries(Connection conn, IQueueMessage<ID, DATA> msg, int numRetries, int maxRetries) { try { if (!isEphemeralDisabled()) { removeFromEphemeralStorage(conn, msg); } } catch (DaoException de) { if (de.getCause() ins...
java
{ "resource": "" }
q16694
JdbcQueue._takeWithRetries
train
protected IQueueMessage<ID, DATA> _takeWithRetries(Connection conn, int numRetries, int maxRetries) { try { jdbcHelper.startTransaction(conn); conn.setTransactionIsolation(transactionIsolationLevel); boolean result = true; IQueueMessage<ID, DATA> msg ...
java
{ "resource": "" }
q16695
PHS398FellowshipSupplementalV1_1Generator.setQuestionnareAnswerForResearchTrainingPlan
train
private void setQuestionnareAnswerForResearchTrainingPlan( ResearchTrainingPlan researchTrainingPlan) { researchTrainingPlan.setHumanSubjectsIndefinite(YesNoDataType.N_NO); researchTrainingPlan.setVertebrateAnimalsIndefinite(YesNoDataType.N_NO); researchTrainingPlan.setHumanSubjectsIndefinite(Ye...
java
{ "resource": "" }
q16696
AliasType.transformKey
train
private String transformKey(String key, String src, String tgt) { StringBuilder sb = new StringBuilder(); String[] srcTokens = src.split(WILDCARD_DELIM_REGEX); String[] tgtTokens = tgt.split(WILDCARD_DELIM_REGEX); int len = Math.max(srcTokens.length, tgtTokens.length); int pos = ...
java
{ "resource": "" }
q16697
ElementTreeView.afterMoveChild
train
@Override protected void afterMoveChild(ElementBase child, ElementBase before) { ElementTreePane childpane = (ElementTreePane) child; ElementTreePane beforepane = (ElementTreePane) before; moveChild(childpane.getNode(), beforepane.getNode()); }
java
{ "resource": "" }
q16698
ElementTreeView.setSelectionStyle
train
public void setSelectionStyle(ThemeUtil.ButtonStyle selectionStyle) { if (activePane != null) { activePane.updateSelectionStyle(this.selectionStyle, selectionStyle); } this.selectionStyle = selectionStyle; }
java
{ "resource": "" }
q16699
ElementTreeView.afterRemoveChild
train
@Override protected void afterRemoveChild(ElementBase child) { if (child == activePane) { setActivePane((ElementTreePane) getFirstChild()); } super.afterRemoveChild(child); }
java
{ "resource": "" }