_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3 values | text stringlengths 73 34.1k | language stringclasses 1 value | meta_information dict |
|---|---|---|---|---|---|
q178400 | Feedindex.getFeed | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11")
public List<Feedindex.Feed> getFeed() {
if (feed == null) {
feed = new ArrayList<Feedindex.Feed>();
}
return this.feed;
} | java | {
"resource": ""
} |
q178401 | Moebliert.setMoeb | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public void setMoeb(Moebliert.Moeb value) {
this.moeb = value;
} | java | {
"resource": ""
} |
q178402 | Ausstattung.getServiceleistungen | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
public List<Serviceleistungen> getServiceleistungen() {
if (serviceleistungen == null) {
serviceleistungen = new ArrayList<Serviceleistungen>();
}
return this.serviceleistungen;
} | java | {
"resource": ""
} |
q178403 | LocationStructure.setSubAdministrativeArea | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
public void setSubAdministrativeArea(LocationStructure.SubAdministrativeArea value) {
this.subAdministrativeArea = value;
} | java | {
"resource": ""
} |
q178404 | LocationStructure.setCity | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
public void setCity(LocationStructure.City value) {
this.city = value;
} | java | {
"resource": ""
} |
q178405 | LocationStructure.setLocality | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
public void setLocality(LocationStructure.Locality value) {
this.locality = value;
} | java | {
"resource": ""
} |
q178406 | OpenImmo_1_2_1.downgradeToPreviousVersion | test | @Override
public void downgradeToPreviousVersion(OpenImmoDocument doc) {
doc.setDocumentVersion(OpenImmoVersion.V1_2_0);
if (doc instanceof OpenImmoTransferDocument) {
try {
this.removeObjektartZusatzElements(doc.getDocument());
} catch (Exception ex) {
LOGGER.error("Can't remove <objektart_zusatz> elements!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
}
try {
this.downgradeEnergiepassElements(doc.getDocument());
} catch (Exception ex) {
LOGGER.error("Can't downgrade <energiepass> elements!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
}
try {
this.downgradeHausElements(doc.getDocument());
} catch (Exception ex) {
LOGGER.error("Can't downgrade <haus> elements!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
}
}
try {
this.downgradeXmlNamespace(doc.getDocument());
} catch (Exception ex) {
LOGGER.error("Can't downgrade the XML namespace!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
}
} | java | {
"resource": ""
} |
q178407 | OpenImmo_1_2_1.upgradeFromPreviousVersion | test | @Override
@SuppressWarnings("Duplicates")
public void upgradeFromPreviousVersion(OpenImmoDocument doc) {
doc.setDocumentVersion(OpenImmoVersion.V1_2_1);
if (doc instanceof OpenImmoTransferDocument) {
try {
this.upgradeEnergiepassElements(doc.getDocument());
} catch (Exception ex) {
LOGGER.error("Can't upgrade <energiepass> elements!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
}
}
try {
this.upgradeXmlNamespace(doc.getDocument());
} catch (Exception ex) {
LOGGER.error("Can't upgrade the XML namespace!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
}
} | java | {
"resource": ""
} |
q178408 | LandUndForstwirtschaft.setLandTyp | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public void setLandTyp(LandUndForstwirtschaft.LandTyp value) {
this.landTyp = value;
} | java | {
"resource": ""
} |
q178409 | MetaDataType.getFIELD | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:42:33+02:00", comments = "JAXB RI v2.2.11")
public List<MetaDataType.FIELD> getFIELD() {
if (field == null) {
field = new ArrayList<MetaDataType.FIELD>();
}
return this.field;
} | java | {
"resource": ""
} |
q178410 | OpenImmo_1_2_0.upgradeFromPreviousVersion | test | @Override
public void upgradeFromPreviousVersion(OpenImmoDocument doc) {
doc.setDocumentVersion(OpenImmoVersion.V1_2_0);
if (doc instanceof OpenImmoTransferDocument) {
try {
this.upgradeMieteinnahmenElements(doc.getDocument());
} catch (Exception ex) {
LOGGER.error("Can't upgrade <mieteinnahmen_ist> and <mieteinnahmen_soll> elements!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
}
}
} | java | {
"resource": ""
} |
q178411 | Trovit.getAd | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:55:25+02:00", comments = "JAXB RI v2.2.11")
public List<AdType> getAd() {
if (ad == null) {
ad = new ArrayList<AdType>();
}
return this.ad;
} | java | {
"resource": ""
} |
q178412 | Gastgewerbe.setGastgewTyp | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public void setGastgewTyp(Gastgewerbe.GastgewTyp value) {
this.gastgewTyp = value;
} | java | {
"resource": ""
} |
q178413 | StpSonstige.setPlatzart | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
public void setPlatzart(StpSonstige.Platzart value) {
this.platzart = value;
} | java | {
"resource": ""
} |
q178414 | BueroPraxisTyp.getDatenVerkabelung | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
public DatenVerkabelungsTyp getDatenVerkabelung() {
if (datenVerkabelung == null) {
return DatenVerkabelungsTyp.KEINE_ANGABE;
} else {
return datenVerkabelung;
}
} | java | {
"resource": ""
} |
q178415 | BueroPraxisTyp.getKlimaanlage | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
public JaNeinVereinbarungTyp getKlimaanlage() {
if (klimaanlage == null) {
return JaNeinVereinbarungTyp.KEINE_ANGABE;
} else {
return klimaanlage;
}
} | java | {
"resource": ""
} |
q178416 | ImagesType.getImage | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T01:43:04+02:00", comments = "JAXB RI v2.2.11")
public List<ImagesType.Image> getImage() {
if (image == null) {
image = new ArrayList<ImagesType.Image>();
}
return this.image;
} | java | {
"resource": ""
} |
q178417 | OverseasSaleAdType.setPriceType | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11")
public void setPriceType(OverseasSaleAdType.PriceType value) {
this.priceType = value;
} | java | {
"resource": ""
} |
q178418 | OverseasSaleAdType.setNewDevelopmentAvailability | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11")
public void setNewDevelopmentAvailability(java.lang.String value) {
this.newDevelopmentAvailability = value;
} | java | {
"resource": ""
} |
q178419 | OverseasSaleAdType.setDirections | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11")
public void setDirections(java.lang.String value) {
this.directions = value;
} | java | {
"resource": ""
} |
q178420 | OverseasSaleAdType.setCo2Rating | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11")
public void setCo2Rating(java.lang.String value) {
this.co2Rating = value;
} | java | {
"resource": ""
} |
q178421 | OverseasSaleAdType.setEnergyRating | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11")
public void setEnergyRating(java.lang.String value) {
this.energyRating = value;
} | java | {
"resource": ""
} |
q178422 | OverseasSaleAdType.setViewingDetails | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11")
public void setViewingDetails(java.lang.String value) {
this.viewingDetails = value;
} | java | {
"resource": ""
} |
q178423 | OverseasSaleAdType.setPropertyStatus | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11")
public void setPropertyStatus(OverseasSaleAdType.PropertyStatus value) {
this.propertyStatus = value;
} | java | {
"resource": ""
} |
q178424 | AdType.setPictures | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:55:25+02:00", comments = "JAXB RI v2.2.11")
public void setPictures(AdType.Pictures value) {
this.pictures = value;
} | java | {
"resource": ""
} |
q178425 | BebaubarNach.setBebaubarAttr | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
public void setBebaubarAttr(BebaubarNach.BebaubarAttr value) {
this.bebaubarAttr = value;
} | java | {
"resource": ""
} |
q178426 | OpenImmo_1_2_4.upgradeFromPreviousVersion | test | @Override
public void upgradeFromPreviousVersion(OpenImmoDocument doc) {
doc.setDocumentVersion(OpenImmoVersion.V1_2_4);
if (doc instanceof OpenImmoTransferDocument) {
try {
this.upgradeAnzahlBalkonTerrassenElements(doc.getDocument());
} catch (Exception ex) {
LOGGER.error("Can't upgrade <anzahl_balkon_terrassen> elements!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
}
try {
this.upgradeAnhangElements(doc.getDocument());
} catch (Exception ex) {
LOGGER.error("Can't upgrade <anhang> elements!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
}
try {
this.upgradeSonstigeElements(doc.getDocument());
} catch (Exception ex) {
LOGGER.error("Can't upgrade <sonstige> elements!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
}
}
} | java | {
"resource": ""
} |
q178427 | Parken.setParkenTyp | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public void setParkenTyp(Parken.ParkenTyp value) {
this.parkenTyp = value;
} | java | {
"resource": ""
} |
q178428 | Alter.setAlterAttr | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public void setAlterAttr(Alter.AlterAttr value) {
this.alterAttr = value;
} | java | {
"resource": ""
} |
q178429 | FreizeitimmobilieGewerblich.setFreizeitTyp | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
public void setFreizeitTyp(FreizeitimmobilieGewerblich.FreizeitTyp value) {
this.freizeitTyp = value;
} | java | {
"resource": ""
} |
q178430 | TelSonstige.setTelefonart | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public void setTelefonart(TelSonstige.Telefonart value) {
this.telefonart = value;
} | java | {
"resource": ""
} |
q178431 | EmailSonstige.setEmailart | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public void setEmailart(EmailSonstige.Emailart value) {
this.emailart = value;
} | java | {
"resource": ""
} |
q178432 | Daft.setOverseasSales | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11")
public void setOverseasSales(Daft.OverseasSales value) {
this.overseasSales = value;
} | java | {
"resource": ""
} |
q178433 | Daft.setOverseasRental | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11")
public void setOverseasRental(Daft.OverseasRental value) {
this.overseasRental = value;
} | java | {
"resource": ""
} |
q178434 | OpenImmoUtils.createUserDefinedSimplefield | test | @SuppressWarnings("Duplicates")
public static Element createUserDefinedSimplefield(Document doc, String name, String value) {
Element root = XmlUtils.getRootElement(doc);
Element node = doc.createElementNS(root.getNamespaceURI(), "user_defined_simplefield");
node.setAttribute("feldname", name);
node.setTextContent(value);
return node;
} | java | {
"resource": ""
} |
q178435 | Fehlerliste.getFehler | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public List<Fehlerliste.Fehler> getFehler() {
if (fehler == null) {
fehler = new ArrayList<Fehlerliste.Fehler>();
}
return this.fehler;
} | java | {
"resource": ""
} |
q178436 | VermarktungGrundstueckGewerbeTyp.setErbpacht | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
public void setErbpacht(JAXBElement<VermarktungGrundstueckGewerbeTyp.Erbpacht> value) {
this.erbpacht = value;
} | java | {
"resource": ""
} |
q178437 | Preise.getStpSonstige | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public List<StpSonstige> getStpSonstige() {
if (stpSonstige == null) {
stpSonstige = new ArrayList<StpSonstige>();
}
return this.stpSonstige;
} | java | {
"resource": ""
} |
q178438 | ValueListsType.getVALUELIST | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:42:33+02:00", comments = "JAXB RI v2.2.11")
public List<ValueListsType.VALUELIST> getVALUELIST() {
if (valuelist == null) {
valuelist = new ArrayList<ValueListsType.VALUELIST>();
}
return this.valuelist;
} | java | {
"resource": ""
} |
q178439 | MinMietdauer.setMinDauer | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public void setMinDauer(MinMietdauer.MinDauer value) {
this.minDauer = value;
} | java | {
"resource": ""
} |
q178440 | ZinshausRenditeobjekt.setZinsTyp | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
public void setZinsTyp(ZinshausRenditeobjekt.ZinsTyp value) {
this.zinsTyp = value;
} | java | {
"resource": ""
} |
q178441 | PhotosType.getPhoto | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11")
public List<URI> getPhoto() {
if (photo == null) {
photo = new ArrayList<URI>();
}
return this.photo;
} | java | {
"resource": ""
} |
q178442 | Feed.setMetadata | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
public void setMetadata(Feed.Metadata value) {
this.metadata = value;
} | java | {
"resource": ""
} |
q178443 | Feed.setProjects | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
public void setProjects(Feed.Projects value) {
this.projects = value;
} | java | {
"resource": ""
} |
q178444 | Feed.setProperties | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
public void setProperties(Feed.Properties value) {
this.properties = value;
} | java | {
"resource": ""
} |
q178445 | Kyero_3.downgradeToPreviousVersion | test | @Override
public void downgradeToPreviousVersion(KyeroDocument doc) {
doc.setDocumentVersion(KyeroVersion.V2_1);
try {
this.downgradeNewBuildElements(doc.getDocument());
} catch (Exception ex) {
LOGGER.error("Can't downgrade <new_build> elements!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
}
try {
this.downgradeTypeElements(doc.getDocument());
} catch (Exception ex) {
LOGGER.error("Can't downgrade <type> elements!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
}
try {
this.downgradeUrlElements(doc.getDocument());
} catch (Exception ex) {
LOGGER.error("Can't downgrade <url> elements!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
}
try {
this.removeLocationElements(doc.getDocument());
} catch (Exception ex) {
LOGGER.error("Can't remove <location> elements!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
}
try {
this.removeEnergyRatingElements(doc.getDocument());
} catch (Exception ex) {
LOGGER.error("Can't remove <energy_rating> elements!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
}
try {
this.removeNotesElements(doc.getDocument());
} catch (Exception ex) {
LOGGER.error("Can't remove <notes> elements!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
}
try {
this.removeUnsupportedLanguageElements(doc.getDocument());
} catch (Exception ex) {
LOGGER.error("Can't remove unsupported translation elements!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
}
} | java | {
"resource": ""
} |
q178446 | Kyero_3.upgradeFromPreviousVersion | test | @Override
public void upgradeFromPreviousVersion(KyeroDocument doc) {
doc.setDocumentVersion(KyeroVersion.V3);
try {
this.removeCustomElements(doc.getDocument());
} catch (Exception ex) {
LOGGER.error("Can't remove <custom> elements!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
}
try {
this.upgradeNewBuildElements(doc.getDocument());
} catch (Exception ex) {
LOGGER.error("Can't upgrade <new_build> elements!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
}
try {
this.upgradeTypeElements(doc.getDocument());
} catch (Exception ex) {
LOGGER.error("Can't upgrade <type> elements!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
}
try {
this.upgradeCurrencyElements(doc.getDocument());
} catch (Exception ex) {
LOGGER.error("Can't upgrade <currency> elements!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
}
try {
this.upgradeUrlElements(doc.getDocument());
} catch (Exception ex) {
LOGGER.error("Can't upgrade <url> elements!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
}
} | java | {
"resource": ""
} |
q178447 | Anbieter.getImmobilie | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
public List<Immobilie> getImmobilie() {
if (immobilie == null) {
immobilie = new ArrayList<Immobilie>();
}
return this.immobilie;
} | java | {
"resource": ""
} |
q178448 | OpenimmoFeedback.getObjekt | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public List<Objekt> getObjekt() {
if (objekt == null) {
objekt = new ArrayList<Objekt>();
}
return this.objekt;
} | java | {
"resource": ""
} |
q178449 | OpenimmoFeedback.getFehlerliste | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public List<Fehlerliste> getFehlerliste() {
if (fehlerliste == null) {
fehlerliste = new ArrayList<Fehlerliste>();
}
return this.fehlerliste;
} | java | {
"resource": ""
} |
q178450 | OpenimmoFeedback.getStatus | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public List<Status> getStatus() {
if (status == null) {
status = new ArrayList<Status>();
}
return this.status;
} | java | {
"resource": ""
} |
q178451 | Sonstige.setSonstigeTyp | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
public void setSonstigeTyp(Sonstige.SonstigeTyp value) {
this.sonstigeTyp = value;
} | java | {
"resource": ""
} |
q178452 | Distanzen.setDistanzZu | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public void setDistanzZu(Distanzen.DistanzZu value) {
this.distanzZu = value;
} | java | {
"resource": ""
} |
q178453 | Infrastruktur.getDistanzen | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public List<Distanzen> getDistanzen() {
if (distanzen == null) {
distanzen = new ArrayList<Distanzen>();
}
return this.distanzen;
} | java | {
"resource": ""
} |
q178454 | Infrastruktur.getDistanzenSport | test | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public List<DistanzenSport> getDistanzenSport() {
if (distanzenSport == null) {
distanzenSport = new ArrayList<DistanzenSport>();
}
return this.distanzenSport;
} | java | {
"resource": ""
} |
q178455 | ObjectUtils.isCompatibleWithThrowsClause | test | public static boolean isCompatibleWithThrowsClause(Throwable ex, Class<?>[] declaredExceptions) {
if (!isCheckedException(ex)) {
return true;
}
if (declaredExceptions != null) {
int i = 0;
while (i < declaredExceptions.length) {
if (declaredExceptions[i].isAssignableFrom(ex.getClass())) {
return true;
}
i++;
}
}
return false;
} | java | {
"resource": ""
} |
q178456 | SimpleNamespaceContext.setBindings | test | public void setBindings(Map<String, String> bindings) {
for (Map.Entry<String, String> entry : bindings.entrySet()) {
bindNamespaceUri(entry.getKey(), entry.getValue());
}
} | java | {
"resource": ""
} |
q178457 | SimpleNamespaceContext.bindNamespaceUri | test | public void bindNamespaceUri(String prefix, String namespaceUri) {
Assert.notNull(prefix, "No prefix given");
Assert.notNull(namespaceUri, "No namespaceUri given");
if (XMLConstants.DEFAULT_NS_PREFIX.equals(prefix)) {
defaultNamespaceUri = namespaceUri;
} else {
prefixToNamespaceUri.put(prefix, namespaceUri);
getPrefixesInternal(namespaceUri).add(prefix);
}
} | java | {
"resource": ""
} |
q178458 | SimpleNamespaceContext.removeBinding | test | public void removeBinding(String prefix) {
if (XMLConstants.DEFAULT_NS_PREFIX.equals(prefix)) {
defaultNamespaceUri = "";
} else {
String namespaceUri = prefixToNamespaceUri.remove(prefix);
List<String> prefixes = getPrefixesInternal(namespaceUri);
prefixes.remove(prefix);
}
} | java | {
"resource": ""
} |
q178459 | XmlValidationModeDetector.hasOpeningTag | test | private boolean hasOpeningTag(String content) {
if (this.inComment) {
return false;
}
int openTagIndex = content.indexOf('<');
return (openTagIndex > -1 && content.length() > openTagIndex && Character.isLetter(content.charAt(openTagIndex + 1)));
} | java | {
"resource": ""
} |
q178460 | XmlValidationModeDetector.consumeCommentTokens | test | private String consumeCommentTokens(String line) {
if (line.indexOf(START_COMMENT) == -1 && line.indexOf(END_COMMENT) == -1) {
return line;
}
while ((line = consume(line)) != null) {
if (!this.inComment && !line.trim().startsWith(START_COMMENT)) {
return line;
}
}
return line;
} | java | {
"resource": ""
} |
q178461 | XmlValidationModeDetector.consume | test | private String consume(String line) {
int index = (this.inComment ? endComment(line) : startComment(line));
return (index == -1 ? null : line.substring(index));
} | java | {
"resource": ""
} |
q178462 | XmlValidationModeDetector.commentToken | test | private int commentToken(String line, String token, boolean inCommentIfPresent) {
int index = line.indexOf(token);
if (index > -1) {
this.inComment = inCommentIfPresent;
}
return (index == -1 ? index : index + token.length());
} | java | {
"resource": ""
} |
q178463 | Log4jConfigurer.initLogging | test | public static void initLogging(String location) throws FileNotFoundException {
String resolvedLocation = SystemPropertyUtils.resolvePlaceholders(location);
URL url = ResourceUtils.getURL(resolvedLocation);
if (resolvedLocation.toLowerCase().endsWith(XML_FILE_EXTENSION)) {
DOMConfigurator.configure(url);
} else {
PropertyConfigurator.configure(url);
}
} | java | {
"resource": ""
} |
q178464 | AbstractStaxContentHandler.startPrefixMapping | test | @Override
public final void startPrefixMapping(String prefix, String uri) {
namespaceContext.bindNamespaceUri(prefix, uri);
namespaceContextChanged = true;
} | java | {
"resource": ""
} |
q178465 | CompositeIterator.add | test | public void add(Iterator<E> iterator) {
Assert.state(!inUse, "You can no longer add iterator to a composite iterator that's already in use");
if (iterators.contains(iterator)) {
throw new IllegalArgumentException("You cannot add the same iterator twice");
}
iterators.add(iterator);
} | java | {
"resource": ""
} |
q178466 | CmdLineParser.addOption | test | public final Option addOption( Option opt ) {
if ( opt.shortForm() != null )
this.options.put("-" + opt.shortForm(), opt);
this.options.put("--" + opt.longForm(), opt);
return opt;
} | java | {
"resource": ""
} |
q178467 | CmdLineParser.addStringOption | test | public final Option addStringOption( char shortForm, String longForm ) {
return addOption(new Option.StringOption(shortForm, longForm));
} | java | {
"resource": ""
} |
q178468 | CmdLineParser.addIntegerOption | test | public final Option addIntegerOption( char shortForm, String longForm ) {
return addOption(new Option.IntegerOption(shortForm, longForm));
} | java | {
"resource": ""
} |
q178469 | CmdLineParser.addLongOption | test | public final Option addLongOption( char shortForm, String longForm ) {
return addOption(new Option.LongOption(shortForm, longForm));
} | java | {
"resource": ""
} |
q178470 | CmdLineParser.addDoubleOption | test | public final Option addDoubleOption( char shortForm, String longForm ) {
return addOption(new Option.DoubleOption(shortForm, longForm));
} | java | {
"resource": ""
} |
q178471 | CmdLineParser.addBooleanOption | test | public final Option addBooleanOption( char shortForm, String longForm ) {
return addOption(new Option.BooleanOption(shortForm, longForm));
} | java | {
"resource": ""
} |
q178472 | CmdLineParser.parse | test | public final void parse( String[] argv, Locale locale )
throws IllegalOptionValueException, UnknownOptionException {
// It would be best if this method only threw OptionException, but for
// backwards compatibility with old user code we throw the two
// exceptions above instead.
Vector otherArgs = new Vector();
int position = 0;
this.values = new Hashtable(10);
while ( position < argv.length ) {
String curArg = argv[position];
if ( curArg.startsWith("-") ) {
if ( curArg.equals("--") ) { // end of options
position += 1;
break;
}
String valueArg = null;
if ( curArg.startsWith("--") ) { // handle --arg=value
int equalsPos = curArg.indexOf("=");
if ( equalsPos != -1 ) {
valueArg = curArg.substring(equalsPos+1);
curArg = curArg.substring(0,equalsPos);
}
} else if(curArg.length() > 2) { // handle -abcd
for(int i=1; i<curArg.length(); i++) {
Option opt=(Option)this.options.get
("-"+curArg.charAt(i));
if(opt==null) throw new
UnknownSuboptionException(curArg,curArg.charAt(i));
if(opt.wantsValue()) throw new
NotFlagException(curArg,curArg.charAt(i));
addValue(opt, opt.getValue(null,locale));
}
position++;
continue;
}
Option opt = (Option)this.options.get(curArg);
if ( opt == null ) {
throw new UnknownOptionException(curArg);
}
Object value = null;
if ( opt.wantsValue() ) {
if ( valueArg == null ) {
position += 1;
if ( position < argv.length ) {
valueArg = argv[position];
}
}
value = opt.getValue(valueArg, locale);
}
else {
value = opt.getValue(null, locale);
}
addValue(opt, value);
position += 1;
}
else {
otherArgs.addElement(curArg);
position += 1;
}
}
for ( ; position < argv.length; ++position ) {
otherArgs.addElement(argv[position]);
}
this.remainingArgs = new String[otherArgs.size()];
otherArgs.copyInto(remainingArgs);
} | java | {
"resource": ""
} |
q178473 | SingletonLoader.newInstance | test | public Object newInstance(Class c) throws InstantiationException, IllegalAccessException {
Object ret = null;
Method[] methods = c.getDeclaredMethods();
Method m;
int modifiers;
// searching for static methods:
for (int i = 0; i < methods.length; i++) {
m = methods[i];
modifiers = m.getModifiers();
if ((modifiers & Modifier.STATIC) != 0) {
// searching for public access:
if ((modifiers & Modifier.PUBLIC) != 0) {
// searching for no parameters:
if (m.getParameterTypes().length == 0) {
// searching for return type:
if (m.getReturnType() == c) {
// searching for substring "instance" in method name:
if (m.getName().toLowerCase().indexOf("instance") != -1) {
try {
// Finally we found a singleton method:
// we are static and don't need an instance.
ret = m.invoke(null, dummyParameters);
} catch (IllegalArgumentException e) {
// This will not happen:
// we ensured that no arguments are needed.
e.printStackTrace();
} catch (IllegalAccessException e) {
// This will not happen (only in applet context perhaps or with some
// SecurityManager):
// we ensured public access.
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
}
}
}
}
// check, if we found a singleton:
if (ret == null) {
// try to invoke the default constructor:
Constructor[] constructors = c.getConstructors();
Constructor con = null;
// search for a parameterless constructor:
for (int i = 0; i < constructors.length; i++) {
con = constructors[i];
if (con.getParameterTypes().length == 0) {
// see, if public:
modifiers = con.getModifiers();
try {
if ((modifiers & Modifier.PUBLIC) == 0) {
// try to set accessible:
con.setAccessible(true);
}
// invokes the default constructor
ret = c.newInstance();
} catch (SecurityException se) {
// damn
}
}
}
}
if (ret == null) {
System.err.println("Unable to instantiate: " + c.getName()
+ ": no singleton method, no public default constructor.");
}
return ret;
} | java | {
"resource": ""
} |
q178474 | ConcurrencyThrottleSupport.afterAccess | test | protected void afterAccess() {
if (this.concurrencyLimit >= 0) {
synchronized (this.monitor) {
this.concurrencyCount--;
if (logger.isDebugEnabled()) {
logger.debug("Returning from throttle at concurrency count " + this.concurrencyCount);
}
this.monitor.notify();
}
}
} | java | {
"resource": ""
} |
q178475 | MethodInvoker.setTargetObject | test | public void setTargetObject(Object targetObject) {
this.targetObject = targetObject;
if (targetObject != null) {
this.targetClass = targetObject.getClass();
}
} | java | {
"resource": ""
} |
q178476 | MethodInvoker.prepare | test | public void prepare() throws ClassNotFoundException, NoSuchMethodException {
if (this.staticMethod != null) {
int lastDotIndex = this.staticMethod.lastIndexOf('.');
if (lastDotIndex == -1 || lastDotIndex == this.staticMethod.length()) {
throw new IllegalArgumentException(
"staticMethod must be a fully qualified class plus method name: " +
"e.g. 'example.MyExampleClass.myExampleMethod'"
);
}
String className = this.staticMethod.substring(0, lastDotIndex);
String methodName = this.staticMethod.substring(lastDotIndex + 1);
this.targetClass = resolveClassName(className);
this.targetMethod = methodName;
}
Class<?> targetClass = getTargetClass();
String targetMethod = getTargetMethod();
if (targetClass == null) {
throw new IllegalArgumentException("Either 'targetClass' or 'targetObject' is required");
}
if (targetMethod == null) {
throw new IllegalArgumentException("Property 'targetMethod' is required");
}
Object[] arguments = getArguments();
Class<?>[] argTypes = new Class<?>[arguments.length];
for (int i = 0; i < arguments.length; ++i) {
argTypes[i] = (arguments[i] != null ? arguments[i].getClass() : Object.class);
}
// Try to get the exact method first.
try {
this.methodObject = targetClass.getMethod(targetMethod, argTypes);
} catch (NoSuchMethodException ex) {
// Just rethrow exception if we can't get any match.
this.methodObject = findMatchingMethod();
if (this.methodObject == null) {
throw ex;
}
}
} | java | {
"resource": ""
} |
q178477 | MethodInvoker.findMatchingMethod | test | protected Method findMatchingMethod() {
String targetMethod = getTargetMethod();
Object[] arguments = getArguments();
int argCount = arguments.length;
Method[] candidates = ReflectionUtils.getAllDeclaredMethods(getTargetClass());
int minTypeDiffWeight = Integer.MAX_VALUE;
Method matchingMethod = null;
for (Method candidate : candidates) {
if (candidate.getName().equals(targetMethod)) {
Class<?>[] paramTypes = candidate.getParameterTypes();
if (paramTypes.length == argCount) {
int typeDiffWeight = getTypeDifferenceWeight(paramTypes, arguments);
if (typeDiffWeight < minTypeDiffWeight) {
minTypeDiffWeight = typeDiffWeight;
matchingMethod = candidate;
}
}
}
}
return matchingMethod;
} | java | {
"resource": ""
} |
q178478 | ByteHelper.toUnsignedString | test | private static String toUnsignedString(int i, int shift) {
char[] buf = new char[32];
int charPos = 32;
int radix = 1 << shift;
int mask = radix - 1;
do {
buf[--charPos] = digits[i & mask];
i >>>= shift;
} while (i != 0);
return new String(buf, charPos, (32 - charPos));
} | java | {
"resource": ""
} |
q178479 | SerializationUtils.serialize | test | public static byte[] serialize(Object object) {
if (object == null) {
return null;
}
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeObject(object);
oos.flush();
} catch (IOException ex) {
throw new IllegalArgumentException("Failed to serialize object of type: " + object.getClass(), ex);
}
return baos.toByteArray();
} | java | {
"resource": ""
} |
q178480 | SerializationUtils.deserialize | test | public static Object deserialize(byte[] bytes) {
if (bytes == null) {
return null;
}
try {
ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bytes));
return ois.readObject();
} catch (IOException ex) {
throw new IllegalArgumentException("Failed to deserialize object", ex);
} catch (ClassNotFoundException ex) {
throw new IllegalStateException("Failed to deserialize object type", ex);
}
} | java | {
"resource": ""
} |
q178481 | DomUtils.getChildElementByTagName | test | public static Element getChildElementByTagName(Element ele, String childEleName) {
Assert.notNull(ele, "Element must not be null");
Assert.notNull(childEleName, "Element name must not be null");
NodeList nl = ele.getChildNodes();
for (int i = 0; i < nl.getLength(); i++) {
Node node = nl.item(i);
if (node instanceof Element && nodeNameMatch(node, childEleName)) {
return (Element) node;
}
}
return null;
} | java | {
"resource": ""
} |
q178482 | DomUtils.getChildElementValueByTagName | test | public static String getChildElementValueByTagName(Element ele, String childEleName) {
Element child = getChildElementByTagName(ele, childEleName);
return (child != null ? getTextValue(child) : null);
} | java | {
"resource": ""
} |
q178483 | DomUtils.getChildElements | test | public static List<Element> getChildElements(Element ele) {
Assert.notNull(ele, "Element must not be null");
NodeList nl = ele.getChildNodes();
List<Element> childEles = new ArrayList<Element>();
for (int i = 0; i < nl.getLength(); i++) {
Node node = nl.item(i);
if (node instanceof Element) {
childEles.add((Element) node);
}
}
return childEles;
} | java | {
"resource": ""
} |
q178484 | DomUtils.nodeNameMatch | test | private static boolean nodeNameMatch(Node node, String desiredName) {
return (desiredName.equals(node.getNodeName()) || desiredName.equals(node.getLocalName()));
} | java | {
"resource": ""
} |
q178485 | DomUtils.nodeNameMatch | test | private static boolean nodeNameMatch(Node node, Collection<?> desiredNames) {
return (desiredNames.contains(node.getNodeName()) || desiredNames.contains(node.getLocalName()));
} | java | {
"resource": ""
} |
q178486 | StringUtil.setSize | test | public static final String setSize(final String s, final int length) {
String result = s;
int oldlen = s.length();
if (oldlen > length) {
System.err.println("greenpeace.util.setSize(String s,int length): length (" + length
+ ") is smaller than s.length(" + oldlen + ") : " + s);
} else {
int tofill = length - oldlen;
result = StringUtil.appendSpaces(s, tofill);
}
return result;
} | java | {
"resource": ""
} |
q178487 | WeakReferenceMonitor.monitor | test | public static void monitor(Object handle, ReleaseListener listener) {
if (logger.isDebugEnabled()) {
logger.debug("Monitoring handle [" + handle + "] with release listener [" + listener + "]");
}
// Make weak reference to this handle, so we can say when
// handle is not used any more by polling on handleQueue.
WeakReference<Object> weakRef = new WeakReference<Object>(handle, handleQueue);
// Add monitored entry to internal map of all monitored entries.
addEntry(weakRef, listener);
} | java | {
"resource": ""
} |
q178488 | WeakReferenceMonitor.addEntry | test | private static void addEntry(Reference<?> ref, ReleaseListener entry) {
synchronized (WeakReferenceMonitor.class) {
// Add entry, the key is given reference.
trackedEntries.put(ref, entry);
// Start monitoring thread lazily.
if (monitoringThread == null) {
monitoringThread = new Thread(new MonitoringProcess(), WeakReferenceMonitor.class.getName());
monitoringThread.setDaemon(true);
monitoringThread.start();
}
}
} | java | {
"resource": ""
} |
q178489 | WeakReferenceMonitor.keepMonitoringThreadAlive | test | private static boolean keepMonitoringThreadAlive() {
synchronized (WeakReferenceMonitor.class) {
if (!trackedEntries.isEmpty()) {
return true;
} else {
logger.debug("No entries left to track - stopping reference monitor thread");
monitoringThread = null;
return false;
}
}
} | java | {
"resource": ""
} |
q178490 | PhoneNumberAddress.calcMobileCity | test | public static String calcMobileCity(String mobileNumber) throws MalformedURLException {
ObjectMapper objectMapper = new ObjectMapper();
String jsonString = null;
String urlString = "http://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=" + mobileNumber;
StringBuffer sb = new StringBuffer();
BufferedReader buffer;
URL url = new URL(urlString);
try {
InputStream in = url.openStream();
//solve the garbage problem
buffer = new BufferedReader(new InputStreamReader(in, "gb2312"));
String line = null;
while ((line = buffer.readLine()) != null) {
sb.append(line);
}
in.close();
buffer.close();
// System.out.println(sb.toString());
jsonString = sb.toString();
EntityHelper.print(jsonString);
//replace \
jsonString = jsonString.replaceAll("^[__]\\w{14}+[_ = ]+", "[");
// System.out.println(jsonString+"]");
String jsonString2 = jsonString + "]";
//json object into the STRING
// array = JSONArray.fromObject(jsonString2);
//Get JSONArray of JSONObject object , easy to read array of key-value pairs in
// jsonObject = array.getJSONObject(0);
} catch (Exception e) {
e.printStackTrace();
}
// return jsonObject.getString("province");
return null;
} | java | {
"resource": ""
} |
q178491 | AbstractStaxXMLReader.startPrefixMapping | test | protected void startPrefixMapping(String prefix, String namespace) throws SAXException {
if (getContentHandler() != null) {
if (prefix == null) {
prefix = "";
}
if (!StringUtils.hasLength(namespace)) {
return;
}
if (!namespace.equals(namespaces.get(prefix))) {
getContentHandler().startPrefixMapping(prefix, namespace);
namespaces.put(prefix, namespace);
}
}
} | java | {
"resource": ""
} |
q178492 | AbstractStaxXMLReader.endPrefixMapping | test | protected void endPrefixMapping(String prefix) throws SAXException {
if (getContentHandler() != null) {
if (namespaces.containsKey(prefix)) {
getContentHandler().endPrefixMapping(prefix);
namespaces.remove(prefix);
}
}
} | java | {
"resource": ""
} |
q178493 | ListenableFutureCallbackRegistry.addCallback | test | @SuppressWarnings("unchecked")
public void addCallback(ListenableFutureCallback<? super T> callback) {
Assert.notNull(callback, "'callback' must not be null");
synchronized (mutex) {
switch (state) {
case NEW:
callbacks.add(callback);
break;
case SUCCESS:
callback.onSuccess((T) result);
break;
case FAILURE:
callback.onFailure((Throwable) result);
break;
}
}
} | java | {
"resource": ""
} |
q178494 | JarArchive.parseTree | test | private ITreeNode parseTree() {
ITreeNode root = new TreeNodeUniqueChildren();
ITreeNode newnode, oldnode;
Enumeration entries = this.jar.entries();
String entry;
while (entries.hasMoreElements()) {
newnode = root;
oldnode = root;
entry = ((JarEntry)entries.nextElement()).getName();
System.out.println("Entry: " + entry);
StringTokenizer tokenizer = new StringTokenizer(entry, "/");
while (tokenizer.hasMoreElements()) {
String path = tokenizer.nextToken();
newnode = new TreeNodeUniqueChildren(path);
oldnode.addChildNode(newnode);
oldnode = newnode;
}
}
return root;
} | java | {
"resource": ""
} |
q178495 | HorizontalPicker.getTextColor | test | private int getTextColor(int item) {
int scrollX = getScrollX();
// set color of text
int color = textColor.getDefaultColor();
int itemWithPadding = (int) (itemWidth + dividerSize);
if (scrollX > itemWithPadding * item - itemWithPadding / 2 &&
scrollX < itemWithPadding * (item + 1) - itemWithPadding / 2) {
int position = scrollX - itemWithPadding / 2;
color = getColor(position, item);
} else if(item == pressedItem) {
color = textColor.getColorForState(new int[] { android.R.attr.state_pressed }, color);
}
return color;
} | java | {
"resource": ""
} |
q178496 | HorizontalPicker.setValues | test | public void setValues(CharSequence[] values) {
if (this.values != values) {
this.values = values;
if (this.values != null) {
layouts = new BoringLayout[this.values.length];
for (int i = 0; i < layouts.length; i++) {
layouts[i] = new BoringLayout(this.values[i], textPaint, itemWidth, Layout.Alignment.ALIGN_CENTER,
1f, 1f, boringMetrics, false, ellipsize, itemWidth);
}
} else {
layouts = new BoringLayout[0];
}
// start marque only if has already been measured
if (getWidth() > 0) {
startMarqueeIfNeeded();
}
requestLayout();
invalidate();
}
} | java | {
"resource": ""
} |
q178497 | HorizontalPicker.getColor | test | private int getColor(int scrollX, int position) {
int itemWithPadding = (int) (itemWidth + dividerSize);
float proportion = Math.abs(((1f * scrollX % itemWithPadding) / 2) / (itemWithPadding / 2f));
if(proportion > .5) {
proportion = (proportion - .5f);
} else {
proportion = .5f - proportion;
}
proportion *= 2;
int defaultColor;
int selectedColor;
if(pressedItem == position) {
defaultColor = textColor.getColorForState(new int[] { android.R.attr.state_pressed }, textColor.getDefaultColor());
selectedColor = textColor.getColorForState(new int[] { android.R.attr.state_pressed, android.R.attr.state_selected }, defaultColor);
} else {
defaultColor = textColor.getDefaultColor();
selectedColor = textColor.getColorForState(new int[] { android.R.attr.state_selected }, defaultColor);
}
return (Integer) new ArgbEvaluator().evaluate(proportion, selectedColor, defaultColor);
} | java | {
"resource": ""
} |
q178498 | HorizontalPicker.setTextSize | test | private void setTextSize(float size) {
if(size != textPaint.getTextSize()) {
textPaint.setTextSize(size);
requestLayout();
invalidate();
}
} | java | {
"resource": ""
} |
q178499 | HorizontalPicker.getInBoundsX | test | private int getInBoundsX(int x) {
if(x < 0) {
x = 0;
} else if(x > ((itemWidth + (int) dividerSize) * (values.length - 1))) {
x = ((itemWidth + (int) dividerSize) * (values.length - 1));
}
return x;
} | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.