code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
@Override
public void configure() {
if (getProperties().containsKey(PROPERTY_NAME_FILE_PATTERN)) {
filePattern = Pattern.compile(getProperties().get(PROPERTY_NAME_FILE_PATTERN).toString());
} else {
filePattern = Pattern.compile(DEFAULT_FILE_PATTERN);
}
} | java |
@Override
public int compareTo(ElementRef o) {
int diff = pageRef.compareTo(o.pageRef);
if(diff != 0) return diff;
return id.compareTo(o.id);
} | java |
@Override
public void endContentLine(ChainWriter out, WebSiteRequest req, HttpServletResponse resp, int rowspan, boolean endsInternal) {
out.print(" </td>\n"
+ " </tr>\n");
} | java |
protected String getSender(final SmsSendRequestDto smsSendRequestDto) {
if (StringUtils.isNotBlank(smsSendRequestDto.getSender())) {
return smsSendRequestDto.getSender();
}
Validate.notEmpty(defaultSender, "defaultSender must not be null or blank");
return defaultSender;
} | java |
protected String getReceiver(final SmsSendRequestDto smsSendRequestDto) {
if (StringUtils.isNotBlank(smsSendRequestDto.getReceiver())) {
return smsSendRequestDto.getReceiver();
}
Validate.notEmpty(defaultReceiver, "defaultReceiver must not be null or blank");
return defaultReceiver;
} | java |
protected String getMessage(final SmsSendRequestDto smsSendRequestDto) {
if (StringUtils.isNotBlank(smsSendRequestDto.getMessage())) {
return smsSendRequestDto.getMessage();
}
Validate.notEmpty(defaultMessage, "defaultMessage must not be null or blank");
return defaultMessage;
} | java |
final public void Update (String s) {
byte[] chars=s.getBytes();
// Changed on 2004-04-10 due to getBytes(int,int,char[],byte) being deprecated
//byte chars[];
//chars = new byte[s.length()];
//s.getBytes(0, s.length(), chars, 0);
Update(chars, chars.length);
} | java |
public static String asHex (byte[] hash) {
StringBuilder buf = new StringBuilder(hash.length * 2);
int i;
for (i = 0; i < hash.length; i++) {
if (((int) hash[i] & 0xff) < 0x10)
buf.append("0");
buf.append(Long.toString((int) hash[i] & 0xff, 16));
}
return buf.toString();
} | java |
public static List<News> findAllNews(
ServletContext servletContext,
HttpServletRequest request,
HttpServletResponse response,
Page page
) throws ServletException, IOException {
final List<News> found = new ArrayList<>();
final SemanticCMS semanticCMS = SemanticCMS.getInstance(servletContext);
CapturePag... | java |
public static LinkedBindingBuilder<Handler> bindHandler(final Binder binder)
{
final Multibinder<Handler> handlers = Multibinder.newSetBinder(binder, Handler.class, HANDLER_NAMED);
return handlers.addBinding();
} | java |
public static LinkedBindingBuilder<Handler> bindLoggingHandler(final Binder binder)
{
final Multibinder<Handler> handlers = Multibinder.newSetBinder(binder, Handler.class, LOGGING_NAMED);
return handlers.addBinding();
} | java |
public static LinkedBindingBuilder<HandlerWrapper> bindSecurityHandler(final Binder binder)
{
return binder.bind(HandlerWrapper.class).annotatedWith(SECURITY_NAMED);
} | java |
@Override
public void printContentStart(
ChainWriter out,
WebSiteRequest req,
HttpServletResponse resp
) throws IOException, SQLException {
out.print(getDescription());
} | java |
@Override
protected String getElementIdTemplate() {
ResourceRef rr = getResourceRef();
if(rr != null) {
String path = rr.getPath().toString();
int slashBefore;
if(path.endsWith(Path.SEPARATOR_STRING)) {
slashBefore = path.lastIndexOf(Path.SEPARATOR_CHAR, path.length() - 2);
} else {
slashBefore... | java |
@Override
public String getLabel() {
ResourceStore rs;
ResourceRef rr;
synchronized(lock) {
rs = this.resourceStore;
rr = this.resourceRef;
}
if(rr != null) {
String path = rr.getPath().toString();
boolean isDirectory = path.endsWith(Path.SEPARATOR_STRING);
int slashBefore;
if(isDirectory) ... | java |
public static String getDispatchedPage(ServletRequest request) {
String dispatchedPage = (String)request.getAttribute(DISPATCHED_PAGE_REQUEST_ATTRIBUTE);
if(logger.isLoggable(Level.FINE)) logger.log(
Level.FINE,
"request={0}, dispatchedPage={1}",
new Object[] {
request,
dispatchedPage
}
);
r... | java |
public static void setDispatchedPage(ServletRequest request, String dispatchedPage) {
if(logger.isLoggable(Level.FINE)) logger.log(
Level.FINE,
"request={0}, dispatchedPage={1}",
new Object[] {
request,
dispatchedPage
}
);
request.setAttribute(DISPATCHED_PAGE_REQUEST_ATTRIBUTE, dispatchedPage)... | java |
@Override
public String getLabel() {
String l = label;
if(l != null) return l;
String p = path;
if(p != null) {
String filename = p.substring(p.lastIndexOf('/') + 1);
if(filename.endsWith(DOT_EXTENSION)) filename = filename.substring(0, filename.length() - DOT_EXTENSION.length());
if(filename.isEmpty(... | java |
public static SourceNode fromStringWithSourceMap(String aGeneratedCode, SourceMapConsumer aSourceMapConsumer, final String aRelativePath) {
// The SourceNode we want to fill with the generated code
// and the SourceMap
final SourceNode node = new SourceNode();
// All even indices of thi... | java |
public void add(Object... aChunk) {
List<Object> list;
if (aChunk.length == 1 && aChunk[0] instanceof List) {
@SuppressWarnings("unchecked")
List<Object> l = (List<Object>) aChunk[0];
list = l;
} else {
list = Arrays.asList(aChunk);
}
... | java |
public void prepend(Object... aChunk) {
for (int i = aChunk.length - 1; i >= 0; i--) {
if (aChunk[i] instanceof String) {
this.prepend((String) aChunk[i]);
} else if (aChunk[i] instanceof SourceNode) {
this.prepend((SourceNode) aChunk[i]);
} el... | java |
public void join(String aSep) {
List<Object> newChildren;
int i;
int len = this.children.size();
if (len > 0) {
newChildren = new ArrayList<>();
for (i = 0; i < len - 1; i++) {
newChildren.add(this.children.get(i));
newChildren.add(... | java |
public void replaceRight(Pattern aPattern, String aReplacement) {
Object lastChild = this.children.get(this.children.size() - 1);
if (lastChild instanceof SourceNode) {
((SourceNode) lastChild).replaceRight(aPattern, aReplacement);
} else if (lastChild instanceof String) {
... | java |
public void walkSourceContents(SourceWalker walker) {
for (int i = 0, len = this.children.size(); i < len; i++) {
if (this.children.get(i) instanceof SourceNode) {
((SourceNode) this.children.get(i)).walkSourceContents(walker);
}
}
for (Entry<String, Stri... | java |
public Map<String,Object> getProperty() {
// TODO: If we have properties volatile, could do the null and frozen cases outside the synchronized block
// TODO: Would this be faster?
synchronized(lock) {
if(properties == null) return Collections.emptyMap();
if(frozen) return properties;
return AoCollections... | java |
public List<Element> getChildElements() {
synchronized(lock) {
if(childElements == null) return Collections.emptyList();
if(frozen) return childElements;
return AoCollections.unmodifiableCopyList(childElements);
}
} | java |
public Long addChildElement(Element childElement, ElementWriter elementWriter) {
synchronized(lock) {
checkNotFrozen();
if(childElements == null) childElements = new ArrayList<>();
childElements.add(childElement);
if(elementWriters == null) elementWriters = new HashMap<>();
IdGenerator idGenerator = id... | java |
public Set<PageRef> getPageLinks() {
synchronized(lock) {
if(pageLinks == null) return Collections.emptySet();
if(frozen) return pageLinks;
return AoCollections.unmodifiableCopySet(pageLinks);
}
} | java |
public BufferResult getBody() {
BufferResult b = body;
if(b == null) return EmptyResult.getInstance();
return b;
} | java |
public String getLabel() {
StringBuilder sb = new StringBuilder();
try {
appendLabel(sb);
} catch(IOException e) {
throw new AssertionError("Should not happen because using StringBuilder", e);
}
return sb.toString();
} | java |
private static <E extends Element> List<E> findTopLevelElementsRecurse(Class<E> elementType, Node node, List<E> matches) {
for(Element elem : node.getChildElements()) {
if(elementType.isInstance(elem)) {
// Found match
if(matches == null) matches = new ArrayList<>();
matches.add(elementType.cast(elem))... | java |
protected void setRemoteSocketAddress(final SocketAddress newRemoteSocketAddress) {
synchronized(remoteSocketAddressLock) {
final SocketAddress oldRemoteSocketAddress = this.remoteSocketAddress;
if(!newRemoteSocketAddress.equals(oldRemoteSocketAddress)) {
this.remoteSocketAddress = newRemoteSocketAddress;
... | java |
@Override
public void start(
Callback<? super Socket> onStart,
Callback<? super Exception> onError
) throws IllegalStateException {
if(isClosed()) throw new IllegalStateException("Socket is closed");
startImpl(onStart, onError);
} | java |
@Override
public ReadableInstant getLastModified(
ServletContext servletContext,
HttpServletRequest request,
HttpServletResponse response,
Page page
) throws ServletException, IOException {
List<News> news = NewsUtils.findAllNews(servletContext, request, response, page);
return news.isEmpty() ? null : new... | java |
@Override
public void search(
String[] words,
WebSiteRequest req,
HttpServletResponse response,
List<SearchResult> results,
AoByteArrayOutputStream bytes,
List<WebPage> finishedPages
) {
} | java |
public boolean send(ProbeTestRun testRun) throws MalformedURLException {
LOGGER.info("Connected to Probe Dock API at " + configuration.getServerConfiguration().getApiUrl());
// Print the payload to the outout stream
if (configuration.isPayloadPrint()) {
try (OutputStreamWriter testRunOsw = new OutputStreamWri... | java |
private HttpURLConnection openConnection(ServerConfiguration configuration, URL url) throws IOException {
if (configuration.hasProxyConfiguration()) {
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(configuration.getProxyConfiguration().getHost(), configuration.getProxyConfiguration().getPort()));
... | java |
public void loadImage() throws InterruptedException {
synchronized(this) {
status=0;
image.getSource().startProduction(this);
while((status&(IMAGEABORTED|IMAGEERROR|SINGLEFRAMEDONE|STATICIMAGEDONE))==0) {
wait();
}
}
} | java |
private FilterDescriptor createFilter(FilterType filterType, Map<String, FilterDescriptor> filters, ScannerContext context) {
Store store = context.getStore();
FilterDescriptor filterDescriptor = getOrCreateNamedDescriptor(FilterDescriptor.class, filterType.getFilterName().getValue(), filters, store);
... | java |
private FilterMappingDescriptor createFilterMapping(FilterMappingType filterMappingType, Map<String, FilterDescriptor> filters,
Map<String, ServletDescriptor> servlets, Store store) {
FilterMappingDescriptor filterMappingDescriptor = store.create(FilterMappingDescriptor.class);
FilterNameTyp... | java |
private <T extends NamedDescriptor> T getOrCreateNamedDescriptor(Class<T> type, String name, Map<String, T> descriptors, Store store) {
T descriptor = descriptors.get(name);
if (descriptor == null) {
descriptor = store.create(type);
descriptor.setName(name);
descripto... | java |
private ParamValueDescriptor createParamValue(ParamValueType paramValueType, Store store) {
ParamValueDescriptor paramValueDescriptor = store.create(ParamValueDescriptor.class);
for (DescriptionType descriptionType : paramValueType.getDescription()) {
DescriptionDescriptor descriptionDescrip... | java |
private void setAsyncSupported(AsyncSupportedDescriptor asyncSupportedDescriptor, TrueFalseType asyncSupported) {
if (asyncSupported != null) {
asyncSupportedDescriptor.setAsyncSupported(asyncSupported.isValue());
}
} | java |
private ServletMappingDescriptor createServletMapping(ServletMappingType servletMappingType, Map<String, ServletDescriptor> servlets, Store store) {
ServletMappingDescriptor servletMappingDescriptor = store.create(ServletMappingDescriptor.class);
ServletNameType servletName = servletMappingType.getServl... | java |
private SessionConfigDescriptor createSessionConfig(SessionConfigType sessionConfigType, Store store) {
SessionConfigDescriptor sessionConfigDescriptor = store.create(SessionConfigDescriptor.class);
XsdIntegerType sessionTimeout = sessionConfigType.getSessionTimeout();
if (sessionTimeout != null... | java |
public void finish() throws IOException {
int lastBlockSize = (int)(byteCount % blockSize);
if(lastBlockSize!=0) {
while(lastBlockSize<blockSize) {
out.write(padding);
byteCount++;
lastBlockSize++;
}
}
out.flush();
} | java |
private void detectFileChange() throws IOException {
checkClosed();
assert Thread.holdsLock(filePosLock);
while(!file.exists()) {
try {
System.err.println("File not found, waiting: " + file.getPath());
Thread.sleep(pollInterval);
} catch(InterruptedException e) {
InterruptedIOException newExc = ... | java |
protected void processSynAckPacket(Packet packet) {
String serverIp = packet.getSrcIpAddr();
int serverPort = packet.getSrcPort();
String clientIp = packet.getDestIpAddr();
int clientPort = packet.getDestPort();
String clientId = makeClientId(clientIp, clientPort);
TcpSer... | java |
protected void processSynAckPacket(Packet packet) {
Integer clientPort = packet.getDestPort();
Integer serverPort = packet.getSrcPort();
String serverIp = packet.getSrcIpAddr();
TcpClientScript scriptFragmentWriter = scripts.get(clientPort);
if ( scriptFragmentWriter == null ) {
... | java |
@Override
public byte[] readBuffer(final ChannelBuffer buffer) {
int len = getLength();
byte[] matched = new byte[len];
buffer.readBytes(matched);
return matched;
} | java |
@Function
public static String randomizeLetterCase(String text) {
StringBuilder result = new StringBuilder();
for (int i = 0; i < text.length(); i++) {
char c = text.charAt(i);
if (RANDOM.nextBoolean()) {
c = toUpperCase(c);
} else {
... | java |
@Override
public Configuration visit(AstConnectNode connectNode, State state) {
// masking is a no-op by default for each stream
state.readUnmasker = Masker.IDENTITY_MASKER;
state.writeMasker = Masker.IDENTITY_MASKER;
state.pipelineAsMap = new LinkedHashMap<>();
for (AstSt... | java |
protected void init(Map stormConf, TopologyContext topologyContext) {
setId(topologyContext.getThisComponentId());
try {
method = inputSignature.findMethod(beanType);
logger.info("{} uses {}", this, method.toGenericString());
} catch (ReflectiveOperationException e) {
throw new IllegalStateException("Un... | java |
protected Object[] invoke(Object[] arguments)
throws InvocationTargetException, IllegalAccessException {
Object returnValue = invoke(method, arguments);
if (! scatterOutput) {
logger.trace("Using return as is");
return new Object[] {returnValue};
}
if (returnValue instanceof Object[]) {
logger.trace... | java |
protected Object invoke(Method method, Object[] arguments)
throws InvocationTargetException, IllegalAccessException {
logger.trace("Lookup for call {}", method);
Object bean = spring.getBean(beanType);
try {
return method.invoke(bean, arguments);
} catch (IllegalArgumentException e) {
StringBuilder msg ... | java |
public void setOutputBinding(Map<String,String> value) {
outputBinding.clear();
outputBindingDefinitions.clear();
for (Map.Entry<String,String> entry : value.entrySet())
putOutputBinding(entry.getKey(), entry.getValue());
}
/**
* Registers an expression for a field.
* @param field the name.
* @param e... | java |
@Function
public static GSSContext createClientGSSContext(String server) {
try {
GSSManager manager = GSSManager.getInstance();
GSSName serverName = manager.createName(server, null);
GSSContext context = manager.createContext(serverName,
krb5Oid,
... | java |
@Function
public static byte[] getClientToken(GSSContext context) {
byte[] initialToken = new byte[0];
if (!context.isEstablished()) {
try {
// token is ignored on the first call
initialToken = context.initSecContext(initialToken, 0, initialToken.length)... | java |
@Function
public static boolean verifyMIC(GSSContext context, MessageProp prop, byte[] message, byte[] mic) {
try {
context.verifyMIC(mic, 0, mic.length,
message, 0, message.length,
prop);
return true;
} catch (GSSException ex) {
... | java |
@Function
public static GSSContext createServerGSSContext() {
System.out.println("createServerGSSContext()...");
try {
final GSSManager manager = GSSManager.getInstance();
//
// Create server credentials to accept kerberos tokens. This should
// make... | java |
@Function
public static boolean acceptClientToken(GSSContext context, byte[] token) {
try {
if (!context.isEstablished()) {
byte[] nextToken = context.acceptSecContext(token, 0, token.length);
return nextToken == null;
}
return true;
... | java |
@Function
public static byte[] generateMIC(GSSContext context, MessageProp prop, byte[] message) {
try {
// Ensure the default Quality-of-Protection is applied.
prop.setQOP(0);
byte[] initialToken = context.getMIC(message, 0, message.length, prop);
return ge... | java |
public Packet getNextPacket() {
Packet parsedPacket = parseNextPacketFromPdml();
if ( parsedPacket == null ) { // All packets have been read
return null;
}
parsedPacket = addTcpdumpInfoToPacket(parsedPacket);
return parsedPacket;
} | java |
private Packet addTcpdumpInfoToPacket(Packet parsedPacket){
int packetSize = parsedPacket.getPacketSize();
tcpdumpReader.readNewPacket(packetSize);
// Get Tcp Payload
if ( parsedPacket.isTcp() ) {
int payloadSize = parsedPacket.getTcpPayloadSize();
... | java |
private Packet parseNextPacketFromPdml() {
Packet currentPacket = null;
int eventType;
fieldStack.empty();
try {
eventType = parser.getEventType();
while (eventType != XmlPullParser.END_DOCUMENT) {
switch (eventType) {
case XmlPull... | java |
public void connect() throws Exception {
// connection must be null if the connection failed
URLConnection newConnection = location.openConnection();
newConnection.connect();
connection = newConnection;
InputStream bytesIn = connection.getInputStream();
CharsetDe... | java |
public void disconnect() throws Exception {
if (connection != null) {
try {
if (connection instanceof Closeable) {
((Closeable) connection).close();
} else {
try {
connection.getInputStream().close();
... | java |
public void writeCommand(Command command) throws Exception {
checkConnected();
switch (command.getKind()) {
case PREPARE:
writeCommand((PrepareCommand) command);
break;
case START:
writeCommand((StartCommand) command);
break;
case... | java |
public CommandEvent readEvent(int timeout, TimeUnit unit) throws Exception {
checkConnected();
connection.setReadTimeout((int) unit.toMillis(timeout));
CommandEvent event = null;
String eventType = textIn.readLine();
if (Thread.interrupted())
{
throw new I... | java |
private void writeEvent(final ChannelHandlerContext ctx, final Object message) {
if (isFinishedSent)
return;
if (message instanceof FinishedMessage)
isFinishedSent = true;
Channels.write(ctx, Channels.future(null), message);
} | java |
public static void main(String... args) throws Exception {
Options options = createOptions();
try {
Parser parser = new PosixParser();
CommandLine cmd = parser.parse(options, args);
if (cmd.hasOption("version")) {
System.out.println("Version:... | java |
public static FunctionMapper newFunctionMapper() {
ServiceLoader<FunctionMapperSpi> loader = loadFunctionMapperSpi();
// load FunctionMapperSpi instances
ConcurrentMap<String, FunctionMapperSpi> functionMappers = new ConcurrentHashMap<>();
for (FunctionMapperSpi functionMapperSpi : load... | java |
public Method resolveFunction(String prefix, String localName) {
FunctionMapperSpi functionMapperSpi = findFunctionMapperSpi(prefix);
return functionMapperSpi.resolveFunction(localName);
} | java |
public byte[] getPayload(int payloadStart, int payloadSize) {
byte[] payloadBuffer = new byte[payloadSize];
System.arraycopy(currentBuffer, payloadStart, payloadBuffer, 0, payloadSize);
return payloadBuffer;
} | java |
public static Config stormConfig(Properties source) {
Config result = new Config();
logger.debug("Mapping declared types for Storm properties...");
for (Field field : result.getClass().getDeclaredFields()) {
if (field.getType() != String.class) continue;
if (field.getName().endsWith(CONFIGURATION_TYPE_FIEL... | java |
public static FunctionSignature valueOf(String serial) {
int paramStart = serial.indexOf("(");
int paramEnd = serial.indexOf(")");
if (paramStart < 0 || paramEnd != serial.length() - 1)
throw new IllegalArgumentException("Malformed method signature: " + serial);
String function = serial.substring(0, paramSt... | java |
public Method findMethod(Class<?> type) throws ReflectiveOperationException {
Method match = null;
for (Method option : type.getDeclaredMethods()) {
if (! getFunction().equals(option.getName())) continue;
Class<?>[] parameters = option.getParameterTypes();
if (parameters.length != getArguments().length) co... | java |
public static Modifiers getInstance(int bitmask) {
switch (bitmask) {
case 0:
return NONE;
case Modifier.PUBLIC:
return PUBLIC;
case Modifier.PUBLIC | Modifier.ABSTRACT:
return PUBLIC_ABSTRACT;
case Modifier.PUBLIC | Modifier.STATIC:
... | java |
public Result<V>[] getMatches(String lookup, int limit) {
int strLen = lookup.length();
char[] chars = new char[strLen + 1];
lookup.getChars(0, strLen, chars, 0);
chars[strLen] = '\uffff';
List resultList = new ArrayList();
fillMatchResults(chars, limit, resultLi... | java |
public synchronized <U extends T> U put(U obj) {
if (obj == null) {
return null;
}
Entry<T>[] entries = mEntries;
int hash = hashCode(obj);
int index = (hash & 0x7fffffff) % entries.length;
for (Entry<T> e = entries[index], prev = null; e != null; e = e.mNext... | java |
public static void fire(Throwable t) {
if (t != null) {
// Don't need to do anything special for unchecked exceptions.
if (t instanceof RuntimeException) {
throw (RuntimeException) t;
}
if (t instanceof Error) {
throw (Error) t;
... | java |
public static void fireFirstDeclared(Throwable t, Class... declaredTypes) {
Throwable cause = t;
while (cause != null) {
cause = cause.getCause();
if (cause == null) {
break;
}
if (declaredTypes != null) {
for (Class declare... | java |
public static void fireCause(Throwable t) {
if (t != null) {
Throwable cause = t.getCause();
if (cause == null) {
cause = t;
}
fire(cause);
}
} | java |
public static void fireDeclaredCause(Throwable t, Class... declaredTypes) {
if (t != null) {
Throwable cause = t.getCause();
if (cause == null) {
cause = t;
}
fireDeclared(cause, declaredTypes);
}
} | java |
public static void fireFirstDeclaredCause(Throwable t, Class... declaredTypes) {
Throwable cause = t;
while (cause != null) {
cause = cause.getCause();
if (cause == null) {
break;
}
if (declaredTypes != null) {
for (Class de... | java |
public static void fireRootCause(Throwable t) {
Throwable root = t;
while (root != null) {
Throwable cause = root.getCause();
if (cause == null) {
break;
}
root = cause;
}
fire(root);
} | java |
public static void fireDeclaredRootCause(Throwable t, Class... declaredTypes) {
Throwable root = t;
while (root != null) {
Throwable cause = root.getCause();
if (cause == null) {
break;
}
root = cause;
}
fireDeclared(root, d... | java |
public void setCodeBuffer(CodeBuffer code) {
mCodeBuffer = code;
mOldLineNumberTable = mLineNumberTable;
mOldLocalVariableTable = mLocalVariableTable;
mOldStackMapTable = mStackMapTable;
mAttributes.remove(mLineNumberTable);
mAttributes.remove(mLocalVariableTable);
... | java |
public void localVariableUse(LocalVariable localVar) {
if (mLocalVariableTable == null) {
addAttribute(new LocalVariableTableAttr(getConstantPool()));
}
mLocalVariableTable.addEntry(localVar);
} | java |
private static RuntimeClassFile createClassFile() {
// Create a ClassFile with the super class of Object.
RuntimeClassFile cf = new RuntimeClassFile();
// Default constructor works only if super class has an accessible
// no-arg constructor.
cf.addDefaultConstructor();
... | java |
public ConstantClassInfo addConstantClass(String className, int dim) {
return (ConstantClassInfo)addConstant(new ConstantClassInfo(this, className, dim));
} | java |
public void init(Configuration configuration)
throws Exception
{
String baseName = configuration.getBootstrapPropertyResolver().getProperty("ResourceBundleFactory.Bundle");
if (baseName != null)
{
this.baseName = baseName;
}
} | java |
public ResourceBundle getDefaultBundle(Locale locale)
throws MissingResourceException
{
ResourceBundle bundle;
if (locale == null)
{
bundle = ResourceBundle.getBundle(baseName);
}
else
{
bundle = ResourceBundle.getBundle(baseName, locale);
}
return bundle;
} | java |
public static <B> BeanPropertyMapFactory<B> forClass(Class<B> clazz) {
synchronized (cFactories) {
BeanPropertyMapFactory factory;
SoftReference<BeanPropertyMapFactory> ref = cFactories.get(clazz);
if (ref != null) {
factory = ref.get();
if (fa... | java |
public static SortedMap<String, Object> asMap(Object bean) {
if (bean == null) {
throw new IllegalArgumentException();
}
BeanPropertyMapFactory factory = forClass(bean.getClass());
return factory.createMap(bean);
} | java |
public TypeDesc[] getExceptions() {
if (mExceptions == null) {
return new TypeDesc[0];
}
ConstantClassInfo[] classes = mExceptions.getExceptions();
TypeDesc[] types = new TypeDesc[classes.length];
for (int i=0; i<types.length; i++) {
types[i] = classes[i]... | java |
public static final String createBoundary() {
final StringBuilder builder = new StringBuilder(BOUNDARY_PREFIX);
builder.append((int) System.currentTimeMillis());
return builder.toString();
} | java |
public R visit(String name, int pos, String value, P param) {
return null;
} | java |
public R visit(String name, int pos, Annotation[] value, P param) {
for (int i=0; i<value.length; i++) {
visit(null, i, value[i], param);
}
return null;
} | java |
@Override
public int doStartTag()
throws JspException
{
// Retrieve the action bean and event handler to secure.
ActionBean actionBean;
if (bean == null)
{
// Search in page, request, session (if valid) and application scopes, in that order.
actionBean = (ActionBean)pageContext.findAttribute(Stripes... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.