public String toString () { if (value == null) return ""; return value.toString(); }
public String toString () { if (value == null) return ""; return value.toString(); }
private String value(String fromElement, boolean fromInclusive) { String fromValue = fromElement.toString(); if (fromInclusive) { fromValue = "[" + fromValue; } else { fromValue = "(" + fromValue; } return fromValue; }
private String value(String fromElement, boolean fromInclusive) { String fromValue = fromElement.toString(); if (fromInclusive) { fromValue = "[" + fromValue; } else { fromValue = "(" + fromValue; } return fromValue; }
@Override public String toString() { return name.toString(); }
private String getBranchFromUrl(String url) { String[] componentsOfUrl = StringUtils.split(url.toString(), HgUrlArgument.DOUBLE_HASH); if (componentsOfUrl.length > 1) { return componentsOfUrl[1]; } return HG_DEFAULT_BRANCH; } }
public InputStream openClassfile(String classname) { try { char sep = File.separatorChar; String filename = directory + sep + classname.replace('.', sep) + ".class"; return new FileInputStream(filename.toString()); } catch (FileNotFoundException e) {} catch (SecurityException e) {} return null; }
String a = null; System.out.println(a.toString()); // NullPointerException will be thrown
public String toString () { for (int i = 0; i < options.length; i++) if (getValue(i).equals(value)) return options[i][0].toString(); return ""; }
public String toString () { for (int i = 0; i < options.length; i++) if (getValue(i).equals(value)) return options[i][0].toString(); return ""; }
int TIMEOUT_MILLISEC = 10000; // = 10 seconds String postMessage="{}"; //HERE_YOUR_POST_STRING. HttpParams httpParams = new BasicHttpParams(); HttpConnectionParams.setConnectionTimeout(httpParams, TIMEOUT_MILLISEC); HttpConnectionParams.setSoTimeout(httpParams, TIMEOUT_MILLISEC); HttpClient client = new DefaultHttpClient(httpParams); HttpPost request = new HttpPost(serverUrl); request.setEntity(new ByteArrayEntity( postMessage.toString().getBytes("UTF8"))); HttpResponse response = client.execute(request);
@Override public Object construct(Node node) { // Ignore white spaces for base64 encoded scalar String noWhiteSpaces = constructScalar((ScalarNode) node).toString().replaceAll("\\s", ""); byte[] decoded = Base64Coder.decode(noWhiteSpaces.toCharArray()); return decoded; } }
private void writePropagatingErrorCase(MethodSpec.Builder methodBuilder) { methodBuilder .beginControlFlow("case $L:", INTERNAL_ON_ERROR_HANDLER_NAME.toString().hashCode()) .addStatement( "dispatchErrorEvent(($L) eventHandler.params[0], ($L) eventState)", mContextClass, ClassNames.ERROR_EVENT) .addStatement("return null") .endControlFlow(); }
@Override public Object decode(ByteBuf buf, State state) throws IOException { String id = (String) StringCodec.INSTANCE.getValueDecoder().decode(buf, state); String[] parts = id.toString().split("-"); return new StreamMessageId(Long.valueOf(parts[0]), Long.valueOf(parts[1])); }
@Override public Object decode(ByteBuf buf, State state) throws IOException { String id = (String) StringCodec.INSTANCE.getValueDecoder().decode(buf, state); String[] parts = id.toString().split("-"); return new StreamMessageId(Long.valueOf(parts[0]), Long.valueOf(parts[1])); }
@Test public void testSPR_9051() throws Exception { assertNotNull(enigma); assertNotNull(lifecycleBean); assertTrue(lifecycleBean.isInitialized()); Set<String> names = new HashSet<>(); names.add(enigma.toString()); names.add(lifecycleBean.getName()); assertEquals(names, new HashSet<>(Arrays.asList("enigma #1", "enigma #2"))); } }
/** * Test a class that defines an ivar pointing to itself. This test was * created to show that handling cyclical object resulted in a missing endFieldSeparator call. */ @Test public void testSelfInstanceTwoVarsReflectionObjectCycle() { final SelfInstanceTwoVarsReflectionTestFixture test = new SelfInstanceTwoVarsReflectionTestFixture(); assertEquals(this.toBaseString(test) + "[typeIsSelf=" + this.toBaseString(test) + ",otherType=" + test.getOtherType().toString() + "]", test.toString()); }
@Override public BitmapFont loadSync (AssetManager manager, String fileName, FileHandle file, BitmapFontParameter parameter) { if (parameter != null && parameter.atlasName != null) { TextureAtlas atlas = manager.get(parameter.atlasName, TextureAtlas.class); String name = file.sibling(data.imagePaths[0]).nameWithoutExtension().toString(); AtlasRegion region = atlas.findRegion(name); if (region == null) throw new GdxRuntimeException("Could not find font region " + name + " in atlas " + parameter.atlasName); return new BitmapFont(file, region); } else { int n = data.getImagePaths().length; Array<TextureRegion> regs = new Array(n); for (int i = 0; i < n; i++) { regs.add(new TextureRegion(manager.get(data.getImagePath(i), Texture.class))); } return new BitmapFont(data, regs, true); } }
@Override public BitmapFont loadSync (AssetManager manager, String fileName, FileHandle file, BitmapFontParameter parameter) { if (parameter != null && parameter.atlasName != null) { TextureAtlas atlas = manager.get(parameter.atlasName, TextureAtlas.class); String name = file.sibling(data.imagePaths[0]).nameWithoutExtension().toString(); AtlasRegion region = atlas.findRegion(name); if (region == null) throw new GdxRuntimeException("Could not find font region " + name + " in atlas " + parameter.atlasName); return new BitmapFont(file, region); } else { int n = data.getImagePaths().length; Array<TextureRegion> regs = new Array(n); for (int i = 0; i < n; i++) { regs.add(new TextureRegion(manager.get(data.getImagePath(i), Texture.class))); } return new BitmapFont(data, regs, true); } }