id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
11,601
System.setProperty("dexmaker.dexcache", getInstrumentation().getTargetContext().getCacheDir().getPath()); PackageInfo info = getInstrumentation().getContext().getPackageManager() .getPackageInfo("com.microsoft.aad.adal.testapp", PackageManager.GET_SIGNATURES); AuthenticationSettings.INSTANCE .setBrokerPackageName(AuthenticationConstants.Broker.COMPANY_PORTAL_APP_PACKAGE_NAME); <BUG>Log.d(TAG, "testSignature is set"); </BUG> } @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) public void testResourceOverwrite() {
Log.d(TAG, "mTestSignature is set");
11,602
Mockito.when(mockedConnection.getInputStream()).thenReturn(Util.createInputStream(Util.getSuccessTokenResponse(false, false)), Util.createInputStream(Util.getSuccessTokenResponse(true, true))); Mockito.when(mockedConnection.getResponseCode()).thenReturn(HttpURLConnection.HTTP_OK); context.acquireTokenByRefreshToken("refreshTokenSending", expectedClientId, callback); signal.await(CONTEXT_REQUEST_TIME_OUT, TimeUnit.MILLISECONDS); <BUG>assertEquals("Same token", "I am a new access token", callback.mResult.getAccessToken()); assertEquals("Same refresh token", "I am a new refresh token", callback.mResult.getRefreshToken()); final CountDownLatch signal2 = new CountDownLatch(1);</BUG> callback = new MockAuthenticationCallback(signal2); context.acquireTokenByRefreshToken("refreshTokenSending", expectedClientId, exptedResource,
assertEquals("Same token", "I am a new access token", callback.getAuthenticationResult().getAccessToken()); assertEquals("Same refresh token", "I am a new refresh token", callback.getAuthenticationResult().getRefreshToken()); final CountDownLatch signal2 = new CountDownLatch(1);
11,603
Mockito.when(mockedConnection.getInputStream()).thenReturn(Util.createInputStream(Util. getSuccessResponseWithoutRefreshToken())); Mockito.when(mockedConnection.getResponseCode()).thenReturn(HttpURLConnection.HTTP_OK); context.acquireTokenByRefreshToken("refreshTokenSending", expectedClientId, callback); signal.await(CONTEXT_REQUEST_TIME_OUT, TimeUnit.MILLISECONDS); <BUG>assertEquals("Same token", "I am a new access token", callback.mResult.getAccessToken()); assertEquals("Same refresh token", refreshToken, callback.mResult.getRefreshToken()); }</BUG> @SmallTest public void testAcquireTokenAuthorityMalformed() throws InterruptedException,
assertEquals("Same token", "I am a new access token", callback.getAuthenticationResult().getAccessToken()); assertEquals("Same refresh token", refreshToken, callback.getAuthenticationResult().getRefreshToken()); }
11,604
testActivity.mSignal = signal; final MockAuthenticationCallback callback = new MockAuthenticationCallback(signal); context.acquireToken(testActivity, "resource", "clientid", "redirectUri", "userid", callback); signal.await(CONTEXT_REQUEST_TIME_OUT, TimeUnit.MILLISECONDS); <BUG>assertNull("Error is null", callback.mException); </BUG> assertEquals("Activity was attempted to start with request code", AuthenticationConstants.UIRequest.BROWSER_FLOW, testActivity.mStartActivityRequestCode);
assertNull("Error is null", callback.getException());
11,605
testActivity.mSignal = signal; final MockAuthenticationCallback callback = new MockAuthenticationCallback(signal); authContext.setRequestCorrelationId(correlationId); authContext.acquireToken(testActivity, "resource", "clientid", "redirectUri", "userid", callback); signal.await(CONTEXT_REQUEST_TIME_OUT, TimeUnit.MILLISECONDS); <BUG>assertNull("Error is null", callback.mException); </BUG> assertEquals("Activity was attempted to start with request code", AuthenticationConstants.UIRequest.BROWSER_FLOW, testActivity.mStartActivityRequestCode);
context.acquireToken(testActivity, "resource", "clientid", "redirectUri", "userid", assertNull("Error is null", callback.getException());
11,606
Util.createInputStream(response2)); Mockito.when(mockedConnection.getResponseCode()).thenReturn(HttpURLConnection.HTTP_OK); context.acquireToken(testActivity, "resource", "clientid", "redirectUri", TEST_IDTOKEN_UPN, callback); signal.await(CONTEXT_REQUEST_TIME_OUT, TimeUnit.MILLISECONDS); <BUG>verifyRefreshTokenResponse(mockCache, callback.mException, callback.mResult); AuthenticationResult result = context.acquireTokenSilentSync("resource", "clientid",</BUG> TEST_IDTOKEN_USERID); assertEquals("Access Token", "TokenReturnsWithIdToken", result.getAccessToken());
verifyRefreshTokenResponse(mockCache, callback.getException(), callback.getAuthenticationResult()); AuthenticationResult result = context.acquireTokenSilentSync("resource", "clientid",
11,607
Util.createInputStream(Util.getSuccessTokenResponse(true, true))); Mockito.when(mockedConnection.getResponseCode()).thenReturn(HttpURLConnection.HTTP_OK); Intent intent = getResponseIntent(callback, "resource", "clientid", "redirectUri", null); tokenWithAuthenticationActivity(context, testActivity, signal, signalCallback, intent, "resource", "clientid", "redirectUri", null, callback); <BUG>verifyTokenResult(null, callback.mResult); </BUG> AuthenticationResult result = context.acquireTokenSilentSync("resource", "clientid", null); verifyTokenResult(null, result); clearCache(context);
verifyTokenResult(null, callback.getAuthenticationResult());
11,608
Util.createInputStream(response2)); Mockito.when(mockedConnection.getResponseCode()).thenReturn(HttpURLConnection.HTTP_OK); context.acquireToken(testActivity, "resource", "clientid", "redirectUri", TEST_IDTOKEN_UPN, callback); signal.await(CONTEXT_REQUEST_TIME_OUT, TimeUnit.MILLISECONDS); <BUG>verifyRefreshTokenResponse(mockCache, callback.mException, callback.mResult); verifyFamilyIdStoredInTokenCacheItem(mockCache,</BUG> CacheKey.createCacheKeyForRTEntry(VALID_AUTHORITY, "resource", "clientId", TEST_IDTOKEN_UPN), "1"); AuthenticationResult result = context.acquireTokenSilentSync("resource", "clientid",
verifyRefreshTokenResponse(mockCache, callback.getException(), callback.getAuthenticationResult()); verifyFamilyIdStoredInTokenCacheItem(mockCache,
11,609
MockAuthenticationCallback callback3 = new MockAuthenticationCallback(signal3); final MockActivity testActivity = new MockActivity(); testActivity.mSignal = signal3; context.acquireToken(testActivity, resource, clientId, "http://redirectUri", "userName1", callback3); signal3.await(CONTEXT_REQUEST_TIME_OUT, TimeUnit.MILLISECONDS); <BUG>assertNull("Error is null", callback3.mException); assertEquals("token for user1", "token1", callback3.mResult.getAccessToken()); assertEquals("idtoken for user1", "userName1", callback3.mResult.getUserInfo().getDisplayableId()); clearCache(context);</BUG> }
assertNull("Error is null", callback3.getException()); assertEquals("token for user1", "token1", callback3.getAuthenticationResult().getAccessToken()); assertEquals("idtoken for user1", "userName1", callback3.getAuthenticationResult().getUserInfo().getDisplayableId()); clearCache(context);
11,610
HttpUrlConnectionFactory.mockedConnection = null;</BUG> context.acquireToken(testActivity, "anotherResource123", "ClienTid", "redirectUri", TEST_IDTOKEN_UPN, callback); signal.await(CONTEXT_REQUEST_TIME_OUT, TimeUnit.MILLISECONDS); assertEquals("Same token in response as in cache for same call", expectedAT, <BUG>callback.mResult.getAccessToken()); </BUG> signal = new CountDownLatch(1); testActivity = new MockActivity(signal); callback = new MockAuthenticationCallback(signal);
assertFalse("Multiresource is not set in the mocked response", callback.getAuthenticationResult().getIsMultiResourceRefreshToken()); callback.setAuthenticationResult(null); HttpUrlConnectionFactory.mockedConnection = null; callback.getAuthenticationResult().getAccessToken());
11,611
assertEquals("expected key", "authority123endsslash$Resource123$clientid123$n$user123", testKeySlash); final String testKeyWithFamilyCientId = CacheKey.createCacheKey("authority", null, null, true, "user123", "family123"); assertEquals("authority$null$null$y$user123$foci-family123", testKeyWithFamilyCientId); } <BUG>public void testcreateCacheKey_EmptyValues() { String testKey = CacheKey.createCacheKey("", "", "", false, "", "");</BUG> assertEquals("expected key", "$$$n$null$foci-", testKey); String testKeyNullUser = CacheKey.createCacheKey("", "", "", false, null, ""); assertEquals("expected key", "$$$n$null$foci-", testKeyNullUser);
public void testcreateCacheKeyEmptyValues() { String testKey = CacheKey.createCacheKey("", "", "", false, "", "");
11,612
String testKeyNullUser = CacheKey.createCacheKey("", "", "", false, null, ""); assertEquals("expected key", "$$$n$null$foci-", testKeyNullUser); String testKeyWithUser = CacheKey.createCacheKey("", "", "", false, "userid", ""); assertEquals("expected key", "$$$n$userid$foci-", testKeyWithUser); } <BUG>public void testcreateCacheKey_NullItem() { try { CacheKey.createCacheKey((TokenCacheItem)null); </BUG> Assert.fail("not expected");
public void testcreateCacheKeyNullItem() { CacheKey.createCacheKey((TokenCacheItem) null);
11,613
assertEquals("authority$null$clientid$y$user123", cacheKey); } catch (final Exception e) { fail("Non expected exceptions"); } } <BUG>public void testcreateCacheKey_NullClientid() { try {</BUG> CacheKey.createCacheKey("https://authority", "resource", null, false, null, null); fail("Expect exceptions"); } catch (Exception exc) {
public void testcreateCacheKeyNullClientid() { try {
11,614
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.security.DigestOutputStream; import java.security.MessageDigest; <BUG>import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Collections; import java.util.List;</BUG> public final class PatchUtils {
import java.text.DateFormat; import java.util.Date; import java.util.List;
11,615
package org.jboss.as.patching.runner; <BUG>import org.jboss.as.boot.DirectoryStructure; import org.jboss.as.patching.LocalPatchInfo;</BUG> import org.jboss.as.patching.PatchInfo; import org.jboss.as.patching.PatchLogger; import org.jboss.as.patching.PatchMessages;
import static org.jboss.as.patching.runner.PatchUtils.generateTimestamp; import org.jboss.as.patching.CommonAttributes; import org.jboss.as.patching.LocalPatchInfo;
11,616
private static final String PATH_DELIMITER = "/"; public static final byte[] NO_CONTENT = PatchingTask.NO_CONTENT; enum Element { ADDED_BUNDLE("added-bundle"), ADDED_MISC_CONTENT("added-misc-content"), <BUG>ADDED_MODULE("added-module"), BUNDLES("bundles"),</BUG> CUMULATIVE("cumulative"), DESCRIPTION("description"), MISC_FILES("misc-files"),
APPLIES_TO_VERSION("applies-to-version"), BUNDLES("bundles"),
11,617
final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { <BUG>case APPLIES_TO_VERSION: builder.addAppliesTo(value); break;</BUG> case RESULTING_VERSION: if(type == Patch.PatchType.CUMULATIVE) {
[DELETED]
11,618
final StringBuilder path = new StringBuilder(); for(final String p : item.getPath()) { path.append(p).append(PATH_DELIMITER); } path.append(item.getName()); <BUG>writer.writeAttribute(Attribute.PATH.name, path.toString()); if(type != ModificationType.REMOVE) {</BUG> writer.writeAttribute(Attribute.HASH.name, bytesToHexString(item.getContentHash())); } if(type != ModificationType.ADD) {
if (item.isDirectory()) { writer.writeAttribute(Attribute.DIRECTORY.name, "true"); if(type != ModificationType.REMOVE) {
11,619
package org.jboss.as.patching; import org.jboss.as.controller.OperationFailedException; import org.jboss.as.patching.runner.PatchingException; import org.jboss.logging.Messages; import org.jboss.logging.annotations.Message; <BUG>import org.jboss.logging.annotations.MessageBundle; import java.io.IOException;</BUG> import java.util.List; @MessageBundle(projectCode = "JBAS") public interface PatchMessages {
import org.jboss.logging.annotations.Cause; import java.io.IOException;
11,620
customTokens.put("%%mlFinalForestsPerHost%%", hubConfig.finalForestsPerHost.toString()); customTokens.put("%%mlTraceAppserverName%%", hubConfig.traceHttpName); customTokens.put("%%mlTracePort%%", hubConfig.tracePort.toString()); customTokens.put("%%mlTraceDbName%%", hubConfig.traceDbName); customTokens.put("%%mlTraceForestsPerHost%%", hubConfig.traceForestsPerHost.toString()); <BUG>customTokens.put("%%mlModulesDbName%%", hubConfig.modulesDbName); }</BUG> public void init() { try { LOGGER.error("PLUGINS DIR: " + pluginsDir.toString());
customTokens.put("%%mlTriggersDbName%%", hubConfig.triggersDbName); customTokens.put("%%mlSchemasDbName%%", hubConfig.schemasDbName); }
11,621
</BUG> + "[(14-19)s:treat|_1$<i>14<i>19|" + "<>:vb$<b>64<i>14<i>19<i>2<b>0<s>1|" + "<>:vp$<b>64<i>14<i>36<i>4<b>0<s>2|" <BUG>+ ">:stanford/d:tag$<b>32<i>0<s>1<s>3|" + ">:stanford/d:tag$<b>32<i>3<s>1<s>1|" + ">:stanford/d:tag$<b>32<i>4<s>1<s>1]" </BUG> + "[(20-22)s:my|_2$<i>20<i>22|"
"Frankenstein, treat my daughter well. She is the one that saved your master who you hold so dear.", "[(0-12)s:Frankenstein|_0$<i>0<i>12|" + "<>:nn$<b>64<i>0<i>12<i>1<b>0<s>3|" + "<>:np$<b>64<i>0<i>13<i>1<b>0<s>2|" + "<>:s$<b>64<i>0<i>37<i>4<b>0<s>1|" + "<:stanford/d:tag$<b>32<i>1<s>3<s>1<s>0]" + ">:stanford/d:tag$<b>32<i>0<s>1<s>3<s>0|" + ">:stanford/d:tag$<b>32<i>3<s>1<s>1<s>0|" + ">:stanford/d:tag$<b>32<i>4<s>1<s>1<s>0]"
11,622
+ "[(20-22)s:my|_2$<i>20<i>22|" + "<>:prp$<b>64<i>20<i>22<i>3<b>0<s>1|" + "<>:np$<b>64<i>20<i>31<i>3<b>0<s>2]" + "[(23-31)s:daughter|_3$<i>23<i>31|" + "<>:nn$<b>64<i>23<i>31<i>4<b>0<s>1|" <BUG>+ ">:stanford/d:tag$<b>32<i>2<s>1<s>1]" </BUG> + "[(32-36)s:well|_4$<i>32<i>36|" + "<>:rb$<b>64<i>32<i>36<i>5<b>0<s>1|" + "<>:advp$<b>64<i>32<i>36<i>4<b>0<s>2]");
+ ">:stanford/d:tag$<b>32<i>2<s>1<s>1<s>0]"
11,623
</BUG> + "[(14-19)s:treat|_1$<i>14<i>19|" + "<>:vb$<b>64<i>14<i>19<i>2<b>0<s>1|" + "<>:vp$<b>64<i>14<i>36<i>5<b>0<s>2|" <BUG>+ ">:stanford/d:tag$<b>32<i>0<s>1<s>2|" + ">:stanford/d:tag$<b>32<i>3<s>1<s>1|" + ">:stanford/d:tag$<b>32<i>4<s>1<s>1]" </BUG> + "[(20-22)s:my|_2$<i>20<i>22|"
"Frankenstein, treat my daughter well. She is the one that saved your master who you hold so dear.", "[(0-12)s:Frankenstein|_0$<i>0<i>12|" + "<>:nn$<b>64<i>0<i>12<i>1<b>0<s>3|" + "<>:np$<b>64<i>0<i>13<i>1<b>0<s>2|" + "<>:s$<b>64<i>0<i>37<i>5<b>0<s>1|" + "<:stanford/d:tag$<b>32<i>1<s>3<s>1<s>0]" + ">:stanford/d:tag$<b>32<i>0<s>1<s>2<s>0|" + ">:stanford/d:tag$<b>32<i>3<s>1<s>1<s>0|" + ">:stanford/d:tag$<b>32<i>4<s>1<s>1<s>0]"
11,624
+ "[(20-22)s:my|_2$<i>20<i>22|" + "<>:prp$<b>64<i>20<i>22<i>3<b>0<s>1|" + "<>:np$<b>64<i>20<i>31<i>4<b>0<s>2]" + "[(23-31)s:daughter|_3$<i>23<i>31|" + "<>:nn$<b>64<i>23<i>31<i>4<b>0<s>1|" <BUG>+ ">:stanford/d:tag$<b>32<i>2<s>21<s>1]" </BUG> + "[(32-36)s:well|_4$<i>32<i>36|" + "<>:rb$<b>64<i>32<i>36<i>5<b>0<s>1|" + "<>:advp$<b>64<i>32<i>36<i>5<b>0<s>2]"
+ ">:stanford/d:tag$<b>32<i>2<s>21<s>1<s>0]"
11,625
+ "<>:dt$<b>64<i>45<i>48<i>8<b>0<s>3|" + "<>:np$<b>64<i>45<i>52<i>9<b>0<s>2|" + "<>:np$<b>64<i>45<i>96<i>18<b>0<s>1]" + "[(49-52)s:one|_8$<i>49<i>52|" + "<>:nn$<b>64<i>49<i>52<i>9<b>0<s>1|" <BUG>+ ">:stanford/d:tag$<b>32<i>5<s>1<s>3|" + ">:stanford/d:tag$<b>32<i>6<s>1<s>1|" + ">:stanford/d:tag$<b>32<i>7<s>1<s>3|" + ">:stanford/d:tag$<b>32<i>10<s>1<s>1]" </BUG> + "[(53-57)s:that|_9$<i>53<i>57|"
+ ">:stanford/d:tag$<b>32<i>5<s>1<s>3<s>0|" + ">:stanford/d:tag$<b>32<i>6<s>1<s>1<s>0|" + ">:stanford/d:tag$<b>32<i>7<s>1<s>3<s>0|" + ">:stanford/d:tag$<b>32<i>10<s>1<s>1<s>0]"
11,626
+ "<>:sb$<b>64<i>53<i>96<i>18<b>0<s>2]" + "[(58-63)s:saved|_10$<i>58<i>63|" + "<>:vb$<b>64<i>58<i>63<i>11<b>0<s>1|" + "<>:s$<b>64<i>58<i>96<i>18<b>0<s>2|" + "<>:vp$<b>64<i>58<i>96<i>18<b>0<s>3|" <BUG>+ ">:stanford/d:tag$<b>32<i>9<s>1<s>1|" + ">:stanford/d:tag$<b>32<i>12<s>1<s>1|" + ">:stanford/d:tag$<b>32<i>15<s>1<s>33]" </BUG> + "[(64-68)s:your|_11$<i>64<i>68|"
+ ">:stanford/d:tag$<b>32<i>9<s>1<s>1<s>0|" + ">:stanford/d:tag$<b>32<i>12<s>1<s>1<s>0|" + ">:stanford/d:tag$<b>32<i>15<s>1<s>33<s>0]"
11,627
+ "[(64-68)s:your|_11$<i>64<i>68|" + "<>:prp$<b>64<i>64<i>68<i>12<b>0<s>1|" + "<>:np$<b>64<i>64<i>75<i>13<b>0<s>2]" + "[(69-75)s:master|_12$<i>69<i>75|" + "<>:nn$<b>64<i>69<i>75<i>13<b>0<s>1|" <BUG>+ ">:stanford/d:tag$<b>32<i>11<s>1<s>1]" </BUG> + "[(76-79)s:who|_13$<i>76<i>79|" + "<>:rp$<b>64<i>76<i>79<i>14<b>0<s>1|" + "<>:sb$<b>64<i>76<i>96<i>18<b>0<s>2]"
+ ">:stanford/d:tag$<b>32<i>11<s>1<s>1<s>0]"
11,628
+ "<>:np$<b>64<i>80<i>83<i>15<b>0<s>2|" + "<>:s$<b>64<i>80<i>96<i>18<b>0<s>1]" + "[(84-88)s:hold|_15$<i>84<i>88|" + "<>:vb$<b>64<i>84<i>88<i>16<b>0<s>2|" + "<>:vp$<b>64<i>84<i>96<i>18<b>0<s>1|" <BUG>+ ">:stanford/d:tag$<b>32<i>13<s>2<s>1|" + ">:stanford/d:tag$<b>32<i>14<s>2<s>3|" + ">:stanford/d:tag$<b>32<i>17<s>2<s>1]" </BUG> + "[(89-91)s:so|_16$<i>89<i>91|"
+ ">:stanford/d:tag$<b>32<i>13<s>2<s>1<s>0|" + ">:stanford/d:tag$<b>32<i>14<s>2<s>3<s>0|" + ">:stanford/d:tag$<b>32<i>17<s>2<s>1<s>0]"
11,629
import org.apache.lucene.search.spans.Spans; import org.apache.lucene.util.Bits; import org.apache.lucene.util.ToStringUtils; import de.ids_mannheim.korap.query.spans.RelationSpans; public class SpanRelationQuery extends SimpleSpanQuery { <BUG>private int direction = 0; </BUG> private byte tempSourceNum = 1; private byte tempTargetNum = 2; private byte sourceClass;
private int direction = 0; // >
11,630
removeTemporaryClasses = query.removeTemporaryClasses(); candidateSpans = new ArrayList<CandidateSpan>(); hasMoreSpans = firstSpans.next(); currentDoc = firstSpans.doc(); this.query = query; <BUG>if (getSpanId() > 0) { hasSpanId = true; }</BUG> } @Override
[DELETED]
11,631
else { Log.d(getClass().getCanonicalName(), "Creating new PilotStack!"); try { <BUG>PilotFrame launchFrame = launchFrameClass.getConstructor().newInstance(); pilotStack.pushFrame(launchFrame); </BUG> } catch (Exception e)
pilotStack.pushFrame(launchFrameClass);
11,632
package com.kodroid.pilot.lib.stack; <BUG>import java.io.Serializable; import java.util.Stack;</BUG> public class PilotStack implements Serializable { private Stack<PilotFrame> mStack = new Stack<>();
import java.lang.reflect.InvocationTargetException; import java.util.Stack;
11,633
if(!isInvisibleFrame(currentFrame)) return currentFrame; } return null; } <BUG>public PilotStack pushFrame(PilotFrame frameToPush) { frameToPush.setParentStack(this);</BUG> mStack.push(frameToPush);
public PilotStack pushFrame(Class<? extends PilotFrame> frameClassToPush) return pushFrame(frameClassToPush, null); public PilotStack pushFrame(Class<? extends PilotFrame> frameClassToPush, Args args) PilotFrame frameToPush = createFrame(frameClassToPush, args); frameToPush.setParentStack(this);
11,634
INCLUSIVE, EXCLUSIVE; } public PilotStack popStackAtFrameType(Class<? extends PilotFrame> clazz, PopType popType, boolean notifyListeners) { <BUG>for(int i = 0; i < mStack.size(); i++) {</BUG> if(mStack.get(i).getClass() == clazz) { int removeFrom = (popType == PopType.INCLUSIVE ? i : i+1);
for(int i = mStack.size()-1; i >= 0; i--)
11,635
protected String _localName = null; protected String _globalPrefix = null; protected ArrayList<ContentName> _names = new ArrayList<ContentName>(); protected ContentName _policyName; protected RepoInfoType _type = RepoInfoType.INFO; <BUG>protected static String DEFAULT_DICTIONARY_RESNAME = "repotags.csvdict"; private static BinaryXMLDictionary _dictionary;</BUG> private static final String REPOSITORY_INFO_ELEMENT = "RepositoryInfo"; private static final String REPOSITORY_INFO_TYPE_ELEMENT = "Type"; private static final String REPOSITORY_INFO_VERSION_ELEMENT = "Version";
[DELETED]
11,636
} return UNKNOWN; } } protected static final HashMap<RepoInfoType, String> _InfoTypeNames = new HashMap<RepoInfoType, String>(); <BUG>static { try { _dictionary = new BinaryXMLDictionary(DEFAULT_DICTIONARY_RESNAME); } catch (IOException e) { Log.logStackTrace(Level.WARNING, e); e.printStackTrace(); } }</BUG> public RepositoryInfo(String version, String globalPrefix, String localName) throws MalformedContentNameStringException {
static RepoInfoType valueFromString(String value) { for (RepoInfoType pv : RepoInfoType.values()) { if (pv._stringValue != null) { if (pv._stringValue.equals(value.toUpperCase())) return pv;
11,637
public final static String PROJECT_EDIT = "/project/edit"; public final static String PROJECT_CREATE = "/project/create"; public final static String PROJECT_DELETE = "/project/delete"; public final static String PROJECT_ADD_ARTICLE = "/project/article/add"; public final static String PROJECT_REMOVE_ARTICLE = "/project/article/remove"; <BUG>public final static String PROJECT_IMAGE_UPLOAD = "/project/image/upload"; public final static String CARTS = "/carts";</BUG> public final static String CHANGE_CART_STATE = "/cart/changeState"; public final static String PLANT_FOR_USER = "/plantForUser"; public final static String USERS = "/users";
public final static String PROJECT_IMAGE_CREATE_EDIT = "/project/image/createEdit"; public final static String PROJECT_IMAGE_DELETE = "/project/image/delete"; public final static String CARTS = "/carts";
11,638
final TokenList tl = new TokenList(); tl.add(name); tl.add(f.length()); table.contents.add(tl); } <BUG>table.sort(); out.println(table.finish()); </BUG> return true; }
out.println(table.sort().finish());
11,639
tl.add(size); if(create) tl.add(file); table.contents.add(tl); } } <BUG>table.sort(); out.println(table.finish()); </BUG> return true; }
out.println(table.sort().finish());
11,640
} catch(final IOException ex) { Util.debug(ex); final String msg = ex.getMessage(); return msg.isEmpty() ? error(DB_NOT_OPENED_X, db) : error(msg); } <BUG>table.sort(); out.println(table.finish()); </BUG> return true; }
out.println(table.sort().finish());
11,641
if(sz == 5) { tl.add(user.has(Perm.CREATE) ? "X" : ""); tl.add(user.has(Perm.ADMIN) ? "X" : ""); } table.contents.add(tl); <BUG>} table.sort(); table.toTop(token(ADMIN)); return table.finish();</BUG> }
[DELETED]
11,642
entry.add(trim(substring(line, il.get(e), il.get(e + 1)))); } contents.add(entry); } } <BUG>public void sort() { </BUG> Collections.sort(contents, new Comparator<TokenList>() { @Override public int compare(final TokenList tl1, final TokenList tl2) {
public Table sort() {
11,643
Collections.sort(contents, new Comparator<TokenList>() { @Override public int compare(final TokenList tl1, final TokenList tl2) { return diff(lc(tl1.get(0)), lc(tl2.get(0))); } <BUG>}); }</BUG> public String value(final int r, final int c) { return string(contents.get(r).get(c)); }
return this;
11,644
if(eq(top, contents.get(i).get(0))) { contents.add(0, contents.remove(i)); <BUG>return; } } }</BUG> public byte[] finish() { final int[] ind = new int[header.size()]; final int sz = header.size(); for(int s = 0; s < sz; ++s) {
break; return this;
11,645
private final BaseXButton install; private final BaseXButton delete; private final BaseXLabel name; private final BaseXLabel version; private final BaseXLabel type; <BUG>private final BaseXLabel directory; </BUG> private boolean refresh; public DialogPackages(final GUI main) { super(main, PACKAGES);
private final BaseXLabel path;
11,646
packages.setSize(270, 160); title = new BaseXLabel(" ").large().border(0, 5, 5, 0); name = new BaseXLabel(" "); version = new BaseXLabel(" "); type = new BaseXLabel(" "); <BUG>directory = new BaseXLabel(" "); </BUG> final BaseXBack table = new BaseXBack(new TableLayout(4, 2, 16, 0)).border(5); table.add(new BaseXLabel(NAME + COL, false, true)); table.add(name);
path = new BaseXLabel(" ");
11,647
table.add(name); table.add(new BaseXLabel(VERSINFO + COL, false, true)); table.add(version); table.add(new BaseXLabel(TYPE + COL, false, true)); table.add(type); <BUG>table.add(new BaseXLabel(DIRECTORY + COL, false, true)); table.add(directory); install = new BaseXButton(INSTALL + DOTS, this);</BUG> delete = new BaseXButton(DELETE + DOTS, this);
table.add(new BaseXLabel(PATH + COL, false, true)); table.add(path); install = new BaseXButton(INSTALL + DOTS, this);
11,648
refresh = false; } final StringList pkgs = packages.getValues(); final ArrayList<Command> cmds = new ArrayList<Command>(); if(cmp == install) { <BUG>final String path = gui.gprop.get(GUIProp.PKGPATH); final BaseXFileChooser fc = new BaseXFileChooser(FILE_OR_DIR, path, gui); </BUG> fc.addFilter(XML_ARCHIVES, IO.XARSUFFIX);
final String pp = gui.gprop.get(GUIProp.PKGPATH); final BaseXFileChooser fc = new BaseXFileChooser(FILE_OR_DIR, pp, gui);
11,649
String DOCUMENTS = lang("documents"); String BINARIES = lang("binaries"); String INPUT_SIZE = lang("input_size"); String ENCODING = lang("encoding"); String METHOD = lang("method"); <BUG>String PARAMETERS = lang("parameters"); String WS_CHOPPING = lang("ws_chopping");</BUG> String TEXT_INDEX = lang("text_index"); String ATTRIBUTE_INDEX = lang("attribute_index"); String FULLTEXT_INDEX = lang("fulltext_index");
String PATH = lang("path"); String WS_CHOPPING = lang("ws_chopping");
11,650
package com.easytoolsoft.easyreport.web.controller.common; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller @RequestMapping(value = "/error") <BUG>public class ErrorController extends AbstractController { @RequestMapping(value = {"/404"})</BUG> public String error404() { return "/error/404"; }
public class ErrorController { @RequestMapping(value = {"/404"})
11,651
String baseName = FilenameUtils.getName(uri.getPath()); </BUG> File tempFile = new File(getPluginsDir(), baseName); <BUG>FileUtils.copyURLToFile(uri.toURL(), tempFile); </BUG> } public File getMuleHome() { return muleHome;
throw new IllegalStateException("Unable to add application archive"); public void addZippedPlugin(String resource) throws IOException, URISyntaxException URL url = getClass().getClassLoader().getResource(resource).toURI().toURL(); String baseName = FilenameUtils.getName(url.getPath()); FileUtils.copyURLToFile(url, tempFile);
11,652
import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.os.Handler; <BUG>import android.support.v4.app.NavUtils; import android.support.v7.app.AppCompatActivity;</BUG> import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.ContextMenu;
import android.support.v4.view.MenuItemCompat; import android.support.v7.app.AppCompatActivity;
11,653
import android.database.ContentObserver; import android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; import android.os.Handler; <BUG>import android.support.v4.app.NavUtils; import android.support.v7.app.AppCompatActivity;</BUG> import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.ContextMenu;
import android.support.v4.view.MenuItemCompat; import android.support.v7.app.AppCompatActivity;
11,654
import android.os.Handler; import android.os.Looper; import android.os.PowerManager; import android.os.PowerManager.WakeLock; import android.preference.PreferenceManager; <BUG>import android.support.design.widget.FloatingActionButton; import android.support.v7.widget.Toolbar;</BUG> import android.util.Log; import android.view.ContextMenu; import android.view.KeyEvent;
import android.support.v4.view.MenuItemCompat; import android.support.v7.widget.Toolbar;
11,655
mAltitude.setOnCheckedChangeListener(mCheckedChangeListener); mDistance.setOnCheckedChangeListener(mCheckedChangeListener); mCompass.setOnCheckedChangeListener(mCheckedChangeListener); mLocation.setOnCheckedChangeListener(mCheckedChangeListener); builder.setTitle(R.string.dialog_layer_title).setIcon(android.R.drawable.ic_dialog_map).setPositiveButton <BUG>(R.string.btn_okay, null).setView(view); </BUG> dialog = builder.create(); return dialog; case DIALOG_NOTRACK:
(android.R.string.ok, null).setView(view);
11,656
import org.apache.commons.io.FileUtils; public class BetterFpsHelper { public static final String MC_VERSION = "1.9"; public static final String VERSION = "1.2.1"; public static final String URL = "http://guichaguri.github.io/BetterFps/"; <BUG>public static final String UPDATE_URL = "https://raw.githubusercontent.com/Guichaguri/BetterFps/1.8/lastest-version.properties"; public static final LinkedHashMap<String, String> helpers = new LinkedHashMap<String, String>();</BUG> public static final LinkedHashMap<String, String> displayHelpers = new LinkedHashMap<String, String>(); static { helpers.put("vanilla", "VanillaMath");
public static final String UPDATE_URL = "http://widget.mcf.li/mc-mods/minecraft/229876-betterfps.json"; public static final LinkedHashMap<String, String> helpers = new LinkedHashMap<String, String>();
11,657
<BUG>package guichaguri.betterfps; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.util.Properties;</BUG> import net.minecraft.client.Minecraft;
import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import java.io.InputStreamReader;
11,658
import net.minecraft.util.text.event.ClickEvent; import net.minecraft.util.text.event.HoverEvent; public class UpdateChecker implements Runnable { private static boolean updateCheck = false; private static boolean done = false; <BUG>private static Properties prop = null; public static void check() {</BUG> if(!BetterFpsConfig.getConfig().updateChecker) { done = true; return;
private static String updateVersion = null; private static String updateDownload = null; public static void check() {
11,659
thread.setDaemon(true); thread.start(); } } public static void showChat() { <BUG>if(!done) return; if(prop == null) return; if(BetterFpsHelper.VERSION.equals(prop.getProperty("version"))) { prop = null; return; }</BUG> if(!BetterFps.isClient) return;
if(updateVersion == null && updateDownload == null) return;
11,660
@CopyMode(Mode.IGNORE) // Ignore the constructor to prevent an infinite loop public HopperBlock() { } @Override @CopyMode(Mode.APPEND) <BUG>public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) { </BUG> TileEntity te = worldIn.getTileEntity(pos); if(te != null) { TileEntityHopper hopper = (TileEntityHopper)te;
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block neighborBlock) {
11,661
} if (json.getValue("heartbeat") instanceof JsonObject) { obj.setHeartbeat(((JsonObject)json.getValue("heartbeat")).copy()); } if (json.getValue("maxBodyLength") instanceof Number) { <BUG>obj.setMaxBodyLength(((Number)json.getValue("maxBodyLength")).intValue()); }</BUG> if (json.getValue("maxHeaderLength") instanceof Number) { obj.setMaxHeaderLength(((Number)json.getValue("maxHeaderLength")).intValue()); }
if (json.getValue("maxFrameInTransaction") instanceof Number) { obj.setMaxFrameInTransaction(((Number)json.getValue("maxFrameInTransaction")).intValue());
11,662
public static void toJson(StompServerOptions obj, JsonObject json) { json.put("ackTimeout", obj.getAckTimeout()); if (obj.getHeartbeat() != null) { json.put("heartbeat", obj.getHeartbeat()); } <BUG>json.put("maxBodyLength", obj.getMaxBodyLength()); json.put("maxHeaderLength", obj.getMaxHeaderLength());</BUG> json.put("maxHeaders", obj.getMaxHeaders()); json.put("secured", obj.isSecured()); json.put("sendErrorOnNoSubscriptions", obj.isSendErrorOnNoSubscriptions());
json.put("maxFrameInTransaction", obj.getMaxFrameInTransaction()); json.put("maxHeaderLength", obj.getMaxHeaderLength());
11,663
private final I18n i18n; private Filter filter; ApplicationElement(TodoItemRepository repository, I18n i18n) { this.repository = repository; this.i18n = i18n; <BUG>Elements.Builder builder = new Elements.Builder() .section().css("todoapp")</BUG> .header().css("header") .h(1).innerText(i18n.constants().todos()).end() .input(text)
TodoBuilder builder = new TodoBuilder() .section().css("todoapp")
11,664
import static org.junit.Assert.assertNotNull; import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; public class ElementsBuilderTest { <BUG>private Elements.Builder builder; </BUG> @Before public void setUp() { Document document = mock(Document.class);
private TestableBuilder builder;
11,665
when(document.createParagraphElement()).thenAnswer(invocation -> new StandaloneElement("p")); when(document.createSelectElement()).thenAnswer(invocation -> new StandaloneInputElement("select")); when(document.createSpanElement()).thenAnswer(invocation -> new StandaloneElement("span")); when(document.createTextAreaElement()).thenAnswer(invocation -> new StandaloneInputElement("textarea")); when(document.createUListElement()).thenAnswer(invocation -> new StandaloneElement("ul")); <BUG>builder = new Elements.Builder(document); </BUG> } @Test public void headings() {
builder = new TestableBuilder(document);
11,666
TodoItemRepository repository = new TodoItemRepository(BEAN_FACTORY); ApplicationElement application = new ApplicationElement(repository, i18n); Element body = Browser.getDocument().getBody(); body.appendChild(application.asElement()); body.appendChild(new FooterElement(i18n).asElement()); <BUG>Element e = new MyBuilder().ahref( "http://www.google.com" ) .img( "https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" ).end() .end().build(); body.appendChild( e );</BUG> History.addValueChangeHandler(event -> application.filter(event.getValue()));
[DELETED]
11,667
@Override public String toString() { return (container ? "container" : "simple") + " @ " + level + ": " + element.getTagName(); } } <BUG>public static class Builder extends CoreBuilder<Builder> { public Builder() { super(Browser.getDocument()); } protected Builder(Document document) { super( document );</BUG> }
[DELETED]
11,668
return start(document.createElement(tag)); } public B start(Element element) { elements.push(new ElementInfo(element, true, level)); level++; <BUG>return (B) this; }</BUG> public B end() { assertCurrent(); if (level == 0) {
return that();
11,669
Element closingElement = elements.peek().element; for (ElementInfo child : children) { closingElement.appendChild(child.element); } level--; <BUG>return (B) this; }</BUG> private String dumpElements() { return elements.toString(); }
return that();
11,670
} public B on(EventType type, EventListener listener) { assertCurrent(); Element element = elements.peek().element; type.register(element, listener); <BUG>return (B) this; }</BUG> public B rememberAs(String id) { assertCurrent(); references.put(id, elements.peek().element);
public B attr(String name, String value) { elements.peek().element.setAttribute(name, value); return that();
11,671
Group group = siteService.findGroup(sectionUuid); CourseSection section = getSection(sectionUuid); if(section == null) { return new ArrayList(); } <BUG>if(log.isDebugEnabled()) log.debug("Getting section enrollments in " + sectionUuid); Set sakaiUserUids = group.getUsersHasRole(getSectionStudentRole(group)); </BUG> List sakaiUsers = userDirectoryService.getUsers(sakaiUserUids); List membersList = new ArrayList();
String studentRole = getSectionStudentRole(group); if(studentRole == null) { Set sakaiUserUids = group.getUsersHasRole(studentRole);
11,672
Group group = siteService.findGroup(sectionUuid); CourseSection section = getSection(sectionUuid); if(section == null) { return new ArrayList(); } <BUG>if(log.isDebugEnabled()) log.debug("Getting section enrollments in " + sectionUuid); Set sakaiUserUids = group.getUsersHasRole(getSectionTaRole(group)); List sakaiUsers = userDirectoryService.getUsers(sakaiUserUids);</BUG> List membersList = new ArrayList(); for(Iterator iter = sakaiUsers.iterator(); iter.hasNext();) {
String studentRole = getSectionStudentRole(group); if(studentRole == null) { Set sakaiUserUids = group.getUsersHasRole(studentRole); List sakaiUsers = userDirectoryService.getUsers(sakaiUserUids);
11,673
Group group = siteService.findGroup(sectionUuid); CourseSection section = getSection(sectionUuid); if(section == null) { return new ArrayList(); } <BUG>if(log.isDebugEnabled()) log.debug("Getting section enrollments in " + sectionUuid); Set sakaiUserUids = group.getUsersHasRole(getSectionTaRole(group)); List sakaiUsers = userDirectoryService.getUsers(sakaiUserUids);</BUG> List membersList = new ArrayList(); for(Iterator iter = sakaiUsers.iterator(); iter.hasNext();) {
String taRole = getSectionTaRole(group); if(taRole == null) { Set sakaiUserUids = group.getUsersHasRole(taRole); List sakaiUsers = userDirectoryService.getUsers(sakaiUserUids);
11,674
Group group = siteService.findGroup(sectionUuid); CourseSection section = getSection(sectionUuid); if(section == null) { return new ArrayList(); } <BUG>if(log.isDebugEnabled()) log.debug("Getting section enrollments in " + sectionUuid); Set sakaiUserUids = group.getUsersHasRole(getSectionStudentRole(group)); </BUG> List sakaiUsers = userDirectoryService.getUsers(sakaiUserUids); List membersList = new ArrayList();
String taRole = getSectionTaRole(group); if(taRole == null) { Set sakaiUserUids = group.getUsersHasRole(taRole);
11,675
Event event = eventTrackingService.newEvent(message, objectReference, true); eventTrackingService.post(event); } public EnrollmentRecord joinSection(String sectionUuid) { Group group = siteService.findGroup(sectionUuid); <BUG>String role = getSectionStudentRole(group); try {</BUG> authzGroupService.joinGroup(sectionUuid, role); postEvent("User joined section", sectionUuid); } catch (PermissionException e) {
if(role == null) { throw new RuntimeException("Can not join section, since there is no student-flagged role"); try {
11,676
sakaiRoleString = getSectionStudentRole(group); } else { String str = "Only students and TAs can be added to sections"; log.error(str); throw new RuntimeException(str); <BUG>} Set currentUserIds = group.getUsersHasRole(sakaiRoleString);</BUG> for(Iterator iter = currentUserIds.iterator(); iter.hasNext();) { String userUid = (String)iter.next(); group.removeMember(userUid);
if(sakaiRoleString == null) { throw new RuntimeException("Can't set memberships for role " + role + ". No sakai role string can be found for this role."); Set currentUserIds = group.getUsersHasRole(sakaiRoleString);
11,677
coursePref += p.getTarget().getCourseName() + ": " + (p.isRequired() ? "R" : p.isProhibited() ? "P" : p.getPreference()); } out.print(",\"" + coursePref + "\""); out.print("," + (instructor.getBackToBackPreference() == 0 ? "" : instructor.getBackToBackPreference())); out.print("," + new DecimalFormat("0.0").format(instructor.getMaxLoad())); <BUG>InstructorConstraint.Context context = ic.getContext(assignment); </BUG> out.print("," + new DecimalFormat("0.0").format(context.getLoad())); out.print("," + (context.countBackToBackPercentage() == 0.0 ? "" : new DecimalFormat("0.0").format(100.0 * context.countBackToBackPercentage()))); out.print("," + (context.countDifferentLectures() == 0.0 ? "" : new DecimalFormat("0.0").format(100.0 * context.countDifferentLectures())));
Instructor.Context context = instructor.getContext(assignment);
11,678
public ReportElement getBase() { return base; } @Override public float print(PDDocument document, PDPageContentStream stream, int pageNumber, float startX, float startY, float allowedWidth) throws IOException { <BUG>PDPage currPage = (PDPage) document.getDocumentCatalog().getPages().get(pageNo); PDPageContentStream pageStream = new PDPageContentStream(document, currPage, true, false); </BUG> base.print(document, pageStream, pageNo, x, y, width); pageStream.close();
PDPage currPage = document.getDocumentCatalog().getPages().get(pageNo); PDPageContentStream pageStream = new PDPageContentStream(document, currPage, PDPageContentStream.AppendMode.APPEND, false);
11,679
public PdfTextStyle(String config) { Assert.hasText(config); String[] split = config.split(","); Assert.isTrue(split.length == 3, "config must look like: 10,Times-Roman,#000000"); fontSize = Integer.parseInt(split[0]); <BUG>font = resolveStandard14Name(split[1]); color = new Color(Integer.valueOf(split[2].substring(1), 16));</BUG> } public int getFontSize() { return fontSize;
font = getFont(split[1]); color = new Color(Integer.valueOf(split[2].substring(1), 16));
11,680
package cc.catalysts.boot.report.pdf.elements; import cc.catalysts.boot.report.pdf.config.PdfTextStyle; import cc.catalysts.boot.report.pdf.utils.ReportAlignType; import org.apache.pdfbox.pdmodel.PDPageContentStream; <BUG>import org.apache.pdfbox.pdmodel.font.PDFont; import org.slf4j.Logger;</BUG> import org.slf4j.LoggerFactory; import org.springframework.util.StringUtils; import java.io.IOException;
import org.apache.pdfbox.pdmodel.font.PDType1Font; import org.apache.pdfbox.util.Matrix; import org.slf4j.Logger;
11,681
addTextSimple(stream, textConfig, textX, nextLineY, ""); return nextLineY; } try { <BUG>String[] split = splitText(textConfig.getFont(), textConfig.getFontSize(), allowedWidth, fixedText); </BUG> float x = calculateAlignPosition(textX, align, textConfig, allowedWidth, split[0]); if (!underline) { addTextSimple(stream, textConfig, x, nextLineY, split[0]); } else {
String[] split = splitText(textConfig.getFont(), textConfig.getFontSize(), allowedWidth, text);
11,682
public static void addTextSimple(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) { try { stream.setFont(textConfig.getFont(), textConfig.getFontSize()); stream.setNonStrokingColor(textConfig.getColor()); stream.beginText(); <BUG>stream.newLineAtOffset(textX, textY); stream.showText(text);</BUG> } catch (Exception e) { LOG.warn("Could not add text: " + e.getClass() + " - " + e.getMessage()); }
stream.setTextMatrix(new Matrix(1,0,0,1, textX, textY)); stream.showText(text);
11,683
public static void addTextSimpleUnderlined(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) { addTextSimple(stream, textConfig, textX, textY, text); try { float lineOffset = textConfig.getFontSize() / 8F; stream.setStrokingColor(textConfig.getColor()); <BUG>stream.setLineWidth(0.5F); stream.drawLine(textX, textY - lineOffset, textX + getTextWidth(textConfig.getFont(), textConfig.getFontSize(), text), textY - lineOffset); </BUG> stream.stroke(); } catch (IOException e) {
stream.moveTo(textX, textY - lineOffset); stream.lineTo(textX + getTextWidth(textConfig.getFont(), textConfig.getFontSize(), text), textY - lineOffset);
11,684
list.add(text.length()); return list; } public static String[] splitText(PDFont font, int fontSize, float allowedWidth, String text) { String endPart = ""; <BUG>String shortenedText = text; List<String> breakSplitted = Arrays.asList(shortenedText.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList()); if (breakSplitted.size() > 1) {</BUG> String[] splittedFirst = splitText(font, fontSize, allowedWidth, breakSplitted.get(0)); StringBuilder remaining = new StringBuilder(splittedFirst[1] == null ? "" : splittedFirst[1] + "\n");
List<String> breakSplitted = Arrays.asList(text.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList()); if (breakSplitted.size() > 1) {
11,685
package cc.catalysts.boot.report.pdf.elements; import org.apache.pdfbox.pdmodel.PDDocument; <BUG>import org.apache.pdfbox.pdmodel.edit.PDPageContentStream; import java.io.IOException;</BUG> import java.util.ArrayList; import java.util.Collection; import java.util.LinkedList;
import org.apache.pdfbox.pdmodel.PDPageContentStream; import java.io.IOException;
11,686
private Provider<ComponentManager> componentManagerProvider; private DocumentInstanceOutputProperties properties; private WrappingListener contentListener = new WrappingListener(); private DefaultWikiPrinter currentWikiPrinter; private EntityReference currentEntityReference; <BUG>private Locale currentLocale; private Date currentCreationDate; private String currentCreationAuthor;</BUG> private Locale currentDefaultLocale; private XWikiDocument document;
private FilterEventParameters currentLocaleParameters;
11,687
this.currentDefaultLocale = null; } @Override public void beginWikiDocumentLocale(Locale locale, FilterEventParameters parameters) throws WikiStreamException { <BUG>this.currentLocale = locale; this.currentCreationDate = getDate(WikiDocumentFilter.PARAMETER_CREATION_DATE, parameters, null); this.currentCreationAuthor = getString(WikiDocumentFilter.PARAMETER_CREATION_AUTHOR, parameters, null);</BUG> } @Override
this.currentLocaleParameters = parameters;
11,688
public void beginWikiDocumentRevision(String version, FilterEventParameters parameters) throws WikiStreamException { this.document = new XWikiDocument(this.entityResolver.resolve(this.currentEntityReference, this.properties != null ? this.properties.getDefaultReference() : null)); <BUG>this.document.setCreationDate(this.currentCreationDate); this.document.setCreator(this.currentCreationAuthor); this.document.setDefaultLocale(this.currentDefaultLocale);</BUG> this.document.setSyntax(getSyntax(WikiDocumentFilter.PARAMETER_SYNTAX, parameters, null)); this.document.setLocale(this.currentLocale);
this.document.setCreationDate(getDate(WikiDocumentFilter.PARAMETER_CREATION_DATE, this.currentLocaleParameters, this.document.setCreator(getString(WikiDocumentFilter.PARAMETER_CREATION_AUTHOR, this.currentLocaleParameters, this.document.setDefaultLocale(this.currentDefaultLocale);
11,689
this.document.setDefaultTemplate(getString(WikiDocumentFilter.PARAMETER_DEFAULTTEMPLATE, parameters, null)); this.document.setValidationScript(getString(WikiDocumentFilter.PARAMETER_VALIDATIONSCRIPT, parameters, null)); this.document.setHidden(getBoolean(WikiDocumentFilter.PARAMETER_HIDDEN, parameters, false)); this.document.setMinorEdit(getBoolean(WikiDocumentFilter.PARAMETER_REVISION_MINOR, parameters, false)); this.document.setAuthor(getString(WikiDocumentFilter.PARAMETER_REVISION_AUTHOR, parameters, null)); <BUG>this.document.setContentAuthor(getString(WikiDocumentFilter.PARAMETER_CONTENT_AUTHOR, parameters, null)); String revisions = getString(XWikiWikiDocumentFilter.PARAMETER_JRCSREVISIONS, parameters, null); </BUG> if (revisions != null) { try {
String revisions = getString(XWikiWikiDocumentFilter.PARAMETER_JRCSREVISIONS, this.currentLocaleParameters, null);
11,690
import com.intellij.openapi.project.DumbAware; import com.intellij.openapi.project.Project; import com.intellij.openapi.projectRoots.Sdk; import com.intellij.openapi.roots.*; import com.intellij.openapi.roots.ui.configuration.ModulesConfigurator; <BUG>import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.NotNull;</BUG> import org.jetbrains.annotations.Nullable; import java.util.Collection; import java.util.Iterator;
import com.intellij.openapi.vfs.WrappingVirtualFile; import org.jetbrains.annotations.NotNull;
11,691
import java.util.Iterator; import java.util.List; public class ProjectSettingsSelectInTarget implements SelectInTarget, DumbAware { public boolean canSelect(final SelectInContext context) { final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(context.getProject()).getFileIndex(); <BUG>VirtualFile file = context.getVirtualFile(); return fileIndex.isInContent(file) || fileIndex.isInLibraryClasses(file) || fileIndex.isInLibrarySource(file);</BUG> } public void selectIn(final SelectInContext context, final boolean requestFocus) {
final VirtualFile file = context.getVirtualFile(); if (file instanceof WrappingVirtualFile) { final Object o = ((WrappingVirtualFile)file).getWrappedObject(context.getProject()); return o instanceof Facet; return fileIndex.isInContent(file) || fileIndex.isInLibraryClasses(file) || fileIndex.isInLibrarySource(file);
11,692
import org.slf4j.LoggerFactory; import org.xwiki.bridge.event.DocumentCreatedEvent; import org.xwiki.bridge.event.DocumentDeletedEvent; import org.xwiki.bridge.event.DocumentUpdatedEvent; import org.xwiki.observation.EventListener; <BUG>import org.xwiki.observation.event.Event; import org.xwiki.rendering.syntax.Syntax;</BUG> import com.xpn.xwiki.XWikiContext; import com.xpn.xwiki.XWikiException; import com.xpn.xwiki.doc.XWikiDocument;
import org.xwiki.query.Query; import org.xwiki.query.QueryException; import org.xwiki.rendering.syntax.Syntax;
11,693
import org.apache.commons.lang3.math.NumberUtils; import org.json.JSONException; import org.mariotaku.microblog.library.MicroBlog; import org.mariotaku.microblog.library.MicroBlogException; import org.mariotaku.microblog.library.twitter.model.RateLimitStatus; <BUG>import org.mariotaku.microblog.library.twitter.model.Status; import org.mariotaku.sqliteqb.library.AllColumns;</BUG> import org.mariotaku.sqliteqb.library.Columns; import org.mariotaku.sqliteqb.library.Columns.Column; import org.mariotaku.sqliteqb.library.Expression;
import org.mariotaku.pickncrop.library.PNCUtils; import org.mariotaku.sqliteqb.library.AllColumns;
11,694
context.getApplicationContext().sendBroadcast(intent); } } @Nullable public static Location getCachedLocation(Context context) { <BUG>if (BuildConfig.DEBUG) { Log.v(LOGTAG, "Fetching cached location", new Exception()); }</BUG> Location location = null;
DebugLog.v(LOGTAG, "Fetching cached location", new Exception());
11,695
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBannerImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.format("Unable to delete %s", file)); }</BUG> }
if (deleteImage) { Utils.deleteMedia(context, imageUri);
11,696
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBackgroundImage(fileBody, tile); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.format("Unable to delete %s", file)); }</BUG> }
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
11,697
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); return twitter.updateProfileImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.format("Unable to delete %s", file)); }</BUG> }
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
11,698
import org.mariotaku.twidere.receiver.NotificationReceiver; import org.mariotaku.twidere.service.LengthyOperationsService; import org.mariotaku.twidere.util.ActivityTracker; import org.mariotaku.twidere.util.AsyncTwitterWrapper; import org.mariotaku.twidere.util.DataStoreFunctionsKt; <BUG>import org.mariotaku.twidere.util.DataStoreUtils; import org.mariotaku.twidere.util.ImagePreloader;</BUG> import org.mariotaku.twidere.util.InternalTwitterContentUtils; import org.mariotaku.twidere.util.JsonSerializer; import org.mariotaku.twidere.util.NotificationManagerWrapper;
import org.mariotaku.twidere.util.DebugLog; import org.mariotaku.twidere.util.ImagePreloader;
11,699
final List<InetAddress> addresses = mDns.lookup(host); for (InetAddress address : addresses) { c.addRow(new String[]{host, address.getHostAddress()}); } } catch (final IOException ignore) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, ignore); }</BUG> }
DebugLog.w(LOGTAG, null, ignore);
11,700
for (Location location : twitter.getAvailableTrends()) { map.put(location); } return map.pack(); } catch (final MicroBlogException e) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, e); }</BUG> }
DebugLog.w(LOGTAG, null, e);