conflict_resolution
stringlengths
27
16k
<<<<<<< // THEN equals returns true assertThat(equals).isEqualTo(false); } /** * Tests for #182 * * @throws Exception */ @Test public void testLineProtocolNanosecondPrecision() throws Exception { // GIVEN a point with millisecond precision Date pDate = new Date(); Point p = Point .measurement("measurement") .addField("foo", "bar") .time(pDate.getTime(), TimeUnit.MILLISECONDS) .build(); // WHEN i call lineProtocol(TimeUnit.NANOSECONDS) String nanosTime = p.lineProtocol(TimeUnit.NANOSECONDS).replace("measurement foo=\"bar\" ", ""); // THEN the timestamp is in nanoseconds assertThat(nanosTime).isEqualTo(String.valueOf(pDate.getTime() * 1000000)); } @Test public void testLineProtocolMicrosecondPrecision() throws Exception { // GIVEN a point with millisecond precision Date pDate = new Date(); Point p = Point .measurement("measurement") .addField("foo", "bar") .time(pDate.getTime(), TimeUnit.MILLISECONDS) .build(); // WHEN i call lineProtocol(TimeUnit.MICROSECONDS) String microsTime = p.lineProtocol(TimeUnit.MICROSECONDS).replace("measurement foo=\"bar\" ", ""); // THEN the timestamp is in microseconds assertThat(microsTime).isEqualTo(String.valueOf(pDate.getTime() * 1000)); } @Test public void testLineProtocolMillisecondPrecision() throws Exception { // GIVEN a point with millisecond precision Date pDate = new Date(); Point p = Point .measurement("measurement") .addField("foo", "bar") .time(pDate.getTime(), TimeUnit.MILLISECONDS) .build(); // WHEN i call lineProtocol(TimeUnit.MILLISECONDS) String millisTime = p.lineProtocol(TimeUnit.MILLISECONDS).replace("measurement foo=\"bar\" ", ""); // THEN the timestamp is in microseconds assertThat(millisTime).isEqualTo(String.valueOf(pDate.getTime())); } @Test public void testLineProtocolSecondPrecision() throws Exception { // GIVEN a point with millisecond precision Date pDate = new Date(); Point p = Point .measurement("measurement") .addField("foo", "bar") .time(pDate.getTime(), TimeUnit.MILLISECONDS) .build(); // WHEN i call lineProtocol(TimeUnit.SECONDS) String secondTime = p.lineProtocol(TimeUnit.SECONDS).replace("measurement foo=\"bar\" ", ""); // THEN the timestamp is in seconds String expectedSecondTimeStamp = String.valueOf(pDate.getTime() / 1000); assertThat(secondTime).isEqualTo(expectedSecondTimeStamp); } @Test public void testLineProtocolMinutePrecision() throws Exception { // GIVEN a point with millisecond precision Date pDate = new Date(); Point p = Point .measurement("measurement") .addField("foo", "bar") .time(pDate.getTime(), TimeUnit.MILLISECONDS) .build(); // WHEN i call lineProtocol(TimeUnit.MINUTE) String secondTime = p.lineProtocol(TimeUnit.MINUTES).replace("measurement foo=\"bar\" ", ""); // THEN the timestamp is in seconds String expectedSecondTimeStamp = String.valueOf(pDate.getTime() / 60000); assertThat(secondTime).isEqualTo(expectedSecondTimeStamp); } @Test public void testLineProtocolHourPrecision() throws Exception { // GIVEN a point with millisecond precision Date pDate = new Date(); Point p = Point .measurement("measurement") .addField("foo", "bar") .time(pDate.getTime(), TimeUnit.MILLISECONDS) .build(); // WHEN i call lineProtocol(TimeUnit.NANOSECONDS) String hourTime = p.lineProtocol(TimeUnit.HOURS).replace("measurement foo=\"bar\" ", ""); // THEN the timestamp is in hours String expectedHourTimeStamp = String.valueOf(Math.round(pDate.getTime() / 3600000)); // 1000ms * 60s * 60m assertThat(hourTime).isEqualTo(expectedHourTimeStamp); } ======= // THEN equals returns true assertThat(equals).isEqualTo(false); } @Test public void testBuilderHasFields() { Point.Builder pointBuilder = Point.measurement("nulltest").time(1, TimeUnit.NANOSECONDS).tag("foo", "bar"); assertThat(pointBuilder.hasFields()).isFalse(); pointBuilder.addField("testfield", 256); assertThat(pointBuilder.hasFields()).isTrue(); } >>>>>>> // THEN equals returns true assertThat(equals).isEqualTo(false); } @Test public void testBuilderHasFields() { Point.Builder pointBuilder = Point.measurement("nulltest").time(1, TimeUnit.NANOSECONDS).tag("foo", "bar"); assertThat(pointBuilder.hasFields()).isFalse(); pointBuilder.addField("testfield", 256); assertThat(pointBuilder.hasFields()).isTrue(); } /** * Tests for #182 * * @throws Exception */ @Test public void testLineProtocolNanosecondPrecision() throws Exception { // GIVEN a point with millisecond precision Date pDate = new Date(); Point p = Point .measurement("measurement") .addField("foo", "bar") .time(pDate.getTime(), TimeUnit.MILLISECONDS) .build(); // WHEN i call lineProtocol(TimeUnit.NANOSECONDS) String nanosTime = p.lineProtocol(TimeUnit.NANOSECONDS).replace("measurement foo=\"bar\" ", ""); // THEN the timestamp is in nanoseconds assertThat(nanosTime).isEqualTo(String.valueOf(pDate.getTime() * 1000000)); } @Test public void testLineProtocolMicrosecondPrecision() throws Exception { // GIVEN a point with millisecond precision Date pDate = new Date(); Point p = Point .measurement("measurement") .addField("foo", "bar") .time(pDate.getTime(), TimeUnit.MILLISECONDS) .build(); // WHEN i call lineProtocol(TimeUnit.MICROSECONDS) String microsTime = p.lineProtocol(TimeUnit.MICROSECONDS).replace("measurement foo=\"bar\" ", ""); // THEN the timestamp is in microseconds assertThat(microsTime).isEqualTo(String.valueOf(pDate.getTime() * 1000)); } @Test public void testLineProtocolMillisecondPrecision() throws Exception { // GIVEN a point with millisecond precision Date pDate = new Date(); Point p = Point .measurement("measurement") .addField("foo", "bar") .time(pDate.getTime(), TimeUnit.MILLISECONDS) .build(); // WHEN i call lineProtocol(TimeUnit.MILLISECONDS) String millisTime = p.lineProtocol(TimeUnit.MILLISECONDS).replace("measurement foo=\"bar\" ", ""); // THEN the timestamp is in microseconds assertThat(millisTime).isEqualTo(String.valueOf(pDate.getTime())); } @Test public void testLineProtocolSecondPrecision() throws Exception { // GIVEN a point with millisecond precision Date pDate = new Date(); Point p = Point .measurement("measurement") .addField("foo", "bar") .time(pDate.getTime(), TimeUnit.MILLISECONDS) .build(); // WHEN i call lineProtocol(TimeUnit.SECONDS) String secondTime = p.lineProtocol(TimeUnit.SECONDS).replace("measurement foo=\"bar\" ", ""); // THEN the timestamp is in seconds String expectedSecondTimeStamp = String.valueOf(pDate.getTime() / 1000); assertThat(secondTime).isEqualTo(expectedSecondTimeStamp); } @Test public void testLineProtocolMinutePrecision() throws Exception { // GIVEN a point with millisecond precision Date pDate = new Date(); Point p = Point .measurement("measurement") .addField("foo", "bar") .time(pDate.getTime(), TimeUnit.MILLISECONDS) .build(); // WHEN i call lineProtocol(TimeUnit.MINUTE) String secondTime = p.lineProtocol(TimeUnit.MINUTES).replace("measurement foo=\"bar\" ", ""); // THEN the timestamp is in seconds String expectedSecondTimeStamp = String.valueOf(pDate.getTime() / 60000); assertThat(secondTime).isEqualTo(expectedSecondTimeStamp); } @Test public void testLineProtocolHourPrecision() throws Exception { // GIVEN a point with millisecond precision Date pDate = new Date(); Point p = Point .measurement("measurement") .addField("foo", "bar") .time(pDate.getTime(), TimeUnit.MILLISECONDS) .build(); // WHEN i call lineProtocol(TimeUnit.NANOSECONDS) String hourTime = p.lineProtocol(TimeUnit.HOURS).replace("measurement foo=\"bar\" ", ""); // THEN the timestamp is in hours String expectedHourTimeStamp = String.valueOf(Math.round(pDate.getTime() / 3600000)); // 1000ms * 60s * 60m assertThat(hourTime).isEqualTo(expectedHourTimeStamp); }
<<<<<<< import com.webank.weid.constant.CredentialConstant; import com.webank.weid.constant.ParamKeyConstant; import com.webank.weid.protocol.response.TransactionInfo; ======= import com.webank.weid.protocol.response.ResponseData; >>>>>>> import com.webank.weid.protocol.response.ResponseData; import com.webank.weid.protocol.response.TransactionInfo; <<<<<<< Assert.assertNull(weidList); Assert.assertNull(cptList); Assert.assertNull(auList); Assert.assertNotNull(ParamKeyConstant.CLAIM); Assert.assertNotNull(ParamKeyConstant.WEID); Assert.assertNotNull(ParamKeyConstant.CONTEXT); Assert.assertNotNull(ParamKeyConstant.AUTHORITY_ISSUER_NAME); Assert.assertNotNull(ParamKeyConstant.CPT_JSON_SCHEMA); Assert.assertNotNull(ParamKeyConstant.CPT_SIGNATURE); Assert.assertNotNull(CredentialConstant.DEFAULT_CREDENTIAL_CONTEXT); TransactionReceipt receipt = new TransactionReceipt(); receipt.setBlockNumber("1010"); receipt.setTransactionHash("bcbd"); receipt.setTransactionIndex("0"); TransactionInfo info = new TransactionInfo(receipt); Assert.assertNotNull(info); Assert.assertNull(new TransactionInfo(null).getBlockNumber()); Assert.assertNull(TransactionUtils.getTransaction(null)); ======= Assert.assertNull(weidList.getResult()); Assert.assertNull(cptList.getResult()); Assert.assertNull(auList.getResult()); >>>>>>> Assert.assertNull(weidList.getResult()); Assert.assertNull(cptList.getResult()); Assert.assertNull(auList.getResult()); TransactionReceipt receipt = new TransactionReceipt(); receipt.setBlockNumber("1010"); receipt.setTransactionHash("bcbd"); receipt.setTransactionIndex("0"); TransactionInfo info = new TransactionInfo(receipt); Assert.assertNotNull(info); Assert.assertNull(new TransactionInfo(null).getBlockNumber()); Assert.assertNull(TransactionUtils.getTransaction(null));
<<<<<<< try { FileContent fileContent = FileContentImpl.createByFile(virtualFile); return createFilePattern().accepts(fileContent); } catch (IOException e) { throw new RuntimeException(e); // TODO? } ======= if (virtualFile.getFileType() instanceof JsonFileType) { FileContent fileContent = FileContentImpl.createByFile(virtualFile); return createFilePattern().accepts(fileContent); } return false; >>>>>>> if (virtualFile.getFileType() instanceof JsonFileType) { try { FileContent fileContent = FileContentImpl.createByFile(virtualFile); return createFilePattern().accepts(fileContent); } catch (IOException e) { throw new RuntimeException(e); // TODO? } } return false;
<<<<<<< // FE9 routinely uses chapter unit data to modify boss units stats, which isn't accounted for in the // normal logic flow. To alleviate this, we want to re-allocate those points appropriately // to make sure the rest of the logic works. Effectively, we want to move those adjustments // to the character data and only use the dispos adjustments for, say, hard mode adjustments. for (FE9Character boss : charData.allBossCharacters()) { String pid = charData.getPIDForCharacter(boss); List<FE9ChapterUnit> bossUnits = new ArrayList<FE9ChapterUnit>(); for (FE9Data.Chapter chapter : FE9Data.Chapter.values()) { for (FE9ChapterArmy army : chapterData.armiesForChapter(chapter)) { FE9ChapterUnit bossUnit = army.getUnitForPID(pid); if (bossUnit != null) { bossUnits.add(bossUnit); } army.commitChanges(); } } chapterData.commitChanges(); if (!bossUnits.isEmpty()) { // Find the lowest offsets out of all of the boss units for each stat area. // We're going to use that as the baseline. All additional adjustments // will be higher than this value. int normalizedHPAdjustment = 255; int normalizedSTRAdjustment = 255; int normalizedMAGAdjustment = 255; int normalizedSKLAdjustment = 255; int normalizedSPDAdjustment = 255; int normalizedLCKAdjustment = 255; int normalizedDEFAdjustment = 255; int normalizedRESAdjustment = 255; for (FE9ChapterUnit bossUnit : bossUnits) { normalizedHPAdjustment = Math.min(normalizedHPAdjustment, bossUnit.getHPAdjustment()); normalizedSTRAdjustment = Math.min(normalizedSTRAdjustment, bossUnit.getSTRAdjustment()); normalizedMAGAdjustment = Math.min(normalizedMAGAdjustment, bossUnit.getMAGAdjustment()); normalizedSKLAdjustment = Math.min(normalizedSKLAdjustment, bossUnit.getSKLAdjustment()); normalizedSPDAdjustment = Math.min(normalizedSPDAdjustment, bossUnit.getSPDAdjustment()); normalizedLCKAdjustment = Math.min(normalizedLCKAdjustment, bossUnit.getLCKAdjustment()); normalizedDEFAdjustment = Math.min(normalizedDEFAdjustment, bossUnit.getDEFAdjustment()); normalizedRESAdjustment = Math.min(normalizedRESAdjustment, bossUnit.getRESAdjustment()); } for (FE9ChapterUnit bossUnit : bossUnits) { bossUnit.setHPAdjustment(bossUnit.getHPAdjustment() - normalizedHPAdjustment); bossUnit.setSTRAdjustment(bossUnit.getSTRAdjustment() - normalizedSTRAdjustment); bossUnit.setMAGAdjustment(bossUnit.getMAGAdjustment() - normalizedMAGAdjustment); bossUnit.setSKLAdjustment(bossUnit.getSKLAdjustment() - normalizedSKLAdjustment); bossUnit.setSPDAdjustment(bossUnit.getSPDAdjustment() - normalizedSPDAdjustment); bossUnit.setLCKAdjustment(bossUnit.getLCKAdjustment() - normalizedLCKAdjustment); bossUnit.setDEFAdjustment(bossUnit.getDEFAdjustment() - normalizedDEFAdjustment); bossUnit.setRESAdjustment(bossUnit.getRESAdjustment() - normalizedRESAdjustment); } // Apply the adjustment we took out of the dispos data and inject it back into the character data. boss.setBaseHP(boss.getBaseHP() + normalizedHPAdjustment); boss.setBaseSTR(boss.getBaseSTR() + normalizedSTRAdjustment); boss.setBaseMAG(boss.getBaseMAG() + normalizedMAGAdjustment); boss.setBaseSKL(boss.getBaseSKL() + normalizedSKLAdjustment); boss.setBaseSPD(boss.getBaseSPD() + normalizedSPDAdjustment); boss.setBaseLCK(boss.getBaseLCK() + normalizedLCKAdjustment); boss.setBaseDEF(boss.getBaseDEF() + normalizedDEFAdjustment); boss.setBaseRES(boss.getBaseRES() + normalizedRESAdjustment); } } ======= // Give Warp a real name and description. textData.setStringForIdentifier("MIID_WARP", "Warp"); textData.setStringForIdentifier("MH_I_WARP", "You could just play through the map properly..."); >>>>>>> // FE9 routinely uses chapter unit data to modify boss units stats, which isn't accounted for in the // normal logic flow. To alleviate this, we want to re-allocate those points appropriately // to make sure the rest of the logic works. Effectively, we want to move those adjustments // to the character data and only use the dispos adjustments for, say, hard mode adjustments. for (FE9Character boss : charData.allBossCharacters()) { String pid = charData.getPIDForCharacter(boss); List<FE9ChapterUnit> bossUnits = new ArrayList<FE9ChapterUnit>(); for (FE9Data.Chapter chapter : FE9Data.Chapter.values()) { for (FE9ChapterArmy army : chapterData.armiesForChapter(chapter)) { FE9ChapterUnit bossUnit = army.getUnitForPID(pid); if (bossUnit != null) { bossUnits.add(bossUnit); } army.commitChanges(); } } chapterData.commitChanges(); if (!bossUnits.isEmpty()) { // Find the lowest offsets out of all of the boss units for each stat area. // We're going to use that as the baseline. All additional adjustments // will be higher than this value. int normalizedHPAdjustment = 255; int normalizedSTRAdjustment = 255; int normalizedMAGAdjustment = 255; int normalizedSKLAdjustment = 255; int normalizedSPDAdjustment = 255; int normalizedLCKAdjustment = 255; int normalizedDEFAdjustment = 255; int normalizedRESAdjustment = 255; for (FE9ChapterUnit bossUnit : bossUnits) { normalizedHPAdjustment = Math.min(normalizedHPAdjustment, bossUnit.getHPAdjustment()); normalizedSTRAdjustment = Math.min(normalizedSTRAdjustment, bossUnit.getSTRAdjustment()); normalizedMAGAdjustment = Math.min(normalizedMAGAdjustment, bossUnit.getMAGAdjustment()); normalizedSKLAdjustment = Math.min(normalizedSKLAdjustment, bossUnit.getSKLAdjustment()); normalizedSPDAdjustment = Math.min(normalizedSPDAdjustment, bossUnit.getSPDAdjustment()); normalizedLCKAdjustment = Math.min(normalizedLCKAdjustment, bossUnit.getLCKAdjustment()); normalizedDEFAdjustment = Math.min(normalizedDEFAdjustment, bossUnit.getDEFAdjustment()); normalizedRESAdjustment = Math.min(normalizedRESAdjustment, bossUnit.getRESAdjustment()); } for (FE9ChapterUnit bossUnit : bossUnits) { bossUnit.setHPAdjustment(bossUnit.getHPAdjustment() - normalizedHPAdjustment); bossUnit.setSTRAdjustment(bossUnit.getSTRAdjustment() - normalizedSTRAdjustment); bossUnit.setMAGAdjustment(bossUnit.getMAGAdjustment() - normalizedMAGAdjustment); bossUnit.setSKLAdjustment(bossUnit.getSKLAdjustment() - normalizedSKLAdjustment); bossUnit.setSPDAdjustment(bossUnit.getSPDAdjustment() - normalizedSPDAdjustment); bossUnit.setLCKAdjustment(bossUnit.getLCKAdjustment() - normalizedLCKAdjustment); bossUnit.setDEFAdjustment(bossUnit.getDEFAdjustment() - normalizedDEFAdjustment); bossUnit.setRESAdjustment(bossUnit.getRESAdjustment() - normalizedRESAdjustment); } // Apply the adjustment we took out of the dispos data and inject it back into the character data. boss.setBaseHP(boss.getBaseHP() + normalizedHPAdjustment); boss.setBaseSTR(boss.getBaseSTR() + normalizedSTRAdjustment); boss.setBaseMAG(boss.getBaseMAG() + normalizedMAGAdjustment); boss.setBaseSKL(boss.getBaseSKL() + normalizedSKLAdjustment); boss.setBaseSPD(boss.getBaseSPD() + normalizedSPDAdjustment); boss.setBaseLCK(boss.getBaseLCK() + normalizedLCKAdjustment); boss.setBaseDEF(boss.getBaseDEF() + normalizedDEFAdjustment); boss.setBaseRES(boss.getBaseRES() + normalizedRESAdjustment); } } // Give Warp a real name and description. textData.setStringForIdentifier("MIID_WARP", "Warp"); textData.setStringForIdentifier("MH_I_WARP", "You could just play through the map properly...");
<<<<<<< GBAFEItemData[] sameRank = itemData.itemsOfTypeAndEqualRank(type, original.getWeaponRank(), false, false, false); for (GBAFEItemData weapon : sameRank) { if (weapon.getMight() > original.getMight()) { items.add(weapon); } } return items.toArray(new GBAFEItemData[items.size()]); ======= List<GBAFEItemData> filteredList = items.stream().filter(item -> (!itemData.isPlayerOnly(item.getID()))).collect(Collectors.toList()); return filteredList.toArray(new GBAFEItemData[filteredList.size()]); >>>>>>> GBAFEItemData[] sameRank = itemData.itemsOfTypeAndEqualRank(type, original.getWeaponRank(), false, false, false); for (GBAFEItemData weapon : sameRank) { if (weapon.getMight() > original.getMight()) { items.add(weapon); } } List<GBAFEItemData> filteredList = items.stream().filter(item -> (!itemData.isPlayerOnly(item.getID()))).collect(Collectors.toList()); return filteredList.toArray(new GBAFEItemData[filteredList.size()]);
<<<<<<< import fedata.gcnwii.fe9.FE9Skill; ======= import fedata.gcnwii.fe9.FE9ScriptScene; import fedata.gcnwii.fe9.scripting.PushLiteralString16Instruction; import fedata.gcnwii.fe9.scripting.ScriptInstruction; >>>>>>> import fedata.gcnwii.fe9.FE9Skill; import fedata.gcnwii.fe9.FE9ScriptScene; import fedata.gcnwii.fe9.scripting.PushLiteralString16Instruction; import fedata.gcnwii.fe9.scripting.ScriptInstruction; <<<<<<< // Give Paragon scroll a real name and allow it to be used with all characters. textData.setStringForIdentifier("MIID_ELITE", "Paragon"); StringBuilder sb = new StringBuilder(); sb.append("Doubles the experience"); sb.append((char)0xA); // line break sb.append("points this unit gains."); sb.append((char)0xA); // line break sb.append((char)0x20); // spacing sb.append((char)0x20); // spacing sb.append("#C04All units"); textData.setStringForIdentifier("Mess_Help2_skill_Elite", sb.toString()); FE9Skill paragon = skillData.getSkillWithSID(FE9Data.Skill.PARAGON.getSID()); paragon.setRestrictionCount(0); paragon.setRestrictionPointer(0); paragon.commitChanges(); // Same for Blossom and Celerity. textData.setStringForIdentifier("MIID_FRAC90", "Blossom"); sb = new StringBuilder(); sb.append("An item that allows you to acquire the skill"); sb.append((char)0xA); sb.append("Blossom when you're at a base."); textData.setStringForIdentifier("MH_I_FRAC90", sb.toString()); FE9Skill blossom = skillData.getSkillWithSID(FE9Data.Skill.BLOSSOM.getSID()); blossom.setRestrictionCount(0); blossom.setRestrictionPointer(0); textData.setStringForIdentifier("MIID_SWIFT", "Celerity"); sb = new StringBuilder(); sb.append("An item that allows you to acquire the skill"); sb.append((char)0xA); sb.append("Celerity when you're at a base."); textData.setStringForIdentifier("MH_I_SWIFT", sb.toString()); ======= // Just to be doubly sure, give Ike a Vulnerary in Prologue. List<FE9ChapterArmy> armies = chapterData.armiesForChapter(FE9Data.Chapter.PROLOGUE); for (FE9ChapterArmy army : armies) { for (String unitID : army.getAllUnitIDs()) { FE9ChapterUnit unit = army.getUnitForUnitID(unitID); if (army.getPIDForUnit(unit).equals(FE9Data.Character.IKE.getPID())) { army.setItem1ForUnit(unit, FE9Data.Item.VULNERARY.getIID()); } } army.commitChanges(); } >>>>>>> // Give Paragon scroll a real name and allow it to be used with all characters. textData.setStringForIdentifier("MIID_ELITE", "Paragon"); StringBuilder sb = new StringBuilder(); sb.append("Doubles the experience"); sb.append((char)0xA); // line break sb.append("points this unit gains."); sb.append((char)0xA); // line break sb.append((char)0x20); // spacing sb.append((char)0x20); // spacing sb.append("#C04All units"); textData.setStringForIdentifier("Mess_Help2_skill_Elite", sb.toString()); FE9Skill paragon = skillData.getSkillWithSID(FE9Data.Skill.PARAGON.getSID()); paragon.setRestrictionCount(0); paragon.setRestrictionPointer(0); paragon.commitChanges(); // Same for Blossom and Celerity. textData.setStringForIdentifier("MIID_FRAC90", "Blossom"); sb = new StringBuilder(); sb.append("An item that allows you to acquire the skill"); sb.append((char)0xA); sb.append("Blossom when you're at a base."); textData.setStringForIdentifier("MH_I_FRAC90", sb.toString()); FE9Skill blossom = skillData.getSkillWithSID(FE9Data.Skill.BLOSSOM.getSID()); blossom.setRestrictionCount(0); blossom.setRestrictionPointer(0); textData.setStringForIdentifier("MIID_SWIFT", "Celerity"); sb = new StringBuilder(); sb.append("An item that allows you to acquire the skill"); sb.append((char)0xA); sb.append("Celerity when you're at a base."); textData.setStringForIdentifier("MH_I_SWIFT", sb.toString()); // Just to be doubly sure, give Ike a Vulnerary in Prologue. List<FE9ChapterArmy> armies = chapterData.armiesForChapter(FE9Data.Chapter.PROLOGUE); for (FE9ChapterArmy army : armies) { for (String unitID : army.getAllUnitIDs()) { FE9ChapterUnit unit = army.getUnitForUnitID(unitID); if (army.getPIDForUnit(unit).equals(FE9Data.Character.IKE.getPID())) { army.setItem1ForUnit(unit, FE9Data.Item.VULNERARY.getIID()); } } army.commitChanges(); }
<<<<<<< INVALID_SCHEMAS("Schemas do not match; cannot port rows.", true), VERSION_OUT_OF_DATE("Must download new version of DataSync before jobs can be run (critical update)", true); ======= INVALID_SCHEMAS("Schemas do not match; cannot port rows.", true), MISSING_METADATA_TITLE("Title is Required", true); >>>>>>> INVALID_SCHEMAS("Schemas do not match; cannot port rows.", true), VERSION_OUT_OF_DATE("Must download new version of DataSync before jobs can be run (critical update)", true), MISSING_METADATA_TITLE("Title is Required", true);
<<<<<<< import com.socrata.datasync.*; import com.socrata.datasync.preferences.UserPreferencesFile; import com.socrata.exceptions.LongRunningQueryException; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.annotate.JsonSerialize; ======= >>>>>>> import com.socrata.datasync.*; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.annotate.JsonSerialize; <<<<<<< ======= import com.socrata.datasync.*; >>>>>>> <<<<<<< ======= File deleteRowsFile = null; if(!fileRowsToDelete.equals(DELETE_ZERO_ROWS)) { deleteRowsFile = new File(fileRowsToDelete); } >>>>>>>
<<<<<<< import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.zip.GZIPOutputStream; ======= import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; >>>>>>> import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.zip.GZIPOutputStream; <<<<<<< import com.socrata.datasync.preferences.UserPreferences; ======= >>>>>>> import com.socrata.datasync.preferences.UserPreferences; <<<<<<< import org.apache.commons.io.IOUtils; import org.apache.commons.net.ftp.*; ======= >>>>>>> import org.apache.commons.io.IOUtils; import org.apache.commons.net.ftp.*;
<<<<<<< import cc.arduino.packages.BoardPort; import processing.app.legacy.PApplet; ======= import processing.app.debug.TextAreaFIFO; import processing.core.*; import static processing.app.I18n._; >>>>>>> import cc.arduino.packages.BoardPort; import processing.app.legacy.PApplet; <<<<<<< ======= private String port; private TextAreaFIFO textArea; private JScrollPane scrollPane; private JTextField textField; private JButton sendButton; private JCheckBox autoscrollBox; private JComboBox lineEndings; private JComboBox serialRates; >>>>>>> <<<<<<< }); ======= } updateBuffer = new StringBuffer(1048576); updateTimer = new javax.swing.Timer(33, this); // redraw serial monitor at 30 Hz } protected void setPlacement(int[] location) { setBounds(location[0], location[1], location[2], location[3]); } protected int[] getPlacement() { int[] location = new int[4]; // Get the dimensions of the Frame Rectangle bounds = getBounds(); location[0] = bounds.x; location[1] = bounds.y; location[2] = bounds.width; location[3] = bounds.height; >>>>>>> }); <<<<<<< serial = new Serial(port, serialRate); serial.addListener(this); ======= serial = new Serial(port, serialRate) { @Override protected void message(char buff[], int n) { addToUpdateBuffer(buff, n); } }; updateTimer.start(); >>>>>>> serial = new Serial(port, serialRate) { @Override protected void message(char buff[], int n) { addToUpdateBuffer(buff, n); } }; <<<<<<< ======= private synchronized void addToUpdateBuffer(char buff[], int n) { updateBuffer.append(buff, 0, n); } private synchronized String consumeUpdateBuffer() { String s = updateBuffer.toString(); updateBuffer.setLength(0); return s; } public void actionPerformed(ActionEvent e) { final String s = consumeUpdateBuffer(); if (s.length() > 0) { //System.out.println("gui append " + s.length()); if (autoscrollBox.isSelected()) { textArea.appendTrim(s); textArea.setCaretPosition(textArea.getDocument().getLength()); } else { textArea.appendNoTrim(s); } } } >>>>>>>
<<<<<<< import java.nio.file.Files; import java.nio.file.StandardCopyOption; ======= import java.util.ArrayList; import java.util.List; >>>>>>> import java.nio.file.Files; import java.nio.file.StandardCopyOption; import java.util.ArrayList; import java.util.List;
<<<<<<< static public void main(String args[]) throws Exception { ======= static public void main(String args[]) { initPlatform(); // run static initialization that grabs all the prefs Preferences.init(null); >>>>>>> static public void main(String args[]) throws Exception { initPlatform(); // run static initialization that grabs all the prefs Preferences.init(null);
<<<<<<< import org.web3j.quorum.methods.response.ConsensusNoResponse; import org.web3j.quorum.methods.response.istanbul.IstanbulCandidates; import org.web3j.quorum.methods.response.istanbul.IstanbulNodeAddress; import org.web3j.quorum.methods.response.istanbul.IstanbulValidators; import java.io.IOException; ======= import org.web3j.protocol.admin.methods.response.BooleanResponse; import org.web3j.protocol.besu.response.BesuEthAccountsMapResponse; import org.web3j.protocol.core.DefaultBlockParameter; import org.web3j.protocol.core.methods.response.EthAccounts; import org.web3j.quorum.methods.response.ConsensusNoResponse; import org.web3j.quorum.methods.response.istanbul.IstanbulCandidates; import java.io.IOException; >>>>>>> import org.web3j.quorum.methods.response.ConsensusNoResponse; import org.web3j.quorum.methods.response.istanbul.IstanbulCandidates; import org.web3j.quorum.methods.response.istanbul.IstanbulNodeAddress; import org.web3j.quorum.methods.response.istanbul.IstanbulValidators; import org.web3j.protocol.admin.methods.response.BooleanResponse; import org.web3j.protocol.besu.response.BesuEthAccountsMapResponse; import org.web3j.protocol.core.DefaultBlockParameter; import org.web3j.protocol.core.methods.response.EthAccounts; import java.io.IOException; <<<<<<< @Override public List<String> getValidators() throws APIException { IstanbulValidators validators = null; try { validators = gethService.getQuorumService().istanbulGetValidators("latest").send(); if (validators == null || validators.hasError()) { throw new APIException(validators.getError().getMessage()); } } catch (IOException e) { throw new APIException(e.getMessage()); } return validators.getValidators(); } @Override public Map<String, Boolean> getCandidates() throws APIException { IstanbulCandidates candidates = null; try { candidates = gethService.getQuorumService().istanbulCandidates().send(); if (candidates == null || candidates.hasError()) { throw new APIException(candidates.getError().getMessage()); } } catch (IOException e) { throw new APIException(e.getMessage()); } return candidates.getCandidates(); } @Override public String propose(String address, boolean auth) throws APIException { ConsensusNoResponse response = null; try { response = gethService.getQuorumService().istanbulPropose(address, auth).send(); if (response == null || response.hasError()) { throw new APIException(response.getError().getMessage()); } } catch (IOException e) { throw new APIException(e.getMessage()); } return response.getNoResponse(); } @Override public String discard(String address) throws APIException { ConsensusNoResponse response = null; try { response = gethService.getQuorumService().istanbulDiscard(address).send(); if (response == null || response.hasError()) { throw new APIException(response.getError().getMessage()); } } catch (IOException e) { throw new APIException(e.getMessage()); } return response.getNoResponse(); } @Override public String istanbulGetNodeAddress() throws APIException { IstanbulNodeAddress address = null; try { address = gethService.getQuorumService().istanbulNodeAddress().send(); if (address == null || address.hasError()) { throw new APIException(address.getError().getMessage()); } } catch (IOException e) { throw new APIException(e.getMessage()); } return address.getNodeAddress(); } ======= @Override public List<String> getSigners() throws APIException { EthAccounts signers = null; try { signers = gethService.getBesuService().cliqueGetSigners(DefaultBlockParameter.valueOf("latest")).send(); if (signers == null || signers.hasError()) { throw new APIException(signers.getError().getMessage()); } } catch (IOException e) { throw new APIException(e.getMessage()); } return signers.getAccounts(); } @Override public Map<String, Boolean> getProposals() throws APIException { BesuEthAccountsMapResponse proposals = null; try { proposals = gethService.getBesuService().cliqueProposals().send(); if (proposals == null || proposals.hasError()) { throw new APIException(proposals.getError().getMessage()); } } catch (IOException e) { throw new APIException(e.getMessage()); } return proposals.getAccounts(); } @Override public Boolean cliquePropose(String address, boolean auth) throws APIException { BooleanResponse response = null; try { response = gethService.getBesuService().cliquePropose(address, auth).send(); if (response == null || response.hasError()) { throw new APIException(response.getError().getMessage()); } } catch (IOException e) { throw new APIException(e.getMessage()); } return true; } @Override public Boolean cliqueDiscard(String address) throws APIException { BooleanResponse response = null; try { response = gethService.getBesuService().cliqueDiscard(address).send(); if (response == null || response.hasError()) { throw new APIException(response.getError().getMessage()); } } catch (IOException e) { throw new APIException(e.getMessage()); } return true; } >>>>>>> @Override public List<String> getSigners() throws APIException { EthAccounts signers = null; try { signers = gethService.getBesuService().cliqueGetSigners(DefaultBlockParameter.valueOf("latest")).send(); if (signers == null || signers.hasError()) { throw new APIException(signers.getError().getMessage()); } } catch (IOException e) { throw new APIException(e.getMessage()); } return signers.getAccounts(); } @Override public Map<String, Boolean> getProposals() throws APIException { BesuEthAccountsMapResponse proposals = null; try { proposals = gethService.getBesuService().cliqueProposals().send(); if (proposals == null || proposals.hasError()) { throw new APIException(proposals.getError().getMessage()); } } catch (IOException e) { throw new APIException(e.getMessage()); } return proposals.getAccounts(); } @Override public Boolean cliquePropose(String address, boolean auth) throws APIException { BooleanResponse response = null; try { response = gethService.getBesuService().cliquePropose(address, auth).send(); if (response == null || response.hasError()) { throw new APIException(response.getError().getMessage()); } } catch (IOException e) { throw new APIException(e.getMessage()); } return true; } @Override public Boolean cliqueDiscard(String address) throws APIException { BooleanResponse response = null; try { response = gethService.getBesuService().cliqueDiscard(address).send(); if (response == null || response.hasError()) { throw new APIException(response.getError().getMessage()); } } catch (IOException e) { throw new APIException(e.getMessage()); } return true; } @Override public List<String> getValidators() throws APIException { IstanbulValidators validators = null; try { validators = gethService.getQuorumService().istanbulGetValidators("latest").send(); if (validators == null || validators.hasError()) { throw new APIException(validators.getError().getMessage()); } } catch (IOException e) { throw new APIException(e.getMessage()); } return validators.getValidators(); } @Override public Map<String, Boolean> getCandidates() throws APIException { IstanbulCandidates candidates = null; try { candidates = gethService.getQuorumService().istanbulCandidates().send(); if (candidates == null || candidates.hasError()) { throw new APIException(candidates.getError().getMessage()); } } catch (IOException e) { throw new APIException(e.getMessage()); } return candidates.getCandidates(); } @Override public String propose(String address, boolean auth) throws APIException { ConsensusNoResponse response = null; try { response = gethService.getQuorumService().istanbulPropose(address, auth).send(); if (response == null || response.hasError()) { throw new APIException(response.getError().getMessage()); } } catch (IOException e) { throw new APIException(e.getMessage()); } return response.getNoResponse(); } @Override public String discard(String address) throws APIException { ConsensusNoResponse response = null; try { response = gethService.getQuorumService().istanbulDiscard(address).send(); if (response == null || response.hasError()) { throw new APIException(response.getError().getMessage()); } } catch (IOException e) { throw new APIException(e.getMessage()); } return response.getNoResponse(); } @Override public String istanbulGetNodeAddress() throws APIException { IstanbulNodeAddress address = null; try { address = gethService.getQuorumService().istanbulNodeAddress().send(); if (address == null || address.hasError()) { throw new APIException(address.getError().getMessage()); } } catch (IOException e) { throw new APIException(e.getMessage()); } return address.getNodeAddress(); }
<<<<<<< public String getCurrentReportingUrl() { return currentReportingUrl; } public void setCurrentReportingUrl(String currentReportingUrl) { this.currentReportingUrl = currentReportingUrl; } ======= >>>>>>> public String getCurrentReportingUrl() { return currentReportingUrl; } public void setCurrentReportingUrl(String currentReportingUrl) { this.currentReportingUrl = currentReportingUrl; } <<<<<<< setCurrentReportingUrl(node.reportingUrl); ======= resetCakeshopService(); >>>>>>> setCurrentReportingUrl(node.reportingUrl); resetCakeshopService();
<<<<<<< import org.apache.accumulo.core.security.Authorizations; ======= import org.apache.accumulo.core.iterators.SortedMapIterator; >>>>>>> import org.apache.accumulo.core.iterators.SortedMapIterator; import org.apache.accumulo.core.security.Authorizations; <<<<<<< public void test1() throws Exception { MockInstance instance = new MockInstance("rft1"); Connector conn = instance.getConnector("", new PasswordToken("")); conn.tableOperations().create("table1"); BatchWriter bw = conn.createBatchWriter("table1", new BatchWriterConfig()); ======= public static class RowZeroOrOneFilter extends RowFilter { private static final Set<String> passRows = new HashSet<String>(Arrays.asList("0", "1")); @Override public boolean acceptRow(SortedKeyValueIterator<Key,Value> rowIterator) throws IOException { return rowIterator.hasTop() && passRows.contains(rowIterator.getTopKey().getRow().toString()); } } public static class RowOneOrTwoFilter extends RowFilter { private static final Set<String> passRows = new HashSet<String>(Arrays.asList("1", "2")); @Override public boolean acceptRow(SortedKeyValueIterator<Key,Value> rowIterator) throws IOException { return rowIterator.hasTop() && passRows.contains(rowIterator.getTopKey().getRow().toString()); } } public static class TrueFilter extends RowFilter { @Override public boolean acceptRow(SortedKeyValueIterator<Key,Value> rowIterator) throws IOException { return true; } } public List<Mutation> createMutations() { List<Mutation> mutations = new LinkedList<Mutation>(); >>>>>>> public static class RowZeroOrOneFilter extends RowFilter { private static final Set<String> passRows = new HashSet<String>(Arrays.asList("0", "1")); @Override public boolean acceptRow(SortedKeyValueIterator<Key,Value> rowIterator) throws IOException { return rowIterator.hasTop() && passRows.contains(rowIterator.getTopKey().getRow().toString()); } } public static class RowOneOrTwoFilter extends RowFilter { private static final Set<String> passRows = new HashSet<String>(Arrays.asList("1", "2")); @Override public boolean acceptRow(SortedKeyValueIterator<Key,Value> rowIterator) throws IOException { return rowIterator.hasTop() && passRows.contains(rowIterator.getTopKey().getRow().toString()); } } public static class TrueFilter extends RowFilter { @Override public boolean acceptRow(SortedKeyValueIterator<Key,Value> rowIterator) throws IOException { return true; } } public List<Mutation> createMutations() { List<Mutation> mutations = new LinkedList<Mutation>(); <<<<<<< bw.addMutation(m); ======= mutations.add(m); return mutations; } public TreeMap<Key,Value> createKeyValues() { List<Mutation> mutations = createMutations(); TreeMap<Key,Value> keyValues = new TreeMap<Key,Value>(); final Text cf = new Text(), cq = new Text(); for (Mutation m : mutations) { final Text row = new Text(m.getRow()); for (ColumnUpdate update : m.getUpdates()) { cf.set(update.getColumnFamily()); cq.set(update.getColumnQualifier()); Key k = new Key(row, cf, cq); Value v = new Value(update.getValue()); keyValues.put(k, v); } } return keyValues; } @Test public void test1() throws Exception { MockInstance instance = new MockInstance("rft1"); Connector conn = instance.getConnector("", new PasswordToken("")); conn.tableOperations().create("table1"); BatchWriter bw = conn.createBatchWriter("table1", new BatchWriterConfig()); for (Mutation m : createMutations()) { bw.addMutation(m); } >>>>>>> mutations.add(m); return mutations; } public TreeMap<Key,Value> createKeyValues() { List<Mutation> mutations = createMutations(); TreeMap<Key,Value> keyValues = new TreeMap<Key,Value>(); final Text cf = new Text(), cq = new Text(); for (Mutation m : mutations) { final Text row = new Text(m.getRow()); for (ColumnUpdate update : m.getUpdates()) { cf.set(update.getColumnFamily()); cq.set(update.getColumnQualifier()); Key k = new Key(row, cf, cq); Value v = new Value(update.getValue()); keyValues.put(k, v); } } return keyValues; } @Test public void test1() throws Exception { MockInstance instance = new MockInstance("rft1"); Connector conn = instance.getConnector("", new PasswordToken("")); conn.tableOperations().create("table1"); BatchWriter bw = conn.createBatchWriter("table1", new BatchWriterConfig()); for (Mutation m : createMutations()) { bw.addMutation(m); }
<<<<<<< import android.app.Activity; import android.content.res.Configuration; ======= >>>>>>> import android.content.res.Configuration; <<<<<<< import android.util.Log; ======= import android.support.v7.app.AppCompatActivity; >>>>>>> import android.util.Log; import android.support.v7.app.AppCompatActivity;
<<<<<<< private List<SelectItem> standaloneSpecs; private List<String> selectedStandaloneSpecs = new ArrayList<>(); ======= private List<SelectItem> javaSEItems; >>>>>>> private List<SelectItem> standaloneSpecs; private List<String> selectedStandaloneSpecs = new ArrayList<>(); private List<SelectItem> javaSEItems; <<<<<<< defineStandaloneExampleSpecs(); defineJavaSEVersionEnabled(); ======= defineJavaSEVersion(); >>>>>>> defineStandaloneExampleSpecs(); defineJavaSEVersion(); <<<<<<< defineStandaloneExampleSpecs(); // Make sure to update the enabled status of the standalone specs defineJavaSEVersionEnabled(); ======= defineJavaSEVersion(); >>>>>>> defineStandaloneExampleSpecs(); // Make sure to update the enabled status of the standalone specs defineJavaSEVersion(); <<<<<<< public List<SelectItem> getStandaloneSpecs() { return standaloneSpecs; } public List<String> getSelectedStandaloneSpecs() { return selectedStandaloneSpecs; } public void setSelectedStandaloneSpecs(List<String> selectedStandaloneSpecs) { this.selectedStandaloneSpecs = selectedStandaloneSpecs; } ======= public List<SelectItem> getJavaSEItems() { return javaSEItems; } >>>>>>> public List<SelectItem> getStandaloneSpecs() { return standaloneSpecs; } public List<String> getSelectedStandaloneSpecs() { return selectedStandaloneSpecs; } public void setSelectedStandaloneSpecs(List<String> selectedStandaloneSpecs) { this.selectedStandaloneSpecs = selectedStandaloneSpecs; } public List<SelectItem> getJavaSEItems() { return javaSEItems; }
<<<<<<< import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.xml.XmlConfiguration; ======= import org.eclipse.jetty.server.ServerConnector; >>>>>>> import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.xml.XmlConfiguration; import org.eclipse.jetty.server.ServerConnector;
<<<<<<< import org.springframework.boot.autoconfigure.velocity.VelocityAutoConfiguration; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.support.SpringBootServletInitializer; ======= >>>>>>> import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.support.SpringBootServletInitializer;
<<<<<<< import org.synyx.urlaubsverwaltung.core.settings.Settings; import org.synyx.urlaubsverwaltung.core.settings.SettingsService; import org.synyx.urlaubsverwaltung.core.util.NumberUtil; ======= import org.synyx.urlaubsverwaltung.core.util.PropertiesUtil; >>>>>>> import org.synyx.urlaubsverwaltung.core.settings.Settings; import org.synyx.urlaubsverwaltung.core.settings.SettingsService; <<<<<<< import java.util.Locale; ======= import java.util.Properties; >>>>>>> <<<<<<< private static final String MANDATORY_FIELD = "error.mandatory.field"; ======= private static final Logger LOG = Logger.getLogger(PersonValidator.class); private static final String ERROR_MANDATORY_FIELD = "error.mandatory.field"; >>>>>>> private static final String ERROR_MANDATORY_FIELD = "error.mandatory.field"; <<<<<<< private static final int MAX_LIMIT_OF_YEARS = 10; ======= private static final String MAX_DAYS = "annual.vacation.max"; >>>>>>> <<<<<<< // is number of days unrealistic? if (days.compareTo(maximumDays) == 1) { errors.rejectValue(field, ERROR_ENTRY); } ======= // is number of days unrealistic? if (days.compareTo(BigDecimal.valueOf(maximumDays)) == 1) { errors.rejectValue(field, ERROR_ENTRY); >>>>>>> // is number of days unrealistic? if (days.compareTo(maximumDays) == 1) { errors.rejectValue(field, ERROR_ENTRY);
<<<<<<< // label = new JLabel(" ("+Language.text("preferences.requires_restart")+")"); // label = new JLabel(" (requires restart of Processing)"); // box.add(label); ======= >>>>>>> <<<<<<< // Launch programs as [ ] 32-bit [ ] 64-bit (Mac OS X only) /* if (Base.isMacOS()) { box = Box.createHorizontalBox(); label = new JLabel(Language.text("preferences.launch_programs_in")+" "); box.add(label); bitsThirtyTwoButton = new JRadioButton("32-bit "+Language.text("preferences.launch_programs_in.mode")+" "); box.add(bitsThirtyTwoButton); bitsSixtyFourButton = new JRadioButton("64-bit "+Language.text("preferences.launch_programs_in.mode")); box.add(bitsSixtyFourButton); ButtonGroup bg = new ButtonGroup(); bg.add(bitsThirtyTwoButton); bg.add(bitsSixtyFourButton); pain.add(box); d = box.getPreferredSize(); box.setBounds(left, top, d.width, d.height); top += d.height + GUI_BETWEEN; } */ ======= >>>>>>>
<<<<<<< cutItem = new JMenuItem("Cut"); ======= JMenuItem item; cutItem = new JMenuItem(Language.text("menu.edit.cut")); >>>>>>> cutItem = new JMenuItem(Language.text("menu.edit.cut")); <<<<<<< pasteItem = new JMenuItem("Paste"); pasteItem.addActionListener(new ActionListener() { ======= item = new JMenuItem(Language.text("menu.edit.paste")); item.addActionListener(new ActionListener() { >>>>>>> pasteItem = new JMenuItem(Language.text("menu.edit.paste")); pasteItem.addActionListener(new ActionListener() { <<<<<<< selectAllItem = new JMenuItem("Select All"); selectAllItem.addActionListener(new ActionListener() { ======= item = new JMenuItem(Language.text("menu.edit.select_all")); item.addActionListener(new ActionListener() { >>>>>>> selectAllItem = new JMenuItem(Language.text("menu.edit.select_all")); selectAllItem.addActionListener(new ActionListener() { <<<<<<< commUncommItem = new JMenuItem("Comment/Uncomment"); commUncommItem.addActionListener(new ActionListener() { ======= item = new JMenuItem(Language.text("menu.edit.comment_uncomment")); item.addActionListener(new ActionListener() { >>>>>>> commUncommItem = new JMenuItem(Language.text("menu.edit.comment_uncomment")); commUncommItem.addActionListener(new ActionListener() { <<<<<<< incIndItem = new JMenuItem("Increase Indent"); incIndItem.addActionListener(new ActionListener() { ======= item = new JMenuItem("\u2192 "+Language.text("menu.edit.increase_indent")); item.addActionListener(new ActionListener() { >>>>>>> incIndItem = new JMenuItem("\u2192 " + Language.text("menu.edit.increase_indent")); incIndItem.addActionListener(new ActionListener() { <<<<<<< decIndItem = new JMenuItem("Decrease Indent"); decIndItem.addActionListener(new ActionListener() { ======= item = new JMenuItem("\u2190 "+Language.text("menu.edit.decrease_indent")); item.addActionListener(new ActionListener() { >>>>>>> decIndItem = new JMenuItem("\u2190 "+Language.text("menu.edit.decrease_indent")); decIndItem.addActionListener(new ActionListener() {
<<<<<<< protected JPanel makeTextPanel(String text) { JPanel panel = new JPanel(false); JLabel filler = new JLabel(text); filler.setHorizontalAlignment(JLabel.CENTER); panel.setLayout(new GridLayout(1, 1)); panel.add(filler); return panel; } ======= public void showFrame(final Editor editor) { this.editor = editor; if (dialog == null) { dialog = new JFrame(title); restartButton = new JButton(Language.text("contrib.restart")); restartButton.setVisible(false); restartButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { Iterator<Editor> iter = editor.getBase().getEditors().iterator(); while (iter.hasNext()) { Editor ed = iter.next(); if (ed.getSketch().isModified()) { int option = Base .showYesNoQuestion(editor, title, Language.text("contrib.unsaved_changes"), Language.text("contrib.unsaved_changes.prompt")); if (option == JOptionPane.NO_OPTION) return; else break; } } // Why the f*k is this happening here? This is nuts, and likely // to cause all kinds of hell across different platforms. [fry] // Thanks to http://stackoverflow.com/a/4160543 StringBuilder cmd = new StringBuilder(); cmd.append(System.getProperty("java.home") + File.separator + "bin" + File.separator + "java "); for (String jvmArg : ManagementFactory.getRuntimeMXBean() .getInputArguments()) { cmd.append(jvmArg + " "); } cmd.append("-cp ") .append(ManagementFactory.getRuntimeMXBean().getClassPath()) .append(" "); cmd.append(Base.class.getName()); try { Runtime.getRuntime().exec(cmd.toString()); System.exit(0); } catch (IOException e) { e.printStackTrace(); } } }); retryConnectingButton = new JButton("Retry"); retryConnectingButton.setVisible(false); retryConnectingButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { // The message is set to null so that every time the retry button is hit // no previous error is displayed in the status status.setMessage(null); downloadAndUpdateContributionListing(editor.getBase()); } }); progressBar = new JProgressBar(); progressBar.setVisible(true); Toolkit.setIcon(dialog); createComponents(); registerDisposeListeners(); dialog.pack(); dialog.setLocationRelativeTo(null); } dialog.setVisible(true); contributionListPanel.grabFocus(); >>>>>>> protected JPanel makeTextPanel(String text) { JPanel panel = new JPanel(false); JLabel filler = new JLabel(text); filler.setHorizontalAlignment(JLabel.CENTER); panel.setLayout(new GridLayout(1, 1)); panel.add(filler); return panel; } <<<<<<< index = 4; } if (dialog == null) { makeFrame(editor); tabbedPane.setSelectedIndex(index); //done before as downloadAndUpdateContributionListing() requires the current selected tab downloadAndUpdateContributionListing(); ======= downloadAndUpdateContributionListing(editor.getBase()); >>>>>>> index = 4; } if (dialog == null) { makeFrame(editor); tabbedPane.setSelectedIndex(index); //done before as downloadAndUpdateContributionListing() requires the current selected tab downloadAndUpdateContributionListing(editor.getBase());
<<<<<<< /** * CoberturaPublisher constructor * * @param coberturaReportFile the report directory * @param onlyStable true to consider only stable builds * @param failUnhealthy true to fail unhealthy builds * @param failUnstable true to fail unstable builds * @param autoUpdateHealth true to auto-update health * @param autoUpdateStability true to auto-update stability * @param zoomCoverageChart true to zoom coverage chart * @param failNoReports true to fail if no reports * @param sourceEncoding source encoding * @param maxNumberOfBuilds max number of builds */ ======= >>>>>>> <<<<<<< Result buildResult = build.getResult(); if (buildResult != null && buildResult.isWorseThan(threshold)) { ======= if (build.getResult() != null && build.getResult().isWorseThan(threshold)) { >>>>>>> Result buildResult = build.getResult(); if (buildResult != null && buildResult.isWorseThan(threshold)) { <<<<<<< if (buildResult != null && buildResult.isWorseOrEqualTo(Result.FAILURE) && reports.length == 0) { ======= if (build.getResult() != null && build.getResult().isWorseOrEqualTo(Result.FAILURE) && reports.length == 0) { >>>>>>> if (buildResult != null && buildResult.isWorseOrEqualTo(Result.FAILURE) && reports.length == 0) {
<<<<<<< // MethodNode test2 = cls.searchMethodByName("test2(I)I"); // checkLine(lines, codeWriter, test2, 3, "return v - 1;"); ======= MethodNode test2 = cls.searchMethodByName("test2(I)I"); checkLine(lines, codeWriter, test2, 3, "return v - 1;"); } @Test @NotYetImplemented public void test2() { ClassNode cls = getClassNode(TestCls.class); CodeWriter codeWriter = cls.getCode(); String code = codeWriter.toString(); String[] lines = code.split(CodeWriter.NL); >>>>>>> // MethodNode test2 = cls.searchMethodByName("test2(I)I"); // checkLine(lines, codeWriter, test2, 3, "return v - 1;"); } @Test @NotYetImplemented public void test2() { ClassNode cls = getClassNode(TestCls.class); CodeWriter codeWriter = cls.getCode(); String code = codeWriter.toString(); String[] lines = code.split(CodeWriter.NL);
<<<<<<< if (isMthMatch(mth, mthPattern)) { int decompiledLine = mth.getDecompiledLine(); ======= if (mthPattern.matcher(mth.getName()).matches()) { int decompiledLine = mth.getDecompiledLine() - 1; >>>>>>> if (isMthMatch(mth, mthPattern)) { int decompiledLine = mth.getDecompiledLine() - 1; <<<<<<< LOG.info("{}\n{}", mth.getMethodInfo().getShortId(), mthCode); ======= LOG.info("Print method: {}\n{}", mth.getMethodInfo().getShortId(), mthCode); >>>>>>> LOG.info("Print method: {}\n{}", mth.getMethodInfo().getShortId(), mthCode);
<<<<<<< private void removeJumpAttributes(InsnNode[] insnArr) { for (InsnNode insn : insnArr) { if (insn != null && insn.contains(AType.JUMP)) { insn.remove(AType.JUMP); } } } ======= private void removeUnreachableBlocks(MethodNode mth) { Set<BlockNode> toRemove = new LinkedHashSet<>(); for (BlockNode block : mth.getBasicBlocks()) { if (block.getPredecessors().isEmpty() && block != mth.getEnterBlock()) { toRemove.add(block); collectSuccessors(block, toRemove); } } if (!toRemove.isEmpty()) { mth.getBasicBlocks().removeIf(toRemove::contains); int insnsCount = toRemove.stream().mapToInt(block -> block.getInstructions().size()).sum(); mth.addAttr(AType.COMMENTS, "JADX INFO: unreachable blocks removed: " + toRemove.size() + ", instructions: " + insnsCount); } } private void collectSuccessors(BlockNode startBlock, Set<BlockNode> toRemove) { Deque<BlockNode> stack = new ArrayDeque<>(); stack.add(startBlock); while (!stack.isEmpty()) { BlockNode block = stack.pop(); if (!toRemove.contains(block)) { for (BlockNode successor : block.getSuccessors()) { if (toRemove.containsAll(successor.getPredecessors())) { stack.push(successor); } } } toRemove.add(block); } } >>>>>>> private void removeJumpAttributes(InsnNode[] insnArr) { for (InsnNode insn : insnArr) { if (insn != null && insn.contains(AType.JUMP)) { insn.remove(AType.JUMP); } } } private void removeUnreachableBlocks(MethodNode mth) { Set<BlockNode> toRemove = new LinkedHashSet<>(); for (BlockNode block : mth.getBasicBlocks()) { if (block.getPredecessors().isEmpty() && block != mth.getEnterBlock()) { toRemove.add(block); collectSuccessors(block, toRemove); } } if (!toRemove.isEmpty()) { mth.getBasicBlocks().removeIf(toRemove::contains); int insnsCount = toRemove.stream().mapToInt(block -> block.getInstructions().size()).sum(); mth.addAttr(AType.COMMENTS, "JADX INFO: unreachable blocks removed: " + toRemove.size() + ", instructions: " + insnsCount); } } private void collectSuccessors(BlockNode startBlock, Set<BlockNode> toRemove) { Deque<BlockNode> stack = new ArrayDeque<>(); stack.add(startBlock); while (!stack.isEmpty()) { BlockNode block = stack.pop(); if (!toRemove.contains(block)) { for (BlockNode successor : block.getSuccessors()) { if (toRemove.containsAll(successor.getPredecessors())) { stack.push(successor); } } } toRemove.add(block); } }
<<<<<<< while (true) { String entryName = "classes" + (index == 0 ? "" : index) + ext; ZipEntry entry = zf.getEntry(entryName); if (entry == null) { break; } // security check if(!ZipSecurity.isValidZipEntry(entry)) { index++; continue; } InputStream inputStream = zf.getInputStream(entry); try { if (ext.equals(".dex")) { addDexFile(entryName, new Dex(inputStream)); } else if (ext.equals(".jar")) { File jarFile = FileUtils.createTempFile(entryName); FileOutputStream fos = new FileOutputStream(jarFile); try { IOUtils.copy(inputStream, fos); } finally { close(fos); ======= try (ZipFile zf = new ZipFile(file)) { // Input file could be .apk or .zip files // we should consider the input file could contain only one single dex, multi-dex, or instantRun support dex for Android .apk files String instantRunDexSuffix = "classes" + ext; for (Enumeration<? extends ZipEntry> e = zf.entries(); e.hasMoreElements(); ) { ZipEntry entry = e.nextElement(); String entryName = entry.getName(); InputStream inputStream = zf.getInputStream(entry); try { if ((entryName.startsWith("classes") && entryName.endsWith(ext)) || entryName.endsWith(instantRunDexSuffix)) { if (ext.equals(".dex")) { index++; addDexFile(entryName, new Dex(inputStream)); } else if (ext.equals(".jar")) { index++; File jarFile = FileUtils.createTempFile(entryName); FileOutputStream fos = new FileOutputStream(jarFile); try { IOUtils.copy(inputStream, fos); } finally { close(fos); } addDexFile(entryName, loadFromJar(jarFile)); } else { throw new JadxRuntimeException("Unexpected extension in zip: " + ext); } } else if (entryName.equals("instant-run.zip") && ext.equals(".dex")) { File jarFile = FileUtils.createTempFile("instant-run.zip"); FileOutputStream fos = new FileOutputStream(jarFile); try { IOUtils.copy(inputStream, fos); } finally { close(fos); } InputFile tempFile = new InputFile(jarFile); tempFile.loadFromZip(ext); List<DexFile> dexFiles = tempFile.getDexFiles(); if (!dexFiles.isEmpty()) { index += dexFiles.size(); this.dexFiles.addAll(dexFiles); } >>>>>>> try (ZipFile zf = new ZipFile(file)) { // Input file could be .apk or .zip files // we should consider the input file could contain only one single dex, multi-dex, or instantRun support dex for Android .apk files String instantRunDexSuffix = "classes" + ext; for (Enumeration<? extends ZipEntry> e = zf.entries(); e.hasMoreElements(); ) { ZipEntry entry = e.nextElement(); String entryName = entry.getName(); // security check if(!ZipSecurity.isValidZipEntry(entry)) { continue; } InputStream inputStream = zf.getInputStream(entry); try { if ((entryName.startsWith("classes") && entryName.endsWith(ext)) || entryName.endsWith(instantRunDexSuffix)) { if (ext.equals(".dex")) { index++; addDexFile(entryName, new Dex(inputStream)); } else if (ext.equals(".jar")) { index++; File jarFile = FileUtils.createTempFile(entryName); FileOutputStream fos = new FileOutputStream(jarFile); try { IOUtils.copy(inputStream, fos); } finally { close(fos); } addDexFile(entryName, loadFromJar(jarFile)); } else { throw new JadxRuntimeException("Unexpected extension in zip: " + ext); } } else if (entryName.equals("instant-run.zip") && ext.equals(".dex")) { File jarFile = FileUtils.createTempFile("instant-run.zip"); FileOutputStream fos = new FileOutputStream(jarFile); try { IOUtils.copy(inputStream, fos); } finally { close(fos); } InputFile tempFile = new InputFile(jarFile); tempFile.loadFromZip(ext); List<DexFile> dexFiles = tempFile.getDexFiles(); if (!dexFiles.isEmpty()) { index += dexFiles.size(); this.dexFiles.addAll(dexFiles); }
<<<<<<< this.mNfcSignedHash = builder.mNfcSignedHash; this.mNfcCreationTimestamp = builder.mNfcCreationTimestamp; ======= this.mOriginalFilename = builder.mOriginalFilename; >>>>>>> this.mNfcSignedHash = builder.mNfcSignedHash; this.mNfcCreationTimestamp = builder.mNfcCreationTimestamp; this.mOriginalFilename = builder.mOriginalFilename; <<<<<<< ======= ArmoredOutputStream armorOut = null; OutputStream out; if (mEnableAsciiArmorOutput) { armorOut = new ArmoredOutputStream(mOutStream); if (mVersionHeader != null) { armorOut.setHeader("Version", mVersionHeader); } out = armorOut; } else { out = mOutStream; } >>>>>>> ArmoredOutputStream armorOut = null; OutputStream out; if (mEnableAsciiArmorOutput) { armorOut = new ArmoredOutputStream(mOutStream); if (mVersionHeader != null) { armorOut.setHeader("Version", mVersionHeader); } out = armorOut; } else { out = mOutStream; } <<<<<<< signatureGenerator = signingKey.getSignatureGenerator( mSignatureHashAlgorithm, cleartext, mNfcSignedHash, mNfcCreationTimestamp); ======= if (mSignatureForceV3) { signatureV3Generator = signingKey.getV3SignatureGenerator( mSignatureHashAlgorithm, cleartext); } else { signatureGenerator = signingKey.getSignatureGenerator( mSignatureHashAlgorithm, cleartext); } >>>>>>> signatureGenerator = signingKey.getSignatureGenerator( mSignatureHashAlgorithm, cleartext, mNfcSignedHash, mNfcCreationTimestamp); <<<<<<< ArmoredOutputStream armorOut = null; OutputStream out; if (mEnableAsciiArmorOutput) { armorOut = new ArmoredOutputStream(mOutStream); armorOut.setHeader("Version", mVersionHeader); out = armorOut; } else { out = mOutStream; } ======= ProgressScaler progressScaler = new ProgressScaler(mProgressable, 8, 95, 100); >>>>>>> ProgressScaler progressScaler = new ProgressScaler(mProgressable, 8, 95, 100); <<<<<<< signatureGenerator.update(buffer, 0, n); ======= if (mSignatureForceV3) { signatureV3Generator.update(buffer, 0, length); } else { signatureGenerator.update(buffer, 0, length); } >>>>>>> signatureGenerator.update(buffer, 0, length); <<<<<<< signatureGenerator.update(buffer, 0, n); ======= if (mSignatureForceV3) { signatureV3Generator.update(buffer, 0, length); } else { signatureGenerator.update(buffer, 0, length); } alreadyWritten += length; if (mData.getSize() > 0) { long progress = 100 * alreadyWritten / mData.getSize(); progressScaler.setProgress((int) progress, 100); } >>>>>>> signatureGenerator.update(buffer, 0, length); alreadyWritten += length; if (mData.getSize() > 0) { long progress = 100 * alreadyWritten / mData.getSize(); progressScaler.setProgress((int) progress, 100); }
<<<<<<< import java.io.IOException; ======= import android.content.ContentResolver; import android.content.Context; import android.content.Intent; >>>>>>> import java.io.IOException; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; <<<<<<< import android.os.Handler; ======= import android.provider.ContactsContract; >>>>>>> import android.os.Handler; import android.provider.ContactsContract; <<<<<<< import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ListView; import android.widget.TextView; ======= import android.widget.*; >>>>>>> import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ListView; import android.widget.TextView; import android.widget.*; <<<<<<< private void loadData(Uri dataUri, boolean isSecret, byte[] fingerprint) { ======= /** * Checks if a system contact exists for given masterKeyId, and if it does, sets name, picture * and onClickListener for the linked system contact's layout * * @param name * @param masterKeyId */ private void loadLinkedSystemContact(String name, final long masterKeyId) { final Context context = mSystemContactName.getContext(); final ContentResolver resolver = context.getContentResolver(); final long contactId = ContactHelper.findContactId(resolver, masterKeyId); if (contactId != -1) {//contact exists for given master key mSystemContactName.setText(name); Bitmap picture = ContactHelper.loadPhotoByMasterKeyId(resolver, masterKeyId, true); if (picture != null) mSystemContactPicture.setImageBitmap(picture); mSystemContactLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { launchContactActivity(contactId, context); } }); } } /** * launches the default android Contacts app to view a contact with the passed * contactId (CONTACT_ID column from ContactsContract.RawContact table which is _ID column in * ContactsContract.Contact table) * * @param contactId _ID for row in ContactsContract.Contacts table * @param context */ private void launchContactActivity(final long contactId, Context context) { Intent intent = new Intent(Intent.ACTION_VIEW); Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, String.valueOf(contactId)); intent.setData(uri); context.startActivity(intent); } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); Uri dataUri = getArguments().getParcelable(ARG_DATA_URI); if (dataUri == null) { Log.e(Constants.TAG, "Data missing. Should be Uri of key!"); getActivity().finish(); return; } loadData(dataUri); } // These are the rows that we will retrieve. static final String[] UNIFIED_PROJECTION = new String[]{ KeychainContract.KeyRings._ID, KeychainContract.KeyRings.MASTER_KEY_ID, KeychainContract.KeyRings.USER_ID, KeychainContract.KeyRings.IS_REVOKED, KeychainContract.KeyRings.IS_EXPIRED, KeychainContract.KeyRings.VERIFIED, KeychainContract.KeyRings.HAS_ANY_SECRET, KeychainContract.KeyRings.FINGERPRINT, KeychainContract.KeyRings.HAS_ENCRYPT }; static final int INDEX_MASTER_KEY_ID = 1; static final int INDEX_USER_ID = 2; static final int INDEX_IS_REVOKED = 3; static final int INDEX_IS_EXPIRED = 4; static final int INDEX_VERIFIED = 5; static final int INDEX_HAS_ANY_SECRET = 6; static final int INDEX_FINGERPRINT = 7; static final int INDEX_HAS_ENCRYPT = 8; private void loadData(Uri dataUri) { >>>>>>> /** * Checks if a system contact exists for given masterKeyId, and if it does, sets name, picture * and onClickListener for the linked system contact's layout * * @param name * @param masterKeyId */ private void loadLinkedSystemContact(String name, final long masterKeyId) { final Context context = mSystemContactName.getContext(); final ContentResolver resolver = context.getContentResolver(); final long contactId = ContactHelper.findContactId(resolver, masterKeyId); if (contactId != -1) {//contact exists for given master key mSystemContactName.setText(name); Bitmap picture = ContactHelper.loadPhotoByMasterKeyId(resolver, masterKeyId, true); if (picture != null) mSystemContactPicture.setImageBitmap(picture); mSystemContactLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { launchContactActivity(contactId, context); } }); } } /** * launches the default android Contacts app to view a contact with the passed * contactId (CONTACT_ID column from ContactsContract.RawContact table which is _ID column in * ContactsContract.Contact table) * * @param contactId _ID for row in ContactsContract.Contacts table * @param context */ private void launchContactActivity(final long contactId, Context context) { Intent intent = new Intent(Intent.ACTION_VIEW); Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, String.valueOf(contactId)); intent.setData(uri); context.startActivity(intent); } private void loadData(Uri dataUri, boolean isSecret, byte[] fingerprint) { <<<<<<< public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) { ======= @Override public void onLoadFinished(Loader<Cursor> loader, Cursor data) { /* TODO better error handling? May cause problems when a key is deleted, * because the notification triggers faster than the activity closes. */ // Avoid NullPointerExceptions... if (data.getCount() == 0) { return; } >>>>>>> @Override public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) { <<<<<<< ======= case LOADER_ID_UNIFIED: { if (data.moveToFirst()) { mIsSecret = data.getInt(INDEX_HAS_ANY_SECRET) != 0; if (mName == null) {//to ensure we load the linked system contact only once String[] mainUserId = KeyRing.splitUserId(data.getString(INDEX_USER_ID)); mName = mainUserId[0]; long masterKeyId = data.getLong(INDEX_MASTER_KEY_ID); loadLinkedSystemContact(mName, masterKeyId); } // load user ids after we know if it's a secret key mUserIdsAdapter = new UserIdsAdapter(getActivity(), null, 0, !mIsSecret, null); mUserIds.setAdapter(mUserIdsAdapter); getLoaderManager().initLoader(LOADER_ID_USER_IDS, null, this); break; } } >>>>>>>
<<<<<<< ======= import org.sufficientlysecure.keychain.operations.results.PromoteKeyResult; >>>>>>> import org.sufficientlysecure.keychain.operations.results.PromoteKeyResult; <<<<<<< // this assumes that the bytes are cleartext (valid for current implementation!) if (source == IO_BYTES) { builder.setCleartextSignature(true); } ======= String symmetricPassphrase = data.getString(ENCRYPT_SYMMETRIC_PASSPHRASE); >>>>>>> String symmetricPassphrase = data.getString(ENCRYPT_SYMMETRIC_PASSPHRASE);
<<<<<<< import android.os.Bundle; import android.os.Parcelable; import android.support.annotation.NonNull; ======= import android.graphics.Color; import android.support.annotation.StringRes; >>>>>>> import android.os.Bundle; import android.os.Parcelable; import android.support.annotation.NonNull; import android.support.annotation.StringRes; <<<<<<< ======= import android.text.format.DateUtils; >>>>>>> <<<<<<< ======= >>>>>>> <<<<<<< public long getSelectedKeyId() { Object item = getSelectedItem(); return getSelectedKeyId(item); } public long getSelectedKeyId(Object item) { if (item instanceof KeyItem) { return ((KeyItem) item).mKeyId; } return Constants.key.none; } public void setPreSelectedKeyId(long selectedKeyId) { mPreSelectedKeyId = selectedKeyId; ======= public void setSelectedKeyId(long selectedKeyId) { this.mSelectedKeyId = selectedKeyId; >>>>>>> public long getSelectedKeyId() { Object item = getSelectedItem(); return getSelectedKeyId(item); } public long getSelectedKeyId(Object item) { if (item instanceof KeyItem) { return ((KeyItem) item).mKeyId; } return Constants.key.none; } public void setPreSelectedKeyId(long selectedKeyId) { mPreSelectedKeyId = selectedKeyId; <<<<<<< public boolean isEnabled(Cursor cursor) { return KeySpinner.this.isItemEnabled(cursor); ======= public void bindView(View view, Context context, Cursor cursor) { TextView vKeyName = (TextView) view.findViewById(R.id.keyspinner_key_name); ImageView vKeyStatus = (ImageView) view.findViewById(R.id.keyspinner_key_status); TextView vKeyEmail = (TextView) view.findViewById(R.id.keyspinner_key_email); TextView vDuplicate = (TextView) view.findViewById(R.id.keyspinner_duplicate); KeyRing.UserId userId = KeyRing.splitUserId(cursor.getString(mIndexUserId)); vKeyName.setText(userId.name); vKeyEmail.setText(userId.email); boolean duplicate = cursor.getLong(mIndexDuplicate) > 0; if (duplicate) { String dateTime = DateUtils.formatDateTime(context, cursor.getLong(mIndexCreationDate) * 1000, DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_SHOW_YEAR | DateUtils.FORMAT_ABBREV_MONTH); vDuplicate.setText(context.getString(R.string.label_key_created, dateTime)); vDuplicate.setVisibility(View.VISIBLE); } else { vDuplicate.setVisibility(View.GONE); } boolean valid = setStatus(getContext(), cursor, vKeyStatus); setItemEnabled(view, valid); >>>>>>> public boolean isEnabled(Cursor cursor) { return KeySpinner.this.isItemEnabled(cursor); <<<<<<< ======= TextView vKeyName = (TextView) view.findViewById(R.id.keyspinner_key_name); ImageView vKeyStatus = (ImageView) view.findViewById(R.id.keyspinner_key_status); TextView vKeyEmail = (TextView) view.findViewById(R.id.keyspinner_key_email); TextView vKeyDuplicate = (TextView) view.findViewById(R.id.keyspinner_duplicate); vKeyName.setText(getNoneString()); vKeyEmail.setVisibility(View.GONE); vKeyDuplicate.setVisibility(View.GONE); vKeyStatus.setVisibility(View.GONE); setItemEnabled(view, true); } else { view = inner.getView(position - 1, convertView, parent); TextView vKeyEmail = (TextView) view.findViewById(R.id.keyspinner_key_email); vKeyEmail.setVisibility(View.VISIBLE); >>>>>>> <<<<<<< @Override public void onRestoreInstanceState(Parcelable state) { Bundle bundle = (Bundle) state; mPreSelectedKeyId = bundle.getLong(ARG_KEY_ID); // restore super state super.onRestoreInstanceState(bundle.getParcelable(ARG_SUPER_STATE)); } @NonNull @Override public Parcelable onSaveInstanceState() { Bundle bundle = new Bundle(); // save super state bundle.putParcelable(ARG_SUPER_STATE, super.onSaveInstanceState()); bundle.putLong(ARG_KEY_ID, getSelectedKeyId()); return bundle; } ======= public @StringRes int getNoneString() { return R.string.choice_none; } >>>>>>> @Override public void onRestoreInstanceState(Parcelable state) { Bundle bundle = (Bundle) state; mPreSelectedKeyId = bundle.getLong(ARG_KEY_ID); // restore super state super.onRestoreInstanceState(bundle.getParcelable(ARG_SUPER_STATE)); } @NonNull @Override public Parcelable onSaveInstanceState() { Bundle bundle = new Bundle(); // save super state bundle.putParcelable(ARG_SUPER_STATE, super.onSaveInstanceState()); bundle.putLong(ARG_KEY_ID, getSelectedKeyId()); return bundle; } public @StringRes int getNoneString() { return R.string.cert_none; }
<<<<<<< import org.sufficientlysecure.keychain.service.ImportKeyringParcel; ======= import org.sufficientlysecure.keychain.service.KeychainIntentService; import org.sufficientlysecure.keychain.ui.linked.LinkedIdWizard; import org.sufficientlysecure.keychain.service.ServiceProgressHandler; import org.sufficientlysecure.keychain.service.ServiceProgressHandler.MessageStatus; import org.sufficientlysecure.keychain.service.PassphraseCacheService; >>>>>>> import org.sufficientlysecure.keychain.service.ImportKeyringParcel; import org.sufficientlysecure.keychain.ui.linked.LinkedIdWizard; <<<<<<< MenuItem exportKey = menu.findItem(R.id.menu_key_view_export_file); exportKey.setVisible(mIsSecret); ======= MenuItem addLinked = menu.findItem(R.id.menu_key_view_add_linked_identity); addLinked.setVisible(mIsSecret); >>>>>>> MenuItem exportKey = menu.findItem(R.id.menu_key_view_export_file); exportKey.setVisible(mIsSecret); MenuItem addLinked = menu.findItem(R.id.menu_key_view_add_linked_identity); addLinked.setVisible(mIsSecret); <<<<<<< startActivityForResult(intent, REQUEST_CERTIFY); } ======= startActivityForResult(intent, 0); } >>>>>>> startActivityForResult(intent, REQUEST_CERTIFY); } <<<<<<< // CryptoOperationHelper.Callback functions private void updateFromKeyserver(Uri dataUri, ProviderHelper providerHelper) throws ProviderHelper.NotFoundException { mIsRefreshing = true; mRefreshItem.setEnabled(false); mRefreshItem.setActionView(mRefresh); mRefresh.startAnimation(mRotate); byte[] blob = (byte[]) providerHelper.getGenericData( KeychainContract.KeyRings.buildUnifiedKeyRingUri(dataUri), KeychainContract.Keys.FINGERPRINT, ProviderHelper.FIELD_TYPE_BLOB); String fingerprint = KeyFormattingUtils.convertFingerprintToHex(blob); ParcelableKeyRing keyEntry = new ParcelableKeyRing(fingerprint, null, null); ArrayList<ParcelableKeyRing> entries = new ArrayList<>(); entries.add(keyEntry); mKeyList = entries; // search config { Preferences prefs = Preferences.getPreferences(this); Preferences.CloudSearchPrefs cloudPrefs = new Preferences.CloudSearchPrefs(true, true, prefs.getPreferredKeyserver()); mKeyserver = cloudPrefs.keyserver; } mOperationHelper.cryptoOperation(); } @Override public ImportKeyringParcel createOperationInput() { return new ImportKeyringParcel(mKeyList, mKeyserver); } @Override public void onCryptoOperationSuccess(ImportKeyResult result) { mIsRefreshing = false; result.createNotify(this).show(); } @Override public void onCryptoOperationCancelled() { mIsRefreshing = false; } @Override public void onCryptoOperationError(ImportKeyResult result) { mIsRefreshing = false; result.createNotify(this).show(); } @Override public boolean onCryptoSetProgress(String msg, int progress, int max) { return true; } ======= >>>>>>> // CryptoOperationHelper.Callback functions private void updateFromKeyserver(Uri dataUri, ProviderHelper providerHelper) throws ProviderHelper.NotFoundException { mIsRefreshing = true; mRefreshItem.setEnabled(false); mRefreshItem.setActionView(mRefresh); mRefresh.startAnimation(mRotate); byte[] blob = (byte[]) providerHelper.getGenericData( KeychainContract.KeyRings.buildUnifiedKeyRingUri(dataUri), KeychainContract.Keys.FINGERPRINT, ProviderHelper.FIELD_TYPE_BLOB); String fingerprint = KeyFormattingUtils.convertFingerprintToHex(blob); ParcelableKeyRing keyEntry = new ParcelableKeyRing(fingerprint, null, null); ArrayList<ParcelableKeyRing> entries = new ArrayList<>(); entries.add(keyEntry); mKeyList = entries; // search config { Preferences prefs = Preferences.getPreferences(this); Preferences.CloudSearchPrefs cloudPrefs = new Preferences.CloudSearchPrefs(true, true, prefs.getPreferredKeyserver()); mKeyserver = cloudPrefs.keyserver; } mOperationHelper.cryptoOperation(); } @Override public ImportKeyringParcel createOperationInput() { return new ImportKeyringParcel(mKeyList, mKeyserver); } @Override public void onCryptoOperationSuccess(ImportKeyResult result) { mIsRefreshing = false; result.createNotify(this).show(); } @Override public void onCryptoOperationCancelled() { mIsRefreshing = false; } @Override public void onCryptoOperationError(ImportKeyResult result) { mIsRefreshing = false; result.createNotify(this).show(); } @Override public boolean onCryptoSetProgress(String msg, int progress, int max) { return true; }
<<<<<<< import java.text.DateFormat; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.TimeZone; import java.util.Vector; import org.spongycastle.bcpg.sig.KeyFlags; import org.spongycastle.openpgp.PGPKeyFlags; import org.spongycastle.openpgp.PGPPublicKey; import org.spongycastle.openpgp.PGPSecretKey; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.pgp.PgpKeyHelper; import org.sufficientlysecure.keychain.util.Choice; ======= import android.annotation.TargetApi; >>>>>>> import java.text.DateFormat; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.TimeZone; import java.util.Vector; import org.spongycastle.bcpg.sig.KeyFlags; import org.spongycastle.openpgp.PGPKeyFlags; import org.spongycastle.openpgp.PGPPublicKey; import org.spongycastle.openpgp.PGPSecretKey; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.pgp.PgpKeyHelper; import org.sufficientlysecure.keychain.util.Choice; import android.annotation.TargetApi; <<<<<<< import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.DatePicker; import android.widget.LinearLayout; import android.widget.TableLayout; import android.widget.TableRow; import android.widget.TextView; ======= import android.widget.*; >>>>>>> import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.DatePicker; import android.widget.LinearLayout; import android.widget.TableLayout; import android.widget.TableRow; import android.widget.TextView;
<<<<<<< import java.util.regex.Matcher; import java.util.regex.Pattern; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.pgp.PgpKeyHelper; ======= >>>>>>> import java.util.regex.Matcher; import java.util.regex.Pattern; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.pgp.PgpKeyHelper; <<<<<<< private String mOriginalName; private EditText mEmail; private String mOriginalEmail; ======= private AutoCompleteTextView mEmail; >>>>>>> private String mOriginalName; private AutoCompleteTextView mEmail; private String mOriginalEmail; <<<<<<< // see http://www.regular-expressions.info/email.html // RFC 2822 if we omit the syntax using double quotes and square brackets // android.util.Patterns.EMAIL_ADDRESS is only available as of Android 2.2+ private static final Pattern EMAIL_PATTERN = Pattern .compile( "[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", Pattern.CASE_INSENSITIVE); ======= public static class NoNameException extends Exception { static final long serialVersionUID = 0xf812773343L; public NoNameException(String message) { super(message); } } >>>>>>> <<<<<<< mName.addTextChangedListener(mTextWatcher); mEmail = (EditText) findViewById(R.id.email); mEmail.addTextChangedListener(mTextWatcher); ======= mEmail = (AutoCompleteTextView) findViewById(R.id.email); >>>>>>> mName.addTextChangedListener(mTextWatcher); mEmail = (AutoCompleteTextView) findViewById(R.id.email); <<<<<<< public String getValue() throws InvalidEmailException { ======= public String getValue() throws NoNameException, NoEmailException { >>>>>>> public String getValue() {
<<<<<<< import org.spongycastle.bcpg.sig.KeyFlags; ======= import com.devspark.appmsg.AppMsg; >>>>>>> <<<<<<< ======= import org.sufficientlysecure.keychain.helper.Preferences; >>>>>>> import org.sufficientlysecure.keychain.helper.Preferences; <<<<<<< Notify.showNotify(this, "Backup Notify.Style", Notify.Style.INFO); } catch(IOException e) { ======= AppMsg.makeText(this, "Backup successful", AppMsg.STYLE_CONFIRM).show(); } catch (IOException e) { >>>>>>> Notify.showNotify(this, "Backup Notify.Style", Notify.Style.INFO); } catch(IOException e) {
<<<<<<< CryptoInputParcel cryptoInput = new CryptoInputParcel(new Date(), ""); return internal(sKR, masterSecretKey, add.mFlags, add.mExpiry, saveParcel, log); ======= return internal(sKR, masterSecretKey, add.mFlags, add.mExpiry, saveParcel, new Passphrase(), log); >>>>>>> mCryptoInput = new CryptoInputParcel(new Date(), new Passphrase("")); return internal(sKR, masterSecretKey, add.mFlags, add.mExpiry, saveParcel, log); <<<<<<< public PgpEditKeyResult modifySecretKeyRing(CanonicalizedSecretKeyRing wsKR, SaveKeyringParcel saveParcel) { ======= public PgpEditKeyResult modifySecretKeyRing(CanonicalizedSecretKeyRing wsKR, SaveKeyringParcel saveParcel, Passphrase passphrase) { >>>>>>> public PgpEditKeyResult modifySecretKeyRing(CanonicalizedSecretKeyRing wsKR, SaveKeyringParcel saveParcel) { <<<<<<< SaveKeyringParcel saveParcel, ======= SaveKeyringParcel saveParcel, Passphrase passphrase, >>>>>>> SaveKeyringParcel saveParcel, <<<<<<< if (isDivertToCard(masterSecretKey)) { masterPrivateKey = null; log.add(LogType.MSG_MF_DIVERT, indent); } else { // 1. Unlock private key progress(R.string.progress_modify_unlock, 10); log.add(LogType.MSG_MF_UNLOCK, indent); { try { PBESecretKeyDecryptor keyDecryptor = new JcePBESecretKeyDecryptorBuilder().setProvider( Constants.BOUNCY_CASTLE_PROVIDER_NAME).build(mCryptoInput.getPassphrase()); masterPrivateKey = masterSecretKey.extractPrivateKey(keyDecryptor); } catch (PGPException e) { log.add(LogType.MSG_MF_UNLOCK_ERROR, indent + 1); return new PgpEditKeyResult(PgpEditKeyResult.RESULT_ERROR, log, null); } ======= { try { PBESecretKeyDecryptor keyDecryptor = new JcePBESecretKeyDecryptorBuilder().setProvider( Constants.BOUNCY_CASTLE_PROVIDER_NAME).build(passphrase.getCharArray()); masterPrivateKey = masterSecretKey.extractPrivateKey(keyDecryptor); } catch (PGPException e) { log.add(LogType.MSG_MF_UNLOCK_ERROR, indent + 1); return new PgpEditKeyResult(PgpEditKeyResult.RESULT_ERROR, log, null); >>>>>>> if (isDivertToCard(masterSecretKey)) { masterPrivateKey = null; log.add(LogType.MSG_MF_DIVERT, indent); } else { // 1. Unlock private key progress(R.string.progress_modify_unlock, 10); log.add(LogType.MSG_MF_UNLOCK, indent); { try { PBESecretKeyDecryptor keyDecryptor = new JcePBESecretKeyDecryptorBuilder().setProvider( Constants.BOUNCY_CASTLE_PROVIDER_NAME).build(mCryptoInput.getPassphrase().getCharArray()); masterPrivateKey = masterSecretKey.extractPrivateKey(keyDecryptor); } catch (PGPException e) { log.add(LogType.MSG_MF_UNLOCK_ERROR, indent + 1); return new PgpEditKeyResult(PgpEditKeyResult.RESULT_ERROR, log, null); } <<<<<<< .setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME).build(passphrase); ======= .setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME).build(passphrase.getCharArray()); >>>>>>> .setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME).build( mCryptoInput.getPassphrase().getCharArray()); <<<<<<< char[] passphrase, ======= Passphrase passphrase, >>>>>>> Passphrase passphrase, <<<<<<< char[] passphrase, String newPassphrase, ======= Passphrase passphrase, Passphrase newPassphrase, >>>>>>> Passphrase passphrase, Passphrase newPassphrase, <<<<<<< Constants.BOUNCY_CASTLE_PROVIDER_NAME).build(passphrase); ======= Constants.BOUNCY_CASTLE_PROVIDER_NAME).build(passphrase.getCharArray()); >>>>>>> Constants.BOUNCY_CASTLE_PROVIDER_NAME).build(passphrase.getCharArray()); <<<<<<< ======= private static PGPSignature generateSubkeyBindingSignature( PGPPublicKey masterPublicKey, PGPPrivateKey masterPrivateKey, PGPSecretKey sKey, PGPPublicKey pKey, int flags, long expiry, Passphrase passphrase) throws IOException, PGPException, SignatureException { PBESecretKeyDecryptor keyDecryptor = new JcePBESecretKeyDecryptorBuilder() .setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME).build( passphrase.getCharArray()); PGPPrivateKey subPrivateKey = sKey.extractPrivateKey(keyDecryptor); return generateSubkeyBindingSignature(masterPublicKey, masterPrivateKey, subPrivateKey, pKey, flags, expiry); } >>>>>>>
<<<<<<< import java.util.ArrayList; import java.util.List; import java.util.Vector; import org.spongycastle.openpgp.PGPKeyFlags; import org.spongycastle.openpgp.PGPSecretKey; import org.sufficientlysecure.keychain.Id; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.pgp.PgpConversionHelper; import org.sufficientlysecure.keychain.service.KeychainIntentService; import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler; import org.sufficientlysecure.keychain.service.PassphraseCacheService; import org.sufficientlysecure.keychain.ui.dialog.ProgressDialogFragment; import org.sufficientlysecure.keychain.ui.widget.Editor.EditorListener; import org.sufficientlysecure.keychain.util.Choice; import android.app.AlertDialog; ======= >>>>>>> import java.util.ArrayList; import java.util.List; import java.util.Vector; import org.spongycastle.openpgp.PGPKeyFlags; import org.spongycastle.openpgp.PGPSecretKey; import org.sufficientlysecure.keychain.Id; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.pgp.PgpConversionHelper; import org.sufficientlysecure.keychain.service.KeychainIntentService; import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler; import org.sufficientlysecure.keychain.service.PassphraseCacheService; import org.sufficientlysecure.keychain.ui.dialog.ProgressDialogFragment; import org.sufficientlysecure.keychain.ui.widget.Editor.EditorListener; import org.sufficientlysecure.keychain.util.Choice; import android.app.AlertDialog; <<<<<<< public class SectionView extends LinearLayout implements OnClickListener, EditorListener, Editor { ======= import org.spongycastle.openpgp.PGPSecretKey; import org.sufficientlysecure.keychain.Id; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.pgp.PgpConversionHelper; import org.sufficientlysecure.keychain.service.KeychainIntentService; import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler; import org.sufficientlysecure.keychain.service.PassphraseCacheService; import org.sufficientlysecure.keychain.ui.dialog.CreateKeyDialogFragment; import org.sufficientlysecure.keychain.ui.dialog.ProgressDialogFragment; import org.sufficientlysecure.keychain.ui.widget.Editor.EditorListener; import org.sufficientlysecure.keychain.util.Choice; import java.util.Vector; public class SectionView extends LinearLayout implements OnClickListener, EditorListener { >>>>>>> import org.spongycastle.openpgp.PGPSecretKey; import org.sufficientlysecure.keychain.Id; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.pgp.PgpConversionHelper; import org.sufficientlysecure.keychain.service.KeychainIntentService; import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler; import org.sufficientlysecure.keychain.service.PassphraseCacheService; import org.sufficientlysecure.keychain.ui.dialog.CreateKeyDialogFragment; import org.sufficientlysecure.keychain.ui.dialog.ProgressDialogFragment; import org.sufficientlysecure.keychain.ui.widget.Editor.EditorListener; import org.sufficientlysecure.keychain.util.Choice; public class SectionView extends LinearLayout implements OnClickListener, EditorListener, Editor {
<<<<<<< import org.sufficientlysecure.keychain.keyimport.HkpKeyserver; import org.sufficientlysecure.keychain.keyimport.Keyserver; import org.sufficientlysecure.keychain.keyimport.ParcelableKeyRing; ======= import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.keyimport.HkpKeyserver; import org.sufficientlysecure.keychain.keyimport.Keyserver; import org.sufficientlysecure.keychain.keyimport.ParcelableKeyRing; >>>>>>> import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.keyimport.HkpKeyserver; import org.sufficientlysecure.keychain.keyimport.Keyserver; import org.sufficientlysecure.keychain.keyimport.ParcelableKeyRing; <<<<<<< import org.sufficientlysecure.keychain.operations.EditKeyOperation; import org.sufficientlysecure.keychain.operations.ImportExportOperation; import org.sufficientlysecure.keychain.operations.PromoteKeyOperation; import org.sufficientlysecure.keychain.operations.SignEncryptOperation; import org.sufficientlysecure.keychain.operations.results.CertifyResult; import org.sufficientlysecure.keychain.operations.results.ConsolidateResult; import org.sufficientlysecure.keychain.operations.results.DecryptVerifyResult; ======= import org.sufficientlysecure.keychain.operations.ImportExportOperation; import org.sufficientlysecure.keychain.operations.results.CertifyResult; import org.sufficientlysecure.keychain.operations.results.ConsolidateResult; import org.sufficientlysecure.keychain.operations.results.DecryptVerifyResult; >>>>>>> import org.sufficientlysecure.keychain.operations.EditKeyOperation; import org.sufficientlysecure.keychain.operations.ImportExportOperation; import org.sufficientlysecure.keychain.operations.PromoteKeyOperation; import org.sufficientlysecure.keychain.operations.SignEncryptOperation; import org.sufficientlysecure.keychain.operations.results.CertifyResult; import org.sufficientlysecure.keychain.operations.results.ConsolidateResult; import org.sufficientlysecure.keychain.operations.results.DecryptVerifyResult; <<<<<<< import org.sufficientlysecure.keychain.operations.results.ImportKeyResult; import org.sufficientlysecure.keychain.operations.results.OperationResult; import org.sufficientlysecure.keychain.operations.results.PromoteKeyResult; import org.sufficientlysecure.keychain.operations.results.SignEncryptResult; ======= import org.sufficientlysecure.keychain.operations.results.ImportKeyResult; import org.sufficientlysecure.keychain.operations.results.OperationResult; import org.sufficientlysecure.keychain.operations.results.OperationResult.LogType; import org.sufficientlysecure.keychain.operations.results.OperationResult.OperationLog; import org.sufficientlysecure.keychain.operations.results.SaveKeyringResult; import org.sufficientlysecure.keychain.operations.results.SignEncryptResult; >>>>>>> import org.sufficientlysecure.keychain.operations.results.ImportKeyResult; import org.sufficientlysecure.keychain.operations.results.OperationResult; import org.sufficientlysecure.keychain.operations.results.OperationResult.OperationLog; import org.sufficientlysecure.keychain.operations.results.PromoteKeyResult; import org.sufficientlysecure.keychain.operations.results.SignEncryptResult; <<<<<<< ======= import org.sufficientlysecure.keychain.pgp.PgpHelper; import org.sufficientlysecure.keychain.pgp.PgpKeyOperation; import org.sufficientlysecure.keychain.pgp.PgpSignEncrypt; >>>>>>> <<<<<<< ======= import org.sufficientlysecure.keychain.pgp.exception.PgpKeyNotFoundException; import org.sufficientlysecure.keychain.provider.CachedPublicKeyRing; >>>>>>> <<<<<<< import org.sufficientlysecure.keychain.util.ParcelableFileCache; ======= import org.sufficientlysecure.keychain.util.ParcelableFileCache; import org.sufficientlysecure.keychain.util.ParcelableFileCache.IteratorWithSize; import org.sufficientlysecure.keychain.util.Preferences; import org.sufficientlysecure.keychain.util.ProgressScaler; >>>>>>> import org.sufficientlysecure.keychain.util.ParcelableFileCache; <<<<<<< ======= import java.util.Date; import java.util.Iterator; import java.util.List; >>>>>>> import java.util.List; <<<<<<< break; case ACTION_DECRYPT_VERIFY: ======= } else if (ACTION_VERIFY_KEYBASE_PROOF.equals(action)) { try { Proof proof = new Proof(new JSONObject(data.getString(KEYBASE_PROOF))); setProgress(R.string.keybase_message_fetching_data, 0, 100); Prover prover = Prover.findProverFor(proof); if (prover == null) { sendProofError(getString(R.string.keybase_no_prover_found) + ": " + proof.getPrettyName()); return; } if (!prover.fetchProofData()) { sendProofError(prover.getLog(), getString(R.string.keybase_problem_fetching_evidence)); return; } String requiredFingerprint = data.getString(KEYBASE_REQUIRED_FINGERPRINT); if (!prover.checkFingerprint(requiredFingerprint)) { sendProofError(getString(R.string.keybase_key_mismatch)); return; } String domain = prover.dnsTxtCheckRequired(); if (domain != null) { DNSMessage dnsQuery = new Client().query(new Question(domain, Record.TYPE.TXT)); if (dnsQuery == null) { sendProofError(prover.getLog(), getString(R.string.keybase_dns_query_failure)); return; } Record[] records = dnsQuery.getAnswers(); List<List<byte[]>> extents = new ArrayList<List<byte[]>>(); for (Record r : records) { Data d = r.getPayload(); if (d instanceof TXT) { extents.add(((TXT) d).getExtents()); } } if (!prover.checkDnsTxt(extents)) { sendProofError(prover.getLog(), null); return; } } byte[] messageBytes = prover.getPgpMessage().getBytes(); if (prover.rawMessageCheckRequired()) { InputStream messageByteStream = PGPUtil.getDecoderStream(new ByteArrayInputStream(messageBytes)); if (!prover.checkRawMessageBytes(messageByteStream)) { sendProofError(prover.getLog(), null); return; } } // kind of awkward, but this whole class wants to pull bytes out of “data” data.putInt(KeychainIntentService.TARGET, KeychainIntentService.IO_BYTES); data.putByteArray(KeychainIntentService.DECRYPT_CIPHERTEXT_BYTES, messageBytes); InputData inputData = createDecryptInputData(data); OutputStream outStream = createCryptOutputStream(data); PgpDecryptVerify.Builder builder = new PgpDecryptVerify.Builder( this, new ProviderHelper(this), this, inputData, outStream ); builder.setSignedLiteralData(true).setRequiredSignerFingerprint(requiredFingerprint); DecryptVerifyResult decryptVerifyResult = builder.build().execute(); outStream.close(); if (!decryptVerifyResult.success()) { OperationLog log = decryptVerifyResult.getLog(); OperationResult.LogEntryParcel lastEntry = null; for (OperationResult.LogEntryParcel entry : log) { lastEntry = entry; } sendProofError(getString(lastEntry.mType.getMsgId())); return; } if (!prover.validate(outStream.toString())) { sendProofError(getString(R.string.keybase_message_payload_mismatch)); return; } Bundle resultData = new Bundle(); resultData.putString(KeychainIntentServiceHandler.DATA_MESSAGE, "OK"); // these help the handler construct a useful human-readable message resultData.putString(KeychainIntentServiceHandler.KEYBASE_PROOF_URL, prover.getProofUrl()); resultData.putString(KeychainIntentServiceHandler.KEYBASE_PRESENCE_URL, prover.getPresenceUrl()); resultData.putString(KeychainIntentServiceHandler.KEYBASE_PRESENCE_LABEL, prover.getPresenceLabel()); sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY, resultData); } catch (Exception e) { sendErrorToHandler(e); } } else if (ACTION_DECRYPT_VERIFY.equals(action)) { >>>>>>> break; } case ACTION_VERIFY_KEYBASE_PROOF: { try { Proof proof = new Proof(new JSONObject(data.getString(KEYBASE_PROOF))); setProgress(R.string.keybase_message_fetching_data, 0, 100); Prover prover = Prover.findProverFor(proof); if (prover == null) { sendProofError(getString(R.string.keybase_no_prover_found) + ": " + proof.getPrettyName()); return; } if (!prover.fetchProofData()) { sendProofError(prover.getLog(), getString(R.string.keybase_problem_fetching_evidence)); return; } String requiredFingerprint = data.getString(KEYBASE_REQUIRED_FINGERPRINT); if (!prover.checkFingerprint(requiredFingerprint)) { sendProofError(getString(R.string.keybase_key_mismatch)); return; } String domain = prover.dnsTxtCheckRequired(); if (domain != null) { DNSMessage dnsQuery = new Client().query(new Question(domain, Record.TYPE.TXT)); if (dnsQuery == null) { sendProofError(prover.getLog(), getString(R.string.keybase_dns_query_failure)); return; } Record[] records = dnsQuery.getAnswers(); List<List<byte[]>> extents = new ArrayList<List<byte[]>>(); for (Record r : records) { Data d = r.getPayload(); if (d instanceof TXT) { extents.add(((TXT) d).getExtents()); } } if (!prover.checkDnsTxt(extents)) { sendProofError(prover.getLog(), null); return; } } byte[] messageBytes = prover.getPgpMessage().getBytes(); if (prover.rawMessageCheckRequired()) { InputStream messageByteStream = PGPUtil.getDecoderStream(new ByteArrayInputStream(messageBytes)); if (!prover.checkRawMessageBytes(messageByteStream)) { sendProofError(prover.getLog(), null); return; } } // kind of awkward, but this whole class wants to pull bytes out of “data” data.putInt(KeychainIntentService.TARGET, KeychainIntentService.IO_BYTES); data.putByteArray(KeychainIntentService.DECRYPT_CIPHERTEXT_BYTES, messageBytes); InputData inputData = createDecryptInputData(data); OutputStream outStream = createCryptOutputStream(data); PgpDecryptVerify.Builder builder = new PgpDecryptVerify.Builder( this, new ProviderHelper(this), this, inputData, outStream ); builder.setSignedLiteralData(true).setRequiredSignerFingerprint(requiredFingerprint); DecryptVerifyResult decryptVerifyResult = builder.build().execute(); outStream.close(); if (!decryptVerifyResult.success()) { OperationLog log = decryptVerifyResult.getLog(); OperationResult.LogEntryParcel lastEntry = null; for (OperationResult.LogEntryParcel entry : log) { lastEntry = entry; } sendProofError(getString(lastEntry.mType.getMsgId())); return; } if (!prover.validate(outStream.toString())) { sendProofError(getString(R.string.keybase_message_payload_mismatch)); return; } Bundle resultData = new Bundle(); resultData.putString(KeychainIntentServiceHandler.DATA_MESSAGE, "OK"); // these help the handler construct a useful human-readable message resultData.putString(KeychainIntentServiceHandler.KEYBASE_PROOF_URL, prover.getProofUrl()); resultData.putString(KeychainIntentServiceHandler.KEYBASE_PRESENCE_URL, prover.getPresenceUrl()); resultData.putString(KeychainIntentServiceHandler.KEYBASE_PRESENCE_LABEL, prover.getPresenceLabel()); sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY, resultData); } catch (Exception e) { sendErrorToHandler(e); } break; } case ACTION_DECRYPT_VERIFY: {
<<<<<<< // setCalendarViewShown() is supported from API 11 onwards. if (android.os.Build.VERSION.SDK_INT >= 11) // Hide calendarView in tablets because of the unix warparound bug. dialog.getDatePicker().setCalendarViewShown(false); ======= if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) { if ( dialog != null && mCreatedDate != null ) { dialog.getDatePicker().setMinDate(mCreatedDate.getTime().getTime()+ DateUtils.DAY_IN_MILLIS); } else { //When created date isn't available dialog.getDatePicker().setMinDate(date.getTime().getTime()+ DateUtils.DAY_IN_MILLIS); } } >>>>>>> // setCalendarViewShown() is supported from API 11 onwards. if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) // Hide calendarView in tablets because of the unix warparound bug. dialog.getDatePicker().setCalendarViewShown(false); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) { if ( dialog != null && mCreatedDate != null ) { dialog.getDatePicker().setMinDate(mCreatedDate.getTime().getTime()+ DateUtils.DAY_IN_MILLIS); } else { //When created date isn't available dialog.getDatePicker().setMinDate(date.getTime().getTime()+ DateUtils.DAY_IN_MILLIS); } }
<<<<<<< ======= import android.app.ProgressDialog; import android.content.Context; import android.content.Intent; >>>>>>> <<<<<<< ======= import org.sufficientlysecure.keychain.helper.ContactHelper; import org.sufficientlysecure.keychain.service.KeychainIntentService; import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler; import org.sufficientlysecure.keychain.service.SaveKeyringParcel; import org.sufficientlysecure.keychain.util.Notify; import java.util.regex.Matcher; >>>>>>> <<<<<<< // Add the fragment to the 'fragment_container' FrameLayout // NOTE: We use commitAllowingStateLoss() to prevent weird crashes! FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); switch (animation) { case ANIM_NO: transaction.setCustomAnimations(0, 0); break; case ANIM_TO_LEFT: transaction.setCustomAnimations(R.anim.frag_slide_in_from_left, R.anim.frag_slide_out_to_right); break; case ANIM_TO_RIGHT: transaction.setCustomAnimations(R.anim.frag_slide_out_to_left, R.anim.frag_slide_in_from_right); transaction.addToBackStack("back"); break; ======= saveHandler.showProgressDialog(this); startService(intent); } private void uploadKey() { // Send all information needed to service to upload key in other thread Intent intent = new Intent(this, KeychainIntentService.class); intent.setAction(KeychainIntentService.ACTION_UPLOAD_KEYRING); // set data uri as path to keyring // TODO // Uri blobUri = KeychainContract.KeyRingData.buildPublicKeyRingUri(mDataUri); // intent.setData(blobUri); // fill values for this action Bundle data = new Bundle(); Spinner keyServer = (Spinner) findViewById(R.id.upload_key_keyserver); String server = (String) keyServer.getSelectedItem(); data.putString(KeychainIntentService.UPLOAD_KEY_SERVER, server); intent.putExtra(KeychainIntentService.EXTRA_DATA, data); // Message is received after uploading is done in KeychainIntentService KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(this, getString(R.string.progress_exporting), ProgressDialog.STYLE_HORIZONTAL) { public void handleMessage(Message message) { // handle messages by standard KeychainIntentServiceHandler first super.handleMessage(message); if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) { Notify.showNotify(CreateKeyActivity.this, R.string.key_send_success, Notify.Style.INFO); CreateKeyActivity.this.setResult(RESULT_OK); CreateKeyActivity.this.finish(); } } }; // Create a new Messenger for the communication back Messenger messenger = new Messenger(saveHandler); intent.putExtra(KeychainIntentService.EXTRA_MESSENGER, messenger); // show progress dialog saveHandler.showProgressDialog(this); // start service with intent startService(intent); } /** * Checks if text of given EditText is not empty. If it is empty an error is * set and the EditText gets the focus. * * @param context * @param editText * @return true if EditText is not empty */ private static boolean isEditTextNotEmpty(Context context, EditText editText) { boolean output = true; if (editText.getText().toString().length() == 0) { editText.setError(context.getString(R.string.create_key_empty)); editText.requestFocus(); output = false; } else { editText.setError(null); >>>>>>> // Add the fragment to the 'fragment_container' FrameLayout // NOTE: We use commitAllowingStateLoss() to prevent weird crashes! FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); switch (animation) { case ANIM_NO: transaction.setCustomAnimations(0, 0); break; case ANIM_TO_LEFT: transaction.setCustomAnimations(R.anim.frag_slide_in_from_left, R.anim.frag_slide_out_to_right); break; case ANIM_TO_RIGHT: transaction.setCustomAnimations(R.anim.frag_slide_out_to_left, R.anim.frag_slide_in_from_right); transaction.addToBackStack("back"); break;
<<<<<<< private boolean canEdit = true; private boolean oldItemDeleted = false; private ArrayList<String> mDeletedIDs = new ArrayList<String>(); private ArrayList<PGPSecretKey> mDeletedKeys = new ArrayList<PGPSecretKey>(); ======= private boolean mCanEdit = true; >>>>>>> private boolean oldItemDeleted = false; private ArrayList<String> mDeletedIDs = new ArrayList<String>(); private ArrayList<PGPSecretKey> mDeletedKeys = new ArrayList<PGPSecretKey>(); private boolean mCanEdit = true; <<<<<<< /** {@inheritDoc} */ public void onDeleted(Editor editor, boolean wasNewItem) { oldItemDeleted |= !wasNewItem; if (oldItemDeleted) { if (mType == Id.type.user_id) mDeletedIDs.add(((UserIdEditor)editor).getOriginalID()); else if (mType == Id.type.key) mDeletedKeys.add(((KeyEditor)editor).getValue()); } ======= /** * {@inheritDoc} */ public void onDeleted(Editor editor) { >>>>>>> /** * {@inheritDoc} */ public void onDeleted(Editor editor, boolean wasNewItem) { oldItemDeleted |= !wasNewItem; if (oldItemDeleted) { if (mType == Id.type.user_id) mDeletedIDs.add(((UserIdEditor)editor).getOriginalID()); else if (mType == Id.type.key) mDeletedKeys.add(((KeyEditor)editor).getValue()); } <<<<<<< public boolean needsSaving() { //check each view for needs saving, take account of deleted items boolean ret = oldItemDeleted; for (int i = 0; i < mEditors.getChildCount(); ++i) { Editor editor = (Editor) mEditors.getChildAt(i); ret |= editor.needsSaving(); if (mType == Id.type.user_id) ret |= ((UserIdEditor)editor).primarySwapped(); } return ret; } public boolean primaryChanged() { boolean ret = false; for (int i = 0; i < mEditors.getChildCount(); ++i) { Editor editor = (Editor) mEditors.getChildAt(i); if (mType == Id.type.user_id) ret |= ((UserIdEditor)editor).primarySwapped(); } return ret; } public String getOriginalPrimaryID() { //NB: this will have to change when we change how Primary IDs are chosen, and so we need to be // careful about where Master key capabilities are stored... multiple primaries and // revoked ones make this harder than the simple case we are continuing to assume here for (int i = 0; i < mEditors.getChildCount(); ++i) { Editor editor = (Editor) mEditors.getChildAt(i); if (mType == Id.type.user_id) { if(((UserIdEditor)editor).getIsOriginallyMainUserID()) { return ((UserIdEditor)editor).getOriginalID(); } } } return null; } public ArrayList<String> getOriginalIDs() { ArrayList<String> orig = new ArrayList<String>(); if (mType == Id.type.user_id) { for (int i = 0; i < mEditors.getChildCount(); ++i) { UserIdEditor editor = (UserIdEditor) mEditors.getChildAt(i); if (editor.isMainUserId()) orig.add(0, editor.getOriginalID()); else orig.add(editor.getOriginalID()); } return orig; } else { return null; } } public ArrayList<String> getDeletedIDs() { return mDeletedIDs; } public ArrayList<PGPSecretKey> getDeletedKeys() { return mDeletedKeys; } public List<Boolean> getNeedsSavingArray() { ArrayList<Boolean> mList = new ArrayList<Boolean>(); for (int i = 0; i < mEditors.getChildCount(); ++i) { Editor editor = (Editor) mEditors.getChildAt(i); mList.add(editor.needsSaving()); } return mList; } public List<Boolean> getNewKeysArray() { ArrayList<Boolean> mList = new ArrayList<Boolean>(); if (mType == Id.type.key) { for (int i = 0; i < mEditors.getChildCount(); ++i) { KeyEditor editor = (KeyEditor) mEditors.getChildAt(i); mList.add(editor.getIsNewKey()); } } return mList; } /** {@inheritDoc} */ ======= /** * {@inheritDoc} */ >>>>>>> public boolean needsSaving() { //check each view for needs saving, take account of deleted items boolean ret = oldItemDeleted; for (int i = 0; i < mEditors.getChildCount(); ++i) { Editor editor = (Editor) mEditors.getChildAt(i); ret |= editor.needsSaving(); if (mType == Id.type.user_id) ret |= ((UserIdEditor)editor).primarySwapped(); } return ret; } public boolean primaryChanged() { boolean ret = false; for (int i = 0; i < mEditors.getChildCount(); ++i) { Editor editor = (Editor) mEditors.getChildAt(i); if (mType == Id.type.user_id) ret |= ((UserIdEditor)editor).primarySwapped(); } return ret; } public String getOriginalPrimaryID() { //NB: this will have to change when we change how Primary IDs are chosen, and so we need to be // careful about where Master key capabilities are stored... multiple primaries and // revoked ones make this harder than the simple case we are continuing to assume here for (int i = 0; i < mEditors.getChildCount(); ++i) { Editor editor = (Editor) mEditors.getChildAt(i); if (mType == Id.type.user_id) { if(((UserIdEditor)editor).getIsOriginallyMainUserID()) { return ((UserIdEditor)editor).getOriginalID(); } } } return null; } public ArrayList<String> getOriginalIDs() { ArrayList<String> orig = new ArrayList<String>(); if (mType == Id.type.user_id) { for (int i = 0; i < mEditors.getChildCount(); ++i) { UserIdEditor editor = (UserIdEditor) mEditors.getChildAt(i); if (editor.isMainUserId()) orig.add(0, editor.getOriginalID()); else orig.add(editor.getOriginalID()); } return orig; } else { return null; } } public ArrayList<String> getDeletedIDs() { return mDeletedIDs; } public ArrayList<PGPSecretKey> getDeletedKeys() { return mDeletedKeys; } public List<Boolean> getNeedsSavingArray() { ArrayList<Boolean> mList = new ArrayList<Boolean>(); for (int i = 0; i < mEditors.getChildCount(); ++i) { Editor editor = (Editor) mEditors.getChildAt(i); mList.add(editor.needsSaving()); } return mList; } public List<Boolean> getNewKeysArray() { ArrayList<Boolean> mList = new ArrayList<Boolean>(); if (mType == Id.type.key) { for (int i = 0; i < mEditors.getChildCount(); ++i) { KeyEditor editor = (KeyEditor) mEditors.getChildAt(i); mList.add(editor.getIsNewKey()); } } return mList; } /** * {@inheritDoc} */ <<<<<<< case Id.type.user_id: { UserIdEditor view = (UserIdEditor) mInflater.inflate( R.layout.edit_key_user_id_item, mEditors, false); view.setEditorListener(this); view.setValue("", mEditors.getChildCount() == 0, true); mEditors.addView(view); if (mEditorListener != null) { mEditorListener.onEdited(); } break; } ======= case Id.type.user_id: { UserIdEditor view = (UserIdEditor) mInflater.inflate( R.layout.edit_key_user_id_item, mEditors, false); view.setEditorListener(this); if (mEditors.getChildCount() == 0) { view.setIsMainUserId(true); } mEditors.addView(view); break; } >>>>>>> case Id.type.user_id: { UserIdEditor view = (UserIdEditor) mInflater.inflate( R.layout.edit_key_user_id_item, mEditors, false); view.setEditorListener(this); view.setValue("", mEditors.getChildCount() == 0, true); mEditors.addView(view); if (mEditorListener != null) { mEditorListener.onEdited(); } break; } <<<<<<< view.setValue(userId, mEditors.getChildCount() == 0, false); view.setCanEdit(canEdit); ======= view.setValue(userId); if (mEditors.getChildCount() == 0) { view.setIsMainUserId(true); } view.setCanEdit(mCanEdit); >>>>>>> view.setValue(userId, mEditors.getChildCount() == 0, false); view.setCanEdit(mCanEdit); <<<<<<< view.setValue(list.get(i), isMasterKey, usages.get(i), newKeys); view.setCanEdit(canEdit); ======= view.setValue(list.get(i), isMasterKey, usages.get(i)); view.setCanEdit(mCanEdit); >>>>>>> view.setValue(list.get(i), isMasterKey, usages.get(i), newKeys); view.setCanEdit(mCanEdit);
<<<<<<< import org.sufficientlysecure.keychain.util.ParcelableFileCache.IteratorWithSize; import org.sufficientlysecure.keychain.keyimport.ParcelableHkpKeyserver; ======= >>>>>>> import org.sufficientlysecure.keychain.keyimport.ParcelableHkpKeyserver; <<<<<<< // for CryptoOperationHelper.Callback private ParcelableHkpKeyserver mKeyserver; private ArrayList<ParcelableKeyRing> mKeyList; private CryptoOperationHelper<ImportKeyringParcel, ImportKeyResult> mOperationHelper; ======= >>>>>>>
<<<<<<< import java.util.ArrayList; import java.util.GregorianCalendar; import java.util.List; import java.util.Vector; import org.spongycastle.bcpg.sig.KeyFlags; ======= import android.app.Activity; import android.app.ProgressDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.os.Messenger; import android.support.v7.app.ActionBarActivity; import android.view.*; import android.view.View.OnClickListener; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.LinearLayout; import android.widget.Toast; import com.beardedhen.androidbootstrap.BootstrapButton; >>>>>>> import java.util.ArrayList; import java.util.GregorianCalendar; import java.util.List; import java.util.Vector; import org.spongycastle.bcpg.sig.KeyFlags; import android.app.Activity; import android.app.ProgressDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.os.Messenger; import android.support.v7.app.ActionBarActivity; import android.view.*; import android.view.View.OnClickListener; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.LinearLayout; import android.widget.Toast; import com.beardedhen.androidbootstrap.BootstrapButton; <<<<<<< import android.app.AlertDialog; import android.app.Activity; import android.app.ProgressDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.os.Messenger; import android.support.v7.app.ActionBarActivity; import android.support.v4.app.ActivityCompat; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.LinearLayout; import android.widget.Toast; import com.beardedhen.androidbootstrap.BootstrapButton; ======= import java.util.ArrayList; import java.util.GregorianCalendar; import java.util.Vector; >>>>>>> import android.app.AlertDialog; import android.support.v4.app.ActivityCompat; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; <<<<<<< ======= // Inflate a "Save"/"Cancel" custom action bar ActionBarHelper.setTwoButtonView(getSupportActionBar(), R.string.btn_save, R.drawable.ic_action_save, new View.OnClickListener() { @Override public void onClick(View v) { saveClicked(); } }, R.string.btn_do_not_save, R.drawable.ic_action_cancel, new View.OnClickListener() { @Override public void onClick(View v) { cancelClicked(); } } ); >>>>>>> <<<<<<< ======= // Inflate a "Save"/"Cancel" custom action bar ActionBarHelper.setOneButtonView(getSupportActionBar(), R.string.btn_save, R.drawable.ic_action_save, new View.OnClickListener() { @Override public void onClick(View v) { saveClicked(); } }); >>>>>>> <<<<<<< masterCanSign = ProviderHelper.getSecretMasterKeyCanCertify(this, keyRingRowId); finallyEdit(masterKeyId); ======= mMasterCanSign = ProviderHelper.getMasterKeyCanSign(this, mDataUri); finallyEdit(masterKeyId, mMasterCanSign); >>>>>>> mMasterCanSign = ProviderHelper.getMasterKeyCanCertify(this, mDataUri); finallyEdit(masterKeyId); <<<<<<< buildLayout(false); ======= >>>>>>> buildLayout(false); <<<<<<< mKeysView.setCanEdit(masterCanSign); mKeysView.setKeys(mKeys, mKeysUsages, newKeys); mKeysView.setEditorListener(this); ======= mKeysView.setCanEdit(mMasterCanSign); mKeysView.setKeys(mKeys, mKeysUsages); >>>>>>> mKeysView.setCanEdit(mMasterCanSign); mKeysView.setKeys(mKeys, mKeysUsages, newKeys); mKeysView.setEditorListener(this); <<<<<<< if (needsSaving()) { //make sure, as some versions don't support invalidateOptionsMenu try { if (!isPassphraseSet()) { throw new PgpGeneralException(this.getString(R.string.set_a_passphrase)); } String passphrase; if (mIsPassPhraseSet) passphrase = PassphraseCacheService.getCachedPassphrase(this, masterKeyId); else passphrase = ""; if (passphrase == null) { showPassphraseDialog(masterKeyId); } else { mCurrentPassphrase = passphrase; finallySaveClicked(); } } catch (PgpGeneralException e) { Toast.makeText(this, getString(R.string.error_message, e.getMessage()), Toast.LENGTH_SHORT).show(); ======= if (!isPassphraseSet()) { Log.e(Constants.TAG, "No passphrase has been set"); Toast.makeText(this, R.string.set_a_passphrase, Toast.LENGTH_LONG).show(); } else { String passphrase = null; if (mIsPassPhraseSet) { passphrase = PassphraseCacheService.getCachedPassphrase(this, masterKeyId); } else { passphrase = ""; } if (passphrase == null) { showPassphraseDialog(masterKeyId, mMasterCanSign); } else { mCurrentPassphrase = passphrase; finallySaveClicked(); >>>>>>> if (needsSaving()) { //make sure, as some versions don't support invalidateOptionsMenu try { if (!isPassphraseSet()) { throw new PgpGeneralException(this.getString(R.string.set_a_passphrase)); } String passphrase; if (mIsPassPhraseSet) passphrase = PassphraseCacheService.getCachedPassphrase(this, masterKeyId); else passphrase = ""; if (passphrase == null) { showPassphraseDialog(masterKeyId); } else { mCurrentPassphrase = passphrase; finallySaveClicked(); } } catch (PgpGeneralException e) { Toast.makeText(this, getString(R.string.error_message, e.getMessage()), Toast.LENGTH_SHORT).show(); <<<<<<< data.putBoolean(KeychainIntentService.SAVE_KEYRING_CAN_SIGN, masterCanSign); data.putParcelable(KeychainIntentService.SAVE_KEYRING_PARCEL, saveParams); ======= data.putString(KeychainIntentService.SAVE_KEYRING_CURRENT_PASSPHRASE, mCurrentPassphrase); data.putString(KeychainIntentService.SAVE_KEYRING_NEW_PASSPHRASE, mNewPassPhrase); data.putStringArrayList(KeychainIntentService.SAVE_KEYRING_USER_IDS, getUserIds(mUserIdsView)); ArrayList<PGPSecretKey> keys = getKeys(mKeysView); data.putByteArray(KeychainIntentService.SAVE_KEYRING_KEYS, PgpConversionHelper.PGPSecretKeyArrayListToBytes(keys)); data.putIntegerArrayList(KeychainIntentService.SAVE_KEYRING_KEYS_USAGES, getKeysUsages(mKeysView)); data.putSerializable(KeychainIntentService.SAVE_KEYRING_KEYS_EXPIRY_DATES, getKeysExpiryDates(mKeysView)); data.putLong(KeychainIntentService.SAVE_KEYRING_MASTER_KEY_ID, getMasterKeyId()); data.putBoolean(KeychainIntentService.SAVE_KEYRING_CAN_SIGN, mMasterCanSign); >>>>>>> data.putBoolean(KeychainIntentService.SAVE_KEYRING_CAN_SIGN, mMasterCanSign); data.putParcelable(KeychainIntentService.SAVE_KEYRING_PARCEL, saveParams); <<<<<<< Toast.makeText(this, getString(R.string.error_message, e.getMessage()), Toast.LENGTH_SHORT).show(); ======= Log.e(Constants.TAG, getString(R.string.error_message, e.getMessage())); Toast.makeText(this, getString(R.string.error_message, e.getMessage()), Toast.LENGTH_SHORT).show(); >>>>>>> Log.e(Constants.TAG, getString(R.string.error_message, e.getMessage())); Toast.makeText(this, getString(R.string.error_message, e.getMessage()), Toast.LENGTH_SHORT).show();
<<<<<<< import org.sufficientlysecure.keychain.util.ParcelableFileCache.IteratorWithSize; import org.sufficientlysecure.keychain.util.ParcelableProxy; ======= >>>>>>> import org.sufficientlysecure.keychain.util.ParcelableProxy; <<<<<<< ParcelableHkpKeyserver hkpKeyserver, ParcelableProxy proxy) { return serialKeyRingImport(entries, num, hkpKeyserver, mProgressable, proxy); ======= String keyServerUri, Proxy proxy, boolean skipSave) { return serialKeyRingImport(entries, num, keyServerUri, mProgressable, proxy, skipSave); >>>>>>> ParcelableHkpKeyserver keyserver, ParcelableProxy proxy, boolean skipSave) { return serialKeyRingImport(entries, num, keyserver, mProgressable, proxy, skipSave); <<<<<<< ParcelableHkpKeyserver hkpKeyserver, ParcelableProxy proxy) { ======= String keyServerUri, Proxy proxy, boolean skipSave) { >>>>>>> ParcelableHkpKeyserver keyserver, ParcelableProxy proxy, boolean skipSave) { <<<<<<< return serialKeyRingImport(it, numEntries, hkpKeyserver, mProgressable, proxy); ======= return serialKeyRingImport(it, numEntries, keyServerUri, mProgressable, proxy, skipSave); >>>>>>> return serialKeyRingImport(it, numEntries, keyserver, mProgressable, proxy, skipSave); <<<<<<< ParcelableHkpKeyserver hkpKeyserver, Progressable progressable, @NonNull ParcelableProxy proxy) { ======= String keyServerUri, Progressable progressable, @NonNull Proxy proxy, boolean skipSave) { >>>>>>> ParcelableHkpKeyserver hkpKeyserver, Progressable progressable, @NonNull ParcelableProxy proxy, boolean skipSave) { <<<<<<< ParcelableHkpKeyserver keyServer = importInput.mKeyserver; ======= String keyServer = importInput.mKeyserver; boolean skipSave = importInput.mSkipSave; >>>>>>> ParcelableHkpKeyserver keyServer = importInput.mKeyserver; boolean skipSave = importInput.mSkipSave; <<<<<<< private ImportKeyResult multiThreadedKeyImport(@NonNull Iterator<ParcelableKeyRing> keyListIterator, int totKeys, final ParcelableHkpKeyserver hkpKeyserver, final ParcelableProxy proxy) { ======= private ImportKeyResult multiThreadedKeyImport(ArrayList<ParcelableKeyRing> keyList, final String keyServer, final Proxy proxy, final boolean skipSave) { >>>>>>> private ImportKeyResult multiThreadedKeyImport(ArrayList<ParcelableKeyRing> keyList, final ParcelableHkpKeyserver keyServer, final ParcelableProxy proxy, final boolean skipSave) { <<<<<<< return serialKeyRingImport(list.iterator(), 1, hkpKeyserver, ignoreProgressable, proxy); ======= return serialKeyRingImport(list.iterator(), 1, keyServer, ignoreProgressable, proxy, skipSave); >>>>>>> return serialKeyRingImport(list.iterator(), 1, keyServer, ignoreProgressable, proxy, skipSave);
<<<<<<< import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler.MessageStatus; import org.sufficientlysecure.keychain.service.input.CryptoInputParcel; ======= import org.sufficientlysecure.keychain.service.ServiceProgressHandler.MessageStatus; >>>>>>> import org.sufficientlysecure.keychain.service.input.CryptoInputParcel; import org.sufficientlysecure.keychain.service.ServiceProgressHandler.MessageStatus;
<<<<<<< ======= private Passphrase mCurrentPassphrase; >>>>>>> <<<<<<< ======= @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case REQUEST_CODE_PASSPHRASE: { if (resultCode == Activity.RESULT_OK && data != null) { mCurrentPassphrase = data.getParcelableExtra(PassphraseDialogActivity.MESSAGE_DATA_PASSPHRASE); // Prepare the loaders. Either re-connect with an existing ones, // or start new ones. getLoaderManager().initLoader(LOADER_ID_USER_IDS, null, EditKeyFragment.this); getLoaderManager().initLoader(LOADER_ID_SUBKEYS, null, EditKeyFragment.this); } else { getActivity().finish(); } return; } default: { super.onActivityResult(requestCode, resultCode, data); } } } >>>>>>> <<<<<<< @Override protected void cryptoOperation(CryptoInputParcel cryptoInput) { Log.d(Constants.TAG, "cryptoInput:\n" + cryptoInput); Log.d(Constants.TAG, "mSaveKeyringParcel:\n" + mSaveKeyringParcel); ======= private void saveInDatabase(Passphrase passphrase) { Log.d(Constants.TAG, "mSaveKeyringParcel:\n" + mSaveKeyringParcel.toString()); >>>>>>> @Override protected void cryptoOperation(CryptoInputParcel cryptoInput) { Log.d(Constants.TAG, "cryptoInput:\n" + cryptoInput); Log.d(Constants.TAG, "mSaveKeyringParcel:\n" + mSaveKeyringParcel); <<<<<<< data.putParcelable(KeychainIntentService.EXTRA_CRYPTO_INPUT, cryptoInput); ======= data.putParcelable(KeychainIntentService.EDIT_KEYRING_PASSPHRASE, passphrase); >>>>>>> data.putParcelable(KeychainIntentService.EXTRA_CRYPTO_INPUT, cryptoInput);
<<<<<<< mKeyserver = in.readParcelable(ParcelableHkpKeyserver.class.getClassLoader()); ======= mKeyserver = in.readString(); mSkipSave = in.readInt() != 0; >>>>>>> mKeyserver = in.readParcelable(ParcelableHkpKeyserver.class.getClassLoader()); mSkipSave = in.readInt() != 0; <<<<<<< dest.writeParcelable(mKeyserver, flags); ======= dest.writeString(mKeyserver); dest.writeInt(mSkipSave ? 1 : 0); >>>>>>> dest.writeParcelable(mKeyserver, flags); dest.writeInt(mSkipSave ? 1 : 0);
<<<<<<< initializeConcealPgpApplication( (CheckBoxPreference) findPreference(Constants.Pref.CONCEAL_PGP_APPLICATION)); ======= initializeForceV3Signatures( (CheckBoxPreference) findPreference(Constants.Pref.FORCE_V3_SIGNATURES)); initializeWriteVersionHeader( (CheckBoxPreference) findPreference(Constants.Pref.WRITE_VERSION_HEADER)); >>>>>>> initializeWriteVersionHeader( (CheckBoxPreference) findPreference(Constants.Pref.WRITE_VERSION_HEADER)); <<<<<<< initializeConcealPgpApplication( (CheckBoxPreference) findPreference(Constants.Pref.CONCEAL_PGP_APPLICATION)); ======= initializeForceV3Signatures( (CheckBoxPreference) findPreference(Constants.Pref.FORCE_V3_SIGNATURES)); initializeWriteVersionHeader( (CheckBoxPreference) findPreference(Constants.Pref.WRITE_VERSION_HEADER)); >>>>>>> initializeWriteVersionHeader( (CheckBoxPreference) findPreference(Constants.Pref.WRITE_VERSION_HEADER)); <<<<<<< private static void initializeConcealPgpApplication(final CheckBoxPreference mConcealPgpApplication) { mConcealPgpApplication.setChecked(sPreferences.getConcealPgpApplication()); mConcealPgpApplication.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { ======= private static void initializeForceV3Signatures(final CheckBoxPreference mForceV3Signatures) { mForceV3Signatures.setChecked(sPreferences.getForceV3Signatures()); mForceV3Signatures .setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { public boolean onPreferenceChange(Preference preference, Object newValue) { mForceV3Signatures.setChecked((Boolean) newValue); sPreferences.setForceV3Signatures((Boolean) newValue); return false; } }); } private static void initializeWriteVersionHeader(final CheckBoxPreference mWriteVersionHeader) { mWriteVersionHeader.setChecked(sPreferences.getWriteVersionHeader()); mWriteVersionHeader.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { >>>>>>> private static void initializeWriteVersionHeader(final CheckBoxPreference mWriteVersionHeader) { mWriteVersionHeader.setChecked(sPreferences.getWriteVersionHeader()); mWriteVersionHeader.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
<<<<<<< import org.junit.Assert; ======= import org.easymock.IAnswer; >>>>>>> <<<<<<< try (Scanner s = conn.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) { s.fetchColumnFamily(ReplicationSection.COLF); Entry<Key,Value> entry = Iterables.getOnlyElement(s); Status status = Status.parseFrom(entry.getValue().get()); Assert.assertFalse(status.getClosed()); } ======= Scanner s = conn.createScanner(MetadataTable.NAME, Authorizations.EMPTY); s.fetchColumnFamily(ReplicationSection.COLF); Entry<Key,Value> entry = Iterables.getOnlyElement(s); Status status = Status.parseFrom(entry.getValue().get()); assertFalse(status.getClosed()); >>>>>>> try (Scanner s = conn.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) { s.fetchColumnFamily(ReplicationSection.COLF); Entry<Key,Value> entry = Iterables.getOnlyElement(s); Status status = Status.parseFrom(entry.getValue().get()); assertFalse(status.getClosed()); } <<<<<<< try (Scanner s = conn.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) { s.fetchColumnFamily(ReplicationSection.COLF); Entry<Key,Value> entry = Iterables.getOnlyElement(s); Status status = Status.parseFrom(entry.getValue().get()); Assert.assertTrue(status.getClosed()); } ======= Scanner s = conn.createScanner(MetadataTable.NAME, Authorizations.EMPTY); s.fetchColumnFamily(ReplicationSection.COLF); Entry<Key,Value> entry = Iterables.getOnlyElement(s); Status status = Status.parseFrom(entry.getValue().get()); assertTrue(status.getClosed()); >>>>>>> try (Scanner s = conn.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) { s.fetchColumnFamily(ReplicationSection.COLF); Entry<Key,Value> entry = Iterables.getOnlyElement(s); Status status = Status.parseFrom(entry.getValue().get()); assertTrue(status.getClosed()); } <<<<<<< try (Scanner s = ReplicationTable.getScanner(conn)) { Entry<Key,Value> entry = Iterables.getOnlyElement(s); Status status = Status.parseFrom(entry.getValue().get()); Assert.assertFalse(status.getClosed()); } ======= Scanner s = ReplicationTable.getScanner(conn); Entry<Key,Value> entry = Iterables.getOnlyElement(s); Status status = Status.parseFrom(entry.getValue().get()); assertFalse(status.getClosed()); >>>>>>> try (Scanner s = ReplicationTable.getScanner(conn)) { Entry<Key,Value> entry = Iterables.getOnlyElement(s); Status status = Status.parseFrom(entry.getValue().get()); assertFalse(status.getClosed()); }
<<<<<<< ======= import org.spongycastle.bcpg.ArmoredInputStream; import org.spongycastle.bcpg.ArmoredOutputStream; import org.spongycastle.bcpg.BCPGOutputStream; import org.spongycastle.bcpg.CompressionAlgorithmTags; import org.spongycastle.bcpg.HashAlgorithmTags; import org.spongycastle.bcpg.SymmetricKeyAlgorithmTags; import org.spongycastle.bcpg.sig.KeyFlags; import org.spongycastle.jce.provider.BouncyCastleProvider; import org.spongycastle.jce.spec.ElGamalParameterSpec; import org.spongycastle.openpgp.PGPCompressedData; import org.spongycastle.openpgp.PGPCompressedDataGenerator; import org.spongycastle.openpgp.PGPEncryptedData; import org.spongycastle.openpgp.PGPEncryptedDataGenerator; import org.spongycastle.openpgp.PGPEncryptedDataList; import org.spongycastle.openpgp.PGPException; import org.spongycastle.openpgp.PGPKeyPair; import org.spongycastle.openpgp.PGPKeyRing; import org.spongycastle.openpgp.PGPKeyRingGenerator; import org.spongycastle.openpgp.PGPLiteralData; import org.spongycastle.openpgp.PGPLiteralDataGenerator; import org.spongycastle.openpgp.PGPObjectFactory; import org.spongycastle.openpgp.PGPOnePassSignature; import org.spongycastle.openpgp.PGPOnePassSignatureList; import org.spongycastle.openpgp.PGPPBEEncryptedData; import org.spongycastle.openpgp.PGPPrivateKey; import org.spongycastle.openpgp.PGPPublicKey; import org.spongycastle.openpgp.PGPPublicKeyEncryptedData; import org.spongycastle.openpgp.PGPPublicKeyRing; import org.spongycastle.openpgp.PGPSecretKey; import org.spongycastle.openpgp.PGPSecretKeyRing; import org.spongycastle.openpgp.PGPSignature; import org.spongycastle.openpgp.PGPSignatureGenerator; import org.spongycastle.openpgp.PGPSignatureList; import org.spongycastle.openpgp.PGPSignatureSubpacketGenerator; import org.spongycastle.openpgp.PGPSignatureSubpacketVector; import org.spongycastle.openpgp.PGPUtil; import org.spongycastle.openpgp.PGPV3SignatureGenerator; import org.thialfihar.android.apg.KeyServer.AddKeyException; import org.thialfihar.android.apg.provider.DataProvider; import org.thialfihar.android.apg.provider.Database; import org.thialfihar.android.apg.provider.KeyRings; import org.thialfihar.android.apg.provider.Keys; import org.thialfihar.android.apg.provider.UserIds; import org.thialfihar.android.apg.ui.widget.KeyEditor; import org.thialfihar.android.apg.ui.widget.SectionView; import org.thialfihar.android.apg.ui.widget.UserIdEditor; import org.thialfihar.android.apg.utils.IterableIterator; import android.app.Activity; import android.content.Context; import android.content.pm.PackageInfo; import android.content.pm.PackageManager.NameNotFoundException; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.os.Message; import android.view.ViewGroup; >>>>>>> <<<<<<< return keyRing.getPublicKey(keyId); ======= return keyRing.getPublicKey(keyId); >>>>>>> return keyRing.getPublicKey(keyId);
<<<<<<< import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler; import org.sufficientlysecure.keychain.ui.linked.LinkedIdWizard; import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler.MessageStatus; ======= import org.sufficientlysecure.keychain.service.ServiceProgressHandler; import org.sufficientlysecure.keychain.service.ServiceProgressHandler.MessageStatus; >>>>>>> import org.sufficientlysecure.keychain.ui.linked.LinkedIdWizard; import org.sufficientlysecure.keychain.service.ServiceProgressHandler; import org.sufficientlysecure.keychain.service.ServiceProgressHandler.MessageStatus;
<<<<<<< import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler; import org.sufficientlysecure.keychain.service.input.CryptoInputParcel; import org.sufficientlysecure.keychain.service.input.RequiredInputParcel; import org.sufficientlysecure.keychain.ui.base.BaseActivity; ======= import org.sufficientlysecure.keychain.service.ServiceProgressHandler; import org.sufficientlysecure.keychain.ui.dialog.ProgressDialogFragment; >>>>>>> import org.sufficientlysecure.keychain.service.input.CryptoInputParcel; import org.sufficientlysecure.keychain.service.input.RequiredInputParcel; import org.sufficientlysecure.keychain.ui.base.BaseActivity; import org.sufficientlysecure.keychain.service.ServiceProgressHandler; import org.sufficientlysecure.keychain.ui.dialog.ProgressDialogFragment;
<<<<<<< public HashSet<Long> getAvailableSubkeys() { if(!isSecret()) { throw new RuntimeException("Tried to find available subkeys from non-secret keys. " + "This is a programming error and should never happen!"); } HashSet<Long> result = new HashSet<Long>(); // then, mark exactly the keys we have available for (PGPSecretKey sub : new IterableIterator<PGPSecretKey>( ((PGPSecretKeyRing) mRing).getSecretKeys())) { S2K s2k = sub.getS2K(); // add key, except if the private key has been stripped (GNU extension) if(s2k == null || (s2k.getProtectionMode() != S2K.GNU_PROTECTION_MODE_NO_PRIVATE_KEY)) { result.add(sub.getKeyID()); } else { Log.d(Constants.TAG, "S2K GNU extension!, mode: " + s2k.getProtectionMode()); } } return result; } ======= >>>>>>>
<<<<<<< import org.sufficientlysecure.keychain.ui.linked.LinkedIdWizard; ======= import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler.MessageStatus; >>>>>>> import org.sufficientlysecure.keychain.ui.linked.LinkedIdWizard; import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler.MessageStatus;
<<<<<<< ======= if (savedInstanceState == null && getIntent().hasExtra(EXTRA_DISPLAY_RESULT)) { OperationResult result = getIntent().getParcelableExtra(EXTRA_DISPLAY_RESULT); result.createNotify(this).show(); } startFragment(savedInstanceState, mDataUri); if (savedInstanceState == null && getIntent().hasExtra(EXTRA_NFC_AID)) { Intent intent = getIntent(); byte[] nfcFingerprints = intent.getByteArrayExtra(EXTRA_NFC_FINGERPRINTS); String nfcUserId = intent.getStringExtra(EXTRA_NFC_USER_ID); byte[] nfcAid = intent.getByteArrayExtra(EXTRA_NFC_AID); showYubiKeyFragment(nfcFingerprints, nfcUserId, nfcAid); } >>>>>>> if (savedInstanceState == null && getIntent().hasExtra(EXTRA_DISPLAY_RESULT)) { OperationResult result = getIntent().getParcelableExtra(EXTRA_DISPLAY_RESULT); result.createNotify(this).show(); } startFragment(savedInstanceState, mDataUri); if (savedInstanceState == null && getIntent().hasExtra(EXTRA_NFC_AID)) { Intent intent = getIntent(); byte[] nfcFingerprints = intent.getByteArrayExtra(EXTRA_NFC_FINGERPRINTS); String nfcUserId = intent.getStringExtra(EXTRA_NFC_USER_ID); byte[] nfcAid = intent.getByteArrayExtra(EXTRA_NFC_AID); showYubiKeyFragment(nfcFingerprints, nfcUserId, nfcAid); } <<<<<<< // invokeBeam is available from API 21 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { mActionNfc.setVisibility(View.VISIBLE); } else { mActionNfc.setVisibility(View.GONE); ======= mMasterKeyId = data.getLong(INDEX_MASTER_KEY_ID); mFingerprint = KeyFormattingUtils.convertFingerprintToHex(data.getBlob(INDEX_FINGERPRINT)); mIsSecret = data.getInt(INDEX_HAS_ANY_SECRET) != 0; mHasEncrypt = data.getInt(INDEX_HAS_ENCRYPT) != 0; mIsRevoked = data.getInt(INDEX_IS_REVOKED) > 0; mIsExpired = data.getInt(INDEX_IS_EXPIRED) != 0; mIsVerified = data.getInt(INDEX_VERIFIED) > 0; // if the refresh animation isn't playing if (!mRotate.hasStarted() && !mRotateSpin.hasStarted()) { // re-create options menu based on mIsSecret, mIsVerified supportInvalidateOptionsMenu(); // this is done at the end of the animation otherwise >>>>>>> // invokeBeam is available from API 21 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { mActionNfc.setVisibility(View.VISIBLE); } else { mActionNfc.setVisibility(View.GONE); <<<<<<< ======= mActionEncryptFile.setVisibility(View.GONE); mActionEncryptText.setVisibility(View.GONE); mActionNfc.setVisibility(View.GONE); mFab.setVisibility(View.GONE); mQrCodeLayout.setVisibility(View.GONE); } else if (mIsSecret) { mStatusText.setText(R.string.view_key_my_key); mStatusImage.setVisibility(View.GONE); color = getResources().getColor(R.color.primary); // reload qr code only if the fingerprint changed if (!mFingerprint.equals(mQrCodeLoaded)) { loadQrCode(mFingerprint); } photoTask.execute(mMasterKeyId); mQrCodeLayout.setVisibility(View.VISIBLE); // and place leftOf qr code RelativeLayout.LayoutParams nameParams = (RelativeLayout.LayoutParams) mName.getLayoutParams(); // remove right margin nameParams.setMargins(FormattingUtils.dpToPx(this, 48), 0, 0, 0); if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { nameParams.setMarginEnd(0); } nameParams.addRule(RelativeLayout.LEFT_OF, R.id.view_key_qr_code_layout); mName.setLayoutParams(nameParams); RelativeLayout.LayoutParams statusParams = (RelativeLayout.LayoutParams) mStatusText.getLayoutParams(); statusParams.setMargins(FormattingUtils.dpToPx(this, 48), 0, 0, 0); if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { statusParams.setMarginEnd(0); } statusParams.addRule(RelativeLayout.LEFT_OF, R.id.view_key_qr_code_layout); mStatusText.setLayoutParams(statusParams); mActionEncryptFile.setVisibility(View.VISIBLE); mActionEncryptText.setVisibility(View.VISIBLE); // invokeBeam is available from API 21 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { mActionNfc.setVisibility(View.VISIBLE); } else { mActionNfc.setVisibility(View.GONE); } >>>>>>>
<<<<<<< import java.util.Arrays; import java.util.HashMap; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.provider.KeychainContract.ApiApps; import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings; import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRingsColumns; import org.sufficientlysecure.keychain.provider.KeychainContract.KeyTypes; import org.sufficientlysecure.keychain.provider.KeychainContract.Keys; import org.sufficientlysecure.keychain.provider.KeychainContract.KeysColumns; import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds; import org.sufficientlysecure.keychain.provider.KeychainContract.UserIdsColumns; import org.sufficientlysecure.keychain.provider.KeychainContract.Certs; import org.sufficientlysecure.keychain.provider.KeychainDatabase.Tables; import org.sufficientlysecure.keychain.util.Log; ======= >>>>>>> <<<<<<< * unified key rings * <pre> * * key_rings/unified * */ matcher.addURI(authority, KeychainContract.BASE_KEY_RINGS + "/" + KeychainContract.PATH_UNIFIED, UNIFIED_KEY_RING); /** * certifications * <pre> * * key_rings/unified * */ matcher.addURI(authority, KeychainContract.BASE_CERTS, CERTS); matcher.addURI(authority, KeychainContract.BASE_CERTS + "/#", CERTS_BY_ROW_ID); matcher.addURI(authority, KeychainContract.BASE_CERTS + "/" + KeychainContract.PATH_BY_KEY_ROW_ID + "/#", CERTS_BY_KEY_ROW_ID); matcher.addURI(authority, KeychainContract.BASE_CERTS + "/" + KeychainContract.PATH_BY_KEY_ROW_ID + "/#/all", CERTS_BY_KEY_ROW_ID_ALL); matcher.addURI(authority, KeychainContract.BASE_CERTS + "/" + KeychainContract.PATH_BY_KEY_ID + "/#", CERTS_BY_KEY_ID); matcher.addURI(authority, KeychainContract.BASE_CERTS + "/" + KeychainContract.PATH_BY_CERTIFIER_ID + "/#", CERTS_BY_CERTIFIER_ID); /** ======= >>>>>>> /** * certifications * * <pre> * </pre> * */ matcher.addURI(authority, KeychainContract.BASE_CERTS, CERTS); matcher.addURI(authority, KeychainContract.BASE_CERTS + "/#", CERTS_BY_ROW_ID); matcher.addURI(authority, KeychainContract.BASE_CERTS + "/" + KeychainContract.PATH_BY_KEY_ROW_ID + "/#", CERTS_BY_KEY_ROW_ID); matcher.addURI(authority, KeychainContract.BASE_CERTS + "/" + KeychainContract.PATH_BY_KEY_ROW_ID + "/#/all", CERTS_BY_KEY_ROW_ID_ALL); matcher.addURI(authority, KeychainContract.BASE_CERTS + "/" + KeychainContract.PATH_BY_KEY_ID + "/#", CERTS_BY_KEY_ID); matcher.addURI(authority, KeychainContract.BASE_CERTS + "/" + KeychainContract.PATH_BY_CERTIFIER_ID + "/#", CERTS_BY_CERTIFIER_ID); /** <<<<<<< boolean all = false; switch (match) { ======= >>>>>>> <<<<<<< Cursor c = qb.query(db, projection, selection, selectionArgs, groupBy, null, orderBy); ======= Cursor c = qb.query(db, projection, selection, selectionArgs, groupBy, having, orderBy); >>>>>>> Cursor c = qb.query(db, projection, selection, selectionArgs, groupBy, having, orderBy);
<<<<<<< ======= import org.apache.xmlbeans.XmlObject; import org.hibernate.Query; >>>>>>> <<<<<<< import org.n52.sos.ds.hibernate.entities.observation.Observation; import org.n52.sos.ds.hibernate.entities.observation.series.AbstractSeriesObservation; import org.n52.sos.ds.hibernate.entities.observation.series.Series; import org.n52.sos.ds.hibernate.entities.observation.series.SeriesObservation; import org.n52.sos.ds.hibernate.entities.parameter.Parameter; import org.n52.sos.ds.hibernate.entities.parameter.observation.ParameterAdder; import org.n52.sos.ds.hibernate.entities.parameter.series.SeriesParameterAdder; ======= import org.n52.sos.ds.hibernate.entities.interfaces.BlobObservation; import org.n52.sos.ds.hibernate.entities.interfaces.BooleanObservation; import org.n52.sos.ds.hibernate.entities.interfaces.CategoryObservation; import org.n52.sos.ds.hibernate.entities.interfaces.CountObservation; import org.n52.sos.ds.hibernate.entities.interfaces.GeometryObservation; import org.n52.sos.ds.hibernate.entities.interfaces.NumericObservation; import org.n52.sos.ds.hibernate.entities.interfaces.SweDataArrayObservation; import org.n52.sos.ds.hibernate.entities.interfaces.TextObservation; import org.n52.sos.ds.hibernate.entities.series.Series; import org.n52.sos.ds.hibernate.entities.series.SeriesObservation; >>>>>>> import org.n52.sos.ds.hibernate.entities.observation.Observation; import org.n52.sos.ds.hibernate.entities.observation.series.AbstractSeriesObservation; import org.n52.sos.ds.hibernate.entities.observation.series.Series; import org.n52.sos.ds.hibernate.entities.observation.series.SeriesObservation; import org.n52.sos.ds.hibernate.entities.parameter.Parameter; import org.n52.sos.ds.hibernate.entities.parameter.observation.ParameterAdder; import org.n52.sos.ds.hibernate.entities.parameter.series.SeriesParameterAdder; <<<<<<< private final Collection<? extends Observation<?>> observations; ======= private final Collection<AbstractObservation> observations; >>>>>>> private final Collection<? extends Observation<?>> observations;
<<<<<<< import io.personium.core.utils.UriUtils; ======= import io.personium.core.rule.ActionInfo; >>>>>>> import io.personium.core.rule.ActionInfo; import io.personium.core.utils.UriUtils;
<<<<<<< /** Logger. */ static Logger log = LoggerFactory.getLogger(FacadeResource.class); /** クッキー認証の際、クッキー内に埋め込まれている情報のキー. */ ======= /** * For cookie authentication, the key of the information embedded in the cookie. */ >>>>>>> /** Logger. */ static Logger log = LoggerFactory.getLogger(FacadeResource.class); /** For cookie authentication, the key of the information embedded in the cookie. */ <<<<<<< /** クッキー認証の際、クエリパラメタに指定されるキー. */ ======= /** * The key specified in the query parameter during cookie authentication. */ >>>>>>> /** The key specified in the query parameter during cookie authentication. */ <<<<<<< * @param cookieAuthValue クッキー内の p_cookieキーに指定された値 * @param cookiePeer p_cookie_peerクエリに指定された値 * @param headerAuthz Authorization ヘッダ * @param headerHost Host ヘッダ ======= * @param cookieAuthValue The value specified for the p_cookie key in the cookie * @param cookiePeer p_cookie_peer Value specified in the query * @param authzHeaderValue Authorization header * @param host Host header >>>>>>> * @param cookieAuthValue The value specified for the p_cookie key in the cookie * @param cookiePeer p_cookie_peer Value specified in the query * @param headerAuthz Authorization header * @param headerHost Host header <<<<<<< // /** // * @param cookieAuthValue クッキー内の p_cookieキーに指定された値 // * @param cookiePeer p_cookie_peerクエリに指定された値 // * @param authzHeaderValue Authorization ヘッダ // * @param host Host ヘッダ // * @param xPersoniumUnitUser ヘッダ // * @param uriInfo UriInfo // * @return UnitCtlResourceオブジェクト // */ // @Path("__ctl") // public final UnitCtlResource ctl( // @CookieParam(P_COOKIE_KEY) final String cookieAuthValue, // @QueryParam(COOKIE_PEER_QUERY_KEY) final String cookiePeer, // @HeaderParam(HttpHeaders.AUTHORIZATION) final String authzHeaderValue, // @HeaderParam(HttpHeaders.HOST) final String host, // @HeaderParam(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_UNIT_USER) final String xPersoniumUnitUser, // @Context final UriInfo uriInfo) { // AccessContext ac = AccessContext.create(authzHeaderValue, // uriInfo, cookiePeer, cookieAuthValue, null, uriInfo.getBaseUri().toString(), // host, xPersoniumUnitUser); // return new UnitCtlResource(ac, uriInfo); // } // // /** // * @param authzHeaderValue Authorization ヘッダ // * @param host Host ヘッダ // * @param xPersoniumUnitUser ヘッダ // * @param uriInfo UriInfo // * @return UnitCtlResourceオブジェクト // */ // @Path("__status") // public final StatusResource status( // @HeaderParam(HttpHeaders.AUTHORIZATION) final String authzHeaderValue, // @HeaderParam(HttpHeaders.HOST) final String host, // @HeaderParam(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_UNIT_USER) final String xPersoniumUnitUser, // @Context final UriInfo uriInfo) { // return new StatusResource(); // } // // static final String CROSSDOMAIN_XML = PersoniumCoreUtils.readStringResource("crossdomain.xml", CharEncoding.UTF_8); // // /** // * Crossdomain.xmlを返します。 // * @return Crossdomain.xmlの文字列. // */ // @Path("crossdomain.xml") // @Produces(MediaType.APPLICATION_XML) // @GET // public final String crosdomainXml() { // return CROSSDOMAIN_XML; // } ======= /** * @param cookieAuthValue The value specified for the p_cookie key in the cookie * @param cookiePeer p_cookie_peer Value specified in the query * @param authzHeaderValue Authorization header * @param host Host header * @param xPersoniumUnitUser header * @param uriInfo UriInfo * @return UnitCtlResource object */ @Path("__ctl") public final UnitCtlResource ctl( @CookieParam(P_COOKIE_KEY) final String cookieAuthValue, @QueryParam(COOKIE_PEER_QUERY_KEY) final String cookiePeer, @HeaderParam(HttpHeaders.AUTHORIZATION) final String authzHeaderValue, @HeaderParam(HttpHeaders.HOST) final String host, @HeaderParam(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_UNIT_USER) final String xPersoniumUnitUser, @Context final UriInfo uriInfo) { AccessContext ac = AccessContext.create(authzHeaderValue, uriInfo, cookiePeer, cookieAuthValue, null, uriInfo.getBaseUri().toString(), host, xPersoniumUnitUser); return new UnitCtlResource(ac, uriInfo); } /** * @param authzHeaderValue Authorization header * @param host Host header * @param xPersoniumUnitUser header * @param uriInfo UriInfo * @return UnitCtlResource object */ @Path("__status") public final StatusResource status( @HeaderParam(HttpHeaders.AUTHORIZATION) final String authzHeaderValue, @HeaderParam(HttpHeaders.HOST) final String host, @HeaderParam(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_UNIT_USER) final String xPersoniumUnitUser, @Context final UriInfo uriInfo) { return new StatusResource(); } static final String CROSSDOMAIN_XML = PersoniumCoreUtils.readStringResource("crossdomain.xml", CharEncoding.UTF_8); /** * Returns Crossdomain.xml. * @return String of Crossdomain.xml. */ @Path("crossdomain.xml") @Produces(MediaType.APPLICATION_XML) @GET public final String crosdomainXml() { return CROSSDOMAIN_XML; } >>>>>>> // /** // * @param cookieAuthValue The value specified for the p_cookie key in the cookie // * @param cookiePeer p_cookie_peer Value specified in the query // * @param authzHeaderValue Authorization header // * @param host Host header // * @param xPersoniumUnitUser header // * @param uriInfo UriInfo // * @return UnitCtlResource object // */ // @Path("__ctl") // public final UnitCtlResource ctl( // @CookieParam(P_COOKIE_KEY) final String cookieAuthValue, // @QueryParam(COOKIE_PEER_QUERY_KEY) final String cookiePeer, // @HeaderParam(HttpHeaders.AUTHORIZATION) final String authzHeaderValue, // @HeaderParam(HttpHeaders.HOST) final String host, // @HeaderParam(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_UNIT_USER) final String xPersoniumUnitUser, // @Context final UriInfo uriInfo) { // AccessContext ac = AccessContext.create(authzHeaderValue, // uriInfo, cookiePeer, cookieAuthValue, null, uriInfo.getBaseUri().toString(), // host, xPersoniumUnitUser); // return new UnitCtlResource(ac, uriInfo); // } // // /** // * @param authzHeaderValue Authorization header // * @param host Host header // * @param xPersoniumUnitUser header // * @param uriInfo UriInfo // * @return UnitCtlResource object // */ // @Path("__status") // public final StatusResource status( // @HeaderParam(HttpHeaders.AUTHORIZATION) final String authzHeaderValue, // @HeaderParam(HttpHeaders.HOST) final String host, // @HeaderParam(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_UNIT_USER) final String xPersoniumUnitUser, // @Context final UriInfo uriInfo) { // return new StatusResource(); // } // // static final String CROSSDOMAIN_XML = PersoniumCoreUtils.readStringResource("crossdomain.xml", CharEncoding.UTF_8); // // /** // * Returns Crossdomain.xml. // * @return String of Crossdomain.xml. // */ // @Path("crossdomain.xml") // @Produces(MediaType.APPLICATION_XML) // @GET // public final String crosdomainXml() { // return CROSSDOMAIN_XML; // }
<<<<<<< // OAuth2.0認証 return createBearerAuthz(authzHeaderValue, cell, headerHost, baseUri, requestURIInfo, headerHost, xPersoniumUnitUser); ======= //OAuth 2.0 authentication return createBearerAuthz(authzHeaderValue, cell, baseUri, requestURIInfo, host, xPersoniumUnitUser); >>>>>>> //OAuth 2.0 authentication return createBearerAuthz(authzHeaderValue, cell, headerHost, baseUri, requestURIInfo, headerHost, xPersoniumUnitUser); <<<<<<< // TCATの場合はユニットユーザトークンである可能性をチェック // TCATがユニットユーザトークンである条件1:Targetが自分のユニットであること。 // TCATがユニットユーザトークンである条件2:Issuerが設定に存在するUnitUserCellであること。 // TODO Issue-223 一時対処 String escapedBaseUri = baseUri; if (requestURIHost.contains(".")) { String cellName = requestURIHost.split("\\.")[0]; escapedBaseUri = baseUri.replaceFirst(cellName + "\\.", ""); } if ((tca.getTarget().equals(baseUri) || tca.getTarget().equals(escapedBaseUri)) && (PersoniumUnitConfig.checkUnitUserIssuers(tca.getIssuer(), baseUri) || PersoniumUnitConfig.checkUnitUserIssuers(tca.getIssuer(), escapedBaseUri))) { // ユニットユーザトークンの処理 ======= //In the case of TCAT, check the possibility of being a unit user token //TCAT is unit user token Condition 1: Target is your own unit. //TCAT is unit user token Condition 2: Issuer is UnitUserCell which exists in the setting. if (tca.getTarget().equals(baseUri) && PersoniumUnitConfig.checkUnitUserIssuers(tca.getIssuer(), baseUri)) { //Processing unit user tokens >>>>>>> //In the case of TCAT, check the possibility of being a unit user token //TCAT is unit user token Condition 1: Target is your own unit. //TCAT is unit user token Condition 2: Issuer is UnitUserCell which exists in the setting. // TODO Issue-223 一時対処 String escapedBaseUri = baseUri; if (requestURIHost.contains(".")) { String cellName = requestURIHost.split("\\.")[0]; escapedBaseUri = baseUri.replaceFirst(cellName + "\\.", ""); } if ((tca.getTarget().equals(baseUri) || tca.getTarget().equals(escapedBaseUri)) && (PersoniumUnitConfig.checkUnitUserIssuers(tca.getIssuer(), baseUri) || PersoniumUnitConfig.checkUnitUserIssuers(tca.getIssuer(), escapedBaseUri))) { //Processing unit user tokens
<<<<<<< ======= import main.analyzer.backward.AssignInvokeUnitContainer; import main.analyzer.backward.InvokeUnitContainer; >>>>>>> import main.analyzer.backward.AssignInvokeUnitContainer; import main.analyzer.backward.InvokeUnitContainer; <<<<<<< output += "\n***Found: " + predictableSourcMap.get(unit); if (unit.getUnit().getJavaSourceStartLineNumber() >= 0) { output += " in Line " + unit.getUnit().getJavaSourceStartLineNumber(); } ======= StringBuilder output = new StringBuilder(getPrintableMsg(others, rule + "a", ruleDesc)); >>>>>>> StringBuilder output = new StringBuilder(getPrintableMsg(others, rule + "a", ruleDesc));
<<<<<<< /** * {@inheritDoc} */ @Override public ArrayList<AnalysisIssue> createAnalysisOutput(Map<String, String> xmlFileStr, List<String> sourcePaths) { ArrayList<AnalysisIssue> outList = new ArrayList<>(); for (UnitContainer unit : predictableSourcMap.keySet()) { String sootString = predictableSourcMap.get(unit).size() <= 0 ? "" : "Found: \"" + predictableSourcMap.get(unit).get(0).replaceAll("\"", "") + "\""; outList.add(new AnalysisIssue(unit, Integer.parseInt(rule), sootString, sourcePaths)); } return outList; } private String getPrintableMsg(Map<UnitContainer, List<String>> predictableSourcMap, String rule, String ruleDesc) { String output = "***Violated Rule " + ======= private String getPrintableMsg(Collection<String> constants, String rule, String ruleDesc) { return "***Violated Rule " + >>>>>>> /** * {@inheritDoc} */ @Override public ArrayList<AnalysisIssue> createAnalysisOutput(Map<String, String> xmlFileStr, List<String> sourcePaths) { ArrayList<AnalysisIssue> outList = new ArrayList<>(); for (UnitContainer unit : predictableSourcMap.keySet()) { String sootString = predictableSourcMap.get(unit).size() <= 0 ? "" : "Found: \"" + predictableSourcMap.get(unit).get(0).replaceAll("\"", "") + "\""; outList.add(new AnalysisIssue(unit, Integer.parseInt(rule), sootString, sourcePaths)); } return outList; } private String getPrintableMsg(Collection<String> constants, String rule, String ruleDesc) { return "***Violated Rule " +
<<<<<<< private final MethodList<?> targetMethodCandidates; ======= private final MethodList targetCandidates; >>>>>>> private final MethodList<?> targetCandidates; <<<<<<< MethodList<?> targetMethodCandidates) { ======= MethodList targetCandidates) { >>>>>>> MethodList<?> targetCandidates) { <<<<<<< MethodList<?> methodList = this.targetMethodCandidates.filter(isVisibleTo(implementationTarget.getTypeDescription())); if (methodList.size() == 0) { throw new IllegalStateException("No bindable method is visible to " + implementationTarget.getTypeDescription()); } ======= >>>>>>> <<<<<<< return instrumentedType .withField(new FieldDescription.Token(fieldName, Opcodes.ACC_PRIVATE | Opcodes.ACC_STATIC | Opcodes.ACC_SYNTHETIC, new TypeDescription.ForLoadedType(delegate.getClass()))) ======= return instrumentedType .withField(fieldName, new TypeDescription.ForLoadedType(delegate.getClass()), FIELD_MODIFIERS) >>>>>>> return instrumentedType .withField(new FieldDescription.Token(fieldName, FIELD_MODIFIERS, new TypeDescription.ForLoadedType(delegate.getClass())))
<<<<<<< import java.util.ResourceBundle; ======= import java.util.concurrent.TimeUnit; >>>>>>> import java.util.concurrent.TimeUnit; import java.util.ResourceBundle; <<<<<<< private final static String PLAYER_LIST_ID = "playersTable"; ======= public final static String SCREEN_DEBRIEFING_ID = "debriefing"; >>>>>>> private final static String PLAYER_LIST_ID = "playersTable"; public final static String SCREEN_DEBRIEFING_ID = "debriefing"; <<<<<<< logger.log(java.util.logging.Level.WARNING, "Can''t find image {0}", objectiveImage.replace("$index", "1")); ======= logger.warning("Can't find image " + objectiveImage.replace("$index", "0")); >>>>>>> logger.warning("Can't find image " + objectiveImage.replace("$index", "0")); <<<<<<< ======= public void showDebriefing(GameResult result) { Screen deScreen = nifty.getScreen(SCREEN_DEBRIEFING_ID); Label levelTitle = deScreen.findNiftyControl("dLevelTitle", Label.class); Element mainObjectiveImage = deScreen.findElementById("dMainObjectiveImage"); Element subObjectiveImage = deScreen.findElementById("dSubObjectiveImage"); String objectiveImage = String.format("Textures/Obj_Shots/%s-$index.png", state.selectedLevel.getFileName()); NiftyImage img = null; GameLevel gameLevel = state.selectedLevel.getKwdFile().getGameLevel(); levelTitle.setText(gameLevel.getTitle()); try { img = nifty.createImage(objectiveImage.replace("$index", "0"), false); mainObjectiveImage.getRenderer(ImageRenderer.class).setImage(img); mainObjectiveImage.setWidth(img.getWidth()); mainObjectiveImage.setHeight(img.getHeight()); mainObjectiveImage.show(); } catch (Exception e) { logger.warning("Can't find image " + objectiveImage.replace("$index", "0")); mainObjectiveImage.hide(); } Label totalEvilRating = deScreen.findNiftyControl("totalEvilRating", Label.class); Label overallTotalEvilRating = deScreen.findNiftyControl("overallTotalEvilRating", Label.class); Label specialsFound = deScreen.findNiftyControl("specialsFound", Label.class); subObjectiveImage.hide(); if (state.selectedLevel instanceof Level && ((Level) state.selectedLevel).getType().equals(Level.LevelType.Level)) { try { img = nifty.createImage(objectiveImage.replace("$index", "1"), false); subObjectiveImage.getRenderer(ImageRenderer.class).setImage(img); subObjectiveImage.setWidth(img.getWidth()); subObjectiveImage.setHeight(img.getHeight()); subObjectiveImage.show(); } catch (Exception e) { logger.warning("Can't find image " + objectiveImage.replace("$index", "1")); subObjectiveImage.hide(); } } boolean levelWon = result.getData(GameResult.ResultType.LEVEL_WON); deScreen.findNiftyControl("levelWon", Label.class).setText(levelWon ? "${menu.21}" : "${menu.22}"); int timeTaken = Math.round(result.getData(GameResult.ResultType.TIME_TAKEN)); deScreen.findNiftyControl("timeTaken", Label.class).setText(timeToString(timeTaken)); goToScreen(SCREEN_DEBRIEFING_ID); } private String timeToString(int time) { String result = ""; int days = time / 86400; if (days != 0) { time -= days * 86400; result += days; } int hours = time / 3600; if (days != 0 || hours != 0) { time -= hours * 3600; result += String.format(" %02d", hours); } int minutes = time / 60; if (days != 0 || hours != 0 || minutes != 0) { time -= minutes * 60; result += String.format(":%02d", minutes); } int seconds = time; result += String.format(":%02d", seconds); return result.trim(); } >>>>>>> public void showDebriefing(GameResult result) { Screen deScreen = nifty.getScreen(SCREEN_DEBRIEFING_ID); Label levelTitle = deScreen.findNiftyControl("dLevelTitle", Label.class); Element mainObjectiveImage = deScreen.findElementById("dMainObjectiveImage"); Element subObjectiveImage = deScreen.findElementById("dSubObjectiveImage"); String objectiveImage = String.format("Textures/Obj_Shots/%s-$index.png", state.selectedLevel.getFileName()); NiftyImage img = null; GameLevel gameLevel = state.selectedLevel.getKwdFile().getGameLevel(); levelTitle.setText(gameLevel.getTitle()); try { img = nifty.createImage(objectiveImage.replace("$index", "0"), false); mainObjectiveImage.getRenderer(ImageRenderer.class).setImage(img); mainObjectiveImage.setWidth(img.getWidth()); mainObjectiveImage.setHeight(img.getHeight()); mainObjectiveImage.show(); } catch (Exception e) { logger.warning("Can't find image " + objectiveImage.replace("$index", "0")); mainObjectiveImage.hide(); } Label totalEvilRating = deScreen.findNiftyControl("totalEvilRating", Label.class); Label overallTotalEvilRating = deScreen.findNiftyControl("overallTotalEvilRating", Label.class); Label specialsFound = deScreen.findNiftyControl("specialsFound", Label.class); subObjectiveImage.hide(); if (state.selectedLevel instanceof Level && ((Level) state.selectedLevel).getType().equals(Level.LevelType.Level)) { try { img = nifty.createImage(objectiveImage.replace("$index", "1"), false); subObjectiveImage.getRenderer(ImageRenderer.class).setImage(img); subObjectiveImage.setWidth(img.getWidth()); subObjectiveImage.setHeight(img.getHeight()); subObjectiveImage.show(); } catch (Exception e) { logger.warning("Can't find image " + objectiveImage.replace("$index", "1")); subObjectiveImage.hide(); } } boolean levelWon = result.getData(GameResult.ResultType.LEVEL_WON); deScreen.findNiftyControl("levelWon", Label.class).setText(levelWon ? "${menu.21}" : "${menu.22}"); int timeTaken = Math.round(result.getData(GameResult.ResultType.TIME_TAKEN)); deScreen.findNiftyControl("timeTaken", Label.class).setText(timeToString(timeTaken)); goToScreen(SCREEN_DEBRIEFING_ID); } private String timeToString(int time) { String result = ""; int days = time / 86400; if (days != 0) { time -= days * 86400; result += days; } int hours = time / 3600; if (days != 0 || hours != 0) { time -= hours * 3600; result += String.format(" %02d", hours); } int minutes = time / 60; if (days != 0 || hours != 0 || minutes != 0) { time -= minutes * 60; result += String.format(":%02d", minutes); } int seconds = time; result += String.format(":%02d", seconds); return result.trim(); }
<<<<<<< private void loadSounds() { SoundsLoader.load(kwdFile.getGameLevel().getSoundCategory(), false); List<ISoundable> items = new ArrayList<>(); items.addAll(kwdFile.getCreatureList()); items.addAll(kwdFile.getDoors()); items.addAll(kwdFile.getObjectList()); items.addAll(kwdFile.getKeeperSpells()); items.addAll(kwdFile.getRooms()); items.addAll(kwdFile.getShots()); items.addAll(kwdFile.getTerrainList()); items.addAll(kwdFile.getTraps()); for (ISoundable item : items) { // all in global space SoundsLoader.load(item.getSoundCategory()); } } ======= @Nullable public GameResult getGameResult() { return gameResult; } >>>>>>> private void loadSounds() { SoundsLoader.load(kwdFile.getGameLevel().getSoundCategory(), false); List<ISoundable> items = new ArrayList<>(); items.addAll(kwdFile.getCreatureList()); items.addAll(kwdFile.getDoors()); items.addAll(kwdFile.getObjectList()); items.addAll(kwdFile.getKeeperSpells()); items.addAll(kwdFile.getRooms()); items.addAll(kwdFile.getShots()); items.addAll(kwdFile.getTerrainList()); items.addAll(kwdFile.getTraps()); for (ISoundable item : items) { // all in global space SoundsLoader.load(item.getSoundCategory()); } } @Nullable public GameResult getGameResult() { return gameResult; }
<<<<<<< onStatusMsg("Read Protection removed. Device resets...Wait until it re-enumerates "); ======= tv.setText("Read Protection removed. Device resets...Wait until it re-enumerates "); // XXX This will reset the device >>>>>>> onStatusMsg("Read Protection removed. Device resets...Wait until it re-enumerates "); // XXX This will reset the device <<<<<<< usb.release(); ======= mUsb.release(); // XXX device will self-reset Log.i(TAG, "USB was released"); >>>>>>> mUsb.release(); // XXX device will self-reset Log.i(TAG, "USB was released"); <<<<<<< if ((devicePid != dfuFile.PID) || (deviceVid != dfuFile.VID)) { throw new Exception("PID/VID Miss match"); ======= if ((mDevicePID != mDfuFile.PID) || (mDeviceVID != mDfuFile.VID)) { throw new FormatException("PID/VID Miss match"); >>>>>>> if ((mDevicePID != mDfuFile.PID) || (mDeviceVID != mDfuFile.VID)) { throw new FormatException("PID/VID Miss match"); <<<<<<< while (dfuStatus.bState != STATE_DFU_IDLE) { ======= while (dfuStatus.bState != STATE_DFU_IDLE){ >>>>>>> while (dfuStatus.bState != STATE_DFU_IDLE){ <<<<<<< download(buffer, 5); ======= download(buffer); >>>>>>> download(buffer); <<<<<<< private void download(byte[] data, int length) throws Exception { int len = usb.controlTransfer(DFU_RequestType, DFU_DNLOAD, 0, 0, data, length, 0); ======= private void download(byte[] data) throws Exception { int len = mUsb.controlTransfer(DFU_RequestType, DFU_DNLOAD, 0, 0, data, data.length, 50); >>>>>>> private void download(byte[] data) throws Exception { int len = mUsb.controlTransfer(DFU_RequestType, DFU_DNLOAD, 0, 0, data, data.length, 50); <<<<<<< private void download(byte[] data, int length, int nBlock) throws Exception { int len = usb.controlTransfer(DFU_RequestType, DFU_DNLOAD, nBlock, 0, data, length, 0); ======= private void download(byte[] data, int nBlock) throws Exception { int len = mUsb.controlTransfer(DFU_RequestType, DFU_DNLOAD, nBlock, 0, data, data.length, 0); >>>>>>> private void download(byte[] data, int nBlock) throws Exception { int len = mUsb.controlTransfer(DFU_RequestType, DFU_DNLOAD, nBlock, 0, data, data.length, 0);
<<<<<<< ======= import android.util.Log; import android.widget.TextView; >>>>>>> import android.util.Log; import android.widget.TextView; <<<<<<< import java.util.ArrayList; import java.util.List; ======= import java.nio.charset.Charset; >>>>>>> import java.util.ArrayList; import java.util.List; import java.nio.charset.Charset; <<<<<<< private final int deviceVid; private final int devicePid; private final DfuFile dfuFile; private Usb usb; private int deviceVersion; //STM bootloader version private final List<DfuListener> listeners = new ArrayList<>(); public interface DfuListener { void onStatusMsg(String msg); } ======= public final static int ELEMENT1_OFFSET = 293; // constant offset in file array where image data starts public final static int TARGET_NAME_START = 22; public final static int TARGET_NAME_MAX_END = 276; public final static int TARGET_SIZE = 277; public final static int TARGET_NUM_ELEMENTS = 281; public static final String mInternalFlashString = "@Internal Flash /0x08000000/04*016Kg,01*064Kg,07*128Kg"; // STM32F405RG, 1MB Flash, 192KB SRAM public static final int mInternalFlashSize = 1048575; public static final int mInternalFlashStartAddress = 0x08000000; Usb mUsb; TextView tv; int mDeviceVID; int mDevicePID; int mDeviceBootVersion; //STM bootloader version DfuFile mDfuFile; >>>>>>> public final static int ELEMENT1_OFFSET = 293; // constant offset in file array where image data starts public final static int TARGET_NAME_START = 22; public final static int TARGET_NAME_MAX_END = 276; public final static int TARGET_SIZE = 277; public final static int TARGET_NUM_ELEMENTS = 281; public static final String mInternalFlashString = "@Internal Flash /0x08000000/04*016Kg,01*064Kg,07*128Kg"; // STM32F405RG, 1MB Flash, 192KB SRAM public static final int mInternalFlashSize = 1048575; public static final int mInternalFlashStartAddress = 0x08000000; private final int deviceVid; private final int devicePid; private final DfuFile dfuFile; private Usb usb; private int deviceVersion; //STM bootloader version private final List<DfuListener> listeners = new ArrayList<>(); public interface DfuListener { void onStatusMsg(String msg); } <<<<<<< public void setUsb(Usb usb) { this.usb = usb; this.deviceVersion = this.usb.getDeviceVersion(); ======= public void setDeviceVersion(int deviceVersion) { mDeviceBootVersion = deviceVersion; >>>>>>> public void setUsb(Usb usb) { this.usb = usb; this.deviceVersion = this.usb.getDeviceVersion(); <<<<<<< onStatusMsg("File Path: " + dfuFile.filePath + "\n"); onStatusMsg("File Size: " + dfuFile.buffer.length + " Bytes \n"); onStatusMsg("ElementAddress: 0x" + Integer.toHexString(dfuFile.fwStartAddress)); onStatusMsg("\tElementSize: " + dfuFile.fwLength + " Bytes\n"); onStatusMsg("Start writing file in blocks of " + dfuFile.maxBlockSize + " Bytes \n"); ======= tv.setText("File Path: " + mDfuFile.filePath + "\n"); tv.append("File Size: " + mDfuFile.file.length + " Bytes \n"); tv.append("ElementAddress: 0x" + Integer.toHexString(mDfuFile.elementStartAddress)); tv.append("\tElementSize: " + mDfuFile.elementLength + " Bytes\n"); tv.append("Start writing file in blocks of " + mDfuFile.maxBlockSize + " Bytes \n"); >>>>>>> onStatusMsg("File Path: " + mDfuFile.filePath + "\n"); onStatusMsg("File Size: " + mDfuFile.file.length + " Bytes \n"); onStatusMsg("ElementAddress: 0x" + Integer.toHexString(mDfuFile.elementStartAddress)); onStatusMsg("\tElementSize: " + mDfuFile.elementLength + " Bytes\n"); onStatusMsg("Start writing file in blocks of " + mDfuFile.maxBlockSize + " Bytes \n"); <<<<<<< //onStatusMsg("Detached and starting application"); // detach(dfuFile.fwStartAddress); ======= >>>>>>> <<<<<<< byte[] deviceFirmware = new byte[dfuFile.fwLength]; ======= byte[] deviceFirmware = new byte[mDfuFile.elementLength]; >>>>>>> byte[] deviceFirmware = new byte[dfuFile.fwLength]; <<<<<<< ByteBuffer fileFw = ByteBuffer.wrap(dfuFile.buffer, dfuFile.fwOffset, dfuFile.fwLength); // set offset and limit of firmware ======= ByteBuffer fileFw = ByteBuffer.wrap(mDfuFile.file, ELEMENT1_OFFSET, mDfuFile.elementLength); // set offset and limit of firmware >>>>>>> ByteBuffer fileFw = ByteBuffer.wrap(mDfuFile.file, ELEMENT1_OFFSET, mDfuFile.elementLength); // set offset and limit of firmware <<<<<<< int address = dfuFile.fwStartAddress; // flash start address int bufferOffset = dfuFile.fwOffset; // index offset of buffer int blockSize = dfuFile.maxBlockSize; // max block size byte[] block = new byte[blockSize]; int numBlocks = dfuFile.fwLength / blockSize; ======= int address = mDfuFile.elementStartAddress; // flash start address int fileOffset = ELEMENT1_OFFSET; // index offset of file int blockSize = mDfuFile.maxBlockSize; // max block size byte[] Block = new byte[blockSize]; int NumOfBlocks = mDfuFile.elementLength / blockSize; >>>>>>> int address = mDfuFile.elementStartAddress; // flash start address int fileOffset = ELEMENT1_OFFSET; // index offset of file int blockSize = mDfuFile.maxBlockSize; // max block size byte[] Block = new byte[blockSize]; int NumOfBlocks = mDfuFile.elementLength / blockSize; <<<<<<< int remainder = dfuFile.fwLength - (blockNum * blockSize); ======= int remainder = mDfuFile.elementLength - (blockNum * blockSize); >>>>>>> int remainder = mDfuFile.elementLength - (blockNum * blockSize); <<<<<<< System.arraycopy(dfuFile.buffer, (blockNum * blockSize) + bufferOffset, block, 0, remainder); ======= System.arraycopy(mDfuFile.file, (blockNum * blockSize) + fileOffset, Block, 0, remainder); >>>>>>> System.arraycopy(mDfuFile.file, (blockNum * blockSize) + fileOffset, Block, 0, remainder); <<<<<<< DfuStatus dfuStatus = new DfuStatus(); int maxBlockSize = dfuFile.maxBlockSize; int startAddress = dfuFile.fwStartAddress; ======= DFU_Status dfuStatus = new DFU_Status(); int maxBlockSize = mDfuFile.maxBlockSize; int startAddress = mDfuFile.elementStartAddress; >>>>>>> DFU_Status dfuStatus = new DFU_Status(); int maxBlockSize = mDfuFile.maxBlockSize; int startAddress = mDfuFile.elementStartAddress; <<<<<<< dfuFile.filePath = myFile.toString(); dfuFile.buffer = new byte[(int) myFile.length()]; ======= mDfuFile.filePath = myFile.toString(); mDfuFile.file = new byte[(int) myFile.length()]; >>>>>>> dfuFile.filePath = myFile.toString(); dfuFile.buffer = new byte[(int) myFile.length()]; <<<<<<< //noinspection ResultOfMethodCallIgnored fileInputStream.read(dfuFile.buffer); ======= fileInputStream.read(mDfuFile.file); >>>>>>> fileInputStream.read(mDfuFile.file); <<<<<<< int length = dfuFile.buffer.length; ======= int Length = mDfuFile.file.length; >>>>>>> int Length = mDfuFile.file.length; <<<<<<< crc |= dfuFile.buffer[crcIndex++] & 0xFF; crc |= (dfuFile.buffer[crcIndex++] & 0xFF) << 8; crc |= (dfuFile.buffer[crcIndex++] & 0xFF) << 16; crc |= (dfuFile.buffer[crcIndex] & 0xFF) << 24; ======= crc |= mDfuFile.file[crcIndex++] & 0xFF; crc |= (mDfuFile.file[crcIndex++] & 0xFF) << 8; crc |= (mDfuFile.file[crcIndex++] & 0xFF) << 16; crc |= (mDfuFile.file[crcIndex] & 0xFF) << 24; >>>>>>> crc |= mDfuFile.file[crcIndex++] & 0xFF; crc |= (mDfuFile.file[crcIndex++] & 0xFF) << 8; crc |= (mDfuFile.file[crcIndex++] & 0xFF) << 16; crc |= (mDfuFile.file[crcIndex] & 0xFF) << 24; <<<<<<< if (crc != calculateCRC(dfuFile.buffer)) { ======= if (crc != calculateCRC(mDfuFile.file)) { >>>>>>> if (crc != calculateCRC(mDfuFile.file)) { <<<<<<< String prefix = new String(dfuFile.buffer, 0, 5); ======= String prefix = new String(mDfuFile.file, 0, 5); >>>>>>> String prefix = new String(mDfuFile.file, 0, 5); <<<<<<< if (dfuFile.buffer[5] != 1) { ======= if (mDfuFile.file[5] != 1) { >>>>>>> if (mDfuFile.file[5] != 1) { <<<<<<< String suffix = new String(dfuFile.buffer, length - 8, 3); ======= String suffix = new String(mDfuFile.file, Length - 8, 3); >>>>>>> String suffix = new String(mDfuFile.file, Length - 8, 3); <<<<<<< if ((dfuFile.buffer[length - 5] != 16) || (dfuFile.buffer[length - 10] != 0x1A) || (dfuFile.buffer[length - 9] != 0x01)) { ======= if ((mDfuFile.file[Length - 5] != 16) || (mDfuFile.file[Length - 10] != 0x1A) || (mDfuFile.file[Length - 9] != 0x01)) { >>>>>>> if ((mDfuFile.file[Length - 5] != 16) || (mDfuFile.file[Length - 10] != 0x1A) || (mDfuFile.file[Length - 9] != 0x01)) { <<<<<<< String target = new String(dfuFile.buffer, 11, 6); ======= String target = new String(mDfuFile.file, 11, 6); >>>>>>> String target = new String(mDfuFile.file, 11, 6); <<<<<<< dfuFile.VID = (dfuFile.buffer[length - 11] & 0xFF) << 8; dfuFile.VID |= (dfuFile.buffer[length - 12] & 0xFF); dfuFile.PID = (dfuFile.buffer[length - 13] & 0xFF) << 8; dfuFile.PID |= (dfuFile.buffer[length - 14] & 0xFF); dfuFile.Version = (dfuFile.buffer[length - 15] & 0xFF) << 8; dfuFile.Version |= (dfuFile.buffer[length - 16] & 0xFF); ======= mDfuFile.VID = (mDfuFile.file[Length - 11] & 0xFF) << 8; mDfuFile.VID |= (mDfuFile.file[Length - 12] & 0xFF); mDfuFile.PID = (mDfuFile.file[Length - 13] & 0xFF) << 8; mDfuFile.PID |= (mDfuFile.file[Length - 14] & 0xFF); mDfuFile.BootVersion = (mDfuFile.file[Length - 15] & 0xFF) << 8; mDfuFile.BootVersion |= (mDfuFile.file[Length - 16] & 0xFF); } private int calculateCRC(byte[] FileData) { int crc = -1; for (int i = 0; i < FileData.length - 4; i++) { crc = CrcTable[(crc ^ FileData[i]) & 0xff] ^ (crc >>> 8); } return crc; >>>>>>> mDfuFile.VID = (mDfuFile.file[Length - 11] & 0xFF) << 8; mDfuFile.VID |= (mDfuFile.file[Length - 12] & 0xFF); mDfuFile.PID = (mDfuFile.file[Length - 13] & 0xFF) << 8; mDfuFile.PID |= (mDfuFile.file[Length - 14] & 0xFF); mDfuFile.BootVersion = (mDfuFile.file[Length - 15] & 0xFF) << 8; mDfuFile.BootVersion |= (mDfuFile.file[Length - 16] & 0xFF);
<<<<<<< private static final String MATCHES = "MATCHES"; public static final String IN = " IN "; private static final String OPEN_CURL = "{"; private static final String OPEN_PAR = "("; private static final String CLOSING_CURL = "}"; private static final String CLOSING_PAR = ")"; private static final String COMMA = ","; //private I_OpenehrTerminologyServer<DvCodedText, ID> tsserver = (I_OpenehrTerminologyServer<DvCodedText, ID>) FhirTerminologyServerR4AdaptorImpl.getInstance(null); private List<Object> whereExpression = new ArrayList<>(); @Override public List<Object> visitWhere(AqlParser.WhereContext ctx) { visitIdentifiedExpr(ctx.identifiedExpr()); return whereExpression; } @Override public List<Object> visitIdentifiedExpr(AqlParser.IdentifiedExprContext context) { // List<Object> whereExpression = new ArrayList<>(); for (ParseTree tree : context.children) { if (tree instanceof TerminalNodeImpl) { String what = tree.getText().trim(); whereExpression.add(what); } else if (tree instanceof AqlParser.IdentifiedEqualityContext) { visitIdentifiedEquality((AqlParser.IdentifiedEqualityContext) tree); } } return whereExpression; } @Override public List<Object> visitMatchesOperand(AqlParser.MatchesOperandContext context) { for (ParseTree tree : context.children) { if (tree instanceof AqlParser.ValueListItemsContext) { whereExpression.addAll(visitValueListItems((AqlParser.ValueListItemsContext) tree)); } else if (tree instanceof AqlParser.IdentifiedEqualityContext) { visitIdentifiedEquality((AqlParser.IdentifiedEqualityContext) tree); } ======= private static final String MATCHES = "MATCHES"; public static final String IN = " IN "; private static final String OPEN_CURL = "{"; private static final String OPEN_PAR = "("; private static final String CLOSING_CURL = "}"; private static final String CLOSING_PAR = ")"; private static final String COMMA = ","; private OpenehrTerminologyServer<DvCodedText, ID> tsserver = (OpenehrTerminologyServer<DvCodedText, ID>) new FhirTerminologyServerAdaptorImpl(); private List<Object> whereExpression = new ArrayList<>(); @Override public List<Object> visitWhere(AqlParser.WhereContext ctx) { visitIdentifiedExpr(ctx.identifiedExpr()); return whereExpression; } @Override public List<Object> visitIdentifiedExpr(AqlParser.IdentifiedExprContext context) { // List<Object> whereExpression = new ArrayList<>(); for (ParseTree tree : context.children) { if (tree instanceof TerminalNodeImpl) { String what = tree.getText().trim(); whereExpression.add(what); } else if (tree instanceof AqlParser.IdentifiedEqualityContext) { visitIdentifiedEquality((AqlParser.IdentifiedEqualityContext) tree); } } return whereExpression; } @Override public List<Object> visitMatchesOperand(AqlParser.MatchesOperandContext context) { for (ParseTree tree : context.children) { if (tree instanceof AqlParser.ValueListItemsContext) { whereExpression.addAll(visitValueListItems((AqlParser.ValueListItemsContext) tree)); } else if (tree instanceof AqlParser.IdentifiedEqualityContext) { visitIdentifiedEquality((AqlParser.IdentifiedEqualityContext) tree); } } return whereExpression; } private void parsePathContext(AqlParser.IdentifiedPathContext identifiedPathContext){ if (identifiedPathContext.objectPath()==null) throw new IllegalArgumentException("WHERE variable should be a path, found:'"+identifiedPathContext.getText()+"'"); String path = identifiedPathContext.objectPath().getText(); String identifier = identifiedPathContext.IDENTIFIER().getText(); String alias = null; VariableDefinition variable = new VariableDefinition(path, alias, identifier, false); whereExpression.add(variable); } @Override public List<Object> visitValueListItems(AqlParser.ValueListItemsContext ctx) { List<Object> operand = new ArrayList<>(); for (ParseTree tree : ctx.children) { if (tree instanceof AqlParser.OperandContext) { AqlParser.OperandContext operandContext = (AqlParser.OperandContext) tree; if (operandContext.STRING() != null) operand.add(operandContext.STRING().getText()); else if (operandContext.BOOLEAN() != null) operand.add(operandContext.BOOLEAN().getText()); else if (operandContext.INTEGER() != null) operand.add(operandContext.INTEGER().getText()); else if (operandContext.DATE() != null) operand.add(operandContext.DATE().getText()); else if (operandContext.FLOAT() != null) operand.add(operandContext.FLOAT().getText()); else if (operandContext.invokeOperand() != null) { for(Object obj: visitInvokeOperand(operandContext.invokeOperand())) { operand.add(obj); operand.add(","); } operand.remove(operand.size()-1); }else if (operandContext.PARAMETER() != null) operand.add("** unsupported operand: PARAMETER **"); else operand.add("** unsupported operand: " + operandContext.getText()); operand.add(","); } else if (tree instanceof AqlParser.ValueListItemsContext) { List<Object> token = visitValueListItems((AqlParser.ValueListItemsContext) tree); operand.addAll(token); } } return operand; } @Override public List<Object> visitInvokeOperand(AqlParser.InvokeOperandContext ctx) { System.out.println("inside invoke operand"); return visitChildren(ctx); } @Override public List<Object> visitInvokeExpr(AqlParser.InvokeExprContext ctx) { List<Object> invokeExpr = new ArrayList<>(); assert(ctx.INVOKE().getText().equals("INVOKE")); assert(ctx.OPEN_PAR().getText().equals("(")); assert(ctx.CLOSE_PAR().getText().equals(")")); List<String> codesList = new ArrayList<>(); tsserver.expand((ID)ctx.URIVALUE().getText()).forEach((DvCodedText dvCode) -> {codesList.add(dvCode.getDefiningCode().getCodeString());}); invokeExpr.addAll(codesList); return invokeExpr; >>>>>>> private static final String MATCHES = "MATCHES"; public static final String IN = " IN "; private static final String OPEN_CURL = "{"; private static final String OPEN_PAR = "("; private static final String CLOSING_CURL = "}"; private static final String CLOSING_PAR = ")"; private static final String COMMA = ","; //private I_OpenehrTerminologyServer<DvCodedText, ID> tsserver = (I_OpenehrTerminologyServer<DvCodedText, ID>) FhirTerminologyServerR4AdaptorImpl.getInstance(null); private List<Object> whereExpression = new ArrayList<>(); @Override public List<Object> visitWhere(AqlParser.WhereContext ctx) { visitIdentifiedExpr(ctx.identifiedExpr()); return whereExpression; } @Override public List<Object> visitIdentifiedExpr(AqlParser.IdentifiedExprContext context) { // List<Object> whereExpression = new ArrayList<>(); for (ParseTree tree : context.children) { if (tree instanceof TerminalNodeImpl) { String what = tree.getText().trim(); whereExpression.add(what); } else if (tree instanceof AqlParser.IdentifiedEqualityContext) { visitIdentifiedEquality((AqlParser.IdentifiedEqualityContext) tree); }
<<<<<<< // TODO-314: check if this can be secured using @PreAuthorize to prevent it getting called from another method outside of admin scope // @PreAuthorize("hasRole('ROLE_VIEWER')") @Override public void adminDeleteEhr(UUID ehrId) { I_EhrAccess ehrAccess = I_EhrAccess.retrieveInstance(getDataAccess(), ehrId); ehrAccess.adminDeleteEhr(); } ======= /** * {@inheritDoc} */ @Override public boolean removeDirectory(UUID ehrId) { try { return I_EhrAccess.removeDirectory(getDataAccess(), ehrId); } catch (Exception e) { logger.error( String.format( "Could not remove directory from EHR with id %s.\nReason: %s", ehrId.toString(), e.getMessage() ) ); throw new InternalServerException(e.getMessage(), e); } } >>>>>>> /** * {@inheritDoc} */ @Override public boolean removeDirectory(UUID ehrId) { try { return I_EhrAccess.removeDirectory(getDataAccess(), ehrId); } catch (Exception e) { logger.error( String.format( "Could not remove directory from EHR with id %s.\nReason: %s", ehrId.toString(), e.getMessage() ) ); throw new InternalServerException(e.getMessage(), e); } } // TODO-314: check if this can be secured using @PreAuthorize to prevent it getting called from another method outside of admin scope // @PreAuthorize("hasRole('ROLE_VIEWER')") @Override public void adminDeleteEhr(UUID ehrId) { I_EhrAccess ehrAccess = I_EhrAccess.retrieveInstance(getDataAccess(), ehrId); ehrAccess.adminDeleteEhr(); }
<<<<<<< import org.ehrbase.api.exception.PreconditionFailedException; ======= import org.ehrbase.api.exception.StateConflictException; >>>>>>> import org.ehrbase.api.exception.PreconditionFailedException; import org.ehrbase.api.exception.StateConflictException; <<<<<<< // Check if there is already a DIRECTORY inside this EHR if (this.ehrService.getDirectoryId(ehrId) != null) { throw new DuplicateObjectException( "DIRECTORY", String.format("EHR with id %s already contains a directory.", ehrId.toString()) ); } ======= // Check for duplicate directories if (this.ehrService.getDirectoryId(ehrId) != null) { throw new StateConflictException( String.format("EHR with id %s already contains a directory.", ehrId.toString()) ); } >>>>>>> // Check for duplicate directories if (this.ehrService.getDirectoryId(ehrId) != null) { throw new StateConflictException( String.format("EHR with id %s already contains a directory.", ehrId.toString()) ); }
<<<<<<< import com.mongodb.BasicDBObject; ======= import com.mongodb.CommandResult; >>>>>>> import com.mongodb.BasicDBObject; import com.mongodb.CommandResult; <<<<<<< case "count": doCount(message); break; ======= case "getCollections": getCollections(message); break; case "collectionStats": getCollectionStats(message); break; case "command": runCommand(message); >>>>>>> case "count": doCount(message); break; case "getCollections": getCollections(message); break; case "collectionStats": getCollectionStats(message); break; case "command": runCommand(message);
<<<<<<< * @deprecated Use RedmineManager(String uri) constructor and then setLogin() , setPassword() */ public RedmineManager(String uri, String login, String password) { this(uri); this.login = login; this.password = password; this.useBasicAuth = true; } /** * Creates an issue for a project. * @param projectKey The project "identifier". ======= * Sample usage: * <p/> * <p/> * <pre> * {@code * Issue issueToCreate = new Issue(); * issueToCreate.setSubject("This is the summary line 123"); * Issue newIssue = mgr.createIssue(PROJECT_KEY, issueToCreate); * } * * @param projectKey The project "identifier". This is a string key like "project-ABC", NOT a database numeric ID. >>>>>>> * Sample usage: * <p/> * <p/> * <pre> * {@code * Issue issueToCreate = new Issue(); * issueToCreate.setSubject("This is the summary line 123"); * Issue newIssue = mgr.createIssue(PROJECT_KEY, issueToCreate); * } * * @param projectKey The project "identifier". This is a string key like "project-ABC", NOT a database numeric ID. <<<<<<< /** * @deprecated this method will be deleted in the future releases. use update() method instead * * Note: This method cannot return the updated Issue from Redmine * because the server does not provide any XML in response. * * @param issue the Issue to update on the server. issue.getId() is used for identification. * @throws IOException * @throws AuthenticationException invalid or no API access key is used with the server, which * requires authorization. Check the constructor arguments. * @throws NotFoundException the issue with the required ID is not found * @throws RedmineException */ public void updateIssue(Issue issue) throws IOException, AuthenticationException, NotFoundException, RedmineException { URI uri = getURIConfigurator().getUpdateURI(issue.getClass(), Integer.toString(issue.getId())); HttpPut httpRequest = new HttpPut(uri); // XXX add "notes" xml node. see http://www.redmine.org/wiki/redmine/Rest_Issues String NO_PROJECT_KEY = null; String xmlBody = RedmineXMLGenerator.toXML(NO_PROJECT_KEY, issue); setEntity(httpRequest, xmlBody); getCommunicator().sendRequest(httpRequest); } private void setEntity(HttpEntityEnclosingRequest request, String body) throws UnsupportedEncodingException { logger.debug(body); StringEntity entity = new StringEntity(body, Communicator.CHARSET); ======= private void setEntity(HttpEntityEnclosingRequest request, String xmlBody) throws UnsupportedEncodingException { StringEntity entity = new StringEntity(xmlBody, Communicator.CHARSET); >>>>>>> private void setEntity(HttpEntityEnclosingRequest request, String body) throws UnsupportedEncodingException { StringEntity entity = new StringEntity(body, Communicator.CHARSET);
<<<<<<< import com.wasteofplastic.askyblock.Messages; import com.wasteofplastic.askyblock.PlayerCache; ======= >>>>>>> import com.wasteofplastic.askyblock.PlayerCache;
<<<<<<< if (split[0].equalsIgnoreCase("teamchat")) { if (VaultHelper.checkPerm(player, Settings.PERMPREFIX + "team.chat")) { // Check if this command is on or not if (!Settings.teamChat) { return false; } // Check if in team if (plugin.getPlayers().inTeam(playerUUID)) { // Check if team members are online boolean online = false; for (UUID teamMember : plugin.getPlayers().getMembers(playerUUID)) { if (!teamMember.equals(playerUUID) && plugin.getServer().getPlayer(teamMember) != null) { online = true; } } if (!online) { player.sendMessage(ChatColor.RED + plugin.myLocale(playerUUID).teamChatNoTeamAround); player.sendMessage(ChatColor.GREEN + plugin.myLocale(playerUUID).teamChatStatusOff); plugin.getChatListener().unSetPlayer(playerUUID); return true; } if (plugin.getChatListener().isTeamChat(playerUUID)) { // Toggle player.sendMessage(ChatColor.GREEN + plugin.myLocale(playerUUID).teamChatStatusOff); plugin.getChatListener().unSetPlayer(playerUUID); } else { player.sendMessage(ChatColor.GREEN + plugin.myLocale(playerUUID).teamChatStatusOn); plugin.getChatListener().setPlayer(playerUUID); } } else { player.sendMessage(ChatColor.RED + plugin.myLocale(playerUUID).teamChatNoTeam); } } else { player.sendMessage(ChatColor.RED + plugin.myLocale(playerUUID).errorNoPermission); } return true; } if (split[0].equalsIgnoreCase("ban")) { if (VaultHelper.checkPerm(player, Settings.PERMPREFIX + "island.ban")) { // Just show ban help player.sendMessage(plugin.myLocale(playerUUID).helpColor + "/" + label + " ban <player>: " + ChatColor.WHITE + plugin.myLocale(playerUUID).islandhelpBan); } else { player.sendMessage(plugin.myLocale(playerUUID).errorNoPermission); } ======= if (split[0].equalsIgnoreCase("teamchat")) { if (VaultHelper.checkPerm(player, Settings.PERMPREFIX + "team.chat")) { // Check if this command is on or not if (!Settings.teamChat) { return false; } // Check if in team if (plugin.getPlayers().inTeam(playerUUID)) { // Check if team members are online boolean online = false; for (UUID teamMember : plugin.getPlayers().getMembers(playerUUID)) { if (!teamMember.equals(playerUUID) && plugin.getServer().getPlayer(teamMember) != null) { online = true; } } if (!online) { player.sendMessage(ChatColor.RED + plugin.myLocale(playerUUID).teamChatNoTeamAround); player.sendMessage(ChatColor.GREEN + plugin.myLocale(playerUUID).teamChatStatusOff); plugin.getChatListener().unSetPlayer(playerUUID); return true; } if (plugin.getChatListener().isTeamChat(playerUUID)) { // Toggle player.sendMessage(ChatColor.GREEN + plugin.myLocale(playerUUID).teamChatStatusOff); plugin.getChatListener().unSetPlayer(playerUUID); } else { player.sendMessage(ChatColor.GREEN + plugin.myLocale(playerUUID).teamChatStatusOn); plugin.getChatListener().setPlayer(playerUUID); } } else { player.sendMessage(plugin.myLocale(playerUUID).errorNoTeam); } } else { player.sendMessage(plugin.myLocale(playerUUID).errorNoPermission); } return true; } if (split[0].equalsIgnoreCase("ban")) { if (VaultHelper.checkPerm(player, Settings.PERMPREFIX + "island.ban")) { // Just show ban help player.sendMessage(plugin.myLocale(playerUUID).helpColor + "/" + label + " ban <player>: " + ChatColor.WHITE + plugin.myLocale(playerUUID).islandhelpBan); } else { player.sendMessage(plugin.myLocale(playerUUID).errorNoPermission); } >>>>>>> if (split[0].equalsIgnoreCase("teamchat")) { if (VaultHelper.checkPerm(player, Settings.PERMPREFIX + "team.chat")) { // Check if this command is on or not if (!Settings.teamChat) { return false; } // Check if in team if (plugin.getPlayers().inTeam(playerUUID)) { // Check if team members are online boolean online = false; for (UUID teamMember : plugin.getPlayers().getMembers(playerUUID)) { if (!teamMember.equals(playerUUID) && plugin.getServer().getPlayer(teamMember) != null) { online = true; } } if (!online) { player.sendMessage(ChatColor.RED + plugin.myLocale(playerUUID).teamChatNoTeamAround); player.sendMessage(ChatColor.GREEN + plugin.myLocale(playerUUID).teamChatStatusOff); plugin.getChatListener().unSetPlayer(playerUUID); return true; } if (plugin.getChatListener().isTeamChat(playerUUID)) { // Toggle player.sendMessage(ChatColor.GREEN + plugin.myLocale(playerUUID).teamChatStatusOff); plugin.getChatListener().unSetPlayer(playerUUID); } else { player.sendMessage(ChatColor.GREEN + plugin.myLocale(playerUUID).teamChatStatusOn); plugin.getChatListener().setPlayer(playerUUID); } } else { player.sendMessage(ChatColor.RED + plugin.myLocale(playerUUID).teamChatNoTeam); return true; } } else { player.sendMessage(ChatColor.RED + plugin.myLocale(playerUUID).errorNoPermission); } } if (split[0].equalsIgnoreCase("ban")) { if (VaultHelper.checkPerm(player, Settings.PERMPREFIX + "island.ban")) { // Just show ban help player.sendMessage(plugin.myLocale(playerUUID).helpColor + "/" + label + " ban <player>: " + ChatColor.WHITE + plugin.myLocale(playerUUID).islandhelpBan); } else { player.sendMessage(plugin.myLocale(playerUUID).errorNoPermission); }
<<<<<<< public ImmutableSet<K> __insertAll(final java.util.Set<? extends K> set) { ======= @Override public ImmutableSet<K> __insertAll(final Set<? extends K> set) { >>>>>>> @Override public ImmutableSet<K> __insertAll(final java.util.Set<? extends K> set) { <<<<<<< public ImmutableSet<K> __insertAllEquivalent(final java.util.Set<? extends K> set, ======= @Override public ImmutableSet<K> __insertAllEquivalent(final Set<? extends K> set, >>>>>>> @Override public ImmutableSet<K> __insertAllEquivalent(final java.util.Set<? extends K> set, <<<<<<< public ImmutableSet<K> __removeAll(final java.util.Set<? extends K> set) { ======= @Override public ImmutableSet<K> __removeAll(final Set<? extends K> set) { >>>>>>> @Override public ImmutableSet<K> __removeAll(final java.util.Set<? extends K> set) { <<<<<<< public ImmutableSet<K> __removeAllEquivalent(final java.util.Set<? extends K> set, ======= @Override public ImmutableSet<K> __removeAllEquivalent(final Set<? extends K> set, >>>>>>> @Override public ImmutableSet<K> __removeAllEquivalent(final java.util.Set<? extends K> set, <<<<<<< public ImmutableSet<K> __retainAll(final java.util.Set<? extends K> set) { ======= @Override public ImmutableSet<K> __retainAll(final Set<? extends K> set) { >>>>>>> @Override public ImmutableSet<K> __retainAll(final java.util.Set<? extends K> set) { <<<<<<< /* * TODO: visibility is currently public to allow set-multimap experiments. Must be set back to * `protected` when experiments are finished. */ public /* protected */ boolean contains(final K key, final int keyHash, final int shift) { ======= @Override boolean contains(final K key, final int keyHash, final int shift) { >>>>>>> /* * TODO: visibility is currently public to allow set-multimap experiments. Must be set back to * `protected` when experiments are finished. */ @Override public /* protected */ boolean contains(final K key, final int keyHash, final int shift) { <<<<<<< /* * TODO: visibility is currently public to allow set-multimap experiments. Must be set back to * `protected` when experiments are finished. */ public /* protected */ CompactSetNode<K> updated(final AtomicReference<Thread> mutator, final K key, final int keyHash, ======= @Override CompactSetNode<K> updated(final AtomicReference<Thread> mutator, final K key, final int keyHash, >>>>>>> /* * TODO: visibility is currently public to allow set-multimap experiments. Must be set back to * `protected` when experiments are finished. */ @Override public /* protected */ CompactSetNode<K> updated(final AtomicReference<Thread> mutator, final K key, final int keyHash, <<<<<<< /* * TODO: visibility is currently public to allow set-multimap experiments. Must be set back to * `protected` when experiments are finished. */ public /* protected */ CompactSetNode<K> removed(final AtomicReference<Thread> mutator, final K key, final int keyHash, ======= @Override CompactSetNode<K> removed(final AtomicReference<Thread> mutator, final K key, final int keyHash, >>>>>>> /* * TODO: visibility is currently public to allow set-multimap experiments. Must be set back to * `protected` when experiments are finished. */ @Override public /* protected */ CompactSetNode<K> removed(final AtomicReference<Thread> mutator, final K key, final int keyHash, <<<<<<< /* * TODO: visibility is currently public to allow set-multimap experiments. Must be set back to * `protected` when experiments are finished. */ public /* protected */ boolean contains(final K key, final int keyHash, final int shift) { ======= @Override boolean contains(final K key, final int keyHash, final int shift) { >>>>>>> /* * TODO: visibility is currently public to allow set-multimap experiments. Must be set back to * `protected` when experiments are finished. */ @Override public /* protected */ boolean contains(final K key, final int keyHash, final int shift) { <<<<<<< /* * TODO: visibility is currently public to allow set-multimap experiments. Must be set back to * `protected` when experiments are finished. */ public /* protected */ CompactSetNode<K> updated(final AtomicReference<Thread> mutator, final K key, final int keyHash, ======= @Override CompactSetNode<K> updated(final AtomicReference<Thread> mutator, final K key, final int keyHash, >>>>>>> /* * TODO: visibility is currently public to allow set-multimap experiments. Must be set back to * `protected` when experiments are finished. */ public /* protected */ CompactSetNode<K> updated(final AtomicReference<Thread> mutator, final K key, final int keyHash, <<<<<<< /* * TODO: visibility is currently public to allow set-multimap experiments. Must be set back to * `protected` when experiments are finished. */ public /* protected */ CompactSetNode<K> removed(final AtomicReference<Thread> mutator, final K key, final int keyHash, ======= @Override CompactSetNode<K> removed(final AtomicReference<Thread> mutator, final K key, final int keyHash, >>>>>>> /* * TODO: visibility is currently public to allow set-multimap experiments. Must be set back to * `protected` when experiments are finished. */ @Override public /* protected */ CompactSetNode<K> removed(final AtomicReference<Thread> mutator, final K key, final int keyHash, <<<<<<< public boolean __insertAll(final java.util.Set<? extends K> set) { ======= @Override public boolean __insertAll(final Set<? extends K> set) { >>>>>>> @Override public boolean __insertAll(final java.util.Set<? extends K> set) { <<<<<<< public boolean __insertAllEquivalent(final java.util.Set<? extends K> set, final Comparator<Object> cmp) { ======= @Override public boolean __insertAllEquivalent(final Set<? extends K> set, final Comparator<Object> cmp) { >>>>>>> @Override public boolean __insertAllEquivalent(final java.util.Set<? extends K> set, final Comparator<Object> cmp) { <<<<<<< public boolean __removeAll(final java.util.Set<? extends K> set) { ======= @Override public boolean __removeAll(final Set<? extends K> set) { >>>>>>> @Override public boolean __removeAll(final java.util.Set<? extends K> set) { <<<<<<< public boolean __removeAllEquivalent(final java.util.Set<? extends K> set, final Comparator<Object> cmp) { ======= @Override public boolean __removeAllEquivalent(final Set<? extends K> set, final Comparator<Object> cmp) { >>>>>>> @Override public boolean __removeAllEquivalent(final java.util.Set<? extends K> set, final Comparator<Object> cmp) { <<<<<<< public boolean __retainAll(final java.util.Set<? extends K> set) { ======= @Override public boolean __retainAll(final Set<? extends K> set) { >>>>>>> @Override public boolean __retainAll(final java.util.Set<? extends K> set) {
<<<<<<< import com.here.oksse.OkSse; import com.here.oksse.ServerSentEvent; ======= import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.TestOnly; >>>>>>> import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; <<<<<<< volatile Status mStatus = Status.NOT_CONNECTED; private ServerSentEvent mEventSource; ======= Status mStatus = Status.NOT_CONNECTED; private EventSource mEventSource; >>>>>>> volatile Status mStatus = Status.NOT_CONNECTED; private EventSource mEventSource; <<<<<<< if (mStatus == Status.CONNECTED) { mHasBeenConnected = true; } ======= >>>>>>> <<<<<<< public void onOpen(ServerSentEvent sse, Response response) { Log.v(TAG, "SSEHandler.onOpen: mEventSource=" + (mEventSource == null ? "null" : mEventSource.hashCode()) + ", sse=" + sse.hashCode()); ======= public void onOpen(@NotNull EventSource eventSource, @NotNull Response response) { failureCount = 0; >>>>>>> public void onOpen(@NotNull EventSource eventSource, @NotNull Response response) { failureCount = 0; Log.v(TAG, "SSEHandler.onOpen: mEventSource=" + (mEventSource == null ? "null" : mEventSource.hashCode())); <<<<<<< public void onMessage(ServerSentEvent sse, String id, String event, String message) { Log.v(TAG, "SSEHandler.onMessage: mEventSource=" + (mEventSource == null ? "null" : mEventSource.hashCode()) + ", sse=" + sse.hashCode()); if (mEventSource == sse) { synchronized (mListeners) { for (ISseListener l : mListeners) { if (l instanceof ISseDataListener) { ((ISseDataListener) l).data(message); } } } } else { Log.v(TAG, "ignoring event from old event source!"); ======= public void onClosed(@NotNull EventSource eventSource) { if (mStatus == Status.CONNECTED){ setStatus(Status.NOT_CONNECTED); >>>>>>> public void onClosed(@NotNull EventSource eventSource) { if (mStatus == Status.CONNECTED){ setStatus(Status.NOT_CONNECTED); if (mEventSource != null) { triggerReconnect(); }
<<<<<<< import com.github.skjolberg.packing.PermutationRotationIterator.PermutationRotation; import com.github.skjolberg.packing.PermutationRotationIterator.PermutationRotationState; ======= >>>>>>>
<<<<<<< ======= public int getBoxCount() { int count = 0; for(Level level : levels) { count += level.size(); } return count; } public Dimension getUsedSpace() { Dimension maxBox = new Dimension(); int height = 0; for (Level level : levels) { maxBox = getUsedSpace(level, maxBox, height); height += level.getHeight(); } return maxBox; } private Dimension getUsedSpace(Level level, Dimension maxBox, int height) { for (Placement placement : level) { maxBox = boundingBox(maxBox, getUsedSpace(placement, height)); } return maxBox; } private Dimension getUsedSpace(Placement placement, int height) { final Box box = placement.getBox(); final Space space = placement.getSpace(); return new Dimension( space.getX() + box.getWidth(), space.getY() + box.getDepth(), height + box.getHeight()); } private Dimension boundingBox(final Dimension b1, final Dimension b2) { return new Dimension( max(b1.getWidth(), b2.getWidth()), max(b1.getDepth(), b2.getDepth()), max(b1.getHeight(), b2.getHeight())); } >>>>>>> public Dimension getUsedSpace() { Dimension maxBox = new Dimension(); int height = 0; for (Level level : levels) { maxBox = getUsedSpace(level, maxBox, height); height += level.getHeight(); } return maxBox; } private Dimension getUsedSpace(Level level, Dimension maxBox, int height) { for (Placement placement : level) { maxBox = boundingBox(maxBox, getUsedSpace(placement, height)); } return maxBox; } private Dimension getUsedSpace(Placement placement, int height) { final Box box = placement.getBox(); final Space space = placement.getSpace(); return new Dimension( space.getX() + box.getWidth(), space.getY() + box.getDepth(), height + box.getHeight()); } private Dimension boundingBox(final Dimension b1, final Dimension b2) { return new Dimension( max(b1.getWidth(), b2.getWidth()), max(b1.getDepth(), b2.getDepth()), max(b1.getHeight(), b2.getHeight())); }
<<<<<<< ======= * Mutant factory for constructing an instance with specified {@link ReaderWriterProvider}, * and returning new instance (or, if there would be no change, this instance). * * @deprecated Since 2.11 should register using {@link JacksonJrExtension} */ @Deprecated public JSON with(ReaderWriterProvider rwp) { ValueReaderLocator rloc = _valueReaderLocator.with(rwp); ValueWriterLocator wloc = _valueWriterLocator.with(rwp); if ((rloc == _valueReaderLocator) && (wloc == _valueWriterLocator)) { return this; } return new JSON(this, rloc, wloc); } /** >>>>>>>
<<<<<<< import org.apache.accumulo.core.client.security.tokens.AuthenticationToken.AuthenticationTokenSerializer; import org.apache.accumulo.core.security.Credentials; ======= import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.core.conf.SiteConfiguration; import org.apache.accumulo.core.security.CredentialHelper; >>>>>>> import org.apache.accumulo.core.client.security.tokens.AuthenticationToken.AuthenticationTokenSerializer; import org.apache.accumulo.core.security.Credentials; import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.core.conf.SiteConfiguration; <<<<<<< else if ("ZooKeeperInstance".equals(instanceType)) { String clientConfigString = conf.get(enumToConfKey(implementingClass, InstanceOpts.CLIENT_CONFIG)); if (clientConfigString == null) { String instanceName = conf.get(enumToConfKey(implementingClass, InstanceOpts.NAME)); String zookeepers = conf.get(enumToConfKey(implementingClass, InstanceOpts.ZOO_KEEPERS)); return new ZooKeeperInstance(ClientConfiguration.loadDefault().withInstance(instanceName).withZkHosts(zookeepers)); } else { return new ZooKeeperInstance(ClientConfiguration.deserialize(clientConfigString)); } } else if (instanceType.isEmpty()) ======= else if ("ZooKeeperInstance".equals(instanceType)) { ZooKeeperInstance zki = new ZooKeeperInstance(conf.get(enumToConfKey(implementingClass, InstanceOpts.NAME)), conf.get(enumToConfKey(implementingClass, InstanceOpts.ZOO_KEEPERS))); // Wrap the DefaultConfiguration with a SiteConfiguration AccumuloConfiguration xmlConfig = SiteConfiguration.getInstance(zki.getConfiguration()); zki.setConfiguration(xmlConfig); return zki; } else if (instanceType.isEmpty()) >>>>>>> else if ("ZooKeeperInstance".equals(instanceType)) { ZooKeeperInstance zki; String clientConfigString = conf.get(enumToConfKey(implementingClass, InstanceOpts.CLIENT_CONFIG)); if (clientConfigString == null) { String instanceName = conf.get(enumToConfKey(implementingClass, InstanceOpts.NAME)); String zookeepers = conf.get(enumToConfKey(implementingClass, InstanceOpts.ZOO_KEEPERS)); zki = new ZooKeeperInstance(ClientConfiguration.loadDefault().withInstance(instanceName).withZkHosts(zookeepers)); } else { zki = new ZooKeeperInstance(ClientConfiguration.deserialize(clientConfigString)); } // Wrap the DefaultConfiguration with a SiteConfiguration AccumuloConfiguration xmlConfig = SiteConfiguration.getInstance(zki.getConfiguration()); zki.setConfiguration(xmlConfig); return zki; } else if (instanceType.isEmpty())
<<<<<<< ======= /** * Constructor used when creating instance using {@link Builder}. * * @param b Builder that has configured settings to use. * * @since 2.11 */ >>>>>>> /** * Constructor used when creating instance using {@link Builder}. * * @param b Builder that has configured settings to use. */
<<<<<<< final String INPUT = "{\"a\":[1,2,{\"b\":true},3],\"c\":-2}"; TreeNode node = TREE_CODEC.readTree(_factory.createParser(EMPTY_READ_CONTEXT, INPUT)); JsonParser p = node.traverse(EMPTY_READ_CONTEXT); ======= final String INPUT = "{\"a\":[1,2,{\"b\":true},3],\"c\":-2,\"d\":null}"; TreeNode node = TREE_CODEC.readTree(_factory.createParser(INPUT)); JsonParser p = node.traverse(); >>>>>>> final String INPUT = "{\"a\":[1,2,{\"b\":true},3],\"c\":-2,\"d\":null}"; TreeNode node = TREE_CODEC.readTree(_factory.createParser(EMPTY_READ_CONTEXT, INPUT)); JsonParser p = node.traverse(EMPTY_READ_CONTEXT);
<<<<<<< _reader = (r != null) ? r : _defaultReader(streamF, features, trees, null, null); _writer = (w != null) ? w : _defaultWriter(features, trees, null, null); ======= _valueReaderLocator = base._valueReaderLocator; _valueWriterLocator = base._valueWriterLocator; _reader = r; _writer = w; >>>>>>> _valueReaderLocator = base._valueReaderLocator; _valueWriterLocator = base._valueWriterLocator; _reader = r; _writer = w; <<<<<<< protected JSONReader _defaultReader(TokenStreamFactory streamF, int features, TreeCodec tc, ReaderWriterProvider rwp, ReaderWriterModifier rwm) { return new JSONReader(features, ValueReaderLocator.blueprint(streamF, features, rwp, rwm), tc, CollectionBuilder.defaultImpl(), MapBuilder.defaultImpl()); ======= protected JSON(JSON base, ValueReaderLocator rloc, ValueWriterLocator wloc) { _features = base._features; _jsonFactory = base._jsonFactory; _treeCodec = base._treeCodec; _valueReaderLocator = rloc; _valueWriterLocator = wloc; _reader = base._reader; _writer = base._writer; _prettyPrinter = base._prettyPrinter; } protected JSONReader _defaultReader() { return new JSONReader(CollectionBuilder.defaultImpl(), MapBuilder.defaultImpl()); >>>>>>> protected JSON(JSON base, ValueReaderLocator rloc, ValueWriterLocator wloc) { _features = base._features; _streamFactory = base._streamFactory; _treeCodec = base._treeCodec; _valueReaderLocator = rloc; _valueWriterLocator = wloc; _reader = base._reader; _writer = base._writer; _prettyPrinter = base._prettyPrinter; } protected JSONReader _defaultReader() { return new JSONReader(CollectionBuilder.defaultImpl(), MapBuilder.defaultImpl()); <<<<<<< return _with(_features, _streamFactory, c, _reader, _writer.with(c), _prettyPrinter); ======= return _with(_features, _jsonFactory, c, _reader, _writer, _prettyPrinter); >>>>>>> return _with(_features, _streamFactory, c, _reader, _writer, _prettyPrinter); <<<<<<< return _with(_features, _streamFactory, _treeCodec, r, w, _prettyPrinter); ======= return new JSON(this, rloc, wloc); >>>>>>> return new JSON(this, rloc, wloc); <<<<<<< return _with(_features, _streamFactory, _treeCodec, r, w, _prettyPrinter); ======= return new JSON(this, rloc, wloc); >>>>>>> return new JSON(this, rloc, wloc); <<<<<<< return new JSON(jsonF, trees, features, reader, writer, pp); ======= >>>>>>>
<<<<<<< _reader = (r != null) ? r : _defaultReader(streamF, features, trees, null); _writer = (w != null) ? w : _defaultWriter(features, trees, null); ======= _reader = (r != null) ? r : _defaultReader(features, trees, null, null); _writer = (w != null) ? w : _defaultWriter(features, trees, null, null); >>>>>>> _reader = (r != null) ? r : _defaultReader(streamF, features, trees, null, null); _writer = (w != null) ? w : _defaultWriter(features, trees, null, null); <<<<<<< protected JSONReader _defaultReader(TokenStreamFactory streamF, int features, TreeCodec tc, ReaderWriterProvider rwp) { return new JSONReader(features, ValueReaderLocator.blueprint(streamF, features, rwp), tc, ======= protected JSONReader _defaultReader(int features, TreeCodec tc, ReaderWriterProvider rwp, ReaderWriterModifier rwm) { return new JSONReader(features, ValueReaderLocator.blueprint(features, rwp, rwm), tc, >>>>>>> protected JSONReader _defaultReader(TokenStreamFactory streamF, int features, TreeCodec tc, ReaderWriterProvider rwp, ReaderWriterModifier rwm) { return new JSONReader(features, ValueReaderLocator.blueprint(streamF, features, rwp, rwm), tc,
<<<<<<< import org.apache.accumulo.core.Constants; import org.apache.accumulo.core.util.Base64; ======= >>>>>>> import org.apache.accumulo.core.util.Base64; <<<<<<< + "ICBcICBcCiAgIC8gIC8gICAgXCAgXF8KIHwvICAvICAgICAgXCB8IHwKIHxfXy8gICAgICAgIFx8X3wK").getBytes(Constants.UTF8)), Constants.UTF8)); ======= + "ICBcICBcCiAgIC8gIC8gICAgXCAgXF8KIHwvICAvICAgICAgXCB8IHwKIHxfXy8gICAgICAgIFx8X3wK").getBytes(UTF_8)), UTF_8)); shellState.getReader().printNewline(); >>>>>>> + "ICBcICBcCiAgIC8gIC8gICAgXCAgXF8KIHwvICAvICAgICAgXCB8IHwKIHxfXy8gICAgICAgIFx8X3wK").getBytes(UTF_8)), UTF_8));
<<<<<<< public TargetSettings(String toIp, int port, byte deviceIndex, SensorManager sensorManager, boolean sendOrientation, boolean sendRaw, int sampleRate, boolean debug, IDebugListener debugListener) { ======= public TargetSettings(String toIp, int port, SensorManager sensorManager, boolean sendOrientation, boolean sendRaw, int sampleRate, boolean debug, IDebugListener debugListener, IErrorHandler errorHandler) { >>>>>>> public TargetSettings(String toIp, int port, byte deviceIndex, SensorManager sensorManager, boolean sendOrientation, boolean sendRaw, int sampleRate, boolean debug, IDebugListener debugListener, IErrorHandler errorHandler) {
<<<<<<< if (!APIConstants.APITransportType.WS.toString().equalsIgnoreCase(importedApi.getType())) { String swaggerContent = FileUtils.readFileToString( new File(pathToArchive + APIImportExportConstants.SWAGGER_DEFINITION_LOCATION)); ======= if (!APIConstants.APIType.WS.toString().equalsIgnoreCase(importedApi.getType())) { String swaggerContent = loadSwaggerFile(pathToArchive); >>>>>>> if (!APIConstants.APITransportType.WS.toString().equalsIgnoreCase(importedApi.getType())) { String swaggerContent = loadSwaggerFile(pathToArchive); <<<<<<< if (!APIConstants.APITransportType.WS.toString().equalsIgnoreCase(importedApi.getType())) { String swaggerContent = FileUtils.readFileToString( new File(pathToArchive + APIImportExportConstants.SWAGGER_DEFINITION_LOCATION)); ======= if (!APIConstants.APIType.WS.toString().equalsIgnoreCase(importedApi.getType())) { String swaggerContent = loadSwaggerFile(pathToArchive); >>>>>>> if (!APIConstants.APITransportType.WS.toString().equalsIgnoreCase(importedApi.getType())) { String swaggerContent = loadSwaggerFile(pathToArchive);
<<<<<<< private JSONObject corsConfiguration; private String environment = "Production and Sandbox"; public String getEnvironment() { return environment; } public void setEnvironment(String environment) { this.environment = environment; } ======= private String swagger; >>>>>>> private JSONObject corsConfiguration; private String environment = "Production and Sandbox"; public String getEnvironment() { return environment; } public void setEnvironment(String environment) { this.environment = environment; } private String swagger; <<<<<<< public JSONObject getCorsConfiguration() { return corsConfiguration; } public void setCorsConfiguration(JSONObject corsConfiguration) { this.corsConfiguration = corsConfiguration; } ======= public String getSwagger() { return swagger; } public void setSwagger(String swagger) { this.swagger = swagger; } >>>>>>> public JSONObject getCorsConfiguration() { return corsConfiguration; } public void setCorsConfiguration(JSONObject corsConfiguration) { this.corsConfiguration = corsConfiguration; } public String getSwagger() { return swagger; } public void setSwagger(String swagger) { this.swagger = swagger; }
<<<<<<< /** * This method will create API request. * * @param apiName - Name of the API * @param context - API context * @param endpointUrl - API endpoint URL * @param isCORSEnabled - CORS configurations is enabled * @throws APIManagerIntegrationTestException - Throws if API request cannot be generated. */ public APIRequest(String apiName, String context, URL endpointUrl, boolean isCORSEnabled) throws APIManagerIntegrationTestException { this.name = apiName; this.context = context; try { String endPointString = "{\n" + " \"production_endpoints\": {\n" + " \"template_not_supported\": false,\n" + " \"config\": null,\n" + " \"url\": \"" + endpointUrl + "\"\n" + " },\n" + " \"sandbox_endpoints\": {\n" + " \"url\": \"" + endpointUrl + "\",\n" + " \"config\": null,\n" + " \"template_not_supported\": false\n" + " },\n" + " \"endpoint_type\": \"http\"\n" + "}"; JSONParser parser = new JSONParser(); this.endpoint = (org.json.simple.JSONObject) parser.parse(endPointString); this.corsConfiguration = new JSONObject("{\"corsConfigurationEnabled\" : " + isCORSEnabled + ", " + "\"accessControlAllowOrigins\" : [\"*\"], " + "\"accessControlAllowCredentials\" : true, " + "\"accessControlAllowHeaders\" : " + "[\"Access-Control-Allow-Origin\", \"authorization\", " + "\"Content-Type\"], \"accessControlAllowMethods\" : [\"POST\", " + "\"PATCH\", \"GET\", \"DELETE\", \"OPTIONS\", \"PUT\"]}"); } catch (JSONException | ParseException e) { log.error("JSON construct error", e); throw new APIManagerIntegrationTestException("JSON construct error", e); } } ======= public APIRequest(String apiName, String context, String version, List<String> productionEndpoints, List<String> sandboxEndpoints) throws APIManagerIntegrationTestException { this.name = apiName; this.context = context; this.version = version; String productionEPs = ""; String sandboxEPs = ""; if (productionEndpoints != null) { for (String productionEndpoint : productionEndpoints) { String uri = "{\n" + "\"url\":\"" + productionEndpoint + "\",\n" + "\"config\":null,\n" + "\"template_not_supported\": false\n" + "},"; productionEPs = productionEPs + uri; } productionEPs = "\"production_endpoints\": [\n" + "{\n" + "\"url\": \"" + productionEndpoints.get(0) + "\"}," + productionEPs + "],"; } if (sandboxEndpoints != null) { for (String sandboxEndpoint : sandboxEndpoints) { String uri = "{\n" + "\"url\":\"" + sandboxEndpoint + "\",\n" + "\"config\":null,\n" + "\"template_not_supported\": false\n" + " },"; sandboxEPs = sandboxEPs + uri; } sandboxEPs = "\"sandbox_endpoints\": [\n" + "{\n" + "\"url\": \"" + sandboxEndpoints.get(0) + "\"}," + sandboxEPs + "],"; } try { JSONParser parser = new JSONParser(); this.endpoint = (org.json.simple.JSONObject) parser.parse( "{ \n" + productionEPs + "\"algoCombo\":\"org.apache.synapse.endpoints.algorithms.RoundRobin\",\n" + "\"failOver\":\"False\",\n" + "\"algoClassName\":\"org.apache.synapse.endpoints.algorithms.RoundRobin\",\n" + "\"sessionManagement\":\"\",\n" + sandboxEPs + "\"implementation_status\":\"managed\",\n" + "\"endpoint_type\":\"load_balance\"\n" + "}" ); } catch (JSONException | ParseException e) { log.error("Error when constructing JSON", e); throw new APIManagerIntegrationTestException("Error when constructing JSON", e); } } >>>>>>> public APIRequest(String apiName, String context, String version, List<String> productionEndpoints, List<String> sandboxEndpoints) throws APIManagerIntegrationTestException { this.name = apiName; this.context = context; this.version = version; String productionEPs = ""; String sandboxEPs = ""; if (productionEndpoints != null) { for (String productionEndpoint : productionEndpoints) { String uri = "{\n" + "\"url\":\"" + productionEndpoint + "\",\n" + "\"config\":null,\n" + "\"template_not_supported\": false\n" + "},"; productionEPs = productionEPs + uri; } productionEPs = "\"production_endpoints\": [\n" + "{\n" + "\"url\": \"" + productionEndpoints.get(0) + "\"}," + productionEPs + "],"; } if (sandboxEndpoints != null) { for (String sandboxEndpoint : sandboxEndpoints) { String uri = "{\n" + "\"url\":\"" + sandboxEndpoint + "\",\n" + "\"config\":null,\n" + "\"template_not_supported\": false\n" + " },"; sandboxEPs = sandboxEPs + uri; } sandboxEPs = "\"sandbox_endpoints\": [\n" + "{\n" + "\"url\": \"" + sandboxEndpoints.get(0) + "\"}," + sandboxEPs + "],"; } try { JSONParser parser = new JSONParser(); this.endpoint = (org.json.simple.JSONObject) parser.parse( "{ \n" + productionEPs + "\"algoCombo\":\"org.apache.synapse.endpoints.algorithms.RoundRobin\",\n" + "\"failOver\":\"False\",\n" + "\"algoClassName\":\"org.apache.synapse.endpoints.algorithms.RoundRobin\",\n" + "\"sessionManagement\":\"\",\n" + sandboxEPs + "\"implementation_status\":\"managed\",\n" + "\"endpoint_type\":\"load_balance\"\n" + "}" ); } catch (JSONException | ParseException e) { log.error("Error when constructing JSON", e); throw new APIManagerIntegrationTestException("Error when constructing JSON", e); } } /** * This method will create API request. * * @param apiName - Name of the API * @param context - API context * @param endpointUrl - API endpoint URL * @param isCORSEnabled - CORS configurations is enabled * @throws APIManagerIntegrationTestException - Throws if API request cannot be generated. */ public APIRequest(String apiName, String context, URL endpointUrl, boolean isCORSEnabled) throws APIManagerIntegrationTestException { this.name = apiName; this.context = context; try { String endPointString = "{\n" + " \"production_endpoints\": {\n" + " \"template_not_supported\": false,\n" + " \"config\": null,\n" + " \"url\": \"" + endpointUrl + "\"\n" + " },\n" + " \"sandbox_endpoints\": {\n" + " \"url\": \"" + endpointUrl + "\",\n" + " \"config\": null,\n" + " \"template_not_supported\": false\n" + " },\n" + " \"endpoint_type\": \"http\"\n" + "}"; JSONParser parser = new JSONParser(); this.endpoint = (org.json.simple.JSONObject) parser.parse(endPointString); this.corsConfiguration = new JSONObject("{\"corsConfigurationEnabled\" : " + isCORSEnabled + ", " + "\"accessControlAllowOrigins\" : [\"*\"], " + "\"accessControlAllowCredentials\" : true, " + "\"accessControlAllowHeaders\" : " + "[\"Access-Control-Allow-Origin\", \"authorization\", " + "\"Content-Type\"], \"accessControlAllowMethods\" : [\"POST\", " + "\"PATCH\", \"GET\", \"DELETE\", \"OPTIONS\", \"PUT\"]}"); } catch (JSONException | ParseException e) { log.error("JSON construct error", e); throw new APIManagerIntegrationTestException("JSON construct error", e); } }
<<<<<<< "DigestAuthAPP", "Unlimited"); waitForAPIDeploymentSync(providerName, apiName, apiVersion, APIMIntegrationConstants.IS_API_EXISTS); ======= "DigestAuthAPP", APIMIntegrationConstants.API_TIER.UNLIMITED); >>>>>>> "DigestAuthAPP", APIMIntegrationConstants.API_TIER.UNLIMITED); waitForAPIDeploymentSync(providerName, apiName, apiVersion, APIMIntegrationConstants.IS_API_EXISTS);
<<<<<<< configureForEnvironment(cfg, createSharedTestDir(SimpleMacIT.class.getName() + "-ssl")); ======= cfg.setProperty(Property.GC_FILE_ARCHIVE, Boolean.TRUE.toString()); configureForEnvironment(cfg, SimpleMacIT.class, createSharedTestDir(SimpleMacIT.class.getName() + "-ssl")); >>>>>>> cfg.setProperty(Property.GC_FILE_ARCHIVE, Boolean.TRUE.toString()); configureForEnvironment(cfg, createSharedTestDir(SimpleMacIT.class.getName() + "-ssl"));
<<<<<<< String[] chosenStrings = FileDialogs.getMultipleFiles(frame, ======= String[] chosen = FileDialogs.getMultipleFiles(frame, >>>>>>> String[] chosenStrings = FileDialogs.getMultipleFiles(frame, <<<<<<< ======= >>>>>>>
<<<<<<< import net.sf.jabref.exporter.*; import net.sf.jabref.exporter.layout.Layout; import net.sf.jabref.exporter.layout.LayoutHelper; import net.sf.jabref.external.*; import net.sf.jabref.gui.groups.GroupAddRemoveDialog; import net.sf.jabref.gui.groups.GroupMatcher; import net.sf.jabref.gui.groups.GroupSelector; import net.sf.jabref.gui.groups.GroupTreeNodeViewModel; ======= import net.sf.jabref.exporter.BibDatabaseWriter; import net.sf.jabref.exporter.ExportToClipboardAction; import net.sf.jabref.exporter.SaveDatabaseAction; import net.sf.jabref.exporter.SaveException; import net.sf.jabref.exporter.SavePreferences; import net.sf.jabref.exporter.SaveSession; import net.sf.jabref.external.AttachFileAction; import net.sf.jabref.external.ExternalFileMenuItem; import net.sf.jabref.external.ExternalFileType; import net.sf.jabref.external.ExternalFileTypes; import net.sf.jabref.external.FindFullTextAction; import net.sf.jabref.external.RegExpFileSearch; import net.sf.jabref.external.SynchronizeFileField; import net.sf.jabref.external.WriteXMPAction; import net.sf.jabref.groups.GroupSelector; import net.sf.jabref.groups.GroupTreeNode; >>>>>>> import net.sf.jabref.exporter.BibDatabaseWriter; import net.sf.jabref.exporter.ExportToClipboardAction; import net.sf.jabref.exporter.SaveDatabaseAction; import net.sf.jabref.exporter.SaveException; import net.sf.jabref.exporter.SavePreferences; import net.sf.jabref.exporter.SaveSession; import net.sf.jabref.external.AttachFileAction; import net.sf.jabref.external.ExternalFileMenuItem; import net.sf.jabref.external.ExternalFileType; import net.sf.jabref.external.ExternalFileTypes; import net.sf.jabref.external.FindFullTextAction; import net.sf.jabref.external.RegExpFileSearch; import net.sf.jabref.external.SynchronizeFileField; import net.sf.jabref.external.WriteXMPAction; <<<<<<< final TreePath path = frame.groupSelector.getSelectionPath(); final GroupTreeNodeViewModel node = path == null ? null : (GroupTreeNodeViewModel) path.getLastPathComponent(); ======= final TreePath path = frame.getGroupSelector().getSelectionPath(); final GroupTreeNode node = path == null ? null : (GroupTreeNode) path.getLastPathComponent(); >>>>>>> final TreePath path = frame.getGroupSelector().getSelectionPath(); final GroupTreeNodeViewModel node = path == null ? null : (GroupTreeNodeViewModel) path.getLastPathComponent();
<<<<<<< public static final String SEARCH_PANE_POS_Y = "searchPanePosY"; public static final String SEARCH_PANE_POS_X = "searchPanePosX"; public static final String SEARCH_HIGHLIGHT_WORDS = "highLightWords"; public static final String SEARCH_REG_EXP = "regExpSearch"; public static final String SEARCH_SELECT_MATCHES = "selectS"; ======= public static final String HIGH_LIGHT_WORDS = "highLightWords"; public static final String REG_EXP_SEARCH = "regExpSearch"; public static final String SELECT_S = "selectS"; >>>>>>> public static final String SEARCH_PANE_POS_Y = "searchPanePosY"; public static final String SEARCH_PANE_POS_X = "searchPanePosX"; public static final String SEARCH_HIGHLIGHT_WORDS = "highLightWords"; public static final String SEARCH_REG_EXP = "regExpSearch"; public static final String SEARCH_SELECT_MATCHES = "selectS"; <<<<<<< public static final String SEARCH_MODE_GLOBAL = "searchAllBases"; public static final String SEARCH_MODE_RESULTS_IN_DIALOG = "showSearchInDialog"; public static final String SEARCH_MODE_FLOAT = "floatSearch"; ======= public static final String SEARCH_ALL_BASES = "searchAllBases"; public static final String SHOW_SEARCH_IN_DIALOG = "showSearchInDialog"; public static final String FLOAT_SEARCH = "floatSearch"; >>>>>>> public static final String SEARCH_MODE_GLOBAL = "searchAllBases"; public static final String SEARCH_MODE_RESULTS_IN_DIALOG = "showSearchInDialog"; public static final String SEARCH_MODE_FLOAT = "floatSearch"; <<<<<<< defaults.put(SEARCH_SELECT_MATCHES, Boolean.FALSE); defaults.put(SEARCH_REG_EXP, Boolean.TRUE); defaults.put(SEARCH_HIGHLIGHT_WORDS, Boolean.TRUE); defaults.put(SEARCH_PANE_POS_X, 0); defaults.put(SEARCH_PANE_POS_Y, 0); ======= defaults.put(SELECT_S, Boolean.FALSE); defaults.put(REG_EXP_SEARCH, Boolean.TRUE); defaults.put(HIGH_LIGHT_WORDS, Boolean.TRUE); >>>>>>> defaults.put(SEARCH_SELECT_MATCHES, Boolean.FALSE); defaults.put(SEARCH_REG_EXP, Boolean.TRUE); defaults.put(SEARCH_HIGHLIGHT_WORDS, Boolean.TRUE); defaults.put(SEARCH_PANE_POS_X, 0); defaults.put(SEARCH_PANE_POS_Y, 0); <<<<<<< defaults.put(SEARCH_BAR_VISIBLE, Boolean.TRUE); defaults.put(DEFAULT_ENCODING, System.getProperty("file.encoding")); ======= defaults.put(SEARCH_PANEL_VISIBLE, Boolean.FALSE); defaults.put(DEFAULT_ENCODING, "UTF-8"); >>>>>>> defaults.put(SEARCH_BAR_VISIBLE, Boolean.TRUE); defaults.put(DEFAULT_ENCODING, "UTF-8"); <<<<<<< defaults.put(SEARCH_MODE_FLOAT, Boolean.TRUE); defaults.put(SEARCH_MODE_RESULTS_IN_DIALOG, Boolean.FALSE); defaults.put(SEARCH_MODE_GLOBAL, Boolean.FALSE); defaults.put(DEFAULT_LABEL_PATTERN, "[auth][year]"); ======= defaults.put(FLOAT_SEARCH, Boolean.TRUE); defaults.put(SHOW_SEARCH_IN_DIALOG, Boolean.FALSE); defaults.put(SEARCH_ALL_BASES, Boolean.FALSE); defaults.put(DEFAULT_LABEL_PATTERN, "[authors3][year]"); >>>>>>> defaults.put(SEARCH_MODE_FLOAT, Boolean.TRUE); defaults.put(SEARCH_MODE_RESULTS_IN_DIALOG, Boolean.FALSE); defaults.put(SEARCH_MODE_GLOBAL, Boolean.FALSE); defaults.put(DEFAULT_LABEL_PATTERN, "[authors3][year]");
<<<<<<< import org.jabref.model.strings.StringUtil; ======= import org.jabref.model.metadata.FileDirectoryPreferences; >>>>>>> import org.jabref.model.strings.StringUtil; import org.jabref.model.metadata.FileDirectoryPreferences; <<<<<<< public LinkedFileViewModel(LinkedFile linkedFile, BibEntry entry, BibDatabaseContext databaseContext, DialogService dialogService, TaskExecutor taskExecutor) { ======= public LinkedFileViewModel(LinkedFile linkedFile, BibEntry entry, BibDatabaseContext databaseContext, TaskExecutor taskExecutor) { this(linkedFile, entry, databaseContext, taskExecutor, new FXDialogService()); } protected LinkedFileViewModel(LinkedFile linkedFile, BibEntry entry, BibDatabaseContext databaseContext, TaskExecutor taskExecutor, DialogService dialogService) { >>>>>>> public LinkedFileViewModel(LinkedFile linkedFile, BibEntry entry, BibDatabaseContext databaseContext, DialogService dialogService, TaskExecutor taskExecutor) {
<<<<<<< expected.remove(PagedSearchBasedParserFetcher.class); expected.remove(PagedSearchBasedFetcher.class); ======= // Remove GROBID, because we don't want to show this to the user expected.remove(GrobidCitationFetcher.class); >>>>>>> expected.remove(PagedSearchBasedParserFetcher.class); expected.remove(PagedSearchBasedFetcher.class); // Remove GROBID, because we don't want to show this to the user expected.remove(GrobidCitationFetcher.class);
<<<<<<< public static Pattern getPatternForWords(List<String> wordsToHighlight) { if (wordsToHighlight == null || wordsToHighlight.isEmpty() || wordsToHighlight.get(0).isEmpty()) { ======= public static Pattern getPatternForWords(ArrayList<String> words) { if ((words == null) || words.isEmpty() || words.get(0).isEmpty()) { >>>>>>> public static Pattern getPatternForWords(List<String> words) { if ((words == null) || words.isEmpty() || words.get(0).isEmpty()) {
<<<<<<< import com.google.common.eventbus.Subscribe; import com.jgoodies.looks.HeaderStyle; import com.jgoodies.looks.Options; ======= import java.awt.BorderLayout; import java.awt.Component; import java.awt.Container; import java.awt.Cursor; import java.awt.FlowLayout; import java.awt.Frame; import java.awt.GraphicsEnvironment; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.File; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.TimerTask; import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.Icon; import javax.swing.JButton; import javax.swing.JCheckBoxMenuItem; import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPopupMenu; import javax.swing.JProgressBar; import javax.swing.JSplitPane; import javax.swing.JToggleButton; import javax.swing.KeyStroke; import javax.swing.MenuElement; import javax.swing.SwingConstants; import javax.swing.SwingUtilities; import javax.swing.TransferHandler; import javax.swing.UIManager; import javax.swing.WindowConstants; >>>>>>> import java.awt.BorderLayout; import java.awt.Component; import java.awt.Container; import java.awt.Cursor; import java.awt.FlowLayout; import java.awt.Frame; import java.awt.GraphicsEnvironment; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.File; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.TimerTask; import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.Icon; import javax.swing.JButton; import javax.swing.JCheckBoxMenuItem; import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPopupMenu; import javax.swing.JProgressBar; import javax.swing.JSplitPane; import javax.swing.JToggleButton; import javax.swing.KeyStroke; import javax.swing.MenuElement; import javax.swing.SwingConstants; import javax.swing.SwingUtilities; import javax.swing.TransferHandler; import javax.swing.UIManager; import javax.swing.WindowConstants; <<<<<<< import javafx.embed.swing.SwingNode; import javafx.scene.control.Button; import javafx.scene.control.SplitPane; import javafx.scene.layout.BorderPane; import javafx.scene.layout.StackPane; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; ======= import javafx.collections.ListChangeListener; import javafx.embed.swing.JFXPanel; import javafx.scene.Scene; import javafx.scene.control.Tab; import javafx.scene.control.TabPane; import javafx.scene.control.Tooltip; >>>>>>> import javafx.collections.ListChangeListener; import javafx.embed.swing.JFXPanel; import javafx.scene.Scene; import javafx.scene.control.Tab; import javafx.scene.control.TabPane; import javafx.scene.control.Tooltip; <<<<<<< ======= import com.google.common.eventbus.Subscribe; import org.fxmisc.easybind.EasyBind; import org.slf4j.Logger; import org.slf4j.LoggerFactory; >>>>>>> import com.google.common.eventbus.Subscribe; import org.fxmisc.easybind.EasyBind; import org.slf4j.Logger; import org.slf4j.LoggerFactory; <<<<<<< public class JabRefFrame extends BorderPane implements OutputPrinter { private static final Log LOGGER = LogFactory.getLog(JabRefFrame.class); ======= public class JabRefFrame extends JFrame implements OutputPrinter { private static final Logger LOGGER = LoggerFactory.getLogger(JabRefFrame.class); >>>>>>> public class JabRefFrame extends BorderPane implements OutputPrinter { private static final Logger LOGGER = LoggerFactory.getLogger(JabRefFrame.class); <<<<<<< //splitPane.setDividerSize(2); //splitPane.setBorder(null); setCenter(splitPane); StackPane header = new StackPane(); header.setId("header"); header.setPrefHeight(50); header.setStyle("-fx-background-color: #4d4674; -fx-text-fill: white;"); setTop(header); SwingNode swingTabbedPane = new SwingNode(); SwingNode swingSidePane = new SwingNode(); SwingUtilities.invokeLater(() -> { swingTabbedPane.setContent(tabbedPane); swingSidePane.setContent(sidePaneManager.getPanel()); }); StackPane centerPane = new StackPane(); centerPane.getChildren().addAll(swingTabbedPane, new Button("test")); splitPane.getItems().addAll(swingSidePane, swingTabbedPane); ======= splitPane.setDividerSize(2); splitPane.setBorder(null); JFXPanel tabbedPaneContainer = CustomJFXPanel.wrap(new Scene(tabbedPane)); // TODO: Remove this hack as soon as toolbar is implemented in JavaFX and these events are no longer captured globally tabbedPaneContainer.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { // We need to consume a few events that have a global listener // Otherwise, they propagate to the JFrame (i.e. "Ctrl + A" in the entry editor still triggers the "Select all" action) Optional<KeyBinding> keyBinding = Globals.getKeyPrefs().mapToKeyBinding(e); if (keyBinding.isPresent()) { switch (keyBinding.get()) { case CUT: case COPY: case PASTE: case DELETE_ENTRY: case SELECT_ALL: e.consume(); break; default: //do nothing } } } }); splitPane.setRightComponent(tabbedPaneContainer); splitPane.setLeftComponent(sidePaneManager.getPanel()); getContentPane().add(splitPane, BorderLayout.CENTER); >>>>>>> splitPane.setDividerSize(2); splitPane.setBorder(null); JFXPanel tabbedPaneContainer = CustomJFXPanel.wrap(new Scene(tabbedPane)); // TODO: Remove this hack as soon as toolbar is implemented in JavaFX and these events are no longer captured globally tabbedPaneContainer.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { // We need to consume a few events that have a global listener // Otherwise, they propagate to the JFrame (i.e. "Ctrl + A" in the entry editor still triggers the "Select all" action) Optional<KeyBinding> keyBinding = Globals.getKeyPrefs().mapToKeyBinding(e); if (keyBinding.isPresent()) { switch (keyBinding.get()) { case CUT: case COPY: case PASTE: case DELETE_ENTRY: case SELECT_ALL: e.consume(); break; default: //do nothing } } } }); splitPane.setRightComponent(tabbedPaneContainer); splitPane.setLeftComponent(sidePaneManager.getPanel()); getContentPane().add(splitPane, BorderLayout.CENTER); StackPane header = new StackPane(); header.setId("header"); header.setPrefHeight(50); header.setStyle("-fx-background-color: #4d4674; -fx-text-fill: white;"); setTop(header); SwingNode swingTabbedPane = new SwingNode(); SwingNode swingSidePane = new SwingNode(); SwingUtilities.invokeLater(() -> { swingTabbedPane.setContent(tabbedPane); swingSidePane.setContent(sidePaneManager.getPanel()); }); StackPane centerPane = new StackPane(); centerPane.getChildren().addAll(swingTabbedPane, new Button("test")); splitPane.getItems().addAll(swingSidePane, swingTabbedPane);
<<<<<<< factory.createMenuItem(StandardActions.MERGE_ENTRIES, new MergeEntriesAction(this, dialogService, stateManager)), ======= >>>>>>> factory.createMenuItem(StandardActions.MERGE_ENTRIES, new MergeEntriesAction(this, dialogService, stateManager)), <<<<<<< factory.createMenuItem(StandardActions.SEND_AS_EMAIL, new SendAsEMailAction(dialogService, stateManager)), pushToApplicationMenuItem, factory.createSubMenu(StandardActions.ABBREVIATE, factory.createMenuItem(StandardActions.ABBREVIATE_DEFAULT, new OldDatabaseCommandWrapper(Actions.ABBREVIATE_DEFAULT, this, stateManager)), factory.createMenuItem(StandardActions.ABBREVIATE_MEDLINE, new OldDatabaseCommandWrapper(Actions.ABBREVIATE_MEDLINE, this, stateManager)), factory.createMenuItem(StandardActions.ABBREVIATE_SHORTEST_UNIQUE, new OldDatabaseCommandWrapper(Actions.ABBREVIATE_SHORTEST_UNIQUE, this, stateManager))), factory.createMenuItem(StandardActions.UNABBREVIATE, new OldDatabaseCommandWrapper(Actions.UNABBREVIATE, this, stateManager)) ======= factory.createMenuItem(StandardActions.SEND_AS_EMAIL, new OldDatabaseCommandWrapper(Actions.SEND_AS_EMAIL, this, stateManager)), pushToApplicationMenuItem >>>>>>> factory.createMenuItem(StandardActions.SEND_AS_EMAIL, new SendAsEMailAction(dialogService, stateManager)), pushToApplicationMenuItem